@tsuga/cli 1.21.0 → 1.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +29 -29
- package/package.json +3 -1
package/dist/cli.js
CHANGED
|
@@ -24,34 +24,34 @@ Expecting one of '${o.join("', '")}'`);return this._lifeCycleHooks[t]?this._life
|
|
|
24
24
|
`),this.outputHelp({error:!0}));let o=n||{},i=o.exitCode||1,a=o.code||"commander.error";this._exit(i,a,t)}_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in le.default.env){let n=t.attributeName();(this.getOptionValue(n)===void 0||["default","config","env"].includes(this.getOptionValueSource(n)))&&(t.required||t.optional?this.emit(`optionEnv:${t.name()}`,le.default.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new gc(this.options),n=o=>this.getOptionValue(o)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(o));this.options.filter(o=>o.implied!==void 0&&n(o.attributeName())&&t.valueFromOption(this.getOptionValue(o.attributeName()),o)).forEach(o=>{Object.keys(o.implied).filter(i=>!n(i)).forEach(i=>{this.setOptionValueWithSource(i,o.implied[i],"implied")})})}missingArgument(t){let n=`error: missing required argument '${t}'`;this.error(n,{code:"commander.missingArgument"})}optionMissingArgument(t){let n=`error: option '${t.flags}' argument missing`;this.error(n,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){let n=`error: required option '${t.flags}' not specified`;this.error(n,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,n){let o=c=>{let l=c.attributeName(),m=this.getOptionValue(l),f=this.options.find(E=>E.negate&&l===E.attributeName()),h=this.options.find(E=>!E.negate&&l===E.attributeName());return f&&(f.presetArg===void 0&&m===!1||f.presetArg!==void 0&&m===f.presetArg)?f:h||c},i=c=>{let l=o(c),m=l.attributeName();return this.getOptionValueSource(m)==="env"?`environment variable '${l.envVar}'`:`option '${l.flags}'`},a=`error: ${i(t)} cannot be used with ${i(n)}`;this.error(a,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let n="";if(t.startsWith("--")&&this._showSuggestionAfterError){let i=[],a=this;do{let c=a.createHelp().visibleOptions(a).filter(l=>l.long).map(l=>l.long);i=i.concat(c),a=a.parent}while(a&&!a._enablePositionalOptions);n=Sl(t,i)}let o=`error: unknown option '${t}'${n}`;this.error(o,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;let n=this.registeredArguments.length,o=n===1?"":"s",i=t.length,a=this.parent?` for '${this.name()}'`:"",c=t.join(", "),l=`error: too many arguments${a}. Expected ${n} argument${o} but got ${i}: ${c}.`;this.error(l,{code:"commander.excessArguments"})}unknownCommand(){let t=this.args[0],n="";if(this._showSuggestionAfterError){let i=[];this.createHelp().visibleCommands(this).forEach(a=>{i.push(a.name()),a.alias()&&i.push(a.alias())}),n=Sl(t,i)}let o=`error: unknown command '${t}'${n}`;this.error(o,{code:"commander.unknownCommand"})}version(t,n,o){if(t===void 0)return this._version;this._version=t,n=n||"-V, --version",o=o||"output the version number";let i=this.createOption(n,o);return this._versionOptionName=i.attributeName(),this._registerOption(i),this.on("option:"+i.name(),()=>{this._outputConfiguration.writeOut(`${t}
|
|
25
25
|
`),this._exit(0,"commander.version",t)}),this}description(t,n){return t===void 0&&n===void 0?this._description:(this._description=t,n&&(this._argsDescription=n),this)}summary(t){return t===void 0?this._summary:(this._summary=t,this)}alias(t){if(t===void 0)return this._aliases[0];let n=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(n=this.commands[this.commands.length-1]),t===n._name)throw new Error("Command alias can't be the same as its name");let o=this.parent?._findCommand(t);if(o){let i=[o.name()].concat(o.aliases()).join("|");throw new Error(`cannot add alias '${t}' to command '${this.name()}' as already have command '${i}'`)}return n._aliases.push(t),this}aliases(t){return t===void 0?this._aliases:(t.forEach(n=>this.alias(n)),this)}usage(t){if(t===void 0){if(this._usage)return this._usage;let n=this.registeredArguments.map(o=>fc(o));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?n:[]).join(" ")}return this._usage=t,this}name(t){return t===void 0?this._name:(this._name=t,this)}helpGroup(t){return t===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=t,this)}commandsGroup(t){return t===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=t,this)}optionsGroup(t){return t===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=t,this)}_initOptionGroup(t){this._defaultOptionGroup&&!t.helpGroupHeading&&t.helpGroup(this._defaultOptionGroup)}_initCommandGroup(t){this._defaultCommandGroup&&!t.helpGroup()&&t.helpGroup(this._defaultCommandGroup)}nameFromFilename(t){return this._name=cr.default.basename(t,cr.default.extname(t)),this}executableDir(t){return t===void 0?this._executableDir:(this._executableDir=t,this)}helpInformation(t){let n=this.createHelp(),o=this._getOutputContext(t);n.prepareContext({error:o.error,helpWidth:o.helpWidth,outputHasColors:o.hasColors});let i=n.formatHelp(this,n);return o.hasColors?i:this._outputConfiguration.stripColor(i)}_getOutputContext(t){t=t||{};let n=!!t.error,o,i,a;return n?(o=l=>this._outputConfiguration.writeErr(l),i=this._outputConfiguration.getErrHasColors(),a=this._outputConfiguration.getErrHelpWidth()):(o=l=>this._outputConfiguration.writeOut(l),i=this._outputConfiguration.getOutHasColors(),a=this._outputConfiguration.getOutHelpWidth()),{error:n,write:l=>(i||(l=this._outputConfiguration.stripColor(l)),o(l)),hasColors:i,helpWidth:a}}outputHelp(t){let n;typeof t=="function"&&(n=t,t=void 0);let o=this._getOutputContext(t),i={error:o.error,write:o.write,command:this};this._getCommandAndAncestors().reverse().forEach(c=>c.emit("beforeAllHelp",i)),this.emit("beforeHelp",i);let a=this.helpInformation({error:o.error});if(n&&(a=n(a),typeof a!="string"&&!Buffer.isBuffer(a)))throw new Error("outputHelp callback must return a string or a Buffer");o.write(a),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",i),this._getCommandAndAncestors().forEach(c=>c.emit("afterAllHelp",i))}helpOption(t,n){return typeof t=="boolean"?(t?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(t??"-h, --help",n??"display help for command"),(t||n)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(t){return this._helpOption=t,this._initOptionGroup(t),this}help(t){this.outputHelp(t);let n=Number(le.default.exitCode??0);n===0&&t&&typeof t!="function"&&t.error&&(n=1),this._exit(n,"commander.help","(outputHelp)")}addHelpText(t,n){let o=["beforeAll","before","after","afterAll"];if(!o.includes(t))throw new Error(`Unexpected value for position to addHelpText.
|
|
26
26
|
Expecting one of '${o.join("', '")}'`);let i=`${t}Help`;return this.on(i,a=>{let c;typeof n=="function"?c=n({error:a.error,command:a.command}):c=n,c&&a.write(`${c}
|
|
27
|
-
`)}),this}_outputHelpIfRequested(t){let n=this._getHelpOption();n&&t.find(i=>n.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function vh(e){return e.map(t=>{if(!t.startsWith("--inspect"))return t;let n,o="127.0.0.1",i="9229",a;return(a=t.match(/^(--inspect(-brk)?)$/))!==null?n=a[1]:(a=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(n=a[1],/^\d+$/.test(a[3])?i=a[3]:o=a[3]):(a=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(n=a[1],o=a[3],i=a[4]),n&&i!=="0"?`${n}=${o}:${parseInt(i)+1}`:t})}function Nh(){if(le.default.env.NO_COLOR||le.default.env.FORCE_COLOR==="0"||le.default.env.FORCE_COLOR==="false")return!1;if(le.default.env.FORCE_COLOR||le.default.env.CLICOLOR_FORCE!==void 0)return!0}var f5=new xo;function tt(e){throw new Error(`assertUnreachable: ${JSON.stringify(e,null,2)}`)}var Fk=Math.pow(10,8)*24*60*60*1e3,y5=-Fk;var Mh=864e5,Dh=6e4,Gh=36e5;var qk=3600;var $h=qk*24,T5=$h*7,Bk=$h*365.2425,Hk=Bk/12,E5=Hk*3,Al=Symbol.for("constructDateFrom");function Jt(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Al in e?e[Al](t):e instanceof Date?new e.constructor(t):new Date(t)}function Ye(e,t){return Jt(t||e,e)}function jh(e,t,n){let o=Ye(e,n?.in);return isNaN(t)?Jt(n?.in||e,NaN):(t&&o.setDate(o.getDate()+t),o)}function Fh(e,t,n){let o=Ye(e,n?.in);if(isNaN(t))return Jt(n?.in||e,NaN);if(!t)return o;let i=o.getDate(),a=Jt(n?.in||e,o.getTime());a.setMonth(o.getMonth()+t+1,0);let c=a.getDate();return i>=c?a:(o.setFullYear(a.getFullYear(),a.getMonth(),i),o)}function Ro(e,t,n){let{years:o=0,months:i=0,weeks:a=0,days:c=0,hours:l=0,minutes:m=0,seconds:f=0}=t,h=Ye(e,n?.in),E=i||o?Fh(h,i+o*12):h,I=c||a?jh(E,c+a*7):E,g=m+l*60,S=(f+g*60)*1e3;return Jt(n?.in||e,+I+S)}var Kk={};function qh(){return Kk}function Ol(e){let t=Ye(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function yt(e,...t){let n=Jt.bind(null,e||t.find(o=>typeof o=="object"));return t.map(n)}function xl(e,t){let n=Ye(e,t?.in);return n.setHours(0,0,0,0),n}function Bh(e,t,n){let[o,i]=yt(n?.in,e,t),a=xl(o),c=xl(i),l=+a-Ol(a),m=+c-Ol(c);return Math.round((l-m)/Mh)}function Dn(e,t){let n=+Ye(e)-+Ye(t);return n<0?-1:n>0?1:n}function Hh(e,t,n){let[o,i]=yt(n?.in,e,t),a=o.getFullYear()-i.getFullYear(),c=o.getMonth()-i.getMonth();return a*12+c}function Kh(e,t,n){let[o,i]=yt(n?.in,e,t);return o.getFullYear()-i.getFullYear()}function Yh(e,t,n){let[o,i]=yt(n?.in,e,t),a=zh(o,i),c=Math.abs(Bh(o,i));o.setDate(o.getDate()-a*c);let l=+(zh(o,i)===-a),m=a*(c-l);return m===0?0:m}function zh(e,t){let n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}function Co(e){return t=>{let o=(e?Math[e]:Math.trunc)(t);return o===0?0:o}}function Vh(e,t,n){let[o,i]=yt(n?.in,e,t),a=(+o-+i)/Gh;return Co(n?.roundingMethod)(a)}function yc(e,t){return+Ye(e)-+Ye(t)}function Qh(e,t,n){let o=yc(e,t)/Dh;return Co(n?.roundingMethod)(o)}function Wh(e,t){let n=Ye(e,t?.in);return n.setHours(23,59,59,999),n}function Zh(e,t){let n=Ye(e,t?.in),o=n.getMonth();return n.setFullYear(n.getFullYear(),o+1,0),n.setHours(23,59,59,999),n}function Xh(e,t){let n=Ye(e,t?.in);return+Wh(n,t)==+Zh(n,t)}function Jh(e,t,n){let[o,i,a]=yt(n?.in,e,e,t),c=Dn(i,a),l=Math.abs(Hh(i,a));if(l<1)return 0;i.getMonth()===1&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-c*l);let m=Dn(i,a)===-c;Xh(o)&&l===1&&Dn(o,a)===1&&(m=!1);let f=c*(l-+m);return f===0?0:f}function ey(e,t,n){let o=yc(e,t)/1e3;return Co(n?.roundingMethod)(o)}function ty(e,t,n){let[o,i]=yt(n?.in,e,t),a=Dn(o,i),c=Math.abs(Kh(o,i));o.setFullYear(1584),i.setFullYear(1584);let l=Dn(o,i)===-a,m=a*(c-+l);return m===0?0:m}function ry(e,t){let[n,o]=yt(e,t.start,t.end);return{start:n,end:o}}var zk={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},ny=(e,t,n)=>{let o,i=zk[e];return typeof i=="string"?o=i:t===1?o=i.one:o=i.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+o:o+" ago":o};function Tc(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var Yk={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Vk={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Qk={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},oy={date:Tc({formats:Yk,defaultWidth:"full"}),time:Tc({formats:Vk,defaultWidth:"full"}),dateTime:Tc({formats:Qk,defaultWidth:"full"})};var Wk={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},iy=(e,t,n,o)=>Wk[e];function Po(e){return(t,n)=>{let o=n?.context?String(n.context):"standalone",i;if(o==="formatting"&&e.formattingValues){let c=e.defaultFormattingWidth||e.defaultWidth,l=n?.width?String(n.width):c;i=e.formattingValues[l]||e.formattingValues[c]}else{let c=e.defaultWidth,l=n?.width?String(n.width):e.defaultWidth;i=e.values[l]||e.values[c]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}var Zk={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Xk={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Jk={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},eM={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},tM={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},rM={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},nM=(e,t)=>{let n=Number(e),o=n%100;if(o>20||o<10)switch(o%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},ay={ordinalNumber:nM,era:Po({values:Zk,defaultWidth:"wide"}),quarter:Po({values:Xk,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Po({values:Jk,defaultWidth:"wide"}),day:Po({values:eM,defaultWidth:"wide"}),dayPeriod:Po({values:tM,defaultWidth:"wide",formattingValues:rM,defaultFormattingWidth:"wide"})};function Uo(e){return(t,n={})=>{let o=n.width,i=o&&e.matchPatterns[o]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let c=a[0],l=o&&e.parsePatterns[o]||e.parsePatterns[e.defaultParseWidth],m=Array.isArray(l)?iM(l,E=>E.test(c)):oM(l,E=>E.test(c)),f;f=e.valueCallback?e.valueCallback(m):m,f=n.valueCallback?n.valueCallback(f):f;let h=t.slice(c.length);return{value:f,rest:h}}}function oM(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function iM(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function sy(e){return(t,n={})=>{let o=t.match(e.matchPattern);if(!o)return null;let i=o[0],a=t.match(e.parsePattern);if(!a)return null;let c=e.valueCallback?e.valueCallback(a[0]):a[0];c=n.valueCallback?n.valueCallback(c):c;let l=t.slice(i.length);return{value:c,rest:l}}}var aM=/^(\d+)(th|st|nd|rd)?/i,sM=/\d+/i,cM={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},pM={any:[/^b/i,/^(a|c)/i]},uM={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},lM={any:[/1/i,/2/i,/3/i,/4/i]},mM={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},dM={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},fM={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},gM={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},hM={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},yM={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},cy={ordinalNumber:sy({matchPattern:aM,parsePattern:sM,valueCallback:e=>parseInt(e,10)}),era:Uo({matchPatterns:cM,defaultMatchWidth:"wide",parsePatterns:pM,defaultParseWidth:"any"}),quarter:Uo({matchPatterns:uM,defaultMatchWidth:"wide",parsePatterns:lM,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Uo({matchPatterns:mM,defaultMatchWidth:"wide",parsePatterns:dM,defaultParseWidth:"any"}),day:Uo({matchPatterns:fM,defaultMatchWidth:"wide",parsePatterns:gM,defaultParseWidth:"any"}),dayPeriod:Uo({matchPatterns:hM,defaultMatchWidth:"any",parsePatterns:yM,defaultParseWidth:"any"})};var Rl={code:"en-US",formatDistance:ny,formatLong:oy,formatRelative:iy,localize:ay,match:cy,options:{weekStartsOn:0,firstWeekContainsDate:1}};var TM=["years","months","weeks","days","hours","minutes","seconds"];function py(e,t){let n=qh(),o=t?.locale??n.locale??Rl,i=t?.format??TM,a=t?.zero??!1,c=t?.delimiter??" ";return o.formatDistance?i.reduce((m,f)=>{let h=`x${f.replace(/(^.)/,I=>I.toUpperCase())}`,E=e[f];return E!==void 0&&(a||e[f])?m.concat(o.formatDistance(h,E)):m},[]).join(c):""}function uy(e,t){let{start:n,end:o}=ry(t?.in,e),i={},a=ty(o,n);a&&(i.years=a);let c=Ro(n,{years:i.years}),l=Jh(o,c);l&&(i.months=l);let m=Ro(c,{months:i.months}),f=Yh(o,m);f&&(i.days=f);let h=Ro(m,{days:i.days}),E=Vh(o,h);E&&(i.hours=E);let I=Ro(h,{hours:i.hours}),g=Qh(o,I);g&&(i.minutes=g);let T=Ro(I,{minutes:i.minutes}),S=ey(o,T);return S&&(i.seconds=S),i}var h8=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z"));var x8=60*1e3;var cW=1/1e6,Pl=1e3,sa=60*Pl,AM=60*sa,_c=24*AM,pW=7*_c,uW=30*_c;var Ul=["past-5-minutes","past-15-minutes","past-30-minutes","past-1-hour","past-2-hours","past-4-hours","past-6-hours","past-12-hours","past-24-hours","past-2-days","past-3-days","past-7-days","past-30-days","past-3-months","current-day","current-week","current-month","current-year","previous-day","previous-week","previous-month","previous-3-months","previous-year"];var OM={s:1,m:60,h:3600,d:86400};function my(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<48||n>57)return!1}return!0}function dy(){return Math.floor(Date.now()/1e3)}function Ic(e){if(typeof e=="number")return e;if(e==="now")return dy();if(e.startsWith("-")&&e.length>=3){let n=e.at(-1),o=n?OM[n]:void 0;if(o){let i=e.slice(1,-1);if(i.length>0&&my(i))return dy()-parseInt(i,10)*o}}if(my(e)&&e.length>0)return parseInt(e,10);let t=Date.parse(e);if(!Number.isNaN(t))return Math.floor(t/1e3);throw new Error(`Invalid time value: ${e}. Use unix seconds, relative (-30m, -1h), 'now', or ISO 8601.`)}var y={};Yt(y,{Assign:()=>xM,Clone:()=>jn,Create:()=>N0,Discard:()=>L0,Metrics:()=>er,Update:()=>k0});var er={assign:0,create:0,clone:0,discard:0,update:0};function xM(e,t){return er.assign+=1,{...e,...t}}var s={};Yt(s,{Counted:()=>zM,Entries:()=>QM,EntriesRegExp:()=>VM,Every:()=>qM,EveryAll:()=>BM,GraphemeCount:()=>$M,HasPropertyKey:()=>YM,IsArray:()=>pa,IsBigInt:()=>ca,IsBoolean:()=>by,IsClassInstance:()=>GM,IsConstructor:()=>vM,IsDeepEqual:()=>Ll,IsEqual:()=>te,IsFunction:()=>Sy,IsGreaterEqualThan:()=>Oy,IsGreaterThan:()=>kM,IsInteger:()=>vl,IsLessEqualThan:()=>Ay,IsLessThan:()=>MM,IsMaxLength:()=>jM,IsMinLength:()=>FM,IsMultipleOf:()=>DM,IsNull:()=>Ac,IsNumber:()=>Oc,IsObject:()=>ua,IsObjectNotArray:()=>NM,IsString:()=>xc,IsSymbol:()=>LM,IsUndefined:()=>Nl,IsUnsafePropertyKey:()=>Ry,IsValueLike:()=>xy,Keys:()=>Sc,ShiftLeft:()=>Rc,Some:()=>HM,SomeAll:()=>KM,Symbols:()=>WM,Values:()=>ZM});function Gn(e,t,n){return e>=t&&e<=n}function RM(e){return e===8205}function CM(e){return Gn(e,55296,56319)}function fy(e){return Gn(e,127462,127487)}function hy(e){return Gn(e,65024,65039)}function yy(e){return Gn(e,768,879)||Gn(e,6832,6911)||Gn(e,7616,7679)||Gn(e,65056,65071)}function bc(e){return e>65535?2:1}function gy(e,t){for(;t<e.length;){let n=e.codePointAt(t);if(yy(n)||hy(n))t+=bc(n);else break}return t}function wl(e,t){let n=e.codePointAt(t),o=t+bc(n);for(o=gy(e,o);o<e.length-1&&e[o]==="\u200D";){let i=e.codePointAt(o+1);o+=1+bc(i),o=gy(e,o)}return fy(n)&&o<e.length&&fy(e.codePointAt(o))&&(o+=bc(e.codePointAt(o))),o}function Ty(e){return CM(e)||yy(e)||hy(e)||RM(e)}function Ey(e){let t=0,n=0;for(;n<e.length;)n=wl(e,n),t++;return t}function PM(e,t){if(t===0)return!0;let n=0,o=0;for(;o<e.length;)if(o=wl(e,o),n++,n>=t)return!0;return!1}function UM(e,t){let n=0,o=0;for(;o<e.length;)if(o=wl(e,o),n++,n>t)return!1;return!0}function _y(e,t){if(t===0)return!0;let n=0;for(;n<e.length;){if(Ty(e.charCodeAt(n)))return PM(e,t);if(n++,n>=t)return!0}return!1}function Iy(e,t){let n=0;for(;n<e.length;){if(Ty(e.charCodeAt(n)))return UM(e,t);if(n++,n>t)return!1}return!0}function pa(e){return Array.isArray(e)}function ca(e){return te(typeof e,"bigint")}function by(e){return te(typeof e,"boolean")}function vM(e){if(Nl(e)||!Sy(e))return!1;let t=Function.prototype.toString.call(e);return!!(/^class\s/.test(t)||/\[native code\]/.test(t))}function Sy(e){return te(typeof e,"function")}function vl(e){return Number.isInteger(e)}function Ac(e){return te(e,null)}function Oc(e){return Number.isFinite(e)}function NM(e){return ua(e)&&!pa(e)}function ua(e){return te(typeof e,"object")&&!Ac(e)}function xc(e){return te(typeof e,"string")}function LM(e){return te(typeof e,"symbol")}function Nl(e){return te(e,void 0)}function te(e,t){return e===t}function kM(e,t){return e>t}function MM(e,t){return e<t}function Ay(e,t){return e<=t}function Oy(e,t){return e>=t}function DM(e,t){if(ca(e)||ca(t))return BigInt(e)%BigInt(t)===0n;let n=1e-10;if(!Oc(e)||vl(e)&&1/t%1===0)return!0;let o=e%t;return Math.min(Math.abs(o),Math.abs(o-t),Math.abs(o+t))<n}function GM(e){if(!ua(e))return!1;let t=globalThis.Object.getPrototypeOf(e);return Ac(t)?!1:te(typeof t.constructor,"function")&&!(te(t.constructor,globalThis.Object)||te(t.constructor.name,"Object"))}function xy(e){return ca(e)||by(e)||Ac(e)||Oc(e)||xc(e)||Nl(e)}function $M(e){return Ey(e)}function jM(e,t){return Iy(e,t)}function FM(e,t){return _y(e,t)}function qM(e,t,n){for(let o=t;o<e.length;o++)if(!n(e[o],o))return!1;return!0}function BM(e,t,n){let o=!0;for(let i=t;i<e.length;i++)n(e[i],i)||(o=!1);return o}function HM(e,t){for(let n=0;n<e.length;n++)if(t(e[n],n))return!0;return!1}function KM(e,t){let n=!1;for(let o=0;o<e.length;o++)t(e[o],o)&&(n=!0);return n}function zM(e,t){return e.reduce((n,o,i)=>t(o,i)?++n:n,0)}function Rc(e,t,n){return te(e.length,0)?n():t(e[0],e.slice(1))}function Ry(e){return te(e,"__proto__")||te(e,"constructor")||te(e,"prototype")}function YM(e,t){return Ry(t)?Object.prototype.hasOwnProperty.call(e,t):t in e}function VM(e){return Sc(e).map(t=>[new RegExp(`^${t}$`),e[t]])}function QM(e){return Object.entries(e)}function Sc(e){return Object.getOwnPropertyNames(e)}function WM(e){return Object.getOwnPropertySymbols(e)}function ZM(e){return Object.values(e)}function XM(e,t){if(!ua(t))return!1;let n=Sc(e);return te(n.length,Sc(t).length)&&n.every(o=>Ll(e[o],t[o]))}function JM(e,t){return pa(t)&&te(e.length,t.length)&&e.every((n,o)=>Ll(e[o],t[o]))}function Ll(e,t){return pa(e)?JM(e,t):ua(e)?XM(e,t):te(e,t)}var Tt={};Yt(Tt,{IsBigInt64Array:()=>d0,IsBigUint64Array:()=>f0,IsBoolean:()=>e0,IsDate:()=>h0,IsFloat32Array:()=>l0,IsFloat64Array:()=>m0,IsInt16Array:()=>s0,IsInt32Array:()=>p0,IsInt8Array:()=>o0,IsMap:()=>T0,IsNumber:()=>t0,IsRegExp:()=>g0,IsSet:()=>y0,IsString:()=>r0,IsTypeArray:()=>n0,IsUint16Array:()=>c0,IsUint32Array:()=>u0,IsUint8Array:()=>i0,IsUint8ClampedArray:()=>a0});function e0(e){return e instanceof Boolean}function t0(e){return e instanceof Number}function r0(e){return e instanceof String}function n0(e){return globalThis.ArrayBuffer.isView(e)}function o0(e){return e instanceof globalThis.Int8Array}function i0(e){return e instanceof globalThis.Uint8Array}function a0(e){return e instanceof globalThis.Uint8ClampedArray}function s0(e){return e instanceof globalThis.Int16Array}function c0(e){return e instanceof globalThis.Uint16Array}function p0(e){return e instanceof globalThis.Int32Array}function u0(e){return e instanceof globalThis.Uint32Array}function l0(e){return e instanceof globalThis.Float32Array}function m0(e){return e instanceof globalThis.Float64Array}function d0(e){return e instanceof globalThis.BigInt64Array}function f0(e){return e instanceof globalThis.BigUint64Array}function g0(e){return e instanceof globalThis.RegExp}function h0(e){return e instanceof globalThis.Date}function y0(e){return e instanceof globalThis.Set}function T0(e){return e instanceof globalThis.Map}var Cc=s;function _0(e){return s.HasPropertyKey(e,"~kind")||s.HasPropertyKey(e,"~unsafe")}function I0(e){let t={};for(let n of Object.getOwnPropertyNames(e)){if(s.IsUnsafePropertyKey(n))continue;let o=Object.getOwnPropertyDescriptor(e,n);o.value=$n(o.value),s.IsEqual(o.enumerable,!0)?t[n]=o.value:Object.defineProperty(t,n,o)}return t}function b0(e){let t={};for(let n of s.Keys(e))s.IsUnsafePropertyKey(n)||(t[n]=$n(e[n]));for(let n of s.Symbols(e))t[n]=$n(e[n]);return t}function S0(e){return s.IsClassInstance(e)?e:_0(e)?I0(e):b0(e)}function A0(e){return e.map(t=>$n(t))}function O0(e){return e.slice()}function x0(e){return new RegExp(e.source,e.flags)}function R0(e){return new Map($n([...e.entries()]))}function C0(e){return new Set($n([...e.values()]))}function $n(e){return Tt.IsTypeArray(e)?O0(e):Tt.IsRegExp(e)?x0(e):Tt.IsMap(e)?R0(e):Tt.IsSet(e)?C0(e):s.IsArray(e)?A0(e):s.IsObject(e)?S0(e):e}function jn(e){return er.clone+=1,$n(e)}var rt={};Yt(rt,{Get:()=>w0,Reset:()=>P0,Set:()=>U0});var pr={immutableTypes:!1,maxErrors:8,maxInstantiationCount:128,useAcceleration:!0,exactOptionalPropertyTypes:!1,enumerableKind:!1,correctiveParse:!1,unionPrioritySort:!0};function P0(){pr.immutableTypes=!1,pr.maxErrors=8,pr.maxInstantiationCount=128,pr.useAcceleration=!0,pr.exactOptionalPropertyTypes=!1,pr.enumerableKind=!1,pr.correctiveParse=!1,pr.unionPrioritySort=!0}function U0(e){for(let t of s.Keys(e)){let n=e[t];n!==void 0&&Object.defineProperty(pr,t,{value:n})}}function w0(){return pr}function v0(e,t){for(let n of Object.keys(t))Object.defineProperty(e,n,{configurable:!0,writable:!0,enumerable:!1,value:t[n]});return e}function Cy(e,t){return{...e,...t}}function N0(e,t,n={}){er.create+=1;let o=rt.Get(),i=Cy(t,n),a=o.enumerableKind?Cy(i,e):v0(i,e);return o.immutableTypes?Object.freeze(a):a}function L0(e,t){er.discard+=1;let n={};for(let o of Object.getOwnPropertyNames(e)){if(t.includes(o))continue;let i=Object.getOwnPropertyDescriptor(e,o);i.value=jn(i.value),Object.defineProperty(n,o,i)}return n}function k0(e,t,n){er.update+=1;let o=rt.Get(),i=jn(e);for(let a of Object.keys(t))Object.defineProperty(i,a,{configurable:!0,writable:!0,enumerable:o.enumerableKind,value:t[a]});for(let a of Object.keys(n))Object.defineProperty(i,a,{configurable:!0,enumerable:!0,writable:!0,value:n[a]});return i}function w(e,t){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.IsEqual(e["~kind"],t)}function Ue(e){return s.IsObject(e)}function v(e,t,n){return y.Create({"~kind":"Deferred"},{type:"deferred",action:e,parameters:t,options:n},{})}function on(e){return w(e,"Deferred")}function M0(e){return y.Update(e,{"~readonly":!0},{})}function la(e,t){return y.Update(M0(e),{},t)}function Py(e,t,n,o){let i=O(e,t,n);return la(i,o)}function D0(e){return y.Update(e,{"~optional":!0},{})}function ma(e,t){return y.Update(D0(e),{},t)}function Uy(e,t,n,o){let i=O(e,t,n);return ma(i,o)}function Pt(e,t){return y.Create({"~kind":"Array"},{type:"array",items:e},t)}function Z(e){return w(e,"Array")}function wo(e){return y.Discard(e,["~kind","type","items"])}function ur(e,t,n={}){return y.Create({"~kind":"Constructor"},{type:"constructor",parameters:e,instanceType:t},n)}function Be(e){return w(e,"Constructor")}function wy(e){return y.Discard(e,["~kind","type","parameters","instanceType"])}function lr(e,t,n={}){return y.Create({"~kind":"Function"},{type:"function",parameters:e,returnType:t},n)}function He(e){return w(e,"Function")}function vy(e){return y.Discard(e,["~kind","type","parameters","returnType"])}function nt(e,t){return y.Create({"~kind":"Ref"},{$ref:e},t)}function ce(e){return w(e,"Ref")}function an(e,t){return y.Create({"~kind":"Generic"},{type:"generic",parameters:e,expression:t})}function vo(e){return w(e,"Generic")}function No(e){return y.Create({"~kind":"Any"},{},e)}function Ve(e){return w(e,"Any")}var Ny="(?!)";function me(e){return y.Create({"~kind":"Never"},{not:{}},e)}function tr(e){return w(e,"Never")}function mr(e,t={}){return v("AddOptional",[e],t)}function Fn(e,t={}){return ma(e,t)}function Ly(e){return Fn(e)}function Je(e){return Ue(e)&&s.HasPropertyKey(e,"~optional")}function ky(e){return s.Keys(e).filter(t=>!Je(e[t]))}function Pc(e){return s.Keys(e)}function Uc(e){return s.Values(e)}function k(e,t={}){let n=ky(e),o=n.length>0?{required:n}:{};return y.Create({"~kind":"Object"},{type:"object",...o,properties:e},t)}function D(e){return w(e,"Object")}function My(e){return y.Discard(e,["~kind","type","properties","required"])}function Qe(e){return y.Create({"~kind":"Unknown"},{},e)}function et(e){return w(e,"Unknown")}function dr(e,t,n){let o=s.Keys(e).reduce((i,a)=>({...i,[a]:y.Update(e[a],{},{$id:a})}),{});return y.Create({"~kind":"Cyclic"},{$defs:o,$ref:t},n)}function Te(e){return w(e,"Cyclic")}function Dy(e){return y.Update(e,{"~unsafe":null},{})}function wc(e){return s.IsObjectNotArray(e)&&s.HasPropertyKey(e,"~unsafe")&&s.IsNull(e["~unsafe"])}var oe={};Yt(oe,{Match:()=>G0});function G0(e,t){return t[e.length]?.(...e)??(()=>{throw Error("Invalid Arguments")})()}function da(...e){let[t,n]=oe.Match(e,{2:(o,i)=>[o,i,i],1:o=>[o,Qe(),Qe()]});return y.Create({"~kind":"Infer"},{type:"infer",name:t,extends:n},{})}function Ke(e){return w(e,"Infer")}function qn(e,t,n,o={}){return y.Create({"~kind":"Dependent"},{if:e,then:t,else:n},o)}function Le(e){return w(e,"Dependent")}function Gy(e){return y.Discard(e,["~kind","if","then","else"])}function $y(e){return s.IsObjectNotArray(e)}function jy(e){return s.Keys(e).filter(n=>isNaN(n)).reduce((n,o)=>[...n,e[o]],[])}function Fy(e){return s.IsString(e)||s.IsNumber(e)}function qy(e,t){let n=$y(e)?jy(e):e;return y.Create({"~kind":"Enum"},{enum:n},t)}function ze(e){return w(e,"Enum")}function ut(e,t={}){return y.Create({"~kind":"Intersect"},{allOf:e},t)}function M(e){return w(e,"Intersect")}function By(e){return y.Discard(e,["~kind","allOf"])}var Bn={};Yt(Bn,{Hash:()=>rD,HashCode:()=>Wy});function fe(){throw new Error("Unreachable")}function $0(e){let t=new Set,n=e;for(;n&&n!==Object.prototype;){for(let o of Reflect.ownKeys(n))o!=="constructor"&&typeof o!="symbol"&&t.add(o);n=Object.getPrototypeOf(n)}return[...t]}function j0(e){return typeof e=="number"}var Et;(function(e){e[e.Array=0]="Array",e[e.BigInt=1]="BigInt",e[e.Boolean=2]="Boolean",e[e.Date=3]="Date",e[e.Constructor=4]="Constructor",e[e.Function=5]="Function",e[e.Null=6]="Null",e[e.Number=7]="Number",e[e.Object=8]="Object",e[e.RegExp=9]="RegExp",e[e.String=10]="String",e[e.Symbol=11]="Symbol",e[e.TypeArray=12]="TypeArray",e[e.Undefined=13]="Undefined"})(Et||(Et={}));var Lo=BigInt("14695981039346656037"),[F0,q0]=[BigInt("1099511628211"),BigInt("18446744073709551616")],B0=Array.from({length:256}).map((e,t)=>BigInt(t)),Yy=new Float64Array(1),Vy=new DataView(Yy.buffer),Qy=new Uint8Array(Yy.buffer);function lt(e){Lo=Lo^B0[e],Lo=Lo*F0%q0}function H0(e){lt(Et.Array);for(let t of e)sn(t)}function K0(e){lt(Et.BigInt),Vy.setBigInt64(0,e);for(let t of Qy)lt(t)}function Ky(e){lt(Et.Boolean),lt(e?1:0)}function z0(e){lt(Et.Constructor),sn(e.toString())}function Y0(e){lt(Et.Date),sn(e.getTime())}function V0(e){lt(Et.Function),sn(e.toString())}function Q0(e){lt(Et.Null)}function zy(e){lt(Et.Number),Vy.setFloat64(0,e,!0);for(let t of Qy)lt(t)}function W0(e){lt(Et.Object);for(let t of $0(e).sort())sn(t),sn(e[t])}function Z0(e){lt(Et.RegExp),kl(e.toString())}var X0=new TextEncoder;function kl(e){lt(Et.String);for(let t of X0.encode(e))lt(t)}function J0(e){lt(Et.Symbol),sn(e.toString())}function eD(e){lt(Et.TypeArray);let t=new Uint8Array(e.buffer);for(let n=0;n<t.length;n++)lt(t[n])}function tD(e){return lt(Et.Undefined)}function sn(e){return Tt.IsTypeArray(e)?eD(e):Tt.IsDate(e)?Y0(e):Tt.IsRegExp(e)?Z0(e):Tt.IsBoolean(e)?Ky(e.valueOf()):Tt.IsString(e)?kl(e.valueOf()):Tt.IsNumber(e)?zy(e.valueOf()):j0(e)?zy(e):s.IsArray(e)?H0(e):s.IsBoolean(e)?Ky(e):s.IsBigInt(e)?K0(e):s.IsConstructor(e)?z0(e):s.IsNull(e)?Q0(e):s.IsObject(e)?W0(e):s.IsString(e)?kl(e):s.IsSymbol(e)?J0(e):s.IsUndefined(e)?tD(e):s.IsFunction(e)?V0(e):fe()}function Wy(e){return Lo=BigInt("14695981039346656037"),sn(e),Lo}function rD(e){return Wy(e).toString(16).padStart(16,"0")}function Zy(e){switch(e.keyword){case"additionalProperties":return"must not have additional properties";case"anyOf":return"must match a schema in anyOf";case"boolean":return"schema is false";case"const":return"must be equal to constant";case"contains":return"must contain at least 1 valid item";case"dependencies":return`must have properties ${e.params.dependencies.join(", ")} when property ${e.params.property} is present`;case"dependentRequired":return`must have properties ${e.params.dependencies.join(", ")} when property ${e.params.property} is present`;case"enum":return"must be equal to one of the allowed values";case"exclusiveMaximum":return`must be ${e.params.comparison} ${e.params.limit}`;case"exclusiveMinimum":return`must be ${e.params.comparison} ${e.params.limit}`;case"format":return`must match format "${e.params.format}"`;case"if":return`must match "${e.params.failingKeyword}" schema`;case"maxItems":return`must not have more than ${e.params.limit} items`;case"maxLength":return`must not have more than ${e.params.limit} characters`;case"maxProperties":return`must not have more than ${e.params.limit} properties`;case"maximum":return`must be ${e.params.comparison} ${e.params.limit}`;case"minItems":return`must not have fewer than ${e.params.limit} items`;case"minLength":return`must not have fewer than ${e.params.limit} characters`;case"minProperties":return`must not have fewer than ${e.params.limit} properties`;case"minimum":return`must be ${e.params.comparison} ${e.params.limit}`;case"multipleOf":return`must be multiple of ${e.params.multipleOf}`;case"not":return"must not be valid";case"oneOf":return"must match exactly one schema in oneOf";case"pattern":return`must match pattern "${e.params.pattern}"`;case"propertyNames":return`property names ${e.params.propertyNames.join(", ")} are invalid`;case"required":return`must have required properties ${e.params.requiredProperties.join(", ")}`;case"type":return typeof e.params.type=="string"?`must be ${e.params.type}`:`must be either ${e.params.type.join(" or ")}`;case"unevaluatedItems":return"must not have unevaluated items";case"unevaluatedProperties":return"must not have unevaluated properties";case"uniqueItems":return"must not have duplicate items";case"~refine":return e.params.message;default:return"an unknown validation error occurred"}}var nD=Zy;function Xy(){return nD}var fa=class{constructor(t,n){this.type=t,this.decode=n}Encode(t){let n=this.type,o=Hn(n)?c=>this.decode(n["~codec"].decode(c)):this.decode,i=Hn(n)?c=>n["~codec"].encode(t(c)):t,a={decode:o,encode:i};return y.Update(this.type,{"~codec":a},{})}},ga=class{constructor(t){this.type=t}Decode(t){return new fa(this.type,t)}};function vc(e){return new ga(e)}function eT(e,t){return vc(e).Decode(t).Encode(()=>{throw Error("Encode not implemented")})}function tT(e,t){return vc(e).Decode(()=>{throw Error("Decode not implemented")}).Encode(t)}function Hn(e){return Ue(e)&&s.HasPropertyKey(e,"~codec")&&s.IsObject(e["~codec"])&&s.HasPropertyKey(e["~codec"],"encode")&&s.HasPropertyKey(e["~codec"],"decode")}function rT(e){return ko(e)}function Kn(e){return Ue(e)&&s.HasPropertyKey(e,"~immutable")}function fr(e,t={}){return v("AddReadonly",[e],t)}function zn(e,t={}){return la(e,t)}function nT(e){return zn(e)}function Yn(e){return Ue(e)&&s.HasPropertyKey(e,"~readonly")}function iD(e,t){let n=Nc(e)?[...e["~refine"],t]:[t];return y.Update(e,{"~refine":n},{})}function oT(...e){let[t,n,o]=oe.Match(e,{3:(i,a,c)=>[i,a,c],2:(i,a)=>[i,a,()=>"Refine Error"]});return iD(t,{check:n,error:o})}function aD(e){return s.IsObjectNotArray(e)&&s.HasPropertyKey(e,"check")&&s.HasPropertyKey(e,"error")&&s.IsFunction(e.check)&&s.IsFunction(e.error)}function Nc(e){return Ue(e)&&s.HasPropertyKey(e,"~refine")&&s.IsArray(e["~refine"])&&s.Every(e["~refine"],0,t=>aD(t))}var iT="-?(?:0|[1-9][0-9]*)n";function ha(e){return y.Create({"~kind":"BigInt"},{type:"bigint"},e)}function vt(e){return w(e,"BigInt")}function Lc(e){return y.Create({"~kind":"Boolean"},{type:"boolean"},e)}function _t(e){return w(e,"Boolean")}function ya(e){return y.Create({"~kind":"Identifier"},{name:e})}function aT(e){return w(e,"Identifier")}var kc="-?(?:0|[1-9][0-9]*)";function Vn(e){return y.Create({"~kind":"Integer"},{type:"integer"},e)}function ot(e){return w(e,"Integer")}var Ml=class extends Error{constructor(t){super("Invalid Literal value"),Object.defineProperty(this,"cause",{value:{value:t},writable:!1,configurable:!1,enumerable:!1})}};function sD(e){return s.IsBigInt(e)?"bigint":s.IsBoolean(e)?"boolean":s.IsNumber(e)?"number":s.IsString(e)?"string":(()=>{throw new Ml(e)})()}function z(e,t){return y.Create({"~kind":"Literal"},{type:sD(e),const:e},t)}function Mc(e){return s.IsBigInt(e)||s.IsBoolean(e)||s.IsNumber(e)||s.IsString(e)}function sT(e){return Q(e)&&s.IsBigInt(e.const)}function cT(e){return Q(e)&&s.IsBoolean(e.const)}function Dc(e){return Q(e)&&s.IsNumber(e.const)}function Gc(e){return Q(e)&&s.IsString(e.const)}function Q(e){return w(e,"Literal")}function Mo(e){return y.Create({"~kind":"Null"},{type:"null"},e)}function gr(e){return w(e,"Null")}var $c="-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?";function Nt(e){return y.Create({"~kind":"Number"},{type:"number"},e)}function Ce(e){return w(e,"Number")}function Do(e){return y.Create({"~kind":"Symbol"},{type:"symbol"},e)}function hr(e){return w(e,"Symbol")}function Qn(...e){let[t,n,o]=oe.Match(e,{3:(i,a,c)=>[i,a,c],2:(i,a)=>[i,a,a],1:i=>[i,Qe(),Qe()]});return y.Create({"~kind":"Parameter"},{name:t,extends:n,equals:o},{})}function pT(e){return w(e,"Parameter")}var jc=".*";function It(e){return y.Create({"~kind":"String"},{type:"string"},e)}function We(e){return w(e,"String")}function q(e,t={}){return y.Create({"~kind":"Union"},{anyOf:e},t)}function R(e){return w(e,"Union")}function uT(e){return y.Discard(e,["~kind","anyOf"])}function Ta(e){let t=lT(e);return s.IsEqual(t.length,2)?t[0]:[]}function cD(e){return!0}function mT(e){return s.ShiftLeft(e,(t,n)=>pD(t)?mT(n):!1,()=>!0)}function dT(e){return s.IsEqual(e.length,0)?!1:mT(e)}function pD(e){return R(e)?dT(e.anyOf):Q(e)?cD(e.const):!1}function Fc(e){return dT(e)}function qc(e){return y.Create({"~kind":"TemplateLiteral"},{type:"string",pattern:e},{})}function fT(e,t,n=[]){return s.ShiftLeft(e,(o,i)=>fT(i,t,[...n,`${o}${t}`]),()=>n)}function uD(e,t){return s.IsEqual(e.length,0)?[`${t}`]:fT(e,t)}function gT(e,t,n=[]){return s.ShiftLeft(t,(o,i)=>gT(e,i,[...n,...hT(e,o)]),()=>n)}function hT(e,t){return R(t)?gT(e,t.anyOf):Q(t)?uD(e,t.const):fe()}function yT(e,t){return s.ShiftLeft(t,(n,o)=>yT(hT(e,n),o),()=>e)}function lD(e){return e.map(t=>z(t))}function mD(e){let t=yT([],e),n=lD(t);return q(n)}function dD(e){return s.IsEqual(e.length,0)?fe():s.IsEqual(e.length,1)&&Q(e[0])?e[0]:mD(e)}function Dl(e){let t=Ta(e);return s.IsEqual(t.length,0)?It():Fc(t)?dD(t):qc(e)}function Ea(e){let t=Dl(e);return Ee(t)?It():t}function Ut(e,t){let n="object",o={[e]:t};return y.Create({"~kind":"Record"},{type:n,patternProperties:o})}function TT(e){return Ut($t,e)}function ET(e){return k({true:e,false:e})}function ke(e,t={}){let[n,o,i]=[e,e.length,!1];return y.Create({"~kind":"Tuple"},{type:"array",additionalItems:i,items:n,minItems:o},t)}function Y(e){return w(e,"Tuple")}function _T(e){return y.Discard(e,["~kind","type","items","minItems","additionalItems"])}function fD(e){return y.Discard(e,["~readonly"])}function Gl(e,t){return y.Update(fD(e),{},t)}function IT(e,t,n,o){let i=O(e,t,n);return Gl(i,o)}function bT(e,t={}){return v("RemoveReadonly",[e],t)}function ST(e,t={}){return Gl(e,t)}function gD(e){return y.Discard(e,["~optional"])}function $l(e,t){return y.Update(gD(e),{},t)}function AT(e,t,n,o){let i=O(e,t,n);return $l(i,o)}function OT(e,t={}){return v("RemoveOptional",[e],t)}function Bc(e,t={}){return $l(e,t)}function jl(e){return e.reduceRight((n,o,i)=>({[i]:o,...n}),{})}function xT(e){let t=jl(e.items);return k(t)}function hD(e,t){return Yn(e)?!!Yn(t):!1}function yD(e,t){return Je(e)?!!Je(t):!1}function TD(e,t){let n=hD(e,t),o=yD(e,t),i=we([e,t]),a=ST(Bc(i));return n&&o?zn(Fn(a)):n&&!o?zn(a):!n&&o?Fn(a):a}function ED(e,t,n){return n in e?n in t?TD(e[n],t[n]):e[n]:n in t?t[n]:me()}function _D(e,t){return[...new Set([...s.Keys(t),...s.Keys(e)])].reduce((o,i)=>({...o,[i]:ED(e,t,i)}),{})}function RT(e){return D(e)?e.properties:Y(e)?jl(e.items):fe()}function CT(e,t){let n=RT(e),o=RT(t),i=_D(n,o);return k(i)}function PT(e,t){let n=Wn(e,t);return s.IsEqual(n,Ia)?e:s.IsEqual(n,ba)||s.IsEqual(n,_a)?t:me()}function UT(e){return D(e)||Y(e)}function ID(e,t){let n=R(e),o=R(t);return n||o}function bD(e,t){let n=Vt(e),o=Vt(t),i=ID(n,o),a=UT(n),c=UT(o);return i?we([n,o]):a&&c?CT(n,o):a&&!c?n:!a&&c?o:PT(n,o)}function wT(e,t,n=[]){return s.ShiftLeft(t,(o,i)=>wT(e,i,[...n,bD(e,o)]),()=>s.IsEqual(n.length,0)?[e]:n)}function vT(e,t,n=[]){return s.ShiftLeft(e,(o,i)=>vT(i,t,[...n,...Sa([o],t)]),()=>n)}function Sa(e,t=[]){return s.ShiftLeft(e,(n,o)=>R(n)?Sa(o,vT(n.anyOf,t)):Sa(o,wT(n,t)),()=>t)}function SD(e,t){let n=dt({},e,t);return G.IsExtendsTrueLike(n)?[]:[e]}function AD(e,t){return e.reduce((n,o)=>[...n,...SD(o,t)],[])}function Hc(e,t){let n=Vt(e),o=R(n)?n.anyOf:[n],i=AD(o,t);return Lt(i)}function rr(e,t,n){let o=ut([e,t]),i=Hc(n,e);return Lt([o,i])}function wt(e){let t=e.map(n=>z(n));return Lt(t)}function we(e){let t=Sa(e),n=Fl(t);return Mr(n)}function ht(e){let t=Ea(e);return Vt(t)}function Lt(e){let t=Fl(e);return Mr(t)}function Vt(e){return Le(e)?rr(e.if,e.then,e.else):ze(e)?wt(e.enum):M(e)?we(e.allOf):Ee(e)?ht(e.pattern):R(e)?Lt(e.anyOf):e}function Mr(e){return s.IsEqual(e.length,1)?e[0]:s.IsEqual(e.length,0)?me():q(e)}function NT(e,t){let n=wt(e);return cn(n,t)}function LT(e,t){return Ut(pn,t)}function kT(e,t){let n=we(e);return cn(n,t)}function MT(e,t){return s.IsString(e)||s.IsNumber(e)?k({[e]:t}):s.IsEqual(e,!1)?k({false:t}):s.IsEqual(e,!0)?k({true:t}):k({})}function DT(e,t){return Ut(Go,t)}function GT(e,t){return s.HasPropertyKey(e,"pattern")&&(s.IsString(e.pattern)||e.pattern instanceof RegExp)?Ut(e.pattern.toString(),t):Ut($t,t)}function $T(e,t){let n=Ta(e);return Fc(n)?cn(ht(e),t):Ut(e,t)}function OD(e){return R(e)?$o(e.anyOf):[e]}function $o(e){return e.reduce((t,n)=>[...t,...OD(n)],[])}function xD(e){return e.some(t=>We(t)||Ce(t)||ot(t))}function RD(e,t){return s.IsEqual(xD(e),!0)?Ut($t,t):void 0}function CD(e,t){return e.reduce((n,o)=>Q(o)&&(s.IsString(o.const)||s.IsNumber(o.const))?{...n,[o.const]:t}:n,{})}function PD(e,t){let n=CD(e,t);return k(n)}function jT(e,t){let n=$o(e),o=RD(n,t);return Ue(o)?o:PD(n,t)}function cn(e,t){return Ve(e)?TT(t):_t(e)?ET(t):ze(e)?NT(e.enum,t):ot(e)?LT(e,t):M(e)?kT(e.allOf,t):Q(e)?MT(e.const,t):Ce(e)?DT(e,t):R(e)?jT(e.anyOf,t):We(e)?GT(e,t):Ee(e)?$T(e.pattern,t):k({})}function ql(e,t,n){return K([e])?y.Update(cn(e,t),{},n):Kc(e,t,n)}function FT(e,t,n,o,i){let a=O(e,t,n),c=O(e,t,o);return ql(a,c,i)}var pn=`^${kc}$`,Go=`^${$c}$`,$t=`^${jc}$`;function Kc(e,t,n={}){return v("Record",[e,t],n)}function jo(e,t,n={}){return ql(e,t,n)}function zc(e,t){return Ut(e,t)}function Yc(e){return s.IsEqual(e,$t)?It():s.IsEqual(e,pn)?Vn():s.IsEqual(e,Go)?Nt():Dl(e)}function it(e){return s.Keys(e.patternProperties)[0]}function un(e){let t=it(e);return Yc(t)}function Se(e){return e.patternProperties[it(e)]}function de(e){return w(e,"Record")}function Zn(e){return y.Create({"~kind":"Rest"},{type:"rest",items:e},{})}function ln(e){return w(e,"Rest")}function Vc(e){return y.Create({"~kind":"This"},{$ref:"#"},e)}function Qc(e){return w(e,"This")}function Fo(e){return y.Create({"~kind":"Undefined"},{type:"undefined"},e)}function nr(e){return w(e,"Undefined")}function Wc(e){return y.Create({"~kind":"Void"},{type:"void"},e)}function kt(e){return w(e,"Void")}function wD(e,t){return s.IsEqual(e,"Array")?Pt(t[0]):s.IsEqual(e,"Capitalize")?Xc(t[0]):s.IsEqual(e,"ConstructorParameters")?np(t[0]):s.IsEqual(e,"Evaluate")?q_(t[0]):s.IsEqual(e,"Exclude")?op(t[0],t[1]):s.IsEqual(e,"Extract")?ip(t[0],t[1]):s.IsEqual(e,"Index")?Ra(t[0],t[1]):s.IsEqual(e,"InstanceType")?ap(t[0]):s.IsEqual(e,"Lowercase")?Jc(t[0]):s.IsEqual(e,"NonNullable")?sp(t[0]):s.IsEqual(e,"Omit")?cp(t[0],t[1]):s.IsEqual(e,"Parameters")?pp(t[0]):s.IsEqual(e,"Partial")?up(t[0]):s.IsEqual(e,"Pick")?lp(t[0],t[1]):s.IsEqual(e,"Readonly")?mp(t[0]):s.IsEqual(e,"KeyOf")?Ca(t[0]):s.IsEqual(e,"Record")?Kc(t[0],t[1]):s.IsEqual(e,"Required")?dp(t[0]):s.IsEqual(e,"ReturnType")?fp(t[0]):s.IsEqual(e,"Uncapitalize")?ep(t[0]):s.IsEqual(e,"Uppercase")?tp(t[0]):xa(nt(e),t)}function Xn(){throw Error("Unreachable")}function zT(e,t=[]){return s.ShiftLeft(e,(n,o)=>zT(o,[...t,n[1]]),()=>t)}function Dr(e){return s.IsEqual(e.length,3)?[e[0],...zT(e[1])]:[]}function YT(e){return Qn(e[0],e[2],e[4])}function VT(e){return Qn(e[0],e[2],e[2])}function QT(e){return Qn(e[0],Qe(),e[2])}function WT(e){return Qn(e,Qe(),Qe())}function ZT(e){return Dr(e)}function XT(e){return e[1]}function JT(e){return Dr(e)}function eE(e){return e[1]}function tE(e){return wD(e[0],e[1])}function rE(e){return null}function nE(e){return It()}function oE(e){return Nt()}function iE(e){return Lc()}function aE(e){return Fo()}function sE(e){return Mo()}function cE(e){return Vn()}function pE(e){return ha()}function uE(e){return Qe()}function lE(e){return No()}function mE(e){return k({})}function dE(e){return me()}function fE(e){return Do()}function gE(e){return Wc()}function hE(e){return Vc()}function yE(e){return z(BigInt(e))}function TE(e){return z(s.IsEqual(e,"true"))}function EE(e){return z(parseFloat(e))}function _E(e){return z(e)}function IE(e){return e[1]}function bE(e){return z(e)}function SE(e){return s.IsEqual(e.length,3)?[e[0],e[1],...e[2]]:[e[0]]}function AE(e){return e[1]}function OE(e){return Zc(e)}function xE(e){return s.IsEqual(e.length,6)?qn(e[1],e[3],e[5]):qn(e[1],e[3],Qe())}function RE(e){return e.length>0}function CE(e){return e.reduce((t,n)=>s.IsEqual(n.length,3)?[...t,[n[1]]]:[...t,[]],[])}function PE(e){return s.IsEqual(e.length,6)?[e[1],e[3],e[5]]:[]}function UE(e){return s.IsArray(e)&&s.IsEqual(e.length,3)?e[1]:e}function wE(e){return s.IsEqual(e.length,2)?e[1]:[]}function qT(e,t){return t.reduce((n,o)=>{let i=o;return s.IsEqual(i.length,1)?Ra(n,i[0]):s.IsEqual(i.length,0)?Pt(n):Xn()},e)}function BT(e,t){return s.IsEqual(t.length,3)?rp(e,t[0],t[1],t[2]):e}function vD(e,t){return s.IsArray(t)&&s.IsEqual(t.length,0)?e:gp(e,t)}function vE(e){let[t,n,o,i,a]=e;return vD(BT(t?Ca(qT(n,o)):qT(n,o),i),a)}function Bl(e,t){return s.IsEqual(t.length,3)?(()=>{let[n,o,i]=t,a=Bl(o,i);if(s.IsEqual(n,"&"))return M(a)?ut([e,...a.allOf]):ut([e,a]);if(s.IsEqual(n,"|"))return R(a)?q([e,...a.anyOf]):q([e,a]);Xn()})():e}function NE(e){let[t,n]=e;return Bl(t,n)}function LE(e){let[t,n]=e;return Bl(t,n)}function kE(e){return F_(e[1])}function ME(e){return e[1]}function DE(e){return an(e[0],e[2])}function GE(e){return s.IsEqual(e.length,4)?da(e[1],e[3]):s.IsEqual(e.length,2)?da(e[1],Qe()):Xn()}function $E(e){return`${e}`}function jE(e){return ot(e[3])?pn:Ce(e[3])?Go:hr(e[3])?$t:We(e[3])?$t:Xn()}function FE(e){return e.length>0}function qE(e){return e.length>0}function BE(e){let[t,n,o,i,a]=e;return{[n]:t&&o?fr(mr(a)):t&&!o?fr(a):!t&&o?mr(a):a}}function HE(e){return Dr(e)}function KE(e){return e.reduce((t,n)=>s.HasPropertyKey(n,pn)||s.HasPropertyKey(n,Go)||s.HasPropertyKey(n,$t)?[t[0],y.Assign(t[1],n)]:[y.Assign(t[0],n),t[1]],[{},{}])}function zE(e){return KE(e[1])}function YE(e){let[t,n]=e,o=s.IsEqual(s.Keys(n).length,0)?{}:{patternProperties:n};return k(t,o)}function VE(e){return s.IsEqual(e.length,5)?fr(mr(e[4])):s.IsEqual(e.length,3)?e[2]:s.IsEqual(e.length,4)?s.IsEqual(e[2],"readonly")?fr(e[3]):mr(e[3]):Xn()}function QE(e){if(!s.IsArray(e)||!s.IsEqual(e.length,3))return e;let[t,n,o]=e;return t&&o?fr(mr(n)):t&&!o?fr(n):!t&&o?mr(n):n}function WE(e){return s.IsEqual(e.length,2)?Zn(e[1]):s.IsEqual(e.length,1)?e[0]:Xn()}function ZE(e){return Dr(e)}function XE(e){return ke(e[1])}function JE(e){return fr(mr(e[4]))}function e_(e){return fr(e[3])}function t_(e){return mr(e[3])}function r_(e){return e[2]}function n_(e){return s.IsEqual(e.length,2)?Zn(e[1]):s.IsEqual(e.length,1)?e[0]:Xn()}function o_(e){return Dr(e)}function i_(e){return lr(e[1],e[4])}function a_(e){return ur(e[2],e[5])}function HT(e,t){return s.IsEqual(e,"remove")?bT(t):s.IsEqual(e,"add")?fr(t):t}function s_(e){return s.IsEqual(e.length,2)&&s.IsEqual(e[0],"-")?"remove":s.IsEqual(e.length,2)&&s.IsEqual(e[0],"+")||s.IsEqual(e.length,1)?"add":"none"}function KT(e,t){return s.IsEqual(e,"remove")?OT(t):s.IsEqual(e,"add")?mr(t):t}function c_(e){return s.IsEqual(e.length,2)&&s.IsEqual(e[0],"-")?"remove":s.IsEqual(e.length,2)&&s.IsEqual(e[0],"+")||s.IsEqual(e.length,1)?"add":"none"}function p_(e){return s.IsEqual(e.length,2)?[e[1]]:[]}function u_(e){return s.IsArray(e[6])&&s.IsEqual(e[6].length,1)?Aa(ya(e[3]),e[5],e[6][0],HT(e[1],KT(e[8],e[10]))):Aa(ya(e[3]),e[5],nt(e[3]),HT(e[1],KT(e[8],e[10])))}function l_(e){return nt(e)}function m_(e){return BigInt(e)}function d_(e){return parseFloat(e)}function f_(e){return s.IsEqual(e,"true")}function g_(e){return null}function h_(e){return{[e[0]]:e[2]}}function y_(e){return Dr(e)}function ND(e){return e.reduce((t,n)=>y.Assign(t,n),{})}function T_(e){return ND(e[1])}function E_(e){return Dr(e)}function __(e){return e[1]}function I_(e){return ha()}function b_(e){return It()}function S_(e){return Nt()}function A_(e){return Vn()}function O_(e){return me()}function x_(e){return z(e)}function R_(e){return q(e[1])}function C_(e){return e.length===3?[...e[0],...e[2]]:e.length===1?[...e[0]]:[]}function P_(e){return[e[0],...e[1]]}function U_(e){return e[1]}function w_(e){return Dr(e)}function v_(e){return s.IsEqual(e.length,2)?e[1]:[]}function N_(e){let t=e[2],n=e[3],[o,i]=e[4],a=s.IsEqual(s.Keys(i).length,0)?{}:{patternProperties:i};return{[e[1]]:an(t,Oa(n,o,a))}}function L_(e){let t=e[2],[n,o]=e[3],i=s.IsEqual(s.Keys(o).length,0)?{}:{patternProperties:o};return{[e[1]]:Oa(t,n,i)}}function k_(e){return{[e[1]]:an(e[2],e[4])}}function M_(e){return{[e[1]]:e[3]}}function D_(e){return null}function G_(e){return Dr(e)}function $_(e){return e[1]}function j_(e){let[t,n]=[e[0],e[1]];return B_(y.Assign(t,KE(n)[0]))}function Pa(e){return te(e.length,2)}function W(e,t,n){return Pa(e)?t(e[0],e[1]):n()}function MD(e,t){return te(t.indexOf(e),0)?[e,t.slice(e.length)]:[]}function ve(e,t){for(let n=0;n<e.length;n++){let o=MD(e[n],t);if(Pa(o))return o}return[]}function Hl(e,t){return Array.from({length:t-e+1},(n,o)=>String.fromCharCode(e+o))}var H_=[...Hl(97,122),...Hl(65,90)],Kl="0",zl=Hl(49,57),qo=[Kl,...zl],K_=" ",Bo=`
|
|
28
|
-
`;var mn="_",hp=".",z_="$",yp="-";var Y_="//",V_="/*",GD="*/";function Q_(e){let t=e.indexOf(GD);return te(t,-1)?"":e.slice(t+2)}function W_(e){let t=e.indexOf(Bo);return te(t,-1)?"":e.slice(t)}function $D(e){return e.replace(/^[ \t\r\f\v]+/,"")}function Tp(e){let t=$D(e);return t.startsWith(V_)?Tp(Q_(t.slice(2))):t.startsWith(Y_)?Tp(W_(t.slice(2))):t}function mt(e){let t=e.trimStart();return t.startsWith(V_)?mt(Q_(t.slice(2))):t.startsWith(Y_)?mt(W_(t.slice(2))):t}function Ep(e,t){return W(ve([e],t),(n,o)=>[n,o],()=>["",t])}function jD(e,t){return e.includes(t)}function Ho(e,t,n,o=""){return W(ve(e,n),(i,a)=>jD(t,i)?Ho(e,t,a,o):Ho(e,t,a,`${o}${i}`),()=>[o,n])}function
|
|
27
|
+
`)}),this}_outputHelpIfRequested(t){let n=this._getHelpOption();n&&t.find(i=>n.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function vh(e){return e.map(t=>{if(!t.startsWith("--inspect"))return t;let n,o="127.0.0.1",i="9229",a;return(a=t.match(/^(--inspect(-brk)?)$/))!==null?n=a[1]:(a=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(n=a[1],/^\d+$/.test(a[3])?i=a[3]:o=a[3]):(a=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(n=a[1],o=a[3],i=a[4]),n&&i!=="0"?`${n}=${o}:${parseInt(i)+1}`:t})}function Nh(){if(le.default.env.NO_COLOR||le.default.env.FORCE_COLOR==="0"||le.default.env.FORCE_COLOR==="false")return!1;if(le.default.env.FORCE_COLOR||le.default.env.CLICOLOR_FORCE!==void 0)return!0}var m5=new xo;function Je(e){throw new Error(`assertUnreachable: ${JSON.stringify(e,null,2)}`)}var qk=Math.pow(10,8)*24*60*60*1e3,g5=-qk;var Mh=864e5,Dh=6e4,Gh=36e5;var Fk=3600;var $h=Fk*24,h5=$h*7,Bk=$h*365.2425,Hk=Bk/12,y5=Hk*3,Al=Symbol.for("constructDateFrom");function Jt(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Al in e?e[Al](t):e instanceof Date?new e.constructor(t):new Date(t)}function Ye(e,t){return Jt(t||e,e)}function jh(e,t,n){let o=Ye(e,n?.in);return isNaN(t)?Jt(n?.in||e,NaN):(t&&o.setDate(o.getDate()+t),o)}function qh(e,t,n){let o=Ye(e,n?.in);if(isNaN(t))return Jt(n?.in||e,NaN);if(!t)return o;let i=o.getDate(),a=Jt(n?.in||e,o.getTime());a.setMonth(o.getMonth()+t+1,0);let c=a.getDate();return i>=c?a:(o.setFullYear(a.getFullYear(),a.getMonth(),i),o)}function Ro(e,t,n){let{years:o=0,months:i=0,weeks:a=0,days:c=0,hours:l=0,minutes:m=0,seconds:f=0}=t,h=Ye(e,n?.in),E=i||o?qh(h,i+o*12):h,I=c||a?jh(E,c+a*7):E,g=m+l*60,S=(f+g*60)*1e3;return Jt(n?.in||e,+I+S)}var Kk={};function Fh(){return Kk}function Ol(e){let t=Ye(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function yt(e,...t){let n=Jt.bind(null,e||t.find(o=>typeof o=="object"));return t.map(n)}function xl(e,t){let n=Ye(e,t?.in);return n.setHours(0,0,0,0),n}function Bh(e,t,n){let[o,i]=yt(n?.in,e,t),a=xl(o),c=xl(i),l=+a-Ol(a),m=+c-Ol(c);return Math.round((l-m)/Mh)}function Dn(e,t){let n=+Ye(e)-+Ye(t);return n<0?-1:n>0?1:n}function Hh(e,t,n){let[o,i]=yt(n?.in,e,t),a=o.getFullYear()-i.getFullYear(),c=o.getMonth()-i.getMonth();return a*12+c}function Kh(e,t,n){let[o,i]=yt(n?.in,e,t);return o.getFullYear()-i.getFullYear()}function Yh(e,t,n){let[o,i]=yt(n?.in,e,t),a=zh(o,i),c=Math.abs(Bh(o,i));o.setDate(o.getDate()-a*c);let l=+(zh(o,i)===-a),m=a*(c-l);return m===0?0:m}function zh(e,t){let n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}function Co(e){return t=>{let o=(e?Math[e]:Math.trunc)(t);return o===0?0:o}}function Vh(e,t,n){let[o,i]=yt(n?.in,e,t),a=(+o-+i)/Gh;return Co(n?.roundingMethod)(a)}function yc(e,t){return+Ye(e)-+Ye(t)}function Qh(e,t,n){let o=yc(e,t)/Dh;return Co(n?.roundingMethod)(o)}function Wh(e,t){let n=Ye(e,t?.in);return n.setHours(23,59,59,999),n}function Zh(e,t){let n=Ye(e,t?.in),o=n.getMonth();return n.setFullYear(n.getFullYear(),o+1,0),n.setHours(23,59,59,999),n}function Xh(e,t){let n=Ye(e,t?.in);return+Wh(n,t)==+Zh(n,t)}function Jh(e,t,n){let[o,i,a]=yt(n?.in,e,e,t),c=Dn(i,a),l=Math.abs(Hh(i,a));if(l<1)return 0;i.getMonth()===1&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-c*l);let m=Dn(i,a)===-c;Xh(o)&&l===1&&Dn(o,a)===1&&(m=!1);let f=c*(l-+m);return f===0?0:f}function ey(e,t,n){let o=yc(e,t)/1e3;return Co(n?.roundingMethod)(o)}function ty(e,t,n){let[o,i]=yt(n?.in,e,t),a=Dn(o,i),c=Math.abs(Kh(o,i));o.setFullYear(1584),i.setFullYear(1584);let l=Dn(o,i)===-a,m=a*(c-+l);return m===0?0:m}function ry(e,t){let[n,o]=yt(e,t.start,t.end);return{start:n,end:o}}var zk={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},ny=(e,t,n)=>{let o,i=zk[e];return typeof i=="string"?o=i:t===1?o=i.one:o=i.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+o:o+" ago":o};function Tc(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var Yk={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Vk={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Qk={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},oy={date:Tc({formats:Yk,defaultWidth:"full"}),time:Tc({formats:Vk,defaultWidth:"full"}),dateTime:Tc({formats:Qk,defaultWidth:"full"})};var Wk={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},iy=(e,t,n,o)=>Wk[e];function Po(e){return(t,n)=>{let o=n?.context?String(n.context):"standalone",i;if(o==="formatting"&&e.formattingValues){let c=e.defaultFormattingWidth||e.defaultWidth,l=n?.width?String(n.width):c;i=e.formattingValues[l]||e.formattingValues[c]}else{let c=e.defaultWidth,l=n?.width?String(n.width):e.defaultWidth;i=e.values[l]||e.values[c]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}var Zk={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Xk={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Jk={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},eM={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},tM={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},rM={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},nM=(e,t)=>{let n=Number(e),o=n%100;if(o>20||o<10)switch(o%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},ay={ordinalNumber:nM,era:Po({values:Zk,defaultWidth:"wide"}),quarter:Po({values:Xk,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Po({values:Jk,defaultWidth:"wide"}),day:Po({values:eM,defaultWidth:"wide"}),dayPeriod:Po({values:tM,defaultWidth:"wide",formattingValues:rM,defaultFormattingWidth:"wide"})};function Uo(e){return(t,n={})=>{let o=n.width,i=o&&e.matchPatterns[o]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let c=a[0],l=o&&e.parsePatterns[o]||e.parsePatterns[e.defaultParseWidth],m=Array.isArray(l)?iM(l,E=>E.test(c)):oM(l,E=>E.test(c)),f;f=e.valueCallback?e.valueCallback(m):m,f=n.valueCallback?n.valueCallback(f):f;let h=t.slice(c.length);return{value:f,rest:h}}}function oM(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function iM(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function sy(e){return(t,n={})=>{let o=t.match(e.matchPattern);if(!o)return null;let i=o[0],a=t.match(e.parsePattern);if(!a)return null;let c=e.valueCallback?e.valueCallback(a[0]):a[0];c=n.valueCallback?n.valueCallback(c):c;let l=t.slice(i.length);return{value:c,rest:l}}}var aM=/^(\d+)(th|st|nd|rd)?/i,sM=/\d+/i,cM={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},pM={any:[/^b/i,/^(a|c)/i]},uM={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},lM={any:[/1/i,/2/i,/3/i,/4/i]},mM={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},dM={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},fM={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},gM={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},hM={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},yM={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},cy={ordinalNumber:sy({matchPattern:aM,parsePattern:sM,valueCallback:e=>parseInt(e,10)}),era:Uo({matchPatterns:cM,defaultMatchWidth:"wide",parsePatterns:pM,defaultParseWidth:"any"}),quarter:Uo({matchPatterns:uM,defaultMatchWidth:"wide",parsePatterns:lM,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Uo({matchPatterns:mM,defaultMatchWidth:"wide",parsePatterns:dM,defaultParseWidth:"any"}),day:Uo({matchPatterns:fM,defaultMatchWidth:"wide",parsePatterns:gM,defaultParseWidth:"any"}),dayPeriod:Uo({matchPatterns:hM,defaultMatchWidth:"any",parsePatterns:yM,defaultParseWidth:"any"})};var Rl={code:"en-US",formatDistance:ny,formatLong:oy,formatRelative:iy,localize:ay,match:cy,options:{weekStartsOn:0,firstWeekContainsDate:1}};var TM=["years","months","weeks","days","hours","minutes","seconds"];function py(e,t){let n=Fh(),o=t?.locale??n.locale??Rl,i=t?.format??TM,a=t?.zero??!1,c=t?.delimiter??" ";return o.formatDistance?i.reduce((m,f)=>{let h=`x${f.replace(/(^.)/,I=>I.toUpperCase())}`,E=e[f];return E!==void 0&&(a||e[f])?m.concat(o.formatDistance(h,E)):m},[]).join(c):""}function uy(e,t){let{start:n,end:o}=ry(t?.in,e),i={},a=ty(o,n);a&&(i.years=a);let c=Ro(n,{years:i.years}),l=Jh(o,c);l&&(i.months=l);let m=Ro(c,{months:i.months}),f=Yh(o,m);f&&(i.days=f);let h=Ro(m,{days:i.days}),E=Vh(o,h);E&&(i.hours=E);let I=Ro(h,{hours:i.hours}),g=Qh(o,I);g&&(i.minutes=g);let T=Ro(I,{minutes:i.minutes}),S=ey(o,T);return S&&(i.seconds=S),i}var f8=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z"));var A8=60*1e3;var aW=1/1e6,Pl=1e3,sa=60*Pl,AM=60*sa,_c=24*AM,sW=7*_c,cW=30*_c;var Ul=["past-5-minutes","past-15-minutes","past-30-minutes","past-1-hour","past-2-hours","past-4-hours","past-6-hours","past-12-hours","past-24-hours","past-2-days","past-3-days","past-7-days","past-30-days","past-3-months","current-day","current-week","current-month","current-year","previous-day","previous-week","previous-month","previous-3-months","previous-year"];var OM={s:1,m:60,h:3600,d:86400};function my(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<48||n>57)return!1}return!0}function dy(){return Math.floor(Date.now()/1e3)}function Ic(e){if(typeof e=="number")return e;if(e==="now")return dy();if(e.startsWith("-")&&e.length>=3){let n=e.at(-1),o=n?OM[n]:void 0;if(o){let i=e.slice(1,-1);if(i.length>0&&my(i))return dy()-parseInt(i,10)*o}}if(my(e)&&e.length>0)return parseInt(e,10);let t=Date.parse(e);if(!Number.isNaN(t))return Math.floor(t/1e3);throw new Error(`Invalid time value: ${e}. Use unix seconds, relative (-30m, -1h), 'now', or ISO 8601.`)}var y={};Yt(y,{Assign:()=>xM,Clone:()=>jn,Create:()=>N0,Discard:()=>L0,Metrics:()=>er,Update:()=>k0});var er={assign:0,create:0,clone:0,discard:0,update:0};function xM(e,t){return er.assign+=1,{...e,...t}}var s={};Yt(s,{Counted:()=>zM,Entries:()=>QM,EntriesRegExp:()=>VM,Every:()=>FM,EveryAll:()=>BM,GraphemeCount:()=>$M,HasPropertyKey:()=>YM,IsArray:()=>pa,IsBigInt:()=>ca,IsBoolean:()=>by,IsClassInstance:()=>GM,IsConstructor:()=>vM,IsDeepEqual:()=>Ll,IsEqual:()=>te,IsFunction:()=>Sy,IsGreaterEqualThan:()=>Oy,IsGreaterThan:()=>kM,IsInteger:()=>vl,IsLessEqualThan:()=>Ay,IsLessThan:()=>MM,IsMaxLength:()=>jM,IsMinLength:()=>qM,IsMultipleOf:()=>DM,IsNull:()=>Ac,IsNumber:()=>Oc,IsObject:()=>ua,IsObjectNotArray:()=>NM,IsString:()=>xc,IsSymbol:()=>LM,IsUndefined:()=>Nl,IsUnsafePropertyKey:()=>Ry,IsValueLike:()=>xy,Keys:()=>Sc,ShiftLeft:()=>Rc,Some:()=>HM,SomeAll:()=>KM,Symbols:()=>WM,Values:()=>ZM});function Gn(e,t,n){return e>=t&&e<=n}function RM(e){return e===8205}function CM(e){return Gn(e,55296,56319)}function fy(e){return Gn(e,127462,127487)}function hy(e){return Gn(e,65024,65039)}function yy(e){return Gn(e,768,879)||Gn(e,6832,6911)||Gn(e,7616,7679)||Gn(e,65056,65071)}function bc(e){return e>65535?2:1}function gy(e,t){for(;t<e.length;){let n=e.codePointAt(t);if(yy(n)||hy(n))t+=bc(n);else break}return t}function wl(e,t){let n=e.codePointAt(t),o=t+bc(n);for(o=gy(e,o);o<e.length-1&&e[o]==="\u200D";){let i=e.codePointAt(o+1);o+=1+bc(i),o=gy(e,o)}return fy(n)&&o<e.length&&fy(e.codePointAt(o))&&(o+=bc(e.codePointAt(o))),o}function Ty(e){return CM(e)||yy(e)||hy(e)||RM(e)}function Ey(e){let t=0,n=0;for(;n<e.length;)n=wl(e,n),t++;return t}function PM(e,t){if(t===0)return!0;let n=0,o=0;for(;o<e.length;)if(o=wl(e,o),n++,n>=t)return!0;return!1}function UM(e,t){let n=0,o=0;for(;o<e.length;)if(o=wl(e,o),n++,n>t)return!1;return!0}function _y(e,t){if(t===0)return!0;let n=0;for(;n<e.length;){if(Ty(e.charCodeAt(n)))return PM(e,t);if(n++,n>=t)return!0}return!1}function Iy(e,t){let n=0;for(;n<e.length;){if(Ty(e.charCodeAt(n)))return UM(e,t);if(n++,n>t)return!1}return!0}function pa(e){return Array.isArray(e)}function ca(e){return te(typeof e,"bigint")}function by(e){return te(typeof e,"boolean")}function vM(e){if(Nl(e)||!Sy(e))return!1;let t=Function.prototype.toString.call(e);return!!(/^class\s/.test(t)||/\[native code\]/.test(t))}function Sy(e){return te(typeof e,"function")}function vl(e){return Number.isInteger(e)}function Ac(e){return te(e,null)}function Oc(e){return Number.isFinite(e)}function NM(e){return ua(e)&&!pa(e)}function ua(e){return te(typeof e,"object")&&!Ac(e)}function xc(e){return te(typeof e,"string")}function LM(e){return te(typeof e,"symbol")}function Nl(e){return te(e,void 0)}function te(e,t){return e===t}function kM(e,t){return e>t}function MM(e,t){return e<t}function Ay(e,t){return e<=t}function Oy(e,t){return e>=t}function DM(e,t){if(ca(e)||ca(t))return BigInt(e)%BigInt(t)===0n;let n=1e-10;if(!Oc(e)||vl(e)&&1/t%1===0)return!0;let o=e%t;return Math.min(Math.abs(o),Math.abs(o-t),Math.abs(o+t))<n}function GM(e){if(!ua(e))return!1;let t=globalThis.Object.getPrototypeOf(e);return Ac(t)?!1:te(typeof t.constructor,"function")&&!(te(t.constructor,globalThis.Object)||te(t.constructor.name,"Object"))}function xy(e){return ca(e)||by(e)||Ac(e)||Oc(e)||xc(e)||Nl(e)}function $M(e){return Ey(e)}function jM(e,t){return Iy(e,t)}function qM(e,t){return _y(e,t)}function FM(e,t,n){for(let o=t;o<e.length;o++)if(!n(e[o],o))return!1;return!0}function BM(e,t,n){let o=!0;for(let i=t;i<e.length;i++)n(e[i],i)||(o=!1);return o}function HM(e,t){for(let n=0;n<e.length;n++)if(t(e[n],n))return!0;return!1}function KM(e,t){let n=!1;for(let o=0;o<e.length;o++)t(e[o],o)&&(n=!0);return n}function zM(e,t){return e.reduce((n,o,i)=>t(o,i)?++n:n,0)}function Rc(e,t,n){return te(e.length,0)?n():t(e[0],e.slice(1))}function Ry(e){return te(e,"__proto__")||te(e,"constructor")||te(e,"prototype")}function YM(e,t){return Ry(t)?Object.prototype.hasOwnProperty.call(e,t):t in e}function VM(e){return Sc(e).map(t=>[new RegExp(`^${t}$`),e[t]])}function QM(e){return Object.entries(e)}function Sc(e){return Object.getOwnPropertyNames(e)}function WM(e){return Object.getOwnPropertySymbols(e)}function ZM(e){return Object.values(e)}function XM(e,t){if(!ua(t))return!1;let n=Sc(e);return te(n.length,Sc(t).length)&&n.every(o=>Ll(e[o],t[o]))}function JM(e,t){return pa(t)&&te(e.length,t.length)&&e.every((n,o)=>Ll(e[o],t[o]))}function Ll(e,t){return pa(e)?JM(e,t):ua(e)?XM(e,t):te(e,t)}var Tt={};Yt(Tt,{IsBigInt64Array:()=>d0,IsBigUint64Array:()=>f0,IsBoolean:()=>e0,IsDate:()=>h0,IsFloat32Array:()=>l0,IsFloat64Array:()=>m0,IsInt16Array:()=>s0,IsInt32Array:()=>p0,IsInt8Array:()=>o0,IsMap:()=>T0,IsNumber:()=>t0,IsRegExp:()=>g0,IsSet:()=>y0,IsString:()=>r0,IsTypeArray:()=>n0,IsUint16Array:()=>c0,IsUint32Array:()=>u0,IsUint8Array:()=>i0,IsUint8ClampedArray:()=>a0});function e0(e){return e instanceof Boolean}function t0(e){return e instanceof Number}function r0(e){return e instanceof String}function n0(e){return globalThis.ArrayBuffer.isView(e)}function o0(e){return e instanceof globalThis.Int8Array}function i0(e){return e instanceof globalThis.Uint8Array}function a0(e){return e instanceof globalThis.Uint8ClampedArray}function s0(e){return e instanceof globalThis.Int16Array}function c0(e){return e instanceof globalThis.Uint16Array}function p0(e){return e instanceof globalThis.Int32Array}function u0(e){return e instanceof globalThis.Uint32Array}function l0(e){return e instanceof globalThis.Float32Array}function m0(e){return e instanceof globalThis.Float64Array}function d0(e){return e instanceof globalThis.BigInt64Array}function f0(e){return e instanceof globalThis.BigUint64Array}function g0(e){return e instanceof globalThis.RegExp}function h0(e){return e instanceof globalThis.Date}function y0(e){return e instanceof globalThis.Set}function T0(e){return e instanceof globalThis.Map}var Cc=s;function _0(e){return s.HasPropertyKey(e,"~kind")||s.HasPropertyKey(e,"~unsafe")}function I0(e){let t={};for(let n of Object.getOwnPropertyNames(e)){if(s.IsUnsafePropertyKey(n))continue;let o=Object.getOwnPropertyDescriptor(e,n);o.value=$n(o.value),s.IsEqual(o.enumerable,!0)?t[n]=o.value:Object.defineProperty(t,n,o)}return t}function b0(e){let t={};for(let n of s.Keys(e))s.IsUnsafePropertyKey(n)||(t[n]=$n(e[n]));for(let n of s.Symbols(e))t[n]=$n(e[n]);return t}function S0(e){return s.IsClassInstance(e)?e:_0(e)?I0(e):b0(e)}function A0(e){return e.map(t=>$n(t))}function O0(e){return e.slice()}function x0(e){return new RegExp(e.source,e.flags)}function R0(e){return new Map($n([...e.entries()]))}function C0(e){return new Set($n([...e.values()]))}function $n(e){return Tt.IsTypeArray(e)?O0(e):Tt.IsRegExp(e)?x0(e):Tt.IsMap(e)?R0(e):Tt.IsSet(e)?C0(e):s.IsArray(e)?A0(e):s.IsObject(e)?S0(e):e}function jn(e){return er.clone+=1,$n(e)}var rt={};Yt(rt,{Get:()=>w0,Reset:()=>P0,Set:()=>U0});var pr={immutableTypes:!1,maxErrors:8,maxInstantiationCount:128,useAcceleration:!0,exactOptionalPropertyTypes:!1,enumerableKind:!1,correctiveParse:!1,unionPrioritySort:!0};function P0(){pr.immutableTypes=!1,pr.maxErrors=8,pr.maxInstantiationCount=128,pr.useAcceleration=!0,pr.exactOptionalPropertyTypes=!1,pr.enumerableKind=!1,pr.correctiveParse=!1,pr.unionPrioritySort=!0}function U0(e){for(let t of s.Keys(e)){let n=e[t];n!==void 0&&Object.defineProperty(pr,t,{value:n})}}function w0(){return pr}function v0(e,t){for(let n of Object.keys(t))Object.defineProperty(e,n,{configurable:!0,writable:!0,enumerable:!1,value:t[n]});return e}function Cy(e,t){return{...e,...t}}function N0(e,t,n={}){er.create+=1;let o=rt.Get(),i=Cy(t,n),a=o.enumerableKind?Cy(i,e):v0(i,e);return o.immutableTypes?Object.freeze(a):a}function L0(e,t){er.discard+=1;let n={};for(let o of Object.getOwnPropertyNames(e)){if(t.includes(o))continue;let i=Object.getOwnPropertyDescriptor(e,o);i.value=jn(i.value),Object.defineProperty(n,o,i)}return n}function k0(e,t,n){er.update+=1;let o=rt.Get(),i=jn(e);for(let a of Object.keys(t))Object.defineProperty(i,a,{configurable:!0,writable:!0,enumerable:o.enumerableKind,value:t[a]});for(let a of Object.keys(n))Object.defineProperty(i,a,{configurable:!0,enumerable:!0,writable:!0,value:n[a]});return i}function w(e,t){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.IsEqual(e["~kind"],t)}function Ue(e){return s.IsObject(e)}function v(e,t,n){return y.Create({"~kind":"Deferred"},{type:"deferred",action:e,parameters:t,options:n},{})}function on(e){return w(e,"Deferred")}function M0(e){return y.Update(e,{"~readonly":!0},{})}function la(e,t){return y.Update(M0(e),{},t)}function Py(e,t,n,o){let i=O(e,t,n);return la(i,o)}function D0(e){return y.Update(e,{"~optional":!0},{})}function ma(e,t){return y.Update(D0(e),{},t)}function Uy(e,t,n,o){let i=O(e,t,n);return ma(i,o)}function Pt(e,t){return y.Create({"~kind":"Array"},{type:"array",items:e},t)}function Z(e){return w(e,"Array")}function wo(e){return y.Discard(e,["~kind","type","items"])}function ur(e,t,n={}){return y.Create({"~kind":"Constructor"},{type:"constructor",parameters:e,instanceType:t},n)}function Be(e){return w(e,"Constructor")}function wy(e){return y.Discard(e,["~kind","type","parameters","instanceType"])}function lr(e,t,n={}){return y.Create({"~kind":"Function"},{type:"function",parameters:e,returnType:t},n)}function He(e){return w(e,"Function")}function vy(e){return y.Discard(e,["~kind","type","parameters","returnType"])}function nt(e,t){return y.Create({"~kind":"Ref"},{$ref:e},t)}function ce(e){return w(e,"Ref")}function an(e,t){return y.Create({"~kind":"Generic"},{type:"generic",parameters:e,expression:t})}function vo(e){return w(e,"Generic")}function No(e){return y.Create({"~kind":"Any"},{},e)}function Ve(e){return w(e,"Any")}var Ny="(?!)";function me(e){return y.Create({"~kind":"Never"},{not:{}},e)}function tr(e){return w(e,"Never")}function mr(e,t={}){return v("AddOptional",[e],t)}function qn(e,t={}){return ma(e,t)}function Ly(e){return qn(e)}function et(e){return Ue(e)&&s.HasPropertyKey(e,"~optional")}function ky(e){return s.Keys(e).filter(t=>!et(e[t]))}function Pc(e){return s.Keys(e)}function Uc(e){return s.Values(e)}function k(e,t={}){let n=ky(e),o=n.length>0?{required:n}:{};return y.Create({"~kind":"Object"},{type:"object",...o,properties:e},t)}function D(e){return w(e,"Object")}function My(e){return y.Discard(e,["~kind","type","properties","required"])}function Qe(e){return y.Create({"~kind":"Unknown"},{},e)}function tt(e){return w(e,"Unknown")}function dr(e,t,n){let o=s.Keys(e).reduce((i,a)=>({...i,[a]:y.Update(e[a],{},{$id:a})}),{});return y.Create({"~kind":"Cyclic"},{$defs:o,$ref:t},n)}function Te(e){return w(e,"Cyclic")}function Dy(e){return y.Update(e,{"~unsafe":null},{})}function wc(e){return s.IsObjectNotArray(e)&&s.HasPropertyKey(e,"~unsafe")&&s.IsNull(e["~unsafe"])}var oe={};Yt(oe,{Match:()=>G0});function G0(e,t){return t[e.length]?.(...e)??(()=>{throw Error("Invalid Arguments")})()}function da(...e){let[t,n]=oe.Match(e,{2:(o,i)=>[o,i,i],1:o=>[o,Qe(),Qe()]});return y.Create({"~kind":"Infer"},{type:"infer",name:t,extends:n},{})}function Ke(e){return w(e,"Infer")}function Fn(e,t,n,o={}){return y.Create({"~kind":"Dependent"},{if:e,then:t,else:n},o)}function Le(e){return w(e,"Dependent")}function Gy(e){return y.Discard(e,["~kind","if","then","else"])}function $y(e){return s.IsObjectNotArray(e)}function jy(e){return s.Keys(e).filter(n=>isNaN(n)).reduce((n,o)=>[...n,e[o]],[])}function qy(e){return s.IsString(e)||s.IsNumber(e)}function Fy(e,t){let n=$y(e)?jy(e):e;return y.Create({"~kind":"Enum"},{enum:n},t)}function ze(e){return w(e,"Enum")}function ut(e,t={}){return y.Create({"~kind":"Intersect"},{allOf:e},t)}function M(e){return w(e,"Intersect")}function By(e){return y.Discard(e,["~kind","allOf"])}var Bn={};Yt(Bn,{Hash:()=>rD,HashCode:()=>Wy});function fe(){throw new Error("Unreachable")}function $0(e){let t=new Set,n=e;for(;n&&n!==Object.prototype;){for(let o of Reflect.ownKeys(n))o!=="constructor"&&typeof o!="symbol"&&t.add(o);n=Object.getPrototypeOf(n)}return[...t]}function j0(e){return typeof e=="number"}var Et;(function(e){e[e.Array=0]="Array",e[e.BigInt=1]="BigInt",e[e.Boolean=2]="Boolean",e[e.Date=3]="Date",e[e.Constructor=4]="Constructor",e[e.Function=5]="Function",e[e.Null=6]="Null",e[e.Number=7]="Number",e[e.Object=8]="Object",e[e.RegExp=9]="RegExp",e[e.String=10]="String",e[e.Symbol=11]="Symbol",e[e.TypeArray=12]="TypeArray",e[e.Undefined=13]="Undefined"})(Et||(Et={}));var Lo=BigInt("14695981039346656037"),[q0,F0]=[BigInt("1099511628211"),BigInt("18446744073709551616")],B0=Array.from({length:256}).map((e,t)=>BigInt(t)),Yy=new Float64Array(1),Vy=new DataView(Yy.buffer),Qy=new Uint8Array(Yy.buffer);function lt(e){Lo=Lo^B0[e],Lo=Lo*q0%F0}function H0(e){lt(Et.Array);for(let t of e)sn(t)}function K0(e){lt(Et.BigInt),Vy.setBigInt64(0,e);for(let t of Qy)lt(t)}function Ky(e){lt(Et.Boolean),lt(e?1:0)}function z0(e){lt(Et.Constructor),sn(e.toString())}function Y0(e){lt(Et.Date),sn(e.getTime())}function V0(e){lt(Et.Function),sn(e.toString())}function Q0(e){lt(Et.Null)}function zy(e){lt(Et.Number),Vy.setFloat64(0,e,!0);for(let t of Qy)lt(t)}function W0(e){lt(Et.Object);for(let t of $0(e).sort())sn(t),sn(e[t])}function Z0(e){lt(Et.RegExp),kl(e.toString())}var X0=new TextEncoder;function kl(e){lt(Et.String);for(let t of X0.encode(e))lt(t)}function J0(e){lt(Et.Symbol),sn(e.toString())}function eD(e){lt(Et.TypeArray);let t=new Uint8Array(e.buffer);for(let n=0;n<t.length;n++)lt(t[n])}function tD(e){return lt(Et.Undefined)}function sn(e){return Tt.IsTypeArray(e)?eD(e):Tt.IsDate(e)?Y0(e):Tt.IsRegExp(e)?Z0(e):Tt.IsBoolean(e)?Ky(e.valueOf()):Tt.IsString(e)?kl(e.valueOf()):Tt.IsNumber(e)?zy(e.valueOf()):j0(e)?zy(e):s.IsArray(e)?H0(e):s.IsBoolean(e)?Ky(e):s.IsBigInt(e)?K0(e):s.IsConstructor(e)?z0(e):s.IsNull(e)?Q0(e):s.IsObject(e)?W0(e):s.IsString(e)?kl(e):s.IsSymbol(e)?J0(e):s.IsUndefined(e)?tD(e):s.IsFunction(e)?V0(e):fe()}function Wy(e){return Lo=BigInt("14695981039346656037"),sn(e),Lo}function rD(e){return Wy(e).toString(16).padStart(16,"0")}function Zy(e){switch(e.keyword){case"additionalProperties":return"must not have additional properties";case"anyOf":return"must match a schema in anyOf";case"boolean":return"schema is false";case"const":return"must be equal to constant";case"contains":return"must contain at least 1 valid item";case"dependencies":return`must have properties ${e.params.dependencies.join(", ")} when property ${e.params.property} is present`;case"dependentRequired":return`must have properties ${e.params.dependencies.join(", ")} when property ${e.params.property} is present`;case"enum":return"must be equal to one of the allowed values";case"exclusiveMaximum":return`must be ${e.params.comparison} ${e.params.limit}`;case"exclusiveMinimum":return`must be ${e.params.comparison} ${e.params.limit}`;case"format":return`must match format "${e.params.format}"`;case"if":return`must match "${e.params.failingKeyword}" schema`;case"maxItems":return`must not have more than ${e.params.limit} items`;case"maxLength":return`must not have more than ${e.params.limit} characters`;case"maxProperties":return`must not have more than ${e.params.limit} properties`;case"maximum":return`must be ${e.params.comparison} ${e.params.limit}`;case"minItems":return`must not have fewer than ${e.params.limit} items`;case"minLength":return`must not have fewer than ${e.params.limit} characters`;case"minProperties":return`must not have fewer than ${e.params.limit} properties`;case"minimum":return`must be ${e.params.comparison} ${e.params.limit}`;case"multipleOf":return`must be multiple of ${e.params.multipleOf}`;case"not":return"must not be valid";case"oneOf":return"must match exactly one schema in oneOf";case"pattern":return`must match pattern "${e.params.pattern}"`;case"propertyNames":return`property names ${e.params.propertyNames.join(", ")} are invalid`;case"required":return`must have required properties ${e.params.requiredProperties.join(", ")}`;case"type":return typeof e.params.type=="string"?`must be ${e.params.type}`:`must be either ${e.params.type.join(" or ")}`;case"unevaluatedItems":return"must not have unevaluated items";case"unevaluatedProperties":return"must not have unevaluated properties";case"uniqueItems":return"must not have duplicate items";case"~refine":return e.params.message;default:return"an unknown validation error occurred"}}var nD=Zy;function Xy(){return nD}var fa=class{constructor(t,n){this.type=t,this.decode=n}Encode(t){let n=this.type,o=Hn(n)?c=>this.decode(n["~codec"].decode(c)):this.decode,i=Hn(n)?c=>n["~codec"].encode(t(c)):t,a={decode:o,encode:i};return y.Update(this.type,{"~codec":a},{})}},ga=class{constructor(t){this.type=t}Decode(t){return new fa(this.type,t)}};function vc(e){return new ga(e)}function eT(e,t){return vc(e).Decode(t).Encode(()=>{throw Error("Encode not implemented")})}function tT(e,t){return vc(e).Decode(()=>{throw Error("Decode not implemented")}).Encode(t)}function Hn(e){return Ue(e)&&s.HasPropertyKey(e,"~codec")&&s.IsObject(e["~codec"])&&s.HasPropertyKey(e["~codec"],"encode")&&s.HasPropertyKey(e["~codec"],"decode")}function rT(e){return ko(e)}function Kn(e){return Ue(e)&&s.HasPropertyKey(e,"~immutable")}function fr(e,t={}){return v("AddReadonly",[e],t)}function zn(e,t={}){return la(e,t)}function nT(e){return zn(e)}function Yn(e){return Ue(e)&&s.HasPropertyKey(e,"~readonly")}function iD(e,t){let n=Nc(e)?[...e["~refine"],t]:[t];return y.Update(e,{"~refine":n},{})}function oT(...e){let[t,n,o]=oe.Match(e,{3:(i,a,c)=>[i,a,c],2:(i,a)=>[i,a,()=>"Refine Error"]});return iD(t,{check:n,error:o})}function aD(e){return s.IsObjectNotArray(e)&&s.HasPropertyKey(e,"check")&&s.HasPropertyKey(e,"error")&&s.IsFunction(e.check)&&s.IsFunction(e.error)}function Nc(e){return Ue(e)&&s.HasPropertyKey(e,"~refine")&&s.IsArray(e["~refine"])&&s.Every(e["~refine"],0,t=>aD(t))}var iT="-?(?:0|[1-9][0-9]*)n";function ha(e){return y.Create({"~kind":"BigInt"},{type:"bigint"},e)}function vt(e){return w(e,"BigInt")}function Lc(e){return y.Create({"~kind":"Boolean"},{type:"boolean"},e)}function _t(e){return w(e,"Boolean")}function ya(e){return y.Create({"~kind":"Identifier"},{name:e})}function aT(e){return w(e,"Identifier")}var kc="-?(?:0|[1-9][0-9]*)";function Vn(e){return y.Create({"~kind":"Integer"},{type:"integer"},e)}function ot(e){return w(e,"Integer")}var Ml=class extends Error{constructor(t){super("Invalid Literal value"),Object.defineProperty(this,"cause",{value:{value:t},writable:!1,configurable:!1,enumerable:!1})}};function sD(e){return s.IsBigInt(e)?"bigint":s.IsBoolean(e)?"boolean":s.IsNumber(e)?"number":s.IsString(e)?"string":(()=>{throw new Ml(e)})()}function z(e,t){return y.Create({"~kind":"Literal"},{type:sD(e),const:e},t)}function Mc(e){return s.IsBigInt(e)||s.IsBoolean(e)||s.IsNumber(e)||s.IsString(e)}function sT(e){return Q(e)&&s.IsBigInt(e.const)}function cT(e){return Q(e)&&s.IsBoolean(e.const)}function Dc(e){return Q(e)&&s.IsNumber(e.const)}function Gc(e){return Q(e)&&s.IsString(e.const)}function Q(e){return w(e,"Literal")}function Mo(e){return y.Create({"~kind":"Null"},{type:"null"},e)}function gr(e){return w(e,"Null")}var $c="-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?";function Nt(e){return y.Create({"~kind":"Number"},{type:"number"},e)}function Ce(e){return w(e,"Number")}function Do(e){return y.Create({"~kind":"Symbol"},{type:"symbol"},e)}function hr(e){return w(e,"Symbol")}function Qn(...e){let[t,n,o]=oe.Match(e,{3:(i,a,c)=>[i,a,c],2:(i,a)=>[i,a,a],1:i=>[i,Qe(),Qe()]});return y.Create({"~kind":"Parameter"},{name:t,extends:n,equals:o},{})}function pT(e){return w(e,"Parameter")}var jc=".*";function It(e){return y.Create({"~kind":"String"},{type:"string"},e)}function We(e){return w(e,"String")}function F(e,t={}){return y.Create({"~kind":"Union"},{anyOf:e},t)}function R(e){return w(e,"Union")}function uT(e){return y.Discard(e,["~kind","anyOf"])}function Ta(e){let t=lT(e);return s.IsEqual(t.length,2)?t[0]:[]}function cD(e){return!0}function mT(e){return s.ShiftLeft(e,(t,n)=>pD(t)?mT(n):!1,()=>!0)}function dT(e){return s.IsEqual(e.length,0)?!1:mT(e)}function pD(e){return R(e)?dT(e.anyOf):Q(e)?cD(e.const):!1}function qc(e){return dT(e)}function Fc(e){return y.Create({"~kind":"TemplateLiteral"},{type:"string",pattern:e},{})}function fT(e,t,n=[]){return s.ShiftLeft(e,(o,i)=>fT(i,t,[...n,`${o}${t}`]),()=>n)}function uD(e,t){return s.IsEqual(e.length,0)?[`${t}`]:fT(e,t)}function gT(e,t,n=[]){return s.ShiftLeft(t,(o,i)=>gT(e,i,[...n,...hT(e,o)]),()=>n)}function hT(e,t){return R(t)?gT(e,t.anyOf):Q(t)?uD(e,t.const):fe()}function yT(e,t){return s.ShiftLeft(t,(n,o)=>yT(hT(e,n),o),()=>e)}function lD(e){return e.map(t=>z(t))}function mD(e){let t=yT([],e),n=lD(t);return F(n)}function dD(e){return s.IsEqual(e.length,0)?fe():s.IsEqual(e.length,1)&&Q(e[0])?e[0]:mD(e)}function Dl(e){let t=Ta(e);return s.IsEqual(t.length,0)?It():qc(t)?dD(t):Fc(e)}function Ea(e){let t=Dl(e);return Ee(t)?It():t}function Ut(e,t){let n="object",o={[e]:t};return y.Create({"~kind":"Record"},{type:n,patternProperties:o})}function TT(e){return Ut($t,e)}function ET(e){return k({true:e,false:e})}function ke(e,t={}){let[n,o,i]=[e,e.length,!1];return y.Create({"~kind":"Tuple"},{type:"array",additionalItems:i,items:n,minItems:o},t)}function Y(e){return w(e,"Tuple")}function _T(e){return y.Discard(e,["~kind","type","items","minItems","additionalItems"])}function fD(e){return y.Discard(e,["~readonly"])}function Gl(e,t){return y.Update(fD(e),{},t)}function IT(e,t,n,o){let i=O(e,t,n);return Gl(i,o)}function bT(e,t={}){return v("RemoveReadonly",[e],t)}function ST(e,t={}){return Gl(e,t)}function gD(e){return y.Discard(e,["~optional"])}function $l(e,t){return y.Update(gD(e),{},t)}function AT(e,t,n,o){let i=O(e,t,n);return $l(i,o)}function OT(e,t={}){return v("RemoveOptional",[e],t)}function Bc(e,t={}){return $l(e,t)}function jl(e){return e.reduceRight((n,o,i)=>({[i]:o,...n}),{})}function xT(e){let t=jl(e.items);return k(t)}function hD(e,t){return Yn(e)?!!Yn(t):!1}function yD(e,t){return et(e)?!!et(t):!1}function TD(e,t){let n=hD(e,t),o=yD(e,t),i=we([e,t]),a=ST(Bc(i));return n&&o?zn(qn(a)):n&&!o?zn(a):!n&&o?qn(a):a}function ED(e,t,n){return n in e?n in t?TD(e[n],t[n]):e[n]:n in t?t[n]:me()}function _D(e,t){return[...new Set([...s.Keys(t),...s.Keys(e)])].reduce((o,i)=>({...o,[i]:ED(e,t,i)}),{})}function RT(e){return D(e)?e.properties:Y(e)?jl(e.items):fe()}function CT(e,t){let n=RT(e),o=RT(t),i=_D(n,o);return k(i)}function PT(e,t){let n=Wn(e,t);return s.IsEqual(n,Ia)?e:s.IsEqual(n,ba)||s.IsEqual(n,_a)?t:me()}function UT(e){return D(e)||Y(e)}function ID(e,t){let n=R(e),o=R(t);return n||o}function bD(e,t){let n=Vt(e),o=Vt(t),i=ID(n,o),a=UT(n),c=UT(o);return i?we([n,o]):a&&c?CT(n,o):a&&!c?n:!a&&c?o:PT(n,o)}function wT(e,t,n=[]){return s.ShiftLeft(t,(o,i)=>wT(e,i,[...n,bD(e,o)]),()=>s.IsEqual(n.length,0)?[e]:n)}function vT(e,t,n=[]){return s.ShiftLeft(e,(o,i)=>vT(i,t,[...n,...Sa([o],t)]),()=>n)}function Sa(e,t=[]){return s.ShiftLeft(e,(n,o)=>R(n)?Sa(o,vT(n.anyOf,t)):Sa(o,wT(n,t)),()=>t)}function SD(e,t){let n=dt({},e,t);return G.IsExtendsTrueLike(n)?[]:[e]}function AD(e,t){return e.reduce((n,o)=>[...n,...SD(o,t)],[])}function Hc(e,t){let n=Vt(e),o=R(n)?n.anyOf:[n],i=AD(o,t);return Lt(i)}function rr(e,t,n){let o=ut([e,t]),i=Hc(n,e);return Lt([o,i])}function wt(e){let t=e.map(n=>z(n));return Lt(t)}function we(e){let t=Sa(e),n=ql(t);return Mr(n)}function ht(e){let t=Ea(e);return Vt(t)}function Lt(e){let t=ql(e);return Mr(t)}function Vt(e){return Le(e)?rr(e.if,e.then,e.else):ze(e)?wt(e.enum):M(e)?we(e.allOf):Ee(e)?ht(e.pattern):R(e)?Lt(e.anyOf):e}function Mr(e){return s.IsEqual(e.length,1)?e[0]:s.IsEqual(e.length,0)?me():F(e)}function NT(e,t){let n=wt(e);return cn(n,t)}function LT(e,t){return Ut(pn,t)}function kT(e,t){let n=we(e);return cn(n,t)}function MT(e,t){return s.IsString(e)||s.IsNumber(e)?k({[e]:t}):s.IsEqual(e,!1)?k({false:t}):s.IsEqual(e,!0)?k({true:t}):k({})}function DT(e,t){return Ut(Go,t)}function GT(e,t){return s.HasPropertyKey(e,"pattern")&&(s.IsString(e.pattern)||e.pattern instanceof RegExp)?Ut(e.pattern.toString(),t):Ut($t,t)}function $T(e,t){let n=Ta(e);return qc(n)?cn(ht(e),t):Ut(e,t)}function OD(e){return R(e)?$o(e.anyOf):[e]}function $o(e){return e.reduce((t,n)=>[...t,...OD(n)],[])}function xD(e){return e.some(t=>We(t)||Ce(t)||ot(t))}function RD(e,t){return s.IsEqual(xD(e),!0)?Ut($t,t):void 0}function CD(e,t){return e.reduce((n,o)=>Q(o)&&(s.IsString(o.const)||s.IsNumber(o.const))?{...n,[o.const]:t}:n,{})}function PD(e,t){let n=CD(e,t);return k(n)}function jT(e,t){let n=$o(e),o=RD(n,t);return Ue(o)?o:PD(n,t)}function cn(e,t){return Ve(e)?TT(t):_t(e)?ET(t):ze(e)?NT(e.enum,t):ot(e)?LT(e,t):M(e)?kT(e.allOf,t):Q(e)?MT(e.const,t):Ce(e)?DT(e,t):R(e)?jT(e.anyOf,t):We(e)?GT(e,t):Ee(e)?$T(e.pattern,t):k({})}function Fl(e,t,n){return K([e])?y.Update(cn(e,t),{},n):Kc(e,t,n)}function qT(e,t,n,o,i){let a=O(e,t,n),c=O(e,t,o);return Fl(a,c,i)}var pn=`^${kc}$`,Go=`^${$c}$`,$t=`^${jc}$`;function Kc(e,t,n={}){return v("Record",[e,t],n)}function jo(e,t,n={}){return Fl(e,t,n)}function zc(e,t){return Ut(e,t)}function Yc(e){return s.IsEqual(e,$t)?It():s.IsEqual(e,pn)?Vn():s.IsEqual(e,Go)?Nt():Dl(e)}function it(e){return s.Keys(e.patternProperties)[0]}function un(e){let t=it(e);return Yc(t)}function Se(e){return e.patternProperties[it(e)]}function de(e){return w(e,"Record")}function Zn(e){return y.Create({"~kind":"Rest"},{type:"rest",items:e},{})}function ln(e){return w(e,"Rest")}function Vc(e){return y.Create({"~kind":"This"},{$ref:"#"},e)}function Qc(e){return w(e,"This")}function qo(e){return y.Create({"~kind":"Undefined"},{type:"undefined"},e)}function nr(e){return w(e,"Undefined")}function Wc(e){return y.Create({"~kind":"Void"},{type:"void"},e)}function kt(e){return w(e,"Void")}function wD(e,t){return s.IsEqual(e,"Array")?Pt(t[0]):s.IsEqual(e,"Capitalize")?Xc(t[0]):s.IsEqual(e,"ConstructorParameters")?np(t[0]):s.IsEqual(e,"Evaluate")?F_(t[0]):s.IsEqual(e,"Exclude")?op(t[0],t[1]):s.IsEqual(e,"Extract")?ip(t[0],t[1]):s.IsEqual(e,"Index")?Ra(t[0],t[1]):s.IsEqual(e,"InstanceType")?ap(t[0]):s.IsEqual(e,"Lowercase")?Jc(t[0]):s.IsEqual(e,"NonNullable")?sp(t[0]):s.IsEqual(e,"Omit")?cp(t[0],t[1]):s.IsEqual(e,"Parameters")?pp(t[0]):s.IsEqual(e,"Partial")?up(t[0]):s.IsEqual(e,"Pick")?lp(t[0],t[1]):s.IsEqual(e,"Readonly")?mp(t[0]):s.IsEqual(e,"KeyOf")?Ca(t[0]):s.IsEqual(e,"Record")?Kc(t[0],t[1]):s.IsEqual(e,"Required")?dp(t[0]):s.IsEqual(e,"ReturnType")?fp(t[0]):s.IsEqual(e,"Uncapitalize")?ep(t[0]):s.IsEqual(e,"Uppercase")?tp(t[0]):xa(nt(e),t)}function Xn(){throw Error("Unreachable")}function zT(e,t=[]){return s.ShiftLeft(e,(n,o)=>zT(o,[...t,n[1]]),()=>t)}function Dr(e){return s.IsEqual(e.length,3)?[e[0],...zT(e[1])]:[]}function YT(e){return Qn(e[0],e[2],e[4])}function VT(e){return Qn(e[0],e[2],e[2])}function QT(e){return Qn(e[0],Qe(),e[2])}function WT(e){return Qn(e,Qe(),Qe())}function ZT(e){return Dr(e)}function XT(e){return e[1]}function JT(e){return Dr(e)}function eE(e){return e[1]}function tE(e){return wD(e[0],e[1])}function rE(e){return null}function nE(e){return It()}function oE(e){return Nt()}function iE(e){return Lc()}function aE(e){return qo()}function sE(e){return Mo()}function cE(e){return Vn()}function pE(e){return ha()}function uE(e){return Qe()}function lE(e){return No()}function mE(e){return k({})}function dE(e){return me()}function fE(e){return Do()}function gE(e){return Wc()}function hE(e){return Vc()}function yE(e){return z(BigInt(e))}function TE(e){return z(s.IsEqual(e,"true"))}function EE(e){return z(parseFloat(e))}function _E(e){return z(e)}function IE(e){return e[1]}function bE(e){return z(e)}function SE(e){return s.IsEqual(e.length,3)?[e[0],e[1],...e[2]]:[e[0]]}function AE(e){return e[1]}function OE(e){return Zc(e)}function xE(e){return s.IsEqual(e.length,6)?Fn(e[1],e[3],e[5]):Fn(e[1],e[3],Qe())}function RE(e){return e.length>0}function CE(e){return e.reduce((t,n)=>s.IsEqual(n.length,3)?[...t,[n[1]]]:[...t,[]],[])}function PE(e){return s.IsEqual(e.length,6)?[e[1],e[3],e[5]]:[]}function UE(e){return s.IsArray(e)&&s.IsEqual(e.length,3)?e[1]:e}function wE(e){return s.IsEqual(e.length,2)?e[1]:[]}function FT(e,t){return t.reduce((n,o)=>{let i=o;return s.IsEqual(i.length,1)?Ra(n,i[0]):s.IsEqual(i.length,0)?Pt(n):Xn()},e)}function BT(e,t){return s.IsEqual(t.length,3)?rp(e,t[0],t[1],t[2]):e}function vD(e,t){return s.IsArray(t)&&s.IsEqual(t.length,0)?e:gp(e,t)}function vE(e){let[t,n,o,i,a]=e;return vD(BT(t?Ca(FT(n,o)):FT(n,o),i),a)}function Bl(e,t){return s.IsEqual(t.length,3)?(()=>{let[n,o,i]=t,a=Bl(o,i);if(s.IsEqual(n,"&"))return M(a)?ut([e,...a.allOf]):ut([e,a]);if(s.IsEqual(n,"|"))return R(a)?F([e,...a.anyOf]):F([e,a]);Xn()})():e}function NE(e){let[t,n]=e;return Bl(t,n)}function LE(e){let[t,n]=e;return Bl(t,n)}function kE(e){return q_(e[1])}function ME(e){return e[1]}function DE(e){return an(e[0],e[2])}function GE(e){return s.IsEqual(e.length,4)?da(e[1],e[3]):s.IsEqual(e.length,2)?da(e[1],Qe()):Xn()}function $E(e){return`${e}`}function jE(e){return ot(e[3])?pn:Ce(e[3])?Go:hr(e[3])?$t:We(e[3])?$t:Xn()}function qE(e){return e.length>0}function FE(e){return e.length>0}function BE(e){let[t,n,o,i,a]=e;return{[n]:t&&o?fr(mr(a)):t&&!o?fr(a):!t&&o?mr(a):a}}function HE(e){return Dr(e)}function KE(e){return e.reduce((t,n)=>s.HasPropertyKey(n,pn)||s.HasPropertyKey(n,Go)||s.HasPropertyKey(n,$t)?[t[0],y.Assign(t[1],n)]:[y.Assign(t[0],n),t[1]],[{},{}])}function zE(e){return KE(e[1])}function YE(e){let[t,n]=e,o=s.IsEqual(s.Keys(n).length,0)?{}:{patternProperties:n};return k(t,o)}function VE(e){return s.IsEqual(e.length,5)?fr(mr(e[4])):s.IsEqual(e.length,3)?e[2]:s.IsEqual(e.length,4)?s.IsEqual(e[2],"readonly")?fr(e[3]):mr(e[3]):Xn()}function QE(e){if(!s.IsArray(e)||!s.IsEqual(e.length,3))return e;let[t,n,o]=e;return t&&o?fr(mr(n)):t&&!o?fr(n):!t&&o?mr(n):n}function WE(e){return s.IsEqual(e.length,2)?Zn(e[1]):s.IsEqual(e.length,1)?e[0]:Xn()}function ZE(e){return Dr(e)}function XE(e){return ke(e[1])}function JE(e){return fr(mr(e[4]))}function e_(e){return fr(e[3])}function t_(e){return mr(e[3])}function r_(e){return e[2]}function n_(e){return s.IsEqual(e.length,2)?Zn(e[1]):s.IsEqual(e.length,1)?e[0]:Xn()}function o_(e){return Dr(e)}function i_(e){return lr(e[1],e[4])}function a_(e){return ur(e[2],e[5])}function HT(e,t){return s.IsEqual(e,"remove")?bT(t):s.IsEqual(e,"add")?fr(t):t}function s_(e){return s.IsEqual(e.length,2)&&s.IsEqual(e[0],"-")?"remove":s.IsEqual(e.length,2)&&s.IsEqual(e[0],"+")||s.IsEqual(e.length,1)?"add":"none"}function KT(e,t){return s.IsEqual(e,"remove")?OT(t):s.IsEqual(e,"add")?mr(t):t}function c_(e){return s.IsEqual(e.length,2)&&s.IsEqual(e[0],"-")?"remove":s.IsEqual(e.length,2)&&s.IsEqual(e[0],"+")||s.IsEqual(e.length,1)?"add":"none"}function p_(e){return s.IsEqual(e.length,2)?[e[1]]:[]}function u_(e){return s.IsArray(e[6])&&s.IsEqual(e[6].length,1)?Aa(ya(e[3]),e[5],e[6][0],HT(e[1],KT(e[8],e[10]))):Aa(ya(e[3]),e[5],nt(e[3]),HT(e[1],KT(e[8],e[10])))}function l_(e){return nt(e)}function m_(e){return BigInt(e)}function d_(e){return parseFloat(e)}function f_(e){return s.IsEqual(e,"true")}function g_(e){return null}function h_(e){return{[e[0]]:e[2]}}function y_(e){return Dr(e)}function ND(e){return e.reduce((t,n)=>y.Assign(t,n),{})}function T_(e){return ND(e[1])}function E_(e){return Dr(e)}function __(e){return e[1]}function I_(e){return ha()}function b_(e){return It()}function S_(e){return Nt()}function A_(e){return Vn()}function O_(e){return me()}function x_(e){return z(e)}function R_(e){return F(e[1])}function C_(e){return e.length===3?[...e[0],...e[2]]:e.length===1?[...e[0]]:[]}function P_(e){return[e[0],...e[1]]}function U_(e){return e[1]}function w_(e){return Dr(e)}function v_(e){return s.IsEqual(e.length,2)?e[1]:[]}function N_(e){let t=e[2],n=e[3],[o,i]=e[4],a=s.IsEqual(s.Keys(i).length,0)?{}:{patternProperties:i};return{[e[1]]:an(t,Oa(n,o,a))}}function L_(e){let t=e[2],[n,o]=e[3],i=s.IsEqual(s.Keys(o).length,0)?{}:{patternProperties:o};return{[e[1]]:Oa(t,n,i)}}function k_(e){return{[e[1]]:an(e[2],e[4])}}function M_(e){return{[e[1]]:e[3]}}function D_(e){return null}function G_(e){return Dr(e)}function $_(e){return e[1]}function j_(e){let[t,n]=[e[0],e[1]];return B_(y.Assign(t,KE(n)[0]))}function Pa(e){return te(e.length,2)}function W(e,t,n){return Pa(e)?t(e[0],e[1]):n()}function MD(e,t){return te(t.indexOf(e),0)?[e,t.slice(e.length)]:[]}function ve(e,t){for(let n=0;n<e.length;n++){let o=MD(e[n],t);if(Pa(o))return o}return[]}function Hl(e,t){return Array.from({length:t-e+1},(n,o)=>String.fromCharCode(e+o))}var H_=[...Hl(97,122),...Hl(65,90)],Kl="0",zl=Hl(49,57),Fo=[Kl,...zl],K_=" ",Bo=`
|
|
28
|
+
`;var mn="_",hp=".",z_="$",yp="-";var Y_="//",V_="/*",GD="*/";function Q_(e){let t=e.indexOf(GD);return te(t,-1)?"":e.slice(t+2)}function W_(e){let t=e.indexOf(Bo);return te(t,-1)?"":e.slice(t)}function $D(e){return e.replace(/^[ \t\r\f\v]+/,"")}function Tp(e){let t=$D(e);return t.startsWith(V_)?Tp(Q_(t.slice(2))):t.startsWith(Y_)?Tp(W_(t.slice(2))):t}function mt(e){let t=e.trimStart();return t.startsWith(V_)?mt(Q_(t.slice(2))):t.startsWith(Y_)?mt(W_(t.slice(2))):t}function Ep(e,t){return W(ve([e],t),(n,o)=>[n,o],()=>["",t])}function jD(e,t){return e.includes(t)}function Ho(e,t,n,o=""){return W(ve(e,n),(i,a)=>jD(t,i)?Ho(e,t,a,o):Ho(e,t,a,`${o}${i}`),()=>[o,n])}function qD(e){return ve(zl,e)}var FD=[...Fo,mn];function BD(e){return Ho(FD,[mn],e)}function HD(e){return W(ve([Kl],e),(t,n)=>[t,n],()=>W(qD(e),(t,n)=>W(BD(n),(o,i)=>[`${t}${o}`,i],()=>[]),()=>[]))}function _p(e){return HD(mt(e))}function KD(e){return Ep(yp,e)}function zD(e){return W(KD(e),(t,n)=>W(_p(n),(o,i)=>[`${t}${o}`,i],()=>[]),()=>[])}function Z_(e){return zD(mt(e))}function YD(e){return W(Z_(e),(t,n)=>W(ve(["n"],n),(o,i)=>[`${t}`,i],()=>[]),()=>[])}function Yl(e){return YD(e)}function Vl(e,t){return ve([e],t)}function _(e,t){return te(e,"")?["",t]:e.startsWith(Bo)?Vl(e,Tp(t)):e.startsWith(K_)?Vl(e,t):Vl(e,mt(t))}var X_=[...H_,mn,z_];function VD(e){return ve(X_,e)}var QD=[...X_,...Fo];function J_(e,t=""){return W(ve(QD,e),(n,o)=>J_(o,`${t}${n}`),()=>[t,e])}function WD(e){return W(VD(e),(t,n)=>W(J_(n),(o,i)=>[`${t}${o}`,i],()=>[]),()=>[])}function Me(e){return WD(mt(e))}var ZD=[...Fo,mn];function XD(e){return Pa(ve([hp],e))}function eI(e){return W(Ho(ZD,[mn],e),(t,n)=>te(t,"")?[]:[t,n],()=>[])}function JD(e){return W(ve([hp],e),(t,n)=>W(eI(n),(o,i)=>[`0${t}${o}`,i],()=>[]),()=>[])}function eG(e){return W(_p(e),(t,n)=>W(ve([hp],n),(o,i)=>W(eI(i),(a,c)=>[`${t}${o}${a}`,c],()=>[`${t}`,i]),()=>[`${t}`,n]),()=>[])}function tG(e){return XD(e)?JD(e):eG(e)}function tI(e){return tG(mt(e))}function rG(e){return Ep(yp,e)}function nG(e){return W(rG(e),(t,n)=>W(tI(n),(o,i)=>[`${t}${o}`,i],()=>[]),()=>[])}function Ip(e){return nG(mt(e))}function oG(e){return te(e,"")?[]:[e.slice(0,1),e.slice(1)]}function rI(e,t){return Rc(e,(n,o)=>t.startsWith(n)?!0:rI(o,t),()=>!1)}function dn(e,t,n=""){return W(oG(t),(o,i)=>rI(e,t)?[n,t]:dn(e,i,`${n}${o}`),()=>[])}function iG(e,t,n){return W(ve([e],n),(o,i)=>W(dn([t],i),(a,c)=>W(ve([t],c),(l,m)=>[`${a}`,m],()=>[]),()=>[]),()=>[])}function aG(e,t,n){return W(ve([e],n),(o,i)=>W(dn([Bo,t],i),(a,c)=>W(ve([t],c),(l,m)=>[`${a}`,m],()=>[]),()=>[]),()=>[])}function nI(e,t,n,o){return n?iG(e,t,mt(o)):aG(e,t,mt(o))}function sG(e,t){return ve(e,t)}function cG(e,t){return nI(e,e,!1,t)}function pG(e,t){return W(sG(e,t),(n,o)=>cG(n,`${n}${o}`),()=>[])}function bp(e,t){return pG(e,mt(t))}function oI(e,t){return W(dn(e,t),(n,o)=>te(n,"")?[]:[n,o],()=>[])}var p=(e,t,n=()=>[])=>e.length===2?t(e):n(),lG=e=>p(p(Me(e),([t,n])=>p(_("extends",n),([o,i])=>p(re(i),([a,c])=>p(_("=",c),([l,m])=>p(re(m),([f,h])=>[[t,o,a,l,f],h]))))),([t,n])=>[YT(t),n]),mG=e=>p(p(Me(e),([t,n])=>p(_("extends",n),([o,i])=>p(re(i),([a,c])=>[[t,o,a],c]))),([t,n])=>[VT(t),n]),dG=e=>p(p(Me(e),([t,n])=>p(_("=",n),([o,i])=>p(re(i),([a,c])=>[[t,o,a],c]))),([t,n])=>[QT(t),n]),fG=e=>p(Me(e),([t,n])=>[WT(t),n]),sI=e=>p(p(lG(e),([t,n])=>[t,n],()=>p(mG(e),([t,n])=>[t,n],()=>p(dG(e),([t,n])=>[t,n],()=>p(fG(e),([t,n])=>[t,n],()=>[])))),([t,n])=>[t,n]),cI=(e,t=[])=>p(p(_(",",e),([n,o])=>p(sI(o),([i,a])=>[[n,i],a])),([n,o])=>cI(o,[...t,n]),()=>[t,e]),gG=e=>p(p(p(sI(e),([t,n])=>p(cI(n),([o,i])=>p(p(_(",",i),([a,c])=>[[a],c],()=>[[],i]),([a,c])=>[[t,o,a],c]))),([t,n])=>[t,n],()=>p([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[ZT(t),n]),Zl=e=>p(p(_("<",e),([t,n])=>p(gG(n),([o,i])=>p(_(">",i),([a,c])=>[[t,o,a],c]))),([t,n])=>[XT(t),n]),pI=(e,t=[])=>p(p(_(",",e),([n,o])=>p(re(o),([i,a])=>[[n,i],a])),([n,o])=>pI(o,[...t,n]),()=>[t,e]),hG=e=>p(p(p(re(e),([t,n])=>p(pI(n),([o,i])=>p(p(_(",",i),([a,c])=>[[a],c],()=>[[],i]),([a,c])=>[[t,o,a],c]))),([t,n])=>[t,n],()=>p([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[JT(t),n]),yG=e=>p(p(_("<",e),([t,n])=>p(hG(n),([o,i])=>p(_(">",i),([a,c])=>[[t,o,a],c]))),([t,n])=>[eE(t),n]),TG=e=>p(p(Me(e),([t,n])=>p(yG(n),([o,i])=>[[t,o],i])),([t,n])=>[tE(t),n]),uI=e=>p(p(p(_(";",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>p([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[rE(t),n]),lI=e=>p(_("string",e),([t,n])=>[nE(t),n]),mI=e=>p(_("number",e),([t,n])=>[oE(t),n]),EG=e=>p(_("boolean",e),([t,n])=>[iE(t),n]),_G=e=>p(_("undefined",e),([t,n])=>[aE(t),n]),IG=e=>p(_("null",e),([t,n])=>[sE(t),n]),dI=e=>p(_("integer",e),([t,n])=>[cE(t),n]),bG=e=>p(_("bigint",e),([t,n])=>[pE(t),n]),SG=e=>p(_("unknown",e),([t,n])=>[uE(t),n]),AG=e=>p(_("any",e),([t,n])=>[lE(t),n]),OG=e=>p(_("object",e),([t,n])=>[mE(t),n]),xG=e=>p(_("never",e),([t,n])=>[dE(t),n]),fI=e=>p(_("symbol",e),([t,n])=>[fE(t),n]),RG=e=>p(_("void",e),([t,n])=>[gE(t),n]),CG=e=>p(_("this",e),([t,n])=>[hE(t),n]),PG=e=>p(p(_("${",e),([t,n])=>p(re(n),([o,i])=>p(_("}",i),([a,c])=>[[t,o,a],c]))),([t,n])=>[IE(t),n]),Ql=e=>p(dn(["${","`"],e),([t,n])=>[bE(t),n]),gI=e=>p(p(p(Ql(e),([t,n])=>p(PG(n),([o,i])=>p(gI(i),([a,c])=>[[t,o,a],c]))),([t,n])=>[t,n],()=>p(p(Ql(e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>p(p(Ql(e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>[]))),([t,n])=>[SE(t),n]),Xl=e=>p(p(_("`",e),([t,n])=>p(gI(n),([o,i])=>p(_("`",i),([a,c])=>[[t,o,a],c]))),([t,n])=>[AE(t),n]),UG=e=>p(Xl(e),([t,n])=>[OE(t),n]),wG=e=>p(p(p(_("if",e),([t,n])=>p(re(n),([o,i])=>p(_("then",i),([a,c])=>p(re(c),([l,m])=>p(_("else",m),([f,h])=>p(re(h),([E,I])=>[[t,o,a,l,f,E],I])))))),([t,n])=>[t,n],()=>p(p(_("if",e),([t,n])=>p(re(n),([o,i])=>p(_("then",i),([a,c])=>p(re(c),([l,m])=>[[t,o,a,l],m])))),([t,n])=>[t,n],()=>[])),([t,n])=>[xE(t),n]),vG=e=>p(Yl(e),([t,n])=>[yE(t),n]),NG=e=>p(p(_("true",e),([t,n])=>[t,n],()=>p(_("false",e),([t,n])=>[t,n],()=>[])),([t,n])=>[TE(t),n]),LG=e=>p(Ip(e),([t,n])=>[EE(t),n]),kG=e=>p(bp(["'",'"'],e),([t,n])=>[_E(t),n]),MG=e=>p(p(p(_("keyof",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>p([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[RE(t),n]),hI=(e,t=[])=>p(p(p(_("[",e),([n,o])=>p(re(o),([i,a])=>p(_("]",a),([c,l])=>[[n,i,c],l]))),([n,o])=>[n,o],()=>p(p(_("[",e),([n,o])=>p(_("]",o),([i,a])=>[[n,i],a])),([n,o])=>[n,o],()=>[])),([n,o])=>hI(o,[...t,n]),()=>[t,e]),DG=e=>p(hI(e),([t,n])=>[CE(t),n]),GG=e=>p(p(p(_("extends",e),([t,n])=>p(re(n),([o,i])=>p(_("?",i),([a,c])=>p(re(c),([l,m])=>p(_(":",m),([f,h])=>p(re(h),([E,I])=>[[t,o,a,l,f,E],I])))))),([t,n])=>[t,n],()=>p([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[PE(t),n]),$G=e=>p(p(p(_("(",e),([t,n])=>p(re(n),([o,i])=>p(_(")",i),([a,c])=>[[t,o,a],c]))),([t,n])=>[t,n],()=>p(lI(e),([t,n])=>[t,n],()=>p(mI(e),([t,n])=>[t,n],()=>p(EG(e),([t,n])=>[t,n],()=>p(_G(e),([t,n])=>[t,n],()=>p(IG(e),([t,n])=>[t,n],()=>p(dI(e),([t,n])=>[t,n],()=>p(bG(e),([t,n])=>[t,n],()=>p(SG(e),([t,n])=>[t,n],()=>p(AG(e),([t,n])=>[t,n],()=>p(OG(e),([t,n])=>[t,n],()=>p(xG(e),([t,n])=>[t,n],()=>p(fI(e),([t,n])=>[t,n],()=>p(RG(e),([t,n])=>[t,n],()=>p(CG(e),([t,n])=>[t,n],()=>p(vG(e),([t,n])=>[t,n],()=>p(NG(e),([t,n])=>[t,n],()=>p(LG(e),([t,n])=>[t,n],()=>p(kG(e),([t,n])=>[t,n],()=>p(UG(e),([t,n])=>[t,n],()=>p(wG(e),([t,n])=>[t,n],()=>p(WG(e),([t,n])=>[t,n],()=>p(JG(e),([t,n])=>[t,n],()=>p(i$(e),([t,n])=>[t,n],()=>p(o$(e),([t,n])=>[t,n],()=>p(p$(e),([t,n])=>[t,n],()=>p(TG(e),([t,n])=>[t,n],()=>p(u$(e),([t,n])=>[t,n],()=>[])))))))))))))))))))))))))))),([t,n])=>[UE(t),n]),jG=e=>p(p(p(_("with",e),([t,n])=>p(NI(n),([o,i])=>[[t,o],i])),([t,n])=>[t,n],()=>p([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[wE(t),n]),yI=e=>p(p(MG(e),([t,n])=>p($G(n),([o,i])=>p(DG(i),([a,c])=>p(GG(c),([l,m])=>p(jG(m),([f,h])=>[[t,o,a,l,f],h]))))),([t,n])=>[vE(t),n]),TI=e=>p(p(p(_("&",e),([t,n])=>p(yI(n),([o,i])=>p(TI(i),([a,c])=>[[t,o,a],c]))),([t,n])=>[t,n],()=>p([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[t,n]),EI=e=>p(p(yI(e),([t,n])=>p(TI(n),([o,i])=>[[t,o],i])),([t,n])=>[NE(t),n]),_I=e=>p(p(p(_("|",e),([t,n])=>p(EI(n),([o,i])=>p(_I(i),([a,c])=>[[t,o,a],c]))),([t,n])=>[t,n],()=>p([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[t,n]),Sp=e=>p(p(EI(e),([t,n])=>p(_I(n),([o,i])=>[[t,o],i])),([t,n])=>[LE(t),n]),qG=e=>p(p(_("readonly",e),([t,n])=>p(Sp(n),([o,i])=>[[t,o],i])),([t,n])=>[kE(t),n]),FG=e=>p(p(_("|",e),([t,n])=>p(Sp(n),([o,i])=>[[t,o],i])),([t,n])=>[ME(t),n]),BG=e=>p(p(Zl(e),([t,n])=>p(_("=",n),([o,i])=>p(re(i),([a,c])=>[[t,o,a],c]))),([t,n])=>[DE(t),n]),HG=e=>p(p(p(_("infer",e),([t,n])=>p(Me(n),([o,i])=>p(_("extends",i),([a,c])=>p(Sp(c),([l,m])=>[[t,o,a,l],m])))),([t,n])=>[t,n],()=>p(p(_("infer",e),([t,n])=>p(Me(n),([o,i])=>[[t,o],i])),([t,n])=>[t,n],()=>[])),([t,n])=>[GE(t),n]),re=e=>p(p(HG(e),([t,n])=>[t,n],()=>p(FG(e),([t,n])=>[t,n],()=>p(qG(e),([t,n])=>[t,n],()=>p(Sp(e),([t,n])=>[t,n],()=>[])))),([t,n])=>[t,n]),KG=e=>p(Ip(e),([t,n])=>[$E(t),n]),zG=e=>p(Me(e),([t,n])=>[t,n]),YG=e=>p(bp(["'",'"'],e),([t,n])=>[t,n]),VG=e=>p(p(_("[",e),([t,n])=>p(Me(n),([o,i])=>p(_(":",i),([a,c])=>p(p(dI(c),([l,m])=>[l,m],()=>p(mI(c),([l,m])=>[l,m],()=>p(lI(c),([l,m])=>[l,m],()=>p(fI(c),([l,m])=>[l,m],()=>[])))),([l,m])=>p(_("]",m),([f,h])=>[[t,o,a,l,f],h]))))),([t,n])=>[jE(t),n]),II=e=>p(p(KG(e),([t,n])=>[t,n],()=>p(zG(e),([t,n])=>[t,n],()=>p(YG(e),([t,n])=>[t,n],()=>p(VG(e),([t,n])=>[t,n],()=>[])))),([t,n])=>[t,n]),bI=e=>p(p(p(_("readonly",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>p([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[qE(t),n]),SI=e=>p(p(p(_("?",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>p([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[FE(t),n]),AI=e=>p(p(bI(e),([t,n])=>p(II(n),([o,i])=>p(SI(i),([a,c])=>p(_(":",c),([l,m])=>p(re(m),([f,h])=>[[t,o,a,l,f],h]))))),([t,n])=>[BE(t),n]),Ap=e=>p(p(p(_(",",e),([t,n])=>p(_(`
|
|
29
29
|
`,n),([o,i])=>[[t,o],i])),([t,n])=>[t,n],()=>p(p(_(";",e),([t,n])=>p(_(`
|
|
30
30
|
`,n),([o,i])=>[[t,o],i])),([t,n])=>[t,n],()=>p(p(_(",",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>p(p(_(";",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>p(p(_(`
|
|
31
31
|
`,e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>[]))))),([t,n])=>[t,n]),OI=(e,t=[])=>p(p(Ap(e),([n,o])=>p(AI(o),([i,a])=>[[n,i],a])),([n,o])=>OI(o,[...t,n]),()=>[t,e]),QG=e=>p(p(p(AI(e),([t,n])=>p(OI(n),([o,i])=>p(p(Ap(i),([a,c])=>[[a],c],()=>[[],i]),([a,c])=>[[t,o,a],c]))),([t,n])=>[t,n],()=>p([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[HE(t),n]),Jl=e=>p(p(_("{",e),([t,n])=>p(QG(n),([o,i])=>p(_("}",i),([a,c])=>[[t,o,a],c]))),([t,n])=>[zE(t),n]),WG=e=>p(Jl(e),([t,n])=>[YE(t),n]),ZG=e=>p(p(p(Me(e),([t,n])=>p(_("?",n),([o,i])=>p(_(":",i),([a,c])=>p(_("readonly",c),([l,m])=>p(re(m),([f,h])=>[[t,o,a,l,f],h]))))),([t,n])=>[t,n],()=>p(p(Me(e),([t,n])=>p(_(":",n),([o,i])=>p(_("readonly",i),([a,c])=>p(re(c),([l,m])=>[[t,o,a,l],m])))),([t,n])=>[t,n],()=>p(p(Me(e),([t,n])=>p(_("?",n),([o,i])=>p(_(":",i),([a,c])=>p(re(c),([l,m])=>[[t,o,a,l],m])))),([t,n])=>[t,n],()=>p(p(Me(e),([t,n])=>p(_(":",n),([o,i])=>p(re(i),([a,c])=>[[t,o,a],c]))),([t,n])=>[t,n],()=>[])))),([t,n])=>[VE(t),n]),iI=e=>p(p(ZG(e),([t,n])=>[t,n],()=>p(p(bI(e),([t,n])=>p(re(n),([o,i])=>p(SI(i),([a,c])=>[[t,o,a],c]))),([t,n])=>[t,n],()=>[])),([t,n])=>[QE(t),n]),xI=e=>p(p(p(_("...",e),([t,n])=>p(iI(n),([o,i])=>[[t,o],i])),([t,n])=>[t,n],()=>p(p(iI(e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>[])),([t,n])=>[WE(t),n]),RI=(e,t=[])=>p(p(_(",",e),([n,o])=>p(xI(o),([i,a])=>[[n,i],a])),([n,o])=>RI(o,[...t,n]),()=>[t,e]),XG=e=>p(p(p(xI(e),([t,n])=>p(RI(n),([o,i])=>p(p(_(",",i),([a,c])=>[[a],c],()=>[[],i]),([a,c])=>[[t,o,a],c]))),([t,n])=>[t,n],()=>p([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[ZE(t),n]),JG=e=>p(p(_("[",e),([t,n])=>p(XG(n),([o,i])=>p(_("]",i),([a,c])=>[[t,o,a],c]))),([t,n])=>[XE(t),n]),e$=e=>p(p(Me(e),([t,n])=>p(_("?",n),([o,i])=>p(_(":",i),([a,c])=>p(_("readonly",c),([l,m])=>p(re(m),([f,h])=>[[t,o,a,l,f],h]))))),([t,n])=>[JE(t),n]),t$=e=>p(p(Me(e),([t,n])=>p(_(":",n),([o,i])=>p(_("readonly",i),([a,c])=>p(re(c),([l,m])=>[[t,o,a,l],m])))),([t,n])=>[e_(t),n]),r$=e=>p(p(Me(e),([t,n])=>p(_("?",n),([o,i])=>p(_(":",i),([a,c])=>p(re(c),([l,m])=>[[t,o,a,l],m])))),([t,n])=>[t_(t),n]),n$=e=>p(p(Me(e),([t,n])=>p(_(":",n),([o,i])=>p(re(i),([a,c])=>[[t,o,a],c]))),([t,n])=>[r_(t),n]),aI=e=>p(p(e$(e),([t,n])=>[t,n],()=>p(t$(e),([t,n])=>[t,n],()=>p(r$(e),([t,n])=>[t,n],()=>p(n$(e),([t,n])=>[t,n],()=>[])))),([t,n])=>[t,n]),CI=e=>p(p(p(_("...",e),([t,n])=>p(aI(n),([o,i])=>[[t,o],i])),([t,n])=>[t,n],()=>p(p(aI(e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>[])),([t,n])=>[n_(t),n]),PI=(e,t=[])=>p(p(_(",",e),([n,o])=>p(CI(o),([i,a])=>[[n,i],a])),([n,o])=>PI(o,[...t,n]),()=>[t,e]),UI=e=>p(p(p(CI(e),([t,n])=>p(PI(n),([o,i])=>p(p(_(",",i),([a,c])=>[[a],c],()=>[[],i]),([a,c])=>[[t,o,a],c]))),([t,n])=>[t,n],()=>p([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[o_(t),n]),o$=e=>p(p(_("(",e),([t,n])=>p(UI(n),([o,i])=>p(_(")",i),([a,c])=>p(_("=>",c),([l,m])=>p(re(m),([f,h])=>[[t,o,a,l,f],h]))))),([t,n])=>[i_(t),n]),i$=e=>p(p(_("new",e),([t,n])=>p(_("(",n),([o,i])=>p(UI(i),([a,c])=>p(_(")",c),([l,m])=>p(_("=>",m),([f,h])=>p(re(h),([E,I])=>[[t,o,a,l,f,E],I])))))),([t,n])=>[a_(t),n]),a$=e=>p(p(p(_("+",e),([t,n])=>p(_("readonly",n),([o,i])=>[[t,o],i])),([t,n])=>[t,n],()=>p(p(_("-",e),([t,n])=>p(_("readonly",n),([o,i])=>[[t,o],i])),([t,n])=>[t,n],()=>p(p(_("readonly",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>p([[],e],([t,n])=>[t,n],()=>[])))),([t,n])=>[s_(t),n]),s$=e=>p(p(p(_("+",e),([t,n])=>p(_("?",n),([o,i])=>[[t,o],i])),([t,n])=>[t,n],()=>p(p(_("-",e),([t,n])=>p(_("?",n),([o,i])=>[[t,o],i])),([t,n])=>[t,n],()=>p(p(_("?",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>p([[],e],([t,n])=>[t,n],()=>[])))),([t,n])=>[c_(t),n]),c$=e=>p(p(p(_("as",e),([t,n])=>p(re(n),([o,i])=>[[t,o],i])),([t,n])=>[t,n],()=>p([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[p_(t),n]),p$=e=>p(p(_("{",e),([t,n])=>p(a$(n),([o,i])=>p(_("[",i),([a,c])=>p(Me(c),([l,m])=>p(_("in",m),([f,h])=>p(re(h),([E,I])=>p(c$(I),([g,T])=>p(_("]",T),([S,b])=>p(s$(b),([x,P])=>p(_(":",P),([ue,tn])=>p(re(tn),([Nr,Lr])=>p(uI(Lr),([Ck,Pk])=>p(_("}",Pk),([Uk,wk])=>[[t,o,a,l,f,E,g,S,x,ue,Nr,Ck,Uk],wk]))))))))))))),([t,n])=>[u_(t),n]),u$=e=>p(Me(e),([t,n])=>[l_(t),n]),l$=e=>p(Yl(e),([t,n])=>[m_(t),n]),m$=e=>p(Ip(e),([t,n])=>[d_(t),n]),d$=e=>p(p(_("true",e),([t,n])=>[t,n],()=>p(_("false",e),([t,n])=>[t,n],()=>[])),([t,n])=>[f_(t),n]),f$=e=>p(bp(['"',"'"],e),([t,n])=>[t,n]),g$=e=>p(_("null",e),([t,n])=>[g_(t),n]),h$=e=>p(_("undefined",e),([t,n])=>[void 0,n]),wI=e=>p(p(II(e),([t,n])=>p(_(":",n),([o,i])=>p(em(i),([a,c])=>[[t,o,a],c]))),([t,n])=>[h_(t),n]),vI=(e,t=[])=>p(p(Ap(e),([n,o])=>p(wI(o),([i,a])=>[[n,i],a])),([n,o])=>vI(o,[...t,n]),()=>[t,e]),y$=e=>p(p(p(wI(e),([t,n])=>p(vI(n),([o,i])=>p(p(Ap(i),([a,c])=>[[a],c],()=>[[],i]),([a,c])=>[[t,o,a],c]))),([t,n])=>[t,n],()=>p([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[y_(t),n]),NI=e=>p(p(_("{",e),([t,n])=>p(y$(n),([o,i])=>p(_("}",i),([a,c])=>[[t,o,a],c]))),([t,n])=>[T_(t),n]),LI=(e,t=[])=>p(p(_(",",e),([n,o])=>p(em(o),([i,a])=>[[n,i],a])),([n,o])=>LI(o,[...t,n]),()=>[t,e]),T$=e=>p(p(p(em(e),([t,n])=>p(LI(n),([o,i])=>p(p(_(",",i),([a,c])=>[[a],c],()=>[[],i]),([a,c])=>[[t,o,a],c]))),([t,n])=>[t,n],()=>p([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[E_(t),n]),E$=e=>p(p(_("[",e),([t,n])=>p(T$(n),([o,i])=>p(_("]",i),([a,c])=>[[t,o,a],c]))),([t,n])=>[__(t),n]),em=e=>p(p(l$(e),([t,n])=>[t,n],()=>p(m$(e),([t,n])=>[t,n],()=>p(d$(e),([t,n])=>[t,n],()=>p(f$(e),([t,n])=>[t,n],()=>p(g$(e),([t,n])=>[t,n],()=>p(h$(e),([t,n])=>[t,n],()=>p(NI(e),([t,n])=>[t,n],()=>p(E$(e),([t,n])=>[t,n],()=>[])))))))),([t,n])=>[t,n]),_$=e=>p(_("-?(?:0|[1-9][0-9]*)n",e),([t,n])=>[I_(t),n]),I$=e=>p(_(".*",e),([t,n])=>[b_(t),n]),b$=e=>p(_("-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?",e),([t,n])=>[S_(t),n]),S$=e=>p(_("-?(?:0|[1-9][0-9]*)",e),([t,n])=>[A_(t),n]),A$=e=>p(_("(?!)",e),([t,n])=>[O_(t),n]),O$=e=>p(oI(["-?(?:0|[1-9][0-9]*)n",".*","-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?","-?(?:0|[1-9][0-9]*)","(?!)","(",")","$","|"],e),([t,n])=>[x_(t),n]),x$=e=>p(p(_$(e),([t,n])=>[t,n],()=>p(I$(e),([t,n])=>[t,n],()=>p(b$(e),([t,n])=>[t,n],()=>p(S$(e),([t,n])=>[t,n],()=>p(A$(e),([t,n])=>[t,n],()=>p(R$(e),([t,n])=>[t,n],()=>p(O$(e),([t,n])=>[t,n],()=>[]))))))),([t,n])=>[t,n]),R$=e=>p(p(_("(",e),([t,n])=>p(tm(n),([o,i])=>p(_(")",i),([a,c])=>[[t,o,a],c]))),([t,n])=>[R_(t),n]),kI=e=>p(p(p(Wl(e),([t,n])=>p(_("|",n),([o,i])=>p(kI(i),([a,c])=>[[t,o,a],c]))),([t,n])=>[t,n],()=>p(p(Wl(e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>p([[],e],([t,n])=>[t,n],()=>[]))),([t,n])=>[C_(t),n]),Wl=e=>p(p(x$(e),([t,n])=>p(tm(n),([o,i])=>[[t,o],i])),([t,n])=>[P_(t),n]),tm=e=>p(p(kI(e),([t,n])=>[t,n],()=>p(Wl(e),([t,n])=>[t,n],()=>[])),([t,n])=>[t,n]),lT=e=>p(p(_("^",e),([t,n])=>p(tm(n),([o,i])=>p(_("$",i),([a,c])=>[[t,o,a],c]))),([t,n])=>[U_(t),n]),MI=(e,t=[])=>p(p(_(",",e),([n,o])=>p(re(o),([i,a])=>[[n,i],a])),([n,o])=>MI(o,[...t,n]),()=>[t,e]),C$=e=>p(p(p(re(e),([t,n])=>p(MI(n),([o,i])=>p(p(_(",",i),([a,c])=>[[a],c],()=>[[],i]),([a,c])=>[[t,o,a],c]))),([t,n])=>[t,n],()=>p([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[w_(t),n]),DI=e=>p(p(p(_("extends",e),([t,n])=>p(C$(n),([o,i])=>[[t,o],i])),([t,n])=>[t,n],()=>p([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[v_(t),n]),P$=e=>p(p(_("interface",e),([t,n])=>p(Me(n),([o,i])=>p(Zl(i),([a,c])=>p(DI(c),([l,m])=>p(Jl(m),([f,h])=>[[t,o,a,l,f],h]))))),([t,n])=>[N_(t),n]),U$=e=>p(p(_("interface",e),([t,n])=>p(Me(n),([o,i])=>p(DI(i),([a,c])=>p(Jl(c),([l,m])=>[[t,o,a,l],m])))),([t,n])=>[L_(t),n]),w$=e=>p(p(_("type",e),([t,n])=>p(Me(n),([o,i])=>p(Zl(i),([a,c])=>p(_("=",c),([l,m])=>p(re(m),([f,h])=>[[t,o,a,l,f],h]))))),([t,n])=>[k_(t),n]),v$=e=>p(p(_("type",e),([t,n])=>p(Me(n),([o,i])=>p(_("=",i),([a,c])=>p(re(c),([l,m])=>[[t,o,a,l],m])))),([t,n])=>[M_(t),n]),N$=e=>p(p(p(_("export",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>p([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[D_(t),n]),GI=e=>p(p(p(_(";",e),([t,n])=>p(_(`
|
|
32
32
|
`,n),([o,i])=>[[t,o],i])),([t,n])=>[t,n],()=>p(p(_(";",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>p(p(_(`
|
|
33
|
-
`,e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>[]))),([t,n])=>[t,n]),$I=(e,t=[])=>p(p(GI(e),([n,o])=>p(rm(o),([i,a])=>[[n,i],a])),([n,o])=>$I(o,[...t,n]),()=>[t,e]),L$=e=>p(p(p(rm(e),([t,n])=>p($I(n),([o,i])=>p(p(GI(i),([a,c])=>[[a],c],()=>[[],i]),([a,c])=>[[t,o,a],c]))),([t,n])=>[t,n],()=>p([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[G_(t),n]),rm=e=>p(p(N$(e),([t,n])=>p(p(P$(n),([o,i])=>[o,i],()=>p(U$(n),([o,i])=>[o,i],()=>p(w$(n),([o,i])=>[o,i],()=>p(v$(n),([o,i])=>[o,i],()=>[])))),([o,i])=>p(uI(i),([a,c])=>[[t,o,a],c]))),([t,n])=>[$_(t),n]),k$=e=>p(p(rm(e),([t,n])=>p(L$(n),([o,i])=>[[t,o],i])),([t,n])=>[j_(t),n]),jI=e=>p(p(k$(e),([t,n])=>[t,n],()=>p(BG(e),([t,n])=>[t,n],()=>p(re(e),([t,n])=>[t,n],()=>[]))),([t,n])=>[t,n]);function FI(e){let t=Xl(`\`${e}\``);return s.IsEqual(t.length,2)?t[0]:fe()}function D$(e){return e.join("|")}function G$(e){return e.slice(1,e.length-1)}function $$(e,t,n){return fn(t,`${n}${e}`)}function j$(e,t){return fn(e,`${t}${iT}`)}function F$(e,t){return fn(e,`${t}${kc}`)}function q$(e,t){return fn(e,`${t}${$c}`)}function B$(e,t){return Ua(q([z("false"),z("true")]),e,t)}function H$(e,t){return fn(e,`${t}${jc}`)}function K$(e,t,n){return fn(t,`${n}${G$(e)}`)}function z$(e,t,n){let o=wa(e,{});return Ua(o,t,n)}function Y$(e,t,n){let o=wt(e);return Ua(o,t,n)}function qI(e,t,n,o=[]){return s.ShiftLeft(e,(i,a)=>qI(a,t,n,[...o,Ua(i,[],"")]),()=>fn(t,`${n}(${D$(o)})`))}function Ua(e,t,n){return ze(e)?Y$(e.enum,t,n):ot(e)?F$(t,n):Q(e)?$$(e.const,t,n):vt(e)?j$(t,n):_t(e)?B$(t,n):Ce(e)?q$(t,n):We(e)?H$(t,n):Ee(e)?K$(e.pattern,t,n):HI(e)?z$(e.parameters[0],t,n):R(e)?qI(e.anyOf,t,n):Ny}function fn(e,t){return s.ShiftLeft(e,(n,o)=>Ua(n,o,t),()=>t)}function V$(e){return`^${fn(e,"")}$`}function BI(e){let t=V$(e);return qc(t)}function wa(e,t){return K(e)?y.Update(BI(e),{},t):Zc(e,t)}function KI(e,t,n,o){let i=jt(e,t,n);return wa(i,o)}function Zc(e,t={}){return v("TemplateLiteral",[e],t)}function HI(e){return Ue(e)&&s.HasPropertyKey(e,"action")&&s.IsEqual(e.action,"TemplateLiteral")}function zI(e){return wa(e,{})}function Q$(e){let t=FI(e);return zI(t)}function YI(e,t={}){let n=s.IsString(e)?Q$(e):zI(e);return y.Update(n,{},t)}function Ee(e){return w(e,"TemplateLiteral")}var G={};Yt(G,{ExtendsFalse:()=>B,ExtendsTrue:()=>U,ExtendsUnion:()=>nm,IsExtendsFalse:()=>W$,IsExtendsTrue:()=>QI,IsExtendsTrueLike:()=>Ko,IsExtendsUnion:()=>VI,Match:()=>Ae});function nm(e){return y.Create({"~kind":"ExtendsUnion"},{inferred:e})}function VI(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"inferred")&&s.IsEqual(e["~kind"],"ExtendsUnion")&&s.IsObject(e.inferred)}function U(e){return y.Create({"~kind":"ExtendsTrue"},{inferred:e})}function QI(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"inferred")&&s.IsEqual(e["~kind"],"ExtendsTrue")&&s.IsObject(e.inferred)}function B(){return y.Create({"~kind":"ExtendsFalse"},{})}function W$(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.IsEqual(e["~kind"],"ExtendsFalse")}function Ko(e){return VI(e)||QI(e)}function Ae(e,t,n){return Ko(e)?t(e.inferred):n()}function Z$(e,t,n,o){return Ae(J(e,n,o),i=>U(y.Assign(y.Assign(e,i),{[t]:n})),()=>B())}function X$(e,t){return U(e)}function J$(e,t,n,o,i){return Ae(J(e,t,n),a=>Ae(J(a,t,o),c=>U(c),()=>B()),()=>Ae(J(e,t,i),a=>U(a),()=>B()))}function e1(e,t,n){let o=wt(n);return J(e,t,o)}function WI(e,t,n){return s.ShiftLeft(n,(o,i)=>Ae(J(e,t,o),a=>WI(a,t,i),()=>B()),()=>U(e))}function t1(e,t,n){let o=ht(n);return J(e,t,o)}function ZI(e,t,n){return s.ShiftLeft(n,(o,i)=>Ae(J(e,t,o),a=>U(a),()=>ZI(e,t,i)),()=>B())}function ae(e,t,n){return Ve(n)?X$(e,t):Le(n)?J$(e,t,n.if,n.then,n.else):ze(n)?e1(e,t,n.enum):Ke(n)?Z$(e,n.name,t,n.extends):M(n)?WI(e,t,n.allOf):Ee(n)?t1(e,t,n.pattern):R(n)?ZI(e,t,n.anyOf):et(n)?U(e):B()}function XI(e,t,n){return Ke(n)?ae(e,t,n):Ve(n)?U(e):et(n)?U(e):nm(e)}function r1(e,t){let n=Kn(e),o=Kn(t);return n&&o||!n&&o?!0:!(n&&!o)}function JI(e,t,n,o){return Z(o)?r1(t,o)?J(e,n,o.items):B():ae(e,t,o)}function eb(e,t,n){return vt(n)?U(e):ae(e,t,n)}function tb(e,t,n){return _t(n)?U(e):ae(e,t,n)}function n1(e,t,n,o,i){let a=Ke(o)?t:o,c=Ke(o)?o:t,l=Je(t),m=Je(o);return!l&&m?B():Ae(J(e,a,c),f=>va(f,n,i),()=>B())}function o1(e,t,n,o){return s.ShiftLeft(o,(i,a)=>n1(e,t,n,i,a),()=>Je(t)?U(e):B())}function i1(e,t,n){return s.ShiftLeft(t,(o,i)=>o1(e,o,i,n),()=>U(e))}function va(e,t,n){return i1(e,t,n)}function Op(e,t,n){return kt(n)?U(e):J(e,t,n)}function rb(e,t,n,o){return Ve(o)?U(e):et(o)?U(e):Be(o)?Ae(va(e,t,o.parameters),i=>Op(i,n,o.instanceType),()=>B()):B()}function nb(e,t,n,o,i){return Ae(J(e,t,i),()=>J(e,n,i),()=>J(e,o,i))}function ob(e,t,n){let o=wt(t);return J(e,o,n)}function ib(e,t,n,o){return Ve(o)?U(e):et(o)?U(e):He(o)?Ae(va(e,t,o.parameters),i=>Op(i,n,o.returnType),()=>B()):B()}function ab(e,t,n){return ot(n)?U(e):Ce(n)?U(e):ae(e,t,n)}function sb(e,t,n){let o=we(t);return J(e,o,n)}function xp(e,t,n){return t===n?U(e):B()}function a1(e,t,n){return Q(n)?xp(e,t,n.const):vt(n)?U(e):ae(e,z(t),n)}function s1(e,t,n){return Q(n)?xp(e,t,n.const):_t(n)?U(e):ae(e,z(t),n)}function c1(e,t,n){return Q(n)?xp(e,t,n.const):Ce(n)?U(e):ae(e,z(t),n)}function p1(e,t,n){return Q(n)?xp(e,t,n.const):We(n)?U(e):ae(e,z(t),n)}function cb(e,t,n){return s.IsBigInt(t.const)?a1(e,t.const,n):s.IsBoolean(t.const)?s1(e,t.const,n):s.IsNumber(t.const)?c1(e,t.const,n):s.IsString(t.const)?p1(e,t.const,n):fe()}function pb(e,t,n){return Ke(n)?ae(e,t,n):U(e)}function ub(e,t,n){return gr(n)?U(e):ae(e,t,n)}function lb(e,t,n){return Ce(n)?U(e):ae(e,t,n)}function u1(e,t,n){return Je(t)?Je(n)?U(e):B():U(e)}function l1(e,t,n){return Ke(n)&&tr(n.extends)?B():Ae(J(e,t,n),o=>u1(o,t,n),()=>B())}function m1(e,t){return e.reduce((n,o)=>o in t?Ko(t[o])?{...n,...t[o].inferred}:fe():fe(),{})}function d1(e,t,n){let o={};for(let c of s.Keys(n))o[c]=c in t?l1({},t[c],n[c]):Je(n[c])?Ke(n[c])?U(y.Assign(e,{[n[c].name]:n[c].extends})):U(e):B();let i=s.Values(o).every(c=>Ko(c)),a=i?m1(s.Keys(o),o):{};return i?U(a):B()}function f1(e,t,n){let o=d1(e,t,n);return Ko(o)?U(y.Assign(e,o.inferred)):B()}function g1(e,t,n){return f1(e,t,n)}function h1(e,t){return s.Keys(t).reduce((n,o)=>({...n,[o]:s.HasPropertyKey(e,o)?R(n[o])?q([...n[o].anyOf,t[o]]):q([e[o],t[o]]):t[o]}),e)}function mb(e,t,n,o){return s.ShiftLeft(t,(i,a)=>Ae(J({},e[i],n),c=>mb(e,a,n,h1(o,c)),()=>B()),()=>U(o))}function y1(e,t,n,o){let i=s.Keys(t);return mb(t,i,o,e)}function db(e,t,n){return de(n)?y1(e,t,it(n),Se(n)):D(n)?g1(e,t,n.properties):ae(e,k(t),n)}function T1(e,t){return s.IsEqual(s.Keys(t).length,0)?U(e):B()}function E1(e,t,n,o,i){return J(e,n,i)}function fb(e,t,n,o){return de(o)?E1(e,Yc(t),n,Yc(it(o)),Se(o)):D(o)?T1(e,o.properties):Ve(o)?U(e):et(o)?U(e):B()}function gb(e,t,n){return We(n)?U(e):ae(e,t,n)}function hb(e,t,n){return hr(n)?U(e):ae(e,t,n)}function yb(e,t,n){let o=ht(t);return J(e,o,n)}function om(e,t){return y.Create({"~kind":"Inferrable"},{name:e,type:t},{})}function Na(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"name")&&s.HasPropertyKey(e,"type")&&s.IsEqual(e["~kind"],"Inferrable")&&s.IsString(e.name)&&s.IsObject(e.type)}function im(e){return ln(e)?Ke(e.items)?Z(e.items.extends)?om(e.items.name,e.items.extends.items):et(e.items.extends)?om(e.items.name,e.items.extends):void 0:fe():void 0}function Rp(e){return Ke(e)?om(e.name,e.extends):void 0}function am(e,t,n=[]){return s.ShiftLeft(e,(o,i)=>Ae(J({},o,t),()=>am(i,t,[...n,o]),()=>{}),()=>n)}function Tb(e,t,n,o){let i=am(n,o);return s.IsArray(i)?U(y.Assign(e,{[t]:ke(i)})):B()}function Cp(e,t,n,o){let i=am(n,o);return s.IsArray(i)?U(y.Assign(e,{[t]:q(i)})):B()}function _1(e){return[...e].reverse()}function sm(e,t){return t?_1(e):e}function I1(e){let t=e.length>0?e[0]:void 0,n=Ue(t)?im(t):void 0;return Ue(n)}function b1(e,t,n,o,i,a){return Ae(J(e,n,i),c=>Eb(c,t,o,a),()=>B())}function S1(e,t,n,o,i){let a=im(o);return Na(a)?Tb(e,a.name,sm(n,t),a.type):s.ShiftLeft(n,(c,l)=>b1(e,t,c,l,o,i),()=>B())}function A1(e,t,n,o){return s.ShiftLeft(o,(i,a)=>S1(e,t,n,i,a),()=>s.IsEqual(n.length,0)?U(e):B())}function Eb(e,t,n,o){return A1(e,t,n,o)}function O1(e,t,n){let o=gn(e,be([],[]),n),i=I1(o);return Eb(e,i,sm(t,i),sm(o,i))}function _b(e,t,n){let o=Rp(n);return Na(o)?Cp(e,o.name,t,o.type):s.ShiftLeft(t,(i,a)=>Ae(J(e,i,n),c=>_b(c,a,n),()=>B()),()=>U(e))}function Ib(e,t,n){let o=gn(e,be([],[]),t);return Y(n)?O1(e,o,n.items):Z(n)?_b(e,o,n.items):ae(e,ke(o),n)}function bb(e,t,n){return kt(n)?U(e):nr(n)?U(e):ae(e,t,n)}function Sb(e,t,n){return s.ShiftLeft(n,(o,i)=>Ae(J(e,t,o),a=>U(a),()=>Sb(e,t,i)),()=>B())}function cm(e,t,n){return s.ShiftLeft(t,(o,i)=>Ae(Sb(e,o,n),a=>cm(a,i,n),()=>B()),()=>U(e))}function Ab(e,t,n){let o=Rp(n);return Na(o)?Cp(e,o.name,t,o.type):R(n)?cm(e,t,n.anyOf):cm(e,t,[n])}function Ob(e,t,n){return Ke(n)?ae(e,t,n):Ve(n)?U(e):et(n)?U(e):B()}function xb(e,t,n){return kt(n)?U(e):ae(e,t,n)}function J(e,t,n){return Ve(t)?XI(e,t,n):Z(t)?JI(e,t,t.items,n):vt(t)?eb(e,t,n):_t(t)?tb(e,t,n):Be(t)?rb(e,t.parameters,t.instanceType,n):Le(t)?nb(e,t.if,t.then,t.else,n):ze(t)?ob(e,t.enum,n):He(t)?ib(e,t.parameters,t.returnType,n):ot(t)?ab(e,t,n):M(t)?sb(e,t.allOf,n):Q(t)?cb(e,t,n):tr(t)?pb(e,t,n):gr(t)?ub(e,t,n):Ce(t)?lb(e,t,n):D(t)?db(e,t.properties,n):de(t)?fb(e,it(t),Se(t),n):We(t)?gb(e,t,n):hr(t)?hb(e,t,n):Ee(t)?yb(e,t.pattern,n):Y(t)?Ib(e,t.items,n):nr(t)?bb(e,t,n):R(t)?Ab(e,t.anyOf,n):et(t)?Ob(e,t,n):kt(t)?xb(e,t,n):B()}function x1(e,t){return we([...e,k(t)])}function pm(e,t,n){return K(e)?y.Update(x1(e,t),{},n):Oa(e,t,n)}function Rb(e,t,n,o,i){let a=jt(e,t,n),c=La(e,t,o);return pm(a,c,i)}function Oa(e,t,n={}){return v("Interface",[e,t],n)}function zo(e){return Ue(e)&&s.HasPropertyKey(e,"action")&&s.IsEqual(e.action,"Interface")}function Cb(e,t,n={}){return pm(e,t,n)}function R1(e,t,n){return e.includes(n)?!0:ka([...e,n],t,t[n])}function Pb(e,t,n){let o=Uc(n);return Jn(e,t,o)}function Jn(e,t,n){return s.ShiftLeft(n,(o,i)=>ka(e,t,o)?!0:Jn(e,t,i),()=>!1)}function ka(e,t,n){return ce(n)?R1(e,t,n.$ref):Z(n)?ka(e,t,n.items):Be(n)?Jn(e,t,[...n.parameters,n.instanceType]):He(n)?Jn(e,t,[...n.parameters,n.returnType]):zo(n)?Pb(e,t,n.parameters[1]):M(n)?Jn(e,t,n.allOf):D(n)?Pb(e,t,n.properties):R(n)?Jn(e,t,n.anyOf):Y(n)?Jn(e,t,n.items):de(n)?ka(e,t,Se(n)):!1}function Ub(e,t,n){return ka(e,t,n)}function C1(e,t){return t.reduce((n,o)=>Ub([o],e,e[o])?[...n,o]:n,[])}function wb(e){let t=Pc(e);return C1(e,t)}function P1(e,t,n){return n.includes(t)?n:t in e?Ma(e,e[t],[...n,t]):fe()}function vb(e,t,n){let o=Uc(t);return Yo(e,o,n)}function Yo(e,t,n){return t.reduce((o,i)=>Ma(e,i,o),n)}function Ma(e,t,n){return ce(t)?P1(e,t.$ref,n):Z(t)?Ma(e,t.items,n):Be(t)?Yo(e,[...t.parameters,t.instanceType],n):He(t)?Yo(e,[...t.parameters,t.returnType],n):zo(t)?vb(e,t.parameters[1],n):M(t)?Yo(e,t.allOf,n):D(t)?vb(e,t.properties,n):R(t)?Yo(e,t.anyOf,n):Y(t)?Yo(e,t.items,n):de(t)?Ma(e,Se(t),n):n}function Nb(e,t,n){return Ma(e,n,[t])}function U1(e){return No()}function w1(e){return s.Keys(e).reduce((t,n)=>({...t,[n]:eo(e[n])}),{})}function Da(e){return e.reduce((t,n)=>[...t,eo(n)],[])}function eo(e){return ce(e)?U1(e.$ref):Z(e)?Pt(eo(e.items),wo(e)):Be(e)?ur(Da(e.parameters),eo(e.instanceType)):He(e)?lr(Da(e.parameters),eo(e.returnType)):M(e)?ut(Da(e.allOf)):D(e)?k(w1(e.properties)):de(e)?jo(un(e),eo(Se(e))):R(e)?q(Da(e.anyOf)):Y(e)?ke(Da(e.items)):e}function v1(e,t){return t in e?eo(e[t]):Qe()}function Lb(e){return v1(e.$defs,e.$ref)}function N1(e,t,n){let o=jt(e,be([],[]),t),i=La({},be([],[]),n);return we([...o,k(i)])}function L1(e,t){return s.Keys(e).filter(o=>t.includes(o)).reduce((o,i)=>{let a=e[i],c=zo(a)?N1(e,a.parameters[0],a.parameters[1]):a;return{...o,[i]:c}},{})}function kb(e,t,n){let o=Nb(e,t,n),i=L1(e,o);return dr(i,t)}function Mb(e,t){return t in e?ce(e[t])?Mb(e,e[t].$ref):e[t]:me()}function yr(e,t){return Mb(e,t)}function Db(e){return Te(e)?Lb(e):wc(e)?Qe():e}function dt(e,t,n){let o=Db(t),i=Db(n);return J(e,o,i)}var _a="equal",k1="disjoint",Ia="left-inside",ba="right-inside";function Wn(e,t){let n=[et(e)?G.ExtendsFalse():dt({},e,t),et(e)?G.ExtendsTrue({}):dt({},t,e)];return G.IsExtendsTrueLike(n[0])&&G.IsExtendsTrueLike(n[1])?_a:G.IsExtendsTrueLike(n[0])&&G.IsExtendsFalse(n[1])?Ia:G.IsExtendsFalse(n[0])&&G.IsExtendsTrueLike(n[1])?ba:k1}function M1(e,t){return t.filter(n=>Wn(e,n)!==ba)}function D1(e,t){let n=t.some(o=>{let i=Wn(e,o);return s.IsEqual(i,Ia)||s.IsEqual(i,_a)});return s.IsEqual(n,!1)}function G1(e,t){let n=Vt(e);return Ve(n)?[n]:D1(n,t)?[...M1(n,t),n]:t}function $1(e){return e.reduce((t,n)=>D(n)?[...t,n]:tr(n)?t:G1(n,t),[])}function Fl(e){let t=$1(e);return $o(t)}function um(e,t){return y.Update(Vt(e),{},t)}function Gb(e,t,n,o){let i=O(e,t,n);return um(i,o)}function Ga(e,t=[]){return on(e)&&s.IsEqual(e.action,"Conditional")?ce(e.parameters[0])?Ga(e.parameters[2],Ga(e.parameters[3],[...t,e.parameters[0].$ref])):Ga(e.parameters[2],Ga(e.parameters[3],t)):on(e)&&s.IsEqual(e.action,"Mapped")&&on(e.parameters[1])&&s.IsEqual(e.parameters[1].action,"KeyOf")&&ce(e.parameters[1].parameters[0])?[...t,e.parameters[1].parameters[0].$ref]:t}function j1(e,t){return e.reduce((n,o)=>[...n,t.includes(o.name)],[])}function Fb(e,t,n=[]){return s.ShiftLeft(e,(o,i)=>s.ShiftLeft(t,(a,c)=>Fb(i,c,[...n,[a,o]]),()=>n),()=>n)}function F1(e){return Ee(e)?ht(e.pattern):ze(e)?wt(e.enum):e}function q1(e){let t=F1(e);return R(t)?[...t.anyOf]:[t]}function B1(e,t){return e.reduce((n,o)=>[...n,[...o,t]],[])}function $b(e,t){return t.reduce((n,o)=>[...n,...B1(e,o)],[])}function jb(e){return e.reduce((t,n)=>s.IsEqual(n[0],!0)?$b(t,q1(n[1])):$b(t,[n[1]]),[[]])}function qb(e,t,n){let o=Ga(n),i=j1(e,o),a=Fb(t,i);return on(n)&&s.IsEqual(n.action,"Conditional")||on(n)&&s.IsEqual(n.action,"Mapped")?jb(a):[t]}function H1(){return["(not-resolvable)",me()]}function K1(){return["(not-generic)",me()]}function z1(e,t,n){return[e,an(t,n)]}function Y1(e,t,n){return t in e?Bb(e,t,e[t],n):H1()}function Bb(e,t,n,o){return vo(n)?z1(t,n.parameters,n.expression):ce(n)?Y1(e,n.$ref,o):K1()}function Hb(e,t,n){return Bb(e,"(anonymous)",t,n)}function V1(e,t,n){if(Ke(t)||Vo(t)||G.IsExtendsTrueLike(dt({},t,n)))return;let o={parameter:e,expect:n,actual:t};throw new Error(`Argument for parameter ${e} does not satisfy constraint`,{cause:o})}function Kb(e,t,n,o,i){let a=O(e,t,i);return V1(n,a,o),y.Assign(e,{[n]:a})}function Q1(e,t,n,o,i){let a=O(e,t,n.extends),c=O(e,t,n.equals);return s.ShiftLeft(i,(l,m)=>lm(Kb(e,t,n.name,a,l),t,o,m),()=>lm(Kb(e,t,n.name,a,c),t,o,[]))}function lm(e,t,n,o){return s.ShiftLeft(n,(i,a)=>Q1(e,t,i,a,o),()=>e)}function zb(e,t,n,o){return lm(e,t,n,o)}var mm=0,dm=0;function W1(){if(!s.IsLessThan(dm,rt.Get().maxInstantiationCount))throw Error("Type instantiation is excessively deep and possibly infinite")}function Z1(){W1(),dm++,mm++}function X1(){mm--,s.IsEqual(mm,0)&&(dm=0)}function J1(e){return s.IsGreaterThan(e.callstack.length,0)?e.callstack[e.callstack.length-1]:""}function ej(e,t){return s.IsEqual(J1(e),t)}function tj(e,t,n,o,i,a){Z1();try{let c=zb(e,t,o,a),l=O(c,be([...t.callstack,n.$ref],t.visited),i);return O(c,be([],[]),l)}finally{X1()}}function rj(e,t,n,o,i,a){return a.reduce((c,l)=>{let m=tj(e,t,n,o,i,l);return[...c,m]},[])}function nj(e,t,n,o,i,a){let c=qb(o,a,i),l=rj(e,t,n,o,i,c);return s.IsEqual(l.length,1)?l[0]:Lt(l)}function Pp(e,t,n,o){let i=jt(e,t,o),a=Hb(e,n,o),c=a[0],l=a[1];return vo(l)?ej(t,c)?xa(nt(c),i):nj(e,t,nt(c),l.parameters,l.expression,i):xa(n,i)}function xa(e,t){return y.Create({"~kind":"Call"},{type:"call",target:e,arguments:t},{})}function Yb(e,t){return Pp({},be([],[]),e,t)}function Vo(e){return w(e,"Call")}function oj(e){return y.Discard(e,["~immutable"])}function Vb(e,t){return y.Update(oj(e),{},t)}function Qb(e,t,n,o){let i=O(e,t,n);return Vb(i,o)}function Wb(e,t){return e(t)}function Zb(e,t){return s.IsString(t)?z(Wb(e,t)):z(t)}function Xb(e,t){let n=ht(t);return Gr(e,n)}function Jb(e,t){let n=t.map(o=>Gr(e,o));return q(n)}function Gr(e,t){return Q(t)?Zb(e,t.const):Ee(t)?Xb(e,t.pattern):R(t)?Jb(e,t.anyOf):t}function Xc(e,t={}){return v("Capitalize",[e],t)}function eS(e,t={}){return fm(e,t)}function Jc(e,t={}){return v("Lowercase",[e],t)}function tS(e,t={}){return gm(e,t)}function ep(e,t={}){return v("Uncapitalize",[e],t)}function rS(e,t={}){return hm(e,t)}function tp(e,t={}){return v("Uppercase",[e],t)}function nS(e,t={}){return ym(e,t)}var ij=e=>e[0].toUpperCase()+e.slice(1),aj=e=>e.toLowerCase(),sj=e=>e[0].toLowerCase()+e.slice(1),cj=e=>e.toUpperCase();function fm(e,t){return K([e])?y.Update(Gr(ij,e),{},t):Xc(e,t)}function gm(e,t){return K([e])?y.Update(Gr(aj,e),{},t):Jc(e,t)}function hm(e,t){return K([e])?y.Update(Gr(sj,e),{},t):ep(e,t)}function ym(e,t){return K([e])?y.Update(Gr(cj,e),{},t):tp(e,t)}function oS(e,t,n,o){let i=O(e,t,n);return fm(i,o)}function iS(e,t,n,o){let i=O(e,t,n);return gm(i,o)}function aS(e,t,n,o){let i=O(e,t,n);return hm(i,o)}function sS(e,t,n,o){let i=O(e,t,n);return ym(i,o)}function rp(e,t,n,o,i={}){return v("Conditional",[e,t,n,o],i)}function cS(e,t,n,o,i={}){return Tm({},be([],[]),e,t,n,o,i)}function pj(e,t,n,o,i,a){let c=dt(e,n,o);return G.IsExtendsUnion(c)?q([O(c.inferred,t,i),O(e,t,a)]):G.IsExtendsTrue(c)?O(c.inferred,t,i):O(e,t,a)}function Tm(e,t,n,o,i,a,c){return K([n,o])?y.Update(pj(e,t,n,o,i,a),{},c):rp(n,o,i,a,c)}function pS(e,t,n,o,i,a,c){let l=O(e,t,n),m=O(e,t,o);return Tm(e,t,l,m,i,a,c)}function np(e,t={}){return v("ConstructorParameters",[e],t)}function uS(e,t={}){return Em(e,t)}function uj(e){let t=Be(e)?e.parameters:[],n=gn({},be([],[]),t);return ke(n)}function Em(e,t){return K([e])?y.Update(uj(e),{},t):np(e,t)}function lS(e,t,n,o){let i=O(e,t,n);return Em(i,o)}function op(e,t,n={}){return v("Exclude",[e,t],n)}function mS(e,t,n={}){return $a(e,t,n)}function $a(e,t,n){return K([e,t])?y.Update(Hc(e,t),{},n):op(e,t,n)}function dS(e,t,n,o,i){let a=O(e,t,n),c=O(e,t,o);return $a(a,c,i)}function ip(e,t,n={}){return v("Extract",[e,t],n)}function fS(e,t,n={}){return _m(e,t,n)}function lj(e,t){let n=dt({},e,t);return G.IsExtendsTrueLike(n)?[e]:[]}function mj(e,t){return e.reduce((n,o)=>[...n,...lj(o,t)],[])}function gS(e,t){let n=Vt(e),o=R(n)?n.anyOf:[n],i=mj(o,t);return Lt(i)}function _m(e,t,n){return K([e,t])?y.Update(gS(e,t),{},n):ip(e,t,n)}function hS(e,t,n,o,i){let a=O(e,t,n),c=O(e,t,o);return _m(a,c,i)}function dj(e){return e.reduce((t,n)=>Mc(n)?[...t,z(n)]:t,[])}function Qo(e){let t=dj(e);return q(t)}function Ra(e,t,n={}){return v("Index",[e,t],n)}function yS(e,t,n={}){let o=s.IsArray(t)?Qo(t):t;return Im(e,o,n)}function TS(e,t){let n=yr(e,t);return Ft(n)}function ES(e,t,n){let o=rr(e,t,n);return Ft(o)}function fj(e,t){let n=s.Keys(e).filter(h=>!s.HasPropertyKey(t,h)),o=s.Keys(t).filter(h=>!s.HasPropertyKey(e,h)),i=s.Keys(e).filter(h=>s.HasPropertyKey(t,h)),a=n.reduce((h,E)=>({...h,[E]:e[E]}),{}),c=o.reduce((h,E)=>({...h,[E]:t[E]}),{}),l=i.reduce((h,E)=>({...h,[E]:we([e[E],t[E]])}),{}),m=y.Assign(a,c);return y.Assign(m,l)}function _S(e){return e.reduce((t,n)=>fj(t,Ft(n)),{})}function IS(e){let t=xT(ke(e));return Ft(t)}function gj(e,t){return s.Keys(e).filter(i=>i in t).reduce((i,a)=>({...i,[a]:Lt([e[a],t[a]])}),{})}function bS(e,t){return s.ShiftLeft(e,(n,o)=>bS(o,gj(t,Ft(n))),()=>t)}function SS(e){return s.ShiftLeft(e,(t,n)=>bS(n,Ft(t)),()=>fe())}function Ft(e){return Te(e)?TS(e.$defs,e.$ref):Le(e)?ES(e.if,e.then,e.else):M(e)?_S(e.allOf):R(e)?SS(e.anyOf):Y(e)?IS(e.items):D(e)?e.properties:{}}function Wo(e){let t=Ft(e);return k(t)}var hj=new RegExp("^(?:0|[1-9][0-9]*)$");function Zo(e){let t=`${e}`;return hj.test(t)?parseInt(t):e}function yj(e){return z(Zo(e))}function AS(e){return e.map(t=>OS(t))}function OS(e){return M(e)?ut(AS(e.allOf)):R(e)?q(AS(e.anyOf)):Q(e)?yj(e.const):e}function xS(e,t){let n=OS(t),o=dt({},n,Nt());return G.IsExtendsTrueLike(o)?e:Q(t)&&s.IsEqual(t.const,"length")?Nt():me()}function RS(e,t){let n=yr(e,t);return Mt(n)}function CS(e,t,n){let o=rr(e,t,n);return Mt(o)}function PS(e){let t=wt(e);return Mt(t)}function US(e){let t=we(e);return Mt(t)}function wS(e){return[`${e}`]}function vS(e){let t=ht(e);return Mt(t)}function NS(e){return e.reduce((t,n)=>[...t,...Mt(n)],[])}function Mt(e){return Te(e)?RS(e.$defs,e.$ref):Le(e)?CS(e.if,e.then,e.else):ze(e)?PS(e.enum):M(e)?US(e.allOf):Q(e)?wS(e.const):Ee(e)?vS(e.pattern):R(e)?NS(e.anyOf):[]}function Xo(e){return Mt(e)}function ja(e,t){return t.map(n=>Fa(e,n))}function Fa(e,t){return Z(t)?Pt(Fa(e,t.items)):Be(t)?ur(ja(e,t.parameters),Fa(e,t.instanceType)):He(t)?lr(ja(e,t.parameters),Fa(e,t.returnType)):Y(t)?ke(ja(e,t.items)):R(t)?q(ja(e,t.anyOf)):M(t)?ut(ja(e,t.allOf)):Qc(t)?k(e):t}function LS(e,t){return Fa(e,t)}function Tj(e,t){let n=t in e?e[t]:me();return LS(e,n)}function kS(e,t){return t.reduce((n,o)=>[...n,Tj(e,o)],[])}function Ej(e,t){let n=Xo(t),o=kS(e,n);return Lt(o)}var _j=new RegExp(pn);function Ij(e){return e.filter(n=>_j.test(n))}function bj(e){let t=Pc(e),n=Ij(t),o=kS(e,n);return Lt(o)}function MS(e,t){return Ce(t)?bj(e):Ej(e,t)}function Sj(e){return z(Zo(e))}function DS(e){return e.map(t=>bm(t))}function bm(e){return M(e)?ut(DS(e.allOf)):R(e)?q(DS(e.anyOf)):Q(e)?Sj(e.const):e}function Aj(e,t){return e.reduceRight((n,o,i)=>{let a=dt({},z(i),t);return G.IsExtendsTrueLike(a)?[o,...n]:n},[])}function Oj(e,t){let n=bm(t),o=Aj(e,n);return Mr(o)}function xj(e){return Mr(e)}function GS(e,t){return Q(t)&&s.IsEqual(t.const,"length")?z(e.length):Ce(t)||ot(t)?xj(e):Oj(e,t)}function $S(e,t){return Z(e)?xS(e.items,t):D(e)?MS(e.properties,t):Y(e)?GS(e.items,t):me()}function Rj(e){return Te(e)||Le(e)||M(e)||R(e)?Wo(e):e}function Im(e,t,n){return K([e,t])?y.Update($S(Rj(e),t),{},n):Ra(e,t,n)}function jS(e,t,n,o,i){let a=O(e,t,n),c=O(e,t,o);return Im(a,c,i)}function ap(e,t={}){return v("InstanceType",[e],t)}function FS(e,t={}){return Sm(e,t)}function Cj(e){return Be(e)?e.instanceType:me()}function Sm(e,t){return K([e])?y.Update(Cj(e),{},t):ap(e,t)}function qS(e,t,n,o={}){let i=O(e,t,n);return Sm(i,o)}function Ca(e,t={}){return v("KeyOf",[e],t)}function BS(e,t={}){return Am(e,t)}function HS(){return q([Nt(),It(),Do()])}function KS(e){return Nt()}function Pj(e){return e.reduce((n,o)=>Mc(o)?[...n,z(Zo(o))]:fe(),[])}function zS(e){let t=s.Keys(e),n=Pj(t);return Mr(n)}function YS(e){return un(e)}function VS(e){let t=e.map((n,o)=>z(o));return Mr(t)}function QS(e){return Ve(e)?HS():Z(e)?KS(e.items):D(e)?zS(e.properties):de(e)?YS(e):Y(e)?VS(e.items):me()}function Uj(e){return Te(e)||Le(e)||M(e)||R(e)?Wo(e):e}function Am(e,t){return K([e])?y.Update(QS(Uj(e)),{},t):Ca(e,t)}function WS(e,t,n,o){let i=O(e,t,n);return Am(i,o)}function Aa(e,t,n,o,i={}){return v("Mapped",[e,t,n,o],i)}function ZS(e,t,n,o,i={}){return Om({},be([],[]),e,t,n,o,i)}function wj(e){let t=ht(e);return Up(t)}function vj(e){return e.reduce((t,n)=>[...t,...Up(n)],[])}function Nj(e){let t=wt(e);return Up(t)}function Lj(e){return s.IsNumber(e)?[z(`${e}`)]:[z(e)]}function Up(e){return ze(e)?Nj(e.enum):Q(e)?Lj(e.const):Ee(e)?wj(e.pattern):R(e)?vj(e.anyOf):[e]}function XS(e){return Up(e)}function kj(e){return Ee(e)?ht(e.pattern):e}function Mj(e,t,n,o,i,a){let c=y.Assign(e,{[n.name]:o}),l=O(c,t,i),m=kj(l),f=O(c,t,a);return Dc(m)||Gc(m)?{[m.const]:f}:{}}function Dj(e,t,n,o,i,a){return o.reduce((c,l)=>[...c,Mj(e,t,n,l,i,a)],[])}function Gj(e){return e.reduce((t,n)=>[...t,k(n)],[])}function JS(e,t,n,o,i,a){let c=XS(o),l=Dj(e,t,n,c,i,a),m=Gj(l);return we(m)}function Om(e,t,n,o,i,a,c){return K([o])?y.Update(JS(e,t,n,o,i,a),{},c):Aa(n,o,i,a,c)}function eA(e,t,n,o,i,a,c){let l=O(e,t,o);return Om(e,t,n,l,i,a,c)}function $j(e,t,n){let o=y.Assign(e,t);return s.Keys(t).filter(a=>n.includes(a)).reduce((a,c)=>({...a,[c]:kb(o,c,t[c])}),{})}function jj(e,t,n){let o=y.Assign(e,t);return s.Keys(t).filter(a=>!n.includes(a)).reduce((a,c)=>({...a,[c]:O(o,be([],[]),t[c])}),{})}function Fj(e,t,n){let o=wb(t),i=$j(e,t,o),a=jj(e,t,o),c={...i,...a};return y.Update(c,{},n)}function wp(e,t,n,o){return Fj(e,n,o)}function sp(e,t={}){return v("NonNullable",[e],t)}function tA(e,t={}){return xm(e,t)}function qj(e){let t=q([Mo(),Fo()]);return $a(e,t,{})}function xm(e,t){return K([e])?y.Update(qj(e),{},t):sp(e,t)}function rA(e,t,n,o){let i=O(e,t,n);return xm(i,o)}function cp(e,t,n={}){return v("Omit",[e,t],n)}function nA(e,t,n={}){let o=s.IsArray(t)?Qo(t):t;return Rm(e,o,n)}function vp(e){let t=Wo(e);return D(t)?t.properties:fe()}function Bj(e,t){return s.Keys(e).reduce((o,i)=>t.includes(i)?o:{...o,[i]:e[i]},{})}function oA(e,t){let n=vp(e),o=Xo(t),i=Bj(n,o);return k(i)}function Rm(e,t,n){return K([e,t])?y.Update(oA(e,t),{},n):cp(e,t,n)}function iA(e,t,n,o,i){let a=O(e,t,n),c=O(e,t,o);return Rm(a,c,i)}function pp(e,t={}){return v("Parameters",[e],t)}function aA(e,t={}){return Cm(e,t)}function Hj(e){let t=He(e)?e.parameters:[],n=gn({},be([],[]),t);return ke(n)}function Cm(e,t){return K([e])?y.Update(Hj(e),{},t):pp(e,t)}function sA(e,t,n,o){let i=O(e,t,n);return Cm(i,o)}function up(e,t={}){return v("Partial",[e],t)}function cA(e,t={}){return Pm(e,t)}function pA(e,t){let n=yr(e,t),o=Tr(n);return dr(y.Assign(e,{[t]:o}),t)}function uA(e,t,n){let o=rr(e,t,n);return Tr(o)}function lA(e){let t=we(e);return Tr(t)}function mA(e){let t=e.map(n=>Tr(n));return q(t)}function dA(e){let t=s.Keys(e).reduce((o,i)=>({...o,[i]:Fn(e[i])}),{});return k(t)}function Tr(e){return Te(e)?pA(e.$defs,e.$ref):Le(e)?uA(e.if,e.then,e.else):M(e)?lA(e.allOf):R(e)?mA(e.anyOf):D(e)?dA(e.properties):k({})}function Pm(e,t){return K([e])?y.Update(Tr(e),{},t):up(e,t)}function fA(e,t,n,o){let i=O(e,t,n);return Pm(i,o)}function lp(e,t,n={}){return v("Pick",[e,t],n)}function gA(e,t,n={}){let o=s.IsArray(t)?Qo(t):t;return Um(e,o,n)}function Kj(e,t){return s.Keys(e).reduce((o,i)=>t.includes(i)?y.Assign(o,{[i]:e[i]}):o,{})}function hA(e,t){let n=vp(e),o=Xo(t),i=Kj(n,o);return k(i)}function Um(e,t,n){return K([e,t])?y.Update(hA(e,t),{},n):lp(e,t,n)}function yA(e,t,n,o,i){let a=O(e,t,n),c=O(e,t,o);return Um(a,c,i)}function mp(e,t={}){return v("ReadonlyObject",[e],t)}function wm(e,t={}){return vm(e,t)}var TA=wm;function EA(e){return ko(Pt(e))}function _A(e,t){let n=yr(e,t),o=Er(n);return dr(y.Assign(e,{[t]:o}),t)}function IA(e,t,n){let o=rr(e,t,n);return Er(o)}function bA(e){let t=we(e);return Er(t)}function SA(e){let t=s.Keys(e).reduce((o,i)=>({...o,[i]:zn(e[i])}),{});return k(t)}function AA(e){return ko(ke(e))}function OA(e){let t=e.map(n=>Er(n));return q(t)}function Er(e){return Z(e)?EA(e.items):Te(e)?_A(e.$defs,e.$ref):Le(e)?IA(e.if,e.then,e.else):M(e)?bA(e.allOf):D(e)?SA(e.properties):Y(e)?AA(e.items):R(e)?OA(e.anyOf):e}function vm(e,t){return K([e])?y.Update(Er(e),{},t):mp(e)}function xA(e,t,n,o){let i=O(e,t,n);return vm(i,o)}function RA(e,t,n,o){return t.visited.includes(o)?n:o in e?O(e,be(t.callstack,[...t.visited,o]),e[o]):n}function CA(e,t){let n=yr(e,t),o=_r(n);return dr(y.Assign(e,{[t]:o}),t)}function PA(e,t,n){let o=rr(e,t,n);return _r(o)}function UA(e){let t=we(e);return _r(t)}function wA(e){let t=e.map(n=>_r(n));return q(t)}function vA(e){let t=s.Keys(e).reduce((o,i)=>({...o,[i]:Bc(e[i])}),{});return k(t)}function _r(e){return Te(e)?CA(e.$defs,e.$ref):Le(e)?PA(e.if,e.then,e.else):M(e)?UA(e.allOf):R(e)?wA(e.anyOf):D(e)?vA(e.properties):k({})}function dp(e,t={}){return v("Required",[e],t)}function NA(e,t={}){return Nm(e,t)}function Nm(e,t){return K([e])?y.Update(_r(e),{},t):dp(e,t)}function LA(e,t,n,o){let i=O(e,t,n);return Nm(i,o)}function fp(e,t={}){return v("ReturnType",[e],t)}function kA(e,t={}){return Lm(e,t)}function zj(e){return He(e)?e.returnType:me()}function Lm(e,t){return K([e])?y.Update(zj(e),{},t):fp(e,t)}function MA(e,t,n,o={}){let i=O(e,t,n);return Lm(i,o)}function gp(e,t){return v("With",[e,t],{})}function Np(e,t){return km(e,t)}function km(e,t){return K([e])?y.Update(e,{},t):gp(e,t)}function DA(e,t,n,o){let i=O(e,t,n);return km(i,o)}function Yj(e){return ln(e)?Y(e.items)?Mm(e.items.items):Ke(e.items)?[e]:ce(e.items)?[e]:[me()]:[e]}function Mm(e){return e.reduce((n,o)=>[...n,...Yj(o)],[])}function be(e,t){return{callstack:e,visited:t}}function K(e){return s.ShiftLeft(e,(t,n)=>ce(t)?!1:K(n),()=>!0)}function La(e,t,n){return s.Keys(n).reduce((o,i)=>({...o,[i]:O(e,t,n[i])}),{})}function gn(e,t,n){let o=jt(e,t,n);return Mm(o)}function jt(e,t,n){return n.map(o=>O(e,t,o))}function Vj(e,t){let n=Je(e)?ma(t,{}):t,o=Yn(e)?la(n,{}):n;return Kn(e)?qa(o,{}):o}function Qj(e,t,n,o,i){return s.IsEqual(n,"AddImmutable")?GA(e,t,o[0],i):s.IsEqual(n,"RemoveImmutable")?Qb(e,t,o[0],i):s.IsEqual(n,"AddReadonly")?Py(e,t,o[0],i):s.IsEqual(n,"RemoveReadonly")?IT(e,t,o[0],i):s.IsEqual(n,"AddOptional")?Uy(e,t,o[0],i):s.IsEqual(n,"RemoveOptional")?AT(e,t,o[0],i):s.IsEqual(n,"Capitalize")?oS(e,t,o[0],i):s.IsEqual(n,"Conditional")?pS(e,t,o[0],o[1],o[2],o[3],i):s.IsEqual(n,"ConstructorParameters")?lS(e,t,o[0],i):s.IsEqual(n,"Evaluate")?Gb(e,t,o[0],i):s.IsEqual(n,"Exclude")?dS(e,t,o[0],o[1],i):s.IsEqual(n,"Extract")?hS(e,t,o[0],o[1],i):s.IsEqual(n,"Index")?jS(e,t,o[0],o[1],i):s.IsEqual(n,"InstanceType")?qS(e,t,o[0],i):s.IsEqual(n,"Interface")?Rb(e,t,o[0],o[1],i):s.IsEqual(n,"KeyOf")?WS(e,t,o[0],i):s.IsEqual(n,"Lowercase")?iS(e,t,o[0],i):s.IsEqual(n,"Mapped")?eA(e,t,o[0],o[1],o[2],o[3],i):s.IsEqual(n,"Module")?wp(e,t,o[0],i):s.IsEqual(n,"NonNullable")?rA(e,t,o[0],i):s.IsEqual(n,"Pick")?yA(e,t,o[0],o[1],i):s.IsEqual(n,"Parameters")?sA(e,t,o[0],i):s.IsEqual(n,"Partial")?fA(e,t,o[0],i):s.IsEqual(n,"Omit")?iA(e,t,o[0],o[1],i):s.IsEqual(n,"ReadonlyObject")?xA(e,t,o[0],i):s.IsEqual(n,"Record")?FT(e,t,o[0],o[1],i):s.IsEqual(n,"Required")?LA(e,t,o[0],i):s.IsEqual(n,"ReturnType")?MA(e,t,o[0],i):s.IsEqual(n,"TemplateLiteral")?KI(e,t,o[0],i):s.IsEqual(n,"Uncapitalize")?aS(e,t,o[0],i):s.IsEqual(n,"Uppercase")?sS(e,t,o[0],i):s.IsEqual(n,"With")?DA(e,t,o[0],o[1]):v(n,o,i)}function Wj(e,t,n){let o=ce(n)?RA(e,t,n,n.$ref):Z(n)?Pt(O(e,t,n.items),wo(n)):Vo(n)?Pp(e,t,n.target,n.arguments):Be(n)?ur(jt(e,t,n.parameters),O(e,t,n.instanceType),wy(n)):He(n)?lr(jt(e,t,n.parameters),O(e,t,n.returnType),vy(n)):Le(n)?qn(O(e,t,n.if),O(e,t,n.then),O(e,t,n.else),Gy(n)):M(n)?ut(jt(e,t,n.allOf),By(n)):D(n)?k(La(e,t,n.properties),My(n)):de(n)?zc(it(n),O(e,t,Se(n))):ln(n)?Zn(O(e,t,n.items)):Y(n)?ke(gn(e,t,n.items),_T(n)):R(n)?q(jt(e,t,n.anyOf),uT(n)):n;return Vj(n,o)}function O(e,t,n){return on(n)?Qj(e,t,n.action,n.parameters,n.options):Wj(e,t,n)}function Qt(e,t){return O(e,be([],[]),t)}function Zj(e){return y.Update(e,{"~immutable":!0},{})}function qa(e,t){return y.Update(Zj(e),{},t)}function GA(e,t,n,o){let i=O(e,t,n);return qa(i,o)}function F_(e,t={}){return v("AddImmutable",[e],t)}function ko(e,t={}){return qa(e,t)}function q_(e,t={}){return v("Evaluate",[e],t)}function ft(e,t={}){return um(e,t)}function B_(e,t={}){return v("Module",[e],t)}function $A(e,t={}){return wp({},be([],[]),e,t)}function Xj(e,t){let n=Wn(e,t);return s.IsEqual(n,"right-inside")||s.IsEqual(n,"disjoint")?1:0}function jA(e,t,n=[]){return s.ShiftLeft(t,(o,i)=>s.IsEqual(Xj(e,o),1)?jA(e,i,[...n,o]):[...n,e,...t],()=>[...n,e])}function FA(e,t=[]){return s.ShiftLeft(e,(n,o)=>FA(o,jA(n,t)),()=>t)}function qA(e){return FA(e)}function BA(...e){let[t,n,o]=oe.Match(e,{2:(c,l)=>s.IsString(c)?[{},c,l]:[c,l,{}],3:(c,l,m)=>[c,l,m],1:c=>[{},c,{}]}),i=jI(n),a=s.IsArray(i)&&s.IsEqual(i.length,2)?O(t,be([],[]),i[0]):me();return y.Update(a,{},o)}var r={};Yt(r,{Any:()=>No,Array:()=>Pt,BigInt:()=>ha,Boolean:()=>Lc,Call:()=>Yb,Capitalize:()=>eS,Codec:()=>vc,Conditional:()=>cS,Constructor:()=>ur,ConstructorParameters:()=>uS,Cyclic:()=>dr,Decode:()=>eT,DecodeBuilder:()=>ga,Dependent:()=>qn,Encode:()=>tT,EncodeBuilder:()=>fa,Enum:()=>qy,Evaluate:()=>ft,Exclude:()=>mS,Extends:()=>dt,ExtendsResult:()=>G,Extract:()=>fS,Function:()=>lr,Generic:()=>an,Identifier:()=>ya,Immutable:()=>rT,Index:()=>yS,Infer:()=>da,InstanceType:()=>FS,Instantiate:()=>Qt,Integer:()=>Vn,Interface:()=>Cb,Intersect:()=>ut,IsAny:()=>Ve,IsArray:()=>Z,IsBigInt:()=>vt,IsBoolean:()=>_t,IsCall:()=>Vo,IsCodec:()=>Hn,IsConstructor:()=>Be,IsCyclic:()=>Te,IsDependent:()=>Le,IsEnum:()=>ze,IsEnumValue:()=>Fy,IsFunction:()=>He,IsGeneric:()=>vo,IsIdentifier:()=>aT,IsImmutable:()=>Kn,IsInfer:()=>Ke,IsInteger:()=>ot,IsIntersect:()=>M,IsKind:()=>w,IsLiteral:()=>Q,IsNever:()=>tr,IsNull:()=>gr,IsNumber:()=>Ce,IsObject:()=>D,IsOptional:()=>Je,IsParameter:()=>pT,IsReadonly:()=>Yn,IsRecord:()=>de,IsRef:()=>ce,IsRefine:()=>Nc,IsRest:()=>ln,IsSchema:()=>Ue,IsString:()=>We,IsSymbol:()=>hr,IsTemplateLiteral:()=>Ee,IsThis:()=>Qc,IsTuple:()=>Y,IsUndefined:()=>nr,IsUnion:()=>R,IsUnknown:()=>et,IsUnsafe:()=>wc,IsVoid:()=>kt,KeyOf:()=>BS,Literal:()=>z,Lowercase:()=>tS,Mapped:()=>ZS,Module:()=>$A,Never:()=>me,NonNullable:()=>tA,Null:()=>Mo,Number:()=>Nt,Object:()=>k,Omit:()=>nA,Optional:()=>Ly,Parameter:()=>Qn,Parameters:()=>aA,Partial:()=>cA,Pick:()=>gA,Readonly:()=>nT,ReadonlyObject:()=>wm,ReadonlyType:()=>TA,Record:()=>jo,RecordKey:()=>un,RecordPattern:()=>it,RecordValue:()=>Se,Ref:()=>nt,Refine:()=>oT,Required:()=>NA,Rest:()=>Zn,ReturnType:()=>kA,Script:()=>BA,String:()=>It,Symbol:()=>Do,TemplateLiteral:()=>YI,This:()=>Vc,Tuple:()=>ke,Uncapitalize:()=>rS,Undefined:()=>Fo,Union:()=>q,Unknown:()=>Qe,Unsafe:()=>Dy,Uppercase:()=>nS,Void:()=>Wc,With:()=>Np});var HA="Must be a valid tags query: only tag:value searches (no wildcards), boolean operators, and parentheses are supported.";var Jj=rn(zA());var YA="lowercase-email",Dm="iana-timezone",Gm="simple-time",$m="simple-date-time";var eF=(e,t)=>RegExp(`^${e.source}(${t.source}${e.source})*$`),tF=/[a-zA-Z0-9-_]+/,rF=/\./,WRe=eF(tF,rF);var VA="lowercase-domain";var Jo="kebab-case";var QA="camel-case";var nF=new Set;function C(e,t,n={}){let o=t.map(i=>{let a=i;return a.$id?(nF.add(i),r.Ref(a.$id)):i});return r.Unsafe({...n,type:"object",discriminator:{propertyName:e},required:[e],oneOf:o})}function _e(e,t){return r.Object({values:r.Array(e,{maxItems:t.maxItems,description:"Values compared by this filter. When `exclude` is omitted or false, rows matching any value are kept; when `exclude` is true, matching rows are removed."}),exclude:r.Optional(r.Boolean({description:"If true, exclude rows matching these values instead of including them"}))},{description:t.description})}function jm(e,t={}){return C("type",[r.Object({type:r.Literal("ids"),ids:r.Array(u({allowEmpty:!1}),{minItems:1,...t.maxIds!==void 0&&{maxItems:t.maxIds}})}),r.Object({type:r.Literal("all"),filters:r.Optional(e)})])}var ti=1e3,kp=100,ge={limit:r.Optional(r.Integer({minimum:1,maximum:ti,description:"Maximum number of items to return in this page."})),offset:r.Optional(r.Integer({minimum:0,description:"Zero-based index of the first matching item to return. Increase it with `limit` to request later pages. If `limit` is provided without `offset`, the offset defaults to 0."}))},Ze={...ge,limit:r.Optional(r.Integer({minimum:1,maximum:ti,default:kp,description:`Maximum number of items to return in this page. Omit to use the public API default of ${kp}.`}))},oF=r.Object({totalCount:r.Integer({description:"Total number of items matching the query before `limit` and `offset` are applied."}),pageCount:r.Integer({description:"Total number of pages available for the requested `limit`."})},{description:"Counts describing the full result set that the returned page was taken from, for computing how many further pages remain."}),rCe=r.Object({pagination:oF},{$id:"ResponseMetadata",description:"Metadata accompanying `data` on paginated operations, describing the full result set the page was taken from."});function A(e={}){return r.Unsafe({...e,type:"string"})}var ei=250;function u({allowEmpty:e=!0,type:t="short",description:n,default:o}={}){let i=e?0:1,a={...n===void 0?{}:{description:n},...o===void 0?{}:{default:o}};switch(t){case"camel-case":return r.String({format:QA,minLength:i,maxLength:ei,...a});case"kebab-case":return r.String({format:Jo,minLength:i,maxLength:ei,...a});case"email":return r.String({format:YA,minLength:i,maxLength:254,errorMessage:{format:"Must be a valid lowercase email address."},...a});case"lowercase-domain":return r.String({format:VA,minLength:i,maxLength:ei,...a});case"tsuga-query":return r.String({format:"tsuga-query",minLength:i,maxLength:1e4,...a});case"tags-query":return r.String({format:"tags-query",minLength:i,maxLength:1e4,errorMessage:{format:`${HA} The query you provided is invalid: \${0}`},...a});case"date-time":return r.String({format:"date-time",...a});case"uri":return r.String({format:"uri",...a});case"user-password":return r.String({format:"user-password",minLength:12,maxLength:ei,...a});case"long":return r.String({minLength:i,maxLength:5e4,...a});case"short":return r.String({minLength:i,maxLength:ei,...a});case"tsuga-formula":return r.String({format:"tsuga-formula",minLength:i,maxLength:ei,errorMessage:{format:"Must be a simple mathematical formula, and all variables in it should refer to queries (q1, q2, etc.). The formula you provided is invalid: ${0}"},...a});case"time":return r.String({format:"time",...a});case"readonly-sql-query":return r.String({format:"readonly-sql-query",minLength:i,maxLength:5e4,errorMessage:{format:"Must be a readonly SQL query - only SELECT statements are allowed."},...a});default:tt(t)}}var Ba=["ingestion-api-key","operation-api-key","rum-public-token","dashboard","log-route","metric-route","monitor","notification-rule","notification-silence","slo"],Mp=r.Array(r.Enum(Ba,{description:"Tsuga-managed asset type."}),{description:"Tsuga-managed asset types covered by the policy. An empty array means all supported asset types."});var Fm=["CLUSTER_DB_QUERY_INVALID_CONNECTION_PARAMS","CLUSTER_DB_QUERY_INVALID_CREDENTIALS","CLUSTER_DB_QUERY_PERMISSION_DENIED","CLUSTER_DB_QUERY_QUERY_SYNTAX_ERROR","CLUSTER_DB_QUERY_DATABASE_UNREACHABLE","CLUSTER_DB_QUERY_CONNECTION_FAILED","CLUSTER_DB_QUERY_QUERY_EXECUTION_FAILED","CLUSTER_DB_QUERY_QUERY_TIMEOUT"],gCe=r.Enum(Fm),iF=["CLUSTER_AGGREGATION_STRUCTURE"],hCe=r.Object({code:r.Enum(Fm),message:r.String()}),ZA=[...Fm,...iF,"ABORT_ERROR","BAD_REQUEST","DUPLICATE_KEY_VIOLATION","FOREIGN_KEY_VIOLATION","FST_ERR_VALIDATION","GROK_RULE_VALIDATION_ERROR","INVALID_INPUT","FORBIDDEN","MISSING_PERMISSION","PRIVILEGE_ESCALATION","RATE_LIMITED","RESERVED_TAG_POLICY_ERROR","RESOURCE_NOT_FOUND","INVALID_INVITATION","TAG_POLICY_ALREADY_EXISTS_ERROR","TAG_POLICY_VALIDATION_ERROR","UNAUTHORIZED","URL_NOT_FOUND"],XA=["INTERNAL_ERROR","INVALID_QUERY_TO_CLUSTER"];var aF=["NETWORK_ERROR","RESPONSE_PARSE_ERROR"],sF=[...ZA,...XA,...aF],cF=r.Object({assetId:r.Optional(r.String({description:"Identifier of the asset that violated the policy. Set from the existing asset for update and bulk requests. Omitted on create requests before the asset exists."})),assetName:r.String({description:"Name of the asset that violated the policy. Set from submitted data or the existing asset row. Returned for every violation."}),assetType:r.Enum(Ba,{description:"Type of Tsuga asset validated by the policy. Set by the route that ran tag-policy validation. Returned for every violation."}),tagPolicyId:r.String({description:"Identifier of the active tag policy that was violated. Generated by Tsuga when the policy is created. Returned for every violation."}),tagKey:r.String({description:"Tag key required or constrained by the violated policy. Set by the tag policy. Returned for every violation."}),message:r.String({description:"Human-readable reason this policy failed for the asset. Generated by Tsuga's tag-policy validator. Returned for every violation."})},{description:"A single tag-policy violation, identifying the offending asset, the policy and tag key involved, and why validation failed."}),pF=C("type",[r.Object({type:r.Literal("invalid-syntax",{description:"Discriminator identifying a rule the grok parser could not parse at all."}),error:r.Object({offset:r.Integer({description:"Byte offset in the rule where parsing failed."}),detail:r.String({description:"Parser detail message."})},{description:"Position and parser message for the syntax failure."})},{$id:"GrokInvalidSyntax"}),r.Object({type:r.Literal("unknown-pattern",{description:"Discriminator identifying a rule that references a pattern name the grok engine does not provide."}),error:r.Object({offset:r.Integer({description:"Byte offset of the unknown pattern."}),unknownPattern:r.String({description:"The pattern name that is not supported."})},{description:"Position and name of the unsupported pattern."})},{$id:"GrokUnknownPattern"}),r.Object({type:r.Literal("invalid-filter",{description:"Discriminator identifying a rule whose filter is a known filter used incorrectly."}),error:r.Object({offset:r.Integer({description:"Byte offset of the invalid filter."}),invalidFilter:r.String({description:"The filter that is invalid."}),message:r.String({description:"Why the filter is invalid."})},{description:"Position, text, and reason for the invalid filter."})},{$id:"GrokInvalidFilter"}),r.Object({type:r.Literal("unknown-filter",{description:"Discriminator identifying a rule that references a filter name the grok engine does not implement."}),error:r.Object({offset:r.Integer({description:"Byte offset of the unknown filter."}),unknownFilter:r.String({description:"The filter name that is not implemented."}),message:r.String({description:"Details about the unsupported filter."})},{description:"Position and name of the unimplemented filter."})},{$id:"GrokUnknownFilter"})],{description:"Full structured detail of a grok rule that failed to compile, discriminated by `type`."}),uF=r.Object({rule:r.String({description:"The rule that failed to compile."}),ruleIndex:r.Integer({description:"0-based index of the failing rule in the submitted `rules` array."}),error:pF},{description:"A single grok rule that failed to compile, with its position in the submitted rules and the structured compile error."}),JA=C("type",[r.Object({type:r.Literal("tag_policy_violation",{description:"Discriminator identifying tag-policy validation details. Set by Tsuga to `tag_policy_violation`. Returned when the error code is `TAG_POLICY_VALIDATION_ERROR`."}),violations:r.Array(cF,{description:"Tag-policy violations that caused the request to fail. Built from active policies applicable to the submitted asset type and owner team. Returned on tag-policy validation errors; can contain multiple policies and multiple assets for bulk requests."})},{$id:"TagPolicyViolationDetails"}),r.Object({type:r.Literal("grok_rule_error",{description:"Discriminator identifying grok rule validation details. Set by Tsuga to `grok_rule_error`. Returned when the error code is `GROK_RULE_VALIDATION_ERROR`."}),ruleErrors:r.Array(uF,{description:"Grok rules that failed to compile, with full structured detail. One entry per invalid rule."})},{$id:"GrokRuleErrorDetails"})],{description:"Structured details for a client error. Set by Tsuga only for error types with machine-readable remediation data, and omitted for every other client error."}),yCe=r.Object({code:r.Optional(r.Enum(sF,{description:"Machine readable error code describing what went wrong"})),message:r.String({description:"Human readable explanation of the error"}),statusCode:r.Number({description:"HTTP status code that was returned"}),details:r.Optional(JA)},{$id:"ErrorResponse",description:"Standard envelope for API errors"}),TCe=r.Object({code:r.Optional(r.Enum(ZA,{description:"Machine readable error code describing what went wrong"})),message:r.String({description:"Human readable explanation of the error"}),statusCode:r.Number({description:"HTTP status code that was returned"}),details:r.Optional(JA)},{$id:"ClientErrorResponse",description:"Standard envelope for client (4XX) API errors"}),ECe=r.Object({code:r.Optional(r.Enum(XA,{description:"Machine readable error code describing what went wrong"})),message:r.String({description:"Human readable explanation of the error"}),statusCode:r.Number({description:"HTTP status code that was returned"})},{$id:"ServerErrorResponse",description:"Standard envelope for server (5XX) API errors"}),_Ce=r.Object({requestId:r.String({description:"Identifier used to trace the lifecycle of this API request"}),error:r.Ref("ClientErrorResponse")},{$id:"ClientErrorEnvelope",description:"Standard envelope wrapping all client (4XX) error responses"}),ICe=r.Object({requestId:r.String({description:"Identifier used to trace the lifecycle of this API request"}),error:r.Ref("ServerErrorResponse")},{$id:"ServerErrorEnvelope",description:"Standard envelope wrapping all server (5XX) error responses"});function d({body:e,description:t,method:n,operationId:o,params:i,tags:a,query:c,paginated:l,response:m,url:f}){return i?{buildUrl:E=>f.replace(/:[a-zA-Z_]+/g,I=>E[I.slice(1)]),method:n,params:i,response:m,templateUrl:f,...e===void 0?{}:{body:e},...t===void 0?{}:{description:t},...o===void 0?{}:{operationId:o},...c===void 0?{}:{query:c},...l===void 0?{}:{paginated:l},...a===void 0?{}:{tags:a}}:{method:n,response:m,url:f,templateUrl:f,...e===void 0?{}:{body:e},...t===void 0?{}:{description:t},...o===void 0?{}:{operationId:o},...c===void 0?{}:{query:c},...l===void 0?{}:{paginated:l},...a===void 0?{}:{tags:a}}}function eO(e,t){if(!t||typeof t!="object")return e;let n=new URLSearchParams;return Object.entries(t).forEach(([o,i])=>{Array.isArray(i)?i.length>0&&i.forEach(a=>{a!==void 0&&(typeof a=="string"||typeof a=="number"||typeof a=="boolean")&&n.append(o,String(a))}):(typeof i=="boolean"||typeof i=="string"||typeof i=="number")&&n.append(o,String(i))}),`${e}?${n.toString()}`}var N=r.Object({success:r.Literal(!0,{description:"Always `true` when the delete request completed and the resource was removed."})},{$id:"DeleteResponse",description:"Confirmation that the targeted resource was deleted.",example:{success:!0}});var Gp="tsuga-cli";var to="/v0/oauth",tO=d({description:"OAuth 2.1 authorization endpoint: validates the client and redirect URI, then redirects to the consent page",url:`${to}/authorize`,method:"GET",query:r.Partial(r.Object({response_type:r.String({description:"Must be `code`"}),client_id:r.String({description:"First-party client id or CIMD document URL"}),redirect_uri:r.String({description:"Client redirect URI"}),code_challenge:r.String({description:"PKCE code challenge"}),code_challenge_method:r.String({description:"Must be `S256`"}),state:r.String({description:"Opaque client state, echoed back"}),resource:r.String({description:"RFC 8707 resource indicator"})})),response:r.Object({},{description:"Never returned: this endpoint redirects (302) or renders an HTML error (400)"})}),rO=d({description:"OAuth 2.1 token endpoint: exchanges an authorization code (PKCE) or refresh token for a token pair",url:`${to}/token`,method:"POST",body:r.Partial(r.Object({grant_type:r.String({description:"`authorization_code` or `refresh_token`"}),code:r.String({description:"Authorization code being exchanged"}),code_verifier:r.String({description:"PKCE code verifier"}),redirect_uri:r.String({description:"Must match the redirect URI used on /authorize"}),client_id:r.String({description:"Client id, when sent by the client"}),refresh_token:r.String({description:"Refresh token, for `grant_type=refresh_token`"})})),response:r.Object({access_token:r.String(),token_type:r.Literal("Bearer"),expires_in:r.Number({description:"Access token lifetime in seconds"}),refresh_token:r.String()})}),DCe=d({description:"Resolve a signed authorization request handle for the consent page",url:`${to}/authorization-request`,method:"GET",query:r.Object({handle:r.String()}),response:r.Object({clientId:r.String(),clientName:r.String(),redirectUri:r.String()})}),GCe=d({description:"Approve or deny an OAuth authorization request from the consent page",url:`${to}/approve`,method:"POST",body:r.Object({handle:r.String({description:"The signed authorization request handle"}),approve:r.Boolean()}),response:r.Object({redirectTo:r.String({description:"The client's redirect URI carrying either the code or the denial"})})}),$Ce=d({description:"Validate an OAuth access token (internal, for the MCP resource server)",url:`${to}/introspect`,method:"POST",body:r.Object({token:r.String()}),response:r.Object({active:r.Boolean(),userId:r.Optional(r.String()),orgId:r.Optional(r.String())})}),lF=["pending","active","revoked"],mF=r.Object({id:r.String(),createdAt:A(),clientId:r.String({description:"Client ID Metadata Document URL or first-party client id"}),clientName:r.String({description:"Display name derived from the client identity"}),userId:r.String(),status:r.Enum(lF),lastUsedAt:r.Optional(A())}),jCe=d({tags:["oauth"],description:"List OAuth grants: your own, or all users for admins",url:`${to}/grants`,method:"GET",query:r.Object({allUsers:r.Optional(r.Boolean({description:"Admins only: list grants of every user in the org"}))}),response:r.Array(mF)}),FCe=d({tags:["oauth"],description:"Delete an OAuth grant (own grant, or any grant for admins)",url:`${to}/grants/:id`,method:"DELETE",params:r.Object({id:r.String()}),response:N});function nO(e,t){let n=new URL(tO.url,e);return n.search=new URLSearchParams({response_type:"code",client_id:Gp,redirect_uri:t.redirectUri,code_challenge:t.challenge,code_challenge_method:"S256",state:t.state}).toString(),n.href}var Ha=class extends Error{constructor(n,o){super(n);this.code=o;this.name="OAuthTokenError"}};function dF(e){if(!e)return{};try{let t=JSON.parse(e);return typeof t=="object"&&t!==null?t:{}}catch{return{}}}async function oO(e,t){let n=await fetch(new URL(rO.url,e).href,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams(t).toString()}),o=await n.text(),i=dF(o);if(n.status!==200){let a=i.error??`HTTP ${n.status}`;throw new Ha(`OAuth token request failed (${a}${i.error_description?`: ${i.error_description}`:""})`,a)}if(typeof i.access_token!="string"||i.access_token===""||typeof i.refresh_token!="string"||i.refresh_token===""||typeof i.expires_in!="number")throw new Error("OAuth token response was missing required fields");return{accessToken:i.access_token,refreshToken:i.refresh_token,expiresAt:new Date(Date.now()+i.expires_in*Pl)}}async function iO(e,t){return oO(e,{grant_type:"authorization_code",client_id:Gp,code:t.code,code_verifier:t.verifier,redirect_uri:t.redirectUri})}async function $p(e,t){return oO(e,{grant_type:"refresh_token",client_id:Gp,refresh_token:t})}var fF="Your session expired. Run `tsuga auth login` to sign in again.",gF="Your session could not be renewed: the refresh token was already used, revoked or expired. A refresh token is single-use, so the server revokes the whole session when one is replayed - run `tsuga auth login` to sign in again.",hF=5*sa;function aO(e,t){return new Date(e.accessExpiresAt)<=new Date(t.getTime()+hF)}function Ka(e){return`\u2022\u2022\u2022\u2022${e.slice(-4)}`}function qm(e){return{accessToken:e.accessToken,accessExpiresAt:e.expiresAt.toISOString(),refreshToken:e.refreshToken}}function sO(e){if(e.overrideKey)return{kind:"operation-api-key",token:e.overrideKey};if(e.operationApiKey)return{kind:"operation-api-key",token:e.operationApiKey};if(e.userAuth)return{kind:"user-session",userAuth:e.userAuth}}function cO(e){if(e)switch(e.kind){case"operation-api-key":return e.token;case"user-session":return e.userAuth.accessToken;default:tt(e)}}async function jp({userAuth:e,now:t,reload:n,refresh:o,persist:i}){if(!aO(e,t))return e;let a=n()??e;if(!aO(a,t))return a;if(!a.refreshToken)throw new Error(fF);let c;try{c=await o(a.refreshToken)}catch(m){throw m instanceof Ha&&m.code==="invalid_grant"?new Error(gF,{cause:m}):new Error(`Could not renew your session: ${m instanceof Error?m.message:String(m)}. Retry the command.`,{cause:m})}let l=qm(c);try{i(l)}catch(m){console.error(`Warning: could not save the renewed session (${m instanceof Error?m.message:String(m)}). Run \`tsuga auth login\` before the next command.`)}return l}var Bm={r:8,g:203,b:0},Hm={r:0,g:130,b:0},Km=["\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2557 ","\u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557"," \u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551"," \u2588\u2588\u2551 \u255A\u2550\u2550\u2550\u2550\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2551"," \u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2551"," \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D"];function zm(e,t,n){return Math.round(e+(t-e)*n)}function yF(e,t){let n=zm(Bm.r,Hm.r,t),o=zm(Bm.g,Hm.g,t),i=zm(Bm.b,Hm.b,t);return`\x1B[38;2;${n};${o};${i}m${e}\x1B[0m`}function TF(e){if(!e)return`
|
|
33
|
+
`,e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>[]))),([t,n])=>[t,n]),$I=(e,t=[])=>p(p(GI(e),([n,o])=>p(rm(o),([i,a])=>[[n,i],a])),([n,o])=>$I(o,[...t,n]),()=>[t,e]),L$=e=>p(p(p(rm(e),([t,n])=>p($I(n),([o,i])=>p(p(GI(i),([a,c])=>[[a],c],()=>[[],i]),([a,c])=>[[t,o,a],c]))),([t,n])=>[t,n],()=>p([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[G_(t),n]),rm=e=>p(p(N$(e),([t,n])=>p(p(P$(n),([o,i])=>[o,i],()=>p(U$(n),([o,i])=>[o,i],()=>p(w$(n),([o,i])=>[o,i],()=>p(v$(n),([o,i])=>[o,i],()=>[])))),([o,i])=>p(uI(i),([a,c])=>[[t,o,a],c]))),([t,n])=>[$_(t),n]),k$=e=>p(p(rm(e),([t,n])=>p(L$(n),([o,i])=>[[t,o],i])),([t,n])=>[j_(t),n]),jI=e=>p(p(k$(e),([t,n])=>[t,n],()=>p(BG(e),([t,n])=>[t,n],()=>p(re(e),([t,n])=>[t,n],()=>[]))),([t,n])=>[t,n]);function qI(e){let t=Xl(`\`${e}\``);return s.IsEqual(t.length,2)?t[0]:fe()}function D$(e){return e.join("|")}function G$(e){return e.slice(1,e.length-1)}function $$(e,t,n){return fn(t,`${n}${e}`)}function j$(e,t){return fn(e,`${t}${iT}`)}function q$(e,t){return fn(e,`${t}${kc}`)}function F$(e,t){return fn(e,`${t}${$c}`)}function B$(e,t){return Ua(F([z("false"),z("true")]),e,t)}function H$(e,t){return fn(e,`${t}${jc}`)}function K$(e,t,n){return fn(t,`${n}${G$(e)}`)}function z$(e,t,n){let o=wa(e,{});return Ua(o,t,n)}function Y$(e,t,n){let o=wt(e);return Ua(o,t,n)}function FI(e,t,n,o=[]){return s.ShiftLeft(e,(i,a)=>FI(a,t,n,[...o,Ua(i,[],"")]),()=>fn(t,`${n}(${D$(o)})`))}function Ua(e,t,n){return ze(e)?Y$(e.enum,t,n):ot(e)?q$(t,n):Q(e)?$$(e.const,t,n):vt(e)?j$(t,n):_t(e)?B$(t,n):Ce(e)?F$(t,n):We(e)?H$(t,n):Ee(e)?K$(e.pattern,t,n):HI(e)?z$(e.parameters[0],t,n):R(e)?FI(e.anyOf,t,n):Ny}function fn(e,t){return s.ShiftLeft(e,(n,o)=>Ua(n,o,t),()=>t)}function V$(e){return`^${fn(e,"")}$`}function BI(e){let t=V$(e);return Fc(t)}function wa(e,t){return K(e)?y.Update(BI(e),{},t):Zc(e,t)}function KI(e,t,n,o){let i=jt(e,t,n);return wa(i,o)}function Zc(e,t={}){return v("TemplateLiteral",[e],t)}function HI(e){return Ue(e)&&s.HasPropertyKey(e,"action")&&s.IsEqual(e.action,"TemplateLiteral")}function zI(e){return wa(e,{})}function Q$(e){let t=qI(e);return zI(t)}function YI(e,t={}){let n=s.IsString(e)?Q$(e):zI(e);return y.Update(n,{},t)}function Ee(e){return w(e,"TemplateLiteral")}var G={};Yt(G,{ExtendsFalse:()=>B,ExtendsTrue:()=>U,ExtendsUnion:()=>nm,IsExtendsFalse:()=>W$,IsExtendsTrue:()=>QI,IsExtendsTrueLike:()=>Ko,IsExtendsUnion:()=>VI,Match:()=>Ae});function nm(e){return y.Create({"~kind":"ExtendsUnion"},{inferred:e})}function VI(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"inferred")&&s.IsEqual(e["~kind"],"ExtendsUnion")&&s.IsObject(e.inferred)}function U(e){return y.Create({"~kind":"ExtendsTrue"},{inferred:e})}function QI(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"inferred")&&s.IsEqual(e["~kind"],"ExtendsTrue")&&s.IsObject(e.inferred)}function B(){return y.Create({"~kind":"ExtendsFalse"},{})}function W$(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.IsEqual(e["~kind"],"ExtendsFalse")}function Ko(e){return VI(e)||QI(e)}function Ae(e,t,n){return Ko(e)?t(e.inferred):n()}function Z$(e,t,n,o){return Ae(J(e,n,o),i=>U(y.Assign(y.Assign(e,i),{[t]:n})),()=>B())}function X$(e,t){return U(e)}function J$(e,t,n,o,i){return Ae(J(e,t,n),a=>Ae(J(a,t,o),c=>U(c),()=>B()),()=>Ae(J(e,t,i),a=>U(a),()=>B()))}function e1(e,t,n){let o=wt(n);return J(e,t,o)}function WI(e,t,n){return s.ShiftLeft(n,(o,i)=>Ae(J(e,t,o),a=>WI(a,t,i),()=>B()),()=>U(e))}function t1(e,t,n){let o=ht(n);return J(e,t,o)}function ZI(e,t,n){return s.ShiftLeft(n,(o,i)=>Ae(J(e,t,o),a=>U(a),()=>ZI(e,t,i)),()=>B())}function ae(e,t,n){return Ve(n)?X$(e,t):Le(n)?J$(e,t,n.if,n.then,n.else):ze(n)?e1(e,t,n.enum):Ke(n)?Z$(e,n.name,t,n.extends):M(n)?WI(e,t,n.allOf):Ee(n)?t1(e,t,n.pattern):R(n)?ZI(e,t,n.anyOf):tt(n)?U(e):B()}function XI(e,t,n){return Ke(n)?ae(e,t,n):Ve(n)?U(e):tt(n)?U(e):nm(e)}function r1(e,t){let n=Kn(e),o=Kn(t);return n&&o||!n&&o?!0:!(n&&!o)}function JI(e,t,n,o){return Z(o)?r1(t,o)?J(e,n,o.items):B():ae(e,t,o)}function eb(e,t,n){return vt(n)?U(e):ae(e,t,n)}function tb(e,t,n){return _t(n)?U(e):ae(e,t,n)}function n1(e,t,n,o,i){let a=Ke(o)?t:o,c=Ke(o)?o:t,l=et(t),m=et(o);return!l&&m?B():Ae(J(e,a,c),f=>va(f,n,i),()=>B())}function o1(e,t,n,o){return s.ShiftLeft(o,(i,a)=>n1(e,t,n,i,a),()=>et(t)?U(e):B())}function i1(e,t,n){return s.ShiftLeft(t,(o,i)=>o1(e,o,i,n),()=>U(e))}function va(e,t,n){return i1(e,t,n)}function Op(e,t,n){return kt(n)?U(e):J(e,t,n)}function rb(e,t,n,o){return Ve(o)?U(e):tt(o)?U(e):Be(o)?Ae(va(e,t,o.parameters),i=>Op(i,n,o.instanceType),()=>B()):B()}function nb(e,t,n,o,i){return Ae(J(e,t,i),()=>J(e,n,i),()=>J(e,o,i))}function ob(e,t,n){let o=wt(t);return J(e,o,n)}function ib(e,t,n,o){return Ve(o)?U(e):tt(o)?U(e):He(o)?Ae(va(e,t,o.parameters),i=>Op(i,n,o.returnType),()=>B()):B()}function ab(e,t,n){return ot(n)?U(e):Ce(n)?U(e):ae(e,t,n)}function sb(e,t,n){let o=we(t);return J(e,o,n)}function xp(e,t,n){return t===n?U(e):B()}function a1(e,t,n){return Q(n)?xp(e,t,n.const):vt(n)?U(e):ae(e,z(t),n)}function s1(e,t,n){return Q(n)?xp(e,t,n.const):_t(n)?U(e):ae(e,z(t),n)}function c1(e,t,n){return Q(n)?xp(e,t,n.const):Ce(n)?U(e):ae(e,z(t),n)}function p1(e,t,n){return Q(n)?xp(e,t,n.const):We(n)?U(e):ae(e,z(t),n)}function cb(e,t,n){return s.IsBigInt(t.const)?a1(e,t.const,n):s.IsBoolean(t.const)?s1(e,t.const,n):s.IsNumber(t.const)?c1(e,t.const,n):s.IsString(t.const)?p1(e,t.const,n):fe()}function pb(e,t,n){return Ke(n)?ae(e,t,n):U(e)}function ub(e,t,n){return gr(n)?U(e):ae(e,t,n)}function lb(e,t,n){return Ce(n)?U(e):ae(e,t,n)}function u1(e,t,n){return et(t)?et(n)?U(e):B():U(e)}function l1(e,t,n){return Ke(n)&&tr(n.extends)?B():Ae(J(e,t,n),o=>u1(o,t,n),()=>B())}function m1(e,t){return e.reduce((n,o)=>o in t?Ko(t[o])?{...n,...t[o].inferred}:fe():fe(),{})}function d1(e,t,n){let o={};for(let c of s.Keys(n))o[c]=c in t?l1({},t[c],n[c]):et(n[c])?Ke(n[c])?U(y.Assign(e,{[n[c].name]:n[c].extends})):U(e):B();let i=s.Values(o).every(c=>Ko(c)),a=i?m1(s.Keys(o),o):{};return i?U(a):B()}function f1(e,t,n){let o=d1(e,t,n);return Ko(o)?U(y.Assign(e,o.inferred)):B()}function g1(e,t,n){return f1(e,t,n)}function h1(e,t){return s.Keys(t).reduce((n,o)=>({...n,[o]:s.HasPropertyKey(e,o)?R(n[o])?F([...n[o].anyOf,t[o]]):F([e[o],t[o]]):t[o]}),e)}function mb(e,t,n,o){return s.ShiftLeft(t,(i,a)=>Ae(J({},e[i],n),c=>mb(e,a,n,h1(o,c)),()=>B()),()=>U(o))}function y1(e,t,n,o){let i=s.Keys(t);return mb(t,i,o,e)}function db(e,t,n){return de(n)?y1(e,t,it(n),Se(n)):D(n)?g1(e,t,n.properties):ae(e,k(t),n)}function T1(e,t){return s.IsEqual(s.Keys(t).length,0)?U(e):B()}function E1(e,t,n,o,i){return J(e,n,i)}function fb(e,t,n,o){return de(o)?E1(e,Yc(t),n,Yc(it(o)),Se(o)):D(o)?T1(e,o.properties):Ve(o)?U(e):tt(o)?U(e):B()}function gb(e,t,n){return We(n)?U(e):ae(e,t,n)}function hb(e,t,n){return hr(n)?U(e):ae(e,t,n)}function yb(e,t,n){let o=ht(t);return J(e,o,n)}function om(e,t){return y.Create({"~kind":"Inferrable"},{name:e,type:t},{})}function Na(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"name")&&s.HasPropertyKey(e,"type")&&s.IsEqual(e["~kind"],"Inferrable")&&s.IsString(e.name)&&s.IsObject(e.type)}function im(e){return ln(e)?Ke(e.items)?Z(e.items.extends)?om(e.items.name,e.items.extends.items):tt(e.items.extends)?om(e.items.name,e.items.extends):void 0:fe():void 0}function Rp(e){return Ke(e)?om(e.name,e.extends):void 0}function am(e,t,n=[]){return s.ShiftLeft(e,(o,i)=>Ae(J({},o,t),()=>am(i,t,[...n,o]),()=>{}),()=>n)}function Tb(e,t,n,o){let i=am(n,o);return s.IsArray(i)?U(y.Assign(e,{[t]:ke(i)})):B()}function Cp(e,t,n,o){let i=am(n,o);return s.IsArray(i)?U(y.Assign(e,{[t]:F(i)})):B()}function _1(e){return[...e].reverse()}function sm(e,t){return t?_1(e):e}function I1(e){let t=e.length>0?e[0]:void 0,n=Ue(t)?im(t):void 0;return Ue(n)}function b1(e,t,n,o,i,a){return Ae(J(e,n,i),c=>Eb(c,t,o,a),()=>B())}function S1(e,t,n,o,i){let a=im(o);return Na(a)?Tb(e,a.name,sm(n,t),a.type):s.ShiftLeft(n,(c,l)=>b1(e,t,c,l,o,i),()=>B())}function A1(e,t,n,o){return s.ShiftLeft(o,(i,a)=>S1(e,t,n,i,a),()=>s.IsEqual(n.length,0)?U(e):B())}function Eb(e,t,n,o){return A1(e,t,n,o)}function O1(e,t,n){let o=gn(e,be([],[]),n),i=I1(o);return Eb(e,i,sm(t,i),sm(o,i))}function _b(e,t,n){let o=Rp(n);return Na(o)?Cp(e,o.name,t,o.type):s.ShiftLeft(t,(i,a)=>Ae(J(e,i,n),c=>_b(c,a,n),()=>B()),()=>U(e))}function Ib(e,t,n){let o=gn(e,be([],[]),t);return Y(n)?O1(e,o,n.items):Z(n)?_b(e,o,n.items):ae(e,ke(o),n)}function bb(e,t,n){return kt(n)?U(e):nr(n)?U(e):ae(e,t,n)}function Sb(e,t,n){return s.ShiftLeft(n,(o,i)=>Ae(J(e,t,o),a=>U(a),()=>Sb(e,t,i)),()=>B())}function cm(e,t,n){return s.ShiftLeft(t,(o,i)=>Ae(Sb(e,o,n),a=>cm(a,i,n),()=>B()),()=>U(e))}function Ab(e,t,n){let o=Rp(n);return Na(o)?Cp(e,o.name,t,o.type):R(n)?cm(e,t,n.anyOf):cm(e,t,[n])}function Ob(e,t,n){return Ke(n)?ae(e,t,n):Ve(n)?U(e):tt(n)?U(e):B()}function xb(e,t,n){return kt(n)?U(e):ae(e,t,n)}function J(e,t,n){return Ve(t)?XI(e,t,n):Z(t)?JI(e,t,t.items,n):vt(t)?eb(e,t,n):_t(t)?tb(e,t,n):Be(t)?rb(e,t.parameters,t.instanceType,n):Le(t)?nb(e,t.if,t.then,t.else,n):ze(t)?ob(e,t.enum,n):He(t)?ib(e,t.parameters,t.returnType,n):ot(t)?ab(e,t,n):M(t)?sb(e,t.allOf,n):Q(t)?cb(e,t,n):tr(t)?pb(e,t,n):gr(t)?ub(e,t,n):Ce(t)?lb(e,t,n):D(t)?db(e,t.properties,n):de(t)?fb(e,it(t),Se(t),n):We(t)?gb(e,t,n):hr(t)?hb(e,t,n):Ee(t)?yb(e,t.pattern,n):Y(t)?Ib(e,t.items,n):nr(t)?bb(e,t,n):R(t)?Ab(e,t.anyOf,n):tt(t)?Ob(e,t,n):kt(t)?xb(e,t,n):B()}function x1(e,t){return we([...e,k(t)])}function pm(e,t,n){return K(e)?y.Update(x1(e,t),{},n):Oa(e,t,n)}function Rb(e,t,n,o,i){let a=jt(e,t,n),c=La(e,t,o);return pm(a,c,i)}function Oa(e,t,n={}){return v("Interface",[e,t],n)}function zo(e){return Ue(e)&&s.HasPropertyKey(e,"action")&&s.IsEqual(e.action,"Interface")}function Cb(e,t,n={}){return pm(e,t,n)}function R1(e,t,n){return e.includes(n)?!0:ka([...e,n],t,t[n])}function Pb(e,t,n){let o=Uc(n);return Jn(e,t,o)}function Jn(e,t,n){return s.ShiftLeft(n,(o,i)=>ka(e,t,o)?!0:Jn(e,t,i),()=>!1)}function ka(e,t,n){return ce(n)?R1(e,t,n.$ref):Z(n)?ka(e,t,n.items):Be(n)?Jn(e,t,[...n.parameters,n.instanceType]):He(n)?Jn(e,t,[...n.parameters,n.returnType]):zo(n)?Pb(e,t,n.parameters[1]):M(n)?Jn(e,t,n.allOf):D(n)?Pb(e,t,n.properties):R(n)?Jn(e,t,n.anyOf):Y(n)?Jn(e,t,n.items):de(n)?ka(e,t,Se(n)):!1}function Ub(e,t,n){return ka(e,t,n)}function C1(e,t){return t.reduce((n,o)=>Ub([o],e,e[o])?[...n,o]:n,[])}function wb(e){let t=Pc(e);return C1(e,t)}function P1(e,t,n){return n.includes(t)?n:t in e?Ma(e,e[t],[...n,t]):fe()}function vb(e,t,n){let o=Uc(t);return Yo(e,o,n)}function Yo(e,t,n){return t.reduce((o,i)=>Ma(e,i,o),n)}function Ma(e,t,n){return ce(t)?P1(e,t.$ref,n):Z(t)?Ma(e,t.items,n):Be(t)?Yo(e,[...t.parameters,t.instanceType],n):He(t)?Yo(e,[...t.parameters,t.returnType],n):zo(t)?vb(e,t.parameters[1],n):M(t)?Yo(e,t.allOf,n):D(t)?vb(e,t.properties,n):R(t)?Yo(e,t.anyOf,n):Y(t)?Yo(e,t.items,n):de(t)?Ma(e,Se(t),n):n}function Nb(e,t,n){return Ma(e,n,[t])}function U1(e){return No()}function w1(e){return s.Keys(e).reduce((t,n)=>({...t,[n]:eo(e[n])}),{})}function Da(e){return e.reduce((t,n)=>[...t,eo(n)],[])}function eo(e){return ce(e)?U1(e.$ref):Z(e)?Pt(eo(e.items),wo(e)):Be(e)?ur(Da(e.parameters),eo(e.instanceType)):He(e)?lr(Da(e.parameters),eo(e.returnType)):M(e)?ut(Da(e.allOf)):D(e)?k(w1(e.properties)):de(e)?jo(un(e),eo(Se(e))):R(e)?F(Da(e.anyOf)):Y(e)?ke(Da(e.items)):e}function v1(e,t){return t in e?eo(e[t]):Qe()}function Lb(e){return v1(e.$defs,e.$ref)}function N1(e,t,n){let o=jt(e,be([],[]),t),i=La({},be([],[]),n);return we([...o,k(i)])}function L1(e,t){return s.Keys(e).filter(o=>t.includes(o)).reduce((o,i)=>{let a=e[i],c=zo(a)?N1(e,a.parameters[0],a.parameters[1]):a;return{...o,[i]:c}},{})}function kb(e,t,n){let o=Nb(e,t,n),i=L1(e,o);return dr(i,t)}function Mb(e,t){return t in e?ce(e[t])?Mb(e,e[t].$ref):e[t]:me()}function yr(e,t){return Mb(e,t)}function Db(e){return Te(e)?Lb(e):wc(e)?Qe():e}function dt(e,t,n){let o=Db(t),i=Db(n);return J(e,o,i)}var _a="equal",k1="disjoint",Ia="left-inside",ba="right-inside";function Wn(e,t){let n=[tt(e)?G.ExtendsFalse():dt({},e,t),tt(e)?G.ExtendsTrue({}):dt({},t,e)];return G.IsExtendsTrueLike(n[0])&&G.IsExtendsTrueLike(n[1])?_a:G.IsExtendsTrueLike(n[0])&&G.IsExtendsFalse(n[1])?Ia:G.IsExtendsFalse(n[0])&&G.IsExtendsTrueLike(n[1])?ba:k1}function M1(e,t){return t.filter(n=>Wn(e,n)!==ba)}function D1(e,t){let n=t.some(o=>{let i=Wn(e,o);return s.IsEqual(i,Ia)||s.IsEqual(i,_a)});return s.IsEqual(n,!1)}function G1(e,t){let n=Vt(e);return Ve(n)?[n]:D1(n,t)?[...M1(n,t),n]:t}function $1(e){return e.reduce((t,n)=>D(n)?[...t,n]:tr(n)?t:G1(n,t),[])}function ql(e){let t=$1(e);return $o(t)}function um(e,t){return y.Update(Vt(e),{},t)}function Gb(e,t,n,o){let i=O(e,t,n);return um(i,o)}function Ga(e,t=[]){return on(e)&&s.IsEqual(e.action,"Conditional")?ce(e.parameters[0])?Ga(e.parameters[2],Ga(e.parameters[3],[...t,e.parameters[0].$ref])):Ga(e.parameters[2],Ga(e.parameters[3],t)):on(e)&&s.IsEqual(e.action,"Mapped")&&on(e.parameters[1])&&s.IsEqual(e.parameters[1].action,"KeyOf")&&ce(e.parameters[1].parameters[0])?[...t,e.parameters[1].parameters[0].$ref]:t}function j1(e,t){return e.reduce((n,o)=>[...n,t.includes(o.name)],[])}function qb(e,t,n=[]){return s.ShiftLeft(e,(o,i)=>s.ShiftLeft(t,(a,c)=>qb(i,c,[...n,[a,o]]),()=>n),()=>n)}function q1(e){return Ee(e)?ht(e.pattern):ze(e)?wt(e.enum):e}function F1(e){let t=q1(e);return R(t)?[...t.anyOf]:[t]}function B1(e,t){return e.reduce((n,o)=>[...n,[...o,t]],[])}function $b(e,t){return t.reduce((n,o)=>[...n,...B1(e,o)],[])}function jb(e){return e.reduce((t,n)=>s.IsEqual(n[0],!0)?$b(t,F1(n[1])):$b(t,[n[1]]),[[]])}function Fb(e,t,n){let o=Ga(n),i=j1(e,o),a=qb(t,i);return on(n)&&s.IsEqual(n.action,"Conditional")||on(n)&&s.IsEqual(n.action,"Mapped")?jb(a):[t]}function H1(){return["(not-resolvable)",me()]}function K1(){return["(not-generic)",me()]}function z1(e,t,n){return[e,an(t,n)]}function Y1(e,t,n){return t in e?Bb(e,t,e[t],n):H1()}function Bb(e,t,n,o){return vo(n)?z1(t,n.parameters,n.expression):ce(n)?Y1(e,n.$ref,o):K1()}function Hb(e,t,n){return Bb(e,"(anonymous)",t,n)}function V1(e,t,n){if(Ke(t)||Vo(t)||G.IsExtendsTrueLike(dt({},t,n)))return;let o={parameter:e,expect:n,actual:t};throw new Error(`Argument for parameter ${e} does not satisfy constraint`,{cause:o})}function Kb(e,t,n,o,i){let a=O(e,t,i);return V1(n,a,o),y.Assign(e,{[n]:a})}function Q1(e,t,n,o,i){let a=O(e,t,n.extends),c=O(e,t,n.equals);return s.ShiftLeft(i,(l,m)=>lm(Kb(e,t,n.name,a,l),t,o,m),()=>lm(Kb(e,t,n.name,a,c),t,o,[]))}function lm(e,t,n,o){return s.ShiftLeft(n,(i,a)=>Q1(e,t,i,a,o),()=>e)}function zb(e,t,n,o){return lm(e,t,n,o)}var mm=0,dm=0;function W1(){if(!s.IsLessThan(dm,rt.Get().maxInstantiationCount))throw Error("Type instantiation is excessively deep and possibly infinite")}function Z1(){W1(),dm++,mm++}function X1(){mm--,s.IsEqual(mm,0)&&(dm=0)}function J1(e){return s.IsGreaterThan(e.callstack.length,0)?e.callstack[e.callstack.length-1]:""}function ej(e,t){return s.IsEqual(J1(e),t)}function tj(e,t,n,o,i,a){Z1();try{let c=zb(e,t,o,a),l=O(c,be([...t.callstack,n.$ref],t.visited),i);return O(c,be([],[]),l)}finally{X1()}}function rj(e,t,n,o,i,a){return a.reduce((c,l)=>{let m=tj(e,t,n,o,i,l);return[...c,m]},[])}function nj(e,t,n,o,i,a){let c=Fb(o,a,i),l=rj(e,t,n,o,i,c);return s.IsEqual(l.length,1)?l[0]:Lt(l)}function Pp(e,t,n,o){let i=jt(e,t,o),a=Hb(e,n,o),c=a[0],l=a[1];return vo(l)?ej(t,c)?xa(nt(c),i):nj(e,t,nt(c),l.parameters,l.expression,i):xa(n,i)}function xa(e,t){return y.Create({"~kind":"Call"},{type:"call",target:e,arguments:t},{})}function Yb(e,t){return Pp({},be([],[]),e,t)}function Vo(e){return w(e,"Call")}function oj(e){return y.Discard(e,["~immutable"])}function Vb(e,t){return y.Update(oj(e),{},t)}function Qb(e,t,n,o){let i=O(e,t,n);return Vb(i,o)}function Wb(e,t){return e(t)}function Zb(e,t){return s.IsString(t)?z(Wb(e,t)):z(t)}function Xb(e,t){let n=ht(t);return Gr(e,n)}function Jb(e,t){let n=t.map(o=>Gr(e,o));return F(n)}function Gr(e,t){return Q(t)?Zb(e,t.const):Ee(t)?Xb(e,t.pattern):R(t)?Jb(e,t.anyOf):t}function Xc(e,t={}){return v("Capitalize",[e],t)}function eS(e,t={}){return fm(e,t)}function Jc(e,t={}){return v("Lowercase",[e],t)}function tS(e,t={}){return gm(e,t)}function ep(e,t={}){return v("Uncapitalize",[e],t)}function rS(e,t={}){return hm(e,t)}function tp(e,t={}){return v("Uppercase",[e],t)}function nS(e,t={}){return ym(e,t)}var ij=e=>e[0].toUpperCase()+e.slice(1),aj=e=>e.toLowerCase(),sj=e=>e[0].toLowerCase()+e.slice(1),cj=e=>e.toUpperCase();function fm(e,t){return K([e])?y.Update(Gr(ij,e),{},t):Xc(e,t)}function gm(e,t){return K([e])?y.Update(Gr(aj,e),{},t):Jc(e,t)}function hm(e,t){return K([e])?y.Update(Gr(sj,e),{},t):ep(e,t)}function ym(e,t){return K([e])?y.Update(Gr(cj,e),{},t):tp(e,t)}function oS(e,t,n,o){let i=O(e,t,n);return fm(i,o)}function iS(e,t,n,o){let i=O(e,t,n);return gm(i,o)}function aS(e,t,n,o){let i=O(e,t,n);return hm(i,o)}function sS(e,t,n,o){let i=O(e,t,n);return ym(i,o)}function rp(e,t,n,o,i={}){return v("Conditional",[e,t,n,o],i)}function cS(e,t,n,o,i={}){return Tm({},be([],[]),e,t,n,o,i)}function pj(e,t,n,o,i,a){let c=dt(e,n,o);return G.IsExtendsUnion(c)?F([O(c.inferred,t,i),O(e,t,a)]):G.IsExtendsTrue(c)?O(c.inferred,t,i):O(e,t,a)}function Tm(e,t,n,o,i,a,c){return K([n,o])?y.Update(pj(e,t,n,o,i,a),{},c):rp(n,o,i,a,c)}function pS(e,t,n,o,i,a,c){let l=O(e,t,n),m=O(e,t,o);return Tm(e,t,l,m,i,a,c)}function np(e,t={}){return v("ConstructorParameters",[e],t)}function uS(e,t={}){return Em(e,t)}function uj(e){let t=Be(e)?e.parameters:[],n=gn({},be([],[]),t);return ke(n)}function Em(e,t){return K([e])?y.Update(uj(e),{},t):np(e,t)}function lS(e,t,n,o){let i=O(e,t,n);return Em(i,o)}function op(e,t,n={}){return v("Exclude",[e,t],n)}function mS(e,t,n={}){return $a(e,t,n)}function $a(e,t,n){return K([e,t])?y.Update(Hc(e,t),{},n):op(e,t,n)}function dS(e,t,n,o,i){let a=O(e,t,n),c=O(e,t,o);return $a(a,c,i)}function ip(e,t,n={}){return v("Extract",[e,t],n)}function fS(e,t,n={}){return _m(e,t,n)}function lj(e,t){let n=dt({},e,t);return G.IsExtendsTrueLike(n)?[e]:[]}function mj(e,t){return e.reduce((n,o)=>[...n,...lj(o,t)],[])}function gS(e,t){let n=Vt(e),o=R(n)?n.anyOf:[n],i=mj(o,t);return Lt(i)}function _m(e,t,n){return K([e,t])?y.Update(gS(e,t),{},n):ip(e,t,n)}function hS(e,t,n,o,i){let a=O(e,t,n),c=O(e,t,o);return _m(a,c,i)}function dj(e){return e.reduce((t,n)=>Mc(n)?[...t,z(n)]:t,[])}function Qo(e){let t=dj(e);return F(t)}function Ra(e,t,n={}){return v("Index",[e,t],n)}function yS(e,t,n={}){let o=s.IsArray(t)?Qo(t):t;return Im(e,o,n)}function TS(e,t){let n=yr(e,t);return qt(n)}function ES(e,t,n){let o=rr(e,t,n);return qt(o)}function fj(e,t){let n=s.Keys(e).filter(h=>!s.HasPropertyKey(t,h)),o=s.Keys(t).filter(h=>!s.HasPropertyKey(e,h)),i=s.Keys(e).filter(h=>s.HasPropertyKey(t,h)),a=n.reduce((h,E)=>({...h,[E]:e[E]}),{}),c=o.reduce((h,E)=>({...h,[E]:t[E]}),{}),l=i.reduce((h,E)=>({...h,[E]:we([e[E],t[E]])}),{}),m=y.Assign(a,c);return y.Assign(m,l)}function _S(e){return e.reduce((t,n)=>fj(t,qt(n)),{})}function IS(e){let t=xT(ke(e));return qt(t)}function gj(e,t){return s.Keys(e).filter(i=>i in t).reduce((i,a)=>({...i,[a]:Lt([e[a],t[a]])}),{})}function bS(e,t){return s.ShiftLeft(e,(n,o)=>bS(o,gj(t,qt(n))),()=>t)}function SS(e){return s.ShiftLeft(e,(t,n)=>bS(n,qt(t)),()=>fe())}function qt(e){return Te(e)?TS(e.$defs,e.$ref):Le(e)?ES(e.if,e.then,e.else):M(e)?_S(e.allOf):R(e)?SS(e.anyOf):Y(e)?IS(e.items):D(e)?e.properties:{}}function Wo(e){let t=qt(e);return k(t)}var hj=new RegExp("^(?:0|[1-9][0-9]*)$");function Zo(e){let t=`${e}`;return hj.test(t)?parseInt(t):e}function yj(e){return z(Zo(e))}function AS(e){return e.map(t=>OS(t))}function OS(e){return M(e)?ut(AS(e.allOf)):R(e)?F(AS(e.anyOf)):Q(e)?yj(e.const):e}function xS(e,t){let n=OS(t),o=dt({},n,Nt());return G.IsExtendsTrueLike(o)?e:Q(t)&&s.IsEqual(t.const,"length")?Nt():me()}function RS(e,t){let n=yr(e,t);return Mt(n)}function CS(e,t,n){let o=rr(e,t,n);return Mt(o)}function PS(e){let t=wt(e);return Mt(t)}function US(e){let t=we(e);return Mt(t)}function wS(e){return[`${e}`]}function vS(e){let t=ht(e);return Mt(t)}function NS(e){return e.reduce((t,n)=>[...t,...Mt(n)],[])}function Mt(e){return Te(e)?RS(e.$defs,e.$ref):Le(e)?CS(e.if,e.then,e.else):ze(e)?PS(e.enum):M(e)?US(e.allOf):Q(e)?wS(e.const):Ee(e)?vS(e.pattern):R(e)?NS(e.anyOf):[]}function Xo(e){return Mt(e)}function ja(e,t){return t.map(n=>qa(e,n))}function qa(e,t){return Z(t)?Pt(qa(e,t.items)):Be(t)?ur(ja(e,t.parameters),qa(e,t.instanceType)):He(t)?lr(ja(e,t.parameters),qa(e,t.returnType)):Y(t)?ke(ja(e,t.items)):R(t)?F(ja(e,t.anyOf)):M(t)?ut(ja(e,t.allOf)):Qc(t)?k(e):t}function LS(e,t){return qa(e,t)}function Tj(e,t){let n=t in e?e[t]:me();return LS(e,n)}function kS(e,t){return t.reduce((n,o)=>[...n,Tj(e,o)],[])}function Ej(e,t){let n=Xo(t),o=kS(e,n);return Lt(o)}var _j=new RegExp(pn);function Ij(e){return e.filter(n=>_j.test(n))}function bj(e){let t=Pc(e),n=Ij(t),o=kS(e,n);return Lt(o)}function MS(e,t){return Ce(t)?bj(e):Ej(e,t)}function Sj(e){return z(Zo(e))}function DS(e){return e.map(t=>bm(t))}function bm(e){return M(e)?ut(DS(e.allOf)):R(e)?F(DS(e.anyOf)):Q(e)?Sj(e.const):e}function Aj(e,t){return e.reduceRight((n,o,i)=>{let a=dt({},z(i),t);return G.IsExtendsTrueLike(a)?[o,...n]:n},[])}function Oj(e,t){let n=bm(t),o=Aj(e,n);return Mr(o)}function xj(e){return Mr(e)}function GS(e,t){return Q(t)&&s.IsEqual(t.const,"length")?z(e.length):Ce(t)||ot(t)?xj(e):Oj(e,t)}function $S(e,t){return Z(e)?xS(e.items,t):D(e)?MS(e.properties,t):Y(e)?GS(e.items,t):me()}function Rj(e){return Te(e)||Le(e)||M(e)||R(e)?Wo(e):e}function Im(e,t,n){return K([e,t])?y.Update($S(Rj(e),t),{},n):Ra(e,t,n)}function jS(e,t,n,o,i){let a=O(e,t,n),c=O(e,t,o);return Im(a,c,i)}function ap(e,t={}){return v("InstanceType",[e],t)}function qS(e,t={}){return Sm(e,t)}function Cj(e){return Be(e)?e.instanceType:me()}function Sm(e,t){return K([e])?y.Update(Cj(e),{},t):ap(e,t)}function FS(e,t,n,o={}){let i=O(e,t,n);return Sm(i,o)}function Ca(e,t={}){return v("KeyOf",[e],t)}function BS(e,t={}){return Am(e,t)}function HS(){return F([Nt(),It(),Do()])}function KS(e){return Nt()}function Pj(e){return e.reduce((n,o)=>Mc(o)?[...n,z(Zo(o))]:fe(),[])}function zS(e){let t=s.Keys(e),n=Pj(t);return Mr(n)}function YS(e){return un(e)}function VS(e){let t=e.map((n,o)=>z(o));return Mr(t)}function QS(e){return Ve(e)?HS():Z(e)?KS(e.items):D(e)?zS(e.properties):de(e)?YS(e):Y(e)?VS(e.items):me()}function Uj(e){return Te(e)||Le(e)||M(e)||R(e)?Wo(e):e}function Am(e,t){return K([e])?y.Update(QS(Uj(e)),{},t):Ca(e,t)}function WS(e,t,n,o){let i=O(e,t,n);return Am(i,o)}function Aa(e,t,n,o,i={}){return v("Mapped",[e,t,n,o],i)}function ZS(e,t,n,o,i={}){return Om({},be([],[]),e,t,n,o,i)}function wj(e){let t=ht(e);return Up(t)}function vj(e){return e.reduce((t,n)=>[...t,...Up(n)],[])}function Nj(e){let t=wt(e);return Up(t)}function Lj(e){return s.IsNumber(e)?[z(`${e}`)]:[z(e)]}function Up(e){return ze(e)?Nj(e.enum):Q(e)?Lj(e.const):Ee(e)?wj(e.pattern):R(e)?vj(e.anyOf):[e]}function XS(e){return Up(e)}function kj(e){return Ee(e)?ht(e.pattern):e}function Mj(e,t,n,o,i,a){let c=y.Assign(e,{[n.name]:o}),l=O(c,t,i),m=kj(l),f=O(c,t,a);return Dc(m)||Gc(m)?{[m.const]:f}:{}}function Dj(e,t,n,o,i,a){return o.reduce((c,l)=>[...c,Mj(e,t,n,l,i,a)],[])}function Gj(e){return e.reduce((t,n)=>[...t,k(n)],[])}function JS(e,t,n,o,i,a){let c=XS(o),l=Dj(e,t,n,c,i,a),m=Gj(l);return we(m)}function Om(e,t,n,o,i,a,c){return K([o])?y.Update(JS(e,t,n,o,i,a),{},c):Aa(n,o,i,a,c)}function eA(e,t,n,o,i,a,c){let l=O(e,t,o);return Om(e,t,n,l,i,a,c)}function $j(e,t,n){let o=y.Assign(e,t);return s.Keys(t).filter(a=>n.includes(a)).reduce((a,c)=>({...a,[c]:kb(o,c,t[c])}),{})}function jj(e,t,n){let o=y.Assign(e,t);return s.Keys(t).filter(a=>!n.includes(a)).reduce((a,c)=>({...a,[c]:O(o,be([],[]),t[c])}),{})}function qj(e,t,n){let o=wb(t),i=$j(e,t,o),a=jj(e,t,o),c={...i,...a};return y.Update(c,{},n)}function wp(e,t,n,o){return qj(e,n,o)}function sp(e,t={}){return v("NonNullable",[e],t)}function tA(e,t={}){return xm(e,t)}function Fj(e){let t=F([Mo(),qo()]);return $a(e,t,{})}function xm(e,t){return K([e])?y.Update(Fj(e),{},t):sp(e,t)}function rA(e,t,n,o){let i=O(e,t,n);return xm(i,o)}function cp(e,t,n={}){return v("Omit",[e,t],n)}function nA(e,t,n={}){let o=s.IsArray(t)?Qo(t):t;return Rm(e,o,n)}function vp(e){let t=Wo(e);return D(t)?t.properties:fe()}function Bj(e,t){return s.Keys(e).reduce((o,i)=>t.includes(i)?o:{...o,[i]:e[i]},{})}function oA(e,t){let n=vp(e),o=Xo(t),i=Bj(n,o);return k(i)}function Rm(e,t,n){return K([e,t])?y.Update(oA(e,t),{},n):cp(e,t,n)}function iA(e,t,n,o,i){let a=O(e,t,n),c=O(e,t,o);return Rm(a,c,i)}function pp(e,t={}){return v("Parameters",[e],t)}function aA(e,t={}){return Cm(e,t)}function Hj(e){let t=He(e)?e.parameters:[],n=gn({},be([],[]),t);return ke(n)}function Cm(e,t){return K([e])?y.Update(Hj(e),{},t):pp(e,t)}function sA(e,t,n,o){let i=O(e,t,n);return Cm(i,o)}function up(e,t={}){return v("Partial",[e],t)}function cA(e,t={}){return Pm(e,t)}function pA(e,t){let n=yr(e,t),o=Tr(n);return dr(y.Assign(e,{[t]:o}),t)}function uA(e,t,n){let o=rr(e,t,n);return Tr(o)}function lA(e){let t=we(e);return Tr(t)}function mA(e){let t=e.map(n=>Tr(n));return F(t)}function dA(e){let t=s.Keys(e).reduce((o,i)=>({...o,[i]:qn(e[i])}),{});return k(t)}function Tr(e){return Te(e)?pA(e.$defs,e.$ref):Le(e)?uA(e.if,e.then,e.else):M(e)?lA(e.allOf):R(e)?mA(e.anyOf):D(e)?dA(e.properties):k({})}function Pm(e,t){return K([e])?y.Update(Tr(e),{},t):up(e,t)}function fA(e,t,n,o){let i=O(e,t,n);return Pm(i,o)}function lp(e,t,n={}){return v("Pick",[e,t],n)}function gA(e,t,n={}){let o=s.IsArray(t)?Qo(t):t;return Um(e,o,n)}function Kj(e,t){return s.Keys(e).reduce((o,i)=>t.includes(i)?y.Assign(o,{[i]:e[i]}):o,{})}function hA(e,t){let n=vp(e),o=Xo(t),i=Kj(n,o);return k(i)}function Um(e,t,n){return K([e,t])?y.Update(hA(e,t),{},n):lp(e,t,n)}function yA(e,t,n,o,i){let a=O(e,t,n),c=O(e,t,o);return Um(a,c,i)}function mp(e,t={}){return v("ReadonlyObject",[e],t)}function wm(e,t={}){return vm(e,t)}var TA=wm;function EA(e){return ko(Pt(e))}function _A(e,t){let n=yr(e,t),o=Er(n);return dr(y.Assign(e,{[t]:o}),t)}function IA(e,t,n){let o=rr(e,t,n);return Er(o)}function bA(e){let t=we(e);return Er(t)}function SA(e){let t=s.Keys(e).reduce((o,i)=>({...o,[i]:zn(e[i])}),{});return k(t)}function AA(e){return ko(ke(e))}function OA(e){let t=e.map(n=>Er(n));return F(t)}function Er(e){return Z(e)?EA(e.items):Te(e)?_A(e.$defs,e.$ref):Le(e)?IA(e.if,e.then,e.else):M(e)?bA(e.allOf):D(e)?SA(e.properties):Y(e)?AA(e.items):R(e)?OA(e.anyOf):e}function vm(e,t){return K([e])?y.Update(Er(e),{},t):mp(e)}function xA(e,t,n,o){let i=O(e,t,n);return vm(i,o)}function RA(e,t,n,o){return t.visited.includes(o)?n:o in e?O(e,be(t.callstack,[...t.visited,o]),e[o]):n}function CA(e,t){let n=yr(e,t),o=_r(n);return dr(y.Assign(e,{[t]:o}),t)}function PA(e,t,n){let o=rr(e,t,n);return _r(o)}function UA(e){let t=we(e);return _r(t)}function wA(e){let t=e.map(n=>_r(n));return F(t)}function vA(e){let t=s.Keys(e).reduce((o,i)=>({...o,[i]:Bc(e[i])}),{});return k(t)}function _r(e){return Te(e)?CA(e.$defs,e.$ref):Le(e)?PA(e.if,e.then,e.else):M(e)?UA(e.allOf):R(e)?wA(e.anyOf):D(e)?vA(e.properties):k({})}function dp(e,t={}){return v("Required",[e],t)}function NA(e,t={}){return Nm(e,t)}function Nm(e,t){return K([e])?y.Update(_r(e),{},t):dp(e,t)}function LA(e,t,n,o){let i=O(e,t,n);return Nm(i,o)}function fp(e,t={}){return v("ReturnType",[e],t)}function kA(e,t={}){return Lm(e,t)}function zj(e){return He(e)?e.returnType:me()}function Lm(e,t){return K([e])?y.Update(zj(e),{},t):fp(e,t)}function MA(e,t,n,o={}){let i=O(e,t,n);return Lm(i,o)}function gp(e,t){return v("With",[e,t],{})}function Np(e,t){return km(e,t)}function km(e,t){return K([e])?y.Update(e,{},t):gp(e,t)}function DA(e,t,n,o){let i=O(e,t,n);return km(i,o)}function Yj(e){return ln(e)?Y(e.items)?Mm(e.items.items):Ke(e.items)?[e]:ce(e.items)?[e]:[me()]:[e]}function Mm(e){return e.reduce((n,o)=>[...n,...Yj(o)],[])}function be(e,t){return{callstack:e,visited:t}}function K(e){return s.ShiftLeft(e,(t,n)=>ce(t)?!1:K(n),()=>!0)}function La(e,t,n){return s.Keys(n).reduce((o,i)=>({...o,[i]:O(e,t,n[i])}),{})}function gn(e,t,n){let o=jt(e,t,n);return Mm(o)}function jt(e,t,n){return n.map(o=>O(e,t,o))}function Vj(e,t){let n=et(e)?ma(t,{}):t,o=Yn(e)?la(n,{}):n;return Kn(e)?Fa(o,{}):o}function Qj(e,t,n,o,i){return s.IsEqual(n,"AddImmutable")?GA(e,t,o[0],i):s.IsEqual(n,"RemoveImmutable")?Qb(e,t,o[0],i):s.IsEqual(n,"AddReadonly")?Py(e,t,o[0],i):s.IsEqual(n,"RemoveReadonly")?IT(e,t,o[0],i):s.IsEqual(n,"AddOptional")?Uy(e,t,o[0],i):s.IsEqual(n,"RemoveOptional")?AT(e,t,o[0],i):s.IsEqual(n,"Capitalize")?oS(e,t,o[0],i):s.IsEqual(n,"Conditional")?pS(e,t,o[0],o[1],o[2],o[3],i):s.IsEqual(n,"ConstructorParameters")?lS(e,t,o[0],i):s.IsEqual(n,"Evaluate")?Gb(e,t,o[0],i):s.IsEqual(n,"Exclude")?dS(e,t,o[0],o[1],i):s.IsEqual(n,"Extract")?hS(e,t,o[0],o[1],i):s.IsEqual(n,"Index")?jS(e,t,o[0],o[1],i):s.IsEqual(n,"InstanceType")?FS(e,t,o[0],i):s.IsEqual(n,"Interface")?Rb(e,t,o[0],o[1],i):s.IsEqual(n,"KeyOf")?WS(e,t,o[0],i):s.IsEqual(n,"Lowercase")?iS(e,t,o[0],i):s.IsEqual(n,"Mapped")?eA(e,t,o[0],o[1],o[2],o[3],i):s.IsEqual(n,"Module")?wp(e,t,o[0],i):s.IsEqual(n,"NonNullable")?rA(e,t,o[0],i):s.IsEqual(n,"Pick")?yA(e,t,o[0],o[1],i):s.IsEqual(n,"Parameters")?sA(e,t,o[0],i):s.IsEqual(n,"Partial")?fA(e,t,o[0],i):s.IsEqual(n,"Omit")?iA(e,t,o[0],o[1],i):s.IsEqual(n,"ReadonlyObject")?xA(e,t,o[0],i):s.IsEqual(n,"Record")?qT(e,t,o[0],o[1],i):s.IsEqual(n,"Required")?LA(e,t,o[0],i):s.IsEqual(n,"ReturnType")?MA(e,t,o[0],i):s.IsEqual(n,"TemplateLiteral")?KI(e,t,o[0],i):s.IsEqual(n,"Uncapitalize")?aS(e,t,o[0],i):s.IsEqual(n,"Uppercase")?sS(e,t,o[0],i):s.IsEqual(n,"With")?DA(e,t,o[0],o[1]):v(n,o,i)}function Wj(e,t,n){let o=ce(n)?RA(e,t,n,n.$ref):Z(n)?Pt(O(e,t,n.items),wo(n)):Vo(n)?Pp(e,t,n.target,n.arguments):Be(n)?ur(jt(e,t,n.parameters),O(e,t,n.instanceType),wy(n)):He(n)?lr(jt(e,t,n.parameters),O(e,t,n.returnType),vy(n)):Le(n)?Fn(O(e,t,n.if),O(e,t,n.then),O(e,t,n.else),Gy(n)):M(n)?ut(jt(e,t,n.allOf),By(n)):D(n)?k(La(e,t,n.properties),My(n)):de(n)?zc(it(n),O(e,t,Se(n))):ln(n)?Zn(O(e,t,n.items)):Y(n)?ke(gn(e,t,n.items),_T(n)):R(n)?F(jt(e,t,n.anyOf),uT(n)):n;return Vj(n,o)}function O(e,t,n){return on(n)?Qj(e,t,n.action,n.parameters,n.options):Wj(e,t,n)}function Qt(e,t){return O(e,be([],[]),t)}function Zj(e){return y.Update(e,{"~immutable":!0},{})}function Fa(e,t){return y.Update(Zj(e),{},t)}function GA(e,t,n,o){let i=O(e,t,n);return Fa(i,o)}function q_(e,t={}){return v("AddImmutable",[e],t)}function ko(e,t={}){return Fa(e,t)}function F_(e,t={}){return v("Evaluate",[e],t)}function ft(e,t={}){return um(e,t)}function B_(e,t={}){return v("Module",[e],t)}function $A(e,t={}){return wp({},be([],[]),e,t)}function Xj(e,t){let n=Wn(e,t);return s.IsEqual(n,"right-inside")||s.IsEqual(n,"disjoint")?1:0}function jA(e,t,n=[]){return s.ShiftLeft(t,(o,i)=>s.IsEqual(Xj(e,o),1)?jA(e,i,[...n,o]):[...n,e,...t],()=>[...n,e])}function qA(e,t=[]){return s.ShiftLeft(e,(n,o)=>qA(o,jA(n,t)),()=>t)}function FA(e){return qA(e)}function BA(...e){let[t,n,o]=oe.Match(e,{2:(c,l)=>s.IsString(c)?[{},c,l]:[c,l,{}],3:(c,l,m)=>[c,l,m],1:c=>[{},c,{}]}),i=jI(n),a=s.IsArray(i)&&s.IsEqual(i.length,2)?O(t,be([],[]),i[0]):me();return y.Update(a,{},o)}var r={};Yt(r,{Any:()=>No,Array:()=>Pt,BigInt:()=>ha,Boolean:()=>Lc,Call:()=>Yb,Capitalize:()=>eS,Codec:()=>vc,Conditional:()=>cS,Constructor:()=>ur,ConstructorParameters:()=>uS,Cyclic:()=>dr,Decode:()=>eT,DecodeBuilder:()=>ga,Dependent:()=>Fn,Encode:()=>tT,EncodeBuilder:()=>fa,Enum:()=>Fy,Evaluate:()=>ft,Exclude:()=>mS,Extends:()=>dt,ExtendsResult:()=>G,Extract:()=>fS,Function:()=>lr,Generic:()=>an,Identifier:()=>ya,Immutable:()=>rT,Index:()=>yS,Infer:()=>da,InstanceType:()=>qS,Instantiate:()=>Qt,Integer:()=>Vn,Interface:()=>Cb,Intersect:()=>ut,IsAny:()=>Ve,IsArray:()=>Z,IsBigInt:()=>vt,IsBoolean:()=>_t,IsCall:()=>Vo,IsCodec:()=>Hn,IsConstructor:()=>Be,IsCyclic:()=>Te,IsDependent:()=>Le,IsEnum:()=>ze,IsEnumValue:()=>qy,IsFunction:()=>He,IsGeneric:()=>vo,IsIdentifier:()=>aT,IsImmutable:()=>Kn,IsInfer:()=>Ke,IsInteger:()=>ot,IsIntersect:()=>M,IsKind:()=>w,IsLiteral:()=>Q,IsNever:()=>tr,IsNull:()=>gr,IsNumber:()=>Ce,IsObject:()=>D,IsOptional:()=>et,IsParameter:()=>pT,IsReadonly:()=>Yn,IsRecord:()=>de,IsRef:()=>ce,IsRefine:()=>Nc,IsRest:()=>ln,IsSchema:()=>Ue,IsString:()=>We,IsSymbol:()=>hr,IsTemplateLiteral:()=>Ee,IsThis:()=>Qc,IsTuple:()=>Y,IsUndefined:()=>nr,IsUnion:()=>R,IsUnknown:()=>tt,IsUnsafe:()=>wc,IsVoid:()=>kt,KeyOf:()=>BS,Literal:()=>z,Lowercase:()=>tS,Mapped:()=>ZS,Module:()=>$A,Never:()=>me,NonNullable:()=>tA,Null:()=>Mo,Number:()=>Nt,Object:()=>k,Omit:()=>nA,Optional:()=>Ly,Parameter:()=>Qn,Parameters:()=>aA,Partial:()=>cA,Pick:()=>gA,Readonly:()=>nT,ReadonlyObject:()=>wm,ReadonlyType:()=>TA,Record:()=>jo,RecordKey:()=>un,RecordPattern:()=>it,RecordValue:()=>Se,Ref:()=>nt,Refine:()=>oT,Required:()=>NA,Rest:()=>Zn,ReturnType:()=>kA,Script:()=>BA,String:()=>It,Symbol:()=>Do,TemplateLiteral:()=>YI,This:()=>Vc,Tuple:()=>ke,Uncapitalize:()=>rS,Undefined:()=>qo,Union:()=>F,Unknown:()=>Qe,Unsafe:()=>Dy,Uppercase:()=>nS,Void:()=>Wc,With:()=>Np});var HA="Must be a valid tags query: only tag:value searches (no wildcards), boolean operators, and parentheses are supported.";var Jj=rn(zA());var YA="lowercase-email",Dm="iana-timezone",Gm="simple-time",$m="simple-date-time";var eq=(e,t)=>RegExp(`^${e.source}(${t.source}${e.source})*$`),tq=/[a-zA-Z0-9-_]+/,rq=/\./,VRe=eq(tq,rq);var VA="lowercase-domain";var Jo="kebab-case";var QA="camel-case";var nq=new Set;function C(e,t,n={}){let o=t.map(i=>{let a=i;return a.$id?(nq.add(i),r.Ref(a.$id)):i});return r.Unsafe({...n,type:"object",discriminator:{propertyName:e},required:[e],oneOf:o})}function _e(e,t){return r.Object({values:r.Array(e,{maxItems:t.maxItems,description:"Values compared by this filter. When `exclude` is omitted or false, rows matching any value are kept; when `exclude` is true, matching rows are removed."}),exclude:r.Optional(r.Boolean({description:"If true, exclude rows matching these values instead of including them"}))},{description:t.description})}function jm(e,t={}){return C("type",[r.Object({type:r.Literal("ids"),ids:r.Array(u({allowEmpty:!1}),{minItems:1,...t.maxIds!==void 0&&{maxItems:t.maxIds}})}),r.Object({type:r.Literal("all"),filters:r.Optional(e)})])}var ti=1e3,kp=100,ge={limit:r.Optional(r.Integer({minimum:1,maximum:ti,description:"Maximum number of items to return in this page."})),offset:r.Optional(r.Integer({minimum:0,description:"Zero-based index of the first matching item to return. Increase it with `limit` to request later pages. If `limit` is provided without `offset`, the offset defaults to 0."}))},Ze={...ge,limit:r.Optional(r.Integer({minimum:1,maximum:ti,default:kp,description:`Maximum number of items to return in this page. Omit to use the public API default of ${kp}.`}))},oq=r.Object({totalCount:r.Integer({description:"Total number of items matching the query before `limit` and `offset` are applied."}),pageCount:r.Integer({description:"Total number of pages available for the requested `limit`."})},{description:"Counts describing the full result set that the returned page was taken from, for computing how many further pages remain."}),eCe=r.Object({pagination:oq},{$id:"ResponseMetadata",description:"Metadata accompanying `data` on paginated operations, describing the full result set the page was taken from."});function A(e={}){return r.Unsafe({...e,type:"string"})}var ei=250;function u({allowEmpty:e=!0,type:t="short",description:n,default:o}={}){let i=e?0:1,a={...n===void 0?{}:{description:n},...o===void 0?{}:{default:o}};switch(t){case"camel-case":return r.String({format:QA,minLength:i,maxLength:ei,...a});case"kebab-case":return r.String({format:Jo,minLength:i,maxLength:ei,...a});case"email":return r.String({format:YA,minLength:i,maxLength:254,errorMessage:{format:"Must be a valid lowercase email address."},...a});case"lowercase-domain":return r.String({format:VA,minLength:i,maxLength:ei,...a});case"tsuga-query":return r.String({format:"tsuga-query",minLength:i,maxLength:1e4,...a});case"tags-query":return r.String({format:"tags-query",minLength:i,maxLength:1e4,errorMessage:{format:`${HA} The query you provided is invalid: \${0}`},...a});case"date-time":return r.String({format:"date-time",...a});case"uri":return r.String({format:"uri",...a});case"user-password":return r.String({format:"user-password",minLength:12,maxLength:ei,...a});case"long":return r.String({minLength:i,maxLength:5e4,...a});case"short":return r.String({minLength:i,maxLength:ei,...a});case"tsuga-formula":return r.String({format:"tsuga-formula",minLength:i,maxLength:ei,errorMessage:{format:"Must be a simple mathematical formula, and all variables in it should refer to queries (q1, q2, etc.). The formula you provided is invalid: ${0}"},...a});case"time":return r.String({format:"time",...a});case"readonly-sql-query":return r.String({format:"readonly-sql-query",minLength:i,maxLength:5e4,errorMessage:{format:"Must be a readonly SQL query - only SELECT statements are allowed."},...a});default:Je(t)}}var Ba=["ingestion-api-key","operation-api-key","rum-public-token","dashboard","log-route","metric-route","monitor","notification-rule","notification-silence","slo"],Mp=r.Array(r.Enum(Ba,{description:"Tsuga-managed asset type."}),{description:"Tsuga-managed asset types covered by the policy. An empty array means all supported asset types."});var qm=["CLUSTER_DB_QUERY_INVALID_CONNECTION_PARAMS","CLUSTER_DB_QUERY_INVALID_CREDENTIALS","CLUSTER_DB_QUERY_PERMISSION_DENIED","CLUSTER_DB_QUERY_QUERY_SYNTAX_ERROR","CLUSTER_DB_QUERY_DATABASE_UNREACHABLE","CLUSTER_DB_QUERY_CONNECTION_FAILED","CLUSTER_DB_QUERY_QUERY_EXECUTION_FAILED","CLUSTER_DB_QUERY_QUERY_TIMEOUT"],dCe=r.Enum(qm),iq=["CLUSTER_AGGREGATION_STRUCTURE"],fCe=r.Object({code:r.Enum(qm),message:r.String()}),ZA=[...qm,...iq,"ABORT_ERROR","BAD_REQUEST","DUPLICATE_KEY_VIOLATION","FOREIGN_KEY_VIOLATION","FST_ERR_VALIDATION","GROK_RULE_VALIDATION_ERROR","INVALID_INPUT","FORBIDDEN","MISSING_PERMISSION","PRIVILEGE_ESCALATION","RATE_LIMITED","RESERVED_TAG_POLICY_ERROR","RESOURCE_NOT_FOUND","INVALID_INVITATION","TAG_POLICY_ALREADY_EXISTS_ERROR","TAG_POLICY_VALIDATION_ERROR","UNAUTHORIZED","URL_NOT_FOUND"],XA=["INTERNAL_ERROR","INVALID_QUERY_TO_CLUSTER"];var aq=["NETWORK_ERROR","RESPONSE_PARSE_ERROR"],sq=[...ZA,...XA,...aq],cq=r.Object({assetId:r.Optional(r.String({description:"Identifier of the asset that violated the policy. Set from the existing asset for update and bulk requests. Omitted on create requests before the asset exists."})),assetName:r.String({description:"Name of the asset that violated the policy. Set from submitted data or the existing asset row. Returned for every violation."}),assetType:r.Enum(Ba,{description:"Type of Tsuga asset validated by the policy. Set by the route that ran tag-policy validation. Returned for every violation."}),tagPolicyId:r.String({description:"Identifier of the active tag policy that was violated. Generated by Tsuga when the policy is created. Returned for every violation."}),tagKey:r.String({description:"Tag key required or constrained by the violated policy. Set by the tag policy. Returned for every violation."}),message:r.String({description:"Human-readable reason this policy failed for the asset. Generated by Tsuga's tag-policy validator. Returned for every violation."})},{description:"A single tag-policy violation, identifying the offending asset, the policy and tag key involved, and why validation failed."}),pq=C("type",[r.Object({type:r.Literal("invalid-syntax",{description:"Discriminator identifying a rule the grok parser could not parse at all."}),error:r.Object({offset:r.Integer({description:"Byte offset in the rule where parsing failed."}),detail:r.String({description:"Parser detail message."})},{description:"Position and parser message for the syntax failure."})},{$id:"GrokInvalidSyntax"}),r.Object({type:r.Literal("unknown-pattern",{description:"Discriminator identifying a rule that references a pattern name the grok engine does not provide."}),error:r.Object({offset:r.Integer({description:"Byte offset of the unknown pattern."}),unknownPattern:r.String({description:"The pattern name that is not supported."})},{description:"Position and name of the unsupported pattern."})},{$id:"GrokUnknownPattern"}),r.Object({type:r.Literal("invalid-filter",{description:"Discriminator identifying a rule whose filter is a known filter used incorrectly."}),error:r.Object({offset:r.Integer({description:"Byte offset of the invalid filter."}),invalidFilter:r.String({description:"The filter that is invalid."}),message:r.String({description:"Why the filter is invalid."})},{description:"Position, text, and reason for the invalid filter."})},{$id:"GrokInvalidFilter"}),r.Object({type:r.Literal("unknown-filter",{description:"Discriminator identifying a rule that references a filter name the grok engine does not implement."}),error:r.Object({offset:r.Integer({description:"Byte offset of the unknown filter."}),unknownFilter:r.String({description:"The filter name that is not implemented."}),message:r.String({description:"Details about the unsupported filter."})},{description:"Position and name of the unimplemented filter."})},{$id:"GrokUnknownFilter"})],{description:"Full structured detail of a grok rule that failed to compile, discriminated by `type`."}),uq=r.Object({rule:r.String({description:"The rule that failed to compile."}),ruleIndex:r.Integer({description:"0-based index of the failing rule in the submitted `rules` array."}),error:pq},{description:"A single grok rule that failed to compile, with its position in the submitted rules and the structured compile error."}),JA=C("type",[r.Object({type:r.Literal("tag_policy_violation",{description:"Discriminator identifying tag-policy validation details. Set by Tsuga to `tag_policy_violation`. Returned when the error code is `TAG_POLICY_VALIDATION_ERROR`."}),violations:r.Array(cq,{description:"Tag-policy violations that caused the request to fail. Built from active policies applicable to the submitted asset type and owner team. Returned on tag-policy validation errors; can contain multiple policies and multiple assets for bulk requests."})},{$id:"TagPolicyViolationDetails"}),r.Object({type:r.Literal("grok_rule_error",{description:"Discriminator identifying grok rule validation details. Set by Tsuga to `grok_rule_error`. Returned when the error code is `GROK_RULE_VALIDATION_ERROR`."}),ruleErrors:r.Array(uq,{description:"Grok rules that failed to compile, with full structured detail. One entry per invalid rule."})},{$id:"GrokRuleErrorDetails"})],{description:"Structured details for a client error. Set by Tsuga only for error types with machine-readable remediation data, and omitted for every other client error."}),gCe=r.Object({code:r.Optional(r.Enum(sq,{description:"Machine readable error code describing what went wrong"})),message:r.String({description:"Human readable explanation of the error"}),statusCode:r.Number({description:"HTTP status code that was returned"}),details:r.Optional(JA)},{$id:"ErrorResponse",description:"Standard envelope for API errors"}),hCe=r.Object({code:r.Optional(r.Enum(ZA,{description:"Machine readable error code describing what went wrong"})),message:r.String({description:"Human readable explanation of the error"}),statusCode:r.Number({description:"HTTP status code that was returned"}),details:r.Optional(JA)},{$id:"ClientErrorResponse",description:"Standard envelope for client (4XX) API errors"}),yCe=r.Object({code:r.Optional(r.Enum(XA,{description:"Machine readable error code describing what went wrong"})),message:r.String({description:"Human readable explanation of the error"}),statusCode:r.Number({description:"HTTP status code that was returned"})},{$id:"ServerErrorResponse",description:"Standard envelope for server (5XX) API errors"}),TCe=r.Object({requestId:r.String({description:"Identifier used to trace the lifecycle of this API request"}),error:r.Ref("ClientErrorResponse")},{$id:"ClientErrorEnvelope",description:"Standard envelope wrapping all client (4XX) error responses"}),ECe=r.Object({requestId:r.String({description:"Identifier used to trace the lifecycle of this API request"}),error:r.Ref("ServerErrorResponse")},{$id:"ServerErrorEnvelope",description:"Standard envelope wrapping all server (5XX) error responses"});function d({body:e,description:t,method:n,operationId:o,params:i,tags:a,query:c,paginated:l,response:m,url:f}){return i?{buildUrl:E=>f.replace(/:[a-zA-Z_]+/g,I=>E[I.slice(1)]),method:n,params:i,response:m,templateUrl:f,...e===void 0?{}:{body:e},...t===void 0?{}:{description:t},...o===void 0?{}:{operationId:o},...c===void 0?{}:{query:c},...l===void 0?{}:{paginated:l},...a===void 0?{}:{tags:a}}:{method:n,response:m,url:f,templateUrl:f,...e===void 0?{}:{body:e},...t===void 0?{}:{description:t},...o===void 0?{}:{operationId:o},...c===void 0?{}:{query:c},...l===void 0?{}:{paginated:l},...a===void 0?{}:{tags:a}}}function eO(e,t){if(!t||typeof t!="object")return e;let n=new URLSearchParams;return Object.entries(t).forEach(([o,i])=>{Array.isArray(i)?i.length>0&&i.forEach(a=>{a!==void 0&&(typeof a=="string"||typeof a=="number"||typeof a=="boolean")&&n.append(o,String(a))}):(typeof i=="boolean"||typeof i=="string"||typeof i=="number")&&n.append(o,String(i))}),`${e}?${n.toString()}`}var N=r.Object({success:r.Literal(!0,{description:"Always `true` when the delete request completed and the resource was removed."})},{$id:"DeleteResponse",description:"Confirmation that the targeted resource was deleted.",example:{success:!0}});var Gp="tsuga-cli";var to="/v0/oauth",tO=d({description:"OAuth 2.1 authorization endpoint: validates the client and redirect URI, then redirects to the consent page",url:`${to}/authorize`,method:"GET",query:r.Partial(r.Object({response_type:r.String({description:"Must be `code`"}),client_id:r.String({description:"First-party client id or CIMD document URL"}),redirect_uri:r.String({description:"Client redirect URI"}),code_challenge:r.String({description:"PKCE code challenge"}),code_challenge_method:r.String({description:"Must be `S256`"}),state:r.String({description:"Opaque client state, echoed back"}),resource:r.String({description:"RFC 8707 resource indicator"})})),response:r.Object({},{description:"Never returned: this endpoint redirects (302) or renders an HTML error (400)"})}),rO=d({description:"OAuth 2.1 token endpoint: exchanges an authorization code (PKCE) or refresh token for a token pair",url:`${to}/token`,method:"POST",body:r.Partial(r.Object({grant_type:r.String({description:"`authorization_code` or `refresh_token`"}),code:r.String({description:"Authorization code being exchanged"}),code_verifier:r.String({description:"PKCE code verifier"}),redirect_uri:r.String({description:"Must match the redirect URI used on /authorize"}),client_id:r.String({description:"Client id, when sent by the client"}),refresh_token:r.String({description:"Refresh token, for `grant_type=refresh_token`"})})),response:r.Object({access_token:r.String(),token_type:r.Literal("Bearer"),expires_in:r.Number({description:"Access token lifetime in seconds"}),refresh_token:r.String()})}),kCe=d({description:"Resolve a signed authorization request handle for the consent page",url:`${to}/authorization-request`,method:"GET",query:r.Object({handle:r.String()}),response:r.Object({clientId:r.String(),clientName:r.String(),redirectUri:r.String()})}),MCe=d({description:"Approve or deny an OAuth authorization request from the consent page",url:`${to}/approve`,method:"POST",body:r.Object({handle:r.String({description:"The signed authorization request handle"}),approve:r.Boolean()}),response:r.Object({redirectTo:r.String({description:"The client's redirect URI carrying either the code or the denial"})})}),DCe=d({description:"Validate an OAuth access token (internal, for the MCP resource server)",url:`${to}/introspect`,method:"POST",body:r.Object({token:r.String()}),response:r.Object({active:r.Boolean(),userId:r.Optional(r.String()),orgId:r.Optional(r.String())})}),lq=["pending","active","revoked"],mq=r.Object({id:r.String(),createdAt:A(),clientId:r.String({description:"Client ID Metadata Document URL or first-party client id"}),clientName:r.String({description:"Display name derived from the client identity"}),userId:r.String(),status:r.Enum(lq),lastUsedAt:r.Optional(A())}),GCe=d({tags:["oauth"],description:"List OAuth grants: your own, or all users for admins",url:`${to}/grants`,method:"GET",query:r.Object({allUsers:r.Optional(r.Boolean({description:"Admins only: list grants of every user in the org"}))}),response:r.Array(mq)}),$Ce=d({tags:["oauth"],description:"Delete an OAuth grant (own grant, or any grant for admins)",url:`${to}/grants/:id`,method:"DELETE",params:r.Object({id:r.String()}),response:N});function nO(e,t){let n=new URL(tO.url,e);return n.search=new URLSearchParams({response_type:"code",client_id:Gp,redirect_uri:t.redirectUri,code_challenge:t.challenge,code_challenge_method:"S256",state:t.state}).toString(),n.href}var Ha=class extends Error{constructor(n,o){super(n);this.code=o;this.name="OAuthTokenError"}};function dq(e){if(!e)return{};try{let t=JSON.parse(e);return typeof t=="object"&&t!==null?t:{}}catch{return{}}}async function oO(e,t){let n=await fetch(new URL(rO.url,e).href,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams(t).toString()}),o=await n.text(),i=dq(o);if(n.status!==200){let a=i.error??`HTTP ${n.status}`;throw new Ha(`OAuth token request failed (${a}${i.error_description?`: ${i.error_description}`:""})`,a)}if(typeof i.access_token!="string"||i.access_token===""||typeof i.refresh_token!="string"||i.refresh_token===""||typeof i.expires_in!="number")throw new Error("OAuth token response was missing required fields");return{accessToken:i.access_token,refreshToken:i.refresh_token,expiresAt:new Date(Date.now()+i.expires_in*Pl)}}async function iO(e,t){return oO(e,{grant_type:"authorization_code",client_id:Gp,code:t.code,code_verifier:t.verifier,redirect_uri:t.redirectUri})}async function $p(e,t){return oO(e,{grant_type:"refresh_token",client_id:Gp,refresh_token:t})}var fq="Your session expired. Run `tsuga auth login` to sign in again.",gq="Your session could not be renewed: the refresh token was already used, revoked or expired. A refresh token is single-use, so the server revokes the whole session when one is replayed - run `tsuga auth login` to sign in again.",hq=5*sa;function aO(e,t){return new Date(e.accessExpiresAt)<=new Date(t.getTime()+hq)}function Ka(e){return`\u2022\u2022\u2022\u2022${e.slice(-4)}`}function Fm(e){return{accessToken:e.accessToken,accessExpiresAt:e.expiresAt.toISOString(),refreshToken:e.refreshToken}}function sO(e){if(e.overrideKey)return{kind:"operation-api-key",token:e.overrideKey};if(e.operationApiKey)return{kind:"operation-api-key",token:e.operationApiKey};if(e.userAuth)return{kind:"user-session",userAuth:e.userAuth}}function cO(e){if(e)switch(e.kind){case"operation-api-key":return e.token;case"user-session":return e.userAuth.accessToken;default:Je(e)}}async function jp({userAuth:e,now:t,reload:n,refresh:o,persist:i}){if(!aO(e,t))return e;let a=n()??e;if(!aO(a,t))return a;if(!a.refreshToken)throw new Error(fq);let c;try{c=await o(a.refreshToken)}catch(m){throw m instanceof Ha&&m.code==="invalid_grant"?new Error(gq,{cause:m}):new Error(`Could not renew your session: ${m instanceof Error?m.message:String(m)}. Retry the command.`,{cause:m})}let l=Fm(c);try{i(l)}catch(m){console.error(`Warning: could not save the renewed session (${m instanceof Error?m.message:String(m)}). Run \`tsuga auth login\` before the next command.`)}return l}var Bm={r:8,g:203,b:0},Hm={r:0,g:130,b:0},Km=["\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2557 ","\u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557"," \u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551"," \u2588\u2588\u2551 \u255A\u2550\u2550\u2550\u2550\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2551"," \u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2551"," \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D"];function zm(e,t,n){return Math.round(e+(t-e)*n)}function yq(e,t){let n=zm(Bm.r,Hm.r,t),o=zm(Bm.g,Hm.g,t),i=zm(Bm.b,Hm.b,t);return`\x1B[38;2;${n};${o};${i}m${e}\x1B[0m`}function Tq(e){if(!e)return`
|
|
34
34
|
|
|
35
35
|
${Km.join(`
|
|
36
36
|
`)}`;let t=Km.length-1;return`
|
|
37
37
|
|
|
38
|
-
${Km.map((o,i)=>
|
|
39
|
-
`)}`}function pO(){return
|
|
38
|
+
${Km.map((o,i)=>yq(o,t===0?0:i/t)).join(`
|
|
39
|
+
`)}`}function pO(){return Tq(process.stdout.isTTY&&!process.env.NO_COLOR)}var qO=require("node:crypto");var za=require("node:crypto");function Eq(e){return(0,za.createHash)("sha256").update(e).digest("base64url")}function uO(){let e=(0,za.randomBytes)(32).toString("base64url");return{verifier:e,challenge:Eq(e)}}var gO=require("node:child_process"),hO=require("node:http"),Jm=require("node:os");var _q={"&":"&","<":"<",">":">",'"':""","'":"'"};function Ym(e){return e.replace(/[&<>"']/g,t=>_q[t]??t)}var Iq=[":root{color-scheme:light dark;--bg:#f9fafb;--card:#fff;--fg:#1f2937;--fg-muted:#6b7280;","--logo-1:#08cb00;--logo-2:#008200;--brand:#08cb00;--bloom:#e5e7eb}","@media(prefers-color-scheme:dark){:root{--bg:#18181b;--card:#202023;--fg:#e4e4e7;","--fg-muted:#a1a1aa;--logo-1:#fff;--logo-2:#fff;--bloom:#52525b}}","*{box-sizing:border-box}","body{margin:0;min-height:100vh;display:flex;align-items:flex-start;justify-content:center;","padding:24px;padding-top:14vh;font-family:Inter,system-ui,-apple-system,'Segoe UI',sans-serif;","color:var(--fg);background-color:var(--bg);background-image:","radial-gradient(72% 78% at 104% 112%,var(--brand) -20%,transparent 64%),","radial-gradient(46% 46% at 94% -4%,var(--brand) -20%,transparent 64%),","radial-gradient(48% 58% at -8% 68%,var(--bloom) -20%,transparent 64%)}","main{display:flex;flex-direction:column;align-items:center;text-align:center;gap:24px;","width:100%;max-width:480px;padding:32px;border-radius:8px;backdrop-filter:blur(8px);","background-color:color-mix(in srgb,var(--card) 55%,transparent);","box-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1)}",".tile{display:flex;padding:6px;border-radius:6px;background-color:var(--card);","box-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1)}",".tile svg{display:block;width:32px;height:32px}",".copy{display:flex;flex-direction:column;gap:8px}","h1{margin:0;font-size:29px;font-weight:600;line-height:1.2}","p{margin:0;font-size:14px;line-height:20px;color:var(--fg-muted)}"].join(""),bq=['<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 111.94 133.41" aria-hidden="true">','<path fill="var(--logo-2)" d="M40.66,54.06c-11.32,8.54-25.39,13.61-40.66,13.61v-23.36c17.9,0,','33.3-10.6,40.29-25.87v28.28c0,2.48.13,4.93.37,7.34Z"/>','<path fill="var(--logo-2)" d="M67.65,103.01v30.4h-23.36v-35.58c-11.87,10.29-27.34,16.54-44.29,','16.54v-23.36c19.33,0,35.76-12.37,41.8-29.63,3.5,16.76,12.87,31.39,25.85,41.63Z"/>','<rect fill="var(--logo-1)" x="44.29" width="23.36" height=".02"/>','<path fill="var(--logo-1)" d="M111.94,67.67c-16.83,0-32.21-6.14-44.05-16.3,2.32,22.28,21.16,',"39.64,44.05,39.64v23.36c-37.36,0-67.65-30.29-67.65-67.65V.02h23.36c0,24.47,19.83,44.29,44.29,",'44.29v23.36Z"/></svg>'].join("");function Vm(e,t){let n=Ym(e);return['<!doctype html><html lang="en"><head><meta charset="utf-8">','<meta name="viewport" content="width=device-width,initial-scale=1">',`<title>${n}</title><style>${Iq}</style></head><body><main>`,`<span class="tile">${bq}</span>`,`<div class="copy"><h1>${n}</h1><p>${Ym(t)}</p></div>`,"</main></body></html>"].join("")}function V(e){process.stdout.write(`${e}
|
|
40
40
|
`)}function ee(e){V(JSON.stringify(e,null,2))}function mO(e){process.stderr.write(`${e}
|
|
41
|
-
`)}var lO=["json","tsv","csv"];function Qm(e){let t=lO.find(n=>n===e);if(t!==void 0)return t;throw new Error(`--output must be one of: ${lO.join(", ")} (got: ${e})`)}function Wm(e){let t=e.split(",").map(n=>n.trim()).filter(n=>n.length>0);if(t.length===0)throw new Error("--fields must contain at least one field name");return t}function dO(e,t){let n=e;for(let o of t.split(".")){if(n===null||typeof n!="object"||!Object.hasOwn(n,o))return;n=n[o]}return n}function Zm(e,t){let n=Object.create(null);for(let o of t){let i=dO(e,o);if(i===void 0)continue;let a=o.split("."),c=a.pop();if(c===void 0)continue;let l=n;for(let m of a)(typeof l[m]!="object"||l[m]===null)&&(l[m]=Object.create(null)),l=l[m];l[c]=i}return n}function fO(e){return e==null?null:typeof e=="string"?e:JSON.stringify(e)}var
|
|
42
|
-
`)}var yO="/oauth/callback",
|
|
43
|
-
`);return o.status!==0?(od("save the session to",o),!1):!0}function id(e){if(!rd(e))return!0;let t=nd(["delete-generic-password","-s",td,"-a",e]);return t.status!==0&&t.status!==OO?(od("remove the session from",t),!1):!0}var CO=(0,no.join)(
|
|
41
|
+
`)}var lO=["json","tsv","csv"];function Qm(e){let t=lO.find(n=>n===e);if(t!==void 0)return t;throw new Error(`--output must be one of: ${lO.join(", ")} (got: ${e})`)}function Wm(e){let t=e.split(",").map(n=>n.trim()).filter(n=>n.length>0);if(t.length===0)throw new Error("--fields must contain at least one field name");return t}function dO(e,t){let n=e;for(let o of t.split(".")){if(n===null||typeof n!="object"||!Object.hasOwn(n,o))return;n=n[o]}return n}function Zm(e,t){let n=Object.create(null);for(let o of t){let i=dO(e,o);if(i===void 0)continue;let a=o.split("."),c=a.pop();if(c===void 0)continue;let l=n;for(let m of a)(typeof l[m]!="object"||l[m]===null)&&(l[m]=Object.create(null)),l=l[m];l[c]=i}return n}function fO(e){return e==null?null:typeof e=="string"?e:JSON.stringify(e)}var Sq={"\\":"\\\\"," ":"\\t","\r":"\\r","\n":"\\n"};function Aq(e){let t=fO(e);return t===null?"":t.replace(/[\\\t\r\n]/g,n=>Sq[n]??n)}function Oq(e){let t=fO(e);return t===null?"":/[,"\n\r]/.test(t)?`"${t.replaceAll('"','""')}"`:t}function Xm(e,t,n){if(t.length===0)return"";let o=e==="csv"?",":" ",i=e==="csv"?Oq:Aq,a=n.map(l=>i(l)).join(o),c=t.map(l=>n.map(m=>i(dO(l,m))).join(o));return[a,...c].join(`
|
|
42
|
+
`)}var yO="/oauth/callback",Rq=5*sa,Cq=Vm("Login complete","You can close this tab and return to the terminal."),qp=Vm("Login failed","Return to the terminal for details.");function Pq(e){return(0,Jm.platform)()==="darwin"?["open",[e]]:(0,Jm.platform)()==="win32"?["rundll32",["url.dll,FileProtocolHandler",e]]:["xdg-open",[e]]}function Uq(e){let[t,n]=Pq(e),o=(0,gO.spawnSync)(t,n,{stdio:"ignore"});return o.error===void 0&&o.status===0}async function wq(e,t,n){return new Promise((o,i)=>{let a=setTimeout(()=>{i(new Error("Timed out waiting for the browser to complete login (5 minutes)."))},Rq),c=(l,m,f,h)=>{l.writeHead(m,{"Content-Type":"text/html"}),l.end(f),clearTimeout(a),h()};e.on("request",(l,m)=>{let f=new URL(l.url??"/",n);if(f.pathname!==yO){m.writeHead(404,{"Content-Type":"text/html"}),m.end(qp);return}let h=f.searchParams.get("error");if(h){let I=f.searchParams.get("error_description")??"";c(m,400,qp,()=>i(new Error(`Authorization failed: ${h}${I?` (${I})`:""}`)));return}if(f.searchParams.get("state")!==t){c(m,400,qp,()=>i(new Error("State mismatch on OAuth callback; aborting for safety.")));return}let E=f.searchParams.get("code");if(!E){c(m,400,qp,()=>i(new Error("OAuth callback did not include an authorization code.")));return}c(m,200,Cq,()=>o(E))})})}async function TO(e){let t=(0,hO.createServer)();t.on("connection",a=>a.unref()),await new Promise((a,c)=>{t.once("error",c),t.listen(0,"127.0.0.1",()=>{t.off("error",c),a()})});let{port:n}=t.address(),o=`http://127.0.0.1:${n}`,i=`${o}${yO}`;try{let a=e.buildAuthorizeUrl(i);return Uq(a)?V("Opening your browser to complete login..."):(V("Visit this URL in your browser to complete login:"),V(` ${a}`)),{code:await wq(t,e.state,o),redirectUri:i}}finally{t.close()}}var Wt=require("node:fs"),sd=require("node:os"),no=require("node:path");var _O=rn(require("os"),1),Ya=rn(require("path"),1),hn=_O.default.homedir(),{env:ro}=process,EO=ro.XDG_DATA_HOME||(hn?Ya.default.join(hn,".local","share"):void 0),Fp=ro.XDG_CONFIG_HOME||(hn?Ya.default.join(hn,".config"):void 0),iPe=ro.XDG_STATE_HOME||(hn?Ya.default.join(hn,".local","state"):void 0),IO=ro.XDG_CACHE_HOME||(hn?Ya.default.join(hn,".cache"):void 0),aPe=ro.XDG_RUNTIME_DIR||void 0,vq=(ro.XDG_DATA_DIRS||"/usr/local/share/:/usr/share/").split(":");EO&&vq.unshift(EO);var Nq=(ro.XDG_CONFIG_DIRS||"/etc/xdg").split(":");Fp&&Nq.unshift(Fp);var bO=new Set(["api.tsuga.com","api.tsuga-staging.com"]),Lq=new Set(["localhost","127.0.0.1","[::1]"]);function ed(e){let t=e.replace(/\/+$/,"");if(!URL.canParse(t))throw new Error(`TSUGA_API_URL is not a URL: ${t}`);let n=new URL(t);if(!Lq.has(n.hostname)&&(n.protocol!=="https:"||!bO.has(n.hostname)))throw new Error(`Refusing to send credentials to ${t}. Set TSUGA_API_URL to ${[...bO].map(o=>`https://${o}`).join(", ")}, or a localhost URL.`);return t}var SO=require("node:child_process"),AO=require("node:fs"),Va="/usr/bin/security",td="tsuga-cli",OO=44,kq=/^https?:\/\/[^\s"'\\]+$/,Qa="the macOS Keychain";function rd(e){if(process.platform!=="darwin"||!kq.test(e))return!1;try{return(0,AO.lstatSync)(Va).isFile()}catch{return!1}}function nd(e,t){try{return{status:0,stdout:(0,SO.execFileSync)(Va,e,{env:{},input:t,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}),stderr:""}}catch(n){let{status:o,stderr:i}=n;return{status:o??1,stdout:"",stderr:i??""}}}function od(e,{status:t,stderr:n}){let o=n.trim()||`\`security\` exited with ${t}`;console.error(`Warning: could not ${e} ${Qa}: ${o}`)}function xO(e){if(!rd(e))return;let t=nd(["find-generic-password","-s",td,"-a",e,"-w"]);if(t.status!==0){t.status!==OO&&od("read the session from",t);return}try{return JSON.parse(t.stdout.trim())}catch{return}}function RO(e,t){if(!rd(e))return!1;let n=Buffer.from(JSON.stringify(t),"utf-8").toString("hex"),o=nd(["-i"],`add-generic-password -U -s ${td} -a ${e} -X ${n}
|
|
43
|
+
`);return o.status!==0?(od("save the session to",o),!1):!0}function id(e){if(!rd(e))return!0;let t=nd(["delete-generic-password","-s",td,"-a",e]);return t.status!==0&&t.status!==OO?(od("remove the session from",t),!1):!0}var CO=(0,no.join)(Fp??(0,no.join)((0,sd.homedir)(),".config"),"tsuga"),ri=(0,no.join)(CO,"config.json"),PO=(0,no.join)(IO??(0,no.join)((0,sd.homedir)(),".cache"),"tsuga"),ad=(0,no.join)(PO,"update-check.json"),Wa=ed("https://api.tsuga.com");function UO(e){return cO(e.credential)}function Hp(){if(!(0,Wt.existsSync)(ri))return{};try{let e=JSON.parse((0,Wt.readFileSync)(ri,"utf-8")),{operationApiKey:t,userAuth:n,...o}=e;return!t&&!n?e:{...o,credentials:{...e.credentials,[Wa]:{...t?{operationApiKey:t}:{},...n?{userAuth:n}:{},...e.credentials?.[Wa]}}}}catch{throw new Error(`Config file corrupted: ${ri}
|
|
44
44
|
Re-authenticate with \`tsuga auth login\` or \`tsuga auth operation-key <OPERATION_API_KEY>\`.`)}}function Za(){try{return Hp()}catch{return{}}}function ni(e){(0,Wt.mkdirSync)(CO,{recursive:!0,mode:448}),(0,Wt.writeFileSync)(ri,`${JSON.stringify(e,null,2)}
|
|
45
|
-
`,{mode:384})}function cd(e,t=yn()){let n=e.credentials?.[t]??{},o=xO(t);return o?{...n,userAuth:o}:n}function Bp(e,t,n=yn()){return{...e,credentials:{...e.credentials,[n]:t}}}function yn(){return ed(process.env.TSUGA_API_URL?.trim()||Wa)}function oi(e){let t=Hp(),n=yn(),o=cd(t,n),i=sO({overrideKey:e.operationApiKey??process.env.TSUGA_OPERATION_API_KEY,operationApiKey:o.operationApiKey,userAuth:o.userAuth}),a=t.defaults??{},c=e.clusterId?.trim()||process.env.TSUGA_CLUSTER_ID?.trim()||a.cluster?.trim()||void 0;return{apiUrl:n,credential:i,clusterId:c,defaults:a}}function Xa(){return cd(Hp()).userAuth}function wO(e,t){let n=Za(),o=yn(),{operationApiKey:i}=n.credentials?.[o]??{},a=t&&i?{operationApiKey:i}:{};if(RO(o,e))return ni(Bp(n,a,o)),Qa;if(!id(o))throw new Error(`Could not save the session to ${Qa}, nor remove the session already stored there. Remove it with \`${Va} delete-generic-password -s tsuga-cli -a ${o}\` and log in again.`);return ni(Bp(n,{...a,userAuth:e},o)),ri}function vO(e){return wO(e,!1)}function Kp(e){wO(e,!0)}function NO(e){let t=Za();ni(Bp(t,{operationApiKey:e}))}function LO(){let e=yn(),t=id(e),n=Za(),o=cd(n,e);if(ni(Bp(n,o.operationApiKey?{operationApiKey:o.operationApiKey}:{},e)),!t)throw new Error(`The session is still in ${Qa}. Remove it with \`${Va} delete-generic-password -s tsuga-cli -a ${e}\`.`)}function zp(){return ri}var kO={from:"-30m",to:"now",query:"*","max-results":"100"};function $r(e){return(Hp().defaults??{})[e]??kO[e]}function MO(e,t){let n=Za();ni({...n,defaults:{...n.defaults,[e]:t}})}function DO(){let{defaults:e,...t}=Za();ni(t)}function GO(e,t){let n=[`API URL: ${e.apiUrl}`],{credential:o}=e;if(o){let a=o.kind;switch(a){case"operation-api-key":n.push(`Operation API key: ${o.token.slice(0,12)}...${o.token.slice(-4)}`);break;case"user-session":n.push(`User session: ${Ka(o.userAuth.accessToken)} (expires ${o.userAuth.accessExpiresAt})`);break;default:
|
|
45
|
+
`,{mode:384})}function cd(e,t=yn()){let n=e.credentials?.[t]??{},o=xO(t);return o?{...n,userAuth:o}:n}function Bp(e,t,n=yn()){return{...e,credentials:{...e.credentials,[n]:t}}}function yn(){return ed(process.env.TSUGA_API_URL?.trim()||Wa)}function oi(e){let t=Hp(),n=yn(),o=cd(t,n),i=sO({overrideKey:e.operationApiKey??process.env.TSUGA_OPERATION_API_KEY,operationApiKey:o.operationApiKey,userAuth:o.userAuth}),a=t.defaults??{},c=e.clusterId?.trim()||process.env.TSUGA_CLUSTER_ID?.trim()||a.cluster?.trim()||void 0;return{apiUrl:n,credential:i,clusterId:c,defaults:a}}function Xa(){return cd(Hp()).userAuth}function wO(e,t){let n=Za(),o=yn(),{operationApiKey:i}=n.credentials?.[o]??{},a=t&&i?{operationApiKey:i}:{};if(RO(o,e))return ni(Bp(n,a,o)),Qa;if(!id(o))throw new Error(`Could not save the session to ${Qa}, nor remove the session already stored there. Remove it with \`${Va} delete-generic-password -s tsuga-cli -a ${o}\` and log in again.`);return ni(Bp(n,{...a,userAuth:e},o)),ri}function vO(e){return wO(e,!1)}function Kp(e){wO(e,!0)}function NO(e){let t=Za();ni(Bp(t,{operationApiKey:e}))}function LO(){let e=yn(),t=id(e),n=Za(),o=cd(n,e);if(ni(Bp(n,o.operationApiKey?{operationApiKey:o.operationApiKey}:{},e)),!t)throw new Error(`The session is still in ${Qa}. Remove it with \`${Va} delete-generic-password -s tsuga-cli -a ${e}\`.`)}function zp(){return ri}var kO={from:"-30m",to:"now",query:"*","max-results":"100"};function $r(e){return(Hp().defaults??{})[e]??kO[e]}function MO(e,t){let n=Za();ni({...n,defaults:{...n.defaults,[e]:t}})}function DO(){let{defaults:e,...t}=Za();ni(t)}function GO(e,t){let n=[`API URL: ${e.apiUrl}`],{credential:o}=e;if(o){let a=o.kind;switch(a){case"operation-api-key":n.push(`Operation API key: ${o.token.slice(0,12)}...${o.token.slice(-4)}`);break;case"user-session":n.push(`User session: ${Ka(o.userAuth.accessToken)} (expires ${o.userAuth.accessExpiresAt})`);break;default:Je(a)}}else n.push("Not authenticated. Run `tsuga auth login` or `tsuga auth operation-key <OPERATION_API_KEY>`.");n.push(`Config: ${t}`),n.push(""),n.push("Defaults (custom overrides marked with *):");let i={...kO,...e.defaults};for(let[a,c]of Object.entries(i)){let l=a in e.defaults?" *":"";n.push(` ${a}: ${c}${l}`)}return`${n.join(`
|
|
46
46
|
`)}
|
|
47
47
|
`}function $O(){if((0,Wt.existsSync)(ad))try{return JSON.parse((0,Wt.readFileSync)(ad,"utf-8")).lastUpdateCheck}catch{return}}function jO(e){(0,Wt.mkdirSync)(PO,{recursive:!0,mode:448}),(0,Wt.writeFileSync)(ad,`${JSON.stringify({lastUpdateCheck:e})}
|
|
48
|
-
`,{mode:384})}async function
|
|
48
|
+
`,{mode:384})}async function Mq(){let e=yn(),{verifier:t,challenge:n}=uO(),o=(0,qO.randomBytes)(16).toString("base64url"),{code:i,redirectUri:a}=await TO({state:o,buildAuthorizeUrl:m=>nO(e,{redirectUri:m,challenge:n,state:o})}),c=await iO(e,{code:i,verifier:t,redirectUri:a}),l=vO(Fm(c));V(`Logged in. Session token ${Ka(c.accessToken)} saved to ${l}`)}async function Dq(){let e=yn(),t=Xa();if(!t){let n=e===Wa?"":` for ${e}`;process.stderr.write(`No user session${n}. Run \`tsuga auth login\`.
|
|
49
49
|
`),process.exitCode=1;return}try{let n=await jp({userAuth:t,now:new Date,reload:Xa,refresh:o=>$p(e,o),persist:Kp});V(n.accessToken)}catch(n){process.stderr.write(`${n instanceof Error?n.message:String(n)}
|
|
50
|
-
`),process.exitCode=1}}function Yp(e,t){let n=py(uy({start:e,end:t}),{format:["years","months","days","hours","minutes"]});return n===""?"less than a minute":n}function GF(e){let t=Ka(e.accessToken),n=new Date,o=new Date(e.accessExpiresAt),i=!!e.refreshToken;return Number.isNaN(o.getTime())?`Logged in as a user (token ${t}, expires ${e.accessExpiresAt}).`:o<=n?i?`Logged in as a user (token ${t}). Access token expired ${Yp(o,n)} ago, on ${e.accessExpiresAt}; the next command renews it automatically.`:`Logged in as a user (token ${t}). Session expired ${Yp(o,n)} ago, on ${e.accessExpiresAt}. Run \`tsuga auth login\` to sign in again.`:i?`Logged in as a user (token ${t}). Access token expires in ${Yp(n,o)}, on ${e.accessExpiresAt}; the session renews automatically.`:`Logged in as a user (token ${t}). Session expires in ${Yp(n,o)}, on ${e.accessExpiresAt}.`}function $F(){let{credential:e}=oi({});if(!e){V("Not authenticated. Run `tsuga auth login` or `tsuga auth operation-key <OPERATION_API_KEY>`.");return}switch(e.kind){case"user-session":V(GF(e.userAuth));return;case"operation-api-key":V("Authenticated with an operation API key.");return;default:tt(e)}}function jF(){LO(),V("Local user session cleared.")}function qO(e){let t=e.command("auth").description("Manage authentication: user login (OAuth) or operation API key");t.action(()=>t.help()),t.command("login").description("Log in as a user with a browser authorization flow and save the session (replaces any saved operation API key)").action(MF),t.command("logout").description("Clear the saved user session").action(jF),t.command("token").description("Print the saved user access token to stdout").action(DF),t.command("operation-key <OPERATION_API_KEY>").description("Save an operation API key to the config file (replaces any saved user session)").action(n=>{NO(n),V(`Operation API key saved to ${zp()}`)}),t.command("status").description("Show the current authentication method").action($F)}var FF=["allowed-domains","cluster-integration-config","custom-usage-tag","database","databricks-connection","explorer-saved-view","github-connection","host","inventory","monitor-alert","monitor-debugging","oauth-grant","org","retention-policy","saml-config","sensitive-data-scanner-rule","service","service-target","team-remap-config","user-self","widget-share"],qF=["adaptive-notification-rule","audit-log","cloud-account","dashboard-folder","dashboard-report","dashboard","ingestion-api-key","investigation","log-route","metric-route","monitor","notification-integration","notification-rule","notification-silence","operation-api-key","quality-report","rum-public-token","slo","tag-policy","team-members","team","user-data","user-invitation","user-permissions"],BF=["log","metric","trace","rum"],pd=[...qF,...BF],wPe=[...FF,...pd];var BO=["admin","public_editor","public_viewer","teams_only"],ii=["admin","editor","viewer"];var oo="/v0/team-membership",ud="Role granted to the user inside this team. `admin` gives full team control, including managing assets, members, and settings. `editor` can view and update most team assets (dashboards, monitors, etc.) but cannot manage members or settings. `viewer` can view team data but cannot make changes.",ld=r.Object({id:r.String({description:"Tsuga-generated team membership ID assigned when the membership is created."}),userId:r.String({description:"User ID that belongs to the team."}),teamId:r.String({description:"Team ID that contains the user."}),roleKey:r.Enum(ii,{description:ud})}),HO=r.Object({userId:u({allowEmpty:!1,description:"User ID to add to or update in the team."}),teamId:u({allowEmpty:!1,description:"Team ID receiving the membership change."}),roleKey:r.Enum(ii,{description:ud})}),HF=r.Object({userId:u({allowEmpty:!1,description:"User ID to remove from the team."}),teamId:u({allowEmpty:!1,description:"Team ID to remove the user from."})}),KF=r.Optional(r.Object({userId:r.Optional(u({allowEmpty:!1,description:"Restrict results to memberships for this user ID."})),teamId:r.Optional(u({allowEmpty:!1,description:"Restrict results to memberships for this team ID."}))})),vPe=d({tags:["access-control"],url:oo,method:"GET",query:KF,response:r.Array(ld)}),NPe=d({tags:["access-control"],url:oo,method:"POST",body:HO,response:ld}),LPe=d({tags:["access-control"],url:oo,method:"PUT",body:HO,response:ld}),kPe=d({tags:["access-control"],url:oo,method:"DELETE",body:HF,response:N}),Vp=500,KO=r.Object({teamId:u({allowEmpty:!1,description:"Team ID receiving all requested memberships."}),members:r.Array(r.Object({userId:r.Optional(u({allowEmpty:!1,description:"Existing user ID to add to the team."})),userEmail:r.Optional(u({allowEmpty:!1,type:"email",description:"Existing user email to resolve and add to the team."})),roleKey:r.Enum(ii,{description:ud})},{oneOf:[{required:["userId"]},{required:["userEmail"]}]}),{minItems:1,maxItems:Vp,description:"Users to add to the team. Each item must include either `userId` or `userEmail`, not both. Duplicate identifiers (including a `userId` and `userEmail` that resolve to the same user) are rejected. Items are processed independently: an unresolved user does not stop other items from being added."})},{description:"Bulk team-membership creation request. Provide one target team and the users to add by ID or email, with a role for each user."}),zF={teamId:"team-123-abc",members:[{userId:"user-123-abc",roleKey:"viewer"},{userEmail:"sam@example.com",roleKey:"editor"}]};Object.assign(KO,{examples:[zF]});var zO=r.Object({results:r.Array(r.Object({userId:r.String({description:"Resolved user ID for this bulk add result. For `user_not_found`, this is the submitted user ID or email that Tsuga could not resolve."}),status:r.Enum(["added","already_member","user_not_found"],{description:"`added` means the membership was created, `already_member` means no change was needed, and `user_not_found` means Tsuga could not resolve the requested user."})}))},{description:"Per-user result summary for a bulk team-membership add request."}),YF={results:[{userId:"user-123-abc",status:"added"},{userId:"sam@example.com",status:"user_not_found"}]};Object.assign(zO,{examples:[YF]});var MPe=d({tags:["access-control"],url:`${oo}/bulk-add`,method:"POST",body:KO,response:zO}),DPe=d({tags:["access-control"],url:`${oo}/bulk-update-user-roles`,method:"PUT",body:r.Object({userIds:r.Array(u({allowEmpty:!1}),{minItems:1,maxItems:Vp}),teamId:u({allowEmpty:!1}),role:r.Enum(ii)}),response:r.Object({})}),YO=r.Object({teamId:u({allowEmpty:!1,description:"Team ID to remove the requested users from."}),userIds:r.Optional(r.Array(u({allowEmpty:!1}),{minItems:1,maxItems:Vp,description:"User IDs to remove from the team. Items are processed independently: a user who is not a member or cannot be resolved does not stop the other items from being removed."})),userEmails:r.Optional(r.Array(u({allowEmpty:!1,type:"email"}),{minItems:1,maxItems:Vp,description:"User emails to resolve and remove from the team."}))},{oneOf:[{required:["userIds"]},{required:["userEmails"]}],description:"Bulk team-membership removal request. Provide one target team and either `userIds` or `userEmails`, not both, with no duplicates."}),VF={teamId:"team-123-abc",userIds:["user-123-abc"]};Object.assign(YO,{examples:[VF]});var VO=r.Object({results:r.Array(r.Object({userId:r.String({description:"Resolved user ID for this bulk remove result. For `user_not_found`, this is the submitted user ID or email that Tsuga could not resolve."}),status:r.Enum(["removed","not_member","user_not_found"],{description:"`removed` means the membership was deleted, `not_member` means no membership existed, and `user_not_found` means Tsuga could not resolve the requested user."})}))},{description:"Per-user result summary for a bulk team-membership removal request."}),QF={results:[{userId:"user-123-abc",status:"removed"},{userId:"missing@example.com",status:"user_not_found"}]};Object.assign(VO,{examples:[QF]});var GPe=d({tags:["access-control"],url:`${oo}/bulk-remove`,method:"DELETE",body:YO,response:VO});var WF={"github-connection":{read:["admin"],write:["admin"]},investigation:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"ingestion-api-key":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"rum-public-token":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"widget-share":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"audit-log":{read:["public_viewer","public_editor","admin"],write:[]},"custom-usage-tag":{read:["public_viewer","public_editor","admin"],write:["admin"]},"cluster-integration-config":{read:["admin"],write:["admin"]},"explorer-saved-view":{read:["public_viewer","public_editor","admin"],write:["public_viewer","public_editor","admin"]},"operation-api-key":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"cloud-account":{read:["public_viewer","public_editor","admin"],write:["admin"]},dashboard:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"dashboard-folder":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"dashboard-report":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},inventory:{read:["public_viewer","public_editor","admin"],write:[]},log:{read:["public_viewer","public_editor","admin"],write:[]},"log-route":{read:["public_viewer","public_editor","admin"],write:["admin","public_editor"]},"metric-route":{read:["public_viewer","public_editor","admin"],write:["admin","public_editor"]},metric:{read:["public_viewer","public_editor","admin"],write:[]},trace:{read:["public_viewer","public_editor","admin"],write:[]},rum:{read:["public_viewer","public_editor","admin"],write:[]},monitor:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"monitor-alert":{read:["public_viewer","public_editor","admin"],write:[]},"monitor-debugging":{read:["admin"],write:[]},"notification-integration":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"notification-rule":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"adaptive-notification-rule":{read:["public_viewer","public_editor","admin"],write:["admin"]},"notification-silence":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"saml-config":{read:["admin"],write:["admin"]},org:{read:["public_viewer","public_editor","admin"],write:["admin"]},"allowed-domains":{read:["public_viewer","public_editor","admin"],write:["admin"]},"quality-report":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"sensitive-data-scanner-rule":{read:["public_viewer","public_editor","admin"],write:["admin"]},slo:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"retention-policy":{read:["public_viewer","public_editor","admin"],write:["admin"]},"databricks-connection":{read:["public_viewer","public_editor","admin"],write:["admin"]},service:{read:["public_viewer","public_editor","admin"],write:[]},"service-target":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},host:{read:["public_viewer","public_editor","admin"],write:[]},database:{read:["public_viewer","public_editor","admin"],write:[]},"tag-policy":{read:["public_viewer","public_editor","admin"],write:["admin"]},team:{read:["public_viewer","public_editor","admin"],write:["admin"]},"team-members":{read:["public_viewer","public_editor","admin"],write:["admin"]},"team-remap-config":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-data":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-invitation":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-permissions":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-self":{read:["public_viewer","public_editor","admin"],write:["public_viewer","public_editor","admin"]},"oauth-grant":{read:[],write:[]}},ZF={"github-connection":{read:["admin"],write:[]},investigation:{read:["viewer","editor","admin"],write:["editor","admin"]},"ingestion-api-key":{read:["viewer","editor","admin"],write:["editor","admin"]},"rum-public-token":{read:["viewer","editor","admin"],write:["editor","admin"]},"widget-share":{read:["viewer","editor","admin"],write:["viewer","editor","admin"]},"audit-log":{read:["viewer","editor","admin"],write:[]},"custom-usage-tag":{read:[],write:[]},"cluster-integration-config":{read:[],write:[]},"explorer-saved-view":{read:["viewer","editor","admin"],write:["viewer","editor","admin"]},"operation-api-key":{read:["viewer","editor","admin"],write:["admin"]},"cloud-account":{read:["viewer","editor","admin"],write:[]},dashboard:{read:["viewer","editor","admin"],write:["editor","admin"]},"dashboard-folder":{read:["viewer","editor","admin"],write:["editor","admin"]},"dashboard-report":{read:["viewer","editor","admin"],write:["editor","admin"]},inventory:{read:["viewer","editor","admin"],write:[]},log:{read:["viewer","editor","admin"],write:[]},"log-route":{read:["viewer","editor","admin"],write:["editor","admin"]},"metric-route":{read:["viewer","editor","admin"],write:["editor","admin"]},metric:{read:["viewer","editor","admin"],write:[]},trace:{read:["viewer","editor","admin"],write:[]},rum:{read:["viewer","editor","admin"],write:[]},monitor:{read:["viewer","editor","admin"],write:["editor","admin"]},"monitor-alert":{read:["viewer","editor","admin"],write:[]},"monitor-debugging":{read:["admin"],write:[]},"notification-integration":{read:["viewer","editor","admin"],write:["editor","admin"]},"notification-rule":{read:["viewer","editor","admin"],write:["editor","admin"]},"adaptive-notification-rule":{read:["viewer","editor","admin"],write:[]},"notification-silence":{read:["viewer","editor","admin"],write:["editor","admin"]},"saml-config":{read:[],write:[]},org:{read:["viewer","editor","admin"],write:[]},"allowed-domains":{read:["viewer","editor","admin"],write:[]},"quality-report":{read:["viewer","editor","admin"],write:["editor","admin"]},"sensitive-data-scanner-rule":{read:["viewer","editor","admin"],write:[]},slo:{read:["viewer","editor","admin"],write:["editor","admin"]},"retention-policy":{read:[],write:[]},"databricks-connection":{read:[],write:[]},service:{read:["viewer","editor","admin"],write:[]},"service-target":{read:["viewer","editor","admin"],write:["editor","admin"]},host:{read:["viewer","editor","admin"],write:[]},database:{read:["viewer","editor","admin"],write:[]},"tag-policy":{read:[],write:[]},team:{read:["viewer","editor","admin"],write:["admin"]},"team-members":{read:["viewer","editor","admin"],write:["admin"]},"team-remap-config":{read:[],write:[]},"user-data":{read:["viewer","editor","admin"],write:["admin"]},"user-invitation":{read:["viewer","editor","admin"],write:["admin"]},"user-permissions":{read:["viewer","editor","admin"],write:[]},"user-self":{read:["viewer","editor","admin"],write:["viewer","editor","admin"]},"oauth-grant":{read:[],write:[]}},XF={user:WF,team:ZF};function md(e){return QO(e,"team")}function dd(e){return QO(e,"user")}function QO(e,t){let n=[],o=XF[t];for(let[i,a]of Object.entries(o))for(let[c,l]of Object.entries(a))l.includes(e)&&n.push({actionType:c,resourceType:i});return n}var HPe={admin:{name:"Global admin",description:"Full control across the organization. Can view and modify everything, including private teams.",permissions:dd("admin"),roleKey:"admin"},public_editor:{name:"Public editor",description:"Can view and edit assets in public teams, but not access private teams or critical settings.",permissions:dd("public_editor"),roleKey:"public_editor"},public_viewer:{name:"Public viewer",description:"Read-only access to public team data. Cannot make changes.",permissions:dd("public_viewer"),roleKey:"public_viewer"},teams_only:{name:"Teams only",description:"Only access data and assets in their own teams.",permissions:[],roleKey:"teams_only"}},KPe={admin:{name:"Team admin",description:"Full team control, manage assets, members, and settings.",permissions:md("admin"),roleKey:"admin"},editor:{name:"Team editor",description:"Can view and update most assets (like dashboards, monitors).",permissions:md("editor"),roleKey:"editor"},viewer:{name:"Team viewer",description:"Can view all team data but cannot make changes.",permissions:md("viewer"),roleKey:"viewer"}};var zPe=new Set(pd);var JF={documentation:void 0,investigations:"investigation",logs:"log",metrics:"metric","team-membership":"team-members",traces:"trace",user:"user-data","allowed-domains":"allowed-domains","cloud-account":"cloud-account","custom-usage-tag":"custom-usage-tag",dashboard:"dashboard","dashboard-folder":"dashboard-folder","ingestion-api-key":"ingestion-api-key",inventory:"inventory","log-route":"log-route","metric-route":"metric-route",monitor:"monitor","notification-rule":"notification-rule","notification-silence":"notification-silence","quality-report":"quality-report","retention-policy":"retention-policy","rum-public-token":"rum-public-token",service:"service","service-target":"service-target",slo:"slo","tag-policy":"tag-policy",team:"team","user-invitation":"user-invitation"},eq=Object.entries(JF),YPe=new Map(eq.flatMap(([e,t])=>t?[[t,e]]:[]));var WO="__tsuga_cluster_id__",tq=r.Object({}),rq=r.Object({status:r.Literal("error"),message:r.String({description:"Why this cluster failed to answer the query."})});function ai(e=tq){let t=C("status",[r.Object({...e.properties,status:r.Literal("ok")}),rq]);return Object.assign(zc($t,t),{description:'Outcome per cluster, keyed by cluster ID. A cluster that failed reports `status: "error"`.'})}var nq=5,Ja=r.Array(u({allowEmpty:!1}),{minItems:1,maxItems:nq,uniqueItems:!0,description:"IDs of the clusters to query, without duplicates. Mutually exclusive with `clusterId`. Omit both to use the default cluster."});var ZO=r.Object({type:r.Literal("number"),number:r.String()}),oq=r.Object({type:r.Literal("string"),string:r.String()}),iq=r.Object({type:r.Literal("timestamp"),timestamp:r.String()}),es=C("type",[ZO,oq,iq]),aq=r.Object({by:r.Record(r.String(),es),computed:r.Record(r.String(),ZO)}),sq=r.Object({type:r.Literal("buckets"),buckets:r.Array(aq),clusterResponses:r.Optional(ai())}),cq=r.Object({type:r.Literal("distribution"),bounds:r.Array(r.Number()),buckets:r.Array(r.Object({timestamp:r.Number(),counts:r.Array(r.Number())})),percentiles:r.Optional(r.Array(r.Number()))}),Qp=C("type",[sq,cq]);var pq=["all","owning-team-and-public","owning-team-only"],Tn=r.Enum(pq,{description:"`all` allows the resource to query all permitted telemetry, `owning-team-and-public` limits it to the owning team plus public data, and `owning-team-only` limits it to the owning team."});var JO=1456444800,ex=4927737600,uq=JO*1e3,lq=ex*1e3,Wp=1704067200,fd=Wp*1e3,tx={title:"TimeRange",description:"Inclusive time range for telemetry queries. Use Unix timestamps in seconds unless the field description says milliseconds.",examples:[{from:Wp,to:Wp}]},mq={title:"TimeRange",description:"Inclusive time range for telemetry queries using Unix timestamps in milliseconds.",examples:[{from:fd,to:fd}]},Zp=e=>r.Integer({description:e,examples:[Wp],minimum:JO,maximum:ex,format:"int64"}),XO=e=>r.Integer({description:e,examples:[fd],minimum:uq,maximum:lq,format:"int64"}),at=r.Object({from:r.Optional(Zp("Start of the query window as a Unix timestamp in seconds")),to:r.Optional(Zp("End of the query window as a Unix timestamp in seconds"))},tx),bt=r.Object({from:Zp("Start of the query window as a Unix timestamp in seconds"),to:Zp("End of the query window as a Unix timestamp in seconds")},tx),si=r.Object({from:XO("Start of the query window as a Unix timestamp in milliseconds"),to:XO("End of the query window as a Unix timestamp in milliseconds")},mq);var gq="/v0/aggregation",hq=r.Union([r.Literal("a"),r.Literal("d"),r.Literal("q"),r.Literal("w"),r.Literal("t")]),gd=r.Object({parallelism:r.Number(),engine:hq,recordBatchCache:r.Optional(r.Boolean()),includeNullGroups:r.Optional(r.Boolean()),restartAwareGaugeSum:r.Optional(r.Boolean())}),hd=["logs","metrics","traces"];var ox={logs:"Logs",metrics:"Metrics",traces:"Spans"},yq=[...hd,"connections","log-patterns","spans","rum"];var hUe={...ox,connections:"Connections","log-patterns":"Log Patterns",spans:"Spans",rum:"RUM events"},Ir=[...hd,"rum"];var yUe={...ox,rum:"RUM events"};var TUe=r.Enum(yq,{description:"Data source being queried"}),ix=r.Enum(hd,{description:"Telemetry source queried by this aggregation: `logs`, `metrics`, or `traces`."}),or=r.Enum(Ir,{description:"Telemetry source queried by this aggregation: `logs`, `metrics`, `traces`, or `rum`."}),io=r.String({description:"Attribute containing the values to aggregate"}),ao=u({description:"Attribute containing the values to aggregate"}),Tq=C("type",[r.Object({type:r.Literal("count",{description:"Counts the total number of records"}),field:r.Optional(io)},{$id:"AggregateCount",title:"Count"}),r.Object({type:r.Literal("unique-count",{description:"Counts the distinct values of the field"}),field:io},{$id:"AggregateUniqueCount",title:"UniqueCount"}),r.Object({type:r.Literal("average",{description:"Calculates the average value of the selected field"}),field:io},{$id:"AggregateAverage",title:"Average"}),r.Object({type:r.Literal("max",{description:"Finds the largest value of the field"}),field:io},{$id:"AggregateMax",title:"Max"}),r.Object({type:r.Literal("min",{description:"Finds the smallest value of the field"}),field:io},{$id:"AggregateMin",title:"Min"}),r.Object({type:r.Literal("sum",{description:"Sums the values of the selected field"}),field:io},{$id:"AggregateSum",title:"Sum"}),r.Object({type:r.Literal("percentile",{description:"Calculates a percentile of the selected field"}),field:io,percentile:r.Number({description:"Percentile to compute for the selected field."})},{$id:"AggregatePercentile",title:"Percentile"})],{title:"Aggregate",description:"Aggregation operation for this query. Required for every query; `field` is required by all aggregate types except `count`."}),Eq=C("type",[r.Object({type:r.Literal("count",{description:"Counts the total number of records"}),field:r.Optional(ao)},{$id:"InputAggregateCount",title:"Count"}),r.Object({type:r.Literal("unique-count",{description:"Counts the distinct values of the field"}),field:ao},{$id:"InputAggregateUniqueCount",title:"UniqueCount"}),r.Object({type:r.Literal("average",{description:"Calculates the average value of the selected field"}),field:ao},{$id:"InputAggregateAverage",title:"Average"}),r.Object({type:r.Literal("max",{description:"Finds the largest value of the field"}),field:ao},{$id:"InputAggregateMax",title:"Max"}),r.Object({type:r.Literal("min",{description:"Finds the smallest value of the field"}),field:ao},{$id:"InputAggregateMin",title:"Min"}),r.Object({type:r.Literal("sum",{description:"Sums the values of the selected field"}),field:ao},{$id:"InputAggregateSum",title:"Sum"}),r.Object({type:r.Literal("percentile",{description:"Calculates a percentile of the selected field"}),field:ao,percentile:r.Number({description:"Percentile to compute for the selected field."})},{$id:"InputAggregatePercentile",title:"Percentile"})],{title:"InputAggregate",description:"Aggregation operation for this query. Required for every query; `field` is required by all aggregate types except `count`."}),ax=r.Object({type:r.Literal("per-second",{description:"Normalizes the metric to events per second"})},{$id:"FunctionPerSecond",title:"PerSecond"}),sx=r.Object({type:r.Literal("per-minute",{description:"Normalizes the metric to events per minute"})},{$id:"FunctionPerMinute",title:"PerMinute"}),cx=r.Object({type:r.Literal("per-hour",{description:"Normalizes the metric to events per hour"})},{$id:"FunctionPerHour",title:"PerHour"}),px=r.Object({type:r.Literal("rate",{description:"Calculates the rate of change"})},{$id:"FunctionRate",title:"Rate"}),ux=r.Object({type:r.Literal("increase",{description:"`Increase` is designed for cumulative metrics. It computes the increase of cumulative metrics by automatically handling counter resets. When used with an aggregation such as `sum` it combines all series without requiring an explicit group-by."})},{$id:"FunctionIncrease",title:"Increase"}),lx=r.Object({type:r.Literal("power",{description:"Raises values to a specified power"}),exponent:r.Integer({description:"The exponent to raise values to"})},{$id:"FunctionPower",title:"Power"}),mx=r.Object({type:r.Literal("sqrt",{description:"Applies a square root transformation to the values"})},{$id:"FunctionSqrt",title:"Sqrt"}),dx=r.Object({type:r.Literal("last",{description:"Takes the last value of the metric for the selected time frame"})},{$id:"FunctionLast",title:"Last"}),_q=r.Object({type:r.Literal("rolling",{description:"Computes a rolling window aggregate"}),window:r.String({description:"Duration of the rolling window"})},{$id:"FunctionRolling",title:"Rolling"}),Iq=r.Object({type:r.Literal("rolling",{description:"Computes a rolling window aggregate"}),window:u({allowEmpty:!1,description:"Duration of the rolling window"})},{$id:"InputFunctionRolling",title:"Rolling"}),bq=r.Object({type:r.Literal("log",{description:"Applies a logarithm transformation to the values"}),base:r.Integer({description:"The base of the logarithm"})},{$id:"FunctionLog",title:"Log"}),Sq=r.Object({type:r.Literal("log",{description:"Applies a logarithm transformation to the values"}),base:r.Integer({description:"The base of the logarithm",minimum:2})},{$id:"InputFunctionLog",title:"Log"}),Aq=r.Object({type:r.Literal("time-offset",{description:"Shifts a query's data backward by a specified duration for easy comparison over different periods of time."}),seconds:r.Integer({description:"Number of seconds to offset"})},{$id:"FunctionTimeOffset",title:"TimeOffset"}),Oq=r.Object({type:r.Literal("time-offset",{description:"Shifts a query's data backward by a specified duration for easy comparison over different periods of time."}),seconds:r.Integer({description:"Number of seconds to offset",minimum:1})},{$id:"InputFunctionTimeOffset",title:"TimeOffset"}),xq=C("type",[ax,sx,cx,px,ux,_q,bq,lx,mx,dx,Aq],{title:"Function",description:"Post-processing function applied to an aggregation query result after the aggregate is computed, selected by `type`."}),Rq=C("type",[ax,sx,cx,px,ux,Iq,Sq,lx,mx,dx,Oq],{title:"InputFunction",description:"Post-processing function applied to an aggregation query result after the aggregate is computed, selected by `type`."});var rx=r.Object({min:r.Number({description:"Lower bound of the distribution range."}),max:r.Number({description:"Upper bound of the distribution range."})}),Cq=["linear","log"],Xp=r.Enum(Cq,{description:"Spacing of the bucket boundaries across the distribution range. `linear` splits the range into equal-width buckets; `log` widens each bucket logarithmically, giving finer resolution near the lower bound."}),nx=r.Integer({minimum:1}),Pq=C("type",[r.Object({type:r.Literal("scalar")},{title:"Scalar",description:"Returns a single value"}),r.Object({type:r.Literal("timeseries"),aggregationWindow:u({description:'Time bucket size for aggregation (e.g. "10s", "60s", "1m")'})},{title:"Timeseries",description:"Returns a time series"}),r.Object({type:r.Literal("histogram"),by:r.Optional(u()),bucketCount:r.Optional(nx),bounds:r.Optional(rx),boundsScale:r.Optional(Xp),percentiles:r.Optional(r.Array(r.Number({minimum:0,maximum:100,multipleOf:1}),{minItems:1}))},{title:"Histogram",description:"Returns a single distribution over the entire time range"}),r.Object({type:r.Literal("heatmap"),aggregationWindow:u({description:'Time bucket size for the heatmap (e.g. "10s", "60s", "1m")'}),by:r.Optional(u()),bucketCount:r.Optional(nx),bounds:r.Optional(rx)},{title:"Heatmap",description:"Returns a distribution per time window"})]),ts=15,Uq=["zero","null"],wq=r.Enum(Uq,{description:"`zero` fills missing points with zero. `null` keeps missing points null."}),fx=r.Object({mode:r.Object({type:wq},{description:"How missing aggregation points should be filled."})},{description:"Missing-point fill behavior for aggregation results. Optional; omit to keep missing points null."}),vq=["avg","sum","min","max","last"],gx=r.Enum(vq,{description:"Per-series rollup applied within each time bucket before the cross-series aggregate. Supported only on metric queries whose `aggregate` is `sum`, and cannot be combined with the `rate`, `increase`, `last`, or `rolling` functions. When omitted, a default is derived from the metric type."});var hx={aggregate:Tq,functions:r.Optional(r.Array(xq,{description:"Post-processing functions applied to aggregation results"})),fill:r.Optional(fx),timeAggregate:r.Optional(gx)},yx={aggregate:Eq,functions:r.Optional(r.Array(Rq,{maxItems:10,description:"Post-processing functions applied to aggregation results. Defaults to an empty array when omitted."})),fill:r.Optional(fx),timeAggregate:r.Optional(gx)},Nq={description:"Aggregations that may be combined together in the same query. Each item is referenced from `formula` as q1, q2, and so on, in submission order."},Tx={maxItems:ts,description:'Aggregations that may be combined together in the same query. Each item is referenced from `formula` as q1, q2, and so on, in submission order. For dataSource "metrics", each aggregate\'s `field` is the metric name, not an attribute; to count distinct values of an attribute use unique-count with field "<metricName>.context.<attribute>" (e.g. "system.cpu.utilization.context.host.name").'},Ex=r.Array(r.Object({...hx,filter:r.Optional(r.String({description:"Filter to apply to the aggregation"}))},{title:"AggregationQuery"}),Nq),rs=r.Array(r.Object({...yx,filter:r.Optional(u({type:"tsuga-query",description:"Tsuga query filter to apply to the aggregation. Defaults to an empty string when omitted."}))},{title:"AggregationQuery"}),Tx),jr=r.Array(r.Object({...hx,filter:r.String({description:"Filter to apply to the aggregation"})},{title:"MonitorAggregationQuery",description:"Single aggregation query evaluated by a monitor or SLO."}),{description:"Aggregation queries used by alerting and SLO evaluation. Each query is referenced from formulas as q1, q2, and so on."}),En=r.Array(r.Object({...yx,filter:u({type:"tsuga-query",description:"Tsuga query filter applied to this alerting or SLO aggregation query. Required by the API; use the query language for the selected data source."})},{title:"MonitorAggregationQuery",description:"Single aggregation query evaluated by a monitor."}),{...Tx,description:"Aggregation queries used by alerting. Each query is referenced from formulas as q1, q2, and so on."}),_x=r.Array(r.Omit(En.items,["fill"],{title:"SloAggregationQuery",description:"Single aggregation query evaluated by an SLO."}),{minItems:1,maxItems:ts,description:"Aggregation queries used by SLO evaluation. Each query is referenced from formulas as q1, q2, and so on."});var Jp=r.String({description:"Formula referencing submitted query outputs, such as `q1 + q2`. References must be within `q1` through `qN` for the submitted queries."}),so=u({type:"tsuga-formula",description:"Formula referencing query outputs, such as `q1 + q2`, to compute derived results. Defaults to `q1`. Formulas may reference only submitted queries (`q1` through `qN`); undefined query references return 400."}),Lq=r.Object({fields:r.Array(r.String(),{description:"Telemetry attribute names used to group aggregation results."}),limit:r.Number({description:'Maximum number of distinct values of `fields` returned for this grouping level, ranked by aggregate value. Groups beyond the limit are truncated, not merged into an "other" group.'}),sortOrder:r.Optional(r.Enum(["asc","desc"],{description:"Sort direction applied to groups: ascending or descending."})),replaceNullWith:r.Optional(r.String({description:"Value used to group documents that have no value for a grouped field."}))},{title:"AggregationGroupBy"}),kq=r.Object({fields:r.Array(u(),{maxItems:1,description:"Telemetry attribute name to group aggregation results by. Currently limited to one field per grouping level."}),limit:r.Number({description:'Maximum number of distinct values of `fields` to return for this grouping level, ranked by aggregate value. Groups beyond the limit are truncated from the response, not merged into an "other" group.'}),sortOrder:r.Optional(r.Enum(["asc","desc"],{description:"Sort direction applied to groups: ascending or descending."})),replaceNullWith:r.Optional(u({allowEmpty:!1,description:"Value used to group documents that have no value for a grouped field."}))},{title:"AggregationGroupBy"}),Ix=7;var ci=r.Array(Lq,{description:"Nested grouping levels applied to the results, outermost first (e.g. group by service, then by level within each service). Each level splits results further, so the response contains one result per unique combination of group values."}),Fr=r.Array(kq,{maxItems:Ix,description:"Nested grouping levels applied to aggregation results, outermost first (e.g. group by service, then by level within each service). Each level splits results further, so the response contains one result per unique combination of group values instead of one aggregated total. Defaults to an empty array (one ungrouped result) when omitted."});var EUe=d({tags:["aggregation"],url:`${gq}/multi-query`,method:"POST",body:r.Object({timeRange:si,queries:rs,groupBy:r.Optional(Fr),returnType:Pq,dataSource:or,formula:so,executionOptions:gd,triggeredBy:r.Optional(r.Literal("refresh")),shouldStreamResults:r.Optional(r.Boolean()),clusterId:r.Optional(u({allowEmpty:!1})),clusterIds:r.Optional(Ja),viewAs:r.Optional(r.Object({owner:u({allowEmpty:!1,description:"Team ID to fetch data as"}),permissions:Tn}))}),response:Qp});var yd=["red","orange","amber","yellow","green","emerald","teal","cyan","sky","blue","indigo","purple","pink"],Td=["light","dark"];var Mq={light:{red:{text:"foreground.red",background:"avatar.background.red"},orange:{text:"foreground.orange",background:"avatar.background.orange"},amber:{text:"foreground.amber",background:"avatar.background.amber"},yellow:{text:"foreground.yellow",background:"avatar.background.yellow"},green:{text:"foreground.green",background:"avatar.background.green"},emerald:{text:"foreground.emerald",background:"avatar.background.emerald"},teal:{text:"foreground.teal",background:"avatar.background.teal"},cyan:{text:"foreground.cyan",background:"avatar.background.cyan"},sky:{text:"foreground.sky",background:"avatar.background.sky"},blue:{text:"foreground.blue",background:"avatar.background.blue"},indigo:{text:"foreground.indigo",background:"avatar.background.indigo"},purple:{text:"foreground.purple",background:"avatar.background.purple"},pink:{text:"foreground.pink",background:"avatar.background.pink"}},dark:{red:{text:"avatar.foreground.foreground",background:"avatar.solid-background.red"},orange:{text:"avatar.foreground.foreground",background:"avatar.solid-background.orange"},amber:{text:"avatar.foreground.foreground",background:"avatar.solid-background.amber"},yellow:{text:"avatar.foreground.foreground",background:"avatar.solid-background.yellow"},green:{text:"avatar.foreground.foreground",background:"avatar.solid-background.green"},emerald:{text:"avatar.foreground.foreground",background:"avatar.solid-background.emerald"},teal:{text:"avatar.foreground.foreground",background:"avatar.solid-background.teal"},cyan:{text:"avatar.foreground.foreground",background:"avatar.solid-background.cyan"},sky:{text:"avatar.foreground.foreground",background:"avatar.solid-background.sky"},blue:{text:"avatar.foreground.foreground",background:"avatar.solid-background.blue"},indigo:{text:"avatar.foreground.foreground",background:"avatar.solid-background.indigo"},purple:{text:"avatar.foreground.foreground",background:"avatar.solid-background.purple"},pink:{text:"avatar.foreground.foreground",background:"avatar.solid-background.pink"}},gradient:{red:"var(--chakra-colors-gradient-red)",orange:"var(--chakra-colors-gradient-orange)",amber:"var(--chakra-colors-gradient-amber)",yellow:"var(--chakra-colors-gradient-yellow)",green:"var(--chakra-colors-gradient-green)",emerald:"var(--chakra-colors-gradient-emerald)",teal:"var(--chakra-colors-gradient-teal)",cyan:"var(--chakra-colors-gradient-cyan)",sky:"var(--chakra-colors-gradient-sky)",blue:"var(--chakra-colors-gradient-blue)",indigo:"var(--chakra-colors-gradient-indigo)",purple:"var(--chakra-colors-gradient-purple)",pink:"var(--chakra-colors-gradient-pink)"}},bx=["activity-heart","activity","airplay","airpods","alarm-clock","anchor","annotation-dots","annotation-heart","annotation-question","annotation","announcement-03","asterisk-01","atom-01","atom-02","award-03","award-04","award-05","backpack","bank-note-01","bank-note-02","bank-note-03","battery-charging-01","beaker-01","beaker-02","bell-03","bell-04","bell-ringing-03","bell-ringing-04","bluetooth-connect","bluetooth-on","book-closed","book-open-01","book-open-02","bookmark","briefcase-01","briefcase-02","brush-01","brush-02","brush-03","building-01","building-02","building-03","building-08","bus","calculator","calendar-check-01","calendar-date","calendar-heart-01","calendar","camera-01","camera-lens","car-01","certificate-01","certificate-02","check-heart","clipboard-attachment","clipboard-check","clipboard-download","clipboard","clock-snooze","clock-stopwatch","cloud-01","cloud-lightning","cloud-moon","cloud-raining-01","cloud-raining-03","cloud-raining-05","cloud-raining-06","cloud-snowing-01","cloud-sun-01","cloud-sun-02","cloud-sun-03","code-browser","code-circle-01","code-circle-02","code-circle-03","code-square-01","code-square-02","coins-hand","coins-stacked-01","colors","compass-01","compass-02","compass-03","compass","credit-card-01","credit-card-02","cube-02","cube-04","cube-outline","currency-bitcoin-circle","currency-dollar-circle","currency-ethereum-circle","currency-euro-circle","currency-pound-circle","currency-ruble-circle","currency-rupee-circle","currency-yen-circle","cursor-click-01","cursor-click-02","diamond-01","diamond-02","dice-1","dice-2","dice-3","dice-4","dice-5","dice-6","disc-01","disc-02","droplets-01","droplets-02","droplets-03","dropper","face-content","face-frown","face-happy","face-neutral","face-sad","face-smile","face-wink","feather","file-02","file-05","file-06","file-heart-01","file-heart-02","file-search-01","file-search-02","file-search-03","film-01","film-02","fingerprint-03","fingerprint-04","flag-01","flag-04","flash-off","flash","gaming-pad-01","gaming-pad-02","gift-01","glasses-01","glasses-02","globe-03","globe-04","globe-05","globe-06","globe-slated-01","globe-slated-02","graduation-hat-01","graduation-hat-02","hash-01","hash-02","headphones-01","headphones-02","heart-circle","heart-hand","heart-hexagon","heart-octagon","heart-rounded","heart-square","hearts","hexagon-01","hexagon-02","home-03","home-smile","hourglass-01","hourglass-02","hourglass-03","hurricane-01","hurricane-02","hurricane-03","image-01","image-02","image-03","image-04","image-05","keyboard-01","laptop-01","life-buoy-01","life-buoy-02","lightbulb-02","lightbulb-03","lightbulb-04","lock-keyhole-circle","lock-keyhole-square","luggage-01","luggage-02","luggage-03","magic-wand-01","magic-wand-02","map-01","map-02","mark","marker-pin-01","marker-pin-04","marker-pin-05","marker-pin-06","medical-circle","medical-cross","medical-square","message-chat-square","message-notification-square","message-smile-square","message-text-square-02","microphone-01","microphone-02","microscope","modem-01","modem-02","monitor-03","monitor-04","monitor-05","moon-01","moon-eclipse","moon-star","music-note-01","music-note-02","music-note-plus","octagon","palette","paperclip","pentagon","phone-01","phone-02","phone-call-01","phone","piggy-bank-01","pin-01","pin-02","plane","play-circle","play-square","podcast","power-02","presentation-chart-01","printer","receipt","recording-01","recording-02","recording-03","rocket-01","rocket-02","roller-brush","rss-01","rss-02","ruler","scales-01","scales-02","server-06","shield-01","shield-02","shield-03","shield-dollar","shield-zap","shopping-bag-01","shopping-cart-01","signal-01","signal-02","signal-03","simcard","sliders-01","sliders-02","snowflake-01","snowflake-02","speaker-01","speaker-02","speaker-03","speedometer-01","speedometer-02","speedometer-03","speedometer-04","square","stand","star-03","star-07","sticker-circle","sticker-square","sun-setting-01","sun-setting-02","sun-setting-03","sun","sunrise","sunset","tablet-01","tag-01","tag-02","tag-03","target-01","target-02","target-03","target-04","target-05","terminal-browser","terminal-circle","terminal-square","thermometer-02","thermometer-03","thermometer-cold","thermometer-warm","thumbs-down","thumbs-up","ticket-01","tool-01","tool-02","train","tram","translate-01","triangle","trophy-01","trophy-02","truck-01","truck-02","tv-02","umbrella-01","umbrella-02","umbrella-03","virus","voicemail","wallet-01","wallet-02","wallet-05","watch-circle","watch-square","waves","webcam-01","webcam-02","wind-01","wind-02","wind-03","youtube","zap-circle","zap-fast","zap"];var OUe=Mq.light.red.background;var Ed=2,_d=2;var Sx=[{key:"amex15_digits",name:"American Express card (1x15 digits)",category:"financial-data",example:"378282246310005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"amex4443_digits",name:"American Express card (4+4+4+3 digits)",category:"financial-data",example:"3782 8224 6310 005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"amex465_digits",name:"American Express card (4+6+5 digits)",category:"financial-data",example:"3782 822463 10005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"amex87_digits",name:"American Express card (8+7 digits)",category:"financial-data",example:"37828224 6310005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card14_digits",name:"Diners card (1x14 digits)",category:"financial-data",example:"30569309025904",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card4442_digits",name:"Diners card (4+4+4+2 digits)",category:"financial-data",example:"3056 9309 0259 04",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card464_digits",name:"Diners card (4+6+4 digits)",category:"financial-data",example:"3056 930902 5904",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card86_digits",name:"Diners card (8+6 digits)",category:"financial-data",example:"30569309 025904",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"discover_card16_digits",name:"Discover card (1x16 digits)",category:"financial-data",example:"6011111111111117",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"discover_card88_digits",name:"Discover card (2x8 digits)",category:"financial-data",example:"60111111 11111117",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"discover_card4444_digits",name:"Discover card (4x4 digits)",category:"financial-data",example:"6011 1111 1111 1117",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"jcb_card16_digits",name:"JCB card (1x16 digits)",category:"financial-data",example:"3530111333300000",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"jcb_card88_digits",name:"JCB card (2x8 digits)",category:"financial-data",example:"35301113 33300000",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"jcb_card4444_digits",name:"JCB card (4x4 digits)",category:"financial-data",example:"3530 1113 3330 0000",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"maestro_card16_digits",name:"Maestro card (1x16 digits)",category:"financial-data",example:"6759649826438453",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"maestro_card88_digits",name:"Maestro card (2x8 digits)",category:"financial-data",example:"67596498 26438453",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"maestro_card4444_digits",name:"Maestro card (4x4 digits)",category:"financial-data",example:"6759 6498 2643 8453",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"mastercard16_digits",name:"Mastercard (1x16 digits)",category:"financial-data",example:"5555555555554444",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"mastercard88_digits",name:"MasterCard (2x8 digits)",category:"financial-data",example:"55555555 55554444",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"mastercard4444_digits",name:"MasterCard (4x4 digits)",category:"financial-data",example:"5555 5555 5555 4444",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa16_digits",name:"Visa (1x16 digits)",category:"financial-data",example:"4111111111111111",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa19_digits",name:"Visa (1x19 digits)",category:"financial-data",example:"4111111111111111151",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa88_digits",name:"Visa (2x8 digits)",category:"financial-data",example:"41111111 11111111",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa883_digits",name:"Visa (8+8+3 digits)",category:"financial-data",example:"41111111 11111111 151",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa4444_digits",name:"Visa (4x4 digits)",category:"financial-data",example:"4111 1111 1111 1111",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa44443_digits",name:"Visa (4+4+4+4+3 digits)",category:"financial-data",example:"4111 1111 1111 1111 151",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"dropbox_long_lived_api_token",name:"Dropbox long lived API token",category:"credential",example:"767cb868836AAAAAAAAAAszri2cnmzu5tr0yf-nvclmwfyiswl67qyqw-uzn-scg",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:[a-z0-9]{11}(AAAAAAAAAA)[a-z0-9\\-_=]{43})"},{key:"dropbox_short_lived_api_token",name:"Dropbox short lived API token",category:"credential",example:"sl.nu0yvsrposcjeyjcpmbfrmqygllrxpahrgbt8flml9xroifbic",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:sl\\.[a-z0-9\\-=_]{50})"},{key:"french_nirpp",name:"French social security number (NIRPP)",category:"personal-information",example:"188073512757119",isUsingLuhnAlgorithm:!1,regexp:"([12])\\s*[0-9]{2}\\s*(0[1-9]|1[0-2])\\s*(2[AB]|[0-9]{2})\\s*([0-9]{3})\\s*([0-9]{3})(\\s*[0-9]{2})?"},{key:"ip_address",name:"IP address",category:"device-identifier",example:"81.55.13.53",isUsingLuhnAlgorithm:!1,regexp:""},{key:"social_security_number",name:"Social security number (XXX-XX-XXXX)",category:"personal-information",example:"437-02-2223",isUsingLuhnAlgorithm:!1,regexp:"(?x)(?-u:\\b)(?:00[1-9]|0[1-9][0-9]|[1-578][0-9]{2}|6[0-57-9][0-9]|66[0-57-9])-(?:0[1-9]|[1-9]0|[1-9][1-9])-(?:000[1-9]|00[1-9]0|0[1-9]00|[1-9]000|[1-9]{4})(?-u:\\b)"},{key:"social_security_number_space",name:"Social security number (XXX XX XXXX)",category:"personal-information",example:"437 02 2223",isUsingLuhnAlgorithm:!1,regexp:"(?x)(?-u:\\b)(?:00[1-9]|0[1-9][0-9]|[1-578][0-9]{2}|6[0-57-9][0-9]|66[0-57-9])\\s+(?:0[1-9]|[1-9]0|[1-9][1-9])\\s+(?:000[1-9]|00[1-9]0|0[1-9]00|[1-9]000|[1-9]{4})(?-u:\\b)"},{key:"social_security_number_digits",name:"Social security number (9 digits)",category:"personal-information",example:"437022223",isUsingLuhnAlgorithm:!1,regexp:"(?x)(?-u:\\b)(?:00[1-9]|0[1-9][0-9]|[1-578][0-9]{2}|6[0-57-9][0-9]|66[0-57-9])(?:0[1-9]|[1-9]0|[1-9][1-9])(?:000[1-9]|00[1-9]0|0[1-9]00|[1-9]000|[1-9]{4})(?-u:\\b)"},{key:"email",name:"Email",category:"credential",example:"admin@tsuga.com",isUsingLuhnAlgorithm:!1,regexp:"[a-zA-Z0-9-_.]*[a-zA-Z0-9_](@[a-zA-Z0-9_]+)(\\.[a-zA-Z0-9_]+(\\.[a-zA-Z0-9_]+)?[a-zA-Z])(?-u:\\b)"},{key:"one_password_secret_key",name:"1Password secret key",category:"credential",example:"A3-O28NKC-F58GULWCN72-4NIKS-KGY7V-U7FAT",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)A3-[A-Z0-9]{6}-(?:(?:[A-Z0-9]{11})|(?:[A-Z0-9]{6}-[A-Z0-9]{5}))-[A-Z0-9]{5}-[A-Z0-9]{5}-[A-Z0-9]{5}(?-u:\\b)"},{key:"one_password_service_account_token",name:"1Password service account token",category:"credential",example:"ops_eyJdAZ/FoIyz0jAXpEQOrRdIE8ydVaYfAXeZXGFqHWfBOjnE/Vgf5kHIbwrNAp2WeFNPeFiVJPlLv1hmaTVums0ldq1Kv8JEglMqP3f0ATBuX/WRbKqXYS3Z1wSzxg6S0krW4df7ZplvK04+JhJimejyTEH5dYaxqsYDBSLxjeEq7JWsmHEuXj6WP5qQi7FB+5s+CwhWPWY/jDhUMB3fdowXbfv5VnWri3iYrfBh+bFeRe9KURhXGHRDE9hgs",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ops_eyJ[a-zA-Z0-9+/]{50}"},{key:"adafruit_api_key",name:"Adafruit API key",category:"credential",example:"jb9pb4unb2bhe7xqepmgwtl2jg7ti101",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{32})"},{key:"adobe_client_id",name:"Adobe client ID",category:"credential",example:"c4166853dfd2897ebe706d49ef13fe63",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"adobe_client_secret",name:"Adobe client secret",category:"credential",example:"p8e-bb6e1614324ae48e507d33af176db3b7",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:p8e-[a-z0-9]{32})"},{key:"age_secret_key",name:"Age secret key",category:"credential",example:"AGE-SECRET-KEY-1QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)AGE-SECRET-KEY-1[QPZRY9X8GF2TVDW0S3JN54KHCE6MUA7L]{58}"},{key:"airtable_api_key",name:"Airtable API key",category:"credential",example:"19b73hbi0tc5cdy4w",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{17})"},{key:"algolia_api_key",name:"Algolia API key",category:"credential",example:"346155deb68d31c4018d73de73452947",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"alibaba_access_key_id",name:"Alibaba Cloud AccessKey ID",category:"credential",example:"LTAI7cc6804e4c2155cd52bd",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:LTAI[a-z0-9]{20})"},{key:"alibaba_secret_key",name:"Alibaba Cloud secret key",category:"credential",example:"suwixirhh10xhnko9bv0vfg2971u9p",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{30})"},{key:"anthropic_admin_api_key",name:"Anthropic admin API key",category:"credential",example:"sk-ant-admin01-abc12fake-456def789ghij-klmnopqrstuvwx-3456yza789bcde-12fakehijklmnopby56aaaogaopaaaabc123xyzAA",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sk-ant-admin01-[a-zA-Z0-9_-]{93}AA)"},{key:"anthropic_api_key",name:"Anthropic API key",category:"credential",example:"sk-ant-api03-abc123xyz-456def789ghij-klmnopqrstuvwx-3456yza789bcde-1234fghijklmnopby56aaaogaopaaaabc123xyzAA",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sk-ant-api03-[a-zA-Z0-9_-]{93}AA)"},{key:"artifactory_api_key",name:"Artifactory API key",category:"credential",example:"AKCpt771klpkqllt647fdf36fq43radbz2w2nyetvx4l90qyeef8kbgkmke63ul5vf6mqsy82",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)AKCp[A-Za-z0-9]{69}(?-u:\\b)"},{key:"artifactory_reference_token",name:"Artifactory reference token",category:"credential",example:"cmVmdc6i6888t9viuobfd88e46pdonjjsvmme6np82qti7wzbj7l9m1ygtyl9wik",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)cmVmd[A-Za-z0-9]{59}(?-u:\\b)"},{key:"asana_client_id",name:"Asana client ID",category:"credential",example:"9760134337886314",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9]{16})"},{key:"asana_client_secret",name:"Asana client secret",category:"credential",example:"tcnc8mjrf5bad359nnz3j1z90gow67ji",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"atlassian_api_token",name:"Atlassian API token",category:"credential",example:"fdo4scsa4kh53jnenkfp5fbe",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:[a-z0-9]{20}[a-f0-9]{4})|(?-u:\\b)(?:ATATT3[A-Za-z0-9_-=]{50})"},{key:"authress_service_client_access_key",name:"Authress service client access key",category:"credential",example:"sc_scmz00n9xj.0ykp.acc_2k5vtnrec4.55vc9459s-gc5qlia7a67jvzm0bobn3g0ezimd3b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:sc|ext|scauth|authress)_[a-z0-9]{5,30}\\.[a-z0-9]{4,6}\\.(?-i:acc)[_-][a-z0-9-]{10,32}\\.[a-z0-9+/_=-]{30})"},{key:"aws_access_token",name:"AWS access token",category:"credential",example:"AKIALALEMEL33243OLIB",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:A3T[A-Z0-9]|AKIA|ASIA|ABIA|ACCA)[A-Z2-7]{16})(?-u:\\b)"},{key:"azure_ad_client_secret",name:"Azure AD client secret",category:"credential",example:"bP88Q~rcBcYjzzOhg1Hnn76Wm3jGgakZiZ.8vMgR",isUsingLuhnAlgorithm:!1,regexp:"(?:^|[\\\\'\"` \\r\\n\\t\\f\\v>=:(?:,)])(?:[a-zA-Z0-9_~.]{3}[0-9]Q~[a-zA-Z0-9_~.-]{31,34})(?:$|[\\\\'\"` \\r\\n\\t\\f\\v<),])"},{key:"bitbucket_client_id",name:"Bitbucket client ID",category:"credential",example:"yyxmjnl3kahirvct7sat2082pzqdyf09",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"bitbucket_client_secret",name:"Bitbucket client secret",category:"credential",example:"fylw1pominwz91e5guqjiugw6srutpl64vzch5rnt8xnt31ka7so9va73fscz836",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{64})"},{key:"beamer_api_token",name:"Beamer API token",category:"credential",example:"b_zhy-phuoqk13asco6az4u_0yhtklgswm4umkv95nv4gu",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:b_[a-z0-9=_\\-]{44})"},{key:"codecov_access_token",name:"Codecov access token",category:"credential",example:"r93iopllonuphk41qglet20y8cb83thm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"clickhouse_cloud_api_secret_key",name:"ClickHouse Cloud API secret key",category:"credential",example:"4b1dbRdW3rOcB7xLthrM4BTBGK1qPLkHigpN1bXD6z",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:4b1d[A-Za-z0-9]{38})(?-u:\\b)"},{key:"clojars_api_token",name:"Clojars API token",category:"credential",example:"CLOJARS_d1vd7t0blxaarzx25dxoda4hm5ox86st6o5ww7tnzsfz07wvu223bf0fmgim",isUsingLuhnAlgorithm:!1,regexp:"CLOJARS_[a-z0-9]{60}"},{key:"cloudflare_api_key",name:"Cloudflare API key",category:"credential",example:"ckg0h_dzkxnl627gy3nskpq9wzm4d5hc_vxk272h",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{40})"},{key:"cloudflare_global_api_key",name:"Cloudflare global API key",category:"credential",example:"1d003bb65ec73ad2691fb76631b6496e3c9d9",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{37})"},{key:"cloudflare_origin_ca_key",name:"Cloudflare Origin CA key",category:"credential",example:"v1.0-aaa334dc886f30631ba0a610-0d98ef66290d7e50aac7c27b5986c99e6f3f1084c881d8ac0eae5de1d1aa0644076ff57022069b3237d19afe60ad045f207ef2b16387ee37b749441b2ae2e9ebe5b4606e846475d4a5",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:v1\\.0-[a-f0-9]{24}-[a-f0-9]{50})"},{key:"cohere_api_token",name:"Cohere API token",category:"credential",example:"lpn59BQ4FNUabVJh1vCpIqZpQbaViELQrTa14p9D",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:[a-zA-Z0-9]{40})"},{key:"confluent_access_token",name:"Confluent access token",category:"credential",example:"kkat92sclkukwvr2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{16})"},{key:"confluent_secret_key",name:"Confluent secret key",category:"credential",example:"64d4ppp37l9fjhadm8vv0awie6wjo4d6ourfcqvi2bcs2tm95x4f0e8gyb8z8usj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"contentful_delivery_api_token",name:"Contentful delivery API token",category:"credential",example:"eumospigka64wiwpavfmmblrq7x1hm6gz84wiiw2ff3",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{43})"},{key:"curl_auth_header",name:"Curl authorization header",category:"credential",example:"curl --header 'Authorization: 5eb4223e-5008-46e5-be67-c7b8f2732305'",isUsingLuhnAlgorithm:!1,regexp:`(?-u:\\b)curl(?-u:\\b)(?:.*?|.*?(?:[\\r\\n]{1,2}.*?){1,5})[ \\t\\n\\r](?:-H|--header)(?:=|[ \\t]{0,5})(?:"(?:Authorization:[ \\t]{0,5}(?:Basic[ \\t](?:[a-z0-9+/]{8,}={0,3})|(?:Bearer|(?:Api-)?Token)[ \\t](?:[a-zA-Z0-9_=~@.+/-]{8,})|(?:[a-zA-Z0-9_=~@.+/-]{8,}))|(?:(?:X-(?:[a-z]+-)?)?(?:Api-?)?(?:Key|Token)):[ \\t]{0,5}(?:[a-zA-Z0-9_=~@.+/-]{8,}))"|'(?:Authorization:[ \\t]{0,5}(?:Basic[ \\t](?:[a-z0-9+/]{8,}={0,3})|(?:Bearer|(?:Api-)?Token)[ \\t](?:[a-zA-Z0-9_=~@.+/-]{8,})|(?:[a-zA-Z0-9_=~@.+/-]{8,}))|(?:(?:X-(?:[a-z]+-)?)?(?:Api-?)?(?:Key|Token)):[ \\t]{0,5}(?:[a-zA-Z0-9_=~@.+/-]{8,}))')(?:(?-u:\\B)|[ \\r\\n\\t\\f\\v]|\\z)`},{key:"curl_auth_user",name:"Curl basic authentication",category:"credential",example:"curl -u elastic:P@ssw0rd$1",isUsingLuhnAlgorithm:!1,regexp:`(?-u:\\b)curl(?-u:\\b)(?:.*|.*(?:[\\r\\n]{1,2}.*){1,5})[ \\t\\n\\r](?:-u|--user)(?:=|[ \\t]{0,5})(?:"(:[^"]{3,}|[^:"]{3,}:|[^:"]{3,}:[^"]{3,})"|'(?:[^:']{3,}:[^']{3,})'|(?:(?:"[^"]{3,}"|'[^']{3,}'|[a-zA-Z0-9_$@.-]+):(?:"[^"]{3,}"|'[^']{3,}'|[a-zA-Z0-9_\${}@.-]+)))(?:[ \\r\\n\\t\\f\\v]|\\z)`},{key:"databricks_api_token",name:"Databricks API token",category:"credential",example:"dapia2553f815d29a193fd09c2bb55201895",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:dapi[a-f0-9]{32}(?:-[0-9])?)"},{key:"datadog_access_token",name:"Datadog access token",category:"credential",example:"ljgbhjnca2hy5yc2nv7cag1ag7ehx2hc6geparov",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{40})"},{key:"defined_networking_api_token",name:"Defined Networking API token",category:"credential",example:"dnkey-nowf_nwyqhvqt1gi66xnuuf2rb-bfxnr9_qydyxnxn1y8uijvhhp9owllbg-2czoe-7qs5_w5650xei",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:-[a-z0-9=_\\-]{26}-[a-z0-9=_\\-]{52})"},{key:"digitalocean_pat",name:"DigitalOcean personal access token",category:"credential",example:"dop_v1_ec8f4a856c1459bd442a275461e2f709506347de30b180851cde71f696e9fcc8",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:dop_v1_[a-f0-9]{64})"},{key:"digitalocean_access_token",name:"DigitalOcean OAuth access token",category:"credential",example:"doo_v1_42b8ea6c4b0c373f88aff9d3fa87e123ab23b0d3c22ac6d4361a4e9c1e89eaa6",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:doo_v1_[a-f0-9]{64})"},{key:"digitalocean_refresh_token",name:"DigitalOcean OAuth refresh token",category:"credential",example:"dor_v1_4d9b3e6fbe65ab472e464dfa6377d702e80164442acdfbeb3ef032d917cb9984",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:dor_v1_[a-f0-9]{64})"},{key:"discord_api_token",name:"Discord API token",category:"credential",example:"7eb855d9a40747182d0b0ea74df27aee31d05756a9933a815a3ccb5a46b2d61d",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{64})"},{key:"discord_client_id",name:"Discord client ID",category:"credential",example:"763721114261247538",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9]{18})"},{key:"discord_client_secret",name:"Discord client secret",category:"credential",example:"13641266018325206246161633988007",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{32})"},{key:"doppler_api_token",name:"Doppler API token",category:"credential",example:"dp.pt.vgin8wwjy7sx66fyq99tavkm3y5g2jdxmsufh257dhj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)dp\\.pt\\.[a-z0-9]{43}"},{key:"dropbox_api_token",name:"Dropbox API token",category:"credential",example:"rdlztoij88rzrsk",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{15})"},{key:"droneci_access_token",name:"DroneCI access token",category:"credential",example:"v26gffr903rbti5v7m392ba0u7oarz36",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"duffel_api_token",name:"Duffel API token",category:"credential",example:"duffel_test_-yd6b3pc4jy593pt5kr2l3ynzkb5b_f619dshefiz=v",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)duffel_(?:test|live)_[a-z0-9_\\-=]{43}"},{key:"dynatrace_api_token",name:"Dynatrace API token",category:"credential",example:"dt0c01.ben820rdpb1so4kasfx3yn4a.zkje7lawif35udsin5t1mi1m1sne7wdzphlzrmdnu3j69gr4kgf5dwg4x5lb30zg",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)dt0c01\\.[a-z0-9]{24}\\.[a-z0-9]{64}"},{key:"easypost_api_token",name:"EasyPost API token",category:"credential",example:"EZAKBVScDZwZFv0nJXHBcxPGil7eztnPJOSmDFf2NGKQk6Dn7VqULciSRm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)EZAK[a-z0-9]{54}(?-u:\\b)"},{key:"easypost_test_api_token",name:"EasyPost test API token",category:"credential",example:"EZTKuxUXVU5HBS1K2iyh165t3VtivpdxMgIf5Y2P1oJxeFeaJGcwzVexds",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)EZTK[a-z0-9]{54}(?-u:\\b)"},{key:"etsy_access_token",name:"Etsy access token",category:"credential",example:"8ssp35lhprxpb3sjyergcz5z",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{24})"},{key:"facebook_secret",name:"Facebook secret",category:"credential",example:"c41c21ba4fb5ee05398db86ca83f06db",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"facebook_access_token",name:"Facebook access token",category:"credential",example:"911602140448729|AY-lRJZq9BoDLobvAiP25L7RcMg",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:[0-9]{15,16}(\\||%)[0-9a-z\\-_]{27,40})"},{key:"facebook_page_access_token",name:"Facebook page access token",category:"credential",example:"EAAM9GOnCB9kBO2frzOAWGN2zMnZClQshlWydZCrBNdodesbwimx1mfVJgqZBP5RSpMfUzWhtjTTXHG5I1UlvlwRZCgjm3ZBVGeTYiqAAoxyED6HaUdhpGVNoPUwAuAWWFsi9OvyYBQt22DGLqMIgD7VktuCTTZCWKasz81Q822FPhMTB9VFFyClNzQ0NLZClt9zxpsMMrUZCo1VU1rL3CKavir5QTfBjfCEzHNlWAUDUV2YZD",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:EAA[MC][a-z0-9]{50})"},{key:"fastly_api_token",name:"Fastly API token",category:"credential",example:"im7_ux24tyyxz_4y4mvzj22akpid830c",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{32})"},{key:"finicity_client_secret",name:"Finicity client secret",category:"credential",example:"roepymyr0ce7wxhjvgb2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{20})"},{key:"finicity_api_token",name:"Finicity API token",category:"credential",example:'= "cce089057c8b7fe7f2a8474b9a050816',isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"flickr_access_token",name:"Flickr access token",category:"credential",example:"damvt93tudulk6wrfp36sawndc9pa7bb",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"finnhub_access_token",name:"Finnhub access token",category:"credential",example:"x01lnfp13spcbsa0at32",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{20})"},{key:"flutterwave_public_key",name:"Flutterwave public key",category:"credential",example:"FLWPUBK_TEST-99484d505b4ee5c1181a2884f5fe3852-X",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)FLWPUBK_TEST-[a-h0-9]{32}-X"},{key:"flutterwave_secret_key",name:"Flutterwave secret key",category:"credential",example:"FLWSECK_TEST-66187ac83488c2245f0d7e95fa37e833-X",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)FLWSECK_TEST-[a-h0-9]{32}-X"},{key:"flutterwave_encryption_key",name:"Flutterwave encryption key",category:"credential",example:"FLWSECK_TEST-6262214a02e7",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)FLWSECK_TEST-[a-h0-9]{12}"},{key:"flyio_access_token",name:"Fly.io access token",category:"credential",example:"fo1_m-HT0NHLBSPwMJ2hIer4v3lxtWEC7grXNidQxJMrVVE",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:fo1_[a-zA-Z0-9_-]{43}|fm1[ar]_[a-zA-Z0-9+\\/]{50}))"},{key:"frameio_api_token",name:"Frame.io API token",category:"credential",example:"fio-u-4ov9vjtr2wwj8j1gob-8xrx2-1=z818psmitskgoq4=p-_k77d54034z55xk-lqh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)fio-u-[a-z0-9\\-_=]{64}"},{key:"freshbooks_access_token",name:"FreshBooks access token",category:"credential",example:"gqw118uwne1nddlt4yruvvs4jr9s0vrj5mxaswgb2amacod8lgnmrknsvbovsx1g",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"gocardless_api_token",name:"GoCardless API token",category:"credential",example:"live_-z4lwtrrk6p6=-v1ig_y_4ceplziwek0lw=oz-eu",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:live_[a-z0-9\\-_=]{40})"},{key:"gcp_api_key",name:"GCP API key",category:"credential",example:"AIzaYpvGqEzpgB7R353HD9CxN8LuhZ6d6UfuXLL",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:AIza[a-zA-Z0-9_-]{35})"},{key:"github_pat",name:"GitHub personal access token",category:"credential",example:"ghp_t7i9llxuukeb7apn4zlnyeyz5b0007rsfs54",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ghp_[0-9a-zA-Z]{36}"},{key:"github_fine_grained_pat",name:"GitHub fine-grained personal access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)github_pat_[a-zA-Z0-9_]{82}"},{key:"github_oauth",name:"GitHub OAuth token",category:"credential",example:"gho_anlrm6zqscqityoqozv503by66dobnem4yxh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)gho_[0-9a-zA-Z]{36}"},{key:"github_app_token",name:"GitHub app token",category:"credential",example:"ghs_0zleityj4n1ulz178o9in1w97q1ifw8u3y8h",isUsingLuhnAlgorithm:!1,regexp:"(?:ghu|ghs)_[0-9a-zA-Z]{36}"},{key:"github_refresh_token",name:"GitHub refresh token",category:"credential",example:"ghr_inu1aa7qbgi46cf8nprbgh4kn03d0zk35raj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ghr_[0-9a-zA-Z]{36}"},{key:"gitlab_cicd_job_token",name:"GitLab CI/CD job token",category:"credential",example:"glcbt-7h2nr_6jmho0uoqkb1ww431kfl",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glcbt-[0-9a-zA-Z]{1,5}_[0-9a-zA-Z_-]{20}"},{key:"gitlab_deploy_token",name:"GitLab deploy token",category:"credential",example:"gldt-7a3o70gqa8zkal0zdp4x",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)gldt-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_feature_flag_client_token",name:"GitLab feature flag client token",category:"credential",example:"glffct-dsct62ndnvcj7alw5nas",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glffct-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_feed_token",name:"GitLab feed token",category:"credential",example:"glft-13956nvy00289v6xu0di",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glft-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_incoming_mail_token",name:"GitLab incoming mail token",category:"credential",example:"glimt-fcdt1a5jvj01si61jgkse2r20",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glimt-[0-9a-zA-Z_\\-]{25}"},{key:"gitlab_kubernetes_agent_token",name:"GitLab Kubernetes agent token",category:"credential",example:"glagent-8wxkulkbbuk7u6r3nvrefswdfw5o0v7vy81y4oky8rnfogm826",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glagent-[0-9a-zA-Z_\\-]{50}"},{key:"gitlab_oauth_app_secret",name:"GitLab OAuth app secret",category:"credential",example:"gloas-vawws2nw5kf6rizn49g41jc3jiy4xqioaihrwm1msltbdt4cbmo4x52tygcic7af",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)gloas-[0-9a-zA-Z_\\-]{64}"},{key:"gitlab_pat",name:"GitLab personal access token",category:"credential",example:"glpat-2gl3ku1497ms4gzyv16i",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glpat-[a-zA-Z0-9_-]{20}"},{key:"gitlab_pat_routable",name:"GitLab personal access token (routable)",category:"credential",example:"glpat-2hf7vebpux9j56tdcqqsvap7vxc.chvjof35u",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glpat-[0-9a-zA-Z_-]{27}\\.[0-9a-z]{2}[0-9a-z]{7}(?-u:\\b)"},{key:"gitlab_ptt",name:"GitLab personal access token (temporary)",category:"credential",example:"glptt-b54e8b7b90cf006b79af110baa9b8d9183fd7048",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glptt-[0-9a-f]{40}"},{key:"gitlab_rrt",name:"GitLab registration token",category:"credential",example:"GR1348941vnauzmn2hj0zncvt0nfe",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)GR1348941[a-zA-Z0-9_-]{20}"},{key:"gitlab_runner_authentication_token",name:"GitLab runner authentication token",category:"credential",example:"glrt-xbd1w7c9clbxm52zdxkm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glrt-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_runner_authentication_token_routable",name:"GitLab runner authentication token (routable)",category:"credential",example:"glrt-t5_8d8ugbkfzddae0dw06tvm0x7qxc.mwcd1a7cn",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glrt-t[0-9]_[0-9a-zA-Z_\\-]{27}\\.[0-9a-z]{2}[0-9a-z]{7}(?-u:\\b)"},{key:"gitlab_scim_token",name:"GitLab SCIM token",category:"credential",example:"glsoat-9jb5zk1nvy800c1uqhh0",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glsoat-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_session_cookie",name:"GitLab session cookie",category:"credential",example:"_gitlab_session=yjhub6vtrp60djn6rszuemeacsoqox97",isUsingLuhnAlgorithm:!1,regexp:"_gitlab_session=[0-9a-z]{32}"},{key:"gitter_access_token",name:"Gitter access token",category:"credential",example:"uazubes6trcd_1gym09opuf_8gj1rmvj6jwber4a",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{40})"},{key:"grafana_api_key",name:"Grafana API key",category:"credential",example:"eyJrIjoiyl5shjvqja0xkfbu38m24vn5httsipr1h9fgjhodxzlkpravuiy8h7hom5kt8gtwuguh2v",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:eyJrIjoi[A-Za-z0-9]{70}={0,3})"},{key:"grafana_cloud_api_token",name:"Grafana cloud API token",category:"credential",example:"glc_cb7p4j2g1qu0sy84me72ufmn1z8mqk8y",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:glc_[A-Za-z0-9+/]{32}={0,3})"},{key:"grafana_service_account_token",name:"Grafana service account token",category:"credential",example:"glsa_rm3sadbwl8o2c13v4ipgkz04h66kiy6t_edaea401",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:glsa_[A-Za-z0-9]{32}_[A-Fa-f0-9]{8})"},{key:"harness_api_key",name:"Harness API key",category:"credential",example:"pat.vzcxr183pymw194fdq1q0v.qjqjarqkd9ydxqagjmq3f5iq.8nn5nyaow3h5mmgjh053",isUsingLuhnAlgorithm:!1,regexp:"(?:pat|sat)\\.[a-zA-Z0-9_-]{22}\\.[a-zA-Z0-9]{24}\\.[a-zA-Z0-9]{20}"},{key:"hashicorp_tf_api_token",name:"HashiCorp Terraform API token",category:"credential",example:"984d8033429986.atlasv1.799k5cihj_807yc1e8afvla8ackd1khsb50nfeswbxbr1re54y0wpzs2tjy=",isUsingLuhnAlgorithm:!1,regexp:"[a-z0-9]{14}\\.(?-i:atlasv1)\\.[a-z0-9\\-_=]{60,70}"},{key:"heroku_api_key",name:"Heroku API key",category:"credential",example:"9127f65b-8b3f-c0b7-a336-a4347e71bc51",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"heroku_api_key_v2",name:"Heroku API key v2",category:"credential",example:"HRKU-AAxPYvV6l2R3DvF0w9VJ4m8cz9oaygOHxpQvcw--iD51MszQZeakD9DZsclX",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(HRKU-AA[0-9a-zA-Z_-]{58}))"},{key:"hubspot_api_key",name:"HubSpot API key",category:"credential",example:"86cb6664-b191-db72-95a7-49adebe84b74",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12})"},{key:"huggingface_access_token",name:"HuggingFace access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:hf_(?i:[a-z]{34}))"},{key:"huggingface_organization_api_token",name:"HuggingFace organization API token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:api_org_(?i:[a-z]{34}))"},{key:"intercom_api_key",name:"Intercom API key",category:"credential",example:"zuc5c=ykf5gcwesqvmh2pji6k3extx0rbalsznte3sdo7iu7f-lumol2npfk",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{60})"},{key:"intra42_client_secret",name:"Intra42 client secret",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:s-s4t2(?:ud|af)-[abcdef0123456789]{64})"},{key:"jfrog_api_key",name:"JFrog API key",category:"credential",example:"lj7nrgoo0kr04kw312zvly7l0olsn37vhto5wdn3yqi5srxnc2axstp7a1kewkxi717w295kh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{73})"},{key:"jfrog_identity_token",name:"JFrog identity token",category:"credential",example:"xh0x2upbtkkg1pseg7ezmcyw2c3kt0bt05l5v8ynvkro6wagolhch0f7kppplt8b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"jwt",name:"JSON web token",category:"credential",example:"ey7gzQUpN8Kz7XY6Yin.ey1o36_XrBphAG8WMHQ.",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:ey[a-zA-Z0-9]{17,}\\.ey[a-zA-Z0-9\\/\\\\_-]{17,}\\.(?:[a-zA-Z0-9\\/\\\\_-]{10,}={0,2})?)"},{key:"jwt_base64",name:"JSON web token base64",category:"credential",example:"ZXlKNE5YUWpVekkxTmlJNklsUjFUM0pDZVRKT1kxUnNSbE5YZFZvNFMyZzRWemhCYWxGaFoySTBabTVtVURGVGJFdE5Uemd0VTI4aWZRLmV5SnBjM01pT2lKcWIyVWlMQTBLSUNKbGVIQWlPakV6TURBNE1Ua3pPREFzRFFvZ0ltaDBkSEE2THk5bGVHRnRjR3hsTG1OdmJTOXBjMTl5YjI5MElqcDBjblZsZlEuZEJqZnRKZVo0Q1ZQLW1COTJLMjd1aGJVSlUxcDFyX3dXMWdGV0ZPRWpYaw==",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ZXlK(?:(?P<alg>aGJHY2lPaU)|(?P<apu>aGNIVWlPaU)|(?P<apv>aGNIWWlPaU)|(?P<aud>aGRXUWlPaU)|(?P<b64>aU5qUWlP)|(?P<crit>amNtbDBJanBi)|(?P<cty>amRIa2lPaU)|(?P<epk>bGNHc2lPbn)|(?P<enc>bGJtTWlPaU)|(?P<jku>cWEzVWlPaU)|(?P<jwk>cWQyc2lPb)|(?P<iss>cGMzTWlPaU)|(?P<iv>cGRpSTZJ)|(?P<kid>cmFXUWlP)|(?P<key_ops>clpYbGZiM0J6SWpwY)|(?P<kty>cmRIa2lPaUp)|(?P<nonce>dWIyNWpaU0k2)|(?P<p2c>d01tTWlP)|(?P<p2s>d01uTWlPaU)|(?P<ppt>d2NIUWlPaU)|(?P<sub>emRXSWlPaU)|(?P<svt>emRuUWlP)|(?P<tag>MFlXY2lPaU)|(?P<typ>MGVYQWlPaUp)|(?P<url>MWNtd2l)|(?P<use>MWMyVWlPaUp)|(?P<ver>MlpYSWlPaU)|(?P<version>MlpYSnphVzl1SWpv)|(?P<x>NElqb2)|(?P<x5c>NE5XTWlP)|(?P<x5t>NE5YUWlPaU)|(?P<x5ts256>NE5YUWpVekkxTmlJNkl)|(?P<x5u>NE5YVWlPaU)|(?P<zip>NmFYQWlPaU))[a-zA-Z0-9\\/\\\\_+\\-\\r\\n]{40,}={0,2}"},{key:"launchdarkly_access_token",name:"LaunchDarkly access token",category:"credential",example:"ezmej9s6yv4qwk2=yeb4kfi162p33b_2hzm7tr-0",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{40})"},{key:"linear_api_key",name:"Linear API key",category:"credential",example:"lin_api_0n5n0k26vb4ka9je9dqdcwl1dae5mbpfhb48xio6",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)lin_api_[a-z0-9]{40}"},{key:"linear_client_secret",name:"Linear client secret",category:"credential",example:"7b956760f09b81684ed833c524f081de",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"linkedin_client_id",name:"LinkedIn client ID",category:"credential",example:"18u930hak0em0r",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{14})"},{key:"linkedin_client_secret",name:"LinkedIn client secret",category:"credential",example:"uvkxd9rw41ylk1zj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{16})"},{key:"lob_api_key",name:"Lob API key",category:"credential",example:"test_02efbb923a38370aac769e3bedc4d3398be",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:(live|test)_[a-f0-9]{35})"},{key:"lob_pub_api_key",name:"Lob publishable API key",category:"credential",example:"test_pub_df170d9f5be9244959713dfee686c42",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:(test|live)_pub_[a-f0-9]{31})"},{key:"mailchimp_api_key",name:"MailChimp API key",category:"credential",example:"81277fbbe2dd9c5e18d5f28cebcc558c-us20",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32}-us[0-9][0-9])"},{key:"mailgun_pub_key",name:"Mailgun public validation key",category:"credential",example:"pubkey-5011bae1a4b57dfa83762c24b0e1299d",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:pubkey-[a-f0-9]{32})"},{key:"mailgun_private_api_token",name:"Mailgun private API token",category:"credential",example:"key-176f7ef066471ac351adab734d2c9fb2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:key-[a-f0-9]{32})"},{key:"mailgun_signing_key",name:"Mailgun webhook signing key",category:"credential",example:"24564bd3d54a469601d5ac5daecb9ad2-00001111-22223333",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-h0-9]{32}-[a-h0-9]{8}-[a-h0-9]{8})"},{key:"mapbox_api_token",name:"MapBox API token",category:"credential",example:"pk.5ko18udoy3cilkpgyedje9limykwj8n7wmhug4967o9wze284mmpuuhjzgig.edjzuv7jwhc6lnv5b3p9nc",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:pk\\.[a-z0-9]{60}\\.[a-z0-9]{22})"},{key:"mattermost_access_token",name:"Mattermost access token",category:"credential",example:"rtw2hncbfhpbyyri90d3q2mo1m",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{26})"},{key:"maxmind_license_key",name:"MaxMind license key",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:[A-Za-z0-9]{6}_[A-Za-z0-9]{29}_mmk)"},{key:"cisco_meraki_api_key",name:"Cisco Meraki API key",category:"credential",example:"acea14a1470f7cf443a031dde64065ce81c77b2b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:[0-9a-f]{40})"},{key:"messagebird_api_token",name:"MessageBird API token",category:"credential",example:"448q6im7yxutswabdko1n69ry",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{25})"},{key:"messagebird_client_id",name:"MessageBird client ID",category:"credential",example:"12345678-ABCD-ABCD-ABCD-1234567890AB",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"netlify_access_token",name:"Netlify access token",category:"credential",example:"3j1sa0o20v0k-cjbjn3vh_4uqnkvb3w_px5no2in",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{40,46})"},{key:"new_relic_user_api_key",name:"New Relic user API key",category:"credential",example:"NRAK-zozcnrh45ornsbl1duyfhell59u",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:NRAK-[a-z0-9]{27})"},{key:"new_relic_user_api_id",name:"New Relic user API ID",category:"credential",example:"k0jze7delork84k8ke1z1dm275yw2aqf5uu2cy7x1uiloll3xab5203hiz9tx9xx",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"new_relic_browser_api_token",name:"New Relic browser API token",category:"credential",example:"NRJS-c7fa1261a97506e4a45",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:NRJS-[a-f0-9]{19})"},{key:"new_relic_insert_key",name:"New Relic insight insert key",category:"credential",example:"NRII-4168ab7eb2e051f37144ad884d32ab34",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:NRII-[a-z0-9-]{32})"},{key:"notion_api_token",name:"Notion API token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:ntn_[0-9]{11}[A-Za-z0-9]{32}[A-Za-z0-9]{3})"},{key:"npm_access_token",name:"npm access token",category:"credential",example:"npm_vz9e7fvsn7o2n2tddg6b01gs7g9wldlys4vm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:npm_[a-z0-9]{36})"},{key:"nytimes_access_token",name:"NYTimes access token",category:"credential",example:"ako7xzi0mx7w15ogdkew7ilq7h13x8rl",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{32})"},{key:"octopus_deploy_api_key",name:"Octopus Deploy API key",category:"credential",example:"API-NFWN6F7X32BYDBU94IGY3V5ZQY",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:API-[A-Z0-9]{26})"},{key:"okta_access_token",name:"Okta access token",category:"credential",example:"003cKkRNNMy4ul7V8UDHEjEBGbnsQ6tejSHzfeBtcp",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:00[a-zA-Z0-9_=\\-]{40})"},{key:"openai_api_key",name:"OpenAI API key",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sk-(?:proj|svcacct|admin)-(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})T3BlbkFJ(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})(?-u:\\b)|sk-[a-zA-Z0-9]{20}T3BlbkFJ[a-zA-Z0-9]{20})"},{key:"openshift_user_token",name:"OpenShift user token",category:"credential",example:"sha256~OFL-TnR3jyLteu_rAuff3PUYNELVvByMRFYCcAkaJSR",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sha256~[a-zA-Z0-9_-]{43})(?:[^a-zA-Z0-9_-]|\\z)"},{key:"perplexity_api_key",name:"Perplexity API key",category:"credential",example:"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'",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pplx-[a-zA-Z0-9]{48})(?:[`'\" \\r\\n\\t\\f\\v;]|\\\\[nr]|$|(?-u:\\b))"},{key:"pgpassword_shell_assignment",name:"PGPASSWORD shell assignment",category:"credential",example:"PGPASSWORD='supersecret'",isUsingLuhnAlgorithm:!1,regexp:`(?-u:\\b)PGPASSWORD=(?:"[^"\\r\\n]+"|'[^'\\r\\n]+'|[^\\s'"]+)`},{key:"plaid_api_token",name:"Plaid API token",category:"credential",example:"access-development-4b0f8c31-83fe-e4c5-3d02-91e487b69d2d",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:access-(?:sandbox|development|production)-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"plaid_client_id",name:"Plaid client ID",category:"credential",example:"TTPjxpFNiwOct5XLdxjXD0Ta",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{24})"},{key:"plaid_secret_key",name:"Plaid secret key",category:"credential",example:"ikhqm7a9k76l8f544dl0v8kxvm2w55",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{30})"},{key:"planetscale_password",name:"PlanetScale password",category:"credential",example:"pscale_pw_9gvu8z79m4b814z0vv8266w70h3i7jlq",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pscale_pw_[a-zA-Z0-9_=\\.-]{32,64})"},{key:"planetscale_api_token",name:"PlanetScale API token",category:"credential",example:"pscale_tkn_nwy9jkjgnry96ftecsx_=jrxc6pkmmew",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pscale_tkn_[a-zA-Z0-9_=\\.-]{32,64})"},{key:"planetscale_oauth_token",name:"PlanetScale OAuth token",category:"credential",example:"pscale_oauth_zx8v3gzfnfxbymj__l629i68jnz5gnff",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pscale_oauth_[a-zA-Z0-9_=\\.-]{32,64})"},{key:"postman_api_token",name:"Postman API token",category:"credential",example:"PMAK-525b84aa46e2c588620d8123-06f9ca36c4aad4305baafbe00716b7bc8f",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:PMAK-[a-f0-9]{24}\\-[a-f0-9]{34})"},{key:"prefect_api_token",name:"Prefect API token",category:"credential",example:"pnu_kttbffyfgffu2sfbxzxw8mbpgvvtxjljwe1p",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pnu_[a-zA-Z0-9]{36})"},{key:"privateai_api_token",name:"PrivateAI API token",category:"credential",example:"iwuxqzqilzbfnccncvjz6px23dnej11h",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"private_key",name:"Private key",category:"credential",example:`-----BEGIN PRIVATE KEY-----
|
|
50
|
+
`),process.exitCode=1}}function Yp(e,t){let n=py(uy({start:e,end:t}),{format:["years","months","days","hours","minutes"]});return n===""?"less than a minute":n}function Gq(e){let t=Ka(e.accessToken),n=new Date,o=new Date(e.accessExpiresAt),i=!!e.refreshToken;return Number.isNaN(o.getTime())?`Logged in as a user (token ${t}, expires ${e.accessExpiresAt}).`:o<=n?i?`Logged in as a user (token ${t}). Access token expired ${Yp(o,n)} ago, on ${e.accessExpiresAt}; the next command renews it automatically.`:`Logged in as a user (token ${t}). Session expired ${Yp(o,n)} ago, on ${e.accessExpiresAt}. Run \`tsuga auth login\` to sign in again.`:i?`Logged in as a user (token ${t}). Access token expires in ${Yp(n,o)}, on ${e.accessExpiresAt}; the session renews automatically.`:`Logged in as a user (token ${t}). Session expires in ${Yp(n,o)}, on ${e.accessExpiresAt}.`}function $q(){let{credential:e}=oi({});if(!e){V("Not authenticated. Run `tsuga auth login` or `tsuga auth operation-key <OPERATION_API_KEY>`.");return}switch(e.kind){case"user-session":V(Gq(e.userAuth));return;case"operation-api-key":V("Authenticated with an operation API key.");return;default:Je(e)}}function jq(){LO(),V("Local user session cleared.")}function FO(e){let t=e.command("auth").description("Manage authentication: user login (OAuth) or operation API key");t.action(()=>t.help()),t.command("login").description("Log in as a user with a browser authorization flow and save the session (replaces any saved operation API key)").action(Mq),t.command("logout").description("Clear the saved user session").action(jq),t.command("token").description("Print the saved user access token to stdout").action(Dq),t.command("operation-key <OPERATION_API_KEY>").description("Save an operation API key to the config file (replaces any saved user session)").action(n=>{NO(n),V(`Operation API key saved to ${zp()}`)}),t.command("status").description("Show the current authentication method").action($q)}var qq=["allowed-domains","cluster-integration-config","custom-usage-tag","database","databricks-connection","explorer-saved-view","github-connection","host","inventory","monitor-alert","monitor-debugging","oauth-grant","org","retention-policy","saml-config","sensitive-data-scanner-rule","service","service-target","team-remap-config","user-self","widget-share"],Fq=["adaptive-notification-rule","audit-log","cloud-account","dashboard-folder","dashboard-report","dashboard","ingestion-api-key","investigation","log-route","metric-route","monitor","notification-integration","notification-rule","notification-silence","operation-api-key","quality-report","rum-public-token","slo","tag-policy","team-members","team","user-data","user-invitation","user-permissions"],Bq=["log","metric","trace","rum"],pd=[...Fq,...Bq],PPe=[...qq,...pd];var BO=["admin","public_editor","public_viewer","teams_only"],ii=["admin","editor","viewer"];var oo="/v0/team-membership",ud="Role granted to the user inside this team. `admin` gives full team control, including managing assets, members, and settings. `editor` can view and update most team assets (dashboards, monitors, etc.) but cannot manage members or settings. `viewer` can view team data but cannot make changes.",ld=r.Object({id:r.String({description:"Tsuga-generated team membership ID assigned when the membership is created."}),userId:r.String({description:"User ID that belongs to the team."}),teamId:r.String({description:"Team ID that contains the user."}),roleKey:r.Enum(ii,{description:ud})}),HO=r.Object({userId:u({allowEmpty:!1,description:"User ID to add to or update in the team."}),teamId:u({allowEmpty:!1,description:"Team ID receiving the membership change."}),roleKey:r.Enum(ii,{description:ud})}),Hq=r.Object({userId:u({allowEmpty:!1,description:"User ID to remove from the team."}),teamId:u({allowEmpty:!1,description:"Team ID to remove the user from."})}),Kq=r.Optional(r.Object({userId:r.Optional(u({allowEmpty:!1,description:"Restrict results to memberships for this user ID."})),teamId:r.Optional(u({allowEmpty:!1,description:"Restrict results to memberships for this team ID."}))})),UPe=d({tags:["access-control"],url:oo,method:"GET",query:Kq,response:r.Array(ld)}),wPe=d({tags:["access-control"],url:oo,method:"POST",body:HO,response:ld}),vPe=d({tags:["access-control"],url:oo,method:"PUT",body:HO,response:ld}),NPe=d({tags:["access-control"],url:oo,method:"DELETE",body:Hq,response:N}),Vp=500,KO=r.Object({teamId:u({allowEmpty:!1,description:"Team ID receiving all requested memberships."}),members:r.Array(r.Object({userId:r.Optional(u({allowEmpty:!1,description:"Existing user ID to add to the team."})),userEmail:r.Optional(u({allowEmpty:!1,type:"email",description:"Existing user email to resolve and add to the team."})),roleKey:r.Enum(ii,{description:ud})},{oneOf:[{required:["userId"]},{required:["userEmail"]}]}),{minItems:1,maxItems:Vp,description:"Users to add to the team. Each item must include either `userId` or `userEmail`, not both. Duplicate identifiers (including a `userId` and `userEmail` that resolve to the same user) are rejected. Items are processed independently: an unresolved user does not stop other items from being added."})},{description:"Bulk team-membership creation request. Provide one target team and the users to add by ID or email, with a role for each user."}),zq={teamId:"team-123-abc",members:[{userId:"user-123-abc",roleKey:"viewer"},{userEmail:"sam@example.com",roleKey:"editor"}]};Object.assign(KO,{examples:[zq]});var zO=r.Object({results:r.Array(r.Object({userId:r.String({description:"Resolved user ID for this bulk add result. For `user_not_found`, this is the submitted user ID or email that Tsuga could not resolve."}),status:r.Enum(["added","already_member","user_not_found"],{description:"`added` means the membership was created, `already_member` means no change was needed, and `user_not_found` means Tsuga could not resolve the requested user."})}))},{description:"Per-user result summary for a bulk team-membership add request."}),Yq={results:[{userId:"user-123-abc",status:"added"},{userId:"sam@example.com",status:"user_not_found"}]};Object.assign(zO,{examples:[Yq]});var LPe=d({tags:["access-control"],url:`${oo}/bulk-add`,method:"POST",body:KO,response:zO}),kPe=d({tags:["access-control"],url:`${oo}/bulk-update-user-roles`,method:"PUT",body:r.Object({userIds:r.Array(u({allowEmpty:!1}),{minItems:1,maxItems:Vp}),teamId:u({allowEmpty:!1}),role:r.Enum(ii)}),response:r.Object({})}),YO=r.Object({teamId:u({allowEmpty:!1,description:"Team ID to remove the requested users from."}),userIds:r.Optional(r.Array(u({allowEmpty:!1}),{minItems:1,maxItems:Vp,description:"User IDs to remove from the team. Items are processed independently: a user who is not a member or cannot be resolved does not stop the other items from being removed."})),userEmails:r.Optional(r.Array(u({allowEmpty:!1,type:"email"}),{minItems:1,maxItems:Vp,description:"User emails to resolve and remove from the team."}))},{oneOf:[{required:["userIds"]},{required:["userEmails"]}],description:"Bulk team-membership removal request. Provide one target team and either `userIds` or `userEmails`, not both, with no duplicates."}),Vq={teamId:"team-123-abc",userIds:["user-123-abc"]};Object.assign(YO,{examples:[Vq]});var VO=r.Object({results:r.Array(r.Object({userId:r.String({description:"Resolved user ID for this bulk remove result. For `user_not_found`, this is the submitted user ID or email that Tsuga could not resolve."}),status:r.Enum(["removed","not_member","user_not_found"],{description:"`removed` means the membership was deleted, `not_member` means no membership existed, and `user_not_found` means Tsuga could not resolve the requested user."})}))},{description:"Per-user result summary for a bulk team-membership removal request."}),Qq={results:[{userId:"user-123-abc",status:"removed"},{userId:"missing@example.com",status:"user_not_found"}]};Object.assign(VO,{examples:[Qq]});var MPe=d({tags:["access-control"],url:`${oo}/bulk-remove`,method:"DELETE",body:YO,response:VO});var Wq={"github-connection":{read:["admin"],write:["admin"]},investigation:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"ingestion-api-key":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"rum-public-token":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"widget-share":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"audit-log":{read:["public_viewer","public_editor","admin"],write:[]},"custom-usage-tag":{read:["public_viewer","public_editor","admin"],write:["admin"]},"cluster-integration-config":{read:["admin"],write:["admin"]},"explorer-saved-view":{read:["public_viewer","public_editor","admin"],write:["public_viewer","public_editor","admin"]},"operation-api-key":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"cloud-account":{read:["public_viewer","public_editor","admin"],write:["admin"]},dashboard:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"dashboard-folder":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"dashboard-report":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},inventory:{read:["public_viewer","public_editor","admin"],write:[]},log:{read:["public_viewer","public_editor","admin"],write:[]},"log-route":{read:["public_viewer","public_editor","admin"],write:["admin","public_editor"]},"metric-route":{read:["public_viewer","public_editor","admin"],write:["admin","public_editor"]},metric:{read:["public_viewer","public_editor","admin"],write:[]},trace:{read:["public_viewer","public_editor","admin"],write:[]},rum:{read:["public_viewer","public_editor","admin"],write:[]},monitor:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"monitor-alert":{read:["public_viewer","public_editor","admin"],write:[]},"monitor-debugging":{read:["admin"],write:[]},"notification-integration":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"notification-rule":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"adaptive-notification-rule":{read:["public_viewer","public_editor","admin"],write:["admin"]},"notification-silence":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"saml-config":{read:["admin"],write:["admin"]},org:{read:["public_viewer","public_editor","admin"],write:["admin"]},"allowed-domains":{read:["public_viewer","public_editor","admin"],write:["admin"]},"quality-report":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"sensitive-data-scanner-rule":{read:["public_viewer","public_editor","admin"],write:["admin"]},slo:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"retention-policy":{read:["public_viewer","public_editor","admin"],write:["admin"]},"databricks-connection":{read:["public_viewer","public_editor","admin"],write:["admin"]},service:{read:["public_viewer","public_editor","admin"],write:[]},"service-target":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},host:{read:["public_viewer","public_editor","admin"],write:[]},database:{read:["public_viewer","public_editor","admin"],write:[]},"tag-policy":{read:["public_viewer","public_editor","admin"],write:["admin"]},team:{read:["public_viewer","public_editor","admin"],write:["admin"]},"team-members":{read:["public_viewer","public_editor","admin"],write:["admin"]},"team-remap-config":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-data":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-invitation":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-permissions":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-self":{read:["public_viewer","public_editor","admin"],write:["public_viewer","public_editor","admin"]},"oauth-grant":{read:[],write:[]}},Zq={"github-connection":{read:["admin"],write:[]},investigation:{read:["viewer","editor","admin"],write:["editor","admin"]},"ingestion-api-key":{read:["viewer","editor","admin"],write:["editor","admin"]},"rum-public-token":{read:["viewer","editor","admin"],write:["editor","admin"]},"widget-share":{read:["viewer","editor","admin"],write:["viewer","editor","admin"]},"audit-log":{read:["viewer","editor","admin"],write:[]},"custom-usage-tag":{read:[],write:[]},"cluster-integration-config":{read:[],write:[]},"explorer-saved-view":{read:["viewer","editor","admin"],write:["viewer","editor","admin"]},"operation-api-key":{read:["viewer","editor","admin"],write:["admin"]},"cloud-account":{read:["viewer","editor","admin"],write:[]},dashboard:{read:["viewer","editor","admin"],write:["editor","admin"]},"dashboard-folder":{read:["viewer","editor","admin"],write:["editor","admin"]},"dashboard-report":{read:["viewer","editor","admin"],write:["editor","admin"]},inventory:{read:["viewer","editor","admin"],write:[]},log:{read:["viewer","editor","admin"],write:[]},"log-route":{read:["viewer","editor","admin"],write:["editor","admin"]},"metric-route":{read:["viewer","editor","admin"],write:["editor","admin"]},metric:{read:["viewer","editor","admin"],write:[]},trace:{read:["viewer","editor","admin"],write:[]},rum:{read:["viewer","editor","admin"],write:[]},monitor:{read:["viewer","editor","admin"],write:["editor","admin"]},"monitor-alert":{read:["viewer","editor","admin"],write:[]},"monitor-debugging":{read:["admin"],write:[]},"notification-integration":{read:["viewer","editor","admin"],write:["editor","admin"]},"notification-rule":{read:["viewer","editor","admin"],write:["editor","admin"]},"adaptive-notification-rule":{read:["viewer","editor","admin"],write:[]},"notification-silence":{read:["viewer","editor","admin"],write:["editor","admin"]},"saml-config":{read:[],write:[]},org:{read:["viewer","editor","admin"],write:[]},"allowed-domains":{read:["viewer","editor","admin"],write:[]},"quality-report":{read:["viewer","editor","admin"],write:["editor","admin"]},"sensitive-data-scanner-rule":{read:["viewer","editor","admin"],write:[]},slo:{read:["viewer","editor","admin"],write:["editor","admin"]},"retention-policy":{read:[],write:[]},"databricks-connection":{read:[],write:[]},service:{read:["viewer","editor","admin"],write:[]},"service-target":{read:["viewer","editor","admin"],write:["editor","admin"]},host:{read:["viewer","editor","admin"],write:[]},database:{read:["viewer","editor","admin"],write:[]},"tag-policy":{read:[],write:[]},team:{read:["viewer","editor","admin"],write:["admin"]},"team-members":{read:["viewer","editor","admin"],write:["admin"]},"team-remap-config":{read:[],write:[]},"user-data":{read:["viewer","editor","admin"],write:["admin"]},"user-invitation":{read:["viewer","editor","admin"],write:["admin"]},"user-permissions":{read:["viewer","editor","admin"],write:[]},"user-self":{read:["viewer","editor","admin"],write:["viewer","editor","admin"]},"oauth-grant":{read:[],write:[]}},Xq={user:Wq,team:Zq};function md(e){return QO(e,"team")}function dd(e){return QO(e,"user")}function QO(e,t){let n=[],o=Xq[t];for(let[i,a]of Object.entries(o))for(let[c,l]of Object.entries(a))l.includes(e)&&n.push({actionType:c,resourceType:i});return n}var FPe={admin:{name:"Global admin",description:"Full control across the organization. Can view and modify everything, including private teams.",permissions:dd("admin"),roleKey:"admin"},public_editor:{name:"Public editor",description:"Can view and edit assets in public teams, but not access private teams or critical settings.",permissions:dd("public_editor"),roleKey:"public_editor"},public_viewer:{name:"Public viewer",description:"Read-only access to public team data. Cannot make changes.",permissions:dd("public_viewer"),roleKey:"public_viewer"},teams_only:{name:"Teams only",description:"Only access data and assets in their own teams.",permissions:[],roleKey:"teams_only"}},BPe={admin:{name:"Team admin",description:"Full team control, manage assets, members, and settings.",permissions:md("admin"),roleKey:"admin"},editor:{name:"Team editor",description:"Can view and update most assets (like dashboards, monitors).",permissions:md("editor"),roleKey:"editor"},viewer:{name:"Team viewer",description:"Can view all team data but cannot make changes.",permissions:md("viewer"),roleKey:"viewer"}};var HPe=new Set(pd);var Jq={documentation:void 0,investigations:"investigation",logs:"log",metrics:"metric","team-membership":"team-members",traces:"trace",user:"user-data","allowed-domains":"allowed-domains","cloud-account":"cloud-account","custom-usage-tag":"custom-usage-tag",dashboard:"dashboard","dashboard-folder":"dashboard-folder","ingestion-api-key":"ingestion-api-key",inventory:"inventory","log-route":"log-route","metric-route":"metric-route",monitor:"monitor","notification-rule":"notification-rule","notification-silence":"notification-silence","quality-report":"quality-report","retention-policy":"retention-policy","rum-public-token":"rum-public-token",service:"service","service-target":"service-target",slo:"slo","tag-policy":"tag-policy",team:"team","user-invitation":"user-invitation"},eF=Object.entries(Jq),KPe=new Map(eF.flatMap(([e,t])=>t?[[t,e]]:[]));var $="context";var WO="trace_id",Qp=`${$}.team`,YPe=`${$}.env`,VPe=`${$}.api_key_id`,Wp=`${$}.service.name`,QPe=`${$}.service.version`,Zp=`${$}.span.kind`,Xp=`${$}.span.name`,io=`${$}.status.code`,fd="resource.attributes.team",ZO=["SPAN_KIND_UNSPECIFIED","SPAN_KIND_INTERNAL","SPAN_KIND_SERVER","SPAN_KIND_CLIENT","SPAN_KIND_PRODUCER","SPAN_KIND_CONSUMER"];var Ja=`${$}.host.name`,tF=`${$}.instance`,rF=`${$}.instanceid`,nF=`${$}.instance_name`,WPe=`${$}.telemetry.sdk.language`,ZPe=`${$}.process.runtime.name`,XPe=`${$}.scope.name`,JPe=`${$}.cloud.provider`,eUe=`${$}.cloud.platform`,tUe=`${$}.aws.ecs.task.arn`,rUe=`${$}.k8s.cluster.name`,nUe=`${$}.k8s.cluster.uid`,oUe=`${$}.k8s.namespace.name`,oF=`${$}.k8s.pod.name`,iUe=`${$}.k8s.pod.uid`,aUe=`${$}.k8s.container.name`,sUe=`${$}.k8s.node.name`,cUe=`${$}.k8s.node.uid`,iF=`${$}.k8s.deployment.name`,pUe=`${$}.k8s.deployment.uid`,aF=`${$}.k8s.replicaset.name`,uUe=`${$}.k8s.replicaset.uid`,sF=`${$}.k8s.statefulset.name`,lUe=`${$}.k8s.statefulset.uid`,cF=`${$}.k8s.daemonset.name`,mUe=`${$}.k8s.daemonset.uid`,dUe=`${$}.k8s.job.name`,fUe=`${$}.k8s.job.uid`,gUe=`${$}.k8s.cronjob.name`,hUe=`${$}.k8s.cronjob.uid`,ai="status_code",Jp="span.name";var eu="span.kind";var pF="db.system.name",uF="db.system",lF="db.namespace",mF="db.name";var yUe=`span_attributes.${lF}`,TUe=`span_attributes.${mF}`,EUe=`span_attributes.${pF}`,_Ue=`span_attributes.${uF}`;var IUe={name:"tsuga.internal.processing_tag_policy_violations_total",attributes:{tagPolicyId:`${$}.tag_policy_id`,dataSource:`${$}.data_source`}};var bUe={name:"tsuga.internal.event_size_bytes",attributes:{batchKind:`${$}.batch_kind`,batchKindMetricsFilter:`${$}.batch_kind:metrics`,sourceApiKeyId:`${$}.source_api_key_id`,sourceEnv:`${$}.source_env`,sourceTeam:`${$}.source_team`}};var gd="__tsuga_metadata__",SUe=`${gd}.signature`,AUe=`${gd}.routes`,OUe=`${gd}.trace_id_bucket`;var vUe=[ai,io,io.replace(`${$}.`,"")];var XO="__tsuga_cluster_id__",dF=r.Object({}),fF=r.Object({status:r.Literal("error"),message:r.String({description:"Why this cluster failed to answer the query."})});function si(e=dF){let t=C("status",[r.Object({...e.properties,status:r.Literal("ok")}),fF]);return Object.assign(zc($t,t),{description:'Outcome per cluster, keyed by cluster ID. A cluster that failed reports `status: "error"`.'})}var gF=5,es=r.Array(u({allowEmpty:!1}),{minItems:1,maxItems:gF,uniqueItems:!0,description:"IDs of the clusters to query, without duplicates. Mutually exclusive with `clusterId`. Omit both to use the default cluster."});var JO=r.Object({type:r.Literal("number"),number:r.String()}),hF=r.Object({type:r.Literal("string"),string:r.String()}),yF=r.Object({type:r.Literal("timestamp"),timestamp:r.String()}),ts=C("type",[JO,hF,yF]),TF=r.Object({by:r.Record(r.String(),ts),computed:r.Record(r.String(),JO)}),EF=r.Object({type:r.Literal("buckets"),buckets:r.Array(TF),clusterResponses:r.Optional(si())}),_F=r.Object({type:r.Literal("distribution"),bounds:r.Array(r.Number()),buckets:r.Array(r.Object({timestamp:r.Number(),counts:r.Array(r.Number())})),percentiles:r.Optional(r.Array(r.Number()))}),tu=C("type",[EF,_F]);var IF=["all","owning-team-and-public","owning-team-only"],Tn=r.Enum(IF,{description:"`all` allows the resource to query all permitted telemetry, `owning-team-and-public` limits it to the owning team plus public data, and `owning-team-only` limits it to the owning team."});var tx=1456444800,rx=4927737600,bF=tx*1e3,SF=rx*1e3,ru=1704067200,hd=ru*1e3,nx={title:"TimeRange",description:"Inclusive time range for telemetry queries. Use Unix timestamps in seconds unless the field description says milliseconds.",examples:[{from:ru,to:ru}]},AF={title:"TimeRange",description:"Inclusive time range for telemetry queries using Unix timestamps in milliseconds.",examples:[{from:hd,to:hd}]},nu=e=>r.Integer({description:e,examples:[ru],minimum:tx,maximum:rx,format:"int64"}),ex=e=>r.Integer({description:e,examples:[hd],minimum:bF,maximum:SF,format:"int64"}),at=r.Object({from:r.Optional(nu("Start of the query window as a Unix timestamp in seconds")),to:r.Optional(nu("End of the query window as a Unix timestamp in seconds"))},nx),bt=r.Object({from:nu("Start of the query window as a Unix timestamp in seconds"),to:nu("End of the query window as a Unix timestamp in seconds")},nx),ci=r.Object({from:ex("Start of the query window as a Unix timestamp in milliseconds"),to:ex("End of the query window as a Unix timestamp in milliseconds")},AF);var RF="/v0/aggregation",CF=r.Union([r.Literal("a"),r.Literal("d"),r.Literal("q"),r.Literal("w"),r.Literal("t")]),yd=r.Object({parallelism:r.Number(),engine:CF,recordBatchCache:r.Optional(r.Boolean()),includeNullGroups:r.Optional(r.Boolean()),restartAwareGaugeSum:r.Optional(r.Boolean())}),Td=["logs","metrics","traces"];var ax={logs:"Logs",metrics:"Metrics",traces:"Spans"},PF=[...Td,"connections","log-patterns","spans","rum"];var twe={...ax,connections:"Connections","log-patterns":"Log Patterns",spans:"Spans",rum:"RUM events"},Ir=[...Td,"rum"];var rwe={...ax,rum:"RUM events"};var nwe=r.Enum(PF,{description:"Data source being queried"}),sx=r.Enum(Td,{description:"Telemetry source queried by this aggregation: `logs`, `metrics`, or `traces`."}),or=r.Enum(Ir,{description:"Telemetry source queried by this aggregation: `logs`, `metrics`, `traces`, or `rum`."}),ao=r.String({description:"Attribute containing the values to aggregate"}),so=u({description:"Attribute containing the values to aggregate"}),UF=C("type",[r.Object({type:r.Literal("count",{description:"Counts the total number of records"}),field:r.Optional(ao)},{$id:"AggregateCount",title:"Count"}),r.Object({type:r.Literal("unique-count",{description:"Counts the distinct values of the field"}),field:ao},{$id:"AggregateUniqueCount",title:"UniqueCount"}),r.Object({type:r.Literal("average",{description:"Calculates the average value of the selected field"}),field:ao},{$id:"AggregateAverage",title:"Average"}),r.Object({type:r.Literal("max",{description:"Finds the largest value of the field"}),field:ao},{$id:"AggregateMax",title:"Max"}),r.Object({type:r.Literal("min",{description:"Finds the smallest value of the field"}),field:ao},{$id:"AggregateMin",title:"Min"}),r.Object({type:r.Literal("sum",{description:"Sums the values of the selected field"}),field:ao},{$id:"AggregateSum",title:"Sum"}),r.Object({type:r.Literal("percentile",{description:"Calculates a percentile of the selected field"}),field:ao,percentile:r.Number({description:"Percentile to compute for the selected field."})},{$id:"AggregatePercentile",title:"Percentile"})],{title:"Aggregate",description:"Aggregation operation for this query. Required for every query; `field` is required by all aggregate types except `count`."}),wF=C("type",[r.Object({type:r.Literal("count",{description:"Counts the total number of records"}),field:r.Optional(so)},{$id:"InputAggregateCount",title:"Count"}),r.Object({type:r.Literal("unique-count",{description:"Counts the distinct values of the field"}),field:so},{$id:"InputAggregateUniqueCount",title:"UniqueCount"}),r.Object({type:r.Literal("average",{description:"Calculates the average value of the selected field"}),field:so},{$id:"InputAggregateAverage",title:"Average"}),r.Object({type:r.Literal("max",{description:"Finds the largest value of the field"}),field:so},{$id:"InputAggregateMax",title:"Max"}),r.Object({type:r.Literal("min",{description:"Finds the smallest value of the field"}),field:so},{$id:"InputAggregateMin",title:"Min"}),r.Object({type:r.Literal("sum",{description:"Sums the values of the selected field"}),field:so},{$id:"InputAggregateSum",title:"Sum"}),r.Object({type:r.Literal("percentile",{description:"Calculates a percentile of the selected field"}),field:so,percentile:r.Number({description:"Percentile to compute for the selected field."})},{$id:"InputAggregatePercentile",title:"Percentile"})],{title:"InputAggregate",description:"Aggregation operation for this query. Required for every query; `field` is required by all aggregate types except `count`."}),cx=r.Object({type:r.Literal("per-second",{description:"Normalizes the metric to events per second"})},{$id:"FunctionPerSecond",title:"PerSecond"}),px=r.Object({type:r.Literal("per-minute",{description:"Normalizes the metric to events per minute"})},{$id:"FunctionPerMinute",title:"PerMinute"}),ux=r.Object({type:r.Literal("per-hour",{description:"Normalizes the metric to events per hour"})},{$id:"FunctionPerHour",title:"PerHour"}),lx=r.Object({type:r.Literal("rate",{description:"Calculates the rate of change"})},{$id:"FunctionRate",title:"Rate"}),mx=r.Object({type:r.Literal("increase",{description:"`Increase` is designed for cumulative metrics. It computes the increase of cumulative metrics by automatically handling counter resets. When used with an aggregation such as `sum` it combines all series without requiring an explicit group-by."})},{$id:"FunctionIncrease",title:"Increase"}),dx=r.Object({type:r.Literal("power",{description:"Raises values to a specified power"}),exponent:r.Integer({description:"The exponent to raise values to"})},{$id:"FunctionPower",title:"Power"}),fx=r.Object({type:r.Literal("sqrt",{description:"Applies a square root transformation to the values"})},{$id:"FunctionSqrt",title:"Sqrt"}),gx=r.Object({type:r.Literal("last",{description:"Takes the last value of the metric for the selected time frame"})},{$id:"FunctionLast",title:"Last"}),vF=r.Object({type:r.Literal("rolling",{description:"Computes a rolling window aggregate"}),window:r.String({description:"Duration of the rolling window"})},{$id:"FunctionRolling",title:"Rolling"}),NF=r.Object({type:r.Literal("rolling",{description:"Computes a rolling window aggregate"}),window:u({allowEmpty:!1,description:"Duration of the rolling window"})},{$id:"InputFunctionRolling",title:"Rolling"}),LF=r.Object({type:r.Literal("log",{description:"Applies a logarithm transformation to the values"}),base:r.Integer({description:"The base of the logarithm"})},{$id:"FunctionLog",title:"Log"}),kF=r.Object({type:r.Literal("log",{description:"Applies a logarithm transformation to the values"}),base:r.Integer({description:"The base of the logarithm",minimum:2})},{$id:"InputFunctionLog",title:"Log"}),MF=r.Object({type:r.Literal("time-offset",{description:"Shifts a query's data backward by a specified duration for easy comparison over different periods of time."}),seconds:r.Integer({description:"Number of seconds to offset"})},{$id:"FunctionTimeOffset",title:"TimeOffset"}),DF=r.Object({type:r.Literal("time-offset",{description:"Shifts a query's data backward by a specified duration for easy comparison over different periods of time."}),seconds:r.Integer({description:"Number of seconds to offset",minimum:1})},{$id:"InputFunctionTimeOffset",title:"TimeOffset"}),GF=C("type",[cx,px,ux,lx,mx,vF,LF,dx,fx,gx,MF],{title:"Function",description:"Post-processing function applied to an aggregation query result after the aggregate is computed, selected by `type`."}),$F=C("type",[cx,px,ux,lx,mx,NF,kF,dx,fx,gx,DF],{title:"InputFunction",description:"Post-processing function applied to an aggregation query result after the aggregate is computed, selected by `type`."});var ox=r.Object({min:r.Number({description:"Lower bound of the distribution range."}),max:r.Number({description:"Upper bound of the distribution range."})}),jF=["linear","log"],ou=r.Enum(jF,{description:"Spacing of the bucket boundaries across the distribution range. `linear` splits the range into equal-width buckets; `log` widens each bucket logarithmically, giving finer resolution near the lower bound."}),ix=r.Integer({minimum:1}),qF=C("type",[r.Object({type:r.Literal("scalar")},{title:"Scalar",description:"Returns a single value"}),r.Object({type:r.Literal("timeseries"),aggregationWindow:u({description:'Time bucket size for aggregation (e.g. "10s", "60s", "1m")'})},{title:"Timeseries",description:"Returns a time series"}),r.Object({type:r.Literal("histogram"),by:r.Optional(u()),bucketCount:r.Optional(ix),bounds:r.Optional(ox),boundsScale:r.Optional(ou),percentiles:r.Optional(r.Array(r.Number({minimum:0,maximum:100,multipleOf:1}),{minItems:1}))},{title:"Histogram",description:"Returns a single distribution over the entire time range"}),r.Object({type:r.Literal("heatmap"),aggregationWindow:u({description:'Time bucket size for the heatmap (e.g. "10s", "60s", "1m")'}),by:r.Optional(u()),bucketCount:r.Optional(ix),bounds:r.Optional(ox)},{title:"Heatmap",description:"Returns a distribution per time window"})]),rs=15,FF=["zero","null"],BF=r.Enum(FF,{description:"`zero` fills missing points with zero. `null` keeps missing points null."}),hx=r.Object({mode:r.Object({type:BF},{description:"How missing aggregation points should be filled."})},{description:"Missing-point fill behavior for aggregation results. Optional; omit to keep missing points null."}),HF=["avg","sum","min","max","last"],yx=r.Enum(HF,{description:"Per-series rollup applied within each time bucket before the cross-series aggregate. Supported only on metric queries whose `aggregate` is `sum`, and cannot be combined with the `rate`, `increase`, `last`, or `rolling` functions. When omitted, a default is derived from the metric type."});var Tx={aggregate:UF,functions:r.Optional(r.Array(GF,{description:"Post-processing functions applied to aggregation results"})),fill:r.Optional(hx),timeAggregate:r.Optional(yx)},Ex={aggregate:wF,functions:r.Optional(r.Array($F,{maxItems:10,description:"Post-processing functions applied to aggregation results. Defaults to an empty array when omitted."})),fill:r.Optional(hx),timeAggregate:r.Optional(yx)},KF={description:"Aggregations that may be combined together in the same query. Each item is referenced from `formula` as q1, q2, and so on, in submission order."},_x={maxItems:rs,description:'Aggregations that may be combined together in the same query. Each item is referenced from `formula` as q1, q2, and so on, in submission order. For dataSource "metrics", each aggregate\'s `field` is the metric name, not an attribute; to count distinct values of an attribute use unique-count with field "<metricName>.context.<attribute>" (e.g. "system.cpu.utilization.context.host.name").'},Ix=r.Array(r.Object({...Tx,filter:r.Optional(r.String({description:"Filter to apply to the aggregation"}))},{title:"AggregationQuery"}),KF),ns=r.Array(r.Object({...Ex,filter:r.Optional(u({type:"tsuga-query",description:"Tsuga query filter to apply to the aggregation. Defaults to an empty string when omitted."}))},{title:"AggregationQuery"}),_x),jr=r.Array(r.Object({...Tx,filter:r.String({description:"Filter to apply to the aggregation"})},{title:"MonitorAggregationQuery",description:"Single aggregation query evaluated by a monitor or SLO."}),{description:"Aggregation queries used by alerting and SLO evaluation. Each query is referenced from formulas as q1, q2, and so on."}),En=r.Array(r.Object({...Ex,filter:u({type:"tsuga-query",description:"Tsuga query filter applied to this alerting or SLO aggregation query. Required by the API; use the query language for the selected data source."})},{title:"MonitorAggregationQuery",description:"Single aggregation query evaluated by a monitor."}),{..._x,description:"Aggregation queries used by alerting. Each query is referenced from formulas as q1, q2, and so on."}),bx=r.Array(r.Omit(En.items,["fill"],{title:"SloAggregationQuery",description:"Single aggregation query evaluated by an SLO."}),{minItems:1,maxItems:rs,description:"Aggregation queries used by SLO evaluation. Each query is referenced from formulas as q1, q2, and so on."});var iu=r.String({description:"Formula referencing submitted query outputs, such as `q1 + q2`. References must be within `q1` through `qN` for the submitted queries."}),co=u({type:"tsuga-formula",description:"Formula referencing query outputs, such as `q1 + q2`, to compute derived results. Defaults to `q1`. Formulas may reference only submitted queries (`q1` through `qN`); undefined query references return 400."}),zF=r.Object({fields:r.Array(r.String(),{description:"Telemetry attribute names used to group aggregation results."}),limit:r.Number({description:'Maximum number of distinct values of `fields` returned for this grouping level, ranked by aggregate value. Groups beyond the limit are truncated, not merged into an "other" group.'}),sortOrder:r.Optional(r.Enum(["asc","desc"],{description:"Sort direction applied to groups: ascending or descending."})),replaceNullWith:r.Optional(r.String({description:"Value used to group documents that have no value for a grouped field."}))},{title:"AggregationGroupBy"}),YF=r.Object({fields:r.Array(u(),{maxItems:1,description:"Telemetry attribute name to group aggregation results by. Currently limited to one field per grouping level."}),limit:r.Number({description:'Maximum number of distinct values of `fields` to return for this grouping level, ranked by aggregate value. Groups beyond the limit are truncated from the response, not merged into an "other" group.'}),sortOrder:r.Optional(r.Enum(["asc","desc"],{description:"Sort direction applied to groups: ascending or descending."})),replaceNullWith:r.Optional(u({allowEmpty:!1,description:"Value used to group documents that have no value for a grouped field."}))},{title:"AggregationGroupBy"}),Sx=7;var pi=r.Array(zF,{description:"Nested grouping levels applied to the results, outermost first (e.g. group by service, then by level within each service). Each level splits results further, so the response contains one result per unique combination of group values."}),qr=r.Array(YF,{maxItems:Sx,description:"Nested grouping levels applied to aggregation results, outermost first (e.g. group by service, then by level within each service). Each level splits results further, so the response contains one result per unique combination of group values instead of one aggregated total. Defaults to an empty array (one ungrouped result) when omitted."});var owe=d({tags:["aggregation"],url:`${RF}/multi-query`,method:"POST",body:r.Object({timeRange:ci,queries:ns,groupBy:r.Optional(qr),returnType:qF,dataSource:or,formula:co,executionOptions:yd,triggeredBy:r.Optional(r.Literal("refresh")),shouldStreamResults:r.Optional(r.Boolean()),clusterId:r.Optional(u({allowEmpty:!1})),clusterIds:r.Optional(es),viewAs:r.Optional(r.Object({owner:u({allowEmpty:!1,description:"Team ID to fetch data as"}),permissions:Tn}))}),response:tu});var Ed=["red","orange","amber","yellow","green","emerald","teal","cyan","sky","blue","indigo","purple","pink"],_d=["light","dark"];var VF={light:{red:{text:"foreground.red",background:"avatar.background.red"},orange:{text:"foreground.orange",background:"avatar.background.orange"},amber:{text:"foreground.amber",background:"avatar.background.amber"},yellow:{text:"foreground.yellow",background:"avatar.background.yellow"},green:{text:"foreground.green",background:"avatar.background.green"},emerald:{text:"foreground.emerald",background:"avatar.background.emerald"},teal:{text:"foreground.teal",background:"avatar.background.teal"},cyan:{text:"foreground.cyan",background:"avatar.background.cyan"},sky:{text:"foreground.sky",background:"avatar.background.sky"},blue:{text:"foreground.blue",background:"avatar.background.blue"},indigo:{text:"foreground.indigo",background:"avatar.background.indigo"},purple:{text:"foreground.purple",background:"avatar.background.purple"},pink:{text:"foreground.pink",background:"avatar.background.pink"}},dark:{red:{text:"avatar.foreground.foreground",background:"avatar.solid-background.red"},orange:{text:"avatar.foreground.foreground",background:"avatar.solid-background.orange"},amber:{text:"avatar.foreground.foreground",background:"avatar.solid-background.amber"},yellow:{text:"avatar.foreground.foreground",background:"avatar.solid-background.yellow"},green:{text:"avatar.foreground.foreground",background:"avatar.solid-background.green"},emerald:{text:"avatar.foreground.foreground",background:"avatar.solid-background.emerald"},teal:{text:"avatar.foreground.foreground",background:"avatar.solid-background.teal"},cyan:{text:"avatar.foreground.foreground",background:"avatar.solid-background.cyan"},sky:{text:"avatar.foreground.foreground",background:"avatar.solid-background.sky"},blue:{text:"avatar.foreground.foreground",background:"avatar.solid-background.blue"},indigo:{text:"avatar.foreground.foreground",background:"avatar.solid-background.indigo"},purple:{text:"avatar.foreground.foreground",background:"avatar.solid-background.purple"},pink:{text:"avatar.foreground.foreground",background:"avatar.solid-background.pink"}},gradient:{red:"var(--chakra-colors-gradient-red)",orange:"var(--chakra-colors-gradient-orange)",amber:"var(--chakra-colors-gradient-amber)",yellow:"var(--chakra-colors-gradient-yellow)",green:"var(--chakra-colors-gradient-green)",emerald:"var(--chakra-colors-gradient-emerald)",teal:"var(--chakra-colors-gradient-teal)",cyan:"var(--chakra-colors-gradient-cyan)",sky:"var(--chakra-colors-gradient-sky)",blue:"var(--chakra-colors-gradient-blue)",indigo:"var(--chakra-colors-gradient-indigo)",purple:"var(--chakra-colors-gradient-purple)",pink:"var(--chakra-colors-gradient-pink)"}},Ax=["activity-heart","activity","airplay","airpods","alarm-clock","anchor","annotation-dots","annotation-heart","annotation-question","annotation","announcement-03","asterisk-01","atom-01","atom-02","award-03","award-04","award-05","backpack","bank-note-01","bank-note-02","bank-note-03","battery-charging-01","beaker-01","beaker-02","bell-03","bell-04","bell-ringing-03","bell-ringing-04","bluetooth-connect","bluetooth-on","book-closed","book-open-01","book-open-02","bookmark","briefcase-01","briefcase-02","brush-01","brush-02","brush-03","building-01","building-02","building-03","building-08","bus","calculator","calendar-check-01","calendar-date","calendar-heart-01","calendar","camera-01","camera-lens","car-01","certificate-01","certificate-02","check-heart","clipboard-attachment","clipboard-check","clipboard-download","clipboard","clock-snooze","clock-stopwatch","cloud-01","cloud-lightning","cloud-moon","cloud-raining-01","cloud-raining-03","cloud-raining-05","cloud-raining-06","cloud-snowing-01","cloud-sun-01","cloud-sun-02","cloud-sun-03","code-browser","code-circle-01","code-circle-02","code-circle-03","code-square-01","code-square-02","coins-hand","coins-stacked-01","colors","compass-01","compass-02","compass-03","compass","credit-card-01","credit-card-02","cube-02","cube-04","cube-outline","currency-bitcoin-circle","currency-dollar-circle","currency-ethereum-circle","currency-euro-circle","currency-pound-circle","currency-ruble-circle","currency-rupee-circle","currency-yen-circle","cursor-click-01","cursor-click-02","diamond-01","diamond-02","dice-1","dice-2","dice-3","dice-4","dice-5","dice-6","disc-01","disc-02","droplets-01","droplets-02","droplets-03","dropper","face-content","face-frown","face-happy","face-neutral","face-sad","face-smile","face-wink","feather","file-02","file-05","file-06","file-heart-01","file-heart-02","file-search-01","file-search-02","file-search-03","film-01","film-02","fingerprint-03","fingerprint-04","flag-01","flag-04","flash-off","flash","gaming-pad-01","gaming-pad-02","gift-01","glasses-01","glasses-02","globe-03","globe-04","globe-05","globe-06","globe-slated-01","globe-slated-02","graduation-hat-01","graduation-hat-02","hash-01","hash-02","headphones-01","headphones-02","heart-circle","heart-hand","heart-hexagon","heart-octagon","heart-rounded","heart-square","hearts","hexagon-01","hexagon-02","home-03","home-smile","hourglass-01","hourglass-02","hourglass-03","hurricane-01","hurricane-02","hurricane-03","image-01","image-02","image-03","image-04","image-05","keyboard-01","laptop-01","life-buoy-01","life-buoy-02","lightbulb-02","lightbulb-03","lightbulb-04","lock-keyhole-circle","lock-keyhole-square","luggage-01","luggage-02","luggage-03","magic-wand-01","magic-wand-02","map-01","map-02","mark","marker-pin-01","marker-pin-04","marker-pin-05","marker-pin-06","medical-circle","medical-cross","medical-square","message-chat-square","message-notification-square","message-smile-square","message-text-square-02","microphone-01","microphone-02","microscope","modem-01","modem-02","monitor-03","monitor-04","monitor-05","moon-01","moon-eclipse","moon-star","music-note-01","music-note-02","music-note-plus","octagon","palette","paperclip","pentagon","phone-01","phone-02","phone-call-01","phone","piggy-bank-01","pin-01","pin-02","plane","play-circle","play-square","podcast","power-02","presentation-chart-01","printer","receipt","recording-01","recording-02","recording-03","rocket-01","rocket-02","roller-brush","rss-01","rss-02","ruler","scales-01","scales-02","server-06","shield-01","shield-02","shield-03","shield-dollar","shield-zap","shopping-bag-01","shopping-cart-01","signal-01","signal-02","signal-03","simcard","sliders-01","sliders-02","snowflake-01","snowflake-02","speaker-01","speaker-02","speaker-03","speedometer-01","speedometer-02","speedometer-03","speedometer-04","square","stand","star-03","star-07","sticker-circle","sticker-square","sun-setting-01","sun-setting-02","sun-setting-03","sun","sunrise","sunset","tablet-01","tag-01","tag-02","tag-03","target-01","target-02","target-03","target-04","target-05","terminal-browser","terminal-circle","terminal-square","thermometer-02","thermometer-03","thermometer-cold","thermometer-warm","thumbs-down","thumbs-up","ticket-01","tool-01","tool-02","train","tram","translate-01","triangle","trophy-01","trophy-02","truck-01","truck-02","tv-02","umbrella-01","umbrella-02","umbrella-03","virus","voicemail","wallet-01","wallet-02","wallet-05","watch-circle","watch-square","waves","webcam-01","webcam-02","wind-01","wind-02","wind-03","youtube","zap-circle","zap-fast","zap"];var uwe=VF.light.red.background;var Id=2,bd=2;var Ox=[{key:"amex15_digits",name:"American Express card (1x15 digits)",category:"financial-data",example:"378282246310005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"amex4443_digits",name:"American Express card (4+4+4+3 digits)",category:"financial-data",example:"3782 8224 6310 005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"amex465_digits",name:"American Express card (4+6+5 digits)",category:"financial-data",example:"3782 822463 10005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"amex87_digits",name:"American Express card (8+7 digits)",category:"financial-data",example:"37828224 6310005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card14_digits",name:"Diners card (1x14 digits)",category:"financial-data",example:"30569309025904",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card4442_digits",name:"Diners card (4+4+4+2 digits)",category:"financial-data",example:"3056 9309 0259 04",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card464_digits",name:"Diners card (4+6+4 digits)",category:"financial-data",example:"3056 930902 5904",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card86_digits",name:"Diners card (8+6 digits)",category:"financial-data",example:"30569309 025904",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"discover_card16_digits",name:"Discover card (1x16 digits)",category:"financial-data",example:"6011111111111117",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"discover_card88_digits",name:"Discover card (2x8 digits)",category:"financial-data",example:"60111111 11111117",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"discover_card4444_digits",name:"Discover card (4x4 digits)",category:"financial-data",example:"6011 1111 1111 1117",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"jcb_card16_digits",name:"JCB card (1x16 digits)",category:"financial-data",example:"3530111333300000",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"jcb_card88_digits",name:"JCB card (2x8 digits)",category:"financial-data",example:"35301113 33300000",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"jcb_card4444_digits",name:"JCB card (4x4 digits)",category:"financial-data",example:"3530 1113 3330 0000",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"maestro_card16_digits",name:"Maestro card (1x16 digits)",category:"financial-data",example:"6759649826438453",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"maestro_card88_digits",name:"Maestro card (2x8 digits)",category:"financial-data",example:"67596498 26438453",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"maestro_card4444_digits",name:"Maestro card (4x4 digits)",category:"financial-data",example:"6759 6498 2643 8453",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"mastercard16_digits",name:"Mastercard (1x16 digits)",category:"financial-data",example:"5555555555554444",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"mastercard88_digits",name:"MasterCard (2x8 digits)",category:"financial-data",example:"55555555 55554444",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"mastercard4444_digits",name:"MasterCard (4x4 digits)",category:"financial-data",example:"5555 5555 5555 4444",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa16_digits",name:"Visa (1x16 digits)",category:"financial-data",example:"4111111111111111",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa19_digits",name:"Visa (1x19 digits)",category:"financial-data",example:"4111111111111111151",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa88_digits",name:"Visa (2x8 digits)",category:"financial-data",example:"41111111 11111111",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa883_digits",name:"Visa (8+8+3 digits)",category:"financial-data",example:"41111111 11111111 151",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa4444_digits",name:"Visa (4x4 digits)",category:"financial-data",example:"4111 1111 1111 1111",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa44443_digits",name:"Visa (4+4+4+4+3 digits)",category:"financial-data",example:"4111 1111 1111 1111 151",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"dropbox_long_lived_api_token",name:"Dropbox long lived API token",category:"credential",example:"767cb868836AAAAAAAAAAszri2cnmzu5tr0yf-nvclmwfyiswl67qyqw-uzn-scg",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:[a-z0-9]{11}(AAAAAAAAAA)[a-z0-9\\-_=]{43})"},{key:"dropbox_short_lived_api_token",name:"Dropbox short lived API token",category:"credential",example:"sl.nu0yvsrposcjeyjcpmbfrmqygllrxpahrgbt8flml9xroifbic",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:sl\\.[a-z0-9\\-=_]{50})"},{key:"french_nirpp",name:"French social security number (NIRPP)",category:"personal-information",example:"188073512757119",isUsingLuhnAlgorithm:!1,regexp:"([12])\\s*[0-9]{2}\\s*(0[1-9]|1[0-2])\\s*(2[AB]|[0-9]{2})\\s*([0-9]{3})\\s*([0-9]{3})(\\s*[0-9]{2})?"},{key:"ip_address",name:"IP address",category:"device-identifier",example:"81.55.13.53",isUsingLuhnAlgorithm:!1,regexp:""},{key:"social_security_number",name:"Social security number (XXX-XX-XXXX)",category:"personal-information",example:"437-02-2223",isUsingLuhnAlgorithm:!1,regexp:"(?x)(?-u:\\b)(?:00[1-9]|0[1-9][0-9]|[1-578][0-9]{2}|6[0-57-9][0-9]|66[0-57-9])-(?:0[1-9]|[1-9]0|[1-9][1-9])-(?:000[1-9]|00[1-9]0|0[1-9]00|[1-9]000|[1-9]{4})(?-u:\\b)"},{key:"social_security_number_space",name:"Social security number (XXX XX XXXX)",category:"personal-information",example:"437 02 2223",isUsingLuhnAlgorithm:!1,regexp:"(?x)(?-u:\\b)(?:00[1-9]|0[1-9][0-9]|[1-578][0-9]{2}|6[0-57-9][0-9]|66[0-57-9])\\s+(?:0[1-9]|[1-9]0|[1-9][1-9])\\s+(?:000[1-9]|00[1-9]0|0[1-9]00|[1-9]000|[1-9]{4})(?-u:\\b)"},{key:"social_security_number_digits",name:"Social security number (9 digits)",category:"personal-information",example:"437022223",isUsingLuhnAlgorithm:!1,regexp:"(?x)(?-u:\\b)(?:00[1-9]|0[1-9][0-9]|[1-578][0-9]{2}|6[0-57-9][0-9]|66[0-57-9])(?:0[1-9]|[1-9]0|[1-9][1-9])(?:000[1-9]|00[1-9]0|0[1-9]00|[1-9]000|[1-9]{4})(?-u:\\b)"},{key:"email",name:"Email",category:"credential",example:"admin@tsuga.com",isUsingLuhnAlgorithm:!1,regexp:"[a-zA-Z0-9-_.]*[a-zA-Z0-9_](@[a-zA-Z0-9_]+)(\\.[a-zA-Z0-9_]+(\\.[a-zA-Z0-9_]+)?[a-zA-Z])(?-u:\\b)"},{key:"one_password_secret_key",name:"1Password secret key",category:"credential",example:"A3-O28NKC-F58GULWCN72-4NIKS-KGY7V-U7FAT",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)A3-[A-Z0-9]{6}-(?:(?:[A-Z0-9]{11})|(?:[A-Z0-9]{6}-[A-Z0-9]{5}))-[A-Z0-9]{5}-[A-Z0-9]{5}-[A-Z0-9]{5}(?-u:\\b)"},{key:"one_password_service_account_token",name:"1Password service account token",category:"credential",example:"ops_eyJdAZ/FoIyz0jAXpEQOrRdIE8ydVaYfAXeZXGFqHWfBOjnE/Vgf5kHIbwrNAp2WeFNPeFiVJPlLv1hmaTVums0ldq1Kv8JEglMqP3f0ATBuX/WRbKqXYS3Z1wSzxg6S0krW4df7ZplvK04+JhJimejyTEH5dYaxqsYDBSLxjeEq7JWsmHEuXj6WP5qQi7FB+5s+CwhWPWY/jDhUMB3fdowXbfv5VnWri3iYrfBh+bFeRe9KURhXGHRDE9hgs",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ops_eyJ[a-zA-Z0-9+/]{50}"},{key:"adafruit_api_key",name:"Adafruit API key",category:"credential",example:"jb9pb4unb2bhe7xqepmgwtl2jg7ti101",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{32})"},{key:"adobe_client_id",name:"Adobe client ID",category:"credential",example:"c4166853dfd2897ebe706d49ef13fe63",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"adobe_client_secret",name:"Adobe client secret",category:"credential",example:"p8e-bb6e1614324ae48e507d33af176db3b7",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:p8e-[a-z0-9]{32})"},{key:"age_secret_key",name:"Age secret key",category:"credential",example:"AGE-SECRET-KEY-1QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)AGE-SECRET-KEY-1[QPZRY9X8GF2TVDW0S3JN54KHCE6MUA7L]{58}"},{key:"airtable_api_key",name:"Airtable API key",category:"credential",example:"19b73hbi0tc5cdy4w",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{17})"},{key:"algolia_api_key",name:"Algolia API key",category:"credential",example:"346155deb68d31c4018d73de73452947",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"alibaba_access_key_id",name:"Alibaba Cloud AccessKey ID",category:"credential",example:"LTAI7cc6804e4c2155cd52bd",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:LTAI[a-z0-9]{20})"},{key:"alibaba_secret_key",name:"Alibaba Cloud secret key",category:"credential",example:"suwixirhh10xhnko9bv0vfg2971u9p",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{30})"},{key:"anthropic_admin_api_key",name:"Anthropic admin API key",category:"credential",example:"sk-ant-admin01-abc12fake-456def789ghij-klmnopqrstuvwx-3456yza789bcde-12fakehijklmnopby56aaaogaopaaaabc123xyzAA",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sk-ant-admin01-[a-zA-Z0-9_-]{93}AA)"},{key:"anthropic_api_key",name:"Anthropic API key",category:"credential",example:"sk-ant-api03-abc123xyz-456def789ghij-klmnopqrstuvwx-3456yza789bcde-1234fghijklmnopby56aaaogaopaaaabc123xyzAA",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sk-ant-api03-[a-zA-Z0-9_-]{93}AA)"},{key:"artifactory_api_key",name:"Artifactory API key",category:"credential",example:"AKCpt771klpkqllt647fdf36fq43radbz2w2nyetvx4l90qyeef8kbgkmke63ul5vf6mqsy82",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)AKCp[A-Za-z0-9]{69}(?-u:\\b)"},{key:"artifactory_reference_token",name:"Artifactory reference token",category:"credential",example:"cmVmdc6i6888t9viuobfd88e46pdonjjsvmme6np82qti7wzbj7l9m1ygtyl9wik",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)cmVmd[A-Za-z0-9]{59}(?-u:\\b)"},{key:"asana_client_id",name:"Asana client ID",category:"credential",example:"9760134337886314",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9]{16})"},{key:"asana_client_secret",name:"Asana client secret",category:"credential",example:"tcnc8mjrf5bad359nnz3j1z90gow67ji",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"atlassian_api_token",name:"Atlassian API token",category:"credential",example:"fdo4scsa4kh53jnenkfp5fbe",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:[a-z0-9]{20}[a-f0-9]{4})|(?-u:\\b)(?:ATATT3[A-Za-z0-9_-=]{50})"},{key:"authress_service_client_access_key",name:"Authress service client access key",category:"credential",example:"sc_scmz00n9xj.0ykp.acc_2k5vtnrec4.55vc9459s-gc5qlia7a67jvzm0bobn3g0ezimd3b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:sc|ext|scauth|authress)_[a-z0-9]{5,30}\\.[a-z0-9]{4,6}\\.(?-i:acc)[_-][a-z0-9-]{10,32}\\.[a-z0-9+/_=-]{30})"},{key:"aws_access_token",name:"AWS access token",category:"credential",example:"AKIALALEMEL33243OLIB",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:A3T[A-Z0-9]|AKIA|ASIA|ABIA|ACCA)[A-Z2-7]{16})(?-u:\\b)"},{key:"azure_ad_client_secret",name:"Azure AD client secret",category:"credential",example:"bP88Q~rcBcYjzzOhg1Hnn76Wm3jGgakZiZ.8vMgR",isUsingLuhnAlgorithm:!1,regexp:"(?:^|[\\\\'\"` \\r\\n\\t\\f\\v>=:(?:,)])(?:[a-zA-Z0-9_~.]{3}[0-9]Q~[a-zA-Z0-9_~.-]{31,34})(?:$|[\\\\'\"` \\r\\n\\t\\f\\v<),])"},{key:"bitbucket_client_id",name:"Bitbucket client ID",category:"credential",example:"yyxmjnl3kahirvct7sat2082pzqdyf09",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"bitbucket_client_secret",name:"Bitbucket client secret",category:"credential",example:"fylw1pominwz91e5guqjiugw6srutpl64vzch5rnt8xnt31ka7so9va73fscz836",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{64})"},{key:"beamer_api_token",name:"Beamer API token",category:"credential",example:"b_zhy-phuoqk13asco6az4u_0yhtklgswm4umkv95nv4gu",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:b_[a-z0-9=_\\-]{44})"},{key:"codecov_access_token",name:"Codecov access token",category:"credential",example:"r93iopllonuphk41qglet20y8cb83thm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"clickhouse_cloud_api_secret_key",name:"ClickHouse Cloud API secret key",category:"credential",example:"4b1dbRdW3rOcB7xLthrM4BTBGK1qPLkHigpN1bXD6z",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:4b1d[A-Za-z0-9]{38})(?-u:\\b)"},{key:"clojars_api_token",name:"Clojars API token",category:"credential",example:"CLOJARS_d1vd7t0blxaarzx25dxoda4hm5ox86st6o5ww7tnzsfz07wvu223bf0fmgim",isUsingLuhnAlgorithm:!1,regexp:"CLOJARS_[a-z0-9]{60}"},{key:"cloudflare_api_key",name:"Cloudflare API key",category:"credential",example:"ckg0h_dzkxnl627gy3nskpq9wzm4d5hc_vxk272h",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{40})"},{key:"cloudflare_global_api_key",name:"Cloudflare global API key",category:"credential",example:"1d003bb65ec73ad2691fb76631b6496e3c9d9",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{37})"},{key:"cloudflare_origin_ca_key",name:"Cloudflare Origin CA key",category:"credential",example:"v1.0-aaa334dc886f30631ba0a610-0d98ef66290d7e50aac7c27b5986c99e6f3f1084c881d8ac0eae5de1d1aa0644076ff57022069b3237d19afe60ad045f207ef2b16387ee37b749441b2ae2e9ebe5b4606e846475d4a5",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:v1\\.0-[a-f0-9]{24}-[a-f0-9]{50})"},{key:"cohere_api_token",name:"Cohere API token",category:"credential",example:"lpn59BQ4FNUabVJh1vCpIqZpQbaViELQrTa14p9D",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:[a-zA-Z0-9]{40})"},{key:"confluent_access_token",name:"Confluent access token",category:"credential",example:"kkat92sclkukwvr2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{16})"},{key:"confluent_secret_key",name:"Confluent secret key",category:"credential",example:"64d4ppp37l9fjhadm8vv0awie6wjo4d6ourfcqvi2bcs2tm95x4f0e8gyb8z8usj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"contentful_delivery_api_token",name:"Contentful delivery API token",category:"credential",example:"eumospigka64wiwpavfmmblrq7x1hm6gz84wiiw2ff3",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{43})"},{key:"curl_auth_header",name:"Curl authorization header",category:"credential",example:"curl --header 'Authorization: 5eb4223e-5008-46e5-be67-c7b8f2732305'",isUsingLuhnAlgorithm:!1,regexp:`(?-u:\\b)curl(?-u:\\b)(?:.*?|.*?(?:[\\r\\n]{1,2}.*?){1,5})[ \\t\\n\\r](?:-H|--header)(?:=|[ \\t]{0,5})(?:"(?:Authorization:[ \\t]{0,5}(?:Basic[ \\t](?:[a-z0-9+/]{8,}={0,3})|(?:Bearer|(?:Api-)?Token)[ \\t](?:[a-zA-Z0-9_=~@.+/-]{8,})|(?:[a-zA-Z0-9_=~@.+/-]{8,}))|(?:(?:X-(?:[a-z]+-)?)?(?:Api-?)?(?:Key|Token)):[ \\t]{0,5}(?:[a-zA-Z0-9_=~@.+/-]{8,}))"|'(?:Authorization:[ \\t]{0,5}(?:Basic[ \\t](?:[a-z0-9+/]{8,}={0,3})|(?:Bearer|(?:Api-)?Token)[ \\t](?:[a-zA-Z0-9_=~@.+/-]{8,})|(?:[a-zA-Z0-9_=~@.+/-]{8,}))|(?:(?:X-(?:[a-z]+-)?)?(?:Api-?)?(?:Key|Token)):[ \\t]{0,5}(?:[a-zA-Z0-9_=~@.+/-]{8,}))')(?:(?-u:\\B)|[ \\r\\n\\t\\f\\v]|\\z)`},{key:"curl_auth_user",name:"Curl basic authentication",category:"credential",example:"curl -u elastic:P@ssw0rd$1",isUsingLuhnAlgorithm:!1,regexp:`(?-u:\\b)curl(?-u:\\b)(?:.*|.*(?:[\\r\\n]{1,2}.*){1,5})[ \\t\\n\\r](?:-u|--user)(?:=|[ \\t]{0,5})(?:"(:[^"]{3,}|[^:"]{3,}:|[^:"]{3,}:[^"]{3,})"|'(?:[^:']{3,}:[^']{3,})'|(?:(?:"[^"]{3,}"|'[^']{3,}'|[a-zA-Z0-9_$@.-]+):(?:"[^"]{3,}"|'[^']{3,}'|[a-zA-Z0-9_\${}@.-]+)))(?:[ \\r\\n\\t\\f\\v]|\\z)`},{key:"databricks_api_token",name:"Databricks API token",category:"credential",example:"dapia2553f815d29a193fd09c2bb55201895",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:dapi[a-f0-9]{32}(?:-[0-9])?)"},{key:"datadog_access_token",name:"Datadog access token",category:"credential",example:"ljgbhjnca2hy5yc2nv7cag1ag7ehx2hc6geparov",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{40})"},{key:"defined_networking_api_token",name:"Defined Networking API token",category:"credential",example:"dnkey-nowf_nwyqhvqt1gi66xnuuf2rb-bfxnr9_qydyxnxn1y8uijvhhp9owllbg-2czoe-7qs5_w5650xei",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:-[a-z0-9=_\\-]{26}-[a-z0-9=_\\-]{52})"},{key:"digitalocean_pat",name:"DigitalOcean personal access token",category:"credential",example:"dop_v1_ec8f4a856c1459bd442a275461e2f709506347de30b180851cde71f696e9fcc8",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:dop_v1_[a-f0-9]{64})"},{key:"digitalocean_access_token",name:"DigitalOcean OAuth access token",category:"credential",example:"doo_v1_42b8ea6c4b0c373f88aff9d3fa87e123ab23b0d3c22ac6d4361a4e9c1e89eaa6",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:doo_v1_[a-f0-9]{64})"},{key:"digitalocean_refresh_token",name:"DigitalOcean OAuth refresh token",category:"credential",example:"dor_v1_4d9b3e6fbe65ab472e464dfa6377d702e80164442acdfbeb3ef032d917cb9984",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:dor_v1_[a-f0-9]{64})"},{key:"discord_api_token",name:"Discord API token",category:"credential",example:"7eb855d9a40747182d0b0ea74df27aee31d05756a9933a815a3ccb5a46b2d61d",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{64})"},{key:"discord_client_id",name:"Discord client ID",category:"credential",example:"763721114261247538",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9]{18})"},{key:"discord_client_secret",name:"Discord client secret",category:"credential",example:"13641266018325206246161633988007",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{32})"},{key:"doppler_api_token",name:"Doppler API token",category:"credential",example:"dp.pt.vgin8wwjy7sx66fyq99tavkm3y5g2jdxmsufh257dhj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)dp\\.pt\\.[a-z0-9]{43}"},{key:"dropbox_api_token",name:"Dropbox API token",category:"credential",example:"rdlztoij88rzrsk",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{15})"},{key:"droneci_access_token",name:"DroneCI access token",category:"credential",example:"v26gffr903rbti5v7m392ba0u7oarz36",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"duffel_api_token",name:"Duffel API token",category:"credential",example:"duffel_test_-yd6b3pc4jy593pt5kr2l3ynzkb5b_f619dshefiz=v",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)duffel_(?:test|live)_[a-z0-9_\\-=]{43}"},{key:"dynatrace_api_token",name:"Dynatrace API token",category:"credential",example:"dt0c01.ben820rdpb1so4kasfx3yn4a.zkje7lawif35udsin5t1mi1m1sne7wdzphlzrmdnu3j69gr4kgf5dwg4x5lb30zg",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)dt0c01\\.[a-z0-9]{24}\\.[a-z0-9]{64}"},{key:"easypost_api_token",name:"EasyPost API token",category:"credential",example:"EZAKBVScDZwZFv0nJXHBcxPGil7eztnPJOSmDFf2NGKQk6Dn7VqULciSRm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)EZAK[a-z0-9]{54}(?-u:\\b)"},{key:"easypost_test_api_token",name:"EasyPost test API token",category:"credential",example:"EZTKuxUXVU5HBS1K2iyh165t3VtivpdxMgIf5Y2P1oJxeFeaJGcwzVexds",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)EZTK[a-z0-9]{54}(?-u:\\b)"},{key:"etsy_access_token",name:"Etsy access token",category:"credential",example:"8ssp35lhprxpb3sjyergcz5z",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{24})"},{key:"facebook_secret",name:"Facebook secret",category:"credential",example:"c41c21ba4fb5ee05398db86ca83f06db",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"facebook_access_token",name:"Facebook access token",category:"credential",example:"911602140448729|AY-lRJZq9BoDLobvAiP25L7RcMg",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:[0-9]{15,16}(\\||%)[0-9a-z\\-_]{27,40})"},{key:"facebook_page_access_token",name:"Facebook page access token",category:"credential",example:"EAAM9GOnCB9kBO2frzOAWGN2zMnZClQshlWydZCrBNdodesbwimx1mfVJgqZBP5RSpMfUzWhtjTTXHG5I1UlvlwRZCgjm3ZBVGeTYiqAAoxyED6HaUdhpGVNoPUwAuAWWFsi9OvyYBQt22DGLqMIgD7VktuCTTZCWKasz81Q822FPhMTB9VFFyClNzQ0NLZClt9zxpsMMrUZCo1VU1rL3CKavir5QTfBjfCEzHNlWAUDUV2YZD",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:EAA[MC][a-z0-9]{50})"},{key:"fastly_api_token",name:"Fastly API token",category:"credential",example:"im7_ux24tyyxz_4y4mvzj22akpid830c",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{32})"},{key:"finicity_client_secret",name:"Finicity client secret",category:"credential",example:"roepymyr0ce7wxhjvgb2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{20})"},{key:"finicity_api_token",name:"Finicity API token",category:"credential",example:'= "cce089057c8b7fe7f2a8474b9a050816',isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"flickr_access_token",name:"Flickr access token",category:"credential",example:"damvt93tudulk6wrfp36sawndc9pa7bb",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"finnhub_access_token",name:"Finnhub access token",category:"credential",example:"x01lnfp13spcbsa0at32",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{20})"},{key:"flutterwave_public_key",name:"Flutterwave public key",category:"credential",example:"FLWPUBK_TEST-99484d505b4ee5c1181a2884f5fe3852-X",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)FLWPUBK_TEST-[a-h0-9]{32}-X"},{key:"flutterwave_secret_key",name:"Flutterwave secret key",category:"credential",example:"FLWSECK_TEST-66187ac83488c2245f0d7e95fa37e833-X",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)FLWSECK_TEST-[a-h0-9]{32}-X"},{key:"flutterwave_encryption_key",name:"Flutterwave encryption key",category:"credential",example:"FLWSECK_TEST-6262214a02e7",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)FLWSECK_TEST-[a-h0-9]{12}"},{key:"flyio_access_token",name:"Fly.io access token",category:"credential",example:"fo1_m-HT0NHLBSPwMJ2hIer4v3lxtWEC7grXNidQxJMrVVE",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:fo1_[a-zA-Z0-9_-]{43}|fm1[ar]_[a-zA-Z0-9+\\/]{50}))"},{key:"frameio_api_token",name:"Frame.io API token",category:"credential",example:"fio-u-4ov9vjtr2wwj8j1gob-8xrx2-1=z818psmitskgoq4=p-_k77d54034z55xk-lqh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)fio-u-[a-z0-9\\-_=]{64}"},{key:"freshbooks_access_token",name:"FreshBooks access token",category:"credential",example:"gqw118uwne1nddlt4yruvvs4jr9s0vrj5mxaswgb2amacod8lgnmrknsvbovsx1g",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"gocardless_api_token",name:"GoCardless API token",category:"credential",example:"live_-z4lwtrrk6p6=-v1ig_y_4ceplziwek0lw=oz-eu",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:live_[a-z0-9\\-_=]{40})"},{key:"gcp_api_key",name:"GCP API key",category:"credential",example:"AIzaYpvGqEzpgB7R353HD9CxN8LuhZ6d6UfuXLL",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:AIza[a-zA-Z0-9_-]{35})"},{key:"github_pat",name:"GitHub personal access token",category:"credential",example:"ghp_t7i9llxuukeb7apn4zlnyeyz5b0007rsfs54",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ghp_[0-9a-zA-Z]{36}"},{key:"github_fine_grained_pat",name:"GitHub fine-grained personal access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)github_pat_[a-zA-Z0-9_]{82}"},{key:"github_oauth",name:"GitHub OAuth token",category:"credential",example:"gho_anlrm6zqscqityoqozv503by66dobnem4yxh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)gho_[0-9a-zA-Z]{36}"},{key:"github_app_token",name:"GitHub app token",category:"credential",example:"ghs_0zleityj4n1ulz178o9in1w97q1ifw8u3y8h",isUsingLuhnAlgorithm:!1,regexp:"(?:ghu|ghs)_[0-9a-zA-Z]{36}"},{key:"github_refresh_token",name:"GitHub refresh token",category:"credential",example:"ghr_inu1aa7qbgi46cf8nprbgh4kn03d0zk35raj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ghr_[0-9a-zA-Z]{36}"},{key:"gitlab_cicd_job_token",name:"GitLab CI/CD job token",category:"credential",example:"glcbt-7h2nr_6jmho0uoqkb1ww431kfl",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glcbt-[0-9a-zA-Z]{1,5}_[0-9a-zA-Z_-]{20}"},{key:"gitlab_deploy_token",name:"GitLab deploy token",category:"credential",example:"gldt-7a3o70gqa8zkal0zdp4x",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)gldt-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_feature_flag_client_token",name:"GitLab feature flag client token",category:"credential",example:"glffct-dsct62ndnvcj7alw5nas",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glffct-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_feed_token",name:"GitLab feed token",category:"credential",example:"glft-13956nvy00289v6xu0di",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glft-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_incoming_mail_token",name:"GitLab incoming mail token",category:"credential",example:"glimt-fcdt1a5jvj01si61jgkse2r20",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glimt-[0-9a-zA-Z_\\-]{25}"},{key:"gitlab_kubernetes_agent_token",name:"GitLab Kubernetes agent token",category:"credential",example:"glagent-8wxkulkbbuk7u6r3nvrefswdfw5o0v7vy81y4oky8rnfogm826",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glagent-[0-9a-zA-Z_\\-]{50}"},{key:"gitlab_oauth_app_secret",name:"GitLab OAuth app secret",category:"credential",example:"gloas-vawws2nw5kf6rizn49g41jc3jiy4xqioaihrwm1msltbdt4cbmo4x52tygcic7af",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)gloas-[0-9a-zA-Z_\\-]{64}"},{key:"gitlab_pat",name:"GitLab personal access token",category:"credential",example:"glpat-2gl3ku1497ms4gzyv16i",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glpat-[a-zA-Z0-9_-]{20}"},{key:"gitlab_pat_routable",name:"GitLab personal access token (routable)",category:"credential",example:"glpat-2hf7vebpux9j56tdcqqsvap7vxc.chvjof35u",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glpat-[0-9a-zA-Z_-]{27}\\.[0-9a-z]{2}[0-9a-z]{7}(?-u:\\b)"},{key:"gitlab_ptt",name:"GitLab personal access token (temporary)",category:"credential",example:"glptt-b54e8b7b90cf006b79af110baa9b8d9183fd7048",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glptt-[0-9a-f]{40}"},{key:"gitlab_rrt",name:"GitLab registration token",category:"credential",example:"GR1348941vnauzmn2hj0zncvt0nfe",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)GR1348941[a-zA-Z0-9_-]{20}"},{key:"gitlab_runner_authentication_token",name:"GitLab runner authentication token",category:"credential",example:"glrt-xbd1w7c9clbxm52zdxkm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glrt-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_runner_authentication_token_routable",name:"GitLab runner authentication token (routable)",category:"credential",example:"glrt-t5_8d8ugbkfzddae0dw06tvm0x7qxc.mwcd1a7cn",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glrt-t[0-9]_[0-9a-zA-Z_\\-]{27}\\.[0-9a-z]{2}[0-9a-z]{7}(?-u:\\b)"},{key:"gitlab_scim_token",name:"GitLab SCIM token",category:"credential",example:"glsoat-9jb5zk1nvy800c1uqhh0",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glsoat-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_session_cookie",name:"GitLab session cookie",category:"credential",example:"_gitlab_session=yjhub6vtrp60djn6rszuemeacsoqox97",isUsingLuhnAlgorithm:!1,regexp:"_gitlab_session=[0-9a-z]{32}"},{key:"gitter_access_token",name:"Gitter access token",category:"credential",example:"uazubes6trcd_1gym09opuf_8gj1rmvj6jwber4a",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{40})"},{key:"grafana_api_key",name:"Grafana API key",category:"credential",example:"eyJrIjoiyl5shjvqja0xkfbu38m24vn5httsipr1h9fgjhodxzlkpravuiy8h7hom5kt8gtwuguh2v",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:eyJrIjoi[A-Za-z0-9]{70}={0,3})"},{key:"grafana_cloud_api_token",name:"Grafana cloud API token",category:"credential",example:"glc_cb7p4j2g1qu0sy84me72ufmn1z8mqk8y",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:glc_[A-Za-z0-9+/]{32}={0,3})"},{key:"grafana_service_account_token",name:"Grafana service account token",category:"credential",example:"glsa_rm3sadbwl8o2c13v4ipgkz04h66kiy6t_edaea401",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:glsa_[A-Za-z0-9]{32}_[A-Fa-f0-9]{8})"},{key:"harness_api_key",name:"Harness API key",category:"credential",example:"pat.vzcxr183pymw194fdq1q0v.qjqjarqkd9ydxqagjmq3f5iq.8nn5nyaow3h5mmgjh053",isUsingLuhnAlgorithm:!1,regexp:"(?:pat|sat)\\.[a-zA-Z0-9_-]{22}\\.[a-zA-Z0-9]{24}\\.[a-zA-Z0-9]{20}"},{key:"hashicorp_tf_api_token",name:"HashiCorp Terraform API token",category:"credential",example:"984d8033429986.atlasv1.799k5cihj_807yc1e8afvla8ackd1khsb50nfeswbxbr1re54y0wpzs2tjy=",isUsingLuhnAlgorithm:!1,regexp:"[a-z0-9]{14}\\.(?-i:atlasv1)\\.[a-z0-9\\-_=]{60,70}"},{key:"heroku_api_key",name:"Heroku API key",category:"credential",example:"9127f65b-8b3f-c0b7-a336-a4347e71bc51",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"heroku_api_key_v2",name:"Heroku API key v2",category:"credential",example:"HRKU-AAxPYvV6l2R3DvF0w9VJ4m8cz9oaygOHxpQvcw--iD51MszQZeakD9DZsclX",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(HRKU-AA[0-9a-zA-Z_-]{58}))"},{key:"hubspot_api_key",name:"HubSpot API key",category:"credential",example:"86cb6664-b191-db72-95a7-49adebe84b74",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12})"},{key:"huggingface_access_token",name:"HuggingFace access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:hf_(?i:[a-z]{34}))"},{key:"huggingface_organization_api_token",name:"HuggingFace organization API token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:api_org_(?i:[a-z]{34}))"},{key:"intercom_api_key",name:"Intercom API key",category:"credential",example:"zuc5c=ykf5gcwesqvmh2pji6k3extx0rbalsznte3sdo7iu7f-lumol2npfk",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{60})"},{key:"intra42_client_secret",name:"Intra42 client secret",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:s-s4t2(?:ud|af)-[abcdef0123456789]{64})"},{key:"jfrog_api_key",name:"JFrog API key",category:"credential",example:"lj7nrgoo0kr04kw312zvly7l0olsn37vhto5wdn3yqi5srxnc2axstp7a1kewkxi717w295kh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{73})"},{key:"jfrog_identity_token",name:"JFrog identity token",category:"credential",example:"xh0x2upbtkkg1pseg7ezmcyw2c3kt0bt05l5v8ynvkro6wagolhch0f7kppplt8b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"jwt",name:"JSON web token",category:"credential",example:"ey7gzQUpN8Kz7XY6Yin.ey1o36_XrBphAG8WMHQ.",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:ey[a-zA-Z0-9]{17,}\\.ey[a-zA-Z0-9\\/\\\\_-]{17,}\\.(?:[a-zA-Z0-9\\/\\\\_-]{10,}={0,2})?)"},{key:"jwt_base64",name:"JSON web token base64",category:"credential",example:"ZXlKNE5YUWpVekkxTmlJNklsUjFUM0pDZVRKT1kxUnNSbE5YZFZvNFMyZzRWemhCYWxGaFoySTBabTVtVURGVGJFdE5Uemd0VTI4aWZRLmV5SnBjM01pT2lKcWIyVWlMQTBLSUNKbGVIQWlPakV6TURBNE1Ua3pPREFzRFFvZ0ltaDBkSEE2THk5bGVHRnRjR3hsTG1OdmJTOXBjMTl5YjI5MElqcDBjblZsZlEuZEJqZnRKZVo0Q1ZQLW1COTJLMjd1aGJVSlUxcDFyX3dXMWdGV0ZPRWpYaw==",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ZXlK(?:(?P<alg>aGJHY2lPaU)|(?P<apu>aGNIVWlPaU)|(?P<apv>aGNIWWlPaU)|(?P<aud>aGRXUWlPaU)|(?P<b64>aU5qUWlP)|(?P<crit>amNtbDBJanBi)|(?P<cty>amRIa2lPaU)|(?P<epk>bGNHc2lPbn)|(?P<enc>bGJtTWlPaU)|(?P<jku>cWEzVWlPaU)|(?P<jwk>cWQyc2lPb)|(?P<iss>cGMzTWlPaU)|(?P<iv>cGRpSTZJ)|(?P<kid>cmFXUWlP)|(?P<key_ops>clpYbGZiM0J6SWpwY)|(?P<kty>cmRIa2lPaUp)|(?P<nonce>dWIyNWpaU0k2)|(?P<p2c>d01tTWlP)|(?P<p2s>d01uTWlPaU)|(?P<ppt>d2NIUWlPaU)|(?P<sub>emRXSWlPaU)|(?P<svt>emRuUWlP)|(?P<tag>MFlXY2lPaU)|(?P<typ>MGVYQWlPaUp)|(?P<url>MWNtd2l)|(?P<use>MWMyVWlPaUp)|(?P<ver>MlpYSWlPaU)|(?P<version>MlpYSnphVzl1SWpv)|(?P<x>NElqb2)|(?P<x5c>NE5XTWlP)|(?P<x5t>NE5YUWlPaU)|(?P<x5ts256>NE5YUWpVekkxTmlJNkl)|(?P<x5u>NE5YVWlPaU)|(?P<zip>NmFYQWlPaU))[a-zA-Z0-9\\/\\\\_+\\-\\r\\n]{40,}={0,2}"},{key:"launchdarkly_access_token",name:"LaunchDarkly access token",category:"credential",example:"ezmej9s6yv4qwk2=yeb4kfi162p33b_2hzm7tr-0",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{40})"},{key:"linear_api_key",name:"Linear API key",category:"credential",example:"lin_api_0n5n0k26vb4ka9je9dqdcwl1dae5mbpfhb48xio6",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)lin_api_[a-z0-9]{40}"},{key:"linear_client_secret",name:"Linear client secret",category:"credential",example:"7b956760f09b81684ed833c524f081de",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"linkedin_client_id",name:"LinkedIn client ID",category:"credential",example:"18u930hak0em0r",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{14})"},{key:"linkedin_client_secret",name:"LinkedIn client secret",category:"credential",example:"uvkxd9rw41ylk1zj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{16})"},{key:"lob_api_key",name:"Lob API key",category:"credential",example:"test_02efbb923a38370aac769e3bedc4d3398be",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:(live|test)_[a-f0-9]{35})"},{key:"lob_pub_api_key",name:"Lob publishable API key",category:"credential",example:"test_pub_df170d9f5be9244959713dfee686c42",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:(test|live)_pub_[a-f0-9]{31})"},{key:"mailchimp_api_key",name:"MailChimp API key",category:"credential",example:"81277fbbe2dd9c5e18d5f28cebcc558c-us20",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32}-us[0-9][0-9])"},{key:"mailgun_pub_key",name:"Mailgun public validation key",category:"credential",example:"pubkey-5011bae1a4b57dfa83762c24b0e1299d",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:pubkey-[a-f0-9]{32})"},{key:"mailgun_private_api_token",name:"Mailgun private API token",category:"credential",example:"key-176f7ef066471ac351adab734d2c9fb2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:key-[a-f0-9]{32})"},{key:"mailgun_signing_key",name:"Mailgun webhook signing key",category:"credential",example:"24564bd3d54a469601d5ac5daecb9ad2-00001111-22223333",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-h0-9]{32}-[a-h0-9]{8}-[a-h0-9]{8})"},{key:"mapbox_api_token",name:"MapBox API token",category:"credential",example:"pk.5ko18udoy3cilkpgyedje9limykwj8n7wmhug4967o9wze284mmpuuhjzgig.edjzuv7jwhc6lnv5b3p9nc",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:pk\\.[a-z0-9]{60}\\.[a-z0-9]{22})"},{key:"mattermost_access_token",name:"Mattermost access token",category:"credential",example:"rtw2hncbfhpbyyri90d3q2mo1m",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{26})"},{key:"maxmind_license_key",name:"MaxMind license key",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:[A-Za-z0-9]{6}_[A-Za-z0-9]{29}_mmk)"},{key:"cisco_meraki_api_key",name:"Cisco Meraki API key",category:"credential",example:"acea14a1470f7cf443a031dde64065ce81c77b2b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:[0-9a-f]{40})"},{key:"messagebird_api_token",name:"MessageBird API token",category:"credential",example:"448q6im7yxutswabdko1n69ry",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{25})"},{key:"messagebird_client_id",name:"MessageBird client ID",category:"credential",example:"12345678-ABCD-ABCD-ABCD-1234567890AB",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"netlify_access_token",name:"Netlify access token",category:"credential",example:"3j1sa0o20v0k-cjbjn3vh_4uqnkvb3w_px5no2in",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{40,46})"},{key:"new_relic_user_api_key",name:"New Relic user API key",category:"credential",example:"NRAK-zozcnrh45ornsbl1duyfhell59u",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:NRAK-[a-z0-9]{27})"},{key:"new_relic_user_api_id",name:"New Relic user API ID",category:"credential",example:"k0jze7delork84k8ke1z1dm275yw2aqf5uu2cy7x1uiloll3xab5203hiz9tx9xx",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"new_relic_browser_api_token",name:"New Relic browser API token",category:"credential",example:"NRJS-c7fa1261a97506e4a45",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:NRJS-[a-f0-9]{19})"},{key:"new_relic_insert_key",name:"New Relic insight insert key",category:"credential",example:"NRII-4168ab7eb2e051f37144ad884d32ab34",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:NRII-[a-z0-9-]{32})"},{key:"notion_api_token",name:"Notion API token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:ntn_[0-9]{11}[A-Za-z0-9]{32}[A-Za-z0-9]{3})"},{key:"npm_access_token",name:"npm access token",category:"credential",example:"npm_vz9e7fvsn7o2n2tddg6b01gs7g9wldlys4vm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:npm_[a-z0-9]{36})"},{key:"nytimes_access_token",name:"NYTimes access token",category:"credential",example:"ako7xzi0mx7w15ogdkew7ilq7h13x8rl",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{32})"},{key:"octopus_deploy_api_key",name:"Octopus Deploy API key",category:"credential",example:"API-NFWN6F7X32BYDBU94IGY3V5ZQY",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:API-[A-Z0-9]{26})"},{key:"okta_access_token",name:"Okta access token",category:"credential",example:"003cKkRNNMy4ul7V8UDHEjEBGbnsQ6tejSHzfeBtcp",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:00[a-zA-Z0-9_=\\-]{40})"},{key:"openai_api_key",name:"OpenAI API key",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sk-(?:proj|svcacct|admin)-(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})T3BlbkFJ(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})(?-u:\\b)|sk-[a-zA-Z0-9]{20}T3BlbkFJ[a-zA-Z0-9]{20})"},{key:"openshift_user_token",name:"OpenShift user token",category:"credential",example:"sha256~OFL-TnR3jyLteu_rAuff3PUYNELVvByMRFYCcAkaJSR",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sha256~[a-zA-Z0-9_-]{43})(?:[^a-zA-Z0-9_-]|\\z)"},{key:"perplexity_api_key",name:"Perplexity API key",category:"credential",example:"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'",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pplx-[a-zA-Z0-9]{48})(?:[`'\" \\r\\n\\t\\f\\v;]|\\\\[nr]|$|(?-u:\\b))"},{key:"pgpassword_shell_assignment",name:"PGPASSWORD shell assignment",category:"credential",example:"PGPASSWORD='supersecret'",isUsingLuhnAlgorithm:!1,regexp:`(?-u:\\b)PGPASSWORD=(?:"[^"\\r\\n]+"|'[^'\\r\\n]+'|[^\\s'"]+)`},{key:"plaid_api_token",name:"Plaid API token",category:"credential",example:"access-development-4b0f8c31-83fe-e4c5-3d02-91e487b69d2d",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:access-(?:sandbox|development|production)-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"plaid_client_id",name:"Plaid client ID",category:"credential",example:"TTPjxpFNiwOct5XLdxjXD0Ta",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{24})"},{key:"plaid_secret_key",name:"Plaid secret key",category:"credential",example:"ikhqm7a9k76l8f544dl0v8kxvm2w55",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{30})"},{key:"planetscale_password",name:"PlanetScale password",category:"credential",example:"pscale_pw_9gvu8z79m4b814z0vv8266w70h3i7jlq",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pscale_pw_[a-zA-Z0-9_=\\.-]{32,64})"},{key:"planetscale_api_token",name:"PlanetScale API token",category:"credential",example:"pscale_tkn_nwy9jkjgnry96ftecsx_=jrxc6pkmmew",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pscale_tkn_[a-zA-Z0-9_=\\.-]{32,64})"},{key:"planetscale_oauth_token",name:"PlanetScale OAuth token",category:"credential",example:"pscale_oauth_zx8v3gzfnfxbymj__l629i68jnz5gnff",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pscale_oauth_[a-zA-Z0-9_=\\.-]{32,64})"},{key:"postman_api_token",name:"Postman API token",category:"credential",example:"PMAK-525b84aa46e2c588620d8123-06f9ca36c4aad4305baafbe00716b7bc8f",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:PMAK-[a-f0-9]{24}\\-[a-f0-9]{34})"},{key:"prefect_api_token",name:"Prefect API token",category:"credential",example:"pnu_kttbffyfgffu2sfbxzxw8mbpgvvtxjljwe1p",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pnu_[a-zA-Z0-9]{36})"},{key:"privateai_api_token",name:"PrivateAI API token",category:"credential",example:"iwuxqzqilzbfnccncvjz6px23dnej11h",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"private_key",name:"Private key",category:"credential",example:`-----BEGIN PRIVATE KEY-----
|
|
51
51
|
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDAC4AWkdwKYSd8
|
|
52
52
|
Ks14IReLcYgADhoXk56ZzXI=
|
|
53
|
-
-----END PRIVATE KEY-----`,isUsingLuhnAlgorithm:!1,regexp:"-----BEGIN[ A-Z0-9_-]{0,100}PRIVATE KEY(?: BLOCK)?-----[ \\r\\n\\t\\f\\v\\S-]{64,}?KEY(?: BLOCK)?-----"},{key:"pulumi_api_token",name:"Pulumi API token",category:"credential",example:"pul-b77e6bff9fddebbc2bb8eca94e3f29a41f6da70a",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pul-[a-f0-9]{40})"},{key:"pypi_upload_token",name:"PyPI upload token",category:"credential",example:"pypi-AgEIcHlwaS5vcmc128fd9e0b47dde39cfecad3a997273458e6392f6aac649ae38864bdd7ff12836",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)pypi-AgEIcHlwaS5vcmc[a-zA-Z0-9_-]{50}"},{key:"rapidapi_access_token",name:"RapidAPI access token",category:"credential",example:"g4x40h94pi_-zlklfz3-qvhiiu5zankyrqqwmsl60decihbqvl",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{50})"},{key:"readme_api_token",name:"ReadMe API token",category:"credential",example:"rdme_k38kau741xa5lw03mdkvcd4vn6s6hdhvhg1wxa4ls7dp8h58r0yxq65nsqwndn056pxsc4",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:rdme_[a-z0-9]{70})"},{key:"rubygems_api_token",name:"RubyGems API token",category:"credential",example:"rubygems_7790aaa8102395704a64594a11f6de4941a27f86bc3fc9d4",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:rubygems_[a-f0-9]{48})"},{key:"scalingo_api_token",name:"Scalingo API token",category:"credential",example:"tk-us-4fhmqrg-rl4416b3oij_qx3q284wbhbqpk7r3te4r14lafou",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:tk-us-[a-zA-Z0-9_-]{48})"},{key:"sendbird_access_id",name:"SendBird access ID",category:"credential",example:"7e7801fd-c25d-50ab-a723-01b94c8d6c5f",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"sendbird_access_token",name:"SendBird access token",category:"credential",example:"305f75f04e3afa65360c25d9944fdae91138328d",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{40})"},{key:"sendgrid_api_token",name:"SendGrid API token",category:"credential",example:"SG.--ed-fvdeffijnle7575jp1sh24wq_9y9hcjua5w3dnqh5-wyegkpzenziy1_qr=hf",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:SG\\.[a-z0-9=_\\-\\.]{66})"},{key:"sendinblue_api_token",name:"Sendinblue API token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:xkeysib-[a-f0-9]{64}\\-[a-z0-9]{16})"},{key:"sentry_access_token",name:"Sentry access token",category:"credential",example:"1ad463398f40a52bb94a3795762f4003d51b03b8a788cba55e3a81de81c72940",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{64})"},{key:"sentry_org_token",name:"Sentry org token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)sntrys_eyJpYXQiO[a-zA-Z0-9+/]{10}(?:LCJyZWdpb25fdXJs|InJlZ2lvbl91cmwi|cmVnaW9uX3VybCI6)[a-zA-Z0-9+/]{10}={0,2}_[a-zA-Z0-9+/]{43}(?:[^a-zA-Z0-9+/]|\\z)"},{key:"sentry_user_token",name:"Sentry user token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sntryu_[a-f0-9]{64})"},{key:"settlemint_application_access_token",name:"Settlemint application access token",category:"credential",example:"sm_aat_gshgzsv353m5yb9s",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sm_aat_[a-zA-Z0-9]{16})"},{key:"settlemint_personal_access_token",name:"Settlemint personal access token",category:"credential",example:"sm_pat_1yhza49gsle0trg8",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sm_pat_[a-zA-Z0-9]{16})"},{key:"settlemint_service_access_token",name:"Settlemint service access token",category:"credential",example:"sm_sat_cha543e6lb19llli",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sm_sat_[a-zA-Z0-9]{16})"},{key:"shippo_api_token",name:"Shippo API token",category:"credential",example:"shippo_live_1d0f80d04e7788c1edb8fc2b8076bbf8f59b84b7",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:shippo_(?:live|test)_[a-fA-F0-9]{40})"},{key:"shopify_access_token",name:"Shopify access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)shpat_[a-fA-F0-9]{32}"},{key:"shopify_custom_access_token",name:"Shopify custom access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)shpca_[a-fA-F0-9]{32}"},{key:"shopify_private_app_access_token",name:"Shopify private app access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)shppa_[a-fA-F0-9]{32}"},{key:"shopify_shared_secret",name:"Shopify shared secret",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)shpss_[a-fA-F0-9]{32}"},{key:"sidekiq_secret",name:"Sidekiq secret",category:"credential",example:"aa8d3915:64fb5cb5",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{8}:[a-f0-9]{8})"},{key:"sidekiq_sensitive_url",name:"Sidekiq sensitive URL",category:"credential",example:"https://cafebabe:deadbeef@gems.contribsys.com/",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)https?://(?:[a-f0-9]{8}:[a-f0-9]{8})@(?:gems.contribsys.com|enterprise.contribsys.com)(?:[\\/|\\#|\\?|:]|$)"},{key:"slack_bot_token",name:"Slack bot token",category:"credential",example:"xoxb-781236542736-2364535789652-GkwFDQoHqzXDVsC6GzqYUypD",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)xoxb-[0-9]{10,13}-[0-9]{10,13}[a-zA-Z0-9-]*"},{key:"slack_user_token",name:"Slack user token",category:"credential",example:"xoxp-41684372915-1320496754-45609968301-e708ba56e1517a99f6b5fb07349476ef",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)xox[pe](?:-[0-9]{10,13}){3}-[a-zA-Z0-9-]{28,34}"},{key:"slack_app_token",name:"Slack app token",category:"credential",example:"xapp-1-A052FGTS2DL-5171572773297-610b6a11f4b7eb819e87b767d80e6575a3634791acb9a9ead051da879eb5b55e",isUsingLuhnAlgorithm:!1,regexp:"xapp-[0-9]-[A-Z0-9]+-[0-9]+-[a-z0-9]+"},{key:"slack_config_access_token",name:"Slack config access token",category:"credential",example:"xoxe.xoxp-1-Mi0yLTM0MTQwNDE0MDE3Ni0zNjU5NDY0Njg4MTctNTE4MjA3NTQ5NjA4MC01NDEyOTYyODY5NzUxLThhMTBjZmI1ZWIzMGIwNTg0ZDdmMDI5Y2UxNzVlZWVhYzU2ZWQyZTZiODNjNDZiMGUxMzRlNmNjNDEwYmQxMjQ",isUsingLuhnAlgorithm:!1,regexp:"xoxe.xox[bp]-[0-9]-[A-Z0-9]{50}"},{key:"slack_config_refresh_token",name:"Slack config refresh token",category:"credential",example:"xoxe-1-My0xLTMxNzcwMjQ0MTcxMy01MTU4MTUyNjkxNzE0LTUxODE4NDI0MDY3MzYtMjA5MGFkOTFlZThkZWE2OGFlZDYwYWJjODNhYzAxYjA5ZjVmODBhYjgzN2QyNDdjOTNlOGY5NTg2YWM1OGM4Mg",isUsingLuhnAlgorithm:!1,regexp:"xoxe-[0-9]-[A-Z0-9]{50}"},{key:"slack_legacy_bot_token",name:"Slack legacy bot token",category:"credential",example:"xoxb-263594206564-FGqddMF8t08v8N7Oq4i57vs1",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)xoxb-[0-9]{8,14}-[a-zA-Z0-9]{18,26}"},{key:"slack_legacy_workspace_token",name:"Slack legacy workspace token",category:"credential",example:"xoxa-2-511111111-31111111111-3111111111111-e039d02840a0b9379c",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)xox[ar]-(?:[0-9]-)?[0-9a-zA-Z]{8,48}"},{key:"slack_legacy_token",name:"Slack legacy token",category:"credential",example:"xoxs-416843729158-132049654-5609968301-e708ba56e1",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)xox[os]-[0-9]+-[0-9]+-[0-9]+-[a-fA-F0-9]+"},{key:"slack_webhook_url",name:"Slack webhook URL",category:"credential",example:"hooks.slack.com/services/z6cvbfngk3h7i0vts4akmbxidtb8o3b4pq2sbbd6o86g",isUsingLuhnAlgorithm:!1,regexp:"(?:https?://)?hooks.slack.com/(?:services|workflows|triggers)/[A-Za-z0-9+/]{43,56}"},{key:"snyk_api_token",name:"Snyk API token",category:"credential",example:"12345678-ABCD-ABCD-ABCD-1234567890AB",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"sonar_api_token",name:"Sonar API token",category:"credential",example:"12345678ABCDEFH1234567890ABCDEFH12345678",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:(?:squ_|sqp_|sqa_)?[a-z0-9=_-]{40})"},{key:"stripe_access_token",name:"Stripe access token",category:"credential",example:"sk_test_cyge9m4s1kxiqdkszz0a57nyx6wk73",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:sk|rk)_(?:test|live|prod)_[a-zA-Z0-9]{10,99})"},{key:"square_access_token",name:"Square access token",category:"credential",example:"sq0atp-OQUxovdrj3tfFpSd66r3sY",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:EAAA|sq0atp-)[a-zA-Z0-9_-]{22,60})"},{key:"squarespace_access_token",name:"Squarespace access token",category:"credential",example:"86447eab-140f-2563-3572-bb016dafd692",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"sumologic_access_id",name:"SumoLogic access ID",category:"credential",example:"suJS4ZsaD5bQTt",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:su[a-zA-Z0-9]{12})"},{key:"sumologic_access_token",name:"SumoLogic access token",category:"credential",example:"1xohkwr8lpvm4osygkpe5zbd16c3376ver2qed1bssuko4uy4tij1bnf4dnwy7o4",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"microsoft_teams_webhook",name:"Microsoft Teams webhook URL",category:"credential",example:"https://mycompany.webhook.office.com/webhookb2/767lrnj6-okh8-dnh8-jey2-y2iteohrwz75@6igi6oz6-ud9w-wior-2zva-5vx0wp6wuiqk/IncomingWebhook/o1zox92ssprrppjtnvcjqq0q09k2wnc3/qwox5p9d-x4zr-3yis-t1on-s67zj50tmyht",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)https://[a-z0-9]+\\.webhook\\.office\\.com/webhookb2/[a-z0-9]{8}-(?:[a-z0-9]{4}-){3}[a-z0-9]{12}@[a-z0-9]{8}-(?:[a-z0-9]{4}-){3}[a-z0-9]{12}/IncomingWebhook/[a-z0-9]{32}/[a-z0-9]{8}-(?:[a-z0-9]{4}-){3}[a-z0-9]{12}"},{key:"telegram_bot_api_token",name:"Telegram bot API token",category:"credential",example:"59015865:A12o5wu6f78zofs0udypf9ti23u82g-qkfz",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9]{5,16}:(?-i:A)[a-z0-9_\\-]{34})"},{key:"travisci_access_token",name:"Travis CI access token",category:"credential",example:"zjgfo5fhshd5c60hpz22wh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{22})"},{key:"twilio_api_key",name:"Twilio API key",category:"credential",example:"SKa585fd034fcd16cdd741f7df9b57fb3b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)SK[0-9a-fA-F]{32}"},{key:"twitch_api_token",name:"Twitch API token",category:"credential",example:"1hm9gcychlkpf93jdjnwdu0uaamu6d",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{30})"},{key:"twitter_api_key",name:"Twitter API key",category:"credential",example:"m8zqu4etx07bjt7tyeacc6pox",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{25})"},{key:"twitter_api_secret",name:"Twitter API secret",category:"credential",example:"7f4gxkubw9qs346ik99zk3z8b6kk3d7g8toi7zujgvgbt8q0yv",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{50})"},{key:"twitter_access_token",name:"Twitter access token",category:"credential",example:"465616696186918-96B1NCD5CH0uyi7zUHiS",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9]{15,25}-[a-zA-Z0-9]{20,40})"},{key:"twitter_access_secret",name:"Twitter access secret",category:"credential",example:"vyuo5peybdzznr7z0ua5wamhogusans4m29uzi25w4jgj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{45})"},{key:"twitter_bearer_token",name:"Twitter bearer token",category:"credential",example:"AAAAAAAAAAAAAAAAAAAAAAWRGWFGlfwyqNrrIa3pewqNNLX0jQMj2sR6M2cZUfBdqXDtkt7Nsb56F4tCz7Pt8ujbosrLxnRqYgwI0b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:A{22}[a-zA-Z0-9%]{80})"},{key:"typeform_api_token",name:"Typeform API token",category:"credential",example:"tfp_o-nsn=6eg2ios=4g652xhf933qor4jj7ort2qh_uw_5jdsuffp31ln=e-2a",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:tfp_[a-z0-9\\-_\\.=]{59})"},{key:"vault_batch_token",name:"Vault batch token",category:"credential",example:"hvb.x84j4cl53mzvhvb1nfc3mfi721gh5i-92f96lt0gns5lpksfu5f0199j-gw4ycxg6au4ser86mczcr_nx6ur2elbpazfrybo80fxjv3bghxshml3g261l6qi03yrz03qup84jk-fc2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:hvb\\.[a-zA-Z0-9_-]{50})"},{key:"vault_service_token",name:"Vault service token",category:"credential",example:"s.8QH9knZV94f0IjBZismfOPD0",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:hvs\\.[a-zA-Z0-9_-]{90}|s\\.(?i:[a-z0-9]{24})))"},{key:"yandex_api_key",name:"Yandex API key",category:"credential",example:"AQVN9wiAh8pyz3lmB5WTo_KUuPDXlxtzkA5-YFG",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:AQVN[A-Za-z0-9_\\-]{35,38})"},{key:"yandex_aws_access_token",name:"Yandex AWS access token",category:"credential",example:"YCZ6DHVrZONPNtgwWLZPrIGyviSrudRVSr8w0b1S",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:YC[a-zA-Z0-9_\\-]{38})"},{key:"yandex_access_token",name:"Yandex access token",category:"credential",example:"t1.L=.WJ9CYVI5eeLkTOrMM_dgaPgdmpen48R8RYsL4VJqelVKDmrqYsSHkH6QyVVhJkuHSQFTd0NOhClEDyCz7eEbh5=",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:t1\\.[A-Z0-9a-z_-]+[=]{0,2}\\.[A-Z0-9a-z_-]{86}[=]{0,2})"},{key:"zendesk_secret_key",name:"Zendesk secret key",category:"credential",example:"iydgm2jofftb2xu7niv55qnfxdwbwmqt2s561bgc",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{40})"},{key:"infracost_api_token",name:"Infracost API token",category:"credential",example:"ico-fNZw8jjy6TugMUHKWX4l9iSP3i95SPNH",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:ico-[a-zA-Z0-9]{32})"},{key:"iban",name:"Iban",category:"financial-data",example:"FR7630006000011234567890189",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)[a-zA-Z]{2}[0-9]{2}[a-zA-Z0-9]{11,30}(?-u:\\b)"},{key:"aikido_token",name:"Aikido token",category:"credential",example:"AIK_SECRET_XU28CmBY7Kxk3RPrqfHk9n6p5QX4p1tXzvJ7J1B3RPrqfHk9n6p5QX4p1tXzvJ7J",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)AIK_SECRET_[A-Za-z0-9]{64}"},{key:"aikido_ci_token",name:"Aikido CI secret",category:"credential",example:"AIK_CI_US_XU28CmBY7Kxk3RPrqfHk9n6p5QX4p1tXzvJ7J1B3RPrqfHk9n6p5QX4p1tXzvJ7J",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)AIK_CI_(US_|ME_)?[A-Za-z0-9]{64}"},{key:"tsuga_ingestion_key",name:"Tsuga ingestion key",category:"credential",example:"tsuga_in:v1:OUvrwavCG//ixL08HEds9OAT",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)tsuga_in:v1:[A-Za-z0-9+/]{24}"},{key:"tsuga_operation_key",name:"Tsuga operation key",category:"credential",example:"tsuga_op:v1:zz3-LWv-sLy:0k7Skt255M0yXe/ZLBoiSamb",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)tsuga_op:v1:[A-Za-z0-9_-]+:[A-Za-z0-9+/]{24}"}],Dq=Sx.map(e=>e.key);var LUe=new Set(Dq),kUe=Sx.map(e=>e.key);var $="context";var Ax="trace_id",eu=`${$}.team`,KUe=`${$}.env`,zUe=`${$}.api_key_id`,tu=`${$}.service.name`,YUe=`${$}.service.version`,ru=`${$}.span.kind`,nu=`${$}.span.name`,co=`${$}.status.code`,Id="resource.attributes.team",Ox=["SPAN_KIND_UNSPECIFIED","SPAN_KIND_INTERNAL","SPAN_KIND_SERVER","SPAN_KIND_CLIENT","SPAN_KIND_PRODUCER","SPAN_KIND_CONSUMER"];var ns=`${$}.host.name`,Gq=`${$}.instance`,$q=`${$}.instanceid`,jq=`${$}.instance_name`,VUe=`${$}.telemetry.sdk.language`,QUe=`${$}.process.runtime.name`,WUe=`${$}.scope.name`,ZUe=`${$}.cloud.provider`,XUe=`${$}.cloud.platform`,JUe=`${$}.aws.ecs.task.arn`,ewe=`${$}.k8s.cluster.name`,twe=`${$}.k8s.cluster.uid`,rwe=`${$}.k8s.namespace.name`,Fq=`${$}.k8s.pod.name`,nwe=`${$}.k8s.pod.uid`,owe=`${$}.k8s.container.name`,iwe=`${$}.k8s.node.name`,awe=`${$}.k8s.node.uid`,qq=`${$}.k8s.deployment.name`,swe=`${$}.k8s.deployment.uid`,Bq=`${$}.k8s.replicaset.name`,cwe=`${$}.k8s.replicaset.uid`,Hq=`${$}.k8s.statefulset.name`,pwe=`${$}.k8s.statefulset.uid`,Kq=`${$}.k8s.daemonset.name`,uwe=`${$}.k8s.daemonset.uid`,lwe=`${$}.k8s.job.name`,mwe=`${$}.k8s.job.uid`,dwe=`${$}.k8s.cronjob.name`,fwe=`${$}.k8s.cronjob.uid`,pi="status_code",ou="span.name";var iu="span.kind";var zq="db.system.name",Yq="db.system",Vq="db.namespace",Qq="db.name";var gwe=`span_attributes.${Vq}`,hwe=`span_attributes.${Qq}`,ywe=`span_attributes.${zq}`,Twe=`span_attributes.${Yq}`;var Ewe={name:"tsuga.internal.processing_tag_policy_violations_total",attributes:{tagPolicyId:`${$}.tag_policy_id`,dataSource:`${$}.data_source`}};var _we={name:"tsuga.internal.event_size_bytes",attributes:{batchKind:`${$}.batch_kind`,batchKindMetricsFilter:`${$}.batch_kind:metrics`,sourceApiKeyId:`${$}.source_api_key_id`,sourceEnv:`${$}.source_env`,sourceTeam:`${$}.source_team`}};var bd="__tsuga_metadata__",Iwe=`${bd}.signature`,bwe=`${bd}.routes`,Swe=`${bd}.trace_id_bucket`;var Cwe={[ru]:iu,[ru.replace(`${$}.`,"")]:iu,[nu]:ou,[nu.replace(`${$}.`,"")]:ou,[co]:pi,[co.replace(`${$}.`,"")]:pi},Pwe={[iu]:ru,[ou]:nu,[pi]:co};function xx(e){return e.replace(/ies$/,"y").replace(/s$/,"")}var Rx=["alert_cluster","alert_conditions","alert_data_url","alert_id","alert_owner","alert_previous_status","alert_priority","alert_start_time","alert_status","alert_tags","alert_timeframe","alert_title","alert_transition","alert_triggered_by","dashboard_url","monitor_url"],Cx=["alert_queries","alert_thresholds","alert_values"],Wq=[...Rx,...Cx],Px=["alert_event_name","alert_message"],tve=[...Wq,...Px],rve=new Set([...Rx,...Px]),nve=new Set(Cx);var Sd={aws:"aws",gcp:"gcp",azure:"azure"},_n=[Sd.aws,Sd.gcp,Sd.azure];var Ux=r.Object({id:r.String({description:"Unique Tsuga cluster ID. Tsuga assigns it when the cluster record is created. Use this value as `clusterId` with public API requests that accept `clusterId`."}),name:r.String({description:"Cluster name stored in Tsuga. Usable as a display label when `friendlyName` is not set."}),friendlyName:r.Optional(r.String({description:"Human-readable display name for the cluster. Present when a friendly name is configured."})),clusterType:r.Enum(_n,{description:"Cloud provider selected for the Tsuga cluster."}),clusterRegion:r.String({description:"Cloud region selected for the cluster using the provider region identifier."})},{$id:"Cluster",description:"Tsuga cluster available to the organization. Use its `id` to scope public API requests that accept `clusterId`."}),Zq={id:"abc-123-def",name:"production",friendlyName:"Production (US)",clusterType:"aws",clusterRegion:"us-east-1"};Object.assign(Ux,{examples:[Zq]});var wx=d({description:"Lists Tsuga clusters available to the organization. Use cluster IDs with public API requests that accept `clusterId`, such as telemetry, service, Kubernetes Explorer, and quality-report requests.",operationId:"listClusters",tags:["clusters"],url:`/${"v1"}/clusters`,method:"GET",response:r.Array(Ux)});function vx(e,t){e.command("clusters").description("Manage Tsuga cluster selection").command("list").description("List all Tsuga clusters available to the operation API key").action(async()=>{let o=await t()(wx);ee(o)})}function Lx(e,t,n,o){let i=e.commands.map(c=>c.name()).filter(c=>!c.startsWith("__")),a=e.options.map(c=>c.long).filter(c=>!!c);for(let c of e.options)(c.required||c.optional)&&(c.long&&o.add(c.long),c.short&&o.add(c.short));n.set(t.join(" "),{cmds:i,flags:[...a,"--help"]});for(let c of e.commands)c.name().startsWith("__")||Lx(c,[...t,c.name()],n,o)}function Xq(e){let t=new Map,n=new Set;return Lx(e,[],t,n),{rows:[...t].map(([i,{cmds:a,flags:c}])=>({key:i,cmds:[...new Set(a)].join(" "),flags:[...new Set(c)].join(" ")})),valueFlags:[...n].join(" ")}}function Nx(e){return e.map(({key:t,cmds:n,flags:o})=>` ${JSON.stringify(t)}) cmds=${JSON.stringify(n)} flags=${JSON.stringify(o)} ;;`).join(`
|
|
54
|
-
`)}function
|
|
53
|
+
-----END PRIVATE KEY-----`,isUsingLuhnAlgorithm:!1,regexp:"-----BEGIN[ A-Z0-9_-]{0,100}PRIVATE KEY(?: BLOCK)?-----[ \\r\\n\\t\\f\\v\\S-]{64,}?KEY(?: BLOCK)?-----"},{key:"pulumi_api_token",name:"Pulumi API token",category:"credential",example:"pul-b77e6bff9fddebbc2bb8eca94e3f29a41f6da70a",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pul-[a-f0-9]{40})"},{key:"pypi_upload_token",name:"PyPI upload token",category:"credential",example:"pypi-AgEIcHlwaS5vcmc128fd9e0b47dde39cfecad3a997273458e6392f6aac649ae38864bdd7ff12836",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)pypi-AgEIcHlwaS5vcmc[a-zA-Z0-9_-]{50}"},{key:"rapidapi_access_token",name:"RapidAPI access token",category:"credential",example:"g4x40h94pi_-zlklfz3-qvhiiu5zankyrqqwmsl60decihbqvl",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{50})"},{key:"readme_api_token",name:"ReadMe API token",category:"credential",example:"rdme_k38kau741xa5lw03mdkvcd4vn6s6hdhvhg1wxa4ls7dp8h58r0yxq65nsqwndn056pxsc4",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:rdme_[a-z0-9]{70})"},{key:"rubygems_api_token",name:"RubyGems API token",category:"credential",example:"rubygems_7790aaa8102395704a64594a11f6de4941a27f86bc3fc9d4",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:rubygems_[a-f0-9]{48})"},{key:"scalingo_api_token",name:"Scalingo API token",category:"credential",example:"tk-us-4fhmqrg-rl4416b3oij_qx3q284wbhbqpk7r3te4r14lafou",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:tk-us-[a-zA-Z0-9_-]{48})"},{key:"sendbird_access_id",name:"SendBird access ID",category:"credential",example:"7e7801fd-c25d-50ab-a723-01b94c8d6c5f",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"sendbird_access_token",name:"SendBird access token",category:"credential",example:"305f75f04e3afa65360c25d9944fdae91138328d",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{40})"},{key:"sendgrid_api_token",name:"SendGrid API token",category:"credential",example:"SG.--ed-fvdeffijnle7575jp1sh24wq_9y9hcjua5w3dnqh5-wyegkpzenziy1_qr=hf",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:SG\\.[a-z0-9=_\\-\\.]{66})"},{key:"sendinblue_api_token",name:"Sendinblue API token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:xkeysib-[a-f0-9]{64}\\-[a-z0-9]{16})"},{key:"sentry_access_token",name:"Sentry access token",category:"credential",example:"1ad463398f40a52bb94a3795762f4003d51b03b8a788cba55e3a81de81c72940",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{64})"},{key:"sentry_org_token",name:"Sentry org token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)sntrys_eyJpYXQiO[a-zA-Z0-9+/]{10}(?:LCJyZWdpb25fdXJs|InJlZ2lvbl91cmwi|cmVnaW9uX3VybCI6)[a-zA-Z0-9+/]{10}={0,2}_[a-zA-Z0-9+/]{43}(?:[^a-zA-Z0-9+/]|\\z)"},{key:"sentry_user_token",name:"Sentry user token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sntryu_[a-f0-9]{64})"},{key:"settlemint_application_access_token",name:"Settlemint application access token",category:"credential",example:"sm_aat_gshgzsv353m5yb9s",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sm_aat_[a-zA-Z0-9]{16})"},{key:"settlemint_personal_access_token",name:"Settlemint personal access token",category:"credential",example:"sm_pat_1yhza49gsle0trg8",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sm_pat_[a-zA-Z0-9]{16})"},{key:"settlemint_service_access_token",name:"Settlemint service access token",category:"credential",example:"sm_sat_cha543e6lb19llli",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sm_sat_[a-zA-Z0-9]{16})"},{key:"shippo_api_token",name:"Shippo API token",category:"credential",example:"shippo_live_1d0f80d04e7788c1edb8fc2b8076bbf8f59b84b7",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:shippo_(?:live|test)_[a-fA-F0-9]{40})"},{key:"shopify_access_token",name:"Shopify access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)shpat_[a-fA-F0-9]{32}"},{key:"shopify_custom_access_token",name:"Shopify custom access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)shpca_[a-fA-F0-9]{32}"},{key:"shopify_private_app_access_token",name:"Shopify private app access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)shppa_[a-fA-F0-9]{32}"},{key:"shopify_shared_secret",name:"Shopify shared secret",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)shpss_[a-fA-F0-9]{32}"},{key:"sidekiq_secret",name:"Sidekiq secret",category:"credential",example:"aa8d3915:64fb5cb5",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{8}:[a-f0-9]{8})"},{key:"sidekiq_sensitive_url",name:"Sidekiq sensitive URL",category:"credential",example:"https://cafebabe:deadbeef@gems.contribsys.com/",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)https?://(?:[a-f0-9]{8}:[a-f0-9]{8})@(?:gems.contribsys.com|enterprise.contribsys.com)(?:[\\/|\\#|\\?|:]|$)"},{key:"slack_bot_token",name:"Slack bot token",category:"credential",example:"xoxb-781236542736-2364535789652-GkwFDQoHqzXDVsC6GzqYUypD",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)xoxb-[0-9]{10,13}-[0-9]{10,13}[a-zA-Z0-9-]*"},{key:"slack_user_token",name:"Slack user token",category:"credential",example:"xoxp-41684372915-1320496754-45609968301-e708ba56e1517a99f6b5fb07349476ef",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)xox[pe](?:-[0-9]{10,13}){3}-[a-zA-Z0-9-]{28,34}"},{key:"slack_app_token",name:"Slack app token",category:"credential",example:"xapp-1-A052FGTS2DL-5171572773297-610b6a11f4b7eb819e87b767d80e6575a3634791acb9a9ead051da879eb5b55e",isUsingLuhnAlgorithm:!1,regexp:"xapp-[0-9]-[A-Z0-9]+-[0-9]+-[a-z0-9]+"},{key:"slack_config_access_token",name:"Slack config access token",category:"credential",example:"xoxe.xoxp-1-Mi0yLTM0MTQwNDE0MDE3Ni0zNjU5NDY0Njg4MTctNTE4MjA3NTQ5NjA4MC01NDEyOTYyODY5NzUxLThhMTBjZmI1ZWIzMGIwNTg0ZDdmMDI5Y2UxNzVlZWVhYzU2ZWQyZTZiODNjNDZiMGUxMzRlNmNjNDEwYmQxMjQ",isUsingLuhnAlgorithm:!1,regexp:"xoxe.xox[bp]-[0-9]-[A-Z0-9]{50}"},{key:"slack_config_refresh_token",name:"Slack config refresh token",category:"credential",example:"xoxe-1-My0xLTMxNzcwMjQ0MTcxMy01MTU4MTUyNjkxNzE0LTUxODE4NDI0MDY3MzYtMjA5MGFkOTFlZThkZWE2OGFlZDYwYWJjODNhYzAxYjA5ZjVmODBhYjgzN2QyNDdjOTNlOGY5NTg2YWM1OGM4Mg",isUsingLuhnAlgorithm:!1,regexp:"xoxe-[0-9]-[A-Z0-9]{50}"},{key:"slack_legacy_bot_token",name:"Slack legacy bot token",category:"credential",example:"xoxb-263594206564-FGqddMF8t08v8N7Oq4i57vs1",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)xoxb-[0-9]{8,14}-[a-zA-Z0-9]{18,26}"},{key:"slack_legacy_workspace_token",name:"Slack legacy workspace token",category:"credential",example:"xoxa-2-511111111-31111111111-3111111111111-e039d02840a0b9379c",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)xox[ar]-(?:[0-9]-)?[0-9a-zA-Z]{8,48}"},{key:"slack_legacy_token",name:"Slack legacy token",category:"credential",example:"xoxs-416843729158-132049654-5609968301-e708ba56e1",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)xox[os]-[0-9]+-[0-9]+-[0-9]+-[a-fA-F0-9]+"},{key:"slack_webhook_url",name:"Slack webhook URL",category:"credential",example:"hooks.slack.com/services/z6cvbfngk3h7i0vts4akmbxidtb8o3b4pq2sbbd6o86g",isUsingLuhnAlgorithm:!1,regexp:"(?:https?://)?hooks.slack.com/(?:services|workflows|triggers)/[A-Za-z0-9+/]{43,56}"},{key:"snyk_api_token",name:"Snyk API token",category:"credential",example:"12345678-ABCD-ABCD-ABCD-1234567890AB",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"sonar_api_token",name:"Sonar API token",category:"credential",example:"12345678ABCDEFH1234567890ABCDEFH12345678",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:(?:squ_|sqp_|sqa_)?[a-z0-9=_-]{40})"},{key:"stripe_access_token",name:"Stripe access token",category:"credential",example:"sk_test_cyge9m4s1kxiqdkszz0a57nyx6wk73",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:sk|rk)_(?:test|live|prod)_[a-zA-Z0-9]{10,99})"},{key:"square_access_token",name:"Square access token",category:"credential",example:"sq0atp-OQUxovdrj3tfFpSd66r3sY",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:EAAA|sq0atp-)[a-zA-Z0-9_-]{22,60})"},{key:"squarespace_access_token",name:"Squarespace access token",category:"credential",example:"86447eab-140f-2563-3572-bb016dafd692",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"sumologic_access_id",name:"SumoLogic access ID",category:"credential",example:"suJS4ZsaD5bQTt",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:su[a-zA-Z0-9]{12})"},{key:"sumologic_access_token",name:"SumoLogic access token",category:"credential",example:"1xohkwr8lpvm4osygkpe5zbd16c3376ver2qed1bssuko4uy4tij1bnf4dnwy7o4",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"microsoft_teams_webhook",name:"Microsoft Teams webhook URL",category:"credential",example:"https://mycompany.webhook.office.com/webhookb2/767lrnj6-okh8-dnh8-jey2-y2iteohrwz75@6igi6oz6-ud9w-wior-2zva-5vx0wp6wuiqk/IncomingWebhook/o1zox92ssprrppjtnvcjqq0q09k2wnc3/qwox5p9d-x4zr-3yis-t1on-s67zj50tmyht",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)https://[a-z0-9]+\\.webhook\\.office\\.com/webhookb2/[a-z0-9]{8}-(?:[a-z0-9]{4}-){3}[a-z0-9]{12}@[a-z0-9]{8}-(?:[a-z0-9]{4}-){3}[a-z0-9]{12}/IncomingWebhook/[a-z0-9]{32}/[a-z0-9]{8}-(?:[a-z0-9]{4}-){3}[a-z0-9]{12}"},{key:"telegram_bot_api_token",name:"Telegram bot API token",category:"credential",example:"59015865:A12o5wu6f78zofs0udypf9ti23u82g-qkfz",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9]{5,16}:(?-i:A)[a-z0-9_\\-]{34})"},{key:"travisci_access_token",name:"Travis CI access token",category:"credential",example:"zjgfo5fhshd5c60hpz22wh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{22})"},{key:"twilio_api_key",name:"Twilio API key",category:"credential",example:"SKa585fd034fcd16cdd741f7df9b57fb3b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)SK[0-9a-fA-F]{32}"},{key:"twitch_api_token",name:"Twitch API token",category:"credential",example:"1hm9gcychlkpf93jdjnwdu0uaamu6d",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{30})"},{key:"twitter_api_key",name:"Twitter API key",category:"credential",example:"m8zqu4etx07bjt7tyeacc6pox",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{25})"},{key:"twitter_api_secret",name:"Twitter API secret",category:"credential",example:"7f4gxkubw9qs346ik99zk3z8b6kk3d7g8toi7zujgvgbt8q0yv",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{50})"},{key:"twitter_access_token",name:"Twitter access token",category:"credential",example:"465616696186918-96B1NCD5CH0uyi7zUHiS",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9]{15,25}-[a-zA-Z0-9]{20,40})"},{key:"twitter_access_secret",name:"Twitter access secret",category:"credential",example:"vyuo5peybdzznr7z0ua5wamhogusans4m29uzi25w4jgj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{45})"},{key:"twitter_bearer_token",name:"Twitter bearer token",category:"credential",example:"AAAAAAAAAAAAAAAAAAAAAAWRGWFGlfwyqNrrIa3pewqNNLX0jQMj2sR6M2cZUfBdqXDtkt7Nsb56F4tCz7Pt8ujbosrLxnRqYgwI0b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:A{22}[a-zA-Z0-9%]{80})"},{key:"typeform_api_token",name:"Typeform API token",category:"credential",example:"tfp_o-nsn=6eg2ios=4g652xhf933qor4jj7ort2qh_uw_5jdsuffp31ln=e-2a",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:tfp_[a-z0-9\\-_\\.=]{59})"},{key:"vault_batch_token",name:"Vault batch token",category:"credential",example:"hvb.x84j4cl53mzvhvb1nfc3mfi721gh5i-92f96lt0gns5lpksfu5f0199j-gw4ycxg6au4ser86mczcr_nx6ur2elbpazfrybo80fxjv3bghxshml3g261l6qi03yrz03qup84jk-fc2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:hvb\\.[a-zA-Z0-9_-]{50})"},{key:"vault_service_token",name:"Vault service token",category:"credential",example:"s.8QH9knZV94f0IjBZismfOPD0",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:hvs\\.[a-zA-Z0-9_-]{90}|s\\.(?i:[a-z0-9]{24})))"},{key:"yandex_api_key",name:"Yandex API key",category:"credential",example:"AQVN9wiAh8pyz3lmB5WTo_KUuPDXlxtzkA5-YFG",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:AQVN[A-Za-z0-9_\\-]{35,38})"},{key:"yandex_aws_access_token",name:"Yandex AWS access token",category:"credential",example:"YCZ6DHVrZONPNtgwWLZPrIGyviSrudRVSr8w0b1S",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:YC[a-zA-Z0-9_\\-]{38})"},{key:"yandex_access_token",name:"Yandex access token",category:"credential",example:"t1.L=.WJ9CYVI5eeLkTOrMM_dgaPgdmpen48R8RYsL4VJqelVKDmrqYsSHkH6QyVVhJkuHSQFTd0NOhClEDyCz7eEbh5=",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:t1\\.[A-Z0-9a-z_-]+[=]{0,2}\\.[A-Z0-9a-z_-]{86}[=]{0,2})"},{key:"zendesk_secret_key",name:"Zendesk secret key",category:"credential",example:"iydgm2jofftb2xu7niv55qnfxdwbwmqt2s561bgc",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{40})"},{key:"infracost_api_token",name:"Infracost API token",category:"credential",example:"ico-fNZw8jjy6TugMUHKWX4l9iSP3i95SPNH",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:ico-[a-zA-Z0-9]{32})"},{key:"iban",name:"Iban",category:"financial-data",example:"FR7630006000011234567890189",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)[a-zA-Z]{2}[0-9]{2}[a-zA-Z0-9]{11,30}(?-u:\\b)"},{key:"aikido_token",name:"Aikido token",category:"credential",example:"AIK_SECRET_XU28CmBY7Kxk3RPrqfHk9n6p5QX4p1tXzvJ7J1B3RPrqfHk9n6p5QX4p1tXzvJ7J",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)AIK_SECRET_[A-Za-z0-9]{64}"},{key:"aikido_ci_token",name:"Aikido CI secret",category:"credential",example:"AIK_CI_US_XU28CmBY7Kxk3RPrqfHk9n6p5QX4p1tXzvJ7J1B3RPrqfHk9n6p5QX4p1tXzvJ7J",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)AIK_CI_(US_|ME_)?[A-Za-z0-9]{64}"},{key:"tsuga_ingestion_key",name:"Tsuga ingestion key",category:"credential",example:"tsuga_in:v1:OUvrwavCG//ixL08HEds9OAT",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)tsuga_in:v1:[A-Za-z0-9+/]{24}"},{key:"tsuga_operation_key",name:"Tsuga operation key",category:"credential",example:"tsuga_op:v1:zz3-LWv-sLy:0k7Skt255M0yXe/ZLBoiSamb",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)tsuga_op:v1:[A-Za-z0-9_-]+:[A-Za-z0-9+/]{24}"}],QF=Ox.map(e=>e.key);var Ewe=new Set(QF),_we=Ox.map(e=>e.key);var Nwe={[Zp]:eu,[Zp.replace(`${$}.`,"")]:eu,[Xp]:Jp,[Xp.replace(`${$}.`,"")]:Jp,[io]:ai,[io.replace(`${$}.`,"")]:ai},Lwe={[eu]:Zp,[Jp]:Xp,[ai]:io};function xx(e){return e.replace(/ies$/,"y").replace(/s$/,"")}var Rx=["alert_cluster","alert_conditions","alert_data_url","alert_id","alert_owner","alert_previous_status","alert_priority","alert_start_time","alert_status","alert_tags","alert_timeframe","alert_title","alert_transition","alert_triggered_by","dashboard_url","monitor_url"],Cx=["alert_queries","alert_thresholds","alert_values"],WF=[...Rx,...Cx],Px=["alert_event_name","alert_message"],ave=[...WF,...Px],sve=new Set([...Rx,...Px]),cve=new Set(Cx);var Sd={aws:"aws",gcp:"gcp",azure:"azure"},_n=[Sd.aws,Sd.gcp,Sd.azure];var Ux=r.Object({id:r.String({description:"Unique Tsuga cluster ID. Tsuga assigns it when the cluster record is created. Use this value as `clusterId` with public API requests that accept `clusterId`."}),name:r.String({description:"Cluster name stored in Tsuga. Usable as a display label when `friendlyName` is not set."}),friendlyName:r.Optional(r.String({description:"Human-readable display name for the cluster. Present when a friendly name is configured."})),clusterType:r.Enum(_n,{description:"Cloud provider selected for the Tsuga cluster."}),clusterRegion:r.String({description:"Cloud region selected for the cluster using the provider region identifier."})},{$id:"Cluster",description:"Tsuga cluster available to the organization. Use its `id` to scope public API requests that accept `clusterId`."}),ZF={id:"abc-123-def",name:"production",friendlyName:"Production (US)",clusterType:"aws",clusterRegion:"us-east-1"};Object.assign(Ux,{examples:[ZF]});var wx=d({description:"Lists Tsuga clusters available to the organization. Use cluster IDs with public API requests that accept `clusterId`, such as telemetry, service, Kubernetes Explorer, and quality-report requests.",operationId:"listClusters",tags:["clusters"],url:`/${"v1"}/clusters`,method:"GET",response:r.Array(Ux)});function vx(e,t){e.command("clusters").description("Manage Tsuga cluster selection").command("list").description("List all Tsuga clusters available to the operation API key").action(async()=>{let o=await t()(wx);ee(o)})}function Lx(e,t,n,o){let i=e.commands.map(c=>c.name()).filter(c=>!c.startsWith("__")),a=e.options.map(c=>c.long).filter(c=>!!c);for(let c of e.options)(c.required||c.optional)&&(c.long&&o.add(c.long),c.short&&o.add(c.short));n.set(t.join(" "),{cmds:i,flags:[...a,"--help"]});for(let c of e.commands)c.name().startsWith("__")||Lx(c,[...t,c.name()],n,o)}function XF(e){let t=new Map,n=new Set;return Lx(e,[],t,n),{rows:[...t].map(([i,{cmds:a,flags:c}])=>({key:i,cmds:[...new Set(a)].join(" "),flags:[...new Set(c)].join(" ")})),valueFlags:[...n].join(" ")}}function Nx(e){return e.map(({key:t,cmds:n,flags:o})=>` ${JSON.stringify(t)}) cmds=${JSON.stringify(n)} flags=${JSON.stringify(o)} ;;`).join(`
|
|
54
|
+
`)}function JF(e,t){return`_tsuga_complete() {
|
|
55
55
|
local cur key cmds flags words i word prev
|
|
56
56
|
local valueflags="${t}"
|
|
57
57
|
local -a path
|
|
@@ -136,43 +136,43 @@ complete -c tsuga -f -a '(__tsuga_complete)'
|
|
|
136
136
|
Usage:
|
|
137
137
|
bash: eval "$(tsuga completion bash)" # add to ~/.bashrc
|
|
138
138
|
zsh: eval "$(tsuga completion zsh)" # add to ~/.zshrc
|
|
139
|
-
fish: tsuga completion fish > ~/.config/fish/completions/tsuga.fish`).action(t=>{let{rows:n,valueFlags:o}=
|
|
140
|
-
...`};Object.assign(Gx,{examples:[nB]});var $x=r.Object({kind:r.Enum(["doc","api"],{description:"`doc` for documentation pages (guides, references, release notes); `api` for API-reference endpoints indexed from the OpenAPI spec. Use this to decide how to present or follow up on the result."}),path:r.String({description:"Path identifying the result. Documentation pages use a slug path (e.g. `data-collection/guides/how-to-add-resource-attributes`). API-reference results use `api/<operationId>` (e.g. `api/aggregateScalar`)."}),title:r.String({description:'Title of the result (e.g. "How to Add Resource Attributes" or "POST /v1/aggregation/multi-query/scalar")'}),subsection:r.Optional(r.String({description:'For documentation pages: the heading path inside the page that matched (e.g. "Language setup"). For API results: the matched field or parameter breadcrumb (e.g. "Body \u203A queries"). Absent when the match is the page or endpoint intro.'})),tab:r.Optional(r.String({description:'Tab label inside the page that the result matched. Set when the matching content is inside a <Tabs><Tab label="\u2026"> block. Always absent for API results.'})),anchor:r.Optional(r.String({description:"For documentation pages: the slugified heading ID used as the URL fragment (e.g. `language-setup`). For API results: the Scalar deep-link fragment (`tag/<tag>/<METHOD><path>`). The `link` field already has this baked in."})),score:r.Number({description:"Relevance score between 0 and 1 (higher is more relevant)"}),excerpt:r.String({description:"Short snippet of matching content"}),link:r.String({description:"URL to the result in the Tsuga app. Documentation pages include the section anchor and tab query parameter when applicable. API results deep-link into the API reference at `/documentation/api#tag/\u2026`."})},{$id:"DocSearchResult",description:"A documentation page or API-reference endpoint search result"}),oB={kind:"doc",path:"data-collection/guides/how-to-add-resource-attributes",title:"How to Add Resource Attributes",subsection:"Set resource attributes by language",tab:"Python",anchor:"set-resource-attributes-by-language",score:.9,excerpt:"...Python SDK setup should use the default resource detectors...",link:"https://www.app.tsuga.com/documentation/data-collection/guides/how-to-add-resource-attributes?tab=Python#set-resource-attributes-by-language"};Object.assign($x,{examples:[oB]});var jx=d({description:"Retrieve the raw markdown content of a documentation or API-reference page by its path. Documentation pages use slug paths (e.g. `getting-started/send-your-first-logs`); API-reference pages use `api/<operationId>` (e.g. `api/aggregateScalar`).",operationId:"getDocPage",tags:["public","docs"],url:Dx,method:"GET",query:r.Object({path:u({allowEmpty:!1,description:"Documentation path to fetch. Use page slug paths for docs or `api/<operationId>` for API-reference pages."})},{description:"Documentation page lookup query."}),response:Gx}),Fx=d({description:"Searches public documentation pages and API-reference endpoints. Use this to build help search or route users to Tsuga docs and API reference results. Results are ranked by relevance; an empty array means no page or endpoint matched the query.",operationId:"searchDocs",tags:["public","docs"],url:`${Dx}/search`,method:"GET",query:r.Object({query:u({allowEmpty:!1,description:"Search text to match against documentation and API-reference content."})},{description:"Documentation search query."}),response:r.Array($x)});function qx(e,t){let n=e.command("docs").description("Search and fetch Tsuga documentation and API-reference pages");n.command("get <DOC_PATH>").description("Get a documentation or API-reference page by path (e.g. 'getting-started/send-your-first-logs' or 'api/aggregateScalar')").action(async o=>{let i=await t()(jx,{query:{path:o}});ee(i)}),n.command("search <SEARCH_TEXT>").description("Search Tsuga documentation and the full API reference, ranked by relevance").action(async o=>{let i=await t()(Fx,{query:{query:o}});ee(i)})}var iB=`/${"v1"}/feedback`,Bx=r.Object({id:r.String({description:"API request ID recorded with the feedback."})},{$id:"Feedback",description:"A recorded piece of feedback"}),aB={id:"request-123-abc"};Object.assign(Bx,{examples:[aB]});var Hx=r.Object({content:u({allowEmpty:!1,type:"long",description:"Free-text feedback content, e.g. what went wrong, what was confusing, or a suggestion. Required and must be non-empty."})}),sB={content:"The traces command times out for large services."};Object.assign(Hx,{examples:[sB]});var Kx=d({description:"Submit free-text feedback about Tsuga tools or APIs, e.g. a tool that failed, returned unusable output, or was confusing to use. Feedback is recorded for the Tsuga team to review and improve tooling.",operationId:"createFeedback",tags:["public","feedback"],url:iB,method:"POST",body:Hx,response:Bx});function zx(e,t){e.command("feedback <MESSAGE...>").description("Send feedback about Tsuga tools or APIs (e.g. a tool that failed or was confusing)").action(async n=>{let o=await t()(Kx,{body:{content:n.join(" ")}});ee(o)})}var cB="^\\S(.*\\S)?$",pB=128,uB=256,lB=r.Object({key:r.String({description:"Tag key attached to the resource. Consumers can use key/value tags for filtering, ownership context, and policy checks."}),value:r.String({description:"Tag value attached to the resource for this key. Tsuga returns the value exactly as stored."})},{title:"Tag"}),mB=r.Object({key:r.String({maxLength:pB,description:"Tag key to attach to the resource."}),value:r.String({maxLength:uB,pattern:cB,description:"Tag value to attach to the resource. Leading or trailing whitespace is rejected."})},{title:"Tag"}),qt=r.Array(lB,{title:"Tags",description:"Key/value tags applied to the resource. Use them to organize resources and to satisfy tag policies."}),Bt=r.Array(mB,{title:"Tags",maxItems:50,description:"Key/value tags to apply to the resource. Tag policies may require specific keys or values."}),De=r.Optional(qt),Xe=r.Optional(Bt);var In="/v0/teams",su=["public","private"],au={NAME:"name",CREATED_AT:"createdAt",MEMBER_COUNT:"memberCount",VISIBILITY:"visibility"},dB=r.Enum([au.NAME,au.CREATED_AT,au.MEMBER_COUNT,au.VISIBILITY],{description:"Team field used for sorting list responses. Use `name`, `createdAt`, `memberCount`, or `visibility`."}),Qx=r.Object({color:r.Enum(yd,{description:"Color token used by Tsuga when rendering the team avatar."}),mode:r.Enum(Td,{description:"Avatar rendering mode selected for the team."}),iconName:r.Enum(bx,{description:"Icon name rendered inside the team avatar when icon mode is used."})}),Od=r.Object({color:r.Enum(yd),mode:r.Enum(Td)}),Yx=100,Vx=250,ui=r.Object({id:r.String({description:"Unique identifier of the team. Generated by Tsuga and stable for the team lifetime."}),name:r.String({description:"Human-readable team name displayed throughout Tsuga and used in team search."}),description:r.Optional(r.String({description:"Optional free-text description of the team."})),visibility:r.Enum(su,{description:"`public` makes team-owned resources discoverable according to access controls. `private` restricts discovery to team members and authorized users."}),tags:De,createdAt:A({description:"Timestamp when Tsuga created the team."}),updatedAt:A({description:"Timestamp when Tsuga last updated the team metadata."}),memberCount:r.Optional(r.Number({description:"Number of members currently in the team"})),avatar:r.Optional(Qx)}),cu=r.Object({name:r.String({minLength:1,maxLength:Yx,format:Jo,description:`Name to assign to the team. Must be kebab-case (lowercase letters, numbers, and dashes only) and unique in the organization. Maximum length is ${Yx} characters.`}),description:r.Optional(r.String({maxLength:Vx,description:`Optional team description. Maximum length is ${Vx} characters.`})),visibility:r.Enum(su,{description:"`public` makes team-owned resources discoverable according to access controls. `private` restricts discovery to team members and authorized users."}),tags:Xe,avatar:r.Optional(Qx)}),fB=r.Object({id:r.String(),name:r.String(),email:r.String(),role:r.Enum(ii),joinedTeamAt:A(),orgRole:r.Enum(BO),avatar:r.Optional(Od)}),Wx=r.Object({searchQuery:r.Optional(u({description:"Substring matched against team names and descriptions."})),visibility:r.Optional(r.Enum(su,{description:"Restrict results to teams with this visibility."})),myTeamsOnly:r.Optional(r.Boolean({description:"If true, return only teams that include the authenticated user."}))}),vNe=d({tags:["teams"],url:In,method:"GET",paginated:!0,response:r.Array(ui),query:r.Object({...ge,includeMemberCount:r.Optional(r.Boolean()),...Wx.properties,sortBy:r.Optional(dB),sortDirection:r.Optional(r.Enum(["asc","desc"],{description:"Sort direction: ascending or descending."}))})}),NNe=d({tags:["teams"],url:`${In}/:id`,method:"GET",params:r.Object({id:u()}),response:ui}),LNe=d({tags:["teams"],url:`${In}/:id/members`,method:"GET",params:r.Object({id:u()}),response:r.Array(fB)}),kNe=d({tags:["teams"],url:`${In}/:id/assets`,method:"GET",params:r.Object({id:u()}),response:r.Object({apiKeyCount:r.Number(),logRouteCount:r.Number(),monitorCount:r.Number(),notificationRuleCount:r.Number(),dashboardCount:r.Number()})}),MNe=d({tags:["teams"],url:In,method:"POST",body:cu,response:ui}),DNe=d({tags:["teams"],url:`${In}/:id`,method:"PUT",params:r.Object({id:u()}),body:cu,response:ui}),gB=C("type",[r.Object({type:r.Literal("ids"),teamIds:r.Array(u({allowEmpty:!1}),{minItems:1,maxItems:100})}),r.Object({type:r.Literal("all"),filters:r.Optional(Wx)})]),GNe=d({tags:["teams"],url:`${In}/bulk-update`,method:"POST",body:r.Object({selection:gB,config:r.Object({visibility:r.Enum(su)})}),response:r.Object({})}),$Ne=d({tags:["teams"],url:`${In}/:id`,method:"DELETE",params:r.Object({id:u()}),response:N});var hB=r.Enum(["agent","cli","mcp-codemode","mcp-server","terraform-provider","web-frontend"],{description:"Tsuga client surface that performed the operation. Use this to distinguish UI, CLI, MCP, and Terraform-originated changes."}),pe=C("type",[r.Object({type:r.Literal("user",{description:"The resource was created or updated by a user."}),id:r.String({description:"Unique identifier of the user actor."}),name:r.String({description:"Display name of the user actor at the time of response."}),avatar:r.Optional(Od)}),r.Object({type:r.Literal("operation-api-key",{description:"The resource was created or updated by an operation API key."}),id:r.String({description:"Unique identifier of the operation API key actor."}),name:r.String({description:"Display name of the operation API key actor."}),source:r.Optional(hB)})],{description:"User or operation API key responsible for creating or updating a resource. Returned by Tsuga for audit context."});var At="/v0/monitors",li=["alert","resolve","keep_last_status","consider_zero"],mi=["alert","resolve","keep_last_status"];var Xx=["no_aggregation","all","any","each","proportion"],Jx=["greater_than","less_than","equal","not_equal","greater_than_or_equal","less_than_or_equal"];var EB=r.Object({formula:r.String({description:"Formula result to compare against the threshold, usually `q1` or a formula alias."}),operator:r.Enum(Jx,{description:"Comparison operator used to evaluate the threshold condition."}),threshold:r.Number({description:"Numeric threshold value used by the comparison. May be negative when the formula result can be below zero."})}),_B=r.Object({formula:u({type:"tsuga-formula",description:"Formula result to compare against the threshold, usually `q1` or a formula alias."}),operator:r.Enum(Jx,{description:"Comparison operator used to evaluate the threshold condition."}),threshold:r.Number({description:"Numeric threshold value used by the comparison. May be negative when the formula result can be below zero."})}),IB=5,xd=r.Array(EB,{description:"Threshold conditions evaluated against query and formula results. All listed conditions must match for a non-grouped threshold monitor to alert."}),Rd=r.Array(_B,{minItems:1,maxItems:IB,description:"Threshold conditions evaluated against query and formula results. All listed conditions must match for a non-grouped threshold monitor to alert."}),Cd=r.Object({formula:r.String({description:"Formula result analyzed for anomalous behavior, usually `q1` or a formula alias."}),conditionType:r.Enum(["rate","error","cpu","general","to_be_set"],{description:"Anomaly model type Tsuga uses to classify expected behavior: `rate` flags downward anomalies (e.g. count rates), `error` and `cpu` flag upward anomalies (e.g. error counts/rates, CPU usage), `general` flags both directions, and `to_be_set` is a placeholder Tsuga replaces by inferring the model type from the monitor query when the monitor is created or updated."})},{description:"Anomaly detection condition evaluated by this monitor. The `formula` result is compared against behavior learned from historical query results, and the monitor alerts on deviations in the direction implied by `conditionType`."}),Pd=r.Object({formula:u({type:"tsuga-formula",description:"Formula result analyzed for anomalous behavior, usually `q1` or a formula alias."}),conditionType:r.Enum(["rate","error","cpu","general","to_be_set"],{description:"Anomaly model type used to classify expected behavior: `rate` flags downward anomalies (e.g. count rates), `error` and `cpu` flag upward anomalies (e.g. error counts/rates, CPU usage), and `general` flags both directions. Use `to_be_set` to let Tsuga infer the model type from the monitor query during create or update."})},{description:"Anomaly detection condition evaluated by this monitor. The `formula` result is compared against behavior learned from historical query results, and the monitor alerts on deviations in the direction implied by `conditionType`."}),St=[1,2,3,4,5];var pu={timeframe:r.Number({description:"Lookback window, in minutes, that each query-backed threshold monitor evaluation aggregates over. Always a whole number, at least 1."}),groupByFields:r.Array(r.Object({fields:r.Array(r.String(),{description:"Attribute names the monitor splits results by, evaluating each resulting group independently. Empty means the monitor evaluates a single ungrouped series."}),limit:r.Number({description:"Configured limit for this group by. Currently ignored; monitor evaluation applies a fixed limit of 100 groups per field."}),sortOrder:r.Optional(r.Enum(["asc","desc"],{description:"Sort direction applied to groups: ascending or descending."})),replaceNullWith:r.Optional(r.String({description:"Value used to group documents that have no value for a grouped field."}))}),{description:"Monitor group by configuration. The `limit` setting is currently ignored; evaluation applies a fixed limit of 100 groups per field."}),aggregationAlertLogic:r.Optional(r.Enum(Xx,{description:"How grouped results are combined into alert state. Use `no_aggregation` only when `groupByFields` is empty; use `all`, `any`, `each`, or `proportion` with non-empty `groupByFields`. `proportion` also requires `proportionAlertThreshold`."})),proportionAlertThreshold:r.Optional(r.Integer({description:"Percentage threshold used when `aggregationAlertLogic` is `proportion`."}))},uu={timeframe:r.Integer({minimum:1,description:"Lookback window, in minutes, that each query-backed threshold monitor evaluation aggregates over."}),groupByFields:r.Array(r.Object({fields:r.Array(u(),{description:"Attribute names the monitor splits results by, evaluating each resulting group independently. Empty or omitted means the monitor evaluates a single ungrouped series."}),limit:r.Number({description:"Configured limit for this group by. Currently ignored; monitor evaluation applies a fixed limit of 100 groups per field."}),sortOrder:r.Optional(r.Enum(["asc","desc"],{description:"Sort direction applied to groups: ascending or descending."})),replaceNullWith:r.Optional(u({allowEmpty:!1,description:"Value used to group documents that have no value for a grouped field."}))}),{maxItems:1,description:"Monitor group by configuration. The `limit` setting is currently ignored; evaluation applies a fixed limit of 100 groups per field."}),aggregationAlertLogic:r.Optional(r.Enum(Xx,{description:"How grouped results are combined into alert state. Use `no_aggregation` only when `groupByFields` is empty; use `all`, `any`, `each`, or `proportion` with non-empty `groupByFields`. `proportion` also requires `proportionAlertThreshold`. On create, omitted query-monitor values default to `no_aggregation`; on update, omitted values keep the existing aggregation logic."})),proportionAlertThreshold:r.Optional(r.Integer({minimum:1,maximum:99,description:"Percentage threshold used when `aggregationAlertLogic` is `proportion`."}))},Ud={...pu,timeframe:r.Number({description:"Lookback window, in minutes, that each anomaly monitor evaluation aggregates over. Always a whole number from 5 through 1440."})},wd={...uu,timeframe:r.Integer({minimum:5,maximum:1440,description:"Lookback window, in minutes, that each anomaly monitor evaluation aggregates over."})},eR=r.Object({type:r.Literal("metric",{description:"Threshold monitor over metric aggregations."}),conditions:xd,noDataBehavior:r.Enum(li,{description:"How the monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, `keep_last_status` preserves the previous state, and `consider_zero` evaluates missing values as zero."}),...pu,queries:jr},{$id:"MonitorConfigurationMetric"}),tR=r.Object({type:r.Literal("metric",{description:"Threshold monitor over metric aggregations."}),conditions:Rd,noDataBehavior:r.Enum(li,{description:"How the monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, `keep_last_status` preserves the previous state, and `consider_zero` evaluates missing values as zero."}),...uu,queries:En},{$id:"InputMonitorConfigurationMetric"}),rR=r.Object({type:r.Literal("log",{description:"Threshold monitor over log aggregations."}),conditions:xd,noDataBehavior:r.Enum(li,{description:"How the monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, `keep_last_status` preserves the previous state, and `consider_zero` evaluates missing values as zero."}),...pu,queries:jr},{$id:"MonitorConfigurationLog"}),nR=r.Object({type:r.Literal("log",{description:"Threshold monitor over log aggregations."}),conditions:Rd,noDataBehavior:r.Enum(li,{description:"How the monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, `keep_last_status` preserves the previous state, and `consider_zero` evaluates missing values as zero."}),...uu,queries:En},{$id:"InputMonitorConfigurationLog"}),oR=r.Object({type:r.Literal("trace",{description:"Threshold monitor over trace aggregations."}),conditions:xd,noDataBehavior:r.Enum(li,{description:"How the monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, `keep_last_status` preserves the previous state, and `consider_zero` evaluates missing values as zero."}),...pu,queries:jr},{$id:"MonitorConfigurationTrace"}),bB=r.Object({type:r.Literal("trace",{description:"Threshold monitor over trace aggregations."}),conditions:Rd,noDataBehavior:r.Enum(li,{description:"How the monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, `keep_last_status` preserves the previous state, and `consider_zero` evaluates missing values as zero."}),...uu,queries:En},{$id:"InputMonitorConfigurationTrace"}),iR=r.Object({type:r.Literal("anomaly-log",{description:"Anomaly monitor over log aggregations."}),condition:Cd,noDataBehavior:r.Enum(mi,{description:"How the anomaly monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, and `keep_last_status` preserves the previous state."}),...Ud,queries:jr},{$id:"MonitorConfigurationAnomalyLog"}),aR=r.Object({type:r.Literal("anomaly-log",{description:"Anomaly monitor over log aggregations."}),condition:Pd,noDataBehavior:r.Enum(mi,{description:"How the anomaly monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, and `keep_last_status` preserves the previous state."}),...wd,queries:En},{$id:"InputMonitorConfigurationAnomalyLog"}),sR=r.Object({type:r.Literal("anomaly-metric",{description:"Anomaly monitor over metric aggregations."}),condition:Cd,noDataBehavior:r.Enum(mi,{description:"How the anomaly monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, and `keep_last_status` preserves the previous state."}),...Ud,queries:jr},{$id:"MonitorConfigurationAnomalyMetric"}),cR=r.Object({type:r.Literal("anomaly-metric",{description:"Anomaly monitor over metric aggregations."}),condition:Pd,noDataBehavior:r.Enum(mi,{description:"How the anomaly monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, and `keep_last_status` preserves the previous state."}),...wd,queries:En},{$id:"InputMonitorConfigurationAnomalyMetric"}),pR=r.Object({type:r.Literal("anomaly-trace",{description:"Anomaly monitor over trace aggregations. Use this configuration when Tsuga should learn historical trace query behavior and alert on unusual movement in trace-derived values."}),condition:Cd,noDataBehavior:r.Enum(mi,{description:"How the anomaly monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, and `keep_last_status` preserves the previous state."}),...Ud,queries:jr},{$id:"MonitorConfigurationAnomalyTrace"}),SB=r.Object({type:r.Literal("anomaly-trace",{description:"Anomaly monitor over trace aggregations. Set this value to create or update an anomaly monitor that learns historical trace query behavior and alerts on unusual movement in trace-derived values."}),condition:Pd,noDataBehavior:r.Enum(mi,{description:"How the anomaly monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, and `keep_last_status` preserves the previous state."}),...wd,queries:En},{$id:"InputMonitorConfigurationAnomalyTrace"}),uR=r.Object({type:r.Literal("certificate-expiry",{description:"Monitor that alerts before discovered certificates expire."}),warnBeforeInDays:r.Integer({description:"Number of days before certificate expiry when the monitor should warn."}),cloudAccounts:r.Optional(r.Array(r.String(),{description:"Cloud account IDs whose certificates are checked. Omitted means certificates from all cloud accounts are checked."})),aggregationAlertLogic:r.Literal("each",{description:"Certificate expiry monitors alert independently for each certificate."}),noDataBehavior:r.Literal("resolve",{description:"Certificate expiry monitors resolve when matching certificate data disappears."})},{$id:"MonitorConfigurationCertificateExpiry"}),AB=r.Object({type:r.Literal("certificate-expiry",{description:"Monitor that alerts before discovered certificates expire."}),warnBeforeInDays:r.Integer({minimum:1,maximum:365,description:"Number of days before certificate expiry when the monitor should warn. Valid values are 1 through 365."}),cloudAccounts:r.Optional(r.Array(r.String(),{minItems:1,description:"Cloud account IDs whose certificates are checked. Omit to check certificates from all cloud accounts."})),aggregationAlertLogic:r.Literal("each",{description:"Certificate expiry monitors alert independently for each certificate."}),noDataBehavior:r.Literal("resolve",{description:"Certificate expiry monitors resolve when matching certificate data disappears."})},{$id:"InputMonitorConfigurationCertificateExpiry"}),OB=r.Object({type:r.Literal("log-error-pattern",{description:"Monitor that alerts on newly detected log error patterns for the configured team, environment, and optional service. Recovery notifications are not sent for this monitor type."}),aggregationAlertLogic:r.Literal("each",{description:"Fixed aggregation logic for log error pattern monitors. Each new pattern is evaluated as its own alert group."}),noDataBehavior:r.Literal("keep_last_status",{description:"Fixed no-data behavior for log error pattern monitors. Pattern state is kept until inactive pattern groups expire."}),filter:r.Object({teamIds:r.Array(r.String(),{description:"Team IDs whose logs are searched for new error patterns. Tsuga resolves these team IDs to team names when exporting monitor assets."}),env:r.String({description:"Environment whose logs are searched for new error patterns."}),service:r.Optional(r.String({description:"Optional service name whose logs are searched for new error patterns. If omitted, the monitor searches all services matching the team and environment filter."}))},{description:"Log selection used for new error pattern detection. All configured fields must match for logs to be included."})},{$id:"MonitorConfigurationLogErrorPattern"}),xB=r.Object({type:r.Literal("log-error-pattern",{description:"Monitor that alerts on newly detected log error patterns for the configured team, environment, and optional service. Recovery notifications are not sent for this monitor type."}),aggregationAlertLogic:r.Literal("each",{description:"Fixed aggregation logic for log error pattern monitors. Each new pattern is evaluated as its own alert group."}),noDataBehavior:r.Literal("keep_last_status",{description:"Fixed no-data behavior for log error pattern monitors. Pattern state is kept until inactive pattern groups expire."}),filter:r.Object({teamIds:r.Array(u(),{description:"Team IDs whose logs are searched for new error patterns. Tsuga resolves these team IDs to team names when exporting monitor assets."}),env:u({description:"Environment whose logs are searched for new error patterns."}),service:r.Optional(u({description:"Optional service name whose logs are searched for new error patterns. If omitted, the monitor searches all services matching the team and environment filter."}))},{description:"Log selection used for new error pattern detection. All configured fields must match for logs to be included."})},{$id:"InputMonitorConfigurationLogErrorPattern"}),RB=C("type",[eR,rR,oR,iR,sR,OB,pR,uR],{description:"Monitor evaluation configuration. The `type` discriminator determines which telemetry source, condition shape, and evaluation rules Tsuga uses."}),CB=C("type",[tR,nR,bB,aR,cR,SB,xB,AB],{description:"Monitor evaluation configuration. The `type` discriminator determines which telemetry source, condition shape, and evaluation rules Tsuga uses."});var oLe=[pi,co,co.replace(`${$}.`,"")];var qr=r.Object({id:r.String({description:"Tsuga-generated monitor ID assigned when the monitor is created."}),name:r.String({description:"Display name of the monitor and alert source."}),owner:r.String({description:"Team ID that owns and manages the monitor."}),message:r.Optional(r.String({description:"Caller-supplied message included in notifications triggered by this monitor. Omitted when the monitor was created or last updated without one."})),tags:De,configuration:RB,priority:r.Enum(St,{description:"Monitor priority from 1 through 5, where 1 is highest priority."}),permissions:Tn,dashboardId:r.Optional(r.String({description:"ID of the dashboard linked to this monitor for context when investigating alerts. Caller-supplied. Omitted when no dashboard is linked."})),pauseUntil:r.Optional(A({description:"Timestamp until which the monitor is snoozed."})),creator:r.Optional(pe),updater:r.Optional(pe),createdAt:A({description:"Timestamp when Tsuga created the monitor."}),updatedAt:A({description:"Timestamp when Tsuga last updated the monitor."}),assetUpdatedAt:A({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."}),clusterIds:r.Array(r.String(),{description:"Cluster IDs where the monitor is deployed. Empty means all eligible clusters."})},{title:"Monitor"}),PB=C("type",[eR,rR,oR,iR,sR,pR,uR]),iLe=r.Object({...qr.properties,configuration:PB},{title:"Monitor"}),aLe=r.Object({...qr.properties,configuration:C("type",[tR,nR,aR,cR])},{title:"Monitor"}),os=r.Object({name:u({description:"Display name of the monitor and alert source."}),message:r.Optional(u({type:"long",description:"Message included in notifications triggered by this monitor. Optional on create. On update, omitting it keeps the existing message."})),tags:Xe,configuration:CB,priority:r.Enum(St,{description:"Monitor priority from 1 through 5, where 1 is highest priority."}),owner:u({allowEmpty:!1,description:"Team ID that owns and manages the monitor."}),dashboardId:r.Optional(r.Union([r.Null(),u({allowEmpty:!1})],{description:"ID of the dashboard to link to this monitor for context when investigating alerts. On create: omit or send `null` to leave the monitor unlinked. On update: omit to skip updating this field, send `null` to clear an existing link."})),pauseUntil:r.Optional(u({allowEmpty:!1,type:"date-time",description:"ISO timestamp until which the monitor should be snoozed."})),permissions:Tn,clusterIds:r.Optional(r.Array(u({allowEmpty:!1}),{description:"Cluster IDs where the monitor should be deployed. Empty or omitted means all eligible clusters for cluster-deployed monitor types."}))}),Zx=["threshold","certificate-expiry","anomaly-detection","log-error-pattern"],bn={PRIORITY:"priority",TYPE:"type",NAME:"name",OWNER:"owner",TAGS:"tags",CLUSTER_IDS:"clusterIds",PAUSE_UNTIL:"pauseUntil",ASSET_UPDATED_AT:"assetUpdatedAt"};var vd=r.Object({owners:_e(u({allowEmpty:!1}),{description:"Restrict results to monitors owned by any of these team IDs",maxItems:50}),searchQuery:r.Object({value:u({allowEmpty:!1,description:"Case-insensitive substring matched against monitor ID, monitor name, query filters, and aggregate fields. Wildcard characters are treated literally."}),exclude:r.Optional(r.Boolean({description:"If true, exclude monitors matching this value instead of including them"}))},{description:"Search query filter for monitors."}),tags:_e(Bt.items,{description:"Restrict results to monitors that have at least one of the listed key/value tags",maxItems:50}),priorities:_e(r.Enum(St),{description:"Restrict results to monitors with one of these priorities",maxItems:St.length}),types:_e(r.Enum(Zx),{description:"Restrict results to monitors with these types",maxItems:Zx.length}),activity:r.Enum(["active","snoozed"],{description:"Restrict results by activity status: active monitors or currently snoozed monitors"}),clusterIds:_e(u({allowEmpty:!1}),{description:"Restrict results to monitors deployed to any of these cluster IDs (monitors with no cluster restriction are always included)",maxItems:50})},{description:"Optional filters applied to narrow the returned monitors"}),Nd=r.Partial(r.Object({...ge,filters:r.Partial(vd),sort:r.Object({by:r.Enum([bn.PRIORITY,bn.TYPE,bn.NAME,bn.OWNER,bn.TAGS,bn.CLUSTER_IDS,bn.PAUSE_UNTIL,bn.ASSET_UPDATED_AT],{description:"Field to sort the returned monitors by. For `priority`, `desc` returns highest-priority monitors first because priority 1 is highest."}),direction:r.Enum(["asc","desc"],{description:"Sort direction. For `priority`, `desc` returns priority 1 first and `asc` returns priority 5 first."})},{description:"Optional sorting applied to the returned monitors. Ties are broken by creation time and monitor ID for stable pagination."})})),sLe=d({tags:["monitors"],url:`${At}/query`,method:"POST",paginated:!0,response:r.Array(qr),body:Nd}),cLe=d({tags:["monitors"],url:`${At}/tags/query`,method:"POST",body:r.Object({filters:r.Optional(r.Partial(r.Omit(vd,["tags"])))}),response:qt}),pLe=d({tags:["monitors"],url:`${At}/counts/query`,method:"POST",body:r.Object({filters:r.Optional(r.Partial(r.Omit(vd,["activity"])))}),response:r.Object({all:r.Integer({description:"Total number of monitors matching the filters that the user can read."}),active:r.Integer({description:"Number of matching readable monitors that are not currently snoozed."}),snoozed:r.Integer({description:"Number of matching readable monitors that are currently snoozed."})})}),uLe=d({tags:["monitors"],url:`${At}/:id`,method:"GET",params:r.Object({id:u()}),response:qr}),lLe=d({tags:["monitors"],url:At,method:"POST",body:os,response:qr}),mLe=d({tags:["monitors"],url:`${At}/:id`,method:"PUT",params:r.Object({id:u()}),body:os,response:qr}),dLe=d({tags:["monitors"],url:`${At}/bulk-update`,method:"PUT",body:r.Object({monitorIds:r.Array(u({allowEmpty:!1}),{minItems:1}),owner:u({allowEmpty:!1})}),response:r.Object({})}),fLe=d({tags:["monitors"],url:`${At}/:id`,method:"DELETE",params:r.Object({id:u()}),response:N}),gLe=d({tags:["monitors"],url:`${At}/bulk-delete`,method:"DELETE",body:r.Object({ids:r.Array(u())}),response:r.Object({})}),hLe=d({tags:["monitors"],url:`${At}/:id/snooze`,method:"POST",params:r.Object({id:u()}),body:r.Object({pauseUntil:u({allowEmpty:!1,type:"date-time"})}),response:qr}),yLe=d({tags:["monitors"],url:`${At}/bulk-snooze`,method:"POST",body:r.Object({monitorIds:r.Array(u()),pauseUntil:u({allowEmpty:!1,type:"date-time"})}),response:r.Object({})}),UB=["alert","alert_consider_zero","alert_no_data","keep_last_status_alert"],wB=["ok","ok_consider_zero","ok_no_data","keep_last_status_ok"],vB=[...UB,...wB],po=r.Enum(vB),NB=C("type",[r.Object({type:r.Literal("each"),subStates:r.Record(r.String(),r.Object({stateValue:r.Union([po,r.Null()]),lastChangedAt:A()}))}),r.Object({type:r.Literal("no_aggregation"),stateValue:r.Optional(po)}),r.Object({type:r.Literal("any"),stateValue:r.Optional(po)}),r.Object({type:r.Literal("all"),stateValue:r.Optional(po)}),r.Object({type:r.Literal("proportion"),stateValue:r.Optional(po)})]),LB=r.Object({monitorId:r.String(),currentState:NB,lastChangedAt:r.Optional(A())}),TLe=d({tags:["monitors"],url:`${At}/states/:id`,method:"GET",params:r.Object({id:u()}),response:LB}),ELe=d({tags:["monitors"],url:`${At}/:id/transitions`,method:"GET",params:r.Object({id:u()}),query:r.Object({from:r.Number(),to:r.Number()}),response:r.Array(r.Object({id:r.String(),createdAt:A(),fromState:r.Optional(po),toState:r.Optional(po),dimension:r.Optional(r.String())}))}),kB=["unprocessed","processed","failed-to-process"],_Le=d({tags:["monitors"],url:`${At}/:id/results`,method:"GET",params:r.Object({id:u()}),query:r.Object({from:r.Number(),to:r.Number()}),response:r.Object({isTruncated:r.Boolean(),results:r.Array(r.Object({id:r.String(),evaluationAt:A(),formulaResult:r.Object({groups:r.Array(r.Object({groupKey:r.Record(r.String(),es),results:r.Array(r.Union([r.Number(),r.Null()])),conditionMet:r.Enum(["true","false","nan-no-data"])}))}),createdAt:A(),status:r.Enum(kB)}))})});var Br="/v0/slos",MB=[7,30,90],DB=["good","bad"],fR=r.Enum(DB,{description:"How to treat SLO with no data: good (count as meeting the SLO), bad (count as breaching it)"}),GB=["good","bad","ignore"],gR=r.Enum(GB,{description:"How to treat time buckets with no data: good (count as meeting the SLO), bad (count as breaching it), or ignore (exclude from the error budget)"}),lR=30,mR=1440,hR=["greater_than","less_than","greater_than_or_equal","less_than_or_equal"],$B=["healthy","breached","no_data"],lu=r.Enum($B,{description:"SLO status: healthy (meeting the target), breached (breaching it), or no_data (not evaluated yet)"}),dR={sli:r.Optional(r.Number({description:"Service level indicator for the latest evaluation; absent when there is no data"})),errorBudget:r.Optional(r.Number({description:"Remaining error budget at the latest evaluation; negative when exhausted, absent when there is no data"})),status:lu},jB=r.Object({overall:r.Object(dR,{description:"Latest overall evaluation for the cluster"}),perGroup:r.Array(r.Object({groupKey:r.Record(r.String(),es,{description:"Group-by field values identifying this group, keyed by field name. Present only when the SLO configuration sets `groupByFields`."}),...dR}),{description:"Latest evaluation for each group produced by the SLO configuration's `groupByFields`. Empty when the SLO is not grouped."})},{title:"SloClusterResults"}),yR=r.Record(r.String(),jB,{description:"Latest evaluation results keyed by cluster ID."}),Ld=r.Object({queries:jr,formula:Jp},{title:"SloQueryFormula",description:"Aggregation queries combined by a formula to produce the SLO signal. Tsuga evaluates this query formula during SLO evaluation and returns it as part of the saved SLO configuration. Returned queries include Tsuga-derived missing-point fill: event SLO queries use zero fill, and time SLO queries keep missing points null."}),kd=r.Object({queries:_x,formula:so},{title:"SloQueryFormula",description:"Aggregation queries combined by a formula to produce the SLO signal. Formulas reference queries as q1, q2, and so on. Do not send per-query fill; Tsuga derives the fill behavior from the SLO type."}),FB=r.Object({type:r.Literal("burn-rate",{description:"Alert configuration kind. Set to `burn-rate` for alerts that fire when the SLO consumes error budget faster than the configured multiplier."}),burnRate:r.Number({description:"Burn-rate multiplier that triggers this alert. The short and long evaluation windows are derived from the predefined template with the closest burn rate."})},{title:"BurnRateAlert"}),qB=r.Object({type:r.Literal("burn-rate",{description:"Alert configuration kind. Set to `burn-rate` for alerts that fire when the SLO consumes error budget faster than the configured multiplier."}),burnRate:r.Number({minimum:1,maximum:100,description:"Burn-rate multiplier that triggers this alert. Required for burn-rate alerts; valid input is 1 through 100. Non-template values are accepted; short and long evaluation windows are derived from the predefined template with the closest burn rate."})},{title:"BurnRateAlert"});var BB=r.Object({type:r.Literal("threshold",{description:"Alert configuration kind. Set to `threshold` for alerts that fire when the SLO indicator falls below a percentage threshold."}),threshold:r.Number({description:"SLI percentage threshold for this alert. The alert passes when SLI is at or above this value and fires when SLI is strictly below it."})},{title:"ThresholdAlert"}),HB=r.Object({type:r.Literal("threshold",{description:"Alert configuration kind. Set to `threshold` for alerts that fire when the SLO indicator falls below a percentage threshold."}),threshold:r.Number({exclusiveMinimum:0,exclusiveMaximum:100,description:"SLI percentage threshold for this alert. Required for threshold alerts; valid input is greater than 0 and less than 100. The alert passes when SLI is at or above this value and fires when SLI is strictly below it."})},{title:"ThresholdAlert"}),KB=C("type",[FB,BB],{description:"Alert trigger configuration: burn-rate or threshold"}),TR=C("type",[qB,HB],{description:"Alert trigger configuration: burn-rate or threshold"}),Md=r.Enum(St,{description:"Alert priority (1 is highest, 5 is lowest)"}),Dd=r.Object({id:r.String({description:"Tsuga-generated SLO alert ID assigned when the alert is created."}),sloId:r.String({description:"Parent SLO ID for this alert."}),priority:Md,configuration:KB,createdAt:A({description:"Timestamp when Tsuga created the alert."}),updatedAt:A({description:"Timestamp when Tsuga last updated the alert."}),assetUpdatedAt:A({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})},{title:"SloAlert"}),zB=r.Object({priority:Md,configuration:TR}),YB=r.Object({id:r.Optional(u({allowEmpty:!1,description:"Identifier of an existing alert to update. Omit to create a new alert on this SLO."})),priority:Md,configuration:TR}),VB=C("type",[r.Object({type:r.Literal("event",{description:"Configuration kind. Set to `event` for SLOs that compute SLI from good and total query formulas over the rolling timeframe."}),dataSource:or,goodQuery:Ld,totalQuery:Ld,groupByFields:r.Optional(ci),noDataBehavior:fR},{title:"EventSloConfiguration"}),r.Object({type:r.Literal("time",{description:"Configuration kind. Set to `time` for SLOs that evaluate a query against a threshold in fixed-size time slices."}),dataSource:or,query:Ld,sliceSizeMinutes:r.Integer({description:"Length of each time-SLO evaluation slice in minutes. Required for `type: time`."}),threshold:r.Object({operator:r.Enum(hR,{description:"Comparison operator between the query value and the threshold"}),value:r.Number({description:"Threshold value compared against the query signal"})},{description:"Threshold comparison applied to each time-SLO evaluation slice"}),groupByFields:r.Optional(ci),noDataBehavior:gR},{title:"TimeSliceSloConfiguration"})],{description:"SLI configuration for this SLO. Use `event` for good/total event-ratio SLOs or `time` for thresholded time-slice SLOs."});var QB=C("type",[r.Object({type:r.Literal("event",{description:"Configuration kind. Set to `event` for SLOs that compute SLI from good and total query formulas over the rolling timeframe."}),dataSource:or,goodQuery:kd,totalQuery:kd,groupByFields:r.Optional(Fr),noDataBehavior:fR},{title:"EventSloConfiguration"}),r.Object({type:r.Literal("time",{description:"Configuration kind. Set to `time` for SLOs that evaluate a query against a threshold in fixed-size time slices."}),dataSource:or,query:kd,sliceSizeMinutes:r.Integer({minimum:lR,maximum:mR,description:`Length of each time-SLO evaluation slice in minutes. Required for \`type: time\`. Valid input is ${lR} through ${mR}.`}),threshold:r.Object({operator:r.Enum(hR,{description:"Comparison operator between the query value and the threshold"}),value:r.Number({description:"Threshold value compared against the query signal"})},{description:"Threshold comparison applied to each time-SLO evaluation slice"}),groupByFields:r.Optional(Fr),noDataBehavior:gR},{title:"TimeSliceSloConfiguration"})],{description:"SLI configuration for this SLO. Use `event` for good/total event-ratio SLOs or `time` for thresholded time-slice SLOs."}),WB=r.Number({exclusiveMinimum:0,exclusiveMaximum:100,description:"Target percentage (0 < target < 100, e.g. 99.9)"}),ER=r.Enum(MB,{type:"integer",description:"Rolling SLO evaluation window in days. Set by the caller on create or update and returned on read and list responses. Allowed values are 7, 30, and 90."}),ZB=r.Array(r.String(),{description:"Cluster IDs this SLO is evaluated on. Omit or send an empty array on input to run on all clusters; responses use an empty array to mean all clusters. Non-empty input values must reference existing clusters."}),XB=r.Array(u({allowEmpty:!1}),{description:"Cluster IDs this SLO is evaluated on. Omit or send an empty array on input to run on all clusters; responses use an empty array to mean all clusters. Non-empty input values must reference existing clusters."}),di=r.Object({id:r.String({description:"Tsuga-generated SLO ID assigned when the SLO is created."}),name:r.String({description:"Display name of the SLO, set by the caller."}),description:r.Optional(r.String({description:"Free-form, caller-provided description of what the SLO measures. Absent when not set."})),tags:De,configuration:VB,target:r.Number({description:"Target percentage (0 < target < 100, e.g. 99.9)"}),timeframeDays:ER,owner:r.String({description:"Team ID that owns the SLO"}),permissions:Tn,clusterIds:ZB,creator:r.Optional(pe),updater:r.Optional(pe),alerts:r.Array(Dd,{description:"Alerts attached to this SLO"}),createdAt:A({description:"Timestamp when Tsuga created the SLO."}),updatedAt:A({description:"Timestamp when Tsuga last updated the SLO."}),assetUpdatedAt:A({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})},{title:"Slo"}),JB=r.Object({...di.properties,results:yR},{title:"SloWithResults"}),mu=r.Object({name:u({allowEmpty:!1,description:"Display name of the SLO."}),description:r.Optional(u({type:"long",description:"Free-form, caller-provided description of what the SLO measures. Optional."})),tags:Xe,configuration:QB,target:WB,timeframeDays:ER,owner:u({allowEmpty:!1,description:"Team ID that owns the SLO"}),permissions:Tn,clusterIds:r.Optional(XB),alerts:r.Array(zB,{description:"Alerts to create on this SLO. Send an empty array for none."})}),Gd=r.Object({...r.Omit(mu,["alerts"]).properties,alerts:r.Array(YB,{description:"Alerts attached to this SLO. The SLO owns its alerts: the set is reconciled to exactly this list \u2014 existing alerts are matched by id, alerts without an id are created, and existing alerts absent from the list are deleted. Send an empty array to clear all alerts."})}),_R=r.Object({owners:_e(u({allowEmpty:!1}),{description:"Restrict results to SLOs owned by any of these team IDs",maxItems:50}),searchQuery:r.Object({value:u({allowEmpty:!1,description:"Substring matched case-insensitively against the SLO name or SLO ID."}),exclude:r.Optional(r.Boolean({description:"If true, exclude SLOs matching this value instead of including them"}))},{description:"Text filter for SLO names or IDs. Optional; `exclude: true` removes matching SLOs."}),tags:_e(Bt.items,{description:"Restrict results to SLOs that have at least one of the listed key/value tags",maxItems:50}),clusterIds:_e(u({allowEmpty:!1}),{description:"Restrict results to SLOs that run against any of these cluster IDs (SLOs with no cluster restriction are always included)",maxItems:50}),statuses:_e(lu,{description:"Restrict results to SLOs whose status is one of these values",maxItems:3})},{description:"Optional filters applied to narrow the returned SLOs"}),$d=r.Partial(_R),jd=r.Partial(r.Object({...ge,filters:$d,sort:r.Object({by:r.Enum(["name","owner","tags","updatedAt","sli","errorBudget","status"],{description:"Field to sort by"}),direction:r.Enum(["asc","desc"],{description:"Sort direction: ascending or descending"})},{description:"Optional sorting applied to the returned SLOs"})})),jLe=d({tags:["slos"],url:`${Br}/query`,method:"POST",paginated:!0,response:r.Array(JB),body:jd}),FLe=d({tags:["slos"],url:`${Br}/tags/query`,method:"POST",body:r.Object({filters:r.Optional(r.Partial(r.Omit(_R,["tags","statuses"])))}),response:qt}),qLe=d({tags:["slos"],url:`${Br}/:id`,method:"GET",params:r.Object({id:u()}),response:di}),BLe=d({tags:["slos"],url:`${Br}/:id/results`,method:"GET",params:r.Object({id:u()}),response:yR}),HLe=d({tags:["slos"],url:Br,method:"POST",body:mu,response:di}),KLe=d({tags:["slos"],url:`${Br}/:id`,method:"PUT",params:r.Object({id:u()}),body:Gd,response:di}),zLe=d({tags:["slos"],url:`${Br}/:id`,method:"DELETE",params:r.Object({id:u()}),response:N}),eH=jm($d),YLe=d({tags:["slos"],url:`${Br}/bulk-delete`,method:"DELETE",body:r.Object({selection:eH}),response:r.Object({})}),tH=jm($d,{maxIds:100}),VLe=d({tags:["slos"],url:`${Br}/bulk-update`,method:"PUT",body:r.Object({selection:tH,owner:u({allowEmpty:!1})}),response:r.Object({})});var fi="/v0/notifications",Sn=`${fi}/rules`,IR=`${fi}/slack/setup`,is=`${fi}/integrations`,uo=["triggered","resolved","no-data"],rH=["sent","stale","pending","rate-limited","failed","silenced"],nH=r.Optional(r.Object({maxMessages:r.Integer({description:"Maximum number of notifications this target can send during the rate-limiting window."}),minutes:r.Integer({description:"Length of the rate-limiting window, in minutes."})},{description:"Per-target rate limit used when sending notifications. If omitted, Tsuga allows up to 1000 notifications every 10 minutes for this target."})),Fd=r.Object({maxMessages:r.Integer({minimum:1,description:"Maximum number of notifications this target can send during the rate-limiting window. The ratio of `maxMessages` to `minutes` cannot exceed 100 notifications per minute."}),minutes:r.Integer({minimum:1,description:"Length of the rate-limiting window, in minutes. The ratio of `maxMessages` to `minutes` cannot exceed 100 notifications per minute."})},{description:"Per-target rate limit used when sending notifications. If omitted, Tsuga allows up to 1000 notifications every 10 minutes for this target."}),oH=r.Optional(Fd),br=r.Optional(r.Object({mode:r.Literal("each",{description:"Renotification mode. `each` sends repeat notifications for each matching monitor alert that remains in a configured state."}),renotificationStates:r.Array(r.Enum(["alert","alert_no_data"]),{description:"Monitor alert states that trigger repeat notifications while the target remains configured for renotification."}),renotifyIntervalMinutes:r.Integer({description:"Minimum number of minutes to wait after the previous notification."})},{description:"Configuration for repeat monitor notifications on this target. If omitted, Tsuga sends only the original notification for each alert transition."})),Sr=r.Optional(r.Object({mode:r.Literal("each",{description:"Renotification mode. `each` sends repeat notifications for each matching monitor alert that remains in a configured state."}),renotificationStates:r.Array(r.Enum(["alert","alert_no_data"]),{description:"Monitor alert states that trigger repeat notifications while the target remains configured for renotification."}),renotifyIntervalMinutes:r.Integer({minimum:1,description:"Minimum number of minutes to wait after the previous notification."})},{description:"Configuration for repeat monitor notifications on this target. If omitted, Tsuga sends only the original notification for each alert transition."})),as=r.Object({id:r.String({description:"Identifier of the notification target within this rule, used with the rule ID for per-target delivery state such as rate limiting."}),rateLimit:nH,config:C("type",[r.Object({type:r.Literal("slack",{description:"Slack target backed by a configured Slack integration."}),channel:r.String({description:"Slack channel ID that receives the notification"}),integrationId:r.String({description:"Slack workspace ID that receives the notification"}),integrationName:r.String({description:"Human readable name of the Slack integration"}),renotifyConfig:br},{$id:"RuleTargetConfigSlack"}),r.Object({type:r.Literal("incident-io",{description:"incident.io target backed by a configured incident.io integration."}),integrationId:r.String({description:"Identifier of the incident.io integration to use"}),integrationName:r.String({description:"Human readable name of the incident.io integration"}),renotifyConfig:br},{$id:"RuleTargetConfigIncidentIo"}),r.Object({type:r.Literal("email",{description:"Email target that sends directly to the listed addresses and does not require an integration."}),addresses:r.Array(r.String(),{description:"Email addresses that will receive the alert"}),renotifyConfig:br},{$id:"RuleTargetConfigEmail"}),r.Object({type:r.Literal("grafana-irm",{description:"Grafana IRM target backed by a configured Grafana IRM integration."}),integrationId:r.String({description:"Identifier of the Grafana IRM integration to use"}),integrationName:r.String({description:"Human readable name of the Grafana IRM integration"}),renotifyConfig:br},{$id:"RuleTargetConfigGrafanaIrm"}),r.Object({type:r.Literal("pagerduty",{description:"PagerDuty target backed by a configured PagerDuty integration."}),integrationId:r.String({description:"Identifier of the PagerDuty integration to use"}),integrationName:r.String({description:"Human readable name of the PagerDuty integration"}),renotifyConfig:br},{$id:"RuleTargetConfigPagerDuty"}),r.Object({type:r.Literal("microsoft-teams",{description:"Microsoft Teams target backed by a configured Microsoft Teams integration."}),integrationId:r.String({description:"Identifier of the Microsoft Teams integration to use"}),integrationName:r.String({description:"Human readable name of the Microsoft Teams integration"}),renotifyConfig:br},{$id:"RuleTargetConfigMicrosoftTeams"}),r.Object({type:r.Literal("webhook",{description:"Webhook target backed by a configured webhook integration."}),integrationId:r.String({description:"Identifier of the webhook integration to use"}),integrationName:r.String({description:"Human readable name of the webhook integration"}),renotifyConfig:br},{$id:"RuleTargetConfigWebhook"}),r.Object({type:r.Literal("servicenow",{description:"ServiceNow target backed by a configured ServiceNow integration."}),integrationId:r.String({description:"Identifier of the ServiceNow integration to use"}),integrationName:r.String({description:"Human readable name of the ServiceNow integration"}),renotifyConfig:br},{$id:"RuleTargetConfigServiceNow"}),r.Object({type:r.Literal("google-chat",{description:"Google Chat target backed by a configured Google Chat integration."}),integrationId:r.String({description:"Identifier of the Google Chat integration to use"}),integrationName:r.String({description:"Human readable name of the Google Chat integration"}),renotifyConfig:br},{$id:"RuleTargetConfigGoogleChat"}),r.Object({type:r.Literal("squadcast",{description:"Squadcast target backed by a configured Squadcast integration."}),integrationId:r.String({description:"Identifier of the Squadcast integration to use"}),integrationName:r.String({description:"Human readable name of the Squadcast integration"}),renotifyConfig:br},{$id:"RuleTargetConfigSquadcast"}),r.Object({type:r.Literal("jira",{description:"Jira target backed by a configured Jira integration. Jira targets file one issue per notification and do not support renotification."}),integrationId:r.String({description:"Identifier of the Jira integration to use"}),integrationName:r.String({description:"Human readable name of the Jira integration"}),projectKey:r.String({description:'Key of the Jira project that alert issues are filed into, like "OPS".'}),issueType:r.String({description:'Name of the Jira issue type created for alerts, like "Bug" or "Task".'}),openStatus:r.Optional(r.String({description:"Jira status the alert ticket is moved to right after it is filed for a firing alert. A later transition between two firing states leaves the ticket status alone."})),closedStatus:r.Optional(r.String({description:"Jira status the alert ticket is moved to when the alert resolves. Only takes effect when the rule delivers recovery transitions."}))},{$id:"RuleTargetConfigJira"})],{description:"Destination that received the notification. The `type` field discriminates the variant: `email` sends directly to the listed addresses, and every other type routes through the named integration referenced by `integrationId`."})}),gi=r.Object({id:u({description:"Identifier of the notification target within this rule. Choose a stable ID that is unique among this rule's targets; Tsuga uses it with the rule ID for per-target delivery state such as rate limiting."}),rateLimit:oH,config:C("type",[r.Object({type:r.Literal("slack",{description:"Slack target backed by a configured Slack integration."}),channel:u({allowEmpty:!1,description:"Slack channel ID that receives the notification"}),integrationId:u({allowEmpty:!1,description:"Slack workspace ID that receives the notification"}),renotifyConfig:Sr},{$id:"RuleTargetInputSlack"}),r.Object({type:r.Literal("incident-io",{description:"incident.io target backed by a configured incident.io integration."}),integrationId:u({allowEmpty:!1,description:"Identifier of the incident.io integration to use"}),renotifyConfig:Sr},{$id:"RuleTargetInputIncidentIo"}),r.Object({type:r.Literal("pagerduty",{description:"PagerDuty target backed by a configured PagerDuty integration."}),integrationId:u({allowEmpty:!1,description:"Identifier of the PagerDuty integration to use"}),renotifyConfig:Sr},{$id:"RuleTargetInputPagerDuty"}),r.Object({type:r.Literal("email",{description:"Email target that sends directly to the listed addresses and does not require an integration."}),addresses:r.Array(u({type:"email"}),{minItems:1,maxItems:20,description:"Email addresses that will receive the alert"}),renotifyConfig:Sr},{$id:"RuleTargetInputEmail"}),r.Object({type:r.Literal("grafana-irm",{description:"Grafana IRM target backed by a configured Grafana IRM integration."}),integrationId:u({allowEmpty:!1,description:"Identifier of the Grafana IRM integration to use"}),renotifyConfig:Sr},{$id:"RuleTargetInputGrafanaIrm"}),r.Object({type:r.Literal("microsoft-teams",{description:"Microsoft Teams target backed by a configured Microsoft Teams integration."}),integrationId:u({allowEmpty:!1,description:"Identifier of the Microsoft Teams integration to use"}),renotifyConfig:Sr},{$id:"RuleTargetInputMicrosoftTeams"}),r.Object({type:r.Literal("webhook",{description:"Webhook target backed by a configured webhook integration."}),integrationId:u({allowEmpty:!1,description:"Identifier of the webhook integration to use"}),renotifyConfig:Sr},{$id:"RuleTargetInputWebhook"}),r.Object({type:r.Literal("servicenow",{description:"ServiceNow target backed by a configured ServiceNow integration."}),integrationId:u({allowEmpty:!1,description:"Identifier of the ServiceNow integration to use"}),renotifyConfig:Sr},{$id:"RuleTargetInputServiceNow"}),r.Object({type:r.Literal("google-chat",{description:"Google Chat target backed by a configured Google Chat integration."}),integrationId:u({allowEmpty:!1,description:"Identifier of the Google Chat integration to use"}),renotifyConfig:Sr},{$id:"RuleTargetInputGoogleChat"}),r.Object({type:r.Literal("squadcast",{description:"Squadcast target backed by a configured Squadcast integration."}),integrationId:u({allowEmpty:!1,description:"Identifier of the Squadcast integration to use"}),renotifyConfig:Sr},{$id:"RuleTargetInputSquadcast"}),r.Object({type:r.Literal("jira",{description:"Jira target backed by a configured Jira integration. Jira targets file one issue per notification and do not support renotification."}),integrationId:u({allowEmpty:!1,description:"Identifier of the Jira integration to use"}),projectKey:u({allowEmpty:!1,description:'Key of the Jira project that alert issues are filed into, like "OPS".'}),issueType:u({allowEmpty:!1,description:'Name of the Jira issue type created for alerts, like "Bug" or "Task".'}),openStatus:r.Optional(u({allowEmpty:!1,description:"Jira status the alert ticket is moved to right after it is filed for a firing alert. A later transition between two firing states leaves the ticket status alone."})),closedStatus:r.Optional(u({allowEmpty:!1,description:"Jira status the alert ticket is moved to when the alert resolves. Only takes effect when the rule delivers recovery transitions."}))},{$id:"RuleTargetInputJira"})],{description:"Destination that should receive the notification. The `type` field discriminates the variant: `email` sends directly to the listed addresses and needs no integration; every other type routes through the integration identified by `integrationId`, which must already exist (create it first with the notification integration endpoints)."})}),qd=C("type",[r.Object({type:r.Literal("specific-teams",{description:"Match alert transitions associated with the listed teams. The caller must be allowed to access every listed team."}),teams:r.Array(r.String(),{description:"Team IDs selected by this filter."})},{title:"SpecificTeams"}),r.Object({type:r.Literal("all-teams",{description:"Match alert transitions for every team in the organization. Public API callers need an API key with `all` scope to create or update this filter."})},{title:"AllTeams"}),r.Object({type:r.Literal("all-public-teams",{description:"Match alert transitions for all public teams. Public API callers need an API key with `all` or `owning-team-and-public` scope to create or update this filter."})},{title:"AllPublicTeams"})],{description:"Team visibility filter used when matching alert transitions. Tsuga validates create and update requests against the caller permissions."}),Bd=C("type",[r.Object({type:r.Literal("specific-teams",{description:"Match alert transitions associated with the listed teams. The caller must be allowed to access every listed team."}),teams:r.Array(u(),{minItems:1,maxItems:100,description:"Team IDs selected by this filter."})},{title:"SpecificTeams"}),r.Object({type:r.Literal("all-teams",{description:"Match alert transitions for every team in the organization. Public API callers need an API key with `all` scope to create or update this filter."})},{title:"AllTeams"}),r.Object({type:r.Literal("all-public-teams",{description:"Match alert transitions for all public teams. Public API callers need an API key with `all` or `owning-team-and-public` scope to create or update this filter."})},{title:"AllPublicTeams"})],{description:"Team visibility filter used when matching alert transitions. Tsuga validates create and update requests against the caller permissions."}),hi=r.Object({id:r.String({description:"Tsuga-generated notification rule ID assigned when the rule is created."}),name:r.String({description:"Display name of the notification rule."}),queryString:r.Optional(r.String({description:"Optional query that narrows which alert transitions trigger the rule. Matches on the monitor transition group key and the monitor tags, e.g. `env:prod service:api`. Omit or leave empty to match regardless of tags."})),teamsFilter:qd,prioritiesFilter:r.Array(r.Enum(St),{description:"Monitor priorities that must match for this rule to fire. An empty array matches every priority."}),transitionTypesFilter:r.Array(r.Enum(uo),{description:"Alert state transitions that must match for this rule to fire. An empty array matches every transition type."}),clusterIdsFilter:r.Array(r.String(),{description:"Cluster IDs that must match for this rule to fire. An empty array matches every cluster, as does a transition that has no cluster ID."}),owner:r.String({description:"Team ID that owns and manages the rule."}),createdAt:A({description:"Timestamp when Tsuga created the rule."}),updatedAt:A({description:"Timestamp when Tsuga last updated the rule."}),isActive:r.Boolean({description:"Whether the rule currently sends notifications when its filters match."}),tags:De,targets:r.Array(as,{description:"Destinations that receive a notification whenever this rule matches an alert transition. Every target in the list is notified independently, subject to its own rate limit and renotification settings."}),creator:r.Optional(pe),updater:r.Optional(pe)}),ss=r.Object({name:u({description:"Display name of the notification rule."}),queryString:r.Optional(u({type:"tags-query",description:"Optional query that narrows which alert transitions trigger the rule. Matches on the monitor transition group key and the monitor tags, e.g. `env:prod service:api`. Omit or leave empty to match regardless of tags."})),teamsFilter:Bd,prioritiesFilter:r.Array(r.Enum(St),{maxItems:St.length,description:"Monitor priorities that must match for this rule to fire. An empty array matches every priority."}),transitionTypesFilter:r.Array(r.Enum(uo),{maxItems:uo.length,description:"Alert state transitions that must match for this rule to fire. An empty array matches every transition type."}),clusterIdsFilter:r.Optional(r.Array(u({allowEmpty:!1}),{description:"Cluster IDs that must match for this rule to fire. Omit it, or leave it empty, to match every cluster."})),owner:u({allowEmpty:!1,description:"Team ID that owns and manages the rule"}),tags:Xe,isActive:r.Boolean({description:"Set to true for the rule to send notifications when its filters match."}),targets:r.Array(gi,{minItems:1,description:"Destinations that receive a notification whenever this rule matches an alert transition. This list replaces the existing targets on update."})}),du=r.Object({id:r.String({description:"Unique identifier of the adaptive notification rule. Generated by Tsuga."}),name:r.String({description:"Display name of the adaptive notification rule."}),owner:r.String({description:"Team ID that owns and manages the rule."}),createdAt:A({description:"Timestamp when Tsuga created the rule."}),updatedAt:A({description:"Timestamp when Tsuga last updated the rule."}),isActive:r.Boolean({description:"Whether the rule currently sends notifications when one of its monitors fires."}),shouldCreateInvestigation:r.Boolean({description:"Whether each page records an investigation holding the sampled traces and the call graph the destination was resolved from, linked from the notification body."}),tags:De,monitorIds:r.Array(r.String(),{description:"Monitors this rule reacts to."}),sloIds:r.Array(r.String(),{description:"SLOs this rule reacts to."}),fallbackTarget:as,creator:r.Optional(pe),updater:r.Optional(pe)}),bR=r.Object({name:u({description:"Display name of the adaptive notification rule."}),owner:u({allowEmpty:!1,description:"Team ID that owns and manages the rule"}),tags:Xe,isActive:r.Boolean({description:"Set to true for the rule to send notifications when one of its monitors fires."}),shouldCreateInvestigation:r.Optional(r.Boolean({description:"Set to true to record an investigation for each page, holding the sampled traces and the call graph the destination was resolved from, and to link it from the notification body. Defaults to false."})),monitorIds:r.Optional(r.Array(u({allowEmpty:!1}),{maxItems:100,description:"Monitors this rule reacts to. Only trace monitors and metric monitors over OTel span metrics are eligible. Send at least one monitor or SLO."})),sloIds:r.Optional(r.Array(u({allowEmpty:!1}),{maxItems:100,description:"SLOs this rule reacts to. Only SLOs over traces or OTel span metrics are eligible. Omit for a rule that reacts to monitors only; send at least one monitor or SLO."})),fallbackTarget:gi}),nke=d({tags:["notification-rules"],url:Sn,method:"GET",paginated:!0,query:r.Object(ge),response:r.Array(hi)}),oke=d({tags:["notification-rules"],url:`${Sn}/:id`,params:r.Object({id:u()}),method:"GET",response:hi}),ike=d({tags:["notification-rules"],url:Sn,method:"POST",body:ss,response:hi}),ake=d({tags:["notification-rules"],url:`${Sn}/:id`,method:"PUT",params:r.Object({id:u()}),body:ss,response:hi}),ske=d({tags:["notification-rules"],url:`${Sn}/:id`,method:"DELETE",params:r.Object({id:u()}),response:N}),cke=d({tags:["notification-rules"],url:`${Sn}/bulk-delete`,method:"DELETE",body:r.Object({ids:r.Array(u())}),response:r.Object({})}),yi=`${fi}/adaptive-rules`,pke=d({tags:["notification-rules"],url:yi,method:"GET",paginated:!0,query:r.Object(ge),response:r.Array(du)}),uke=d({tags:["notification-rules"],url:`${yi}/:id`,params:r.Object({id:u()}),method:"GET",response:du}),lke=d({tags:["notification-rules"],url:yi,method:"POST",body:bR,response:du}),mke=d({tags:["notification-rules"],url:`${yi}/:id`,method:"PUT",params:r.Object({id:u()}),body:bR,response:du}),dke=d({tags:["notification-rules"],url:`${yi}/:id`,method:"DELETE",params:r.Object({id:u()}),response:N}),fke=d({tags:["notification-rules"],url:`${yi}/bulk-delete`,method:"DELETE",body:r.Object({ids:r.Array(u())}),response:r.Object({})}),gke=d({tags:["notification-integrations"],url:`${IR}/start`,method:"POST",response:r.Object({redirectUrl:r.String()})}),iH=["google-chat","grafana-irm","incident-io","jira","microsoft-teams","pagerduty","servicenow","slack","squadcast","webhook"],aH=r.Object({id:r.String(),name:r.String(),type:r.Enum(iH),createdAt:A(),ruleCount:r.Number(),creator:r.Optional(pe)}),hke=d({tags:["notification-integrations"],url:`${Sn}/integrations`,method:"GET",paginated:!0,query:r.Object(ge),response:r.Array(aH)}),yke=d({tags:["notification-integrations"],url:`${IR}/callback`,method:"GET",query:r.Object({code:u()}),response:r.Object({success:r.Boolean()})}),Hd=["POST","PUT"],sH=r.Record(r.String(),r.String()),cH=r.Record(r.String(),r.Unknown()),pH=r.Record(r.String(),r.Union([r.String(),r.Number(),r.Boolean(),r.Null(),r.Array(r.Union([r.String(),r.Number(),r.Boolean()]))])),uH=C("type",[r.Object({type:r.Literal("json"),value:cH}),r.Object({type:r.Literal("form"),value:pH})]),lH=r.Object({ok:r.String(),alert:r.String()}),Kd=r.Object({id:r.String(),name:r.String(),setting:C("type",[r.Object({type:r.Literal("incident-io"),alertSourceConfigId:r.String(),tokenLastChars:r.String()}),r.Object({type:r.Literal("grafana-irm"),urlLastChars:r.String()}),r.Object({type:r.Literal("pagerduty"),integrationKeyLastChars:r.String()}),r.Object({type:r.Literal("microsoft-teams"),webhookUrlLastChars:r.String()}),r.Object({type:r.Literal("webhook"),urlLastChars:r.String(),method:r.Enum(Hd),authentication:C("type",[r.Object({type:r.Literal("bearer"),tokenLastChars:r.String()}),r.Object({type:r.Literal("basic"),username:r.String(),passwordLastChars:r.String()}),r.Object({type:r.Literal("custom-header"),key:r.String(),valueLastChars:r.String()}),r.Object({type:r.Literal("none")})]),customHeaders:r.Optional(sH),payloadTemplate:uH,eventNameMapping:r.Optional(lH)}),r.Object({type:r.Literal("servicenow"),instanceName:r.String(),username:r.String(),passwordLastChars:r.String()}),r.Object({type:r.Literal("google-chat"),webhookUrlLastChars:r.String()}),r.Object({type:r.Literal("squadcast"),webhookUrlLastChars:r.String()}),r.Object({type:r.Literal("jira"),siteUrl:r.String(),email:r.String(),apiTokenLastChars:r.String()})]),tags:De}),mH=r.Object({type:r.Literal("webhook"),url:u({type:"uri"}),method:r.Enum(Hd),authentication:C("type",[r.Object({type:r.Literal("bearer"),token:u({allowEmpty:!1})}),r.Object({type:r.Literal("basic"),username:u({allowEmpty:!1}),password:u({allowEmpty:!1})}),r.Object({type:r.Literal("custom-header"),key:u({allowEmpty:!1}),value:u({allowEmpty:!1})}),r.Object({type:r.Literal("none")})]),customHeaders:r.Record(u({allowEmpty:!1}),u()),payloadTemplate:C("type",[r.Object({type:r.Literal("json"),value:r.Record(u({allowEmpty:!1}),r.Unknown())}),r.Object({type:r.Literal("form"),value:r.Record(u({allowEmpty:!1}),r.Union([r.String(),r.Number(),r.Boolean(),r.Null(),r.Array(r.Union([r.String(),r.Number(),r.Boolean()]))]))})]),eventNameMapping:r.Optional(r.Object({ok:u({allowEmpty:!1}),alert:u({allowEmpty:!1})}))}),SR=r.Object({type:r.Literal("incident-io"),alertSourceConfigId:u(),token:u()}),AR=r.Object({type:r.Literal("grafana-irm"),url:u({type:"uri"})}),OR=r.Object({type:r.Literal("pagerduty"),integrationKey:u()}),xR=r.Object({type:r.Literal("microsoft-teams"),webhookUrl:u({type:"uri"})}),dH=r.Object({type:r.Literal("servicenow"),instanceName:u({allowEmpty:!1,description:'Instance name of the ServiceNow instance. This corresponds to the subdomain part of the instance URL, like "my-instance" in "my-instance.service-now.com"'}),username:u({allowEmpty:!1}),password:u({allowEmpty:!1})}),fH=r.Object({type:r.Literal("google-chat"),webhookUrl:u({type:"uri"})}),gH=r.Object({type:r.Literal("squadcast"),webhookUrl:u({type:"uri"})}),hH=r.Object({type:r.Literal("jira"),siteUrl:u({type:"uri",allowEmpty:!1,description:'Base URL of the Jira Cloud site, like "https://your-company.atlassian.net". Tsuga files issues against this site.'}),email:u({type:"email",allowEmpty:!1,description:"Atlassian account email used together with the API token for Basic authentication."}),apiToken:u({allowEmpty:!1,description:"Atlassian API token minted for the account, used as the Basic auth password."})}),yH=r.Object({name:u(),setting:C("type",[SR,AR,OR,xR,mH,dH,fH,gH,hH]),tags:Xe}),TH=r.Object({type:r.Literal("webhook"),url:r.Optional(u({type:"uri"})),method:r.Optional(r.Enum(Hd)),authentication:r.Optional(C("type",[r.Object({type:r.Literal("bearer"),token:r.Optional(u({allowEmpty:!1}))}),r.Object({type:r.Literal("basic"),username:r.Optional(u({allowEmpty:!1})),password:r.Optional(u({allowEmpty:!1}))}),r.Object({type:r.Literal("custom-header"),key:r.Optional(u({allowEmpty:!1})),value:r.Optional(u({allowEmpty:!1}))}),r.Object({type:r.Literal("none")})])),customHeaders:r.Optional(r.Record(u({allowEmpty:!1}),u())),payloadTemplate:r.Optional(C("type",[r.Object({type:r.Literal("json"),value:r.Record(u({allowEmpty:!1}),r.Unknown())}),r.Object({type:r.Literal("form"),value:r.Record(u({allowEmpty:!1}),r.Union([r.String(),r.Number(),r.Boolean(),r.Null(),r.Array(r.Union([r.String(),r.Number(),r.Boolean()]))]))})])),eventNameMapping:r.Optional(r.Object({ok:r.Optional(u({allowEmpty:!1})),alert:r.Optional(u({allowEmpty:!1}))}))}),EH=r.Object({type:r.Literal("servicenow"),instanceName:r.Optional(u({allowEmpty:!1})),username:r.Optional(u({allowEmpty:!1})),password:r.Optional(u({allowEmpty:!1}))}),_H=r.Object({type:r.Literal("jira"),siteUrl:r.Optional(u({type:"uri",allowEmpty:!1})),email:r.Optional(u({allowEmpty:!1})),apiToken:r.Optional(u({allowEmpty:!1}))}),IH=r.Object({type:r.Literal("google-chat"),webhookUrl:u({type:"uri"})}),bH=r.Object({type:r.Literal("squadcast"),webhookUrl:u({type:"uri"})}),SH=r.Object({name:r.Optional(u()),setting:r.Optional(C("type",[SR,AR,OR,xR,TH,EH,IH,bH,_H]))}),Tke=d({tags:["notification-integrations"],url:is,method:"POST",body:yH,response:Kd}),Eke=d({tags:["notification-integrations"],url:`${is}/:id`,method:"GET",params:r.Object({id:u()}),response:Kd}),_ke=d({tags:["notification-integrations"],url:`${is}/:id`,method:"PUT",params:r.Object({id:u()}),body:SH,response:Kd}),Ike=d({tags:["notification-integrations"],url:`${is}/:id`,method:"DELETE",params:r.Object({id:u()}),response:N}),AH=C("status",[r.Object({status:r.Literal("ok",{description:"Tsuga reached Jira and listed the projects the credentials can file into."}),projects:r.Array(r.Object({key:r.String({description:'Jira project key, like "OPS".'}),name:r.String({description:"Human readable Jira project name."}),issueTypes:r.Array(r.String(),{description:"Issue type names available when creating an issue in this project."}),statuses:r.Optional(r.Array(r.String(),{description:"Status names an issue in this project can be transitioned to. Omitted when Jira refused the status lookup for this project."}))}),{description:"Projects the connected Jira account can file issues into."})},{title:"JiraMetadataOk"}),r.Object({status:r.Literal("error",{description:"Tsuga could not load Jira metadata with the stored credentials."}),message:r.String({description:"Human readable reason the Jira metadata could not be loaded."})},{title:"JiraMetadataError"})],{description:"Result of probing Jira for the projects, issue types and statuses reachable with a stored integration. Returns a typed error instead of failing so the rule editor can fall back to free-text entry."}),bke=d({tags:["notification-integrations"],url:`${is}/:id/jira-metadata`,method:"GET",params:r.Object({id:u()}),response:AH}),Ske=d({tags:["notification-rules"],url:`${At}/:id/notifications`,method:"GET",params:r.Object({id:u()}),query:r.Optional(r.Object({from:r.Optional(r.Number()),to:r.Optional(r.Number())})),response:r.Object({notifications:r.Array(r.Object({id:r.String(),monitorId:r.String(),monitorResultId:r.String(),ruleId:r.Optional(r.String()),targetId:r.Optional(r.String()),status:r.Enum(rH),tryCount:r.Number(),nextTryAt:A(),createdAt:A(),updatedAt:A(),sentAt:r.Optional(A())})),isTruncated:r.Boolean()})}),OH=["slack","incident-io","pagerduty","email","grafana-irm","microsoft-teams","webhook","servicenow","google-chat","squadcast","jira"],Ake=d({tags:["notification-rules"],url:`${Sn}/test`,method:"POST",body:r.Object({notificationRule:ss,targetIds:r.Optional(r.Array(u({allowEmpty:!1}),{description:"Target IDs to test specific targets",minItems:1,maxItems:10}))}),response:r.Union([r.Object({success:r.Literal(!1),overallMessage:r.String({description:"Message when there is an overall error"})}),r.Object({success:r.Boolean(),results:r.Array(r.Object({targetId:r.String({description:"The ID of the target that was tested"}),targetType:r.Enum(OH,{description:"The type of the target (e.g., slack, webhook)"}),status:r.Enum(["success","failure"],{description:"Whether the test notification was sent successfully"}),message:r.Optional(r.String({description:"Message if the notification failed for this specific target"}))}))})])});var Dt="/v0/service-catalog";var xH=r.Object({team:r.String({description:"Team name observed on telemetry for this service."}),lastSeenAt:A({description:"Most recent time this team was observed for the service."})},{description:"A team name observed on telemetry for this service, with the last time it was seen."}),RH=r.Object({ingestionApiKey:r.String({description:"Ingestion API key name or identifier observed on telemetry for this service."}),lastSeenAt:A({description:"Most recent time this ingestion key was observed for the service."})},{description:"An ingestion API key observed on telemetry for this service, with the last time it was seen."}),CH=r.Object({version:r.String({description:"Service version value observed in telemetry."}),firstSeenAt:A({description:"First time this version was observed for the service."}),lastSeenAt:A({description:"Most recent time this version was observed for the service."}),faulty:r.Optional(r.Boolean({description:"Whether Tsuga detected this version as associated with faulty behavior."})),faultyLatency:r.Optional(r.Boolean({description:"Whether the faulty behavior Tsuga detected for this version is a latency degradation. Only set by faulty deployment detection when it reports on latency; absent when the detection did not evaluate latency."})),detectionTriggered:r.Optional(r.Boolean({description:"Whether faulty deployment detection has already been triggered for this version. Set when the detection job is launched to avoid re-triggering it. Absent on versions predating this field."}))},{description:"A service version observed in telemetry, with first and last seen timestamps and faulty deployment detection results."}),PH=r.Object({language:r.String({description:"Programming language observed for this service."}),lastSeenAt:A({description:"Most recent time this language was observed."})},{description:"A programming language observed for this service, with the last time it was seen."}),UH=r.Object({runtime:r.String({description:"Runtime observed for this service."}),lastSeenAt:A({description:"Most recent time this runtime was observed."})},{description:"A runtime observed for this service, with the last time it was seen."}),RR=r.Object({protocol:r.String({description:"Observed API protocol (e.g. 'http', 'grpc', 'graphql')"}),lastSeenAt:A({description:"Most recent observation timestamp"})},{description:"An API protocol observed for this service, with the last time it was seen."}),wH=r.Object({framework:r.String({description:"Observed application framework (e.g. 'express', 'fastify', 'django', 'rails')"}),lastSeenAt:A({description:"Most recent observation timestamp"})},{description:"An application framework detected from OpenTelemetry instrumentation scope, with the last time it was seen."}),vH=r.Object({platform:r.String({description:"Observed cloud or orchestration platform (e.g. 'aws_eks', 'kubernetes')"}),lastSeenAt:A({description:"Most recent observation timestamp"})},{description:"A cloud or orchestration platform this service runs on, with the last time it was seen."}),NH=r.Object({provider:r.String({description:"Observed cloud provider (e.g. 'aws', 'gcp', 'azure')"}),lastSeenAt:A({description:"Most recent observation timestamp"})},{description:"A cloud provider this service runs on, with the last time it was seen."}),Ti=r.Object({id:r.String({description:"Tsuga-generated identifier of this service target, unique across all services. Used with delivery state such as rate limiting and re-notification."}),serviceId:r.String({description:"Identifier of the service catalog entry this target is attached to."}),config:as.properties.config,rateLimit:as.properties.rateLimit,createdAt:A({description:"Timestamp when user created this service target."}),updatedAt:A({description:"Timestamp when user last updated this service target."})}),zd=r.Object({config:gi.properties.config,rateLimit:gi.properties.rateLimit}),Yd=r.Object({config:gi.properties.config,rateLimit:r.Union([Fd,r.Null()],{description:"Per-target rate limit to apply when sending notifications. Set it to `null` to drop the current limit and fall back to the default of 1000 notifications every 10 minutes."})}),cs=r.Object({id:r.String({description:"Unique identifier of this service. Use it with service detail and graph endpoints."}),serviceName:r.String({description:"OpenTelemetry service name observed in telemetry."}),serviceNamespace:r.Optional(r.String({description:"OpenTelemetry service namespace observed in telemetry."})),env:r.Optional(r.String({description:"Environment value observed for this service."})),teams:r.Array(xH,{description:"Team names observed on telemetry for this service and when each was last seen."}),ingestionApiKeys:r.Array(RH,{description:"Ingestion API keys observed on telemetry for this service and when each was last seen."}),versions:r.Array(CH,{description:"Service version values observed in telemetry, including first and last seen timestamps."}),languages:r.Array(PH,{description:"Programming languages observed for this service."}),runtimes:r.Array(UH,{description:"Runtime values observed for this service."}),serverProtocols:r.Array(RR,{description:"API protocols this service exposes (from server-kind spans)"}),clientProtocols:r.Array(RR,{description:"API protocols this service calls out over (from client-kind spans)"}),frameworks:r.Array(wH,{description:"Application frameworks detected from OTel instrumentation scope"}),cloudPlatforms:r.Array(vH,{description:"Cloud platforms this service is running on"}),cloudProviders:r.Array(NH,{description:"Cloud providers this service is running on"}),lastSeenAt:A({description:"Most recent time Tsuga observed telemetry for this service."}),firstSeenAt:A({description:"First time Tsuga observed telemetry for this service."}),sources:r.Array(r.String(),{description:"Telemetry sources that contributed evidence for this service entry."}),additionalUserFields:r.Optional(r.Unsafe({type:"object",additionalProperties:!0,description:"Additional user-defined service metadata, when configured."})),logsCount24h:r.Number({description:"Number of logs observed for this service in the last 24 hours."}),errorLogsCount24h:r.Number({description:"Number of error logs observed for this service in the last 24 hours."}),tracesCount24h:r.Number({description:"Number of traces observed for this service in the last 24 hours."}),errorTracesCount24h:r.Number({description:"Number of error traces observed for this service in the last 24 hours."}),notificationTargets:r.Array(Ti,{description:"Notification targets attached to this service, used by adaptive notification rules to page its owners."}),createdAt:A({description:"Timestamp when Tsuga created this service catalog entry."}),updatedAt:A({description:"Timestamp when Tsuga last updated this service catalog entry."})}),kke=d({tags:["service-catalog"],query:r.Object({...ge,clusterId:r.Optional(u())}),method:"GET",paginated:!0,url:`${Dt}/services`,response:r.Array(cs)}),LH=r.Object({spanKind:r.Enum(Ox),count:r.Number()}),Vd=r.Object({...cs.properties,spanKindCounts:r.Array(LH),envs:r.Object({primaryEnv:r.String(),allEnvs:r.Array(r.String())})}),Mke=d({tags:["service-catalog"],query:r.Object({...ge,clusterId:r.Optional(u()),env:r.Optional(u())}),method:"GET",paginated:!0,url:`${Dt}/v2/services`,response:r.Array(Vd)}),kH=["serviceName","envs","lastDeploy","traceErrorRate","traceRequestRate","logErrorRate","logRequestRate","teams","api","frameworks","languages","pagingDestination"],MH=r.Object({searchQuery:r.Object({value:u({allowEmpty:!1,description:"Substring matched case-insensitively against service names."})},{description:"Text filter for service names."}),teams:_e(u({allowEmpty:!1}),{description:"Restrict results to services observed under any of these team names",maxItems:50}),envs:_e(u({allowEmpty:!1}),{description:"Restrict results to services observed in any of these environments",maxItems:50}),versions:_e(u({allowEmpty:!1}),{description:"Restrict results to services whose latest observed version is one of these",maxItems:50}),languages:_e(u({allowEmpty:!1}),{description:"Restrict results to services written in any of these languages",maxItems:50}),hasRecentData:r.Boolean({description:"When true, only return services that received logs or traces in the last 24 hours"})}),DH=r.Partial(r.Object({...ge,clusterId:u(),filters:r.Partial(MH,{description:"Optional filters applied to narrow the returned services"}),sort:r.Object({by:r.Enum(kH,{description:"Field to sort the returned services by"}),direction:r.Enum(["asc","desc"],{description:"Sort direction: ascending or descending"})},{description:"Optional sorting applied to the returned services"})})),Dke=d({tags:["service-catalog"],url:`${Dt}/v2/services/query`,method:"POST",paginated:!0,body:DH,response:r.Array(Vd)}),Gke=d({tags:["service-catalog"],query:r.Object({serviceName:u({allowEmpty:!1}),serviceNamespace:r.Optional(u({allowEmpty:!1})),env:u({allowEmpty:!1}),clusterId:r.Optional(u())}),method:"GET",url:`${Dt}/v2/service`,response:Vd}),$ke=d({tags:["service-catalog"],method:"GET",url:`${Dt}/services/:serviceId`,params:r.Object({serviceId:u()}),response:cs}),jke=d({tags:["service-catalog"],method:"GET",url:`${Dt}/services/:serviceId/targets`,params:r.Object({serviceId:u()}),response:r.Array(Ti)}),Fke=d({tags:["service-catalog"],method:"POST",url:`${Dt}/services/:serviceId/targets`,params:r.Object({serviceId:u()}),body:zd,response:Ti}),qke=d({tags:["service-catalog"],method:"PUT",url:`${Dt}/services/:serviceId/targets/:targetId`,params:r.Object({serviceId:u(),targetId:u()}),body:Yd,response:Ti}),Bke=d({tags:["service-catalog"],method:"DELETE",url:`${Dt}/services/:serviceId/targets/:targetId`,params:r.Object({serviceId:u(),targetId:u()}),response:N}),GH=["otel_kube","otel_host_kube","otel_host","prometheus","aws_ec2","gcp_compute_engine"];var CR=r.Object({id:r.String(),hostName:r.String(),env:r.Optional(r.String()),cpuUtilizationAverage:r.Number(),hostType:r.Enum(GH),teams:r.Array(r.String()),tags:r.Array(r.String()),firstSeenAt:A(),lastSeenAt:A(),clusterId:r.String()}),Hke=d({tags:["service-catalog"],method:"GET",url:`${Dt}/hosts`,response:r.Array(CR)}),Kke=d({tags:["service-catalog"],method:"GET",url:`${Dt}/hosts/:hostId`,params:r.Object({hostId:u()}),response:CR}),$H=["http","rpc","messaging","genai","object_store"],PR={name:r.String({description:"Service or inferred dependency name shown in the graph."}),env:r.Optional(r.String({description:"Environment observed from spans."}))},Qd=r.Object({...PR,nodeType:r.Literal("observed",{description:"Discriminator for this node variant. Always `observed` for a graph node matched to a service catalog entry by name and env."}),id:r.Union([r.String(),r.Null()],{description:"Service ID, or null when multiple namespaces match the observed service name."}),namespace:r.Union([r.String(),r.Null()],{description:"Service namespace, or null when multiple namespaces match the observed service name."}),errorRate:r.Optional(r.Number({description:"Ratio of entry requests with at least one error to total entry requests observed on this service. Omitted when no entry requests were observed."})),entryErrorRequestCount:r.Number({description:"Number of entry requests on this service where at least one entry span had error status."}),entryRequestCount:r.Number({description:"Number of entry requests observed on this service, counted as unique trace IDs that have at least one entry span on this service. An entry span is a consumer-kind span, a root span (no parent), or any span whose parent belongs to a different service."})}),UR={...PR,endpoint:r.Optional(r.String({description:"Inferred service endpoint address"})),resourceName:r.Optional(r.String({description:"Inferred resource name, e.g. table or queue name"}))},Wd=r.Object({...UR,nodeType:r.Literal("inferred_db",{description:"Discriminator for this node variant. Always `inferred_db` for a database dependency detected from client-span attributes that could not be matched to a service catalog entry."}),serviceType:r.Literal("db",{description:"Inferred dependency type. Always `db` for this node variant."}),databaseName:r.Optional(r.String({description:"Database name from span_attributes db.namespace (falling back to legacy db.name). Matches the database catalog `name`."})),databaseSystem:r.String({description:"Database system from span_attributes db.system.name (falling back to legacy db.system). Matches the database catalog `databaseSystem`."})}),Zd=r.Object({...UR,nodeType:r.Literal("inferred",{description:"Discriminator for this node variant. Always `inferred` for a non-database dependency detected from client-span attributes (e.g. a queue or external HTTP call) that could not be matched to a service catalog entry. Database dependencies use the `inferred_db` variant."}),serviceType:r.Enum($H,{description:"Inferred dependency type from span metadata: http, rpc, messaging, genai, or object_store."})}),jH=C("nodeType",[Qd,Wd,Zd]),Xd=r.Object({from:r.Object({env:r.Optional(r.String({description:"Environment of the source node"})),name:r.String({description:"Name of the source node"})},{description:"Reference to the caller node, i.e. the service or dependency that issued the request."}),to:r.Object({env:r.Optional(r.String({description:"Environment of the target node"})),name:r.String({description:"Name of the target node"}),databaseSystem:r.Optional(r.String({description:"Database system of the target when it is an inferred database node (`inferred_db`). Together with `name` and `env` it identifies the target node, distinguishing a database from a same-named service or a same-named database on another system."}))},{description:"Reference to the callee node, i.e. the service or dependency that received the request."}),count:r.Number({description:"Number of cross-service transitions observed on this directed edge in the graph query window."}),errorRate:r.Optional(r.Number({description:"Ratio of errored client spans to total client spans observed on this edge. Omitted when no client spans were observed. For edges to inferred services, the originating span is treated as the client span regardless of its kind."})),errorCount:r.Number({description:"Number of client spans with error status observed on this edge"}),clientSpanCount:r.Number({description:"Number of client spans observed on this edge"})},{description:"Directed dependency edge from a caller node (`from`) to a callee node (`to`) in the service graph, with call-volume and error counts observed over the query window."}),zke=d({tags:["service-catalog"],url:`${Dt}/services/:serviceId/graph`,method:"GET",params:r.Object({serviceId:u()}),query:r.Object({...at.properties,query:r.Optional(u({type:"tsuga-query"}))}),response:r.Object({clusterId:r.String(),nodes:r.Array(jH),edges:r.Array(Xd)})}),FH=r.Object({monitors:r.Array(r.Object({id:r.String({description:"Identifier of the monitor"}),name:r.String({description:"Display name of the monitor"}),owner:r.String({description:"Team ID that owns the monitor"}),priority:r.Enum(St,{description:"Priority of the monitor"})})),slos:r.Array(r.Object({id:r.String({description:"Identifier of the SLO"}),name:r.String({description:"Display name of the SLO"}),owner:r.String({description:"Team ID that owns the SLO"}),statusCount:r.Partial(r.Record(lu,r.Number()),{description:"Count of SLO statuses for this service: one entry per group matching the service when the SLO groups by service.name, otherwise the overall status"})}))}),Yke=d({tags:["service-catalog"],method:"GET",url:`${Dt}/services/:serviceId/related-resources`,params:r.Object({serviceId:u()}),response:FH}),Vke=d({tags:["service-catalog"],method:"GET",url:`${Dt}/services/by-api-keys`,response:r.Record(r.String(),r.Array(r.Object({serviceName:r.String(),serviceNamespace:r.Optional(r.String())})))});var fu=`/${"v1"}/services`,Jd=r.Pick(cs,["id","serviceName","serviceNamespace","env","teams","versions","languages","runtimes","serverProtocols","clientProtocols","frameworks","cloudPlatforms","cloudProviders","lastSeenAt","firstSeenAt","sources","logsCount24h","errorLogsCount24h","tracesCount24h","errorTracesCount24h"],{$id:"Service",description:"Service inferred from telemetry, with observed metadata, activity counts, and version signals. See [Services](/documentation/categorize/services/index)."}),qH={id:"123-456-abc",serviceName:"api-gateway",serviceNamespace:"platform",env:"production",teams:[{team:"platform",lastSeenAt:"2024-01-15T12:34:56.000Z"}],versions:[{version:"1.2.3",firstSeenAt:"2024-01-01T08:00:00.000Z",lastSeenAt:"2024-01-15T12:34:56.000Z",faulty:!0,faultyLatency:!0}],languages:[{language:"go",lastSeenAt:"2024-01-15T12:34:56.000Z"}],runtimes:[{runtime:"go",lastSeenAt:"2024-01-15T12:34:56.000Z"}],serverProtocols:[{protocol:"http",lastSeenAt:"2024-01-15T12:34:56.000Z"}],clientProtocols:[{protocol:"grpc",lastSeenAt:"2024-01-15T12:34:56.000Z"}],frameworks:[{framework:"gin",lastSeenAt:"2024-01-15T12:34:56.000Z"}],cloudPlatforms:[{platform:"aws_eks",lastSeenAt:"2024-01-15T12:34:56.000Z"},{platform:"kubernetes",lastSeenAt:"2024-01-15T12:34:56.000Z"}],cloudProviders:[{provider:"aws",lastSeenAt:"2024-01-15T12:34:56.000Z"}],lastSeenAt:"2024-01-15T12:34:56.000Z",firstSeenAt:"2024-01-01T08:00:00.000Z",sources:["logs","metrics","traces"],logsCount24h:12e3,errorLogsCount24h:42,tracesCount24h:8500,errorTracesCount24h:17};Object.assign(Jd,{examples:[qH]});var wR=d({description:"Lists services inferred from telemetry. Use this endpoint to inventory service ownership, environments, versions, runtimes, and recent activity. Pagination fields limit the returned page.",operationId:"listServices",tags:["services"],url:fu,method:"GET",paginated:!0,query:r.Object({...Ze,clusterId:r.Optional(u({allowEmpty:!1,description:"Telemetry cluster to target. Omit to use the first cluster in the organization; this does not query all clusters."}))},{description:"Service list query. Use pagination and optional cluster scope."}),response:r.Array(Jd)}),vR=d({description:"Retrieves one telemetry-inferred service by service ID.",operationId:"getService",tags:["services"],url:`${fu}/:serviceId`,method:"GET",params:r.Object({serviceId:u({allowEmpty:!1,description:"Identifier of the service to retrieve. Use the `id` returned by service list responses."})}),response:Jd}),BH=r.Pick(Qd,["name","env","nodeType","id","namespace","errorRate","entryErrorRequestCount","entryRequestCount"],{$id:"ObservedServiceGraphNode",description:"Service graph node matched to a service catalog entry by name and env. `id`/`namespace` are null when multiple namespaces share the observed service name."}),HH=r.Pick(Zd,["name","env","nodeType","serviceType","endpoint","resourceName"],{$id:"InferredServiceGraphNode",description:"Dependency node detected from client-span attributes (e.g. a queue or external HTTP call) that could not be matched to a service catalog entry. Database dependencies use the `inferred_db` variant."}),KH=r.Pick(Wd,["name","env","nodeType","serviceType","endpoint","resourceName"],{$id:"InferredDbServiceGraphNode",description:"Database dependency node detected from client-span attributes that could not be matched to a service catalog entry."}),zH=C("nodeType",[BH,KH,HH]),YH=r.Pick(Xd,["from","to","count","errorRate","errorCount","clientSpanCount"],{$id:"ServiceGraphEdge",description:"Directed dependency edge from a caller node (`from`) to a callee node (`to`), with call-volume and error counts observed over the query window."}),VH=r.Optional(r.Integer({...at.properties.from,description:"Start of the service graph query window as a Unix timestamp in seconds. Provide both `from` and `to` for a deterministic graph window; otherwise Tsuga uses backend graph defaults."})),QH=r.Optional(r.Integer({...at.properties.to,description:"End of the service graph query window as a Unix timestamp in seconds. Provide both `from` and `to` for a deterministic graph window; otherwise Tsuga uses backend graph defaults."})),WH=u({type:"tsuga-query",default:"*",description:"Tsuga query used to filter spans considered for the graph. Defaults to `*`, which applies no additional filter beyond the service identity."}),NR=d({description:"Retrieves a dependency graph for one service over an optional time range and query filter. Provide an explicit time range for deterministic results. Use this to inspect observed downstream and upstream service relationships. See [Service page](/documentation/categorize/services/service-page).",operationId:"getServiceGraph",tags:["services"],url:`${fu}/:serviceId/graph`,method:"GET",params:r.Object({serviceId:u({allowEmpty:!1,description:"Identifier of the service to use as the graph root. Use the `id` returned by service list or get responses."})}),query:r.Object({from:VH,to:QH,query:r.Optional(WH)},{description:"Service graph query. Use time range and optional span query filters."}),response:r.Object({clusterId:r.String({description:"Cluster ID the graph was built from"}),nodes:r.Array(zH,{description:"Observed and inferred nodes included in the service dependency graph."}),edges:r.Array(YH,{description:"Directed dependency edges between graph nodes."})})}),gu=`${fu}/:serviceId/notification-targets`,hu=r.Pick(Ti,["id","serviceId","config","rateLimit"],{$id:"ServiceNotificationTarget",description:"Notification target attached to a service, used by adaptive notification rules to page the service owners. See [Rules](/documentation/alert/notifications/rules)."}),ef={rateLimit:{maxMessages:10,minutes:5},config:{type:"email",addresses:["oncall@example.com"],renotifyConfig:{mode:"each",renotificationStates:["alert"],renotifyIntervalMinutes:30}}},ZH={id:"789-abc-def",serviceId:"123-456-abc",...ef};Object.assign(hu,{examples:[ZH]});var yu=u({allowEmpty:!1,description:"Identifier of the service the notification target belongs to. Use the `id` returned by service list or get responses."}),nMe=d({description:"Lists the notification targets attached to one service. Use this to discover target IDs before updating or deleting a target.",operationId:"listServiceNotificationTargets",tags:["services"],url:gu,method:"GET",params:r.Object({serviceId:yu}),response:r.Array(hu)}),XH=r.Pick(zd,["config","rateLimit"],{description:"Service notification target create request. Provide the delivery destination and an optional per-target rate limit.",examples:[ef]}),JH=r.Pick(Yd,["config","rateLimit"],{description:"Service notification target update request. The submitted destination and rate limit overwrite the stored ones.",examples:[ef]}),oMe=d({description:"Attaches a notification target to a service. Adaptive notification rules matching the service page this target on alert transitions.",operationId:"createServiceNotificationTarget",tags:["services"],url:gu,method:"POST",params:r.Object({serviceId:yu}),body:XH,response:hu}),iMe=d({description:"Updates one notification target attached to a service.",operationId:"updateServiceNotificationTarget",tags:["services"],url:`${gu}/:targetId`,method:"PUT",params:r.Object({serviceId:yu,targetId:u({allowEmpty:!1,description:"Identifier of the notification target to update. Use the `id` returned by service notification target list or create responses."})}),body:JH,response:hu}),aMe=d({description:"Detaches a notification target from a service. Notification rules stop paging this destination for the service.",operationId:"deleteServiceNotificationTarget",tags:["services"],url:`${gu}/:targetId`,method:"DELETE",params:r.Object({serviceId:yu,targetId:u({allowEmpty:!1,description:"Identifier of the notification target to delete. Use the `id` returned by service notification target list or create responses."})}),response:N});var Ge=" (unix seconds, ISO 8601, or relative like -1h/-30m/now)";function LR(e,t){let n=t??$r(e);return n===void 0?void 0:Ic(n)}function tf(e){let t=$r(e);return t===void 0?"":` (default: ${t})`}function kR(e,t){e.command("service-graph").description("Inspect service dependency graphs").command("get <SERVICE_ID>").description("Retrieve the dependency graph for a service").option("--from <TIMESTAMP>",`Start of time range${Ge}${tf("from")}`).option("--to <TIMESTAMP>",`End of time range${Ge}${tf("to")}`).option("--query <TSUGA_QUERY>",`Tsuga query to filter graph spans${tf("query")}`).action(async(o,i)=>{let a={},c=LR("from",i.from),l=LR("to",i.to);c!==void 0&&(a.from=c),l!==void 0&&(a.to=l),i.query!==void 0&&(a.query=i.query);let m=await t()(NR,{params:{serviceId:o},query:a});ee(m)})}var e2=`/${"v1"}/grok`,t2=25,r2=100,MR=r.Object({rules:r.Array(u({allowEmpty:!1,type:"long",description:"Grok parsing rule to preview against each sample. The rule uses the same Grok syntax as the log route **Grok parser** processor, for example `pod:%{DATA:namespace}/%{DATA:name}`."}),{minItems:1,maxItems:t2,description:"Ordered Grok parsing rules to preview. For each sample, Tsuga tries the rules in order and returns the first successful match, matching route Grok processor semantics."}),samples:r.Array(u({allowEmpty:!1,type:"long",description:"Raw log line to parse with the provided Grok rules. The value is parsed as preview input only; this endpoint does not ingest or store the sample."}),{minItems:1,maxItems:r2,description:"Sample log lines to run against the rules. Results are returned in the same order as this array."})},{description:"Grok rules and sample log lines to preview extraction before saving a route processor. The endpoint uses the same parser as the route builder preview and does not create or update routes."}),n2={rules:['pod:%{DATA:pod_namespace}/%{DATA:pod_name}\\] "%{DATA:request}" HTTP/%{POSINT:status}'],samples:['[conn-id:abc pod:tsuga-events/tsuga-events-searcher-0] "/token" HTTP/200']};Object.assign(MR,{examples:[n2]});var DR=r.Object({results:r.Array(r.Object({sample:r.String({description:"Echo of the submitted log line, so results can be matched to the samples in the request."}),matched:r.Boolean({description:"Whether any submitted rule matched this sample. `true` means `extracted` contains the captured fields; `false` means no rule matched."}),extracted:r.Union([r.Record(r.String(),r.Unknown()),r.Null()],{description:"Fields extracted from the first matching Grok rule when `matched` is `true`; dotted capture names are expanded into nested objects. `null` when no rule matched."})}),{description:"Preview result for each submitted sample, in the same order as the request `samples` array."})},{description:"Grok extraction preview results from applying the ordered rules to each submitted sample."}),o2={results:[{sample:'[conn-id:abc pod:tsuga-events/tsuga-events-searcher-0] "/token" HTTP/200',matched:!0,extracted:{pod_namespace:"tsuga-events",pod_name:"tsuga-events-searcher-0",request:"/token",status:"200"}}]};Object.assign(DR,{examples:[o2]});var GR=d({url:`${e2}/parse`,method:"POST",operationId:"parseGrok",tags:["public","grok"],body:MR,response:DR,description:"Parses sample log lines with Grok rules and returns extracted fields, using the same Grok engine as the log route processor. Use this endpoint to author and test route Grok rules before saving them. The operation requires public API read access to log routes. A rule that fails to compile returns a 400 response with error code `GROK_RULE_VALIDATION_ERROR` and structured details in `error.details.ruleErrors`."});var $R=rn(require("node:fs"));function Ei(e){if(e.file){let t=$R.default.readFileSync(e.file==="-"?0:e.file,"utf-8");return JSON.parse(t)}if(e.data)return JSON.parse(e.data);throw new Error("Provide a request body with -f <FILE_PATH> or -d <JSON>. Use --generate-skeleton to get a template.")}function rf(e){return s.HasPropertyKey(e,"~refine")&&s.IsArray(e["~refine"])&&s.Every(e["~refine"],0,t=>s.IsObject(t)&&s.HasPropertyKey(t,"check")&&s.HasPropertyKey(t,"error")&&s.IsFunction(t.check)&&s.IsFunction(t.error))}function ir(e){return s.IsObject(e)&&!s.IsArray(e)}function Tu(e){return s.IsBoolean(e)}function F(e){return ir(e)||Tu(e)}function nf(e){return s.HasPropertyKey(e,"additionalItems")&&F(e.additionalItems)}function Hr(e){return s.HasPropertyKey(e,"additionalProperties")&&F(e.additionalProperties)}function of(e){return s.HasPropertyKey(e,"allOf")&&s.IsArray(e.allOf)&&e.allOf.every(t=>F(t))}function ps(e){return s.HasPropertyKey(e,"$anchor")&&s.IsString(e.$anchor)}function af(e){return s.HasPropertyKey(e,"anyOf")&&s.IsArray(e.anyOf)&&e.anyOf.every(t=>F(t))}function sf(e){return s.HasPropertyKey(e,"const")}function lo(e){return s.HasPropertyKey(e,"contains")&&F(e.contains)}function Ht(e){return s.HasPropertyKey(e,"default")}function cf(e){return s.HasPropertyKey(e,"dependencies")&&s.IsObject(e.dependencies)&&Object.values(e.dependencies).every(t=>F(t)||s.IsArray(t)&&t.every(n=>s.IsString(n)))}function pf(e){return s.HasPropertyKey(e,"dependentRequired")&&s.IsObject(e.dependentRequired)&&Object.values(e.dependentRequired).every(t=>s.IsArray(t)&&t.every(n=>s.IsString(n)))}function uf(e){return s.HasPropertyKey(e,"dependentSchemas")&&s.IsObject(e.dependentSchemas)&&Object.values(e.dependentSchemas).every(t=>F(t))}function An(e){return s.HasPropertyKey(e,"$dynamicAnchor")&&s.IsString(e.$dynamicAnchor)}function lf(e){return s.HasPropertyKey(e,"$dynamicRef")&&s.IsString(e.$dynamicRef)}function mf(e){return s.HasPropertyKey(e,"else")&&F(e.else)}function df(e){return s.HasPropertyKey(e,"enum")&&s.IsArray(e.enum)}function ff(e){return s.HasPropertyKey(e,"exclusiveMaximum")&&(s.IsNumber(e.exclusiveMaximum)||s.IsBigInt(e.exclusiveMaximum))}function Kr(e){return s.HasPropertyKey(e,"exclusiveMinimum")&&(s.IsNumber(e.exclusiveMinimum)||s.IsBigInt(e.exclusiveMinimum))}function us(e){return s.HasPropertyKey(e,"format")&&s.IsString(e.format)}function zr(e){return s.HasPropertyKey(e,"$id")&&s.IsString(e.$id)}function gf(e){return s.HasPropertyKey(e,"if")&&F(e.if)}function _i(e){return s.HasPropertyKey(e,"items")&&(F(e.items)||s.IsArray(e.items)&&e.items.every(t=>F(t)))}function hf(e){return _i(e)&&s.IsArray(e.items)}function yf(e){return s.HasPropertyKey(e,"maximum")&&(s.IsNumber(e.maximum)||s.IsBigInt(e.maximum))}function Tf(e){return s.HasPropertyKey(e,"maxContains")&&s.IsNumber(e.maxContains)}function Eu(e){return s.HasPropertyKey(e,"maxItems")&&s.IsNumber(e.maxItems)}function Ef(e){return s.HasPropertyKey(e,"maxLength")&&s.IsNumber(e.maxLength)}function _f(e){return s.HasPropertyKey(e,"maxProperties")&&s.IsNumber(e.maxProperties)}function Yr(e){return s.HasPropertyKey(e,"minimum")&&(s.IsNumber(e.minimum)||s.IsBigInt(e.minimum))}function mo(e){return s.HasPropertyKey(e,"minContains")&&s.IsNumber(e.minContains)}function Ii(e){return s.HasPropertyKey(e,"minItems")&&s.IsNumber(e.minItems)}function ls(e){return s.HasPropertyKey(e,"minLength")&&s.IsNumber(e.minLength)}function ms(e){return s.HasPropertyKey(e,"minProperties")&&s.IsNumber(e.minProperties)}function If(e){return s.HasPropertyKey(e,"multipleOf")&&(s.IsNumber(e.multipleOf)||s.IsBigInt(e.multipleOf))}function bf(e){return s.HasPropertyKey(e,"not")&&F(e.not)}function Sf(e){return s.HasPropertyKey(e,"oneOf")&&s.IsArray(e.oneOf)&&e.oneOf.every(t=>F(t))}function ds(e){return s.HasPropertyKey(e,"pattern")&&(s.IsString(e.pattern)||e.pattern instanceof RegExp)}function fs(e){return s.HasPropertyKey(e,"patternProperties")&&s.IsObject(e.patternProperties)&&Object.values(e.patternProperties).every(t=>F(t))}function bi(e){return s.HasPropertyKey(e,"prefixItems")&&s.IsArray(e.prefixItems)&&e.prefixItems.every(t=>F(t))}function gs(e){return s.HasPropertyKey(e,"properties")&&s.IsObject(e.properties)&&Object.values(e.properties).every(t=>F(t))}function Af(e){return s.HasPropertyKey(e,"propertyNames")&&(s.IsObject(e.propertyNames)||F(e.propertyNames))}function i2(e){return s.HasPropertyKey(e,"$recursiveAnchor")&&s.IsBoolean(e.$recursiveAnchor)}function _u(e){return i2(e)&&s.IsEqual(e.$recursiveAnchor,!0)}function Of(e){return s.HasPropertyKey(e,"$recursiveRef")&&s.IsString(e.$recursiveRef)}function xf(e){return s.HasPropertyKey(e,"$ref")&&s.IsString(e.$ref)}function fo(e){return s.HasPropertyKey(e,"required")&&s.IsArray(e.required)&&e.required.every(t=>s.IsString(t))}function Rf(e){return s.HasPropertyKey(e,"then")&&F(e.then)}function Cf(e){return s.HasPropertyKey(e,"type")&&(s.IsString(e.type)||s.IsArray(e.type)&&e.type.every(t=>s.IsString(t)))}function Si(e){return s.HasPropertyKey(e,"uniqueItems")&&s.IsBoolean(e.uniqueItems)}function Iu(e){return s.HasPropertyKey(e,"unevaluatedItems")&&F(e.unevaluatedItems)}function bu(e){return s.HasPropertyKey(e,"unevaluatedProperties")&&F(e.unevaluatedProperties)}var xt=class{constructor(){let t=new Set,n=new Set;this.stack=[{indices:t,keys:n}]}Push(){let t=new Set,n=new Set;return this.stack.push({indices:t,keys:n}),!0}Pop(){return this.stack.pop(),!0}AddIndex(t){return this.GetIndices().add(t),!0}AddKey(t){return this.GetKeys().add(t),!0}GetIndices(){return this.stack[this.stack.length-1].indices}GetKeys(){return this.stack[this.stack.length-1].keys}Merge(t){for(let n of t)n.GetIndices().forEach(o=>this.GetIndices().add(o)),n.GetKeys().forEach(o=>this.GetKeys().add(o));return!0}},hs=class extends xt{constructor(t){super(),this.callback=t}AddError(t){return this.callback(t),!1}},st=class extends hs{constructor(){super(t=>this.errors.push(t)),this.errors=[]}AddError(t){return this.errors.push(t),!1}GetErrors(){return this.errors}};function jR(e,t,n,o){return s.Every(n["~refine"],0,(i,a)=>i.check(o))}function FR(e,t,n,o,i,a){return s.EveryAll(i["~refine"],0,(c,l)=>c.check(a)||t.AddError({keyword:"~refine",schemaPath:n,instancePath:o,params:{index:l,message:c.error(a)}}))}function qR(e){return _i(e)&&s.IsArray(e.items)}function BR(e,t,n,o){return qR(n)?s.Every(o,0,(a,c)=>s.IsLessThan(c,n.items.length)||Kt(e,t,n.additionalItems,a)&&t.AddIndex(c)):!0}function HR(e,t,n,o,i,a){return qR(i)?s.Every(a,0,(l,m)=>{let f=`${n}/additionalItems`,h=`${o}/${m}`;return s.IsLessThan(m,i.items.length)||zt(e,t,f,h,i.additionalItems,l)&&t.AddIndex(m)}):!0}function a2(e){return`^${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}$`}function KR(e){let t=[];return fs(e)&&t.push(...s.Keys(e.patternProperties)),gs(e)&&t.push(...s.Keys(e.properties).map(a2)),s.IsEqual(t.length,0)?"(?!)":`(${t.join("|")})`}function zR(e,t,n,o){let i=new RegExp(KR(n));return s.Every(s.Keys(o),0,(c,l)=>i.test(c)||Kt(e,t,n.additionalProperties,o[c])&&t.AddKey(c))}function YR(e,t,n,o,i,a){let c=new RegExp(KR(i)),l=[];return s.EveryAll(s.Keys(a),0,(f,h)=>{let E=`${n}/additionalProperties`,I=`${o}/${f}`,g=new st,T=c.test(f)||zt(e,g,E,I,i.additionalProperties,a[f])&&t.AddKey(f);return T||l.push(f),T})||t.AddError({keyword:"additionalProperties",schemaPath:n,instancePath:o,params:{additionalProperties:l}})}function VR(e,t,n,o){let i=n.allOf.reduce((a,c)=>{let l=new xt;return ne(e,l,c,o)?[...a,l]:a},[]);return s.IsEqual(i.length,n.allOf.length)&&t.Merge(i)}function QR(e,t,n,o,i,a){let c=[],l=i.allOf.reduce((f,h,E)=>{let I=`${n}/allOf/${E}`,g=new st,T=Ie(e,g,I,o,h,a);return T||c.push(g),T?[...f,g]:f},[]),m=s.IsEqual(l.length,i.allOf.length)&&t.Merge(l);return m||c.forEach(f=>f.GetErrors().forEach(h=>t.AddError(h))),m}function WR(e,t,n,o){let i=n.anyOf.reduce((a,c)=>{let l=new xt;return ne(e,l,c,o)?[...a,l]:a},[]);return s.IsGreaterThan(i.length,0)&&t.Merge(i)}function ZR(e,t,n,o,i,a){let c=[],l=i.anyOf.reduce((f,h,E)=>{let I=new st,g=`${n}/anyOf/${E}`,T=Ie(e,I,g,o,h,a);return T||c.push(I),T?[...f,I]:f},[]),m=s.IsGreaterThan(l.length,0)&&t.Merge(l);return m||c.forEach(f=>f.GetErrors().forEach(h=>t.AddError(h))),m||t.AddError({keyword:"anyOf",schemaPath:n,instancePath:o,params:{}})}function Uf(e,t,n,o){return n}function XR(e,t,n,o,i,a){return Uf(e,t,i,a)||t.AddError({keyword:"boolean",schemaPath:n,instancePath:o,params:{}})}function wf(e,t,n,o){return s.IsValueLike(n.const)?s.IsEqual(o,n.const):s.IsDeepEqual(o,n.const)}function JR(e,t,n,o,i,a){return wf(e,t,i,a)||t.AddError({keyword:"const",schemaPath:n,instancePath:o,params:{allowedValue:i.const}})}function s2(e){return!(mo(e)&&s.IsEqual(e.minContains,0))}function vf(e,t,n,o){return s2(n)?!s.IsEqual(o.length,0)&&s.SomeAll(o,(i,a)=>ne(e,t,n.contains,i)&&t.AddIndex(a)):!0}function eC(e,t,n,o,i,a){return vf(e,t,i,a)||t.AddError({keyword:"contains",schemaPath:n,instancePath:o,params:{minContains:1}})}function tC(e,t,n,o){let i=s.IsEqual(s.Keys(o).length,0),a=s.Every(s.Entries(n.dependencies),0,([c,l])=>!s.HasPropertyKey(o,c)||(s.IsArray(l)?l.every(m=>s.HasPropertyKey(o,m)):ne(e,t,l,o)));return i||a}function rC(e,t,n,o,i,a){let c=s.IsEqual(s.Keys(a).length,0),l=s.EveryAll(s.Entries(i.dependencies),0,([m,f])=>{let h=`${n}/dependencies/${m}`;return!s.HasPropertyKey(a,m)||(s.IsArray(f)?f.every(E=>s.HasPropertyKey(a,E)||t.AddError({keyword:"dependencies",schemaPath:n,instancePath:o,params:{property:m,dependencies:f}})):Ie(e,t,h,o,f,a))});return c||l}function nC(e,t,n,o){let i=s.IsEqual(s.Keys(o).length,0),a=s.Every(s.Entries(n.dependentRequired),0,([c,l])=>!s.HasPropertyKey(o,c)||l.every(m=>s.HasPropertyKey(o,m)));return i||a}function oC(e,t,n,o,i,a){let c=s.IsEqual(s.Keys(a).length,0),l=s.EveryAll(s.Entries(i.dependentRequired),0,([m,f])=>!s.HasPropertyKey(a,m)||s.EveryAll(f,0,h=>s.HasPropertyKey(a,h)||t.AddError({keyword:"dependentRequired",schemaPath:n,instancePath:o,params:{property:m,dependencies:f}})));return c||l}function iC(e,t,n,o){let i=s.IsEqual(s.Keys(o).length,0),a=s.Every(s.Entries(n.dependentSchemas),0,([c,l])=>!s.HasPropertyKey(o,c)||ne(e,t,l,o));return i||a}function aC(e,t,n,o,i,a){let c=s.IsEqual(s.Keys(a).length,0),l=s.EveryAll(s.Entries(i.dependentSchemas),0,([m,f])=>{let h=`${n}/dependentSchemas/${m}`;return!s.HasPropertyKey(a,m)||Ie(e,t,h,o,f,a)});return c||l}function sC(e,t,n,o){let i=e.DynamicRef(n)??!1;return F(i)&&ne(e,t,i,o)}function cC(e,t,n,o,i,a){let c=e.DynamicRef(i)??!1;return F(c)&&Ie(e,t,"#",o,c,a)}function kf(e,t,n,o){return s.Some(n.enum,i=>s.IsValueLike(i)?s.IsEqual(o,i):s.IsDeepEqual(o,i))}function pC(e,t,n,o,i,a){return kf(e,t,i,a)||t.AddError({keyword:"enum",schemaPath:n,instancePath:o,params:{allowedValues:i.enum}})}function Mf(e,t,n,o){return s.IsLessThan(o,n.exclusiveMaximum)}function uC(e,t,n,o,i,a){return Mf(e,t,i,a)||t.AddError({keyword:"exclusiveMaximum",schemaPath:n,instancePath:o,params:{comparison:"<",limit:i.exclusiveMaximum}})}function Df(e,t,n,o){return s.IsGreaterThan(o,n.exclusiveMinimum)}function lC(e,t,n,o,i,a){return Df(e,t,i,a)||t.AddError({keyword:"exclusiveMinimum",schemaPath:n,instancePath:o,params:{comparison:">",limit:i.exclusiveMinimum}})}var Ri={};Yt(Ri,{Clear:()=>bC,Entries:()=>z2,Get:()=>Q2,Has:()=>V2,IsDate:()=>Oi,IsDateTime:()=>Su,IsDuration:()=>Au,IsEmail:()=>Ou,IsHostname:()=>Ru,IsIPv4:()=>Uu,IsIPv6:()=>wu,IsIdnEmail:()=>Cu,IsIdnHostname:()=>Pu,IsIri:()=>Nu,IsIriReference:()=>vu,IsJsonPointer:()=>ku,IsJsonPointerUriFragment:()=>Lu,IsRegex:()=>Mu,IsRelativeJsonPointer:()=>Du,IsTime:()=>xi,IsUri:()=>Fu,IsUriReference:()=>Gu,IsUriTemplate:()=>$u,IsUrl:()=>qu,IsUuid:()=>Bu,Reset:()=>SC,Set:()=>Y2,Test:()=>W2});var c2=[0,31,28,31,30,31,30,31,31,30,31,30,31],p2=/^(\d\d\d\d)-(\d\d)-(\d\d)$/;function u2(e){return e%4===0&&(e%100!==0||e%400===0)}function Oi(e){let t=p2.exec(e);if(!t)return!1;let n=+t[1],o=+t[2],i=+t[3];return o>=1&&o<=12&&i>=1&&i<=(o===2&&u2(n)?29:c2[o])}var l2=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(?:Z|([+-])(\d\d):(\d\d))?$/i;function xi(e,t=!0){let n=l2.exec(e);if(!n)return!1;let o=+n[1],i=+n[2],a=+n[3],c=n[4]==="-"?-1:1,l=+(n[5]||0),m=+(n[6]||0);if(l>23||m>59||t&&!n[4]&&e.toLowerCase().indexOf("z")===-1)return!1;if(o<=23&&i<=59&&a<60)return!0;let f=i-m*c,h=o-l*c-(f<0?1:0);return(h===23||h===-1)&&(f===59||f===-1)&&a<61}function Su(e,t=!0){let n=e.split(/T/i);return n.length===2&&Oi(n[0])&&xi(n[1],t)}var m2=/^P((\d+Y(\d+M(\d+D)?)?|\d+M(\d+D)?|\d+D)(T(\d+H(\d+M(\d+S)?)?|\d+M(\d+S)?|\d+S))?|T(\d+H(\d+M(\d+S)?)?|\d+M(\d+S)?|\d+S)|\d+W)$/;function Au(e){return m2.test(e)}var d2=/^(?!.*\.\.)[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i;function Ou(e){return d2.test(e)}var go=36,xu=1,Gf=26,f2=38,g2=700,h2=72,y2=128;function T2(e,t,n){e=n?Math.floor(e/g2):e>>1,e+=Math.floor(e/t);let o=0;for(;e>(go-xu)*Gf>>1;)e=Math.floor(e/(go-xu)),o+=go;return o+Math.floor((go-xu+1)*e/(e+f2))}function mC(e){let t=[],n=y2,o=0,i=h2,a=e.lastIndexOf("-");if(a>0)for(let l=0;l<a;l++){let m=e.charCodeAt(l);if(m>=128)throw new Error("Invalid punycode: non-basic before delimiter");t.push(m)}let c=a<0?0:a+1;for(;c<e.length;){let l=o,m=1,f=go;for(;;){if(c>=e.length)throw new Error("Invalid punycode: unexpected end of input");let E=e.charCodeAt(c++),I;if(E>=97&&E<=122)I=E-97;else if(E>=48&&E<=57)I=E-48+26;else if(E>=65&&E<=90)fe();else throw new Error("Invalid punycode: bad digit character");o+=I*m;let g=f<=i?xu:f>=i+Gf?Gf:f-i;if(I<g)break;m*=go-g,f+=go}let h=t.length+1;i=T2(o-l,h,l===0),n+=Math.floor(o/h),o%=h,t.splice(o,0,n),o++}return globalThis.String.fromCodePoint(...t)}function _2(e){return new RegExp("\\p{Mn}","u").test(String.fromCodePoint(e))}function I2(e){return new RegExp("\\p{Mc}","u").test(String.fromCodePoint(e))}function b2(e){return new RegExp("\\p{Me}","u").test(String.fromCodePoint(e))}function S2(e){return _2(e)||I2(e)||b2(e)}var A2=new Set([1600,2042,12334,12335,12337,12338,12339,12340,12341,12347]),O2=new Set([2381,2509,2637,2765,2893,3021,3149,3277,3387,3388,3405,3530,6980,7082,7083,43456,69702,69759,69817,69939,69940,70080,70197,70477,70722,70850,71103,71231,71350,72767,73028,73029]);function x2(e){return new RegExp("\\p{Script=Greek}","u").test(String.fromCodePoint(e))}function R2(e){return new RegExp("\\p{Script=Hebrew}","u").test(String.fromCodePoint(e))}function C2(e){return new RegExp("\\p{Script=Hiragana}","u").test(String.fromCodePoint(e))}function P2(e){return new RegExp("\\p{Script=Katakana}","u").test(String.fromCodePoint(e))}function U2(e){return new RegExp("\\p{Script=Han}","u").test(String.fromCodePoint(e))}function w2(e){return e>=1632&&e<=1641}function v2(e){return e>=1776&&e<=1785}function dC(e){return O2.has(e)}function fC(e){if(e.length===0)return fe();let t=[...e].map(c=>c.codePointAt(0)),n=t.length;if(t[0]===45||t[n-1]===45||n>=4&&t[2]===45&&t[3]===45||S2(t[0]))return!1;let o=!1,i=!1,a=!1;for(let c=0;c<n;c++){let l=t[c];if(A2.has(l))return!1;(C2(l)||P2(l)||U2(l))&&(o=!0),w2(l)&&(i=!0),v2(l)&&(a=!0);let m=t[c-1],f=t[c+1];switch(l){case 183:if(m!==108||f!==108)return!1;break;case 885:if(f===void 0||!x2(f))return!1;break;case 1523:case 1524:if(m===void 0||!R2(m))return!1;break;case 8204:if(m===void 0||m<128&&!dC(m))return!1;break;case 8205:if(m===void 0||!dC(m))return!1;break;case 12539:break}}return!(e.includes("\u30FB")&&!o||i&&a)}function N2(e){if(e.charCodeAt(0)===45||e.charCodeAt(e.length-1)===45||e.length>=4&&e.charCodeAt(2)===45&&e.charCodeAt(3)===45)return!1;for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(!(n>=97&&n<=122||n>=65&&n<=90||n>=48&&n<=57||n===45))return!1}return!0}function gC(e){return e.toLowerCase().startsWith("xn--")}function hC(e){try{let t=e.slice(4).toLowerCase();if(t.lastIndexOf("-")===0)return!1;let o=mC(t);return o?fC(o):!1}catch{return!1}}function yC(e){return e.length===0||e.length>63?!1:gC(e)?hC(e):fC(e)}function TC(e){return e.length===0||e.length>63?!1:gC(e)?hC(e):N2(e)}function Ru(e){if(e.length===0||e.length>253||e.charCodeAt(e.length-1)===46)return!1;for(let t of e.split("."))if(!TC(t))return!1;return!0}var k2=/^(?!.*\.\.)[\p{L}\p{N}!#$%&'*+/=?^_`{|}~-]+(?:\.[\p{L}\p{N}!#$%&'*+/=?^_`{|}~-]+)*@[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,61}[\p{L}\p{N}])?(?:\.[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,61}[\p{L}\p{N}])?)*$/iu;function Cu(e){return k2.test(e)}function Pu(e){if(e.length===0||e.includes(" "))return!1;let t=e.normalize("NFC").replace(/[\u002E\u3002\uFF0E\uFF61]/g,".");if(t.length>253)return!1;for(let n of t.split("."))if(!yC(n))return!1;return!0}function $f(e,t,n){let o=0,i=0,a=0,c=0;for(let l=t;l<n;l++){let m=e.charCodeAt(l);if(m===46){if(a===0||i>255||c===48&&a>1)return!1;o++,i=0,a=0,c=0}else if(m>=48&&m<=57)a===0&&(c=m),i=i*10+(m-48),a++;else return!1}return o===3&&a>0&&i<=255&&!(c===48&&a>1)}function Uu(e){return $f(e,0,e.length)}function M2(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function wu(e){let t=e.length;if(t===0)return!1;let n=0,o=!1,i=0;if(e.charCodeAt(0)===58&&e.charCodeAt(1)===58){if(t===2)return!0;o=!0,i=2}for(;i<t;){let a=0,c=i;for(;i<t&&M2(e.charCodeAt(i));)i++,a++;if(a===0)return!1;let l=e.charCodeAt(i);if(l===46){if(!$f(e,c,t))return!1;n+=2,i=t;break}if(a>4)return!1;if(n++,i===t)break;if(l!==58)return!1;if(i++,e.charCodeAt(i)===58){if(o||e.charCodeAt(i+1)===58)return!1;if(o=!0,i++,i===t)break}}return o?n<=7:n===8}function EC(e){try{return new URL(e,"http://example.com"),!0}catch{return!1}}function vu(e){if(e.includes(" ")||e.includes("\\")||/[\x00-\x1F\x7F]/.test(e)||/%(?![0-9a-fA-F]{2})/.test(e))return!1;if(e==="")return!0;let t=e.indexOf(":");return t>0&&/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e.substring(0,t))?EC(e):e.match(/^([a-zA-Z][a-zA-Z0-9+\-.]*)(\/\/)/)&&t===-1?!1:EC(e)}function Nu(e){try{return new URL(e),!0}catch{return!1}}var D2=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;function Lu(e){return D2.test(e)}var G2=/^(?:\/(?:[^~/]|~0|~1)*)*$/;function ku(e){return G2.test(e)}function Mu(e){if(e.length===0)return!1;try{return new RegExp(e),!0}catch{return!1}}var $2=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function Du(e){return $2.test(e)}var j2=/^(?!.*[^\x00-\x7F])(?!.*\\)(?:(?:[a-z][a-z0-9+\-.]*:)?(?:\/\/[^\s[\]{}<>^`|]*)?|[^\s[\]{}<>^`|]*)(?:\?[^\s[\]{}<>^`|]*)?(?:#[^\s[\]{}<>^`|]*)?$/i;function Gu(e){return j2.test(e)}var F2=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i;function $u(e){return F2.test(e)}function _C(e){return e>=97&&e<=122||e>=65&&e<=90}function IC(e){return _C(e)||e>=48&&e<=57}function ju(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function q2(e){return IC(e)||e===43||e===45||e===46}function jf(e){return IC(e)||e===45||e===46||e===95||e===126}function Ff(e){return e===33||e===36||e===38||e===39||e===40||e===41||e===42||e===43||e===44||e===59||e===61}function B2(e){return jf(e)||Ff(e)||e===58||e===64}function Fu(e){let t=e.length;if(t===0||!_C(e.charCodeAt(0)))return!1;let n=1;for(;n<t;){let o=e.charCodeAt(n);if(o===58)break;if(!q2(o))return!1;n++}if(e.charCodeAt(n)!==58)return!1;if(n++,e.charCodeAt(n)===47&&e.charCodeAt(n+1)===47){n+=2;let o=n,i=-1;for(let a=n;a<t;a++){let c=e.charCodeAt(a);if(c===64){i=a;break}if(c===47||c===63||c===35)break}if(i!==-1){for(let a=o;a<i;a++){let c=e.charCodeAt(a);if(c===91||c===93)return!1;if(c===37){if(a+2>=i||!ju(e.charCodeAt(a+1))||!ju(e.charCodeAt(a+2)))return!1;a+=2}else if(!jf(c)&&!Ff(c)&&c!==58)return!1}n=i+1}if(e.charCodeAt(n)===91){for(n++;n<t&&e.charCodeAt(n)!==93;)n++;if(e.charCodeAt(n)!==93)return!1;n++}else for(;n<t;){let a=e.charCodeAt(n);if(a===47||a===63||a===35||a===58)break;if(a<128&&!jf(a)&&!Ff(a))return!1;n++}if(e.charCodeAt(n)===58)for(n++;n<t;){let a=e.charCodeAt(n);if(a===47||a===63||a===35)break;if(a<48||a>57)return!1;n++}}for(;n<t;){let o=e.charCodeAt(n);if(o===37){if(n+2>=t||!ju(e.charCodeAt(n+1))||!ju(e.charCodeAt(n+2)))return!1;n+=2}else{if(o>127)return!1;if(!(B2(o)||o===47||o===63||o===35))return!1}n++}return!0}var H2=/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu;function qu(e){return H2.test(e)}var K2=/^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;function Bu(e){return K2.test(e)}var Oe=new Map;function bC(){Oe.clear()}function z2(){return[...Oe.entries()]}function Y2(e,t){Oe.set(e,t)}function V2(e){return Oe.has(e)}function Q2(e){return Oe.get(e)}function W2(e,t){return Oe.get(e)?.(t)??!0}function SC(){bC(),Oe.set("date-time",Su),Oe.set("date",Oi),Oe.set("duration",Au),Oe.set("email",Ou),Oe.set("hostname",Ru),Oe.set("idn-email",Cu),Oe.set("idn-hostname",Pu),Oe.set("ipv4",Uu),Oe.set("ipv6",wu),Oe.set("iri-reference",vu),Oe.set("iri",Nu),Oe.set("json-pointer-uri-fragment",Lu),Oe.set("json-pointer",ku),Oe.set("regex",Mu),Oe.set("relative-json-pointer",Du),Oe.set("time",xi),Oe.set("uri-reference",Gu),Oe.set("uri-template",$u),Oe.set("uri",Fu),Oe.set("url",qu),Oe.set("uuid",Bu)}SC();function qf(e,t,n,o){return Ri.Test(n.format,o)}function AC(e,t,n,o,i,a){return qf(e,t,i,a)||t.AddError({keyword:"format",schemaPath:n,instancePath:o,params:{format:i.format}})}function OC(e,t,n,o){let i=Rf(n)?n.then:!0,a=mf(n)?n.else:!0;return ne(e,t,n.if,o)?ne(e,t,i,o):ne(e,t,a,o)}function xC(e,t,n,o,i,a){let c=Rf(i)?i.then:!0,l=mf(i)?i.else:!0,m=new st,f=Ie(e,m,`${n}/if`,o,i.if,a)?Ie(e,m,`${n}/then`,o,c,a)||t.AddError({keyword:"if",schemaPath:n,instancePath:o,params:{failingKeyword:"then"}}):Ie(e,t,`${n}/else`,o,l,a)||t.AddError({keyword:"if",schemaPath:n,instancePath:o,params:{failingKeyword:"else"}});return f&&t.Merge([m]),f}function Z2(e,t,n,o){return s.Every(n.items,0,(i,a)=>s.IsLessEqualThan(o.length,a)||Kt(e,t,i,o[a])&&t.AddIndex(a))}function X2(e,t,n,o,i,a){return s.EveryAll(i.items,0,(c,l)=>{let m=`${n}/items/${l}`,f=`${o}/${l}`;return s.IsLessEqualThan(a.length,l)||zt(e,t,m,f,c,a[l])&&t.AddIndex(l)})}function J2(e,t,n,o){let i=bi(n)?n.prefixItems.length:0;return s.Every(o,i,(a,c)=>Kt(e,t,n.items,a)&&t.AddIndex(c))}function eK(e,t,n,o,i,a){let c=bi(i)?i.prefixItems.length:0;return s.EveryAll(a,c,(l,m)=>{let f=`${n}/items`,h=`${o}/${m}`;return zt(e,t,f,h,i.items,l)&&t.AddIndex(m)})}function RC(e,t,n,o){return hf(n)?Z2(e,t,n,o):J2(e,t,n,o)}function CC(e,t,n,o,i,a){return hf(i)?X2(e,t,n,o,i,a):eK(e,t,n,o,i,a)}function tK(e){return lo(e)}function Bf(e,t,n,o){if(!tK(n))return!0;let i=s.Counted(o,a=>ne(e,t,n.contains,a));return s.IsLessEqualThan(i,n.maxContains)}function PC(e,t,n,o,i,a){let c=mo(i)?i.minContains:1;return Bf(e,t,i,a)||t.AddError({keyword:"contains",schemaPath:n,instancePath:o,params:{minContains:c,maxContains:i.maxContains}})}function Hf(e,t,n,o){return s.IsLessEqualThan(o,n.maximum)}function UC(e,t,n,o,i,a){return Hf(e,t,i,a)||t.AddError({keyword:"maximum",schemaPath:n,instancePath:o,params:{comparison:"<=",limit:i.maximum}})}function Kf(e,t,n,o){return s.IsLessEqualThan(o.length,n.maxItems)}function wC(e,t,n,o,i,a){return Kf(e,t,i,a)||t.AddError({keyword:"maxItems",schemaPath:n,instancePath:o,params:{limit:i.maxItems}})}function zf(e,t,n,o){return s.IsMaxLength(o,n.maxLength)}function vC(e,t,n,o,i,a){return zf(e,t,i,a)||t.AddError({keyword:"maxLength",schemaPath:n,instancePath:o,params:{limit:i.maxLength}})}function Yf(e,t,n,o){return s.IsLessEqualThan(s.Keys(o).length,n.maxProperties)}function NC(e,t,n,o,i,a){return Yf(e,t,i,a)||t.AddError({keyword:"maxProperties",schemaPath:n,instancePath:o,params:{limit:i.maxProperties}})}function rK(e){return lo(e)}function Vf(e,t,n,o){if(!rK(n))return!0;let i=s.Counted(o,(a,c)=>ne(e,t,n.contains,a)&&t.AddIndex(c));return s.IsGreaterEqualThan(i,n.minContains)}function LC(e,t,n,o,i,a){return Vf(e,t,i,a)||t.AddError({keyword:"contains",schemaPath:n,instancePath:o,params:{minContains:i.minContains}})}function Qf(e,t,n,o){return s.IsGreaterEqualThan(o,n.minimum)}function kC(e,t,n,o,i,a){return Qf(e,t,i,a)||t.AddError({keyword:"minimum",schemaPath:n,instancePath:o,params:{comparison:">=",limit:i.minimum}})}function Wf(e,t,n,o){return s.IsGreaterEqualThan(o.length,n.minItems)}function MC(e,t,n,o,i,a){return Wf(e,t,i,a)||t.AddError({keyword:"minItems",schemaPath:n,instancePath:o,params:{limit:i.minItems}})}function Zf(e,t,n,o){return s.IsMinLength(o,n.minLength)}function DC(e,t,n,o,i,a){return Zf(e,t,i,a)||t.AddError({keyword:"minLength",schemaPath:n,instancePath:o,params:{limit:i.minLength}})}function Xf(e,t,n,o){return s.IsGreaterEqualThan(s.Keys(o).length,n.minProperties)}function GC(e,t,n,o,i,a){return Xf(e,t,i,a)||t.AddError({keyword:"minProperties",schemaPath:n,instancePath:o,params:{limit:i.minProperties}})}function Jf(e,t,n,o){return s.IsMultipleOf(o,n.multipleOf)}function $C(e,t,n,o,i,a){return Jf(e,t,i,a)||t.AddError({keyword:"multipleOf",schemaPath:n,instancePath:o,params:{multipleOf:i.multipleOf}})}function eg(e,t,n,o){let i=new xt;return!ne(e,i,n.not,o)&&t.Merge([i])}function jC(e,t,n,o,i,a){return eg(e,t,i,a)||t.AddError({keyword:"not",schemaPath:n,instancePath:o,params:{}})}function FC(e,t,n,o){let i=n.oneOf.reduce((a,c)=>{let l=new xt;return ne(e,l,c,o)?[...a,l]:a},[]);return s.IsEqual(i.length,1)&&t.Merge(i)}function qC(e,t,n,o,i,a){let c=[],l=[],m=i.oneOf.reduce((h,E,I)=>{let g=new st,T=`${n}/oneOf/${I}`,S=Ie(e,g,T,o,E,a);return S&&l.push(I),S||c.push(g),S?[...h,g]:h},[]),f=s.IsEqual(m.length,1)&&t.Merge(m);return!f&&s.IsEqual(l.length,0)&&c.forEach(h=>h.GetErrors().forEach(E=>t.AddError(E))),f||t.AddError({keyword:"oneOf",schemaPath:n,instancePath:o,params:{passingSchemas:l}})}function tg(e,t,n,o){return(s.IsString(n.pattern)?new RegExp(n.pattern,"u"):n.pattern).test(o)}function BC(e,t,n,o,i,a){return tg(e,t,i,a)||t.AddError({keyword:"pattern",schemaPath:n,instancePath:o,params:{pattern:i.pattern}})}function HC(e,t,n,o){return s.Every(s.Entries(n.patternProperties),0,([i,a])=>{let c=new RegExp(i,"u");return s.Every(s.Entries(o),0,([l,m])=>!c.test(l)||Kt(e,t,a,m)&&t.AddKey(l))})}function KC(e,t,n,o,i,a){return s.EveryAll(s.Entries(i.patternProperties),0,([c,l])=>{let m=`${n}/patternProperties/${c}`,f=new RegExp(c,"u");return s.EveryAll(s.Entries(a),0,([h,E])=>{let I=`${o}/${h}`;return!f.test(h)||zt(e,t,m,I,l,E)&&t.AddKey(h)})})}function zC(e,t,n,o){return s.IsEqual(o.length,0)||s.Every(n.prefixItems,0,(i,a)=>s.IsLessEqualThan(o.length,a)||Kt(e,t,i,o[a])&&t.AddIndex(a))}function YC(e,t,n,o,i,a){return s.IsEqual(a.length,0)||s.EveryAll(i.prefixItems,0,(c,l)=>{let m=`${n}/prefixItems/${l}`,f=`${o}/${l}`;return s.IsLessEqualThan(a.length,l)||zt(e,t,m,f,c,a[l])&&t.AddIndex(l)})}function rg(e,t){return e.includes(t)||rt.Get().exactOptionalPropertyTypes}function ng(e,t){return s.IsUndefined(e[t])}function VC(e,t,n,o){let i=fo(n)?n.required:[];return s.Every(s.Entries(n.properties),0,([c,l])=>{let m=!s.HasPropertyKey(o,c)||Kt(e,t,l,o[c])&&t.AddKey(c);return rg(i,c)?m:ng(o,c)||m})}function QC(e,t,n,o,i,a){let c=fo(i)?i.required:[];return s.EveryAll(s.Entries(i.properties),0,([m,f])=>{let h=`${n}/properties/${m}`,E=`${o}/${m}`,I=()=>!s.HasPropertyKey(a,m)||zt(e,t,h,E,f,a[m])&&t.AddKey(m);return rg(c,m)?I():ng(a,m)||I()})}function WC(e,t,n,o){return s.Every(s.Keys(o),0,(i,a)=>ne(e,t,n.propertyNames,i))}function ZC(e,t,n,o,i,a){let c=[];return s.EveryAll(s.Keys(a),0,(m,f)=>{let h=`${o}/${m}`,E=`${n}/propertyNames`,I=new st,g=Ie(e,I,E,h,i.propertyNames,m);return g||c.push(m),g})||t.AddError({keyword:"propertyNames",schemaPath:n,instancePath:o,params:{propertyNames:c}})}function XC(e,t,n,o){let i=e.RecursiveRef(n)??!1;return F(i)&&ne(e,t,i,o)}function JC(e,t,n,o,i,a){let c=e.RecursiveRef(i)??!1;return F(c)&&Ie(e,t,"#",o,c,a)}function eP(e,t,n,o){let i=e.Ref(n)??!1,a=new xt,c=F(i)&&ne(e,a,i,o);return c&&t.Merge([a]),c}function tP(e,t,n,o,i,a){let c=e.Ref(i)??!1,l=new st,m=F(c)&&Ie(e,l,"#",o,c,a);return m&&t.Merge([l]),m||l.GetErrors().forEach(f=>t.AddError(f)),m}function rP(e,t,n,o){return s.Every(n.required,0,i=>s.HasPropertyKey(o,i))}function nP(e,t,n,o,i,a){let c=[];return s.EveryAll(i.required,0,m=>{let f=s.HasPropertyKey(a,m);return f||c.push(m),f})||t.AddError({keyword:"required",schemaPath:n,instancePath:o,params:{requiredProperties:c}})}function og(e,t,n,o,i){return s.IsEqual(n,"object")?s.IsObjectNotArray(i):s.IsEqual(n,"array")?s.IsArray(i):s.IsEqual(n,"boolean")?s.IsBoolean(i):s.IsEqual(n,"integer")?s.IsInteger(i):s.IsEqual(n,"number")?s.IsNumber(i):s.IsEqual(n,"null")?s.IsNull(i):s.IsEqual(n,"string")?s.IsString(i):s.IsEqual(n,"bigint")?s.IsBigInt(i):s.IsEqual(n,"constructor")?s.IsConstructor(i):s.IsEqual(n,"function")?s.IsFunction(i):s.IsEqual(n,"symbol")?s.IsSymbol(i):s.IsEqual(n,"undefined")?s.IsUndefined(i):s.IsEqual(n,"void")?s.IsUndefined(i):!0}function oP(e,t,n,o,i){return s.Some(n,a=>og(e,t,a,o,i))}function iP(e,t,n,o){return s.IsArray(n.type)?oP(e,t,n.type,n,o):og(e,t,n.type,n,o)}function aP(e,t,n,o,i,a){return(s.IsArray(i.type)?oP(e,t,i.type,i,a):og(e,t,i.type,i,a))||t.AddError({keyword:"type",schemaPath:n,instancePath:o,params:{type:i.type}})}function sP(e,t,n,o){let i=t.GetIndices();return s.Every(o,0,(a,c)=>(i.has(c)||ne(e,t,n.unevaluatedItems,a))&&t.AddIndex(c))}function cP(e,t,n,o,i,a){let c=t.GetIndices(),l=[];return s.EveryAll(a,0,(f,h)=>{let E=new st,I=(c.has(h)||Ie(e,E,n,o,i.unevaluatedItems,f))&&t.AddIndex(h);return I||l.push(h),I})||t.AddError({keyword:"unevaluatedItems",schemaPath:n,instancePath:o,params:{unevaluatedItems:l}})}function pP(e,t,n,o){let i=t.GetKeys();return s.Every(s.Entries(o),0,([a,c])=>i.has(a)||ne(e,t,n.unevaluatedProperties,c)&&t.AddKey(a))}function uP(e,t,n,o,i,a){let c=t.GetKeys(),l=[];return s.EveryAll(s.Entries(a),0,([f,h])=>{let E=new st,I=c.has(f)||Ie(e,E,n,o,i.unevaluatedProperties,h)&&t.AddKey(f);return I||l.push(f),I})||t.AddError({keyword:"unevaluatedProperties",schemaPath:n,instancePath:o,params:{unevaluatedProperties:l}})}function lP(e){return!s.IsEqual(e.uniqueItems,!1)}function mP(e,t,n,o){if(!lP(n))return!0;let i=new Set(o.map(Bn.Hash)).size,a=o.length;return s.IsEqual(i,a)}function dP(e,t,n,o,i,a){if(!lP(i))return!0;let c=new Set,l=a.reduce((f,h,E)=>{let I=Bn.Hash(h);return c.has(I)?[...f,E]:(c.add(I),f)},[]);return s.IsEqual(l.length,0)||t.AddError({keyword:"uniqueItems",schemaPath:n,instancePath:o,params:{duplicateItems:l}})}function Kt(e,t,n,o){return t.Push()&&ne(e,t,n,o)&&t.Pop()}function ne(e,t,n,o){e.Push(n);let i=Tu(n)?Uf(e,t,n,o):(!Cf(n)||iP(e,t,n,o))&&(!(s.IsObject(o)&&!s.IsArray(o))||(!fo(n)||rP(e,t,n,o))&&(!Hr(n)||zR(e,t,n,o))&&(!cf(n)||tC(e,t,n,o))&&(!pf(n)||nC(e,t,n,o))&&(!uf(n)||iC(e,t,n,o))&&(!fs(n)||HC(e,t,n,o))&&(!gs(n)||VC(e,t,n,o))&&(!Af(n)||WC(e,t,n,o))&&(!ms(n)||Xf(e,t,n,o))&&(!_f(n)||Yf(e,t,n,o)))&&(!s.IsArray(o)||(!nf(n)||BR(e,t,n,o))&&(!lo(n)||vf(e,t,n,o))&&(!_i(n)||RC(e,t,n,o))&&(!Tf(n)||Bf(e,t,n,o))&&(!Eu(n)||Kf(e,t,n,o))&&(!mo(n)||Vf(e,t,n,o))&&(!Ii(n)||Wf(e,t,n,o))&&(!bi(n)||zC(e,t,n,o))&&(!Si(n)||mP(e,t,n,o)))&&(!s.IsString(o)||(!Ef(n)||zf(e,t,n,o))&&(!ls(n)||Zf(e,t,n,o))&&(!us(n)||qf(e,t,n,o))&&(!ds(n)||tg(e,t,n,o)))&&(!(s.IsNumber(o)||s.IsBigInt(o))||(!ff(n)||Mf(e,t,n,o))&&(!Kr(n)||Df(e,t,n,o))&&(!yf(n)||Hf(e,t,n,o))&&(!Yr(n)||Qf(e,t,n,o))&&(!If(n)||Jf(e,t,n,o)))&&(!xf(n)||eP(e,t,n,o))&&(!Of(n)||XC(e,t,n,o))&&(!lf(n)||sC(e,t,n,o))&&(!sf(n)||wf(e,t,n,o))&&(!df(n)||kf(e,t,n,o))&&(!gf(n)||OC(e,t,n,o))&&(!bf(n)||eg(e,t,n,o))&&(!of(n)||VR(e,t,n,o))&&(!af(n)||WR(e,t,n,o))&&(!Sf(n)||FC(e,t,n,o))&&(!Iu(n)||!s.IsArray(o)||sP(e,t,n,o))&&(!bu(n)||!s.IsObject(o)||pP(e,t,n,o))&&(!rf(n)||jR(e,t,n,o));return e.Pop(n),i}function zt(e,t,n,o,i,a){return t.Push()&&Ie(e,t,n,o,i,a)&&t.Pop()}function Ie(e,t,n,o,i,a){e.Push(i);let c=Tu(i)?XR(e,t,n,o,i,a):!!(+(!Cf(i)||aP(e,t,n,o,i,a))&+(!(s.IsObject(a)&&!s.IsArray(a))||!!(+(!fo(i)||nP(e,t,n,o,i,a))&+(!Hr(i)||YR(e,t,n,o,i,a))&+(!cf(i)||rC(e,t,n,o,i,a))&+(!pf(i)||oC(e,t,n,o,i,a))&+(!uf(i)||aC(e,t,n,o,i,a))&+(!fs(i)||KC(e,t,n,o,i,a))&+(!gs(i)||QC(e,t,n,o,i,a))&+(!Af(i)||ZC(e,t,n,o,i,a))&+(!ms(i)||GC(e,t,n,o,i,a))&+(!_f(i)||NC(e,t,n,o,i,a))))&+(!s.IsArray(a)||!!(+(!nf(i)||HR(e,t,n,o,i,a))&+(!lo(i)||eC(e,t,n,o,i,a))&+(!_i(i)||CC(e,t,n,o,i,a))&+(!Tf(i)||PC(e,t,n,o,i,a))&+(!Eu(i)||wC(e,t,n,o,i,a))&+(!mo(i)||LC(e,t,n,o,i,a))&+(!Ii(i)||MC(e,t,n,o,i,a))&+(!bi(i)||YC(e,t,n,o,i,a))&+(!Si(i)||dP(e,t,n,o,i,a))))&+(!s.IsString(a)||!!(+(!Ef(i)||vC(e,t,n,o,i,a))&+(!ls(i)||DC(e,t,n,o,i,a))&+(!us(i)||AC(e,t,n,o,i,a))&+(!ds(i)||BC(e,t,n,o,i,a))))&+(!(s.IsNumber(a)||s.IsBigInt(a))||!!(+(!ff(i)||uC(e,t,n,o,i,a))&+(!Kr(i)||lC(e,t,n,o,i,a))&+(!yf(i)||UC(e,t,n,o,i,a))&+(!Yr(i)||kC(e,t,n,o,i,a))&+(!If(i)||$C(e,t,n,o,i,a))))&+(!xf(i)||tP(e,t,n,o,i,a))&+(!Of(i)||JC(e,t,n,o,i,a))&+(!lf(i)||cC(e,t,n,o,i,a))&+(!sf(i)||JR(e,t,n,o,i,a))&+(!df(i)||pC(e,t,n,o,i,a))&+(!gf(i)||xC(e,t,n,o,i,a))&+(!bf(i)||jC(e,t,n,o,i,a))&+(!of(i)||QR(e,t,n,o,i,a))&+(!af(i)||ZR(e,t,n,o,i,a))&+(!Sf(i)||qC(e,t,n,o,i,a))&+(!Iu(i)||!s.IsArray(a)||cP(e,t,n,o,i,a))&+(!bu(i)||!s.IsObject(a)||uP(e,t,n,o,i,a)))&&(!rf(i)||FR(e,t,n,o,i,a));return e.Pop(i),c}var On={};Yt(On,{DynamicRef:()=>yK,Ref:()=>ag});var Ci={};Yt(Ci,{Delete:()=>uK,Get:()=>cK,Has:()=>sK,Indices:()=>Es,Set:()=>pK});function fP(e){if(e.length===0)throw Error("Cannot set root")}function gP(e){if(!s.IsObject(e))throw Error("Cannot set value")}function nK(e){if(s.IsUnsafePropertyKey(e))throw Error("Pointer contains unsafe property key")}function hP(e){for(let t of e)nK(t)}function oK(e){return/^(0|[1-9]\d*)$/.test(e)}function yP(e){return[e.slice(0,e.length-1),e.slice(e.length-1)[0]]}function iK(e,t){return s.IsObject(t)&&s.HasPropertyKey(t,e)}function aK(e,t){return s.IsObject(t)&&!s.IsUnsafePropertyKey(e)?t[e]:void 0}function ig(e,t){return e.reduce((n,o)=>aK(o,n),t)}function Es(e){if(s.IsEqual(e.length,0))return[];let t=e.split("/").map(n=>n.replace(/~1/g,"/").replace(/~0/g,"~"));return t.length>0&&t[0]===""?t.slice(1):t}function sK(e,t){let n=e;return Es(t).every(o=>iK(o,n)?(n=n[o],!0):!1)}function cK(e,t){let n=Es(t);return ig(n,e)}function pK(e,t,n){let o=Es(t);fP(o),hP(o);let[i,a]=yP(o),c=ig(i,e);return gP(c),c[a]=n,e}function uK(e,t){let n=Es(t);fP(n),hP(n);let[o,i]=yP(n),a=ig(o,e);return gP(a),s.IsArray(a)&&oK(i)?a.splice(+i,1):delete a[i],e}function lK(e,t,n){if(e.$id===n.hash)return e;let o=new URL(e.$id,t.href),i=new URL(n.href,t.href);if(s.IsEqual(o.pathname,i.pathname))return n.hash.startsWith("#")?TP(e,t,n):e}function mK(e,t,n){let o=new URL(`#${e.$anchor}`,t.href),i=new URL(n.href,t.href);return s.IsEqual(o.href,i.href)?e:void 0}function dK(e,t,n){let o=new URL(`#${e.$dynamicAnchor}`,t.href),i=new URL(n.href,t.href);return s.IsEqual(o.href,i.href)?e:void 0}function TP(e,t,n){if(n.href.endsWith("#"))return e;if(!n.hash.startsWith("#"))return;let o=decodeURIComponent(n.hash.slice(1));if(o.startsWith("/"))return Ci.Get(e,o)}function fK(e,t,n){if(zr(e)){let o=lK(e,t,n);if(!s.IsUndefined(o))return o}if(ps(e)){let o=mK(e,t,n);if(!s.IsUndefined(o))return o}if(An(e)){let o=dK(e,t,n);if(!s.IsUndefined(o))return o}return TP(e,t,n)}function gK(e,t,n){return e.reduce((o,i)=>{let a=sg(i,t,n);return s.IsUndefined(a)?o:a},void 0)}function hK(e,t,n){return s.Keys(e).reduce((o,i)=>{let a=sg(e[i],t,n);return s.IsUndefined(a)?o:a},void 0)}function sg(e,t,n){let o=ir(e)&&zr(e)?new URL(e.$id,t.href):t;if(ir(e)){let i=fK(e,o,n);if(!s.IsUndefined(i))return i}if(s.IsArray(e))return gK(e,o,n);if(s.IsObject(e))return hK(e,o,n)}function ag(e,t){let n=new URL("http://unknown/"),o=zr(e)?new URL(e.$id,n.href):n,i=new URL(t,o.href);return sg(e,o,i)}function yK(e,t,n,o){let i=n.$dynamicRef.startsWith("#")?ag(t,n.$dynamicRef):ag(e,n.$dynamicRef);return s.IsUndefined(i)?void 0:!ir(i)||!An(i)||new URL(n.$dynamicRef,"http://unknown/").hash.startsWith("#/")?i:o.find(l=>l.$dynamicAnchor===i.$dynamicAnchor)??i}var Pi=function(e,t,n,o){if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?o:n==="a"?o.call(e):o?o.value:t.get(e)},xn,EP,_P,IP,bP,ho=class{constructor(t,n){xn.add(this),this.context=t,this.schema=n,this.ids=[],this.anchors=[],this.recursiveAnchors=[],this.dynamicAnchors=[]}BaseURL(){return this.ids.reduce((t,n)=>new URL(n.$id,t),new URL("http://unknown"))}Base(){return this.ids[this.ids.length-1]??this.schema}Push(t){ir(t)&&(zr(t)&&(this.ids.push(t),Pi(this,xn,"m",EP).call(this,t)),ps(t)&&this.anchors.push(t),_u(t)&&this.recursiveAnchors.push(t),An(t)&&this.dynamicAnchors.push(t))}Pop(t){ir(t)&&(zr(t)&&(this.ids.pop(),Pi(this,xn,"m",_P).call(this,t)),ps(t)&&this.anchors.pop(),_u(t)&&this.recursiveAnchors.pop(),An(t)&&this.dynamicAnchors.pop())}Ref(t){return Pi(this,xn,"m",IP).call(this,t)??Pi(this,xn,"m",bP).call(this,t)}RecursiveRef(t){return _u(this.Base())?On.Ref(this.recursiveAnchors[0],t.$recursiveRef):On.Ref(this.Base(),t.$recursiveRef)}DynamicRef(t){let n=this.schema;return On.DynamicRef(n,this.Base(),t,this.dynamicAnchors)}};xn=new WeakSet,EP=function e(t,n=!0){if(!ir(t))return;let o=t;if(!(!n&&zr(o))){!n&&An(o)&&this.dynamicAnchors.push(o);for(let i of s.Keys(o))Pi(this,xn,"m",e).call(this,o[i],!1)}},_P=function e(t,n=!0){if(!ir(t))return;let o=t;if(!(!n&&zr(o))){!n&&An(o)&&this.dynamicAnchors.pop();for(let i of s.Keys(o))Pi(this,xn,"m",e).call(this,o[i],!1)}},IP=function(t){return s.HasPropertyKey(this.context,t.$ref)?this.context[t.$ref]:void 0},bP=function(t){let n=this.schema;return t.$ref.startsWith("#")?On.Ref(this.Base(),t.$ref):On.Ref(n,t.$ref)};function Hu(...e){let[t,n,o]=oe.Match(e,{3:(h,E,I)=>[h,E,I],2:(h,E)=>[{},h,E]}),i=rt.Get(),a=Xy(),c=[],l=new ho(t,n),m=new hs(h=>{if(!s.IsGreaterEqualThan(c.length,i.maxErrors))return c.push({...h,message:a(h)})});return[Ie(l,m,"#","",n,o),c]}function pg(...e){let[t,n,o]=oe.Match(e,{3:(c,l,m)=>[c,l,m],2:(c,l)=>[{},c,l]}),i=new ho(t,n),a=new xt;return ne(i,a,n,o)}function he(...e){let[t,n,o]=oe.Match(e,{3:(i,a,c)=>[i,a,c],2:(i,a)=>[{},i,a]});return pg(t,n,o)}function Rn(...e){let[t,n,o]=oe.Match(e,{3:(c,l,m)=>[c,l,m],2:(c,l)=>[{},c,l]}),[i,a]=Hu(t,n,o);return a}var Cn=class extends Error{constructor(t,n,o){super(t),Object.defineProperty(this,"cause",{value:{source:t,errors:o,value:n},writable:!1,configurable:!1,enumerable:!1})}};function SP(e,t,n){return s.IsArray(n)?n.map(o=>ct(e,t.items,o)):n}function AP(e,t,n){return ct({...e,...t.$defs},nt(t.$ref),n)}function _K(e,t){let n=s.HasPropertyKey(t,"unevaluatedProperties")?{additionalProperties:t.unevaluatedProperties}:{},o=Qt(e,t),i=ft(o);return D(i)?Np(i,n):i}function OP(e,t,n){let o=_K(e,t);return ct(e,o,n)}function Ku(e){return s.HasPropertyKey(e,"additionalProperties")?e.additionalProperties:void 0}function xP(e,t,n){if(!s.IsObject(n)||s.IsArray(n))return n;let o=Ku(t);for(let i of s.Keys(n)){if(s.HasPropertyKey(t.properties,i)){n[i]=ct(e,t.properties[i],n[i]);continue}if(s.IsBoolean(o)&&s.IsEqual(o,!0)||Ue(o)&&he(e,o,n[i])){n[i]=ct(e,o,n[i]);continue}delete n[i]}return n}function RP(e,t,n){if(!s.IsObject(n))return n;let o=Ku(t),[i,a]=[new RegExp(it(t)),Se(t)];for(let c of s.Keys(n)){if(i.test(c)){n[c]=ct(e,a,n[c]);continue}if(s.IsBoolean(o)&&s.IsEqual(o,!0)||Ue(o)&&he(e,o,n[c])){n[c]=ct(e,o,n[c]);continue}delete n[c]}return n}function CP(e,t,n){return s.HasPropertyKey(e,t.$ref)?ct(e,e[t.$ref],n):n}function PP(e,t,n){if(!s.IsArray(n))return n;let o=Math.min(n.length,t.items.length);for(let i=0;i<o;i++)n[i]=ct(e,t.items[i],n[i]);return s.IsGreaterThan(n.length,o)?n.slice(0,o):n}function $e(e){return jn(e)}function UP(e,t,n){for(let o of t.anyOf){let i=ct(e,o,$e(n));if(he(e,o,i))return i}return n}function ct(e,t,n){return Z(t)?SP(e,t,n):Te(t)?AP(e,t,n):M(t)?OP(e,t,n):D(t)?xP(e,t,n):de(t)?RP(e,t,n):ce(t)?CP(e,t,n):Y(t)?PP(e,t,n):R(t)?UP(e,t,n):n}function IK(e,t){for(let n of Cc.Keys(e))Cc.HasPropertyKey(t,n)||(t[n]=e[n]);return t}function bK(e){let t={};for(let n of Cc.Keys(e))t[n]=_s(e[n]);return t}function SK(e){return ug(qA(e))}function ug(e){return e.map(t=>_s(t))}function _s(e){let t=Z(e)?Pt(_s(e.items),wo(e)):M(e)?ut(ug(e.allOf)):R(e)?q(SK(e.anyOf)):D(e)?k(bK(e.properties)):de(e)?jo(un(e),_s(Se(e))):Y(e)?ke(ug(e.items)):e;return IK(e,t)}function Ui(e){return _s(e)}function Ar(...e){let[t,n,o]=oe.Match(e,{3:(a,c,l)=>[a,c,l],2:(a,c)=>[{},a,c]}),i=rt.Get().unionPrioritySort?Ui(n):n;return ct(t,i,o)}var ie={};Yt(ie,{Fail:()=>To,IsOk:()=>lg,Ok:()=>L,TryArray:()=>AK,TryBigInt:()=>mg,TryBoolean:()=>MK,TryNull:()=>FK,TryNumber:()=>KK,TryString:()=>zK,TryUndefined:()=>ZK});function lg(e){return s.IsObject(e)&&s.HasPropertyKey(e,"value")}function L(e){return{value:e}}function To(){}function AK(e){return s.IsArray(e)?L(e):L([e])}function OK(e){return s.IsEqual(e,!0)?L(BigInt(1)):L(BigInt(0))}var xK=/^-?(0|[1-9]\d*)n$/,RK=/^-?(0|[1-9]\d*)\.\d+$/,CK=/^-?(0|[1-9]\d*)$/;function PK(e){return xK.test(e)}function UK(e){return RK.test(e)}function wK(e){return CK.test(e)}function vK(e){let t=e.toLowerCase();return PK(e)?L(BigInt(e.slice(0,e.length-1))):UK(e)?L(BigInt(e.split(".")[0])):wK(e)?L(BigInt(e)):s.IsEqual(t,"false")?L(BigInt(0)):s.IsEqual(t,"true")?L(BigInt(1)):void 0}function mg(e){return s.IsBigInt(e)?L(e):s.IsBoolean(e)?OK(e):s.IsNumber(e)?L(BigInt(Math.trunc(e))):s.IsNull(e)?L(BigInt(0)):s.IsString(e)?vK(e):s.IsUndefined(e)?L(BigInt(0)):void 0}function NK(e){return s.IsEqual(e,BigInt(0))?L(!1):s.IsEqual(e,BigInt(1))?L(!0):void 0}function LK(e){return s.IsEqual(e,0)?L(!1):s.IsEqual(e,1)?L(!0):void 0}function kK(e){return s.IsEqual(e.toLowerCase(),"false")?L(!1):s.IsEqual(e.toLowerCase(),"true")?L(!0):s.IsEqual(e,"0")?L(!1):s.IsEqual(e,"1")?L(!0):void 0}function MK(e){return s.IsBigInt(e)?NK(e):s.IsBoolean(e)?L(e):s.IsNumber(e)?LK(e):s.IsNull(e)?L(!1):s.IsString(e)?kK(e):s.IsUndefined(e)?L(!1):void 0}function DK(e){return s.IsEqual(e,BigInt(0))?L(null):void 0}function GK(e){return s.IsEqual(e,!1)?L(null):void 0}function $K(e){return s.IsEqual(e,0)?L(null):void 0}function jK(e){let t=e.toLowerCase();return s.IsEqual(t,"undefined")||s.IsEqual(t,"null")||s.IsEqual(e,"")||s.IsEqual(e,"0")?L(null):void 0}function FK(e){return s.IsBigInt(e)?DK(e):s.IsBoolean(e)?GK(e):s.IsNumber(e)?$K(e):s.IsNull(e)?L(null):s.IsString(e)?jK(e):s.IsUndefined(e)?L(null):void 0}var wP=BigInt(Number.MAX_SAFE_INTEGER),vP=BigInt(Number.MIN_SAFE_INTEGER);function qK(e){return e<=wP&&e>=vP?L(Number(e)):void 0}function BK(e){return L(e?1:0)}function HK(e){let t=+e;if(s.IsNumber(t))return L(t);let n=e.toLowerCase();if(s.IsEqual(n,"false"))return L(0);if(s.IsEqual(n,"true"))return L(1);let o=mg(e);return lg(o)?o.value<=wP&&o.value>=vP?L(Number(o.value)):void 0:void 0}function KK(e){return s.IsBigInt(e)?qK(e):s.IsBoolean(e)?BK(e):s.IsNumber(e)?L(e):s.IsNull(e)?L(0):s.IsString(e)?HK(e):s.IsUndefined(e)?L(0):void 0}function zK(e){return s.IsBigInt(e)?L(e.toString()):s.IsBoolean(e)?L(e.toString()):s.IsNumber(e)?L(e.toString()):s.IsNull(e)?L("null"):s.IsString(e)?L(e):s.IsUndefined(e)?L(""):void 0}function YK(e){return s.IsEqual(e,BigInt(0))?L(void 0):void 0}function VK(e){return s.IsEqual(e,!1)?L(void 0):void 0}function QK(e){return s.IsEqual(e,0)?L(void 0):void 0}function WK(e){let t=e.toLowerCase();return s.IsEqual(t,"undefined")||s.IsEqual(t,"null")||s.IsEqual(e,"")||s.IsEqual(e,"0")?L(void 0):void 0}function ZK(e){return s.IsBigInt(e)?YK(e):s.IsBoolean(e)?VK(e):s.IsNumber(e)?QK(e):s.IsNull(e)?L(void 0):s.IsString(e)?WK(e):s.IsUndefined(e)?L(e):void 0}function NP(e,t,n){return ie.TryArray(n).value.map(i=>je(e,t.items,i))}function LP(e,t,n){let o=ie.TryBigInt(n);return ie.IsOk(o)?o.value:n}function kP(e,t,n){let o=ie.TryBoolean(n);return ie.IsOk(o)?o.value:n}function MP(e,t,n){return je({...e,...t.$defs},nt(t.$ref),n)}function DP(e,t,n){return je(e,ft(t),n)}function GP(e,t,n){let o=ie.TryNumber(n);return ie.IsOk(o)?Math.trunc(o.value):n}function $P(e,t,n){let o=Qt(e,t),i=ft(o);return je(e,i,n)}function XK(e,t,n){let o=ie.TryBigInt(n);return ie.IsOk(o)&&s.IsEqual(t.const,o.value)?o.value:n}function JK(e,t,n){let o=ie.TryBoolean(n);return ie.IsOk(o)&&s.IsEqual(t.const,o.value)?o.value:n}function ez(e,t,n){let o=ie.TryNumber(n);return ie.IsOk(o)&&s.IsEqual(t.const,o.value)?o.value:n}function tz(e,t,n){let o=ie.TryString(n);return ie.IsOk(o)&&s.IsEqual(t.const,o.value)?o.value:n}function jP(e,t,n){return s.IsEqual(t.const,n)?n:sT(t)?XK(e,t,n):cT(t)?JK(e,t,n):Dc(t)?ez(e,t,n):Gc(t)?tz(e,t,n):fe()}function FP(e,t,n){let o=ie.TryNull(n);return ie.IsOk(o)?o.value:n}function qP(e,t,n){let o=ie.TryNumber(n);return ie.IsOk(o)?o.value:n}function zu(e,t,n,o){let i=s.Keys(o);for(let[a,c]of t)for(let l of i)a.test(l)||(o[l]=je(e,n,o[l]));return o}function Is(e,t,n){return Je(e)&&s.IsUndefined(n[t])}function rz(e,t,n){let o=s.EntriesRegExp(t.properties),i=s.Keys(n);for(let[a,c]of o)for(let l of i)!a.test(l)||Is(c,l,n)||(n[l]=je(e,c,n[l]));return s.HasPropertyKey(t,"additionalProperties")&&s.IsObject(t.additionalProperties)?zu(e,o,t.additionalProperties,n):n}function BP(e,t,n){return s.IsObjectNotArray(n)?rz(e,t,n):n}function nz(e,t,n){let o=s.EntriesRegExp(t.patternProperties),i=s.Keys(n);for(let[a,c]of o)for(let l of i)a.test(l)&&(n[l]=je(e,c,n[l]));return s.HasPropertyKey(t,"additionalProperties")&&s.IsObject(t.additionalProperties)?zu(e,o,t.additionalProperties,n):n}function HP(e,t,n){return s.IsObjectNotArray(n)?nz(e,t,n):n}function KP(e,t,n){return s.HasPropertyKey(e,t.$ref)?je(e,e[t.$ref],n):n}function zP(e,t,n){let o=ie.TryString(n);return ie.IsOk(o)?o.value:n}function YP(e,t,n){return je(e,ft(t),n)}function VP(e,t,n){if(!s.IsArray(n))return n;for(let o=0;o<Math.min(t.items.length,n.length);o++)n[o]=je(e,t.items[o],n[o]);return n}function QP(e,t,n){let o=ie.TryUndefined(n);return ie.IsOk(o)?o.value:n}function WP(e,t,n){if(t.anyOf.some(c=>he(e,c,n)))return n;let a=t.anyOf.map(c=>je(e,c,$e(n))).find(c=>he(e,t,c));return s.IsUndefined(a)?n:a}function ZP(e,t,n){let o=ie.TryUndefined(n);return ie.IsOk(o)?void 0:n}function je(e,t,n){return Z(t)?NP(e,t,n):vt(t)?LP(e,t,n):_t(t)?kP(e,t,n):Te(t)?MP(e,t,n):ze(t)?DP(e,t,n):ot(t)?GP(e,t,n):M(t)?$P(e,t,n):Q(t)?jP(e,t,n):gr(t)?FP(e,t,n):Ce(t)?qP(e,t,n):D(t)?BP(e,t,n):de(t)?HP(e,t,n):ce(t)?KP(e,t,n):We(t)?zP(e,t,n):Ee(t)?YP(e,t,n):Y(t)?VP(e,t,n):nr(t)?QP(e,t,n):R(t)?WP(e,t,n):kt(t)?ZP(e,t,n):n}function Pn(...e){let[t,n,o]=oe.Match(e,{3:(i,a,c)=>[i,a,c],2:(i,a)=>[{},i,a]});return je(t,n,o)}function XP(e,t,n){if(!s.IsArray(n))return n;for(let o=0;o<n.length;o++)n[o]=pt(e,t.items,n[o]);return n}function JP(e,t,n){return pt({...e,...t.$defs},nt(t.$ref),n)}function eU(e,t){return s.IsUndefined(t)?s.IsFunction(e.default)?e.default():$e(e.default):t}function tU(e,t,n){let o=Qt(e,t),i=ft(o);return pt(e,i,n)}function rU(e,t,n){if(!s.IsObject(n))return n;let o=s.Keys(t.properties);for(let i of o){let a=pt(e,t.properties[i],n[i]);s.IsUndefined(a)&&(Je(t.properties[i])||!s.HasPropertyKey(t.properties[i],"default"))||(n[i]=a)}if(!Hr(t)||s.IsBoolean(t.additionalProperties))return n;for(let i of s.Keys(n))o.includes(i)||(n[i]=pt(e,t.additionalProperties,n[i]));return n}function nU(e,t,n){if(!s.IsObject(n))return n;let[o,i]=[new RegExp(it(t)),Se(t)];for(let a of s.Keys(n))o.test(a)&&Ht(i)&&(n[a]=pt(e,i,n[a]));if(!Hr(t))return n;for(let a of s.Keys(n))o.test(a)||(n[a]=pt(e,t.additionalProperties,n[a]));return n}function oU(e,t,n){return s.HasPropertyKey(e,t.$ref)?pt(e,e[t.$ref],n):n}function iU(e,t,n){if(!s.IsArray(n))return n;let[o,i]=[t.items,Math.max(t.items.length,n.length)];for(let a=0;a<i;a++)a<o.length&&(n[a]=pt(e,o[a],n[a]));return n}function aU(e,t,n){for(let o of t.anyOf){let i=pt(e,o,$e(n));if(he(e,o,i))return i}return n}function pt(e,t,n){let o=Ht(t)?eU(t,n):n;return Z(t)?XP(e,t,o):Te(t)?JP(e,t,o):M(t)?tU(e,t,o):D(t)?rU(e,t,o):de(t)?nU(e,t,o):ce(t)?oU(e,t,o):Y(t)?iU(e,t,o):R(t)?aU(e,t,o):o}function Eo(...e){let[t,n,o]=oe.Match(e,{3:(i,a,c)=>[i,a,c],2:(i,a)=>[{},i,a]});return pt(t,n,o)}function wi(e){return(...t)=>{let[n,o,i]=oe.Match(t,{3:(a,c,l)=>[a,c,l],2:(a,c)=>[{},a,c]});return e.reduce((a,c)=>c(n,o,a),i)}}function oz(e,t,n){return t["~codec"].decode(n)}function iz(e,t,n){return t["~codec"].encode(n)}function xe(e,t,n,o){return Hn(n)?s.IsEqual(e,"Decode")?oz(t,n,o):iz(t,n,o):o}function az(e,t,n,o){if(!s.IsArray(o))return o;for(let i=0;i<o.length;i++)o[i]=Pe(e,t,n.items,o[i]);return xe(e,t,n,o)}function sz(e,t,n,o){let i=xe(e,t,n,o);if(!s.IsArray(i))return i;for(let a=0;a<i.length;a++)i[a]=Pe(e,t,n.items,i[a]);return i}function sU(e,t,n,o){return s.IsEqual(e,"Decode")?az(e,t,n,o):sz(e,t,n,o)}function cU(e,t,n,o){return o=Pe(e,{...t,...n.$defs},nt(n.$ref),o),xe(e,t,n,o)}function pU(e){return e.reduce((t,n)=>({...t,...n}),{})}function uU(e,t){for(let n of t)if(!s.IsDeepEqual(e,n))return n;return e}function cz(e,t,n,o){if(s.IsEqual(n.allOf.length,0))return xe(e,t,n,o);let i=n.allOf.map(l=>Pe(e,t,l,Ar(l,$e(o)))),c=i.every(l=>s.IsObject(l))?pU(i):uU(o,i);return xe(e,t,n,c)}function pz(e,t,n,o){if(s.IsEqual(n.allOf.length,0))return xe(e,t,n,o);let i=xe(e,t,n,o),a=n.allOf.map(l=>Pe(e,t,l,Ar(l,$e(i))));return a.every(l=>s.IsObject(l))?pU(a):uU(i,a)}function lU(e,t,n,o){return s.IsEqual(e,"Decode")?cz(e,t,n,o):pz(e,t,n,o)}function uz(e,t,n,o){if(!s.IsObjectNotArray(o))return o;for(let i of s.Keys(n.properties))!s.HasPropertyKey(o,i)||Is(n.properties[i],i,o)||(o[i]=Pe(e,t,n.properties[i],o[i]));return xe(e,t,n,o)}function lz(e,t,n,o){let i=xe(e,t,n,o);if(!s.IsObjectNotArray(i))return i;for(let a of s.Keys(n.properties))!s.HasPropertyKey(i,a)||Is(n.properties[a],a,i)||(i[a]=Pe(e,t,n.properties[a],i[a]));return i}function mU(e,t,n,o){return s.IsEqual(e,"Decode")?uz(e,t,n,o):lz(e,t,n,o)}function mz(e,t,n,o){if(!s.IsObjectNotArray(o))return o;let i=new RegExp(it(n));for(let a of s.Keys(o))i.test(a)&&(o[a]=Pe(e,t,Se(n),o[a]));return xe(e,t,n,o)}function dz(e,t,n,o){let i=xe(e,t,n,o);if(!s.IsObjectNotArray(i))return i;let a=new RegExp(it(n));for(let c of s.Keys(i))a.test(c)&&(i[c]=Pe(e,t,Se(n),i[c]));return i}function dU(e,t,n,o){return s.IsEqual(e,"Decode")?mz(e,t,n,o):dz(e,t,n,o)}function fU(e,t,n,o){return s.HasPropertyKey(t,n.$ref)?Pe(e,t,t[n.$ref],o):o}function gU(e,t,n,o){return s.IsEqual(e,"Decode")?xe(e,t,n,fU(e,t,n,o)):fU(e,t,n,xe(e,t,n,o))}function fz(e,t,n,o){if(!s.IsArray(o))return o;for(let i=0;i<Math.min(n.items.length,o.length);i++)o[i]=Pe(e,t,n.items[i],o[i]);return xe(e,t,n,o)}function gz(e,t,n,o){let i=xe(e,t,n,o);if(!s.IsArray(i))return o;for(let a=0;a<Math.min(n.items.length,i.length);a++)i[a]=Pe(e,t,n.items[a],i[a]);return i}function hU(e,t,n,o){return s.IsEqual(e,"Decode")?fz(e,t,n,o):gz(e,t,n,o)}function hz(e,t,n,o){for(let i of n.anyOf){if(!he(t,i,o))continue;let a=Pe(e,t,i,o);return xe(e,t,n,a)}return o}function yz(e,t,n,o){let i=xe(e,t,n,o);for(let a of n.anyOf){let c=Pe(e,t,a,$e(i));if(he(t,a,c))return c}return i}function yU(e,t,n,o){return s.IsEqual(e,"Decode")?hz(e,t,n,o):yz(e,t,n,o)}function Pe(e,t,n,o){return Z(n)?sU(e,t,n,o):Te(n)?cU(e,t,n,o):M(n)?lU(e,t,n,o):D(n)?mU(e,t,n,o):de(n)?dU(e,t,n,o):ce(n)?gU(e,t,n,o):Y(n)?hU(e,t,n,o):R(n)?yU(e,t,n,o):xe(e,t,n,o)}var dg=class extends Cn{constructor(t,n){super("Decode",t,n)}};function Tz(e,t,n){if(!he(e,t,n))throw new dg(n,Rn(e,t,n));return n}function Ez(e,t,n){let o=rt.Get().unionPrioritySort?Ui(t):t;return Pe("Decode",e,o,n)}var o9e=wi([(e,t,n)=>$e(n),(e,t,n)=>Eo(e,t,n),(e,t,n)=>Pn(e,t,n),(e,t,n)=>Ar(e,t,n),(e,t,n)=>Tz(e,t,n),(e,t,n)=>Ez(e,t,n)]);var fg=class extends Cn{constructor(t,n){super("Encode",t,n)}};function _z(e,t,n){if(!he(e,t,n))throw new fg(n,Rn(e,t,n));return n}function Iz(e,t,n){let o=rt.Get().unionPrioritySort?Ui(t):t;return Pe("Encode",e,o,n)}var y9e=wi([(e,t,n)=>$e(n),(e,t,n)=>Iz(e,t,n),(e,t,n)=>Eo(e,t,n),(e,t,n)=>Pn(e,t,n),(e,t,n)=>Ar(e,t,n),(e,t,n)=>_z(e,t,n)]);var Zt=class extends Error{constructor(t,n){super(n),this.type=t}};function TU(e,t){return s.IsFunction(t.default)?t.default(t):s.IsObject(t.default)?$e(t.default):t.default}function EU(e,t){if(Si(t)&&!Ht(t))throw new Zt(t,"Arrays with uniqueItems constraints must specify a default annotation");let n=Ii(t)?t.minItems:0;return Array.from({length:n},()=>Fe(e,t.items))}function _U(e,t){return Kr(t)?BigInt(t.exclusiveMinimum)+BigInt(1):Yr(t)?BigInt(t.minimum):BigInt(0)}function IU(e,t){return!1}function bU(e,t){let n=Fe(e,t.instanceType);return class{constructor(){Object.assign(this,n)}}}function SU(e,t){return Fe({...e,...t.$defs},nt(t.$ref))}function AU(e,t){return Fe(e,ft(t))}function OU(e,t){let n=Fe(e,t.returnType);return()=>n}function xU(e,t){return Kr(t)&&s.IsNumber(t.exclusiveMinimum)?t.exclusiveMinimum+1:Yr(t)?t.minimum:0}function RU(e,t){let n=Qt(e,t),o=ft(n);return Fe(e,o)}function CU(e,t){return t.const}function PU(e,t){throw new Zt(t,"Cannot create TNever types")}function UU(e,t){return null}function wU(e,t){return Kr(t)&&s.IsNumber(t.exclusiveMinimum)?t.exclusiveMinimum+1:Yr(t)?t.minimum:0}function vU(e,t){return(s.IsUndefined(t.required)?[]:t.required).reduce((o,i)=>({...o,[i]:Fe(e,t.properties[i])}),{})}function NU(e,t){if(ms(t)&&!Ht(t))throw new Zt(t,"Record with the minProperties constraint must have a default annotation");return{}}function LU(e,t){return s.HasPropertyKey(e,t.$ref)?Fe(e,e[t.$ref]):(()=>{throw new Zt(t,"Unable to deref Ref")})()}function kU(e,t){if((ds(t)||us(t))&&!Ht(t))throw Error("Strings with format or pattern constraints must specify default");let o=ls(t)?t.minLength:0;return"".padEnd(o)}function MU(e,t){return Symbol()}function DU(e,t){let n=Ea(t.pattern);if(We(n))throw new Zt(t,"Unable to create TemplateLiteral due to infinite type expansion");return Fe(e,n)}function GU(e,t){return Array.from({length:t.minItems},(n,o)=>Fe(e,t.items[o]))}function $U(e,t){if(s.IsEqual(t.anyOf.length,0))throw Error("Unable to create Union with no variants");return Fe(e,t.anyOf[0])}function Fe(e,t){return Ht(t)?TU(e,t):Z(t)?EU(e,t):vt(t)?_U(e,t):_t(t)?IU(e,t):Be(t)?bU(e,t):Te(t)?SU(e,t):ze(t)?AU(e,t):He(t)?OU(e,t):ot(t)?xU(e,t):M(t)?RU(e,t):Q(t)?CU(e,t):tr(t)?PU(e,t):gr(t)?UU(e,t):Ce(t)?wU(e,t):D(t)?vU(e,t):de(t)?NU(e,t):ce(t)?LU(e,t):We(t)?kU(e,t):hr(t)?MU(e,t):Ee(t)?DU(e,t):Y(t)?GU(e,t):nr(t)?void 0:R(t)?$U(e,t):kt(t)?void 0:void 0}function Or(...e){let[t,n]=oe.Match(e,{2:(o,i)=>[o,i],1:o=>[{},o]});return Fe(t,n)}var gg=class extends Cn{constructor(t,n){super("Parse",t,n)}};function bz(e,t,n){if(!he(e,t,n))throw new gg(n,Rn(e,t,n));return n}var G6e=wi([(e,t,n)=>$e(n),(e,t,n)=>Eo(e,t,n),(e,t,n)=>Pn(e,t,n),(e,t,n)=>Ar(e,t,n),(e,t,n)=>bz(e,t,n)]);var Az=k({type:z("insert"),path:It(),value:Qe()}),Oz=Object({type:z("update"),path:It(),value:Qe()}),xz=k({type:z("delete"),path:It()}),K6e=q([Az,Oz,xz]);function vi(e){if(!e.body)throw new Error("This command does not accept a request body");let t=e.body;return t.examples?.length?t.examples[0]:Or(t)}function Wr(e,t,n,o,i){e.command(t).description(n).option("-f, --file <FILE_PATH>","Read body from file (use - for stdin)").option("-d, --data <JSON>","Inline JSON body").option("--generate-skeleton","Print a JSON skeleton for the request body and exit").action(async a=>{if(a.generateSkeleton){ee(vi(o));return}let c=Ei(a),l=await i()(o,{body:c});ee(l)})}function qU(e,t){let n=e.command("grok").description("Test and preview grok parsing rules");Wr(n,"parse","Parse sample log lines with grok rules and return the extracted fields",GR,t)}var BU=require("node:child_process"),HU=require("node:fs"),KU=require("node:os"),Qu=require("node:path");var _o=require("node:fs");function bs(e,t){let n=`${e}.tmp.${process.pid}`;(0,_o.writeFileSync)(n,t),(0,_o.renameSync)(n,e)}function Ss(e){try{return(0,_o.readFileSync)(e,"utf8")}catch(t){if(t.code==="ENOENT")return;throw t}}function As(e,t){if(t===void 0)return;let n=`${e}.bak.${new Date().toISOString().replaceAll(":","-")}`;return(0,_o.writeFileSync)(n,t),n}function Io(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var hg="tsuga-dev/agent-plugins",Yu="tsuga";function Vu(e,t){V(` $ ${e} ${t.join(" ")}`);try{(0,BU.execFileSync)(e,t,{stdio:["ignore","inherit","inherit"]})}catch(n){let o=n.status??1;throw new Error(`${e} ${t.join(" ")} exited ${o}`,{cause:n})}}function Pz(e,t){V("Claude Code \u2192 installing Tsuga plugin"),Vu("claude",["plugin","marketplace","add",hg]),Vu("claude",["plugin","install",`tsuga@${Yu}`]),t.autoUpdate&&Uz(e)}function Uz(e){let t=(0,Qu.join)(e,".claude","settings.json");V(`Claude Code \u2192 ${t} (autoUpdate)`),(0,HU.mkdirSync)((0,Qu.dirname)(t),{recursive:!0});let n=Ss(t),o=JSON.parse(n??"{}");if(!Io(o))throw new Error(`${t} must contain a JSON object`);let i=o.extraKnownMarketplaces??{};if(!Io(i))throw new Error(`${t} "extraKnownMarketplaces" must be a JSON object`);let a=i[Yu],c=Io(a)?a:{};o.extraKnownMarketplaces={...i,[Yu]:{source:{source:"github",repo:hg},...c,autoUpdate:!0}};let l=As(t,n);bs(t,`${JSON.stringify(o,null,2)}
|
|
141
|
-
`),V(l===void 0?" created":` patched (backup: ${l})`)}function wz(){V("Codex \u2192 installing Tsuga plugin"),Vu("codex",["plugin","marketplace","add",hg]),Vu("codex",["plugin","add",`tsuga@${Yu}`])}function zU(e){let t=e.command("install").description("Install Tsuga plugins into local LLM CLIs").command("plugin").description("Install the Tsuga plugin into a specific LLM CLI");t.command("claude-code").description("Install the Tsuga plugin into Claude Code (requires the claude CLI in PATH)").option("--no-auto-update","Skip patching ~/.claude/settings.json with autoUpdate=true").action(n=>{Pz((0,KU.homedir)(),n),V("Restart your claude session to load the new plugins.")}),t.command("codex").description("Install the Tsuga plugin into Codex (requires the codex CLI in PATH)").action(()=>{wz(),V("Restart your codex session to load the new plugins.")})}var vz=10,Nz=r.Object({key:u({allowEmpty:!1,description:"Telemetry attribute key to scope the ranking by: a service, environment, team, route, or other positive equality term in the population you want fields for. Use dot-path keys such as `context.service.name`."}),value:r.Optional(u({allowEmpty:!1,description:"Attribute value the scoped telemetry should match, when the scope is a specific service, environment, team, route, or other known value. When omitted, artifacts that reference the key match this entry at full weight regardless of value."})),valueMustMatch:r.Optional(r.Boolean({description:"When true, this entry is a hard filter rather than a weight: any widget or monitor that does not match it exactly (key = value) contributes no fields at all, instead of contributing at a reduced weight. Other widgets of the same dashboard still contribute if they match. Requires `value`."}))}),yg=r.Object({field:r.String({description:"Field name to use in queries. For `kind: attribute`, this is an attribute dot path. For `kind: metric`, this is either a metric name or a `metricName.context.attribute` path when the metric query used a metric attribute."}),kind:r.Enum(["attribute","metric"],{description:"Whether the field is a telemetry attribute or a metric name. `metric` appears only in the metrics bucket, for fields referenced as the aggregated field of a metrics-source query."}),inferredType:r.Enum(["numeric","categorical","unknown"],{description:"Value type inferred from how the field is used: `numeric` when aggregated with sum/average/percentile, referenced by numeric or range filters, or a metric name; `categorical` when only grouped by or matched with equality/text filters; `unknown` otherwise. Evidence-based \u2014 a numeric field used only in equality filters reads as categorical."}),score:r.Number({description:"Relative relevance score computed by Tsuga from how strongly readable dashboards and monitors use this field for the requested scope, discounted when the field is common across the whole organization. Higher values mean stronger evidence that the field is useful for this scope. Scores are intended for ranking, not for comparison across unrelated scopes."}),artifacts:r.Number({description:"Number of distinct readable dashboards and monitors that reference this field and match the requested scope. Tsuga counts an artifact once per field even if it uses the field in multiple widgets or queries."}),globalArtifacts:r.Number({description:"Number of organization-wide dashboards and monitors that reference this field, regardless of the requested scope or caller permissions. Tsuga uses this anonymous baseline to down-rank fields that are common everywhere."}),usage:r.Object({groupBy:r.Number({description:"Number of distinct readable matching artifacts that use this field as a group-by or split dimension."}),filter:r.Number({description:"Number of distinct readable matching artifacts that filter on this field in widget queries, monitor queries, or dashboard-wide filters."}),measure:r.Number({description:"Number of distinct readable matching artifacts that aggregate this field as `aggregate.field`."}),column:r.Number({description:"Number of distinct readable matching artifacts that pin this field as a list-widget column."})},{description:"Distinct-artifact counts by usage kind, explaining why the field ranked where it did; a dashboard referencing the field the same way in many widgets counts once for that usage kind."})}),Tg=r.Object({logs:r.Array(yg,{description:"Top log fields for the requested scope, ranked by score and mined from readable logs-sourced dashboards and monitors."}),traces:r.Array(yg,{description:"Top trace fields for the requested scope, ranked by score and mined from readable traces-sourced dashboards and monitors."}),metrics:r.Array(yg,{description:"Top metric names and metric-attribute fields for the requested scope, ranked by score and mined from readable metrics-sourced dashboards and monitors."}),dashboardsMatched:r.Number({description:"Number of dashboards that matched the requested scope and that the caller can read. Dashboards the caller cannot read are removed before field rankings are returned."}),monitorsMatched:r.Number({description:"Number of monitors that matched the requested scope and that the caller can read. Monitors the caller cannot read are removed before field rankings are returned."})}),Eg=r.Object({scope:r.Array(Nz,{minItems:1,maxItems:vz,description:"Scope entries that define the population to rank fields for, drawn from positive equality pairs in a TQL query, such as service and environment. Tsuga matches entries softly by default: an artifact's contribution is weighted by the fraction of entries it matches."})}),B8e=d({tags:["interesting-fields"],url:"/v0/interesting-fields",method:"POST",body:Eg,response:Tg});var Lz=`/${"v1"}/interesting-fields`,kz={scope:[{key:"context.service.name",value:"payments"},{key:"context.env",value:"prod",valueMustMatch:!0}]},Mz=r.Object(Eg.properties,{description:"The scope to rank fields for, as attribute key/value pairs such as a service name and an environment. Entries are matched softly by default: a widget contributes in proportion to how many entries it matches, so a broader scope returns a broader ranking. Set `valueMustMatch` on an entry to make it a hard filter instead: a widget that does not match it exactly contributes nothing, even when other entries match.",examples:[kz]}),YU=d({url:Lz,method:"POST",operationId:"getInterestingFields",tags:["public","interesting-fields"],body:Mz,response:Tg,description:"Ranks the telemetry fields most relevant to a scope, mined from how the org already uses them in dashboards and monitors, bucketed by logs, traces, and metrics. Use this before guessing a field or metric name: a field that many scope-matching dashboards group or filter on is the one an operator would reach for. Ranking is TF-IDF style, so a field used everywhere in the org scores below one that is distinctive to the scope. Dashboards and monitors the caller cannot read never contribute field names, only the anonymous frequency baseline. The operation requires public API read access to dashboards and monitors."});function VU(e,t){let n=e.command("interesting-fields").description("Discover the telemetry fields an org already uses for a scope");Wr(n,"list","Rank the log, trace and metric fields most relevant to a scope, mined from dashboards and monitors",YU,t)}var ar="/v0/kubernetes-explorer",Dz="^[a-z0-9.-]+$",Gz="^[A-Za-z0-9._-]+$",QU=256,WU=r.Optional(u({allowEmpty:!1,description:"Tsuga cluster ID to target. Tsuga assigns it when a cluster is connected to the organization. Optional for single-cluster organizations and required for organizations with multiple clusters to scope the request to one cluster."}));var xr=e=>r.Optional(r.Array(u({allowEmpty:!1}),{description:e})),ZU={clusterId:WU,search:r.Optional(r.String({pattern:Dz,minLength:1,maxLength:QU,description:"Substring matched against the resource name. Kubernetes names are lowercase RFC 1123, so only lowercase letters, digits, `.` and `-` are accepted; uppercase and other characters are rejected. Wildcard and other query-syntax characters are treated literally."}))},XU={clusterId:WU,search:r.Optional(r.String({pattern:Gz,minLength:1,maxLength:QU,description:"Substring matched against the Kubernetes cluster name. Unlike Kubernetes resource names this is a collector-assigned identifier, so uppercase letters, digits, `.`, `-` and `_` are accepted. Wildcard and other query-syntax characters are treated literally."}))},JU=r.Object(ZU),ew=r.Object(XU),Os={...ZU,includeInternalNamespaces:r.Optional(r.Boolean({description:"When false or omitted, resources in internal namespaces (kube-system, kube-public, kube-node-lease, local-path-storage, gke-managed-*) are excluded."})),clusters:xr("Restrict results to these Kubernetes cluster names."),namespaces:xr("Restrict results to these namespaces."),teams:xr("Restrict results to these team names."),envs:xr("Restrict results to these environments."),...ge},tw=["Pending","Running","Succeeded","Failed","Unknown","CrashLoopBackOff","Error"],$z={...Os,nodes:xr("Restrict results to pods scheduled on these nodes."),deployments:xr("Restrict results to pods owned by these Deployments."),statefulsets:xr("Restrict results to pods owned by these StatefulSets."),daemonsets:xr("Restrict results to pods owned by these DaemonSets."),podStatus:r.Optional(r.Array(r.Enum(tw),{description:"Restrict results to pods whose resolved status matches any of these values. Includes the five Kubernetes phases plus Tsuga-derived CrashLoopBackOff and Error. Applied after stitching pod phase and container status reason telemetry, because phase is not a filterable metric attribute."}))},Ni=r.Enum(["asc","desc"],{description:"Sort direction. Defaults to ascending."}),jz=["deployment","statefulset","daemonset"],rw=r.Object({kind:r.Enum(jz,{description:"Kind of Kubernetes workload associated with the pod. Derived from workload attributes in pod telemetry."}),name:r.String({description:"Name of the workload associated with the pod. Derived from workload attributes in pod telemetry."})},{description:"Kubernetes workload controller that owns the pod. Present when workload attributes are observed in pod telemetry."}),nw=r.Object({podName:r.String({description:"Name of the Kubernetes pod. Set when the pod is created."}),namespace:r.Optional(r.String({description:"Kubernetes namespace that contains the pod. Present when namespace telemetry is observed."})),cluster:r.Optional(r.String({description:"Kubernetes cluster name that reported the pod. Present when cluster telemetry is observed."})),team:r.Optional(r.String({description:"Team metadata associated with the pod. Present when a team label or mapping is observed."})),env:r.Optional(r.String({description:"Environment metadata associated with the pod, such as production or staging. Present when an environment label or mapping is observed."})),node:r.Optional(r.String({description:"Kubernetes node currently or most recently running the pod. Present when node telemetry is observed."})),phase:r.Enum(tw,{description:"Current or most recently observed pod status. From pod status and container state telemetry. Values include the Kubernetes phases Pending, Running, Succeeded, Failed, and Unknown, plus Tsuga-derived CrashLoopBackOff and Error values."}),readyContainers:r.Integer({description:"Number of containers in the pod that are currently ready. From container readiness telemetry. Zero or greater."}),totalContainers:r.Integer({description:"Number of observed containers for the pod based on container readiness telemetry. Zero or greater."}),restarts:r.Integer({description:"Total restart count across containers in the pod. From container restart telemetry. Zero or greater."}),createdAt:r.Optional(A({description:"Timestamp from pod start time telemetry for the selected pod instance. Present when pod start time telemetry is observed."}))}),_g=r.Object({...nw.properties,workload:r.Optional(rw),cpuUsageMilli:r.Optional(r.Number({description:"Recent pod CPU usage in millicores. Present when CPU usage telemetry is observed."})),cpuLimitMilli:r.Optional(r.Number({description:"Configured pod CPU limit in millicores, summed across observed containers. Present when a CPU limit is configured and observed."})),cpuRequestMilli:r.Optional(r.Number({description:"Configured pod CPU request in millicores, summed across observed containers. Present when a CPU request is configured and observed."})),memoryUsageBytes:r.Optional(r.Number({description:"Recent pod memory usage in bytes. Present when memory usage telemetry is observed."})),memoryLimitBytes:r.Optional(r.Number({description:"Configured pod memory limit in bytes, summed across observed containers. Present when a memory limit is configured and observed."})),memoryRequestBytes:r.Optional(r.Number({description:"Configured pod memory request in bytes, summed across observed containers. Present when a memory request is configured and observed."})),cpuUtilization:r.Optional(r.Number({description:"Recent CPU usage divided by the configured CPU limit. Present when both usage and limit are observed."})),memoryUtilization:r.Optional(r.Number({description:"Recent memory usage divided by the configured memory limit. Present when both usage and limit are observed."})),cpuRequestUtilization:r.Optional(r.Number({description:"Recent CPU usage divided by the configured CPU request. Present when both usage and request are observed."})),memoryRequestUtilization:r.Optional(r.Number({description:"Recent memory usage divided by the configured memory request. Present when both usage and request are observed."}))}),Fz=["podName","namespace","cluster","team","env","node","phase","restarts","cpuUsageMilli","cpuUtilization","cpuRequestUtilization","memoryUsageBytes","memoryUtilization","memoryRequestUtilization","createdAt"],rWe=d({tags:["kubernetes-explorer"],method:"GET",url:`${ar}/pods`,query:r.Object({...$z,sortBy:r.Optional(r.Enum(Fz,{description:"Field to sort pods by."})),sortDirection:r.Optional(Ni)}),paginated:!0,response:r.Array(_g)}),Ig=r.Object({cluster:r.String({description:"Kubernetes cluster name from cluster telemetry."}),teams:r.Optional(r.Array(r.String(),{description:"Team metadata values observed on pods in non-default Kubernetes namespaces on the cluster. Present when team labels or mappings are observed."})),envs:r.Optional(r.Array(r.String(),{description:"Environment metadata values observed on pods in non-default Kubernetes namespaces on the cluster. Present when environment labels or mappings are observed."})),cpuUsageMilli:r.Optional(r.Number({description:"Aggregate recent CPU usage for observed pods in the cluster, excluding default Kubernetes namespaces, in millicores. Present when CPU usage telemetry is observed."})),memoryUsageBytes:r.Optional(r.Number({description:"Aggregate recent memory usage for observed pods in the cluster, excluding default Kubernetes namespaces, in bytes. Present when memory usage telemetry is observed."})),readyNodes:r.Optional(r.Integer({description:"Number of Kubernetes nodes in the cluster that are ready. Present when node readiness telemetry is observed."})),podPhaseCounts:r.Optional(r.Object({Pending:r.Integer({description:"Number of observed pods currently in the Pending phase."}),Running:r.Integer({description:"Number of observed pods currently in the Running phase."}),Succeeded:r.Integer({description:"Number of observed pods currently in the Succeeded phase."}),Failed:r.Integer({description:"Number of observed pods currently in the Failed phase."}),Unknown:r.Integer({description:"Number of observed pods currently in the Unknown phase."})},{description:"Counts of observed pods by Kubernetes phase, excluding default Kubernetes namespaces. Present when pod phase telemetry is observed."}))}),qz=["cluster","teams","envs","cpuUsageMilli","memoryUsageBytes","readyNodes"],nWe=d({tags:["kubernetes-explorer"],method:"GET",url:`${ar}/clusters`,query:r.Object({...XU,teams:xr("Restrict to clusters that host workloads from these team names."),envs:xr("Restrict to clusters that host workloads in these environments."),sortBy:r.Optional(r.Enum(qz,{description:"Field to sort clusters by."})),sortDirection:r.Optional(Ni),...ge}),paginated:!0,response:r.Array(Ig)}),bg=r.Object({namespace:r.String({description:"Kubernetes namespace name from namespace telemetry. Includes namespaces with no observed pods when namespace telemetry is observed."}),cluster:r.Optional(r.String({description:"Kubernetes cluster name that contains the namespace. Present when cluster telemetry is observed."})),teams:r.Optional(r.Array(r.String(),{description:"Team metadata values observed in workloads in the namespace. Present when team labels or mappings are observed."})),envs:r.Optional(r.Array(r.String(),{description:"Environment metadata values observed in workloads in the namespace. Present when environment labels or mappings are observed."})),pods:r.Optional(r.Integer({description:"Number of observed pods in the namespace. Present when pod telemetry is observed."})),cpuUsageMilli:r.Optional(r.Number({description:"Aggregate recent CPU usage for observed pods in the namespace, in millicores. Present when CPU usage telemetry is observed."})),memoryUsageBytes:r.Optional(r.Number({description:"Aggregate recent memory usage for observed pods in the namespace, in bytes. Present when memory usage telemetry is observed."}))}),Bz=["namespace","cluster","teams","envs","pods","cpuUsageMilli","memoryUsageBytes"],oWe=d({tags:["kubernetes-explorer"],method:"GET",url:`${ar}/namespaces`,query:r.Object({...Os,sortBy:r.Optional(r.Enum(Bz,{description:"Field to sort namespaces by."})),sortDirection:r.Optional(Ni)}),paginated:!0,response:r.Array(bg)}),Sg=r.Object({deployment:r.String({description:"Kubernetes Deployment name from workload telemetry."}),namespace:r.Optional(r.String({description:"Kubernetes namespace that contains the Deployment. Present when namespace telemetry is observed."})),cluster:r.Optional(r.String({description:"Kubernetes cluster name that contains the Deployment. Present when cluster telemetry is observed."})),team:r.Optional(r.String({description:"Team metadata associated with the Deployment. Present when a team label or mapping is observed."})),env:r.Optional(r.String({description:"Environment metadata associated with the Deployment. Present when an environment label or mapping is observed."})),pods:r.Optional(r.Integer({description:"Number of observed pods associated with the Deployment. Present when pod telemetry and workload attributes are observed."})),availableReplicas:r.Optional(r.Integer({description:"Number of available Deployment replicas from Deployment status telemetry. Present when deployment status is observed."})),desiredReplicas:r.Optional(r.Integer({description:"Desired replica count configured for the Deployment. Present when Deployment spec telemetry is observed."})),cpuUsageMilli:r.Optional(r.Number({description:"Recent aggregate CPU usage for observed Deployment pods, in millicores. Present when CPU usage telemetry is observed."})),memoryUsageBytes:r.Optional(r.Number({description:"Recent aggregate memory usage for observed Deployment pods, in bytes. Present when memory usage telemetry is observed."}))}),Hz=["deployment","namespace","cluster","team","env","pods","availableReplicas","cpuUsageMilli","memoryUsageBytes"],iWe=d({tags:["kubernetes-explorer"],method:"GET",url:`${ar}/deployments`,query:r.Object({...Os,sortBy:r.Optional(r.Enum(Hz,{description:"Field to sort deployments by."})),sortDirection:r.Optional(Ni)}),paginated:!0,response:r.Array(Sg)}),Ag=r.Object({statefulSet:r.String({description:"Kubernetes StatefulSet name from workload telemetry."}),namespace:r.Optional(r.String({description:"Kubernetes namespace that contains the StatefulSet. Present when namespace telemetry is observed."})),cluster:r.Optional(r.String({description:"Kubernetes cluster name that contains the StatefulSet. Present when cluster telemetry is observed."})),team:r.Optional(r.String({description:"Team metadata associated with the StatefulSet. Present when a team label or mapping is observed."})),env:r.Optional(r.String({description:"Environment metadata associated with the StatefulSet. Present when an environment label or mapping is observed."})),pods:r.Optional(r.Integer({description:"Number of observed pods associated with the StatefulSet. Present when pod telemetry and workload attributes are observed."})),readyReplicas:r.Optional(r.Integer({description:"Number of ready StatefulSet replicas from StatefulSet status telemetry. Present when StatefulSet status is observed."})),desiredReplicas:r.Optional(r.Integer({description:"Desired replica count configured for the StatefulSet. Present when StatefulSet spec telemetry is observed."})),cpuUsageMilli:r.Optional(r.Number({description:"Recent aggregate CPU usage for observed StatefulSet pods, in millicores. Present when CPU usage telemetry is observed."})),memoryUsageBytes:r.Optional(r.Number({description:"Recent aggregate memory usage for observed StatefulSet pods, in bytes. Present when memory usage telemetry is observed."}))}),Kz=["statefulSet","namespace","cluster","team","env","pods","cpuUsageMilli","memoryUsageBytes"],aWe=d({tags:["kubernetes-explorer"],method:"GET",url:`${ar}/statefulsets`,query:r.Object({...Os,sortBy:r.Optional(r.Enum(Kz,{description:"Field to sort StatefulSets by."})),sortDirection:r.Optional(Ni)}),paginated:!0,response:r.Array(Ag)}),Og=r.Object({daemonSet:r.String({description:"Kubernetes DaemonSet name from workload telemetry."}),namespace:r.Optional(r.String({description:"Kubernetes namespace that contains the DaemonSet. Present when namespace telemetry is observed."})),cluster:r.Optional(r.String({description:"Kubernetes cluster name that contains the DaemonSet. Present when cluster telemetry is observed."})),team:r.Optional(r.String({description:"Team metadata associated with the DaemonSet. Present when a team label or mapping is observed."})),env:r.Optional(r.String({description:"Environment metadata associated with the DaemonSet. Present when an environment label or mapping is observed."})),pods:r.Optional(r.Integer({description:"Number of observed pods associated with the DaemonSet. Present when pod telemetry and workload attributes are observed."})),readyNodes:r.Optional(r.Integer({description:"Number of eligible nodes with a ready DaemonSet pod. Present when DaemonSet status telemetry is observed."})),desiredNodes:r.Optional(r.Integer({description:"Number of eligible nodes where the DaemonSet should run a pod. Present when DaemonSet status telemetry is observed."})),cpuUsageMilli:r.Optional(r.Number({description:"Recent aggregate CPU usage for observed DaemonSet pods, in millicores. Present when CPU usage telemetry is observed."})),memoryUsageBytes:r.Optional(r.Number({description:"Recent aggregate memory usage for observed DaemonSet pods, in bytes. Present when memory usage telemetry is observed."}))}),zz=["daemonSet","namespace","cluster","team","env","pods","readyNodes","cpuUsageMilli","memoryUsageBytes"],sWe=d({tags:["kubernetes-explorer"],method:"GET",url:`${ar}/daemonsets`,query:r.Object({...Os,sortBy:r.Optional(r.Enum(zz,{description:"Field to sort DaemonSets by."})),sortDirection:r.Optional(Ni)}),paginated:!0,response:r.Array(Og)}),xg=r.Object({overview:r.Object({...nw.properties,workload:r.Optional(rw)},{description:"Pod identity, status, and owning workload, derived from recent pod metrics."}),healthMetrics:r.Object({cpu:r.Object({usage:r.String({description:"Metric name callers can use to query pod CPU usage. This is not the current CPU value."}),limit:r.String({description:"Metric name callers can use to query configured container CPU limits for the pod. This is not the current CPU limit value."}),request:r.String({description:"Metric name callers can use to query configured container CPU requests for the pod. This is not the current CPU request value."})},{description:"Metric names for pod CPU usage and for configured container CPU limits and requests."}),memory:r.Object({usage:r.String({description:"Metric name callers can use to query pod memory usage. This is not the current memory value."}),limit:r.String({description:"Metric name callers can use to query configured container memory limits for the pod. This is not the current memory limit value."}),request:r.String({description:"Metric name callers can use to query configured container memory requests for the pod. This is not the current memory request value."})},{description:"Metric names for pod memory usage and for configured container memory limits and requests."})},{description:"Metric names callers can use to query pod CPU and memory telemetry. These are fixed metric identifiers, not current values."}),searchFilters:r.Object({logs:r.String({description:"TQL log search filter scoped to this pod. Built from cluster, namespace, and pod identifiers."}),traces:r.String({description:"TQL trace search filter scoped to this pod. Built from cluster, namespace, and pod identifiers."})},{description:"TQL filters scoped to this pod, ready to use as the query for log and trace search."})}),ow=r.Object({clusterId:r.Optional(u({allowEmpty:!1})),k8sCluster:u({allowEmpty:!1}),k8sNamespace:u({allowEmpty:!1}),podName:u({allowEmpty:!1})}),cWe=d({tags:["kubernetes-explorer"],method:"GET",url:`${ar}/pod-details`,query:ow,response:xg}),Rg=r.Object({configuration:r.Optional(r.Object({spec:r.Record(r.String(),r.Unknown(),{description:"Kubernetes PodSpec from the latest observed pod manifest. Fields outside `object.spec` are stripped."}),lastObservedAt:A({description:"Timestamp when Tsuga last observed the pod manifest used for configuration."})},{description:"Pod configuration from the latest observed pod manifest. Present when a pod manifest log is found for the pod."})),labels:r.Record(r.String(),r.String(),{description:"Kubernetes labels on the pod from the latest observed pod manifest. Key-value strings."}),annotations:r.Record(r.String(),r.String(),{description:"Kubernetes annotations on the pod from the latest observed pod manifest. Key-value strings."}),deletedAt:r.Optional(A({description:"Timestamp when Tsuga last observed the pod deletion event. Present when the latest observed pod event is deleted."}))}),pWe=d({tags:["kubernetes-explorer"],method:"GET",url:`${ar}/pod-manifest`,query:ow,response:Rg}),Cg=r.Object({podName:r.String({description:"Name of a pod instance associated with the workload. Resolved from recent pod usage telemetry and workload attributes."}),podUid:r.Optional(r.String({description:"Kubernetes UID for the pod replica. Present when UID telemetry is observed."})),cpuUsageMilli:r.Optional(r.Number({description:"Recent CPU usage for the pod replica, in millicores. Present when CPU usage telemetry is observed."})),memoryUsageBytes:r.Optional(r.Number({description:"Recent memory usage for the pod replica, in bytes. Present when memory usage telemetry is observed."}))},{description:"A single pod instance with recent CPU or memory telemetry for the workload, resolved from pod usage telemetry and workload attributes."}),Pg=r.Object({overview:r.Object({deploymentName:r.String({description:"Kubernetes Deployment name for this detail response."}),namespace:r.Optional(r.String({description:"Kubernetes namespace for this detail response. Present when any deployment signal is found."})),cluster:r.Optional(r.String({description:"Kubernetes cluster name for this detail response. Present when any deployment signal is found."})),team:r.Optional(r.String({description:"Team metadata from the Deployment available-replica metric. Present when the metric includes team metadata."})),env:r.Optional(r.String({description:"Environment metadata from the Deployment available-replica metric. Present when the metric includes environment metadata."})),availableReplicas:r.Optional(r.Integer({description:"Number of available Deployment replicas from Deployment status telemetry. Present when deployment status is observed."})),desiredReplicas:r.Optional(r.Integer({description:"Desired replica count configured for the Deployment. Present when Deployment spec telemetry is observed."})),latestRevisionAt:r.Optional(A({description:"Latest ReplicaSet metadata.creationTimestamp observed for the Deployment. Present when ReplicaSet object telemetry is observed."}))}),podReplicas:r.Array(Cg,{description:"Pod instances with recent CPU or memory telemetry for the Deployment. Tsuga builds this list from pod usage telemetry and workload attributes. Empty when no matching pod usage telemetry is observed."}),revisions:r.Array(r.Object({replicaSetName:r.String({description:"ReplicaSet name for a Deployment revision from workload telemetry."}),revision:r.Integer({description:"Deployment revision number from ReplicaSet annotations. Integer greater than or equal to zero."}),firstSeen:r.Optional(A({description:"ReplicaSet metadata.creationTimestamp from the latest observed ReplicaSet object. Present when creation time is observed."})),observedGeneration:r.Optional(r.Integer({description:"Latest generation observed for the ReplicaSet revision. Present when generation telemetry is observed."})),readyReplicas:r.Optional(r.Integer({description:"Number of ready replicas for the ReplicaSet revision. Present when ReplicaSet status telemetry is observed."})),replicas:r.Optional(r.Integer({description:"Total replica count for the ReplicaSet revision. Present when ReplicaSet status telemetry is observed."})),logsSearchFilter:r.String({description:"TQL log search filter scoped to this ReplicaSet revision. Built from cluster, namespace, and ReplicaSet identifiers."})}),{description:"Deployment rollout revisions from recent ReplicaSet object telemetry. Includes the latest observed event per ReplicaSet, excludes ReplicaSets whose latest observed spec.replicas is 0, and returns up to 8 revisions sorted by revision number descending."})}),uWe=d({tags:["kubernetes-explorer"],method:"GET",url:`${ar}/deployment-details`,query:r.Object({clusterId:r.Optional(u({allowEmpty:!1})),k8sCluster:u({allowEmpty:!1}),k8sNamespace:u({allowEmpty:!1}),deploymentName:u({allowEmpty:!1})}),response:Pg}),Yz=r.Object({overview:r.Object({statefulSetName:r.String(),namespace:r.Optional(r.String()),cluster:r.Optional(r.String()),team:r.Optional(r.String()),env:r.Optional(r.String()),readyReplicas:r.Optional(r.Integer()),desiredReplicas:r.Optional(r.Integer()),latestRevisionAt:r.Optional(A())}),podReplicas:r.Array(Cg,{description:"Pod instances with recent CPU or memory telemetry for the StatefulSet. Tsuga builds this list from pod usage telemetry and workload attributes. Empty when no matching pod usage telemetry is observed."}),revisions:r.Array(r.Object({revisionName:r.String(),firstSeen:r.Optional(A())}))}),lWe=d({tags:["kubernetes-explorer"],method:"GET",url:`${ar}/statefulset-details`,query:r.Object({clusterId:r.Optional(u({allowEmpty:!1})),k8sCluster:u({allowEmpty:!1}),k8sNamespace:u({allowEmpty:!1}),statefulSetName:u({allowEmpty:!1})}),response:Yz}),Vz=r.Object({overview:r.Object({daemonSetName:r.String(),namespace:r.Optional(r.String()),cluster:r.Optional(r.String()),team:r.Optional(r.String()),env:r.Optional(r.String()),readyNodes:r.Optional(r.Integer()),desiredNodes:r.Optional(r.Integer()),latestRevisionAt:r.Optional(A())}),podReplicas:r.Array(Cg,{description:"Pod instances with recent CPU or memory telemetry for the DaemonSet. Tsuga builds this list from pod usage telemetry and workload attributes. Empty when no matching pod usage telemetry is observed."}),revisions:r.Array(r.Object({observedGeneration:r.Integer(),firstSeen:r.Optional(A())}))}),mWe=d({tags:["kubernetes-explorer"],method:"GET",url:`${ar}/daemonset-details`,query:r.Object({clusterId:r.Optional(u({allowEmpty:!1})),k8sCluster:u({allowEmpty:!1}),k8sNamespace:u({allowEmpty:!1}),daemonSetName:u({allowEmpty:!1})}),response:Vz});var Zr=`/${"v1"}/kubernetes-explorer`,iw=r.Pick(_g,["podName","namespace","cluster","team","env","node","phase","readyContainers","totalContainers","restarts","createdAt","workload","cpuUsageMilli","cpuLimitMilli","memoryUsageBytes","memoryLimitBytes","cpuUtilization","memoryUtilization"],{description:"A Kubernetes pod with its current phase, owning workload, and resource usage."}),Qz={podName:"api-gateway-7d9f8c6b5-2xk4p",namespace:"production",cluster:"prod-us-east",team:"platform",env:"production",node:"ip-10-0-1-23.ec2.internal",phase:"Running",readyContainers:1,totalContainers:1,restarts:0,createdAt:"2024-01-15T12:34:56.000Z",workload:{kind:"deployment",name:"api-gateway"},cpuUsageMilli:125,cpuLimitMilli:500,memoryUsageBytes:134217728,memoryLimitBytes:536870912,cpuUtilization:.25,memoryUtilization:.25};Object.assign(iw,{examples:[Qz]});var aw=r.Pick(Ig,["cluster","teams","envs","cpuUsageMilli","memoryUsageBytes","readyNodes","podPhaseCounts"],{description:"A Kubernetes cluster with aggregate resource usage, node readiness, and pod phase counts."}),Wz={cluster:"prod-us-east",teams:["platform","payments"],envs:["production"],cpuUsageMilli:4200,memoryUsageBytes:8589934592,readyNodes:6,podPhaseCounts:{Pending:1,Running:42,Succeeded:3,Failed:0,Unknown:0}};Object.assign(aw,{examples:[Wz]});var sw=r.Pick(bg,["namespace","cluster","teams","envs","pods","cpuUsageMilli","memoryUsageBytes"],{description:"A Kubernetes namespace with pod count and aggregate resource usage."}),Zz={namespace:"production",cluster:"prod-us-east",teams:["platform"],envs:["production"],pods:24,cpuUsageMilli:1800,memoryUsageBytes:3221225472};Object.assign(sw,{examples:[Zz]});var cw=r.Pick(Sg,["deployment","namespace","cluster","team","env","pods","availableReplicas","desiredReplicas","cpuUsageMilli","memoryUsageBytes"],{description:"A Kubernetes deployment with replica counts and aggregate resource usage."}),Xz={deployment:"api-gateway",namespace:"production",cluster:"prod-us-east",team:"platform",env:"production",pods:3,availableReplicas:3,desiredReplicas:3,cpuUsageMilli:375,memoryUsageBytes:402653184};Object.assign(cw,{examples:[Xz]});var pw=r.Pick(Ag,["statefulSet","namespace","cluster","team","env","pods","readyReplicas","desiredReplicas","cpuUsageMilli","memoryUsageBytes"],{description:"A Kubernetes StatefulSet with replica counts and aggregate resource usage."}),Jz={statefulSet:"postgres",namespace:"production",cluster:"prod-us-east",team:"platform",env:"production",pods:3,readyReplicas:3,desiredReplicas:3,cpuUsageMilli:900,memoryUsageBytes:2147483648};Object.assign(pw,{examples:[Jz]});var uw=r.Pick(Og,["daemonSet","namespace","cluster","team","env","pods","readyNodes","desiredNodes","cpuUsageMilli","memoryUsageBytes"],{description:"A Kubernetes DaemonSet with eligible-node readiness and aggregate resource usage."}),e4={daemonSet:"otel-collector",namespace:"observability",cluster:"prod-us-east",team:"platform",env:"production",pods:6,readyNodes:6,desiredNodes:6,cpuUsageMilli:300,memoryUsageBytes:805306368};Object.assign(uw,{examples:[e4]});var lw=r.Pick(xg,["overview","healthMetrics","searchFilters"],{description:"Metrics-derived information for a single Kubernetes pod: status, owning workload, CPU/memory metric identifiers, and log/trace filters."}),t4={overview:{podName:"api-gateway-7d9f8c6b5-2xk4p",namespace:"production",cluster:"prod-us-east",team:"platform",env:"production",node:"ip-10-0-1-23.ec2.internal",phase:"Running",readyContainers:1,totalContainers:1,restarts:0,createdAt:"2024-01-15T12:34:56.000Z",workload:{kind:"deployment",name:"api-gateway"}},healthMetrics:{cpu:{usage:"k8s.pod.cpu.usage",limit:"k8s.container.cpu_limit",request:"k8s.container.cpu_request"},memory:{usage:"k8s.pod.memory.usage",limit:"k8s.container.memory_limit",request:"k8s.container.memory_request"}},searchFilters:{logs:'context.k8s.cluster.name:"prod-us-east" AND context.k8s.namespace.name:"production" AND context.k8s.pod.name:"api-gateway-7d9f8c6b5-2xk4p"',traces:'context.k8s.cluster.name:"prod-us-east" AND context.k8s.namespace.name:"production" AND context.k8s.pod.name:"api-gateway-7d9f8c6b5-2xk4p"'}};Object.assign(lw,{examples:[t4]});var mw=r.Pick(Rg,["configuration","labels","annotations","deletedAt"],{description:"Manifest-derived details for a single Kubernetes pod: the pod manifest spec, labels, and annotations from the pod's most recently observed manifest."}),r4={configuration:{spec:{restartPolicy:"Always",serviceAccountName:"api-gateway"},lastObservedAt:"2024-01-15T12:30:00.000Z"},labels:{app:"api-gateway","pod-template-hash":"7d9f8c6b5"},annotations:{"prometheus.io/scrape":"true"}};Object.assign(mw,{examples:[r4]});var dw=r.Pick(Pg,["overview","podReplicas","revisions"],{description:"Detailed information for a single Kubernetes deployment: replica status, backing pods, and rollout revisions."}),n4={overview:{deploymentName:"api-gateway",namespace:"production",cluster:"prod-us-east",team:"platform",env:"production",availableReplicas:3,desiredReplicas:3,latestRevisionAt:"2024-01-15T12:00:00.000Z"},podReplicas:[{podName:"api-gateway-7d9f8c6b5-2xk4p",podUid:"a1b2c3d4-e5f6-7890-abcd-ef1234567890",cpuUsageMilli:125,memoryUsageBytes:134217728}],revisions:[{replicaSetName:"api-gateway-7d9f8c6b5",revision:7,firstSeen:"2024-01-15T12:00:00.000Z",observedGeneration:7,readyReplicas:3,replicas:3,logsSearchFilter:'context.k8s.cluster.name:"prod-us-east" context.k8s.namespace.name:"production" context.k8s.replicaset.name:"api-gateway-7d9f8c6b5"'}]};Object.assign(dw,{examples:[n4]});var fw=r.Object({clusterId:r.Optional(u({allowEmpty:!1,description:"Tsuga cluster ID to target. Tsuga assigns it when a cluster is connected to the organization. Optional for single-cluster organizations and required for organizations with multiple clusters to scope the request to one cluster."}))}),xs=r.Pick(JU,["clusterId","search"]),o4=r.Pick(ew,["clusterId","search"]),gw=d({description:"Lists Kubernetes pods observed across the organization with their current phase, owning workload, and resource usage.",operationId:"listKubernetesPods",tags:["public","kubernetes-explorer"],method:"GET",url:`${Zr}/pods`,query:xs,response:r.Array(iw)}),hw=d({description:"Lists Kubernetes clusters observed across the organization with aggregate resource usage, node readiness, and pod phase counts.",operationId:"listKubernetesClusters",tags:["public","kubernetes-explorer"],method:"GET",url:`${Zr}/clusters`,query:o4,response:r.Array(aw)}),yw=d({description:"Lists Kubernetes namespaces observed across the organization with pod counts and aggregate resource usage.",operationId:"listKubernetesNamespaces",tags:["public","kubernetes-explorer"],method:"GET",url:`${Zr}/namespaces`,query:xs,response:r.Array(sw)}),Tw=d({description:"Lists Kubernetes deployments observed across the organization with replica counts and aggregate resource usage.",operationId:"listKubernetesDeployments",tags:["public","kubernetes-explorer"],method:"GET",url:`${Zr}/deployments`,query:xs,response:r.Array(cw)}),Ew=d({description:"Lists Kubernetes StatefulSets observed across the organization with replica counts and aggregate resource usage.",operationId:"listKubernetesStatefulSets",tags:["public","kubernetes-explorer"],method:"GET",url:`${Zr}/statefulsets`,query:xs,response:r.Array(pw)}),_w=d({description:"Lists Kubernetes DaemonSets observed across the organization with eligible-node readiness and aggregate resource usage.",operationId:"listKubernetesDaemonSets",tags:["public","kubernetes-explorer"],method:"GET",url:`${Zr}/daemonsets`,query:xs,response:r.Array(uw)}),Iw=r.Object({...fw.properties,k8sCluster:u({allowEmpty:!1,description:"Kubernetes cluster name that contains the pod. From cluster telemetry. Required to identify the pod because pod names are only unique within a namespace and cluster."}),k8sNamespace:u({allowEmpty:!1,description:"Kubernetes namespace that contains the pod. From pod metadata. Required to identify the pod because pod names are only unique within a namespace and cluster."}),podName:u({allowEmpty:!1,description:"Kubernetes pod name to retrieve. Set when the pod is created. Required to fetch pod details for the selected cluster and namespace."})}),bw=d({description:"Retrieves metrics-derived information for a single Kubernetes pod: status, owning workload, CPU/memory metric identifiers, and ready-to-use log and trace filters. Manifest configuration, labels, and annotations are served by the pod-manifest endpoint.",operationId:"getKubernetesPodDetails",tags:["public","kubernetes-explorer"],method:"GET",url:`${Zr}/pod-details`,query:Iw,response:lw}),Sw=d({description:"Retrieves the manifest-derived details for a single Kubernetes pod: the pod manifest spec, labels, and annotations from the pod's most recently observed manifest.",operationId:"getKubernetesPodManifest",tags:["public","kubernetes-explorer"],method:"GET",url:`${Zr}/pod-manifest`,query:Iw,response:mw}),Aw=d({description:"Retrieves detailed information for a single Kubernetes deployment: replica status, backing pods, and rollout revisions with ready-to-use log filters.",operationId:"getKubernetesDeploymentDetails",tags:["public","kubernetes-explorer"],method:"GET",url:`${Zr}/deployment-details`,query:r.Object({...fw.properties,k8sCluster:u({allowEmpty:!1,description:"Kubernetes cluster name that contains the Deployment. From cluster telemetry. Required to identify the Deployment because names are only unique within a namespace and cluster."}),k8sNamespace:u({allowEmpty:!1,description:"Kubernetes namespace that contains the Deployment. From workload metadata. Required to identify the Deployment because names are only unique within a namespace and cluster."}),deploymentName:u({allowEmpty:!1,description:"Kubernetes Deployment name to retrieve. From workload telemetry. Required to fetch deployment details for the selected cluster and namespace."})}),response:dw});var i4="clusterId";function Ow(e,t,n){let o=t.query.properties??{},i=Object.keys(o).filter(a=>a!==i4);for(let a of i){let c=a.replace(/([A-Z])/g,"-$1").toLowerCase(),l=c.replace(/-/g,"_").toUpperCase(),m=o[a]?.description??"";n?e.requiredOption(`--${c} <${l}>`,m):e.option(`--${c} <${l}>`,m)}return i}function Li(e,t,n,o){let i=e.command(t).description(n.description??`List Kubernetes ${t}`),a=Ow(i,n,!1);i.action(async c=>{let l={};for(let m of a)c[m]!==void 0&&(l[m]=c[m]);ee(Object.keys(l).length>0?await o()(n,{query:l}):await o()(n))})}function Ug(e,t,n,o){let i=e.command(t).description(n.description??`Get Kubernetes ${t}`),a=Ow(i,n,!0);i.action(async c=>{let l={};for(let m of a)l[m]=c[m];ee(await o()(n,{query:l}))})}function xw(e,t){let n=e.command("kubernetes").description("Explore Kubernetes resources observed across the organization");Li(n,"pods",gw,t),Li(n,"clusters",hw,t),Li(n,"namespaces",yw,t),Li(n,"deployments",Tw,t),Li(n,"statefulsets",Ew,t),Li(n,"daemonsets",_w,t),Ug(n,"pod-details",bw,t),Ug(n,"pod-manifest",Sw,t),Ug(n,"deployment-details",Aw,t)}var a4=r.Union([r.Literal("scalar"),r.Literal("timeseries")]),s4="/v0/promql",Wu=r.Object({query:u({type:"long",allowEmpty:!1,description:"PromQL expression to evaluate."}),timeRange:si,step:u({allowEmpty:!1,description:"Evaluation step interval (e.g. `1m`, `5m`, `1h`). Must be a valid Prometheus duration string."}),returnType:r.Optional(a4),executionOptions:gd,shouldStreamResults:r.Optional(r.Boolean()),clusterId:r.Optional(u({allowEmpty:!1,description:"Cluster to target. Defaults to the first cluster created in the organization when omitted."}))}),c4={query:'rate({"otel.trace.span_processor.spans"}[5m])',timeRange:{from:17822015e5,to:17822034e5},step:"1m",executionOptions:{parallelism:1,engine:"q"},clusterId:"cluster-abc"};Object.assign(Wu,{examples:[c4]});var PWe=d({tags:["promql"],url:s4,method:"POST",body:Wu,response:Qp});var Rw=`/${"v1"}/aggregation`,Cw=r.Object({id:r.String({description:"Result identifier. Query results use `q1`, `q2`, and so on; formula results use `formula`."}),group:r.Record(r.String(),r.Union([r.String(),r.Number()]),{description:"Group-by field values for this result. Empty when no group-by is requested."})}),Pw=r.Object({results:r.Array(r.Object({...Cw.properties,value:r.Number({description:"Aggregated value for this query or formula and group, over the full time range."})},{title:"ScalarResult"}),{description:"One aggregated value per query or formula and group."})},{$id:"ScalarAggregationResponse",title:"ScalarAggregationResponse",description:"Scalar aggregation response with one value per query or formula and group."}),p4={results:[{id:"q1",group:{host:"server-1"},value:123.45}]};Object.assign(Pw,{examples:[p4]});var Zu=r.Object({series:r.Array(r.Object({...Cw.properties,points:r.Array(r.Object({timestamp:r.Integer({description:"Unix timestamp in milliseconds for this point, spaced by `aggregationWindow`."}),value:r.Number({description:"Aggregated value at this timestamp."})}),{description:"Ordered data points for this query or formula and group."})},{title:"Series"}),{description:"One time series per query or formula and group."})},{$id:"TimeseriesAggregationResponse",title:"TimeseriesAggregationResponse",description:"Timeseries aggregation response with timestamped points over time."}),u4={series:[{id:"q1",group:{host:"server-1"},points:[{timestamp:16094592e5,value:123.45},{timestamp:160945926e4,value:456.78}]}]};Object.assign(Zu,{examples:[u4]});var l4=r.Omit(rs.items,["fill"],{title:"AggregationQuery",description:"Aggregation query. Omit `filter` for an unfiltered query and omit `functions` when no post-processing is needed."}),m4=r.Optional(Fr),Uw={timeRange:bt,queries:r.Array(l4,{maxItems:ts,description:`Aggregations that may be combined together in the same query. Each item is referenced from \`formula\` as q1, q2, and so on, in submission order. Limited to ${ts} items. For dataSource "metrics", each aggregate's \`field\` is the metric name, not an attribute; to count distinct values of an attribute use unique-count with field "<metricName>.context.<attribute>" (e.g. "system.cpu.utilization.context.host.name").`}),groupBy:m4,dataSource:ix,formula:r.Optional(so)},ww=r.Object({clusterId:r.Optional(u({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))}),vw=r.Object(Uw,{description:"Scalar aggregation request. Provide a time range, one or more queries, a telemetry data source, and optional grouping or formula. Omit `groupBy` for ungrouped results. Send `clusterId` as a query parameter, not in the JSON body."}),d4={timeRange:{from:1782201500,to:1782203400},dataSource:"logs",queries:[{aggregate:{type:"count"},filter:"context.service.name:checkout"}],groupBy:[{fields:["level"],limit:5}]};Object.assign(vw,{examples:[d4]});var Nw=d({description:"Runs one or more aggregation queries over logs, metrics, or traces and returns scalar values. Use optional group-by and formula fields to compute grouped or derived results. See [Analytics queries](/documentation/visualize/analytics/queries).",operationId:"aggregateScalar",tags:["public","aggregation"],url:`${Rw}/multi-query/scalar`,method:"POST",body:vw,query:ww,response:Pw}),Lw=r.Object({...Uw,aggregationWindow:u({description:"Time bucket size for timeseries aggregation, such as `10s`, `1m`, or `1h`."})},{description:"Timeseries aggregation request. Provide a time range, bucket size, one or more queries, a telemetry data source, and optional grouping or formula. Omit `groupBy` for ungrouped series. Send `clusterId` as a query parameter, not in the JSON body."}),f4={timeRange:{from:1782201500,to:1782203400},aggregationWindow:"1m",dataSource:"logs",queries:[{aggregate:{type:"count"},filter:"context.service.name:checkout"}],groupBy:[{fields:["level"],limit:5}]};Object.assign(Lw,{examples:[f4]});var kw=d({description:"Runs one or more aggregation queries over logs, metrics, or traces and returns timestamped series. Use `aggregationWindow` to choose the time bucket size. See [Analytics queries](/documentation/visualize/analytics/queries).",operationId:"aggregateTimeseries",tags:["public","aggregation"],url:`${Rw}/multi-query/timeseries`,method:"POST",body:Lw,query:ww,response:Zu});var g4=`/${"v1"}/promql`,h4=r.Object({...r.Pick(Wu,["query","step"]).properties,timeRange:bt},{description:"PromQL range-query request. Send clusterId as a query parameter, not in this JSON body.",examples:[{query:'sum by ("context.service.name") (sum_over_time({"traces.span.metrics.calls", "span.kind"="SPAN_KIND_SERVER"}[5m]))',timeRange:{from:1782201500,to:1782203400},step:"1m"}]}),y4=r.Object({clusterId:r.Optional(u({allowEmpty:!1,description:"Telemetry cluster to query. Set by the client as the clusterId query parameter, not in the JSON body. Required when the organization has multiple clusters; omit only for single-cluster organizations. Unknown cluster IDs return 404."}))}),Mw=d({description:"Runs a PromQL range query over Tsuga metric data and returns timeseries results. Authenticate with a bearer operation API key or OAuth access token that can read metrics. Send clusterId as a query parameter; multi-cluster organizations must provide it. See [How to write PromQL queries](/documentation/visualize/guides/how-to-write-promql-queries) for query syntax and examples.",operationId:"queryPromql",tags:["public","promql"],url:g4,method:"POST",body:h4,query:y4,response:Zu});function Dw(e,t){let n=e.command("promql").description("Run PromQL queries over metric data");Wr(n,"query","Run a PromQL range query over metric data",Mw,t)}var Mi="/v0/dashboard-folders",Di=r.Object({id:r.String({description:"Tsuga-generated dashboard folder ID assigned when the folder is created. Use it as dashboard `folderId` or child-folder `parentFolderId`."}),name:r.String({description:"Display name of the dashboard folder. Set by the caller on create or update."}),owner:r.String({description:"ID of the team that owns the dashboard folder. Set by the caller on create or update and used for folder access control."}),parentFolderId:r.Optional(r.String({description:"ID of the top-level parent folder when this folder is nested. Set by the caller on create or update. Returned only for child folders; omitted for top-level folders."})),tags:De,creator:r.Optional(pe),updater:r.Optional(pe),createdAt:A(),updatedAt:A()},{title:"DashboardFolder"}),wg=r.Object({...Di.properties,dashboardCount:r.Number({description:"Number of dashboards directly assigned to this folder that the caller can read. Returned only by folder list responses; callers without dashboard read access see 0."})}),Xu=r.Object({name:u({allowEmpty:!1,description:"Display name of the dashboard folder. Required and non-empty."}),owner:u({allowEmpty:!1,description:"ID of the team that owns the dashboard folder. Required and used for folder access control."}),parentFolderId:r.Optional(r.Union([r.Null(),u({allowEmpty:!1})],{description:"ID of the top-level folder to nest this folder under. Omit on create or pass null to create a top-level folder; omit on update to keep the current parent; pass null on update to move the folder to top level. Non-null values must name a readable top-level folder. Folders can be nested at most two levels deep."})),tags:Xe}),Ju=r.Partial(r.Object({owners:_e(u({allowEmpty:!1}),{description:"Restrict results to dashboard folders owned by any of these team IDs",maxItems:50}),searchQuery:r.Object({value:u({allowEmpty:!1,description:"Substring matched case-insensitively against dashboard folder names or folder IDs. Omit the whole `searchQuery` filter to skip text filtering."}),exclude:r.Optional(r.Boolean({description:"If true, exclude dashboard folders matching this value instead of including them"}))},{description:"Text filter for dashboard folder names or IDs. Optional; `exclude: true` returns folders whose name and ID do not match the substring."}),tags:_e(Bt.items,{description:"Restrict results to dashboard folders that have at least one of the listed key/value tags",maxItems:50}),parentFolderId:r.Union([r.Null(),u({allowEmpty:!1})],{description:"Parent folder filter for dashboard folder query results. Optional; pass a folder ID to return the child folders nested directly under it, or null to return only top-level folders. Omit to return all folders."})},{description:"Optional filters applied to narrow the returned dashboard folders"})),ki={IS_FAVORITE:"isFavorite",OWNER:"owner",TAGS:"tags",DASHBOARD_COUNT:"dashboardCount",UPDATED_AT:"updatedAt",NAME:"name"},vg=[ki.OWNER,ki.TAGS,ki.DASHBOARD_COUNT,ki.UPDATED_AT,ki.NAME],T4=r.Partial(r.Object({...ge,filters:Ju,sort:r.Object({by:r.Enum([...vg,ki.IS_FAVORITE],{description:"Field to sort the returned dashboard folders by"}),direction:r.Enum(["asc","desc"],{description:"Sort direction: ascending or descending"})},{description:"Optional sorting applied to the returned dashboard folders"})})),t7e=d({tags:["dashboard-folders"],url:`${Mi}/query`,method:"POST",paginated:!0,body:T4,response:r.Array(wg)}),r7e=d({tags:["dashboard-folders"],url:`${Mi}/:id`,method:"GET",params:r.Object({id:u()}),response:Di}),n7e=d({tags:["dashboard-folders"],url:Mi,method:"POST",body:Xu,response:Di}),o7e=d({tags:["dashboard-folders"],url:`${Mi}/:id`,method:"PUT",params:r.Object({id:u()}),body:Xu,response:Di}),i7e=d({tags:["dashboard-folders"],url:`${Mi}/:id`,method:"DELETE",params:r.Object({id:u()}),response:N}),a7e=d({tags:["dashboard-folders"],url:`${Mi}/tags/query`,method:"POST",body:r.Object({filters:r.Optional(r.Omit(Ju,["tags"]))}),response:qt});var Rs=`/${"v1"}/dashboard-folders`,el=r.Pick(Di,["id","name","owner","parentFolderId","tags"],{$id:"DashboardFolder",description:"Folder used to organize dashboards into a two-level hierarchy"}),Gw={id:"123-456-abc",name:"Platform",owner:"team-123-abc",tags:[{key:"team",value:"platform"}]};Object.assign(el,{examples:[Gw]});var $w=r.Pick(wg,["id","name","owner","parentFolderId","tags","dashboardCount"],{$id:"DashboardFolderWithDashboardCount",description:"Folder used to organize dashboards into a two-level hierarchy, including the number of readable dashboards it directly contains."}),E4={...Gw,dashboardCount:10};Object.assign($w,{examples:[E4]});var Ng=r.Pick(Xu,["name","owner","parentFolderId","tags"],{description:"Dashboard folder create or update request. Provide a name, owner team, optional parent folder, and optional tags."}),_4={name:"Platform",owner:"team-123-abc",parentFolderId:null,tags:[{key:"team",value:"platform"}]};Object.assign(Ng,{examples:[_4]});var I4=r.Object({by:r.Enum(vg,{description:"Field to sort the returned dashboard folders by: `owner` sorts by owning team name, `tags` sorts by tag key/value pairs, `dashboardCount` sorts by the number of readable dashboards directly in the folder, `updatedAt` sorts by last-updated timestamp, and `name` sorts alphabetically by folder name."}),direction:r.Enum(["asc","desc"],{description:"Sort direction: ascending or descending"})},{description:"Optional sorting applied to the returned dashboard folders"}),jw=r.Object({...Ze,filters:r.Optional(r.Pick(Ju,["owners","searchQuery","tags","parentFolderId"])),sort:r.Optional(I4)},{description:"Dashboard folder query request. Use filters, sorting, limit, and offset to page through visible dashboard folders."}),b4={filters:{owners:{values:["team-123-abc"]},searchQuery:{value:"Platform"},tags:{values:[{key:"team",value:"platform"}]}},sort:{by:"name",direction:"asc"},limit:10,offset:0};Object.assign(jw,{examples:[b4]});var Fw=d({description:"Queries dashboard folders visible to the authenticated operation key. Returns all folders unless the `parentFolderId` filter is set: pass a folder ID to select the children of that folder, or null to return only top-level folders. Results are ordered by most recently updated folder first unless `sort` is set, and include the number of readable dashboards directly assigned to each folder. Use filters to narrow by owning team, name or ID substring, or tags.",operationId:"queryDashboardFolders",tags:["dashboard-folders"],url:`${Rs}/query`,method:"POST",paginated:!0,body:jw,response:r.Array($w)}),qw=d({description:"Retrieves one dashboard folder by ID.",operationId:"getDashboardFolder",tags:["dashboard-folders"],url:`${Rs}/:id`,method:"GET",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the dashboard folder to retrieve. Use the `id` returned by folder list, get, create, or update responses."})}),response:el}),Bw=d({description:"Creates a dashboard folder owned by the specified team. To create a child folder, set `parentFolderId` to a readable top-level folder.",operationId:"createDashboardFolder",tags:["dashboard-folders"],url:Rs,method:"POST",body:Ng,response:el}),Hw=d({description:"Updates an existing dashboard folder by ID. Send the folder name, owner, tags, and parent relationship; omit `parentFolderId` to keep the current parent or send null to move the folder to top level.",operationId:"updateDashboardFolder",tags:["dashboard-folders"],url:`${Rs}/:id`,method:"PUT",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the dashboard folder to update. Use the `id` returned by folder list, get, create, or update responses."})}),body:Ng,response:el}),Kw=d({description:"Deletes an empty dashboard folder by ID. The request fails if the folder still contains dashboards or child folders; dashboards and child folders are not moved or deleted automatically.",operationId:"deleteDashboardFolder",tags:["dashboard-folders"],url:`${Rs}/:id`,method:"DELETE",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the dashboard folder to delete. Use the `id` returned by folder list, get, create, or update responses."})}),response:N});var Rr="/v0/dashboards",Yw=["white","gray.100","amber.200","lime.200","emerald.200","cyan.200","blue.200","violet.200","fuchsia.200","pink.200","red.200"],S4=["bar","distribution","gauge","heatmap","list","pie","query-value","table","timeseries","top-list"],x7e=[...S4,"note"];var A4=["ns","us","ms","s","m","h","days"];var O4=["B","KB","MB","GB","TB","PB"];var x4=20;var Vw=r.Object({type:r.Literal("cpu",{description:"Normalizes values as CPU usage"})},{$id:"DataNormalizerCpu",title:"CPU"}),Qw=r.Object({type:r.Literal("duration",{description:"Normalizes values as durations using standard time units"}),unit:r.Enum(A4,{description:"Time unit used to present the normalized values"})},{$id:"DataNormalizerDuration",title:"Duration"}),Ww=r.Object({type:r.Literal("data",{description:"Normalizes values as data sizes using byte units"}),unit:r.Enum(O4,{description:"Data size unit used to present the normalized values"})},{$id:"DataNormalizerData",title:"Data"}),Zw=r.Object({type:r.Literal("percent",{description:"Formats numeric values as percentages. Use it when the raw value is already on a 0-100 scale, for example `25` to display `25%`."})},{$id:"DataNormalizerPercent",title:"Percent"}),Xw=r.Object({type:r.Literal("percent-fraction",{description:"Formats numeric values as percentages. Use it when the raw value is a 0-1 fraction; Tsuga multiplies the value by 100 for display, for example `0.2` to display `20%`."})},{$id:"DataNormalizerPercentFraction",title:"Percent Fraction"}),Jw=r.Object({type:r.Literal("date",{description:"Formats values as calendar dates"})},{$id:"DataNormalizerDate",title:"Date"}),ev=r.Object({type:r.Literal("level",{description:"Displays values using their log level name"})},{$id:"DataNormalizerLevel",title:"Level"}),tv=r.Object({type:r.Literal("none",{description:"Displays raw values without a unit. Records an explicit removal of the unit, so it is not re-derived from metric metadata"})},{$id:"DataNormalizerNone",title:"None"}),R4=r.Object({type:r.Literal("custom",{description:"Normalizes values using a custom unit label"}),unit:r.String({description:"Text label describing the custom unit"})},{$id:"DataNormalizerCustom",title:"Custom"}),C4=r.Object({type:r.Literal("custom",{description:"Normalizes values using a custom unit label"}),unit:r.String({description:"Text label describing the custom unit. Must not be empty.",minLength:1,maxLength:x4})},{$id:"InputDataNormalizerCustom",title:"Custom"}),Rt=C("type",[Qw,Ww,Zw,Xw,Jw,ev,Vw,tv,R4],{title:"Normalizer",description:"Display-value formatter for widget values or list/table columns."}),Ct=C("type",[Qw,Ww,Zw,Xw,Jw,ev,Vw,tv,C4],{title:"Normalizer",description:"Display-value formatter for widget values or list/table columns."}),Lg=r.Object({attribute:r.String({description:"Attribute (log field or database row column) displayed as a column in the list"}),normalizer:r.Optional(Rt)},{title:"WidgetListColumn",description:"List column pairing a displayed attribute with the formatting applied to its values."}),kg=r.Object({attribute:r.String({description:"Attribute (log field or database row column) displayed as a column in the list"}),normalizer:r.Optional(Ct)},{title:"WidgetListColumn",description:"List column pairing a displayed attribute with the formatting applied to its values."}),Gi=["background","no-background"],P4=["table","legend-only","no-legend"];var U4=["greater_than","less_than","equal","not_equal","greater_than_or_equal","less_than_or_equal"],rv=["alert","warning","success"],Cr=r.Object({operator:r.Enum(U4,{description:"Comparator used to evaluate the metric value"}),value:r.Number({description:"Threshold value used when evaluating the operator"}),color:r.Enum(rv,{description:"Color applied when the condition is met"})},{title:"ConditionalFormatting",description:"Color rule evaluated against the displayed value. The first matching rule in the array is applied."}),w4=r.Object({value:r.Number({description:"Y-axis value where the threshold marker is placed"}),level:r.Enum(rv,{description:"Level applied to the threshold marker"})},{title:"ThresholdMarker",description:"Marker line drawn across the chart at a fixed value, colored by its level."}),v4=["sec","min","hour","day"],wn=r.Object({time:r.Number({description:"Numeric count of `metric` units in each bucket. Required when `timeBucket` is present."}),metric:r.Enum(v4,{description:"Unit used to measure the bucket width"})},{description:"Time bucket width for time-based chart widgets. Optional; when present, `time` and `metric` together define the bucket width."});var Un=r.Enum(["flex-start","center","flex-end"],{description:"Flex alignment keyword used for widget layout"}),$i=r.Object({formula:r.Optional(r.String({description:"Optional alias for formula (only used for display in the UI)"})),queries:r.Optional(r.Record(r.String(),r.String({description:'Display name for this query series in the legend, keyed by the zero-based query index as a string ("0" = first query, "1" = second, and so on). This differs from `formula`, which references queries as "q1", "q2". Omit to fall back to an auto-generated label like "Count on <filter>".'}),{description:"Display names for individual query series, keyed by the zero-based query index as a string."}))},{description:"Display names used for the formula series and the individual query series instead of auto-generated labels."}),ji=r.Object({formula:r.Optional(u({type:"short",description:"Optional alias for formula (only used for display in the UI)"})),queries:r.Optional(r.Record(r.String(),u({type:"short",description:'Display name for this query series in the legend, keyed by the zero-based query index as a string ("0" = first query, "1" = second, and so on). This differs from `formula`, which references queries as "q1", "q2". Omit to fall back to an auto-generated label like "Count on <filter>".'}),{description:"Display names for individual query series, keyed by the zero-based query index as a string."}))},{description:"Display names used for the formula series and the individual query series instead of auto-generated labels."}),rl={source:or,queries:Ex,formula:r.Optional(Jp),aliases:r.Optional($i),visibleSeries:r.Optional(r.Array(r.Boolean(),{description:"Flags indicating whether each query or formula series is visible"}))},nl={source:or,queries:rs,formula:r.Optional(so),aliases:r.Optional(ji),visibleSeries:r.Optional(r.Array(r.Boolean(),{description:"Flags indicating whether each query or formula series is visible"}))},Pr=r.Optional(r.Enum(["relative","absolute"],{description:"Whether each group holds its own value or its percentage of the ungrouped total (defaults to absolute)"})),Fi={...rl,groupBy:r.Optional(ci)},qi={...nl,groupBy:r.Optional(Fr)},qe=r.Enum(P4,{description:"Controls whether and how the widget displays legend or series details (e.g. table, legend-only, or no legend)"}),ye=r.Optional(r.Union([r.Number(),r.Literal("max")],{description:"Display precision for numeric labels, tooltips, tables, and scalar values. Use a number of decimal places to round displayed values, or `max` to display the full submitted precision."})),Xt=r.Optional(r.Array(w4,{description:"Threshold markers displayed on the chart"})),N4=r.Object({name:r.String({description:"Display name of the table column"}),...rl,source:or,normalizer:r.Optional(Rt),precision:ye},{title:"TableColumn",description:"Table column backed by its own aggregation. `defaultSorting` and `columnSizes` reference it as `col-<index>`, using its zero-based position in `columns`."}),L4=r.Object({name:u({description:"Display name of the table column"}),...nl,source:or,normalizer:r.Optional(Ct),precision:ye},{title:"TableColumn",description:"Table column backed by its own aggregation. `defaultSorting` and `columnSizes` reference it as `col-<index>`, using its zero-based position in `columns`."}),k4=r.Array(r.Object({id:r.String({description:"ID of the column to sort by"}),desc:r.Boolean({description:"Whether the sort is descending"})},{title:"TableDefaultSorting"}),{description:"Default sorting applied to a table widget. Column IDs are `label` for the grouping column and `col-<index>` for each entry in `columns`. Users can still change sorting by selecting columns in the rendered table."}),M4=r.Array(r.Object({id:u({description:"ID of the column to sort by"}),desc:r.Boolean({description:"Whether the sort is descending"})},{title:"TableDefaultSorting"}),{description:"Default sorting applied to a table widget. Column IDs are `label` for the grouping column and `col-<index>` for each entry in `columns`. Users can still change sorting by selecting columns in the rendered table."}),Mg=r.Array(r.Object({id:r.String({description:"Column attribute used for the default list sort. It matches an attribute in `listColumns` or a built-in list column for the selected list source."}),desc:r.Boolean({description:"Sort direction for the default list sort. `true` sorts descending; `false` sorts ascending."})},{title:"ListDefaultSorting"}),{description:"Default sorting applied to a list widget. Applies to log, span, or connection list widgets. Users can still change sorting by selecting columns in the rendered list."}),Dg=r.Array(r.Object({id:u({description:"Column attribute used for the default list sort. Set this to an attribute in `listColumns` or a built-in list column for the selected list source."}),desc:r.Boolean({description:"Sort direction for the default list sort. Set `true` for descending order or `false` for ascending order."})},{title:"ListDefaultSorting"}),{description:"Default sorting applied to a list widget. Optional on create or update for log, span, or connection list widgets. Users can still change sorting by selecting columns in the rendered list."}),nv=["horizontal","vertical"],D4=r.Object({type:r.Literal("list",{description:"Displays matching logs in a tabular list"}),query:r.String({description:"Query that selects logs for the list"}),listColumns:r.Optional(r.Array(Lg,{description:"Custom columns to display for each log"})),listColumnsSize:r.Optional(r.Record(r.String(),r.Number({description:"List column width by column id"}),{description:"List column widths in pixels, keyed by the `attribute` of the matching `listColumns` entry. Columns without an entry keep their default width."})),isCellWrapped:r.Optional(r.Boolean({description:"Whether list widget cell text wraps instead of truncating. Applies to list widgets."})),defaultSorting:r.Optional(Mg)},{$id:"GraphVisualizationList",title:"List"}),G4=r.Object({type:r.Literal("list",{description:"Displays matching logs in a tabular list"}),query:u({type:"tsuga-query",description:"Query that selects logs for the list"}),listColumns:r.Optional(r.Array(kg,{description:"Custom columns to display for each log"})),listColumnsSize:r.Optional(r.Record(r.String(),r.Number({description:"List column width by column id"}),{description:"List column widths in pixels, keyed by the `attribute` of the matching `listColumns` entry. Columns without an entry keep their default width."})),isCellWrapped:r.Optional(r.Boolean({description:"Whether list widget cell text wraps instead of truncating. Applies to list widgets. Optional; omit or set false to use truncated cells."})),defaultSorting:r.Optional(Dg)},{$id:"InputGraphVisualizationList",title:"List"}),tl=C("type",[r.Object({type:r.Literal("auto",{description:"Automatically choose this axis bound"})}),r.Object({type:r.Literal("number",{description:"Use a fixed numeric axis bound"}),value:r.Number({description:"Fixed numeric axis bound value"})})],{description:"Axis bound mode: automatic or fixed numeric value"}),Bi=r.Object({min:tl,max:tl,scale:C("type",[r.Object({type:r.Literal("pow",{description:"Power scale"}),exponent:r.Number({description:"Exponent used by the power scale"})}),r.Object({type:r.Enum(["linear","log","sqrt"],{description:"Built-in axis scale"})})],{description:"Y-axis scale mode"}),alwaysIncludeZero:r.Boolean({description:"Whether the rendered Y axis should always include zero"})},{description:"Y-axis bounds and scale configuration for chart widgets."}),Hi=r.Object({min:tl,max:tl,scale:C("type",[r.Object({type:r.Literal("pow",{description:"Power scale"}),exponent:r.Number({minimum:0,description:"Exponent used by the power scale"})}),r.Object({type:r.Enum(["linear","log","sqrt"],{description:"Built-in axis scale"})})],{description:"Y-axis scale mode"}),alwaysIncludeZero:r.Boolean({description:"Whether the rendered Y axis should always include zero"})},{description:"Y-axis bounds and scale configuration for chart widgets. Optional on create or update."}),$4=r.Array(r.Integer({description:"Marker value expressed as a percentage between 0 and 100"}),{description:"Percentile markers displayed on top of the distribution chart"}),j4=r.Array(r.Integer({minimum:0,maximum:100,description:"Marker value expressed as a percentage between 0 and 100"}),{description:"Percentile markers displayed on top of the distribution chart"});var F4=r.Object({type:r.Literal("timeseries-connection",{description:"Displays the database rows-based aggregation as a time series chart"}),connectionId:r.String({description:"The ID of the connection to use to query the datastore."}),queries:r.Array(r.String({description:"The read-only SQL query to execute against the connection."})),legendMode:r.Optional(qe),thresholds:Xt,yAxisSettings:r.Optional(Bi)},{$id:"GraphVisualizationTimeseriesConnection",title:"TimeseriesConnection"}),q4=r.Object({type:r.Literal("timeseries-connection",{description:"Displays the database rows-based aggregation as a time series chart"}),connectionId:u({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:r.Array(u({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:r.Optional(qe),thresholds:Xt,yAxisSettings:r.Optional(Hi)},{$id:"InputGraphVisualizationTimeseriesConnection",title:"TimeseriesConnection"}),B4=r.Object({type:r.Literal("list-connection",{description:"Displays database rows as a tabular list"}),connectionId:r.String({description:"The ID of the connection to use to query the datastore."}),query:r.String({description:"The read-only SQL query to execute against the connection."}),listColumns:r.Optional(r.Array(Lg,{description:"Custom columns to display for each database row"})),listColumnsSize:r.Optional(r.Record(r.String(),r.Number({description:"List column width by column id"}),{description:"List column widths in pixels, keyed by the `attribute` of the matching `listColumns` entry. Columns without an entry keep their default width."})),isCellWrapped:r.Optional(r.Boolean({description:"Whether list widget cell text wraps instead of truncating. Applies to connection list widgets."})),defaultSorting:r.Optional(Mg)},{$id:"GraphVisualizationListConnection",title:"ListConnection"}),H4=r.Object({type:r.Literal("list-connection",{description:"Displays database rows as a tabular list"}),connectionId:u({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),query:u({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),listColumns:r.Optional(r.Array(kg,{description:"Custom columns to display for each database row"})),listColumnsSize:r.Optional(r.Record(r.String(),r.Number({description:"List column width by column id"}),{description:"List column widths in pixels, keyed by the `attribute` of the matching `listColumns` entry. Columns without an entry keep their default width."})),isCellWrapped:r.Optional(r.Boolean({description:"Whether list widget cell text wraps instead of truncating. Applies to connection list widgets. Optional; omit or set false to use truncated cells."})),defaultSorting:r.Optional(Dg)},{$id:"InputGraphVisualizationListConnection",title:"ListConnection"}),K4=r.Object({type:r.Literal("top-list-connection",{description:"Displays the database rows-based aggregation as a ranked top list"}),connectionId:r.String({description:"The ID of the connection to use to query the datastore."}),queries:r.Array(r.String({description:"The read-only SQL query to execute against the connection."}))},{$id:"GraphVisualizationTopListConnection",title:"TopListConnection"}),z4=r.Object({type:r.Literal("top-list-connection",{description:"Displays the database rows-based aggregation as a ranked top list"}),connectionId:u({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:r.Array(u({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1})},{$id:"InputGraphVisualizationTopListConnection",title:"TopListConnection"}),Y4=r.Object({type:r.Literal("pie-connection",{description:"Displays the database rows-based aggregation as a pie chart"}),connectionId:r.String({description:"The ID of the connection to use to query the datastore."}),queries:r.Array(r.String({description:"The read-only SQL query to execute against the connection."})),legendMode:r.Optional(qe)},{$id:"GraphVisualizationPieConnection",title:"PieConnection"}),V4=r.Object({type:r.Literal("pie-connection",{description:"Displays the database rows-based aggregation as a pie chart"}),connectionId:u({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:r.Array(u({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:r.Optional(qe)},{$id:"InputGraphVisualizationPieConnection",title:"PieConnection"}),Q4=r.Object({type:r.Literal("bar-connection",{description:"Displays the database rows-based aggregation as a bar chart"}),connectionId:r.String({description:"The ID of the connection to use to query the datastore."}),queries:r.Array(r.String({description:"The read-only SQL query to execute against the connection."})),legendMode:r.Optional(qe),thresholds:Xt,yAxisSettings:r.Optional(Bi)},{$id:"GraphVisualizationBarConnection",title:"BarConnection"}),W4=r.Object({type:r.Literal("bar-connection",{description:"Displays the database rows-based aggregation as a bar chart"}),connectionId:u({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:r.Array(u({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:r.Optional(qe),thresholds:Xt,yAxisSettings:r.Optional(Hi)},{$id:"InputGraphVisualizationBarConnection",title:"BarConnection"}),Z4=r.Object({type:r.Literal("query-value-connection",{description:"Displays a single value computed by a SQL query against a database connection"}),connectionId:r.String({description:"The ID of the connection to use to query the datastore."}),queries:r.Array(r.String({description:"The read-only SQL query to execute against the connection."})),backgroundMode:r.Optional(r.Enum(Gi,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:r.Optional(r.Array(Cr,{description:"Conditional formatting rules applied to the displayed value"})),precision:ye,normalizer:r.Optional(Rt),legendMode:r.Optional(qe)},{$id:"GraphVisualizationQueryValueConnection",title:"QueryValueConnection"}),X4=r.Object({type:r.Literal("query-value-connection",{description:"Displays a single value computed by a SQL query against a database connection"}),connectionId:u({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:r.Array(u({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),backgroundMode:r.Optional(r.Enum(Gi,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:r.Optional(r.Array(Cr,{description:"Conditional formatting rules applied to the displayed value"})),precision:ye,normalizer:r.Optional(Ct),legendMode:r.Optional(qe)},{$id:"InputGraphVisualizationQueryValueConnection",title:"QueryValueConnection"}),J4=r.Object({type:r.Literal("list-log-patterns",{description:"Displays log patterns clustered from logs matching the query"}),query:r.String({description:"Tsuga query that selects logs to cluster into patterns"}),layout:r.Optional(r.Enum(nv,{description:"Layout used to render log patterns"}))},{$id:"GraphVisualizationListLogPatterns",title:"ListLogPatterns"}),e3=r.Object({type:r.Literal("list-log-patterns",{description:"Displays log patterns clustered from logs matching the query"}),query:u({type:"tsuga-query",description:"Tsuga query that selects logs to cluster into patterns"}),layout:r.Optional(r.Enum(nv,{description:"Layout used to render log patterns"}))},{$id:"InputGraphVisualizationListLogPatterns",title:"ListLogPatterns"}),t3=r.Object({type:r.Literal("list-spans",{description:"Displays matching trace spans in a tabular list"}),query:r.String({description:"Query that selects trace spans for the list"}),listColumns:r.Optional(r.Array(Lg,{description:"Custom columns to display for each span"})),listColumnsSize:r.Optional(r.Record(r.String(),r.Number({description:"List column width by column id"}),{description:"List column widths in pixels, keyed by the `attribute` of the matching `listColumns` entry. Columns without an entry keep their default width."})),isCellWrapped:r.Optional(r.Boolean({description:"Whether list widget cell text wraps instead of truncating. Applies to span list widgets."})),defaultSorting:r.Optional(Mg)},{$id:"GraphVisualizationListSpans",title:"ListSpans"}),r3=r.Object({type:r.Literal("list-spans",{description:"Displays matching trace spans in a tabular list"}),query:u({type:"tsuga-query",description:"Query that selects trace spans for the list"}),listColumns:r.Optional(r.Array(kg,{description:"Custom columns to display for each span"})),listColumnsSize:r.Optional(r.Record(r.String(),r.Number({description:"List column width by column id"}),{description:"List column widths in pixels, keyed by the `attribute` of the matching `listColumns` entry. Columns without an entry keep their default width."})),isCellWrapped:r.Optional(r.Boolean({description:"Whether list widget cell text wraps instead of truncating. Applies to span list widgets. Optional; omit or set false to use truncated cells."})),defaultSorting:r.Optional(Dg)},{$id:"InputGraphVisualizationListSpans",title:"ListSpans"}),Cs=r.Array(r.String({description:"Raw PromQL expression for this widget, returned exactly as stored."}),{description:"PromQL expressions configured for this widget. PromQL-backed widgets require at least one query."}),Ps=r.Array(u({allowEmpty:!1,type:"long",description:"Raw PromQL expression for this widget."}),{minItems:1,description:"PromQL expressions configured for this widget."}),n3=r.Object({type:r.Literal("timeseries-promql",{description:"Displays PromQL metrics query-based aggregation as a time series chart"}),queries:Cs,aliases:r.Optional($i),timeBucket:r.Optional(wn),normalizer:r.Optional(Rt),precision:ye,legendMode:r.Optional(qe),thresholds:Xt,yAxisSettings:r.Optional(Bi),smoothing:r.Optional(r.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"}))},{$id:"GraphVisualizationTimeseriesPromql",title:"TimeseriesPromql"}),o3=r.Object({type:r.Literal("timeseries-promql",{description:"Displays PromQL metrics query-based aggregation as a time series chart"}),queries:Ps,aliases:r.Optional(ji),timeBucket:r.Optional(wn),normalizer:r.Optional(Ct),precision:ye,legendMode:r.Optional(qe),thresholds:Xt,yAxisSettings:r.Optional(Hi),smoothing:r.Optional(r.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"}))},{$id:"InputGraphVisualizationTimeseriesPromql",title:"TimeseriesPromql"}),i3=r.Object({type:r.Literal("query-value-promql",{description:"Configures a PromQL metrics query-based aggregation as a single value"}),queries:Cs,aliases:r.Optional($i),backgroundMode:r.Optional(r.Enum(Gi,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:r.Optional(r.Array(Cr,{description:"Conditional formatting rules applied to the displayed value"})),precision:ye,normalizer:r.Optional(Rt),legendMode:r.Optional(qe)},{$id:"GraphVisualizationQueryValuePromql",title:"QueryValuePromql"}),a3=r.Object({type:r.Literal("query-value-promql",{description:"Configures a PromQL metrics query-based aggregation as a single value"}),queries:Ps,aliases:r.Optional(ji),backgroundMode:r.Optional(r.Enum(Gi,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:r.Optional(r.Array(Cr,{description:"Conditional formatting rules applied to the displayed value"})),precision:ye,normalizer:r.Optional(Ct),legendMode:r.Optional(qe)},{$id:"InputGraphVisualizationQueryValuePromql",title:"QueryValuePromql"}),s3=r.Object({type:r.Literal("top-list-promql",{description:"Displays PromQL metrics query-based aggregation as a ranked top list"}),queries:Cs,aliases:r.Optional($i),normalizer:r.Optional(Rt),precision:ye,conditions:r.Optional(r.Array(Cr,{description:"Conditional formatting rules applied to the displayed value"}))},{$id:"GraphVisualizationTopListPromql",title:"TopListPromql"}),c3=r.Object({type:r.Literal("top-list-promql",{description:"Displays PromQL metrics query-based aggregation as a ranked top list"}),queries:Ps,aliases:r.Optional(ji),normalizer:r.Optional(Ct),precision:ye,conditions:r.Optional(r.Array(Cr,{description:"Conditional formatting rules applied to the displayed value"}))},{$id:"InputGraphVisualizationTopListPromql",title:"TopListPromql"}),p3=r.Object({type:r.Literal("pie-promql",{description:"Displays PromQL metrics query-based aggregation as a pie chart"}),queries:Cs,aliases:r.Optional($i),normalizer:r.Optional(Rt),precision:ye,legendMode:r.Optional(qe)},{$id:"GraphVisualizationPiePromql",title:"PiePromql"}),u3=r.Object({type:r.Literal("pie-promql",{description:"Displays PromQL metrics query-based aggregation as a pie chart"}),queries:Ps,aliases:r.Optional(ji),normalizer:r.Optional(Ct),precision:ye,legendMode:r.Optional(qe)},{$id:"InputGraphVisualizationPiePromql",title:"PiePromql"}),l3=r.Object({type:r.Literal("bar-promql",{description:"Displays PromQL metrics query-based aggregation as a bar chart"}),queries:Cs,aliases:r.Optional($i),timeBucket:r.Optional(wn),precision:ye,normalizer:r.Optional(Rt),thresholds:Xt,legendMode:r.Optional(qe),yAxisSettings:r.Optional(Bi)},{$id:"GraphVisualizationBarPromql",title:"BarPromql"}),m3=r.Object({type:r.Literal("bar-promql",{description:"Displays PromQL metrics query-based aggregation as a bar chart"}),queries:Ps,aliases:r.Optional(ji),timeBucket:r.Optional(wn),precision:ye,normalizer:r.Optional(Ct),thresholds:Xt,legendMode:r.Optional(qe),yAxisSettings:r.Optional(Hi)},{$id:"InputGraphVisualizationBarPromql",title:"BarPromql"}),d3=r.Object({type:r.Literal("timeseries",{description:"Displays the aggregation as a time series chart"}),...Fi,groupByMode:Pr,timeBucket:r.Optional(wn),normalizer:r.Optional(Rt),precision:ye,legendMode:r.Optional(qe),thresholds:Xt,yAxisSettings:r.Optional(Bi),smoothing:r.Optional(r.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"}))},{$id:"GraphVisualizationTimeseries",title:"Timeseries"}),f3=r.Object({type:r.Literal("timeseries",{description:"Displays the aggregation as a time series chart"}),...qi,groupByMode:Pr,timeBucket:r.Optional(wn),normalizer:r.Optional(Ct),precision:ye,legendMode:r.Optional(qe),thresholds:Xt,yAxisSettings:r.Optional(Hi),smoothing:r.Optional(r.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"}))},{$id:"InputGraphVisualizationTimeseries",title:"Timeseries"}),ov="Requests stacked rendering for a top-list widget. Tsuga renders stacked rows only for one count or sum query with exactly two grouped fields, no formula, non-negative values, and a single-cluster context; otherwise the widget renders as a normal top list.",g3=r.Object({type:r.Literal("top-list",{description:"Displays the aggregation as a ranked list of top results"}),...Fi,groupByMode:Pr,normalizer:r.Optional(Rt),precision:ye,conditions:r.Optional(r.Array(Cr,{description:"Conditional formatting rules applied to the displayed value"})),isStacked:r.Optional(r.Boolean({description:ov}))},{$id:"GraphVisualizationTopList",title:"TopList"}),h3=r.Object({type:r.Literal("top-list",{description:"Displays the aggregation as a ranked list of top results"}),...qi,groupByMode:Pr,normalizer:r.Optional(Ct),precision:ye,conditions:r.Optional(r.Array(Cr,{description:"Conditional formatting rules applied to the displayed value"})),isStacked:r.Optional(r.Boolean({description:ov}))},{$id:"InputGraphVisualizationTopList",title:"TopList"}),y3=r.Object({type:r.Literal("pie",{description:"Displays the aggregation as a pie chart"}),...Fi,groupByMode:Pr,normalizer:r.Optional(Rt),precision:ye,legendMode:r.Optional(qe)},{$id:"GraphVisualizationPie",title:"Pie"}),T3=r.Object({type:r.Literal("pie",{description:"Displays the aggregation as a pie chart"}),...qi,groupByMode:Pr,normalizer:r.Optional(Ct),precision:ye,legendMode:r.Optional(qe)},{$id:"InputGraphVisualizationPie",title:"Pie"}),E3=r.Object({type:r.Literal("query-value",{description:"Displays the aggregation as a single value"}),...rl,backgroundMode:r.Optional(r.Enum(Gi,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:r.Optional(r.Array(Cr,{description:"Conditional formatting rules applied to the displayed value"})),precision:ye,normalizer:r.Optional(Rt),legendMode:r.Optional(qe)},{$id:"GraphVisualizationQueryValue",title:"QueryValue"}),_3=r.Object({type:r.Literal("query-value",{description:"Displays the aggregation as a single value"}),...nl,backgroundMode:r.Optional(r.Enum(Gi,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:r.Optional(r.Array(Cr,{description:"Conditional formatting rules applied to the displayed value"})),precision:ye,normalizer:r.Optional(Ct),legendMode:r.Optional(qe)},{$id:"InputGraphVisualizationQueryValue",title:"QueryValue"}),I3=r.Object({type:r.Literal("bar",{description:"Displays the aggregation as a bar chart"}),...Fi,groupByMode:Pr,timeBucket:r.Optional(wn),precision:ye,normalizer:r.Optional(Rt),thresholds:Xt,legendMode:r.Optional(qe),yAxisSettings:r.Optional(Bi)},{$id:"GraphVisualizationBar",title:"Bar"}),b3=r.Object({type:r.Literal("bar",{description:"Displays the aggregation as a bar chart"}),...qi,groupByMode:Pr,timeBucket:r.Optional(wn),precision:ye,normalizer:r.Optional(Ct),thresholds:Xt,legendMode:r.Optional(qe),yAxisSettings:r.Optional(Hi)},{$id:"InputGraphVisualizationBar",title:"Bar"}),iv='Attribute that switches the count to "Groups" mode: records are grouped by this attribute, the aggregation produces one value per group, and the chart buckets those per-group values. When omitted, individual records are bucketed.',av=r.String({description:iv}),sv=u({description:iv}),S3=r.Object({type:r.Literal("distribution",{description:"Displays the aggregation as a distribution chart"}),...Fi,group:r.Optional(av),precision:ye,normalizer:r.Optional(Rt),percentileMarkers:r.Optional($4),boundsScale:r.Optional(Xp)},{$id:"GraphVisualizationDistribution",title:"Distribution"}),A3=r.Object({type:r.Literal("distribution",{description:"Displays the aggregation as a distribution chart"}),...qi,group:r.Optional(sv),precision:ye,normalizer:r.Optional(Ct),percentileMarkers:r.Optional(j4),boundsScale:r.Optional(Xp)},{$id:"InputGraphVisualizationDistribution",title:"Distribution"}),cv=["red","pink","violet","blue","cyan","green","yellow","orange"],pv=r.Enum(cv,{description:"Color palette used to render the heatmap intensity gradient"}),O3=r.Object({type:r.Literal("heatmap",{description:"Displays the aggregation as a heatmap chart"}),...Fi,group:r.Optional(av),precision:ye,normalizer:r.Optional(Rt),palette:r.Optional(pv)},{$id:"GraphVisualizationHeatmap",title:"Heatmap"}),x3=r.Object({type:r.Literal("heatmap",{description:"Displays the aggregation as a heatmap chart"}),...qi,group:r.Optional(sv),precision:ye,normalizer:r.Optional(Ct),palette:r.Optional(pv)},{$id:"InputGraphVisualizationHeatmap",title:"Heatmap"}),uv=r.Object({from:r.Number({description:"Lower bound of the Gauge color threshold; runs up to the next threshold or the max"}),color:r.Enum(cv,{description:"Color applied to the band starting at this value"})},{title:"GaugeColorThreshold",description:"Color band of the gauge range. Bands are ordered by `from`, so entries may be listed in any order."}),R3=r.Object({type:r.Literal("gauge",{description:"Displays the aggregation as a gauge"}),...rl,max:r.Optional(r.Number({description:"Gauge maximum value"})),colorThresholds:r.Optional(r.Array(uv,{description:"Color thresholds inside the gauge range"})),precision:ye,normalizer:r.Optional(Rt)},{$id:"GraphVisualizationGauge",title:"Gauge"}),C3=r.Object({type:r.Literal("gauge",{description:"Displays the aggregation as a gauge"}),...nl,max:r.Optional(r.Number({description:"Gauge maximum value"})),colorThresholds:r.Optional(r.Array(uv,{description:"Color thresholds inside the gauge range"})),precision:ye,normalizer:r.Optional(Ct)},{$id:"InputGraphVisualizationGauge",title:"Gauge"}),P3=r.Object({type:r.Literal("table",{description:"Displays the aggregation as a table with multi-level grouping"}),columns:r.Array(N4,{description:"Each column defines an independent aggregation displayed as a table column"}),groupBy:r.Optional(ci),groupByMode:Pr,defaultSorting:r.Optional(k4),columnSizes:r.Optional(r.Record(r.String(),r.Number({description:"Column width by column id"}),{description:"Table column widths in pixels, keyed by column id: `label` for the grouping column and `col-<index>` for each entry in `columns`. Columns without an entry keep their default width."}))},{$id:"GraphVisualizationTable",title:"Table"}),U3=r.Object({type:r.Literal("table",{description:"Displays the aggregation as a table with multi-level grouping"}),columns:r.Array(L4,{minItems:1,description:"Each column defines an independent aggregation displayed as a table column"}),groupBy:r.Optional(Fr),groupByMode:Pr,defaultSorting:r.Optional(M4),columnSizes:r.Optional(r.Record(r.String(),r.Number({description:"Column width by column id"}),{description:"Table column widths in pixels, keyed by column id: `label` for the grouping column and `col-<index>` for each entry in `columns`. Columns without an entry keep their default width."}))},{$id:"InputGraphVisualizationTable",title:"Table"}),w3=r.Object({type:r.Literal("note",{description:"Displays static text on the dashboard"}),note:r.Optional(r.String({description:"Markdown-compatible text shown in the note"})),noteColor:r.Optional(r.Enum(Yw,{description:"Background color used to render the note"})),noteAlign:r.Optional(Un),noteJustifyContent:r.Optional(Un)},{$id:"GraphVisualizationNote",title:"Note"}),v3=r.Object({type:r.Literal("note",{description:"Displays static text on the dashboard"}),note:r.Optional(u({type:"long",description:"Markdown-compatible text shown in the note"})),noteColor:r.Optional(r.Enum(Yw,{description:"Background color used to render the note"})),noteAlign:r.Optional(Un),noteJustifyContent:r.Optional(Un)},{$id:"InputGraphVisualizationNote",title:"Note"}),N3=C("type",[F4,B4,K4,Y4,Q4,Z4,n3,i3,s3,p3,l3,d3,g3,y3,E3,R3,I3,S3,O3,P3,D4,w3,J4,t3],{description:"Widget visualization configuration. The `type` discriminator selects the widget kind and its required fields."}),L3=C("type",[q4,H4,z4,V4,W4,X4,o3,a3,c3,u3,m3,f3,h3,T3,_3,C3,b3,A3,x3,U3,G4,v3,e3,r3],{description:"Widget visualization configuration. The `type` discriminator selects the widget kind and its required fields."}),ol=r.Object({id:r.String({description:"Unique identifier of the graph widget inside the dashboard. Set by the caller when the graph is created; use it to target the graph in later update requests."}),name:r.Optional(r.String({description:"Display name of the graph widget."})),description:r.Optional(r.String({description:"Optional text shown with the graph widget."})),descriptionAlign:r.Optional(Un),descriptionJustifyContent:r.Optional(Un),visualization:N3,layout:r.Optional(r.Object({x:r.Number({description:"Column position of the widget on the 12-column dashboard grid. 0 is the leftmost column; increasing values move right."}),y:r.Number({description:"Row position of the widget on the dashboard grid, in row units of 50 pixels each. 0 is the topmost row; increasing values move down."}),w:r.Number({description:"Width of the widget in grid columns, out of the 12-column grid. Dashboard validation uses this with `h` and the widget type to reject layouts below the widget minimum."}),h:r.Number({description:"Height of the widget in grid rows, where each row is 50 pixels tall. Dashboard validation uses this with `w` and the widget type to reject layouts below the widget minimum."})},{description:`Grid position and size of the widget. Optional; when provided, the size must be at least ${Ed}\xD7${_d} (width\xD7height) grid units, except note widgets which can go down to 1\xD71.`}))},{title:"Graph",description:"Single dashboard widget, combining its identity, its visualization configuration, and its position on the dashboard grid."}),il=r.Object({id:u({description:"Unique identifier of the graph widget inside the dashboard. Assign it when the graph is created; use it to target the graph in later update requests."}),name:r.Optional(u({description:"Display name of the graph widget."})),description:r.Optional(r.String({minLength:1,maxLength:800,description:"Text shown with the graph widget."})),descriptionAlign:r.Optional(Un),descriptionJustifyContent:r.Optional(Un),visualization:L3,layout:r.Optional(r.Object({x:r.Number({description:"Column position of the widget on the 12-column dashboard grid. 0 is the leftmost column; increasing values move right."}),y:r.Number({description:"Row position of the widget on the dashboard grid, in row units of 50 pixels each. 0 is the topmost row; increasing values move down."}),w:r.Number({description:"Width of the widget in grid columns, out of the 12-column grid. Dashboard validation uses this with `h` and the widget type to reject layouts below the widget minimum."}),h:r.Number({description:"Height of the widget in grid rows, where each row is 50 pixels tall. Dashboard validation uses this with `w` and the widget type to reject layouts below the widget minimum."})},{description:`Grid position and size of the widget. Optional; when provided, the size must be at least ${Ed}\xD7${_d} (width\xD7height) grid units, except note widgets which can go down to 1\xD71.`}))},{title:"Graph",description:"Single dashboard widget, combining its identity, its visualization configuration, and its position on the dashboard grid."}),zw=10,k3=r.Array(r.Object({key:r.String({description:"Dashboard-wide filter key, usually a telemetry attribute name."}),values:r.Array(r.String({description:"Filter value."}),{description:"Allowed values for this dashboard-wide filter."}),exclude:r.Optional(r.Boolean({description:"If true, widgets exclude telemetry whose value matches this filter instead of including it (is-not)."}))}),{description:"Dashboard-wide filters applied to every widget on the dashboard."}),M3=r.Array(r.Object({key:u({description:"Dashboard-wide filter key, usually a telemetry attribute name."}),values:r.Array(u({description:"Filter value."}),{description:"Allowed values for this dashboard-wide filter."}),exclude:r.Optional(r.Boolean({description:"If true, widgets exclude telemetry whose value matches this filter instead of including it (is-not)."}))}),{maxItems:zw,description:`Dashboard-wide filters applied to every widget on the dashboard. Up to ${zw} filters are allowed.`}),Ki=r.Object({id:r.String({description:"Tsuga-generated dashboard ID assigned when the dashboard is created."}),name:r.String({description:"Display name of the dashboard. Set by the caller on create or update."}),owner:r.String({description:"ID of the team that owns the dashboard. Set by the caller on create or update and used for dashboard access control."}),graphs:r.Array(ol,{description:"Ordered widgets that compose the dashboard"}),filters:r.Optional(k3),createdAt:A({description:"Timestamp when Tsuga created the dashboard."}),updatedAt:A({description:"Timestamp when Tsuga last updated the dashboard."}),creator:r.Optional(pe),updater:r.Optional(pe),tags:De,timePreset:r.Optional(r.Enum(Ul,{description:"Relative time preset used when opening the dashboard."})),folderId:r.Optional(r.String({description:"Folder that contains the dashboard. Set from the dashboard's saved folder relationship. Returned when the dashboard is in a folder; omitted when it is not."}))}),al=r.Object({name:u({description:"Display name of the dashboard."}),owner:u({allowEmpty:!1,description:"ID of the team that owns the dashboard. Required and used for dashboard access control."}),graphs:r.Array(il,{description:"Ordered widgets that compose the dashboard"}),filters:r.Optional(M3),tags:Xe,timePreset:r.Optional(r.Enum(Ul,{description:"Relative time preset used when opening the dashboard. Optional; create defaults to `past-30-minutes` when omitted, and update omission preserves the current value."})),folderId:r.Optional(r.Union([r.Null(),u({allowEmpty:!1})],{description:"Folder that should contain the dashboard. Optional; omit on update to keep the current folder, pass null to clear the folder, or pass a readable dashboard-folder ID to move it."}))}),sr={IS_FAVORITE:"isFavorite",OWNER:"owner",TAGS:"tags",WIDGET_COUNT:"widgetCount",UPDATED_AT:"updatedAt",NAME:"name"},lv=[sr.OWNER,sr.TAGS,sr.WIDGET_COUNT,sr.UPDATED_AT,sr.NAME],Us=r.Partial(r.Object({owners:_e(u({allowEmpty:!1}),{description:"Restrict results to dashboards owned by any of these team IDs",maxItems:50}),searchQuery:r.Object({value:u({allowEmpty:!1,description:"Substring matched case-insensitively against dashboard names or dashboard IDs. Omit the whole `searchQuery` filter to skip text filtering."}),exclude:r.Optional(r.Boolean({description:"If true, exclude dashboards matching this value instead of including them"}))},{description:"Text filter for dashboard names or IDs. Optional; `exclude: true` returns dashboards whose name and ID do not match the substring."}),tags:_e(Bt.items,{description:"Restrict results to dashboards that have at least one of the listed key/value tags",maxItems:50}),folderId:r.Union([r.Null(),u({allowEmpty:!1})],{description:"Folder filter for dashboard query results. Optional; pass a folder ID to return dashboards in that folder, or null to return only dashboards that are not in any folder."})},{description:"Optional filters applied to narrow the returned dashboards"})),D3=r.Partial(r.Object({...ge,filters:Us,sort:r.Object({by:r.Enum([sr.IS_FAVORITE,sr.OWNER,sr.TAGS,sr.WIDGET_COUNT,sr.UPDATED_AT,sr.NAME],{description:"Field to sort the returned dashboards by"}),direction:r.Enum(["asc","desc"],{description:"Sort direction: ascending or descending"})},{description:"Optional sorting applied to the returned dashboards"})})),R7e=d({tags:["dashboards"],url:`${Rr}/query`,method:"POST",paginated:!0,response:r.Array(Ki),body:D3}),C7e=d({tags:["dashboards"],url:`${Rr}/tags/query`,method:"POST",body:r.Object({filters:r.Optional(r.Omit(Us,["tags"]))}),response:qt}),P7e=d({tags:["dashboards"],url:`${Rr}/counts/query`,method:"POST",body:r.Object({filters:r.Optional(r.Partial(Us))}),response:r.Object({all:r.Integer({description:"Total number of dashboards matching the filters that the user can read."})})}),U7e=d({tags:["dashboards"],url:`${Rr}/:id`,method:"GET",params:r.Object({id:u()}),response:Ki}),w7e=d({tags:["dashboards"],url:Rr,method:"POST",body:al,response:Ki}),v7e=d({tags:["dashboards"],url:`${Rr}/:id`,method:"PUT",params:r.Object({id:u()}),body:r.Partial(al),response:Ki}),N7e=d({tags:["dashboards"],url:`${Rr}/bulk-update`,method:"PUT",body:r.Object({dashboardIds:r.Array(u(),{description:"Dashboard IDs to update. At least one dashboard ID is required."}),owner:r.Optional(u({allowEmpty:!1,description:"Owning team ID to apply to every dashboard. Optional when folderId is provided; omit to keep the current owner."})),folderId:r.Optional(r.Union([r.Null(),u({allowEmpty:!1})],{description:"Folder that should contain every dashboard. Optional when owner is provided; omit to keep the current folder, pass null to clear the folder, or pass a dashboard-folder ID to move dashboards."}))}),response:r.Object({})}),L7e=d({tags:["dashboards"],url:`${Rr}/:id`,method:"DELETE",params:r.Object({id:u()}),response:N}),k7e=d({tags:["dashboards"],url:`${Rr}/:id/graphs/:graphId`,method:"PUT",params:r.Object({id:u({allowEmpty:!1}),graphId:u({allowEmpty:!1})}),body:r.Omit(il,["id"]),response:ol}),M7e=d({tags:["dashboards"],url:`${Rr}/bulk-delete`,method:"DELETE",body:r.Object({ids:r.Array(u())}),response:r.Object({})});var zi=`/${"v1"}/dashboards`,ws=r.Pick(Ki,["id","name","owner","graphs","filters","tags","timePreset","folderId"],{$id:"Dashboard",description:"Saved visualization made of dashboard-wide filters and ordered graphs. Use dashboards to preserve reusable views for a team or workflow. See [Dashboards](/documentation/visualize/dashboards/index)."}),G3={id:"123-456-abc",name:"API Performance Overview",owner:"team-123-abc",graphs:[{id:"789-abc-def",name:"Request Latency P99",visualization:{type:"timeseries",source:"metrics",queries:[{aggregate:{type:"percentile",field:"duration",percentile:99},filter:"service:api-gateway"}]},layout:{x:0,y:0,w:6,h:4}}],filters:[{key:"env",values:["production"]}],tags:[{key:"team",value:"platform"}],timePreset:"past-1-hour"};Object.assign(ws,{examples:[G3]});var $3=r.Object({by:r.Enum([...lv],{description:"Field to sort the returned dashboards by: `owner` sorts by owning team ID, `tags` sorts by tag key/value pairs, `widgetCount` sorts by the number of graphs on the dashboard, `updatedAt` sorts by last-updated timestamp, and `name` sorts alphabetically by dashboard name."}),direction:r.Enum(["asc","desc"],{description:"Sort direction: ascending or descending"})},{description:"Optional sorting applied to the returned dashboards"}),mv=r.Object({...Ze,filters:r.Optional(r.Pick(Us,["owners","searchQuery","tags","folderId"])),sort:r.Optional($3)},{description:"Dashboard query request. Use filters, sorting, limit, and offset to page through visible dashboards."}),j3={filters:{owners:{values:["team-123-abc"]},searchQuery:{value:"API"},tags:{values:[{key:"service",value:"api-gateway"}]},folderId:"folder-123-abc"},sort:{by:"name",direction:"asc"},limit:10,offset:0};Object.assign(mv,{examples:[j3]});var dv=d({description:"Queries dashboards visible to the authenticated operation key. Use this endpoint to build dashboard inventories or synchronize dashboard metadata. Pagination fields limit the returned page; use the response metadata to request additional pages. See [Dashboards](/documentation/visualize/dashboards/index).",operationId:"queryDashboards",tags:["dashboards"],url:`${zi}/query`,method:"POST",paginated:!0,body:mv,response:r.Array(ws)}),fv=d({description:"Retrieves one dashboard by ID.",operationId:"getDashboard",tags:["dashboards"],url:`${zi}/:id`,method:"GET",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the saved dashboard to retrieve. Use the `id` returned by dashboard query, create, or update responses."})}),response:ws}),Gg=r.Pick(al,["name","owner","graphs","filters","tags","timePreset","folderId"],{description:"Dashboard create or update request. Provide the dashboard identity, owner team, widgets, filters, tags, and optional time preset."}),F3={name:"API Performance Overview",owner:"team-123-abc",graphs:[{id:"789-abc-def",name:"Request Latency P99",visualization:{type:"timeseries",source:"metrics",queries:[{aggregate:{type:"percentile",field:"duration",percentile:99},filter:"service:api-gateway"}]},layout:{x:0,y:0,w:6,h:4}}],filters:[{key:"env",values:["production"]}],tags:[{key:"team",value:"platform"}],timePreset:"past-1-hour",folderId:null};Object.assign(Gg,{examples:[F3]});var q3=r.Omit(il,["id"],{description:"Dashboard graph update request. The graph identifier is supplied in the `graphId` path parameter; provide the replacement graph definition without an `id` field."}),gv=d({description:"Creates a dashboard owned by the specified team. Use this to provision dashboards from automation or templates. The response returns the saved dashboard definition.",operationId:"createDashboard",tags:["dashboards"],url:zi,method:"POST",body:Gg,response:ws}),hv=d({description:"Updates an existing dashboard by ID. Fields are patched from the request body; omitted fields keep their current values.",operationId:"updateDashboard",tags:["dashboards"],url:`${zi}/:id`,method:"PUT",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the saved dashboard to update. Use the `id` returned by dashboard query, get, or create responses."})}),body:r.Partial(Gg),response:ws}),B3=r.Object({id:u({allowEmpty:!1,description:"Identifier of the saved dashboard to delete. Use the `id` returned by dashboard query, get, create, or update responses."})}),yv=d({description:"Deletes a dashboard by ID. Use only after confirming no users or automation still rely on the dashboard.",operationId:"deleteDashboard",tags:["dashboards"],url:`${zi}/:id`,method:"DELETE",params:B3,response:N}),H7e=d({description:"Updates one graph inside a dashboard without replacing the full dashboard. Use this for targeted widget edits when you already know the dashboard ID and graph ID.",operationId:"updateDashboardGraph",tags:["dashboards"],url:`${zi}/:id/graphs/:graphId`,method:"PUT",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the dashboard that contains the graph to update. Use the `id` returned by dashboard responses."}),graphId:u({allowEmpty:!1,description:"Identifier of the graph to update within the dashboard. Use graph IDs from the dashboard response."})}),body:q3,response:ol});var Tv=100,Ev=3,Yi=r.Object({id:r.String({description:"Tsuga-generated ingestion API key ID assigned when the key is created."}),name:r.String({description:"Human-readable key name. Names must be kebab-case when creating or updating keys."}),keyLastCharacters:r.String({description:"Last visible characters of the secret key. Use this to identify a key without exposing the full secret."}),owner:r.String({description:"Team ID that owns and manages the ingestion API key."}),tags:qt,teamOverrideFields:r.Optional(r.Array(r.String(),{description:"Telemetry attribute names used to override ownership for data sent with this key."})),updatedAt:A({description:"Timestamp when Tsuga last updated the key metadata."}),createdAt:A({description:"Timestamp when Tsuga created the key."}),creator:r.Optional(pe),updater:r.Optional(pe),assetUpdatedAt:A({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})}),vs=r.Object({name:r.String({format:Jo,minLength:1,maxLength:Tv,description:`Kebab-case name for the ingestion API key. Maximum length is ${Tv} characters.`}),owner:u({allowEmpty:!1,description:"Team ID that will own and manage the ingestion API key."}),tags:Bt,teamOverrideFields:r.Union([r.Array(u({allowEmpty:!1}),{minItems:1,maxItems:Ev,description:`Array form. Up to ${Ev} fields are allowed.`}),r.Null({description:"Clear any existing team override fields."})],{description:"Telemetry attribute names used to override ownership for data sent with this key. Send null to clear existing override fields."})}),Vi="/v0/ingestion-api-keys",J7e=d({tags:["ingestion-api-keys"],url:Vi,method:"POST",body:vs,response:r.Intersect([Yi,r.Object({key:r.String({description:"Full secret value of the ingestion API key. Generated by Tsuga and returned only in this create response; subsequent get and list responses expose only `keyLastCharacters`. Store it immediately, since it cannot be retrieved again after this response."})})])}),eZe=d({tags:["ingestion-api-keys"],url:Vi,method:"GET",paginated:!0,query:r.Object(ge),response:r.Array(Yi)}),tZe=d({tags:["ingestion-api-keys"],url:`${Vi}/:id`,method:"GET",params:r.Object({id:u({allowEmpty:!1})}),response:Yi}),rZe=d({tags:["ingestion-api-keys"],url:`${Vi}/:id`,method:"PUT",params:r.Object({id:u({allowEmpty:!1})}),body:vs,response:Yi}),nZe=d({tags:["ingestion-api-keys"],url:`${Vi}/:id`,method:"DELETE",params:r.Object({id:u({allowEmpty:!1})}),response:N}),oZe=d({tags:["ingestion-api-keys"],url:`${Vi}/bulk-delete`,method:"DELETE",body:r.Object({ids:r.Array(u({allowEmpty:!1}))}),response:r.Object({})});var Ns=`/${"v1"}/ingestion-api-keys`,Ls=r.Pick(Yi,["id","name","owner","tags","teamOverrideFields","keyLastCharacters"],{$id:"IngestionApiKey",description:"API key used to send telemetry data to Tsuga. The full key secret is returned only when the key is created. See [API keys](/documentation/account-and-settings/api-keys)."}),_v={id:"123-456-abc",name:"production-logs-ingestion",keyLastCharacters:"x7Qm",owner:"team-123-abc",tags:[{key:"env",value:"production"}],teamOverrideFields:["service"]};Object.assign(Ls,{examples:[_v]});var Iv=r.Pick(vs,["name","owner","tags","teamOverrideFields"],{$id:"CreateIngestionApiKeyRequest",description:"Ingestion API key creation request. Provide a kebab-case name, owner team, required tags, and required team override fields as an array of fields or null."}),bv=r.Pick(vs,["name","owner","tags","teamOverrideFields"],{$id:"UpdateIngestionApiKeyRequest",description:"Ingestion API key update request. Provide the full metadata definition, including name, owner team, tags, and team override fields."}),Sv={name:"production-logs-ingestion",owner:"team-123-abc",tags:[{key:"env",value:"production"}],teamOverrideFields:["service"]};Object.assign(Iv,{examples:[Sv]});Object.assign(bv,{examples:[Sv]});var H3={..._v,key:"tsuga_in:v1:abc123xyx7Qm"},Av=d({description:"Lists ingestion API keys visible to the authenticated operation key. Use this to inventory telemetry intake keys, owners, tags, and team override fields. Pagination fields limit the returned page.",operationId:"listIngestionApiKeys",tags:["ingestion-api-keys"],url:Ns,method:"GET",paginated:!0,query:r.Object(Ze),response:r.Array(Ls)}),mZe=d({description:"Retrieves one ingestion API key by ID. The response never includes the full secret key value; only the last visible characters are returned.",operationId:"getIngestionApiKey",tags:["ingestion-api-keys"],url:`${Ns}/:id`,method:"GET",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the ingestion API key to retrieve. Use the `id` returned by ingestion API key list or create responses."})}),response:Ls}),K3=r.Intersect([r.Pick(Ls,["id","name","keyLastCharacters","owner","tags","teamOverrideFields"]),r.Object({key:r.String({description:"Full Tsuga-generated ingestion API key secret. Returned only in the create response; list, get, and update responses expose only `keyLastCharacters`."})})],{title:"IngestionApiKeyCreated",example:H3}),Ov=d({description:"Creates an ingestion API key for telemetry intake. Store the returned `key` immediately because Tsuga returns the full secret only in this response.",operationId:"createIngestionApiKey",tags:["ingestion-api-keys"],url:Ns,method:"POST",body:Iv,response:K3}),xv=d({description:"Updates ingestion API key metadata by ID, including name, owner, tags, and team override fields. The secret key value is not rotated by this operation.",operationId:"updateIngestionApiKey",tags:["ingestion-api-keys"],url:`${Ns}/:id`,method:"PUT",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the ingestion API key to update. Use the `id` returned by ingestion API key list, get, or create responses."})}),body:bv,response:Ls}),Rv=d({description:"Deletes an ingestion API key by ID. Telemetry clients using the deleted key can no longer send data with it.",operationId:"deleteIngestionApiKey",tags:["ingestion-api-keys"],url:`${Ns}/:id`,method:"DELETE",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the ingestion API key to delete. Use the `id` returned by ingestion API key list, create, or update responses."})}),response:N});var z3={application:{webService:["azure_web_app","gcp_app_engine_service"]},data:{bucket:["aws_s3_bucket","gcp_bucket","azure_blob_storage_container"],messagingService:["aws_kinesis_data_stream","aws_sqs_queue","aws_sns_topic","azure_service_bus_namespace","azure_service_bus_queue","gcp_pubsub_topic","azure_event_grid_topic","azure_event_hub_namespace","azure_event_hub"],fileSystem:["aws_efs","azure_file_share"],contentDeliveryNetwork:["aws_cloudfront_distribution","gcp_cloud_cdn_configuration"],database:["aws_dynamodb_table","aws_elasticache","aws_rds_instance","azure_database_for_mysql_server","azure_database_for_postgres_server","azure_sql_database_server","azure_sql_database","gcp_bigtable_instance","gcp_cloud_sql_instance","gcp_firestore_database","gcp_spanner_instance","azure_cosmos_db_account"],storageAccount:["azure_storage_account"],volume:["aws_ebs_volume","gcp_compute_disk","azure_disk"]},compute:{virtualMachine:["aws_ec2_instance","gcp_compute_instance","azure_compute_virtual_machine"],serverless:["aws_lambda_function","gcp_cloud_run_function","gcp_cloud_run_job","gcp_cloud_run_service","azure_function_app"]},container:{kubernetesCluster:["aws_eks_cluster","gcp_gke_cluster","azure_aks_cluster"],containerRepository:["aws_ecr_repository","gcp_artifact_registry_repository","azure_container_registry"],containerCluster:["aws_ecs_cluster"],containerServiceTask:["aws_ecs_task"],containerService:["aws_ecs_service","azure_container_instance_group"],containerImage:["aws_ecr_image","gcp_artifact_registry_docker_image","azure_container_registry_image"]},network:{virtualNetwork:["aws_vpc","gcp_vpc","azure_virtual_network"],loadBalancer:["aws_elastic_load_balancer","gcp_forwarding_rule","azure_load_balancer","azure_traffic_manager_profile"],targetGroup:["aws_target_group"],certificate:["aws_acm_certificate","gcp_certificate_manager_certificate","azure_app_service_certificate"]}},[hZe,sl,ks]=Y3(z3),yZe=Object.fromEntries(sl.map(e=>[e,e]));function Y3(e){let t=[],n=[],o=[],i=Object.keys(e);for(let a of i){t.push(a);let c=e[a];for(let l in c){n.push(l);let m=c[l];Array.isArray(m)&&o.push(...m)}}return[$g(t),$g(n),$g(o)]}function $g(e){if(e.length===0)throw new Error("Array must have at least one element.");return e}var jg=r.Enum(["HTTP","HTTPS","TCP","UDP","GENEVE","TLS","TLS_QUIC","TCP_UDP","TCP_QUIC","QUIC"]),V3=r.Object({versioningStatus:r.Optional(r.Enum(["Enabled","Disabled","Suspended","Not configured"]))}),Q3=r.Object({domainName:r.Optional(r.String()),origins:r.Optional(r.Array(r.String()))}),W3=r.Object({allocatedStorageGib:r.Optional(r.Number()),encryptedAtRest:r.Optional(r.Boolean()),engine:r.Optional(r.String()),dynamoDbItemCount:r.Optional(r.Number()),dynamoDbActualSizeGib:r.Optional(r.Number())}),Z3=r.Object({version:r.Optional(r.String()),virtualNetworkId:r.Optional(r.String()),subnets:r.Optional(r.Array(r.String()))}),X3=r.Object({artifactRegistryFormat:r.Optional(r.Enum(["FORMAT_UNSPECIFIED","DOCKER","MAVEN","NPM","APT","YUM","PYTHON","KFP","GO","GENERIC"])),uri:r.Optional(r.String()),tagMutability:r.Optional(r.Enum(["MUTABLE","IMMUTABLE"])),scanOnPush:r.Optional(r.Boolean()),encryptionType:r.Optional(r.String())}),J3=r.Object({status:r.Optional(r.String()),activeServices:r.Optional(r.Number()),pendingTasks:r.Optional(r.Number()),runningTasks:r.Optional(r.Number()),registeredContainerInstances:r.Optional(r.Number()),capacityProviders:r.Optional(r.Array(r.String()))}),eY=r.Object({status:r.Optional(r.String()),desiredStatus:r.Optional(r.String()),healthStatus:r.Optional(r.String()),availabilityZone:r.Optional(r.String()),startedAt:r.Optional(A())}),tY=r.Object({isEncrypted:r.Optional(r.Boolean()),ownerId:r.Optional(r.String()),state:r.Optional(r.Enum(["creating","available","deleting","deleted","error","updating"]))}),rY=r.Object({type:r.Optional(r.String()),osType:r.Optional(r.String()),subnetIds:r.Optional(r.Array(r.String())),nbContainers:r.Optional(r.Number())}),nY=r.Object({digest:r.String(),imageTags:r.Array(r.String()),imageSizeBytes:r.Optional(r.Number()),imagePushedAt:r.Optional(A()),mediaType:r.Optional(r.String()),repositoryName:r.String(),repositoryId:r.Optional(r.String()),scanStatus:r.Optional(r.String())}),oY=r.Object({url:r.Optional(r.String()),maxMessageSizeBytes:r.Optional(r.Number()),messageRetentionHours:r.Optional(r.Number())}),iY=r.Object({runtime:r.Optional(r.String()),memoryAllocationMib:r.Optional(r.Number()),timeoutMs:r.Optional(r.Number()),codeSha256:r.Optional(r.String())}),aY=r.Object({kind:r.Optional(r.String())}),sY=r.Object({instanceId:r.String(),architecture:r.Optional(r.String()),instanceType:r.Optional(r.String()),operatingSystem:r.Optional(r.String()),memoryMib:r.Optional(r.Number()),vCpus:r.Optional(r.Number()),vpcId:r.Optional(r.String()),k8sClusterId:r.Optional(r.String())}),cY=r.Object({id:r.Optional(r.String()),ipCidrBlocks:r.Array(r.String())}),pY=r.Object({protocol:r.Optional(jg),port:r.Optional(r.Number()),instanceProtocol:r.Optional(jg),instancePort:r.Optional(r.Number())}),uY=r.Object({protocol:r.Optional(r.String()),ports:r.Optional(r.Array(r.String())),portRange:r.Optional(r.String()),allPorts:r.Optional(r.Boolean())}),lY=r.Object({name:r.String(),ip:r.Optional(r.String()),type:r.Enum(["public","private"])}),mY=r.Object({type:r.String(),name:r.String()}),dY=r.Object({frontendIp:r.Optional(lY),backendIpPools:r.Array(mY)}),fY=r.Object({targetId:r.String(),targetPort:r.Optional(r.Number()),targetType:r.Optional(r.Enum(["instance","ip","lambda","alb"])),healthState:r.Optional(r.String()),healthReason:r.Optional(r.String()),healthDescription:r.Optional(r.String()),availabilityZone:r.Optional(r.String())}),gY=r.Object({protocol:r.Optional(jg),port:r.Optional(r.Number()),type:r.Optional(r.Enum(["alb","lambda","instance","ip"])),name:r.Optional(r.String()),targetGroupArn:r.Optional(r.String()),virtualNetworkId:r.Optional(r.String()),healthCheckProtocol:r.Optional(r.String()),healthCheckPort:r.Optional(r.String()),healthCheckPath:r.Optional(r.String()),healthCheckIntervalSeconds:r.Optional(r.Number()),healthCheckTimeoutSeconds:r.Optional(r.Number()),healthyThresholdCount:r.Optional(r.Number()),unhealthyThresholdCount:r.Optional(r.Number()),targets:r.Optional(r.Array(fY)),targetCount:r.Optional(r.Number()),healthyTargetCount:r.Optional(r.Number()),loadBalancerArns:r.Optional(r.Array(r.String()))}),hY=r.Object({first:r.Optional(r.String()),last:r.Optional(r.String()),scope:r.Optional(r.Number())}),yY=r.Object({type:r.Optional(r.String()),name:r.Optional(r.String()),alwaysServe:r.Optional(r.Boolean()),subnets:r.Optional(r.Array(r.Union([r.Number(),hY]))),target:r.Optional(r.String()),weight:r.Optional(r.Number()),priority:r.Optional(r.Number()),status:r.Optional(r.String())}),TY=r.Object({instanceId:r.Optional(r.String()),state:r.Optional(r.String()),reasonCode:r.Optional(r.String()),description:r.Optional(r.String())}),EY=r.Object({loadBalancerType:r.Optional(r.String()),dnsName:r.Optional(r.String()),virtualNetworkId:r.Optional(r.String()),subnetIds:r.Array(r.String()),scheme:r.Optional(r.String()),listeners:r.Optional(r.Union([r.Array(pY),r.Array(uY)])),targets:r.Optional(r.Union([r.Array(r.String()),r.Array(TY),r.Array(yY)])),azureLoadBalancingRules:r.Optional(r.Array(dY))}),_Y=r.Object({domainName:r.Optional(r.String()),expiresAt:r.Optional(A()),inUseBy:r.Optional(r.Array(r.String())),renewalEligibility:r.Optional(r.String()),revokedAt:r.Optional(A()),status:r.Optional(r.String()),type:r.Optional(r.String())}),IY=r.Object({state:r.Optional(r.Enum(["creating","available","deleting","deleted","error","in-use"])),volumeType:r.Optional(r.Enum(["gp2","gp3","io1","io2","st1","sc1","standard"]))}),bY=r.Object({osType:r.Optional(r.Enum(["Windows","Linux"]))}),SY=r.Object({state:r.Optional(r.String()),volumeType:r.Optional(r.String())}),AY=r.Intersect([r.Object({isEncrypted:r.Optional(r.Boolean()),sizeGib:r.Optional(r.Number())}),r.Union([IY,SY,bY])]),OY=r.Object({instanceCount:r.Optional(r.Number()),hostnames:r.Optional(r.Array(r.String())),runtime:r.Optional(r.String())}),cl=r.Union([r.Object({category:r.Literal("application"),resourceType:r.Literal("webService"),attributes:r.Optional(OY)}),r.Object({category:r.Literal("data"),resourceType:r.Literal("bucket"),attributes:r.Optional(V3)}),r.Object({category:r.Literal("data"),resourceType:r.Literal("messagingService"),attributes:r.Optional(oY)}),r.Object({category:r.Literal("data"),resourceType:r.Literal("fileSystem"),attributes:r.Optional(tY)}),r.Object({category:r.Literal("data"),resourceType:r.Literal("contentDeliveryNetwork"),attributes:r.Optional(Q3)}),r.Object({category:r.Literal("data"),resourceType:r.Literal("database"),attributes:r.Optional(W3)}),r.Object({category:r.Literal("data"),resourceType:r.Literal("storageAccount"),attributes:r.Optional(aY)}),r.Object({category:r.Literal("data"),resourceType:r.Literal("volume"),attributes:r.Optional(AY)}),r.Object({category:r.Literal("compute"),resourceType:r.Literal("virtualMachine"),attributes:r.Optional(sY)}),r.Object({category:r.Literal("compute"),resourceType:r.Literal("serverless"),attributes:r.Optional(iY)}),r.Object({category:r.Literal("container"),resourceType:r.Literal("kubernetesCluster"),attributes:r.Optional(Z3)}),r.Object({category:r.Literal("container"),resourceType:r.Literal("containerRepository"),attributes:r.Optional(X3)}),r.Object({category:r.Literal("container"),resourceType:r.Literal("containerCluster"),attributes:r.Optional(J3)}),r.Object({category:r.Literal("container"),resourceType:r.Literal("containerServiceTask"),attributes:r.Optional(eY)}),r.Object({category:r.Literal("container"),resourceType:r.Literal("containerService"),attributes:r.Optional(rY)}),r.Object({category:r.Literal("container"),resourceType:r.Literal("containerImage"),attributes:r.Optional(nY)}),r.Object({category:r.Literal("network"),resourceType:r.Literal("virtualNetwork"),attributes:r.Optional(cY)}),r.Object({category:r.Literal("network"),resourceType:r.Literal("loadBalancer"),attributes:EY}),r.Object({category:r.Literal("network"),resourceType:r.Literal("targetGroup"),attributes:r.Optional(gY)}),r.Object({category:r.Literal("network"),resourceType:r.Literal("certificate"),attributes:r.Optional(_Y)})],{description:"Normalized public inventory category, resource type, and category-specific attributes. Attribute shape depends on the category and resourceType combination."});var bo="/v0/inventory",Cv=["scan_in_progress","success","failure","partial"],qg=r.Object({id:r.String({description:"Identifier of the inventory resource. Generated by Tsuga."}),cloudPlatform:r.Enum(_n,{description:"Cloud platform where Tsuga discovered this resource."}),cloudAccount:r.String({description:"Cloud-native account identifier where Tsuga discovered this resource, such as an AWS account ID, GCP project ID, or Azure subscription ID."}),cloudRegion:r.Optional(r.String({description:"Cloud region where Tsuga discovered this resource, when the resource is regional."})),fullyQualifiedResourceId:r.String({description:"Cloud-native unique identifier for this resource, such as an AWS ARN, GCP resource name, or Azure resource ID."}),displayName:r.String({description:"Human-readable resource name shown in Tsuga. Derived from cloud provider metadata when available."}),nativeResourceType:r.String({description:"Cloud-native resource type reported by the inventory integration, for example `aws_ec2_instance` or `gcp_bucket`."}),resourceCreatedAt:r.Optional(A({description:"Timestamp when the resource was created in the cloud, when known."})),resourceUpdatedAt:r.Optional(A({description:"Timestamp when the resource was last updated in the cloud, when known."})),resourceLastSeenAt:A({description:"Timestamp when Tsuga last observed this resource during an inventory scan."}),tags:De,nativeAttributes:r.Optional(r.Unsafe({type:"object",additionalProperties:!0})),covered:r.Optional(r.Boolean({description:"Whether the resource is covered by the configured infrastructure-as-code identifiers"}))}),Qi={DISPLAY_NAME:"displayName",CLOUD_ACCOUNT:"cloudAccount",NATIVE_RESOURCE_TYPE:"nativeResourceType",CLOUD_REGION:"cloudRegion",RESOURCE_TYPE:"resourceType",RESOURCE_CREATED_AT:"resourceCreatedAt"},Pv=r.Object({cloudPlatforms:_e(r.Enum(_n),{description:"Restrict results to resources discovered on any of these cloud platforms",maxItems:_n.length}),cloudAccounts:_e(u({allowEmpty:!1}),{description:"Restrict results to resources in any of these cloud accounts",maxItems:500}),cloudRegions:_e(u({allowEmpty:!1}),{description:"Restrict results to resources in any of these cloud regions",maxItems:500}),nativeResourceTypes:_e(r.Enum(ks),{description:"Restrict results to resources of any of these cloud-native resource types",maxItems:ks.length}),resourceTypes:_e(r.Enum(sl),{description:"Restrict results to resources of any of these normalized resource types",maxItems:sl.length}),tags:_e(Bt.items,{description:"Restrict results to resources that have at least one of the listed key/value tags",maxItems:50}),isIacManaged:r.Boolean({description:"Restrict results by infrastructure-as-code coverage. When true, only resources covered by the configured IaC identifiers are returned; when false, only uncovered resources are returned."}),searchQuery:r.Object({value:u({allowEmpty:!1,description:"Case-insensitive substring matched against resource ID, display name, fully-qualified resource ID, cloud account, region, and resource type. Use the `tags` filter to narrow by tag. Wildcard characters are treated literally."}),exclude:r.Optional(r.Boolean({description:"If true, exclude resources matching this value instead of including them"}))},{description:"Search query filter for resources."})},{description:"Optional filters applied to narrow the returned resources"}),Bg=r.Partial(r.Object({...ge,filters:r.Partial(Pv,{description:"Filters applied to narrow the returned resources."}),sort:r.Object({by:r.Enum([Qi.DISPLAY_NAME,Qi.CLOUD_ACCOUNT,Qi.NATIVE_RESOURCE_TYPE,Qi.CLOUD_REGION,Qi.RESOURCE_TYPE,Qi.RESOURCE_CREATED_AT],{description:"Field to sort the returned resources by"}),direction:r.Enum(["asc","desc"],{description:"Sort direction: ascending or descending"})},{description:"Optional sorting applied to the returned resources. Ties are broken by resource ID for stable pagination."})})),xZe=d({tags:["inventory"],method:"POST",url:`${bo}/resources/query`,paginated:!0,body:Bg,response:r.Array(r.Intersect([qg,cl]))}),xY=["resourceType","cloudAccount","isIacManaged"],RZe=d({tags:["inventory"],method:"POST",url:`${bo}/resources/counts`,body:r.Object({filters:r.Optional(r.Partial(Pv)),groupBy:r.Enum(xY,{description:"Dimension to group the resource counts by."})}),response:r.Array(r.Object({value:r.String({description:'The group value the count belongs to: a resource type, a cloud account id, or "true"/"false" for IaC coverage.'}),count:r.Integer({description:"Number of resources in this group matching the requested filters."})}))}),CZe=d({tags:["inventory"],method:"GET",url:`${bo}/resources/filter-options`,response:r.Object({cloudRegions:r.Array(r.String(),{description:"Distinct cloud regions present across the tenant's resources."}),nativeResourceTypes:r.Array(r.String(),{description:"Distinct cloud-native resource types present across the tenant's resources."}),tags:qt})}),PZe=C("type",[r.Object({type:r.Literal("aws",{description:"Discriminator identifying AWS connection settings."}),accountId:r.String({description:"AWS account ID that Tsuga scans."}),externalId:r.String({description:"External ID Tsuga passes when assuming the cross-account IAM role."}),roleArn:r.String({description:"ARN of the IAM role Tsuga assumes to read inventory in the account."})}),r.Object({type:r.Literal("gcp",{description:"Discriminator identifying GCP connection settings."}),projectId:r.String({description:"GCP project ID that Tsuga scans."}),serviceAccountId:r.String({description:"Service account Tsuga impersonates to read inventory."}),workloadIdentityProvider:r.String({description:"Workload identity provider resource name used for federated authentication."})}),r.Object({type:r.Literal("azure",{description:"Discriminator identifying Azure connection settings."}),clientId:r.String({description:"Client ID of the Azure application Tsuga authenticates as."}),subscriptionId:r.String({description:"Azure subscription ID that Tsuga scans."}),tenantId:r.String({description:"Azure tenant ID that owns the subscription."})})]),RY="^[0-9]{12}$",CY="^arn:aws[a-z-]*:iam::[0-9]{12}:role/.+$",PY="^[a-z][a-z0-9-]{4,28}[a-z0-9]$",UY="^[^@\\s]+@[^@\\s]+\\.iam\\.gserviceaccount\\.com$",wY="^//iam\\.googleapis\\.com/projects/[0-9]+/locations/global/workloadIdentityPools/[^/]+/providers/[^/]+$",Fg="^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$",vY=r.Object({type:r.Literal("aws",{description:"Discriminator identifying AWS connection settings."}),accountId:r.String({pattern:RY,description:"AWS account ID that Tsuga scans.",errorMessage:{pattern:"Must be a 12-digit AWS account ID."}}),externalId:u({allowEmpty:!1,description:"External ID Tsuga passes when assuming the cross-account IAM role."}),roleArn:r.String({pattern:CY,minLength:1,maxLength:2048,description:"ARN of the IAM role Tsuga assumes to read inventory in the account.",errorMessage:{pattern:"Must be an IAM role ARN, e.g. arn:aws:iam::123456789012:role/MyRole."}})},{$id:"AwsConnectionSettings"}),NY=r.Object({type:r.Literal("gcp",{description:"Discriminator identifying GCP connection settings."}),projectId:r.String({pattern:PY,minLength:6,maxLength:30,description:"GCP project ID that Tsuga scans.",errorMessage:{pattern:"Must be a GCP project ID (6-30 chars: lowercase letters, digits, hyphens)."}}),serviceAccountId:r.String({pattern:UY,minLength:1,maxLength:128,description:"Service account Tsuga impersonates to read inventory.",errorMessage:{pattern:"Must be a service account email, e.g. name@project.iam.gserviceaccount.com."}}),workloadIdentityProvider:r.String({pattern:wY,minLength:1,maxLength:256,description:"Full resource name of the workload identity provider used for federated authentication, e.g. //iam.googleapis.com/projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider.",errorMessage:{pattern:"Must be the full provider resource name: //iam.googleapis.com/projects/<PROJECT_NUMBER>/locations/global/workloadIdentityPools/<POOL_ID>/providers/<PROVIDER_ID>."}})},{$id:"GcpConnectionSettings"}),LY=r.Object({type:r.Literal("azure",{description:"Discriminator identifying Azure connection settings."}),clientId:r.String({pattern:Fg,minLength:1,description:"Client ID of the Azure application Tsuga authenticates as (GUID).",errorMessage:{pattern:"Must be a GUID."}}),subscriptionId:r.String({pattern:Fg,minLength:1,description:"Azure subscription ID that Tsuga scans (GUID).",errorMessage:{pattern:"Must be a GUID."}}),tenantId:r.String({pattern:Fg,minLength:1,description:"Azure tenant ID that owns the subscription (GUID).",errorMessage:{pattern:"Must be a GUID."}})},{$id:"AzureConnectionSettings"}),Uv=C("type",[vY,NY,LY],{description:"Credentials Tsuga uses to scan the account, in the provider-specific shape selected by `type`. Credentials are stored as provided and are not validated at creation time; failures surface through `lastScanStatus`."}),Wi=r.Object({id:r.String({description:"Identifier of the cloud account. Generated by Tsuga."}),cloudType:r.Enum(_n,{description:"Cloud provider of the account."}),cloudAccountId:r.String({description:"Cloud-native account identifier: an AWS account ID, GCP project ID, or Azure subscription ID."}),accountFriendlyName:r.Optional(r.String({description:"Human-readable name for the account shown in Tsuga."})),organizationId:r.Optional(r.String({description:"Cloud organization identifier, when known."})),createdBy:r.Optional(r.String({description:"Identifier of the user who created the account, when created by a user."})),createdAt:A({description:"Timestamp when the account was registered in Tsuga."}),lastScanStartedAt:r.Optional(A({description:"Timestamp when the most recent inventory scan started."})),lastScanFinishedAt:r.Optional(A({description:"Timestamp when the most recent inventory scan finished."})),lastScanStatus:r.Optional(r.Enum(Cv,{description:"Status of the most recent inventory scan."}))}),Hg=r.Object({cloudType:r.Enum(_n,{description:"Cloud provider of the account."}),cloudAccountId:u({allowEmpty:!1,description:"Cloud-native account identifier: an AWS account ID, GCP project ID, or Azure subscription ID."}),accountFriendlyName:r.Optional(u({description:"Human-readable name for the account shown in Tsuga."})),organizationId:r.Optional(u({description:"Cloud organization identifier, when known."})),connectionSettings:Uv,lastScanStatus:r.Optional(r.Enum(Cv,{description:"Status of the most recent inventory scan."}))}),So=`${bo}/cloud-accounts`,UZe=d({tags:["inventory"],url:So,method:"GET",response:r.Array(Wi)}),wZe=d({tags:["inventory"],url:`${So}/:id`,method:"GET",params:r.Object({id:u()}),response:Wi}),vZe=d({tags:["inventory"],url:So,method:"POST",body:Hg,response:Wi}),Kg=r.Object({accountFriendlyName:u({description:"Human-readable name for the account shown in Tsuga."})}),NZe=d({tags:["inventory"],url:`${So}/:id`,method:"PUT",params:r.Object({id:u()}),body:Kg,response:Wi}),LZe=d({tags:["inventory"],url:`${So}/:id`,method:"DELETE",params:r.Object({id:u()}),response:N}),kZe=d({tags:["inventory"],url:`${bo}/trigger-scan`,method:"POST",body:r.Object({}),response:r.Object({success:r.Literal(!0)})}),MZe=d({tags:["inventory"],url:`${So}/azure/onboarding`,method:"POST",body:r.Object({tenantId:u()}),response:r.Object({subjectId:r.String(),audience:r.String()})}),DZe=d({tags:["inventory"],method:"POST",url:`${So}/validate/:type`,params:r.Object({type:u()}),body:r.Object({data:Uv,id:r.Optional(u())}),response:r.Object({areAccountSettingsValid:r.Boolean(),message:r.Optional(r.String())})}),wv=`${bo}/settings`,GZe=d({tags:["inventory"],url:wv,method:"GET",response:r.Object({settings:r.Optional(r.Object({id:r.String(),infrastructureIdentifiers:r.Array(r.Object({name:r.String(),value:r.Optional(r.String())}))}))})}),kY=50,$Ze=d({tags:["inventory"],url:wv,method:"POST",body:r.Object({infrastructureIdentifiers:r.Array(r.Object({name:u({allowEmpty:!1}),value:r.Optional(u({allowEmpty:!1}))}),{maxItems:kY})}),response:r.Object({})}),jZe=d({tags:["inventory"],url:`${bo}/iac-tags-proposal`,method:"GET",response:r.Array(r.Object({name:r.String(),value:r.Optional(r.String())}))});var vv=`/${"v1"}/inventory`,MY=r.Omit(qg,["nativeAttributes","covered"],{$id:"InventoryResourceBase",description:"Base fields shared by cloud resources discovered during inventory scans. Public inventory resources omit raw provider-native attributes and infrastructure-as-code coverage fields. See [Cloud resources](/documentation/categorize/cloud-resources)."}),Nv=r.Intersect([MY,cl],{$id:"InventoryResource",description:"Cloud resource discovered by an inventory scan, together with normalized category, resource type, and public category-specific attributes. See [Cloud resources](/documentation/categorize/cloud-resources)."}),DY={id:"123-456-abc",cloudPlatform:"aws",cloudAccount:"123456789012",cloudRegion:"us-east-1",fullyQualifiedResourceId:"arn:aws:s3:::tsuga-example-bucket",displayName:"tsuga-example-bucket",nativeResourceType:"aws_s3_bucket",resourceCreatedAt:"2024-01-01T08:00:00.000Z",resourceLastSeenAt:"2024-01-15T12:34:56.000Z",tags:[{key:"team",value:"platform"}],category:"data",resourceType:"bucket",attributes:{versioningStatus:"Enabled"}};Object.assign(Nv,{examples:[DY]});var Lv=r.Object({...Bg.properties,...Ze},{description:"Inventory resource query request. Use filters, sorting, limit, and offset to page through discovered resources."}),GY={filters:{cloudPlatforms:{values:["aws"]},cloudAccounts:{values:["123456789012"]},cloudRegions:{values:["us-east-1"]},resourceTypes:{values:["bucket"]},nativeResourceTypes:{values:["aws_s3_bucket"]},tags:{values:[{key:"team",value:"platform"}]},isIacManaged:!0,searchQuery:{value:"tsuga-example"}},sort:{by:"displayName",direction:"asc"},limit:10,offset:0};Object.assign(Lv,{examples:[GY]});var kv=d({description:"Queries cloud resources discovered by inventory scans, with optional filters, sorting, and pagination. Use this endpoint to build infrastructure inventories across connected cloud accounts.",operationId:"queryInventoryResources",tags:["inventory"],url:`${vv}/resources/query`,method:"POST",paginated:!0,body:Lv,response:r.Array(Nv)}),Ms=`${vv}/cloud-accounts`,Ds=r.Pick(Wi,["id","cloudType","cloudAccountId","accountFriendlyName"],{$id:"CloudAccount"}),$Y={id:"123-456-abc",cloudType:"aws",cloudAccountId:"123456789012",accountFriendlyName:"Production AWS"};Object.assign(Ds,{examples:[$Y]});var Mv=r.Pick(Hg,["cloudType","cloudAccountId","accountFriendlyName","connectionSettings"]),jY={cloudType:"aws",cloudAccountId:"123456789012",accountFriendlyName:"Production AWS",connectionSettings:{type:"aws",accountId:"123456789012",externalId:"tsuga-external-id",roleArn:"arn:aws:iam::123456789012:role/tsuga-inventory"}};Object.assign(Mv,{examples:[jY]});var FY=r.Pick(Kg,["accountFriendlyName"]),QZe=d({description:"Lists cloud accounts connected to Tsuga that the authenticated operation key can read.",operationId:"listCloudAccounts",tags:["inventory"],url:Ms,method:"GET",response:r.Array(Ds)}),WZe=d({description:"Retrieves one cloud account by ID.",operationId:"getCloudAccount",tags:["inventory"],url:`${Ms}/:id`,method:"GET",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the cloud account to retrieve. Use the `id` returned by the cloud account list or create operations."})}),response:Ds}),ZZe=d({description:"Registers a cloud account for inventory scanning. Connection settings are stored as provided and are not validated at creation time; scan failures surface through `lastScanStatus`.",operationId:"createCloudAccount",tags:["inventory"],url:Ms,method:"POST",body:Mv,response:Ds}),XZe=d({description:"Updates the friendly name of a cloud account by ID.",operationId:"updateCloudAccount",tags:["inventory"],url:`${Ms}/:id`,method:"PUT",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the cloud account to update. Use the `id` returned by the cloud account list or create operations."})}),body:FY,response:Ds}),JZe=d({description:"Deletes a cloud account by ID. Future inventory scans stop for the account, and the trust relationship on the cloud side can be safely removed afterward.",operationId:"deleteCloudAccount",tags:["inventory"],url:`${Ms}/:id`,method:"DELETE",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the cloud account to delete. Use the `id` returned by the cloud account list or create operations."})}),response:N});var Gs="/v0/investigations",qY=["dashboard","monitor","service","slo","log-route","adaptive-notification-rule"],BY=r.Object({type:r.String({description:'Kind of linked asset, e.g. "dashboard"'}),id:r.String({description:"Identifier of the linked asset"})}),HY=r.Object({type:r.Enum(qY,{description:"Kind of linked asset"}),id:u({allowEmpty:!1,description:"Identifier of the linked asset"})}),Xr=r.Object({id:r.String({description:"Identifier of the investigation"}),name:r.String({description:"Human readable name shown for the investigation"}),slug:r.Optional(r.String({description:'Immutable identifier supplied by the creating agent, e.g. "incident-2024-06-payments-5xx". Set once at creation and matched against the agent telemetry to link back to the run that created the investigation.'})),contentMd:r.Optional(r.String({description:"Markdown content capturing the investigation notes and findings"})),tags:De,owner:r.String({description:"Team ID owning the investigation"}),env:r.Optional(r.String({description:'Environment the investigation relates to, e.g. "prod"'})),linkedAssets:r.Array(BY,{description:"Assets (dashboards, monitors, \u2026) referenced by this investigation"}),creator:r.Optional(pe),updater:r.Optional(pe),createdAt:A({description:"Timestamp the investigation was created at."}),updatedAt:A({description:"Timestamp the investigation was last updated at."})},{title:"Investigation"}),pl=r.Object({name:u({allowEmpty:!1,description:"Human readable name shown for the investigation"}),slug:u({type:"kebab-case",allowEmpty:!1,description:'Immutable, unique identifier supplied by the creating agent, used to link the investigation back to the agent run, e.g. "incident-2024-06-payments-5xx". The agent should also emit this value in its telemetry.'}),contentMd:r.Optional(u({type:"long",description:"Markdown content capturing the investigation notes and findings"})),tags:Xe,owner:u({allowEmpty:!1,description:"Team ID owning the investigation"}),env:r.Optional(u({allowEmpty:!0,description:"Environment the investigation relates to"})),linkedAssets:r.Optional(r.Array(HY,{maxItems:100,description:"Assets (dashboards, monitors, \u2026) referenced by this investigation"}))}),zg=r.Object(r.Omit(pl,["slug"]).properties),sXe=d({tags:["investigations"],url:Gs,method:"GET",paginated:!0,query:r.Object(ge),response:r.Array(Xr)}),cXe=d({tags:["investigations"],url:`${Gs}/:id`,params:r.Object({id:u()}),method:"GET",response:Xr}),pXe=d({tags:["investigations"],url:Gs,method:"POST",body:pl,response:Xr}),uXe=d({tags:["investigations"],url:`${Gs}/:id`,method:"PUT",body:zg,params:r.Object({id:u()}),response:Xr}),lXe=d({tags:["investigations"],url:`${Gs}/:id`,method:"DELETE",params:r.Object({id:u()}),response:N});var $s=`/${"v1"}/investigations`,Dv=d({description:"Retrieve all investigations",tags:["private"],url:$s,method:"GET",paginated:!0,query:r.Object(Ze),response:r.Array(Xr)}),Gv=d({description:"Retrieve an investigation by its id",tags:["private"],url:`${$s}/:id`,method:"GET",params:r.Object({id:u({allowEmpty:!1})}),response:Xr}),$v=d({description:"Create a new investigation",tags:["private"],url:$s,method:"POST",body:pl,response:Xr}),jv=d({description:"Update an investigation by its id",tags:["private"],url:`${$s}/:id`,method:"PUT",body:zg,params:r.Object({id:u({allowEmpty:!1})}),response:Xr}),Fv=d({description:"Delete an investigation by its id",tags:["private"],url:`${$s}/:id`,method:"DELETE",params:r.Object({id:u({allowEmpty:!1})}),response:N});var qv=15,ul={id:r.String({description:"Unique identifier of the processor within the route. Used to preserve processor identity during updates."}),description:r.Optional(r.String({description:"Optional user-provided processor note."})),tags:De,updatedAt:r.Optional(A({description:"Timestamp when Tsuga last updated the processor."}))},ll={id:u({allowEmpty:!1,description:"Unique identifier of the processor within the route. Preserve it across updates for existing processors."}),description:r.Optional(u({type:"long",description:"Optional processor note."})),tags:Xe,updatedAt:r.Optional(A({description:"Backend-maintained timestamp for this processor. Omit this field on create and update requests; Tsuga sets or preserves it based on processor changes."}))},Bv={...ul,type:r.Literal("creator",{description:"Create processor. It writes a new attribute from a format string, formula, or category rule."})},Hv={...ll,type:r.Literal("creator",{description:"Create processor. It writes a new attribute from a format string, formula, or category rule."})},KY=C("subtype",[r.Object({targetAttribute:r.String({description:"Attribute that will receive the formatted value"}),formatString:r.String({description:"Template string used to build the target attribute value"}),overrideTarget:r.Optional(r.Boolean({description:"Whether to overwrite the target attribute when it already exists. If omitted, route processing treats this as true."})),subtype:r.Literal("format-string",{description:"Builds a string from literal text and existing attribute values."}),replaceMissingByEmpty:r.Optional(r.Boolean({description:"Whether missing referenced attributes render as empty strings. If omitted, route processing treats this as true."}))},{$id:"ProcessorParamsCreatorFormatString"}),r.Object({targetAttribute:r.String({description:"Attribute that will receive the computed value"}),formula:r.String({description:"Mathematical formula evaluated to populate the target attribute"}),overrideTarget:r.Optional(r.Boolean({description:"Whether to overwrite the target attribute when it already exists. If omitted, route processing treats this as true."})),subtype:r.Literal("math-formula",{description:"Evaluates a mathematical expression and writes the numeric result."}),replaceMissingBy0:r.Optional(r.Boolean({description:"Whether missing referenced attributes evaluate as zero. If omitted, route processing treats this as true."}))},{$id:"ProcessorParamsCreatorMathFormula"}),r.Object({targetAttribute:r.String({description:"Attribute that will receive the category value"}),clauses:r.Array(r.Object({query:r.String({description:"Query that selects logs for this category clause. Clauses are evaluated in order."}),value:r.String({description:"String category value assigned when this clause matches."})}),{description:"Conditions evaluated in order to determine the category value. The first matching clause wins."}),defaultValue:r.Optional(r.String({description:"String category value used when no clause matches. If omitted and no clause matches, no category value is written."})),subtype:r.Literal("category",{description:"Assigns the first matching category value from ordered query clauses, with an optional default."})},{$id:"ProcessorParamsCreatorCategory"})],{description:"Create processor configuration. The `subtype` discriminator selects how the value written to `targetAttribute` is built and which fields are required."}),zY=C("subtype",[r.Object({targetAttribute:u({allowEmpty:!1,description:"Attribute that will receive the formatted value"}),formatString:u({allowEmpty:!1,type:"long",description:"Template string used to build the target attribute value"}),overrideTarget:r.Optional(r.Boolean({description:"Set to true to overwrite an existing target attribute value (defaults to true)"})),subtype:r.Literal("format-string",{description:"Builds a string from literal text and existing attribute values."}),replaceMissingByEmpty:r.Optional(r.Boolean({description:"Set to true for missing referenced attributes to render as empty strings. Defaults to true."}))},{$id:"InputProcessorParamsCreatorFormatString"}),r.Object({targetAttribute:u({allowEmpty:!1,description:"Attribute that will receive the computed value"}),formula:u({allowEmpty:!1,type:"long",description:"Mathematical formula evaluated to populate the target attribute"}),overrideTarget:r.Optional(r.Boolean({description:"Set to true to overwrite an existing target attribute value (defaults to true)"})),subtype:r.Literal("math-formula",{description:"Evaluates a mathematical expression and writes the numeric result."}),replaceMissingBy0:r.Optional(r.Boolean({description:"Set to true for missing referenced attributes to evaluate as zero. Defaults to true."}))},{$id:"InputProcessorParamsCreatorMathFormula"}),r.Object({targetAttribute:u({allowEmpty:!1,description:"Attribute that will receive the category value"}),clauses:r.Array(r.Object({query:u({allowEmpty:!1,type:"tsuga-query",description:"Query that selects logs for this category clause. Clauses are evaluated in order."}),value:u({allowEmpty:!1,description:"String category value assigned when this clause matches."})}),{minItems:1,maxItems:qv,description:"Conditions evaluated in order to determine the category value. The first matching clause wins."}),defaultValue:r.Optional(u({description:"String category value used when no clause matches. If omitted and no clause matches, no category value is written."})),subtype:r.Literal("category",{description:"Assigns the first matching category value from ordered query clauses, with an optional default."})},{$id:"InputProcessorParamsCreatorCategory"})],{description:"Create processor configuration. The `subtype` discriminator selects how the value written to `targetAttribute` is built and which fields are required."}),YY=r.Object({...Bv,params:KY}),VY=r.Object({...Hv,params:zY}),Kv={...ul,type:r.Literal("mapper",{description:"Map processor. It moves, copies, or normalizes existing log attributes."})},zv={...ll,type:r.Literal("mapper",{description:"Map processor. It moves, copies, or normalizes existing log attributes."})},QY=C("subtype",[r.Object({attributes:r.Array(r.Object({originAttribute:r.String({description:"Attribute name to map to the target attribute"}),keepOrigin:r.Optional(r.Boolean({description:"Whether the source attribute is preserved after mapping. If omitted, route processing treats this as false."})),overrideTarget:r.Optional(r.Boolean({description:"Whether to overwrite the target attribute when it already exists. If omitted, route processing treats this as true."})),targetAttribute:r.String({description:"Attribute name that will receive the mapped value"})}),{description:"Mappings that map individual attributes to new targets"}),subtype:r.Literal("map-attributes",{description:"Copies or moves one or more source attributes to target attributes."})},{$id:"ProcessorParamsMapperMapAttributes"}),r.Object({attributeName:r.String({description:"Attribute whose value will determine the log level"}),subtype:r.Literal("map-level",{description:"Normalizes a severity or status attribute into Tsuga log levels."})},{$id:"ProcessorParamsMapperMapLevel"}),r.Object({attributeName:r.String({description:"Attribute whose value will determine the log timestamp"}),subtype:r.Literal("map-timestamp",{description:"Uses an event-time attribute as the log timestamp."})},{$id:"ProcessorParamsMapperMapTimestamp"})],{description:"Map processor configuration. The `subtype` discriminator selects whether existing attributes are copied or moved to new names, or used to set the log level or timestamp."}),WY=C("subtype",[r.Object({attributes:r.Array(r.Object({originAttribute:u({allowEmpty:!1,description:"Attribute name to map to the target attribute"}),keepOrigin:r.Optional(r.Boolean({description:"Preserve the source attribute after mapping (defaults to false)"})),overrideTarget:r.Optional(r.Boolean({description:"Overwrite the target attribute when it already exists (defaults to true)"})),targetAttribute:u({allowEmpty:!1,description:"Attribute name that will receive the mapped value"})}),{minItems:1,maxItems:50,description:"Mappings that map individual attributes to new targets"}),subtype:r.Literal("map-attributes",{description:"Copies or moves one or more source attributes to target attributes."})},{$id:"InputProcessorParamsMapperMapAttributes"}),r.Object({attributeName:u({allowEmpty:!1,description:"Attribute whose value will determine the log level"}),subtype:r.Literal("map-level",{description:"Normalizes a severity or status attribute into Tsuga log levels."})},{$id:"InputProcessorParamsMapperMapLevel"}),r.Object({attributeName:u({allowEmpty:!1,description:"Attribute whose value will determine the log timestamp"}),subtype:r.Literal("map-timestamp",{description:"Uses an event-time attribute as the log timestamp."})},{$id:"InputProcessorParamsMapperMapTimestamp"})],{description:"Map processor configuration. The `subtype` discriminator selects whether existing attributes are copied or moved to new names, or used to set the log level or timestamp."}),ZY=r.Object({...zv,params:WY}),XY=r.Object({...Kv,params:QY}),Yv={...ul,type:r.Literal("parse-attribute",{description:"Parse processor. It extracts structured fields from a text attribute."})},Vv={...ll,type:r.Literal("parse-attribute",{description:"Parse processor. It extracts structured fields from a text attribute."})},Qv=5,JY=C("subtype",[r.Object({attributeName:r.String({description:"Attribute whose value will be parsed with Grok rules"}),rules:r.Array(r.String({description:"Grok rule applied to parse text. Route processing sends rules as engine patterns."}),{description:"Ordered Grok rules evaluated until one matches."}),samples:r.Optional(r.Array(r.String(),{description:"Example log lines for validating the Grok rules. Samples are not sent to the ingestion engine."})),subtype:r.Literal("grok",{description:"Extracts fields from unstructured text using ordered Grok rules."})}),r.Object({sourceAttribute:r.String({description:"Attribute containing the URL to parse"}),subtype:r.Literal("url",{description:"Parses a URL attribute and writes URL detail fields."})}),r.Object({sourceAttribute:r.String({description:"Attribute containing the user agent string to parse"}),subtype:r.Literal("user-agent",{description:"Parses a user-agent string and writes browser, operating system, and device details."})}),r.Object({sourceAttribute:r.String({description:"Attribute containing the key/value string segment to parse"}),targetAttribute:r.String({description:"Target map attribute where extracted key/value pairs will be written"}),keyValueSplitter:r.String({description:"Delimiter separating keys from values in the source string"}),pairsSplitter:r.String({description:"Delimiter separating each key/value pair in the source string."}),acceptStandaloneKey:r.Boolean({description:"Whether keys without explicit values are accepted by the parser."}),subtype:r.Literal("key-value",{description:"Parses delimited key/value text into attributes."})})],{description:"Parse processor configuration. The `subtype` discriminator selects which parser reads the source text attribute and which fields it extracts."}),e9=C("subtype",[r.Object({attributeName:u({allowEmpty:!1,description:"Attribute whose value will be parsed with Grok rules"}),rules:r.Array(u({allowEmpty:!1,type:"long",description:"Grok rule applied to parse text. Route processing sends rules as engine patterns."}),{minItems:1,maxItems:5,description:"Ordered Grok rules evaluated until one matches."}),samples:r.Optional(r.Array(u({type:"long"}),{maxItems:Qv,description:"Example log lines for validating the Grok rules. Samples are not sent to the ingestion engine."})),subtype:r.Literal("grok",{description:"Extracts fields from unstructured text using ordered Grok rules."})}),r.Object({sourceAttribute:u({allowEmpty:!1,description:"Attribute containing the URL to parse"}),subtype:r.Literal("url",{description:"Parses a URL attribute and writes URL detail fields."})}),r.Object({sourceAttribute:u({allowEmpty:!1,description:"Attribute containing the user agent string to parse"}),subtype:r.Literal("user-agent",{description:"Parses a user-agent string and writes browser, operating system, and device details."})}),r.Object({sourceAttribute:u({allowEmpty:!1,description:"Attribute containing the key/value string segment to parse"}),targetAttribute:u({description:"Target map attribute where extracted key/value pairs will be written"}),keyValueSplitter:u({allowEmpty:!1,description:"Delimiter separating keys from values in the source string"}),pairsSplitter:u({allowEmpty:!0,description:"Delimiter separating each key/value pair in the source string."}),acceptStandaloneKey:r.Boolean({description:"Set to true to accept keys without explicit values."}),subtype:r.Literal("key-value",{description:"Parses delimited key/value text into attributes."})})],{description:"Parse processor configuration. The `subtype` discriminator selects which parser reads the source text attribute and which fields it extracts."}),t9=r.Object({...Yv,params:JY}),r9=r.Object({...Vv,params:e9}),n9=r.Object({...Hv,params:C("subtype",[r.Object({targetAttribute:u({allowEmpty:!1,description:"Attribute that will receive the formatted value"}),formatString:u({allowEmpty:!1,type:"long",description:"Template string used to build the target attribute value"}),overrideTarget:r.Optional(r.Boolean({description:"Set to true to overwrite an existing target attribute value (defaults to true)"})),subtype:r.Literal("format-string"),replaceMissingByEmpty:r.Optional(r.Boolean({description:"Set to true for missing referenced attributes to render as empty strings. Defaults to true."}))}),r.Object({targetAttribute:u({allowEmpty:!1,description:"Attribute that will receive the category value"}),clauses:r.Array(r.Object({query:u({allowEmpty:!1,type:"tsuga-query",description:"Query that selects logs for this category clause. Clauses are evaluated in order."}),value:u({allowEmpty:!1,description:"String category value assigned when this clause matches."})}),{minItems:1,maxItems:qv,description:"Conditions evaluated in order to determine the category value. The first matching clause wins."}),defaultValue:r.Optional(u({description:"String category value used when no clause matches."})),subtype:r.Literal("category")})])}),o9=r.Object({...zv,params:r.Object({attributes:r.Array(r.Object({originAttribute:u({allowEmpty:!1,description:"Attribute name to map to the target attribute"}),keepOrigin:r.Optional(r.Boolean({description:"Preserve the source attribute after mapping (defaults to false)"})),overrideTarget:r.Optional(r.Boolean({description:"Overwrite the target attribute when it already exists (defaults to true)"})),targetAttribute:u({allowEmpty:!1,description:"Attribute name that will receive the mapped value"})}),{minItems:1,maxItems:50,description:"Mappings that map individual attributes to new targets"}),subtype:r.Literal("map-attributes")})}),i9=r.Object({...Vv,params:r.Object({attributeName:u({allowEmpty:!1,description:"Attribute whose value will be parsed with Grok rules"}),rules:r.Array(u({allowEmpty:!1,type:"long",description:"Grok rule applied to parse text. Route processing sends rules as engine patterns."}),{minItems:1,maxItems:5,description:"Ordered Grok rules evaluated until one matches."}),samples:r.Optional(r.Array(u({type:"long"}),{maxItems:Qv,description:"Example log lines for validating the Grok rules."})),subtype:r.Literal("grok")})}),AXe=C("type",[o9,i9,n9]),a9=r.Object({...Bv,params:C("subtype",[r.Object({targetAttribute:r.String({description:"Attribute that will receive the formatted value"}),formatString:r.String({description:"Template string used to build the target attribute value"}),overrideTarget:r.Optional(r.Boolean({description:"Whether to overwrite the target attribute when it already exists."})),subtype:r.Literal("format-string"),replaceMissingByEmpty:r.Optional(r.Boolean({description:"Whether missing referenced attributes render as empty strings."}))}),r.Object({targetAttribute:r.String({description:"Attribute that will receive the category value"}),clauses:r.Array(r.Object({query:r.String({description:"Query that selects logs for this category clause."}),value:r.String({description:"String category value assigned when this clause matches."})}),{description:"Conditions evaluated in order to determine the category value."}),defaultValue:r.Optional(r.String({description:"String category value used when no clause matches."})),subtype:r.Literal("category")})])}),s9=r.Object({...Kv,params:r.Object({attributes:r.Array(r.Object({originAttribute:r.String({description:"Attribute name to map to the target attribute"}),keepOrigin:r.Optional(r.Boolean({description:"Whether the source attribute is preserved after mapping."})),overrideTarget:r.Optional(r.Boolean({description:"Whether to overwrite the target attribute when it already exists."})),targetAttribute:r.String({description:"Attribute name that will receive the mapped value"})}),{description:"Mappings that map individual attributes to new targets"}),subtype:r.Literal("map-attributes")})}),c9=r.Object({...Yv,params:r.Object({attributeName:r.String({description:"Attribute whose value will be parsed with Grok rules"}),rules:r.Array(r.String({description:"Grok rule applied to parse text."}),{description:"Ordered Grok rules evaluated until one matches."}),samples:r.Optional(r.Array(r.String(),{description:"Example log lines for validating the Grok rules."})),subtype:r.Literal("grok")})}),OXe=C("type",[s9,c9,a9]),p9=11,Wv=r.Cyclic({OutputProcessor:r.Union([XY,t9,YY,r.Object({...ul,params:r.Object({items:r.Array(r.Object({query:r.String({description:"Query that determines whether logs enter this branch"}),processors:r.Array(r.Ref("OutputProcessor"),{description:"Processors executed when the branch query matches"})}),{description:"Conditional branches evaluated in order before falling back to the default"})}),type:r.Literal("split",{description:"Split processor. It sends each log through the first matching conditional branch."})})])},"OutputProcessor",{description:"Processing step executed sequentially on route logs"}),Zv=r.Cyclic({InputProcessor:r.Union([ZY,r9,VY,r.Object({...ll,params:r.Object({items:r.Array(r.Object({query:u({type:"tsuga-query",description:"Query that determines whether logs enter this branch"}),processors:r.Array(r.Ref("InputProcessor"),{maxItems:50,description:"Processors executed when the branch query matches"})}),{minItems:2,maxItems:p9,description:"Conditional branches evaluated in order before falling back to the default"})}),type:r.Literal("split",{description:"Split processor. It sends each log through the first matching conditional branch."})})])},"InputProcessor",{description:"Processing step executed sequentially on route logs"});var u9="/v0/logs",vn=`${u9}/routes`,Nn=r.Object({id:r.String({description:"Tsuga-generated log route ID assigned when the route is created."}),name:r.String({description:"Human-readable route name shown in Tsuga."}),description:r.Optional(r.String({description:"Optional free-text note about the route's purpose, set by the caller. This metadata is not evaluated when matching or processing logs."})),isEnabled:r.Boolean({description:"Whether this route is active for newly ingested logs. Disabled routes remain saved but do not process logs."}),query:r.String({description:"Tsuga query that selects which newly ingested logs enter the route processor chain."}),rank:r.Number({description:"Tsuga-assigned evaluation order, unique across all routes and dense (no gaps). Enabled routes are checked from lower rank to higher rank during ingestion, and every route whose query matches a log applies its processors to it \u2014 matching is not stopped after the first hit. New routes are appended with the highest rank; deleting a route shifts all higher ranks down by one to close the gap. Use `PUT /:id/modify-ranking` to move a route to a different rank, which shifts the routes between its old and new position accordingly."}),tags:De,owner:r.String({description:"ID of the team that owns the route. Determines which team members can view and manage it, and which tag policies apply to it. Only an org admin or an admin of this team may change the `query` field or delete the route."}),processors:r.Array(Wv,{description:"Processors applied in array order to logs that match the route, each transforming the output of the previous one. A `split` processor forks the chain into branches and cannot be followed by another processor at the same level."}),creator:r.Optional(pe),updater:r.Optional(pe),updatedAt:A({description:"Timestamp when Tsuga last updated the route."}),createdAt:A({description:"Timestamp when Tsuga created the route."}),assetUpdatedAt:A({description:"Timestamp when Tsuga last changed route behavior. This can differ from `updatedAt` when only metadata such as `description` or `tags` changed."})},{title:"LogRoute"}),js=r.Object({name:u({allowEmpty:!1,description:"Human-readable log route name shown in Tsuga."}),description:r.Optional(u({type:"long",description:"Optional free-text note about the log route's purpose. This metadata is not evaluated when matching or processing logs."})),isEnabled:r.Boolean({description:"Set to true for the log route to process newly ingested matching logs. Set to false to save it without running it."}),query:u({type:"tsuga-query",description:"Tsuga query that selects which newly ingested logs enter the log route processor chain."}),tags:Xe,owner:u({allowEmpty:!1,description:"ID of the team that will own the log route, determining which team members can view and manage it and which tag policies apply. Only an org admin or an admin of this team may change the `query` field or delete the log route."}),processors:r.Array(Zv,{maxItems:50,description:"Processors applied in array order to logs that match the log route, each transforming the output of the previous one. Up to 50 are accepted. A `split` processor forks the chain into branches and cannot be followed by another processor at the same level."})});var LXe=d({tags:["routes"],url:vn,method:"GET",paginated:!0,query:r.Object(ge),response:r.Array(Nn)}),kXe=d({tags:["routes"],url:`${vn}/:id`,params:r.Object({id:u()}),method:"GET",response:Nn}),MXe=d({tags:["routes"],url:vn,method:"POST",body:js,response:Nn}),DXe=d({tags:["routes"],url:`${vn}/:id`,method:"PUT",body:js,params:r.Object({id:u()}),response:Nn}),GXe=d({tags:["routes"],url:`${vn}/:id/clone`,method:"POST",params:r.Object({id:u()}),body:js,response:Nn}),$Xe=d({tags:["routes"],url:`${vn}/:id`,method:"DELETE",params:r.Object({id:u()}),response:N}),jXe=d({description:"Moves a route to a new rank, shifting the ranks of the routes between its old and new position by one to keep ranks dense and unique. Affects the route's evaluation order for newly ingested logs; does not change any route's processors or other fields.",tags:["routes"],url:`${vn}/:id/modify-ranking`,method:"PUT",params:r.Object({id:u()}),body:r.Object({rank:r.Integer({minimum:1,description:"Target rank for the route, from 1 to the total number of routes. Requests outside that range are rejected."})}),response:r.Object({})}),FXe=d({description:"Sets a route's `isEnabled` state without changing any other field. Disabling a route stops it from processing newly ingested logs while keeping it saved and its rank unchanged.",tags:["routes"],url:`${vn}/:id/enable`,method:"PUT",params:r.Object({id:u()}),body:r.Object({enable:r.Boolean({description:"Set to true to enable the route, or false to disable it."})}),response:Nn});var Fs=`/${"v1"}/routes`,Xv={name:"Enrich API Gateway Logs",description:"Adds service metadata and normalizes log format",isEnabled:!0,query:"service:api-gateway",tags:[{key:"category",value:"enrichment"}],owner:"team-123-abc",processors:[{id:"parse-gateway-message",type:"parse-attribute",tags:[],params:{subtype:"grok",attributeName:"message",rules:["%{TIMESTAMP_ISO8601:timestamp} %{LOGLEVEL:level} %{GREEDYDATA:msg}"]}}]},Jv={name:"Normalize Checkout Logs",description:"Maps service fields and extracts key/value details",isEnabled:!0,query:"context.service.name:checkout",tags:[{key:"category",value:"normalization"}],owner:"team-123-abc",processors:[{id:"map-service-name",type:"mapper",tags:[],params:{subtype:"map-attributes",attributes:[{originAttribute:"context.service.name",targetAttribute:"service",keepOrigin:!1,overrideTarget:!0}]}},{id:"parse-logfmt-message",type:"parse-attribute",tags:[],params:{subtype:"key-value",sourceAttribute:"message",targetAttribute:"logfmt",keyValueSplitter:"=",pairsSplitter:" ",acceptStandaloneKey:!1}}]},qs=r.Pick(Nn,["id","name","description","isEnabled","query","tags","owner","processors"],{$id:"Route",description:"Team-owned log processing definition that selects newly ingested logs and applies ordered processors. See [Routes](/documentation/process/routes/index)."}),l9={id:"123-456-abc",...Xv},m9={id:"456-789-def",...Jv};Object.assign(qs,{examples:[l9,m9]});var eN=d({description:"Lists log routes visible to the authenticated operation key. Returned routes are ordered by evaluation order, with earlier routes evaluated first. Use this to inventory ingest-time processing definitions and owners. Pagination fields limit the returned page.",operationId:"listRoutes",tags:["routes"],url:Fs,method:"GET",paginated:!0,query:r.Object(Ze),response:r.Array(qs)}),tN=d({description:"Retrieves one log route by ID.",operationId:"getRoute",tags:["routes"],url:`${Fs}/:id`,method:"GET",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the log route to retrieve. Use the `id` returned by route list or create responses."})}),response:qs}),Yg=r.Pick(js,["name","description","isEnabled","query","tags","owner","processors"],{description:"Log route create or update request. Provide the route metadata, source query, owner team, enabled state, tags, and ordered processors."});Object.assign(Yg,{examples:[Xv,Jv]});var rN=d({description:"Creates a log route at the end of the evaluation order. Routes affect only newly ingested logs after the cluster receives the updated configuration.",operationId:"createRoute",tags:["routes"],url:Fs,method:"POST",body:Yg,response:qs}),nN=d({description:"Updates an existing log route by ID without changing its evaluation order. Fields omitted from the request keep their existing values. Routes affect only newly ingested logs after the cluster receives the updated configuration.",operationId:"updateRoute",tags:["routes"],url:`${Fs}/:id`,method:"PUT",body:Yg,params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the log route to update. Use the `id` returned by route list, get, or create responses."})}),response:qs}),oN=d({description:"Deletes a log route by ID and compacts the evaluation order for remaining routes. The route stops processing future logs after the cluster receives the updated configuration.",operationId:"deleteRoute",tags:["routes"],url:`${Fs}/:id`,method:"DELETE",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the log route to delete. Use the `id` returned by route list, create, or update responses."})}),response:N});var Bs=`/${"v1"}/monitors`,Hs=r.Pick(qr,["id","name","message","tags","configuration","priority","owner","dashboardId","permissions","clusterIds"],{$id:"Monitor",description:"Saved alert definition that evaluates telemetry and creates alert transitions. Notification delivery is configured separately with notification rules. See [Monitors](/documentation/alert/monitors/index)."}),aN={name:"High Error Rate Alert",message:"Error rate exceeded threshold. Check the API gateway logs.",tags:[{key:"severity",value:"critical"}],configuration:{type:"log",timeframe:5,groupByFields:[],aggregationAlertLogic:"no_aggregation",queries:[{aggregate:{type:"count"},filter:"level:ERROR service:api-gateway"}],conditions:[{formula:"q1",operator:"greater_than",threshold:100}],noDataBehavior:"resolve"},priority:1,owner:"team-123-abc",dashboardId:"789-abc-def",permissions:"all",clusterIds:[]},sN={name:"High CPU Utilization By Service",message:"More than half of grouped services are above the CPU threshold.",tags:[{key:"severity",value:"warning"}],configuration:{type:"metric",timeframe:10,groupByFields:[{fields:["context.service.name"],limit:10}],aggregationAlertLogic:"proportion",proportionAlertThreshold:50,queries:[{aggregate:{type:"average",field:"system.cpu.utilization"},filter:"context.service.name:checkout"}],conditions:[{formula:"q1",operator:"greater_than",threshold:.8}],noDataBehavior:"keep_last_status"},priority:2,owner:"team-123-abc",dashboardId:"789-abc-def",permissions:"all",clusterIds:[]},cN={name:"Certificate Expiry Warning",message:"A certificate is approaching expiry.",tags:[{key:"environment",value:"production"}],configuration:{type:"certificate-expiry",warnBeforeInDays:30,cloudAccounts:["aws-prod"],aggregationAlertLogic:"each",noDataBehavior:"resolve"},priority:3,owner:"team-123-abc",dashboardId:"789-abc-def",permissions:"all",clusterIds:[]},pN={name:"New Error Pattern Detector",message:"A new error pattern was detected in the logs.",tags:[{key:"team",value:"platform"}],configuration:{type:"log-error-pattern",aggregationAlertLogic:"each",noDataBehavior:"keep_last_status",filter:{teamIds:["team-123-abc"],env:"production",service:"api-gateway"}},priority:2,owner:"team-123-abc",dashboardId:"789-abc-def",permissions:"all",clusterIds:[]},d9={id:"123-456-abc",...aN},f9={id:"234-567-bcd",...sN},g9={id:"345-678-cde",...cN},h9={id:"456-789-def",...pN};Object.assign(Hs,{examples:[d9,f9,g9,h9]});var iN=r.Pick(Nd,["filters","sort","limit","offset"]),uN=r.Object({...iN.properties,...Ze,filters:iN.properties.filters},{description:"Monitor query request. Use filters, sorting, limit, and offset to page through visible monitors."}),y9={filters:{owners:{values:["team-123-abc"]},searchQuery:{value:"service:api-gateway"},tags:{values:[{key:"paging",value:"true"}]},priorities:{values:[4,5],exclude:!0},types:{values:["threshold"]},activity:"active",clusterIds:{values:["cluster-123-abc"]}},sort:{by:"name",direction:"asc"},limit:10,offset:0};Object.assign(uN,{examples:[y9]});var lN=d({description:"Queries monitors visible to the authenticated operation key. Use this endpoint to inventory monitor definitions, filter by owner, tag, priority, type, activity, or cluster, and page through results. See [Monitors](/documentation/alert/monitors/index).",operationId:"queryMonitors",tags:["monitors"],url:`${Bs}/query`,method:"POST",paginated:!0,body:uN,response:r.Array(Hs)}),mN=d({description:"Retrieves one monitor definition by ID.",operationId:"getMonitor",tags:["monitors"],url:`${Bs}/:id`,method:"GET",params:r.Object({id:u({allowEmpty:!1,description:"Monitor ID returned by monitor query, create, or update operations."})}),response:Hs}),dN=["name","message","tags","configuration","priority","owner","dashboardId","permissions","clusterIds"],fN=r.Pick(os,dN,{$id:"CreateMonitorRequest",description:"Monitor creation request. Provide ownership, data access, alert configuration, priority, tags, and optional dashboard or cluster scope."}),gN=r.Pick(os,dN,{$id:"UpdateMonitorRequest",description:"Monitor update request. Required fields and the submitted configuration are overwritten; omitted `message`, `tags`, and `clusterIds` keep their existing values. Omitting `dashboardId` clears the dashboard link."}),hN=aN,yN=sN,TN=cN,EN=pN;Object.assign(fN,{examples:[hN,yN,TN,EN]});Object.assign(gN,{examples:[hN,yN,TN,EN]});var _N=d({description:"Creates a monitor owned by the specified team. The monitor can evaluate logs, metrics, traces, anomaly behavior, certificate expiry, or new error patterns depending on its configuration.",operationId:"createMonitor",tags:["monitors"],url:Bs,method:"POST",body:fN,response:Hs}),IN=d({description:"Updates an existing monitor definition by ID. Required fields and the submitted configuration are overwritten; omitted `message`, `tags`, and `clusterIds` keep their existing values. Omitting `dashboardId` clears the dashboard link, and public updates clear any existing snooze because `pauseUntil` is not part of the public schema.",operationId:"updateMonitor",tags:["monitors"],url:`${Bs}/:id`,method:"PUT",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the saved monitor to update. Use the `id` returned by monitor query or create responses."})}),body:gN,response:Hs}),T9=r.Object({id:u({allowEmpty:!1,description:"Identifier of the saved monitor to delete. Use the `id` returned by monitor query, create, or update responses."})}),bN=d({description:"Deletes a monitor by ID. Deleting a monitor stops future evaluations and alert transitions for that monitor.",operationId:"deleteMonitor",tags:["monitors"],url:`${Bs}/:id`,method:"DELETE",params:T9,response:N});var Ks=`/${"v1"}/notification-rules`,zs=r.Pick(hi,["id","name","queryString","teamsFilter","prioritiesFilter","transitionTypesFilter","clusterIdsFilter","owner","isActive","tags","targets"],{$id:"Rule",description:"Notification rule that matches alert transitions and routes notifications to one or more targets. See [Rules](/documentation/alert/notifications/rules)."}),SN={name:"Critical Alerts",queryString:"env:prod service:api",teamsFilter:{type:"all-public-teams"},prioritiesFilter:[1,2],transitionTypesFilter:["triggered","resolved"],clusterIdsFilter:[],owner:"team-123-abc",isActive:!0,tags:[{key:"channel",value:"alerts"}],targets:[{id:"789-abc-def",rateLimit:{maxMessages:10,minutes:5},config:{type:"email",addresses:["oncall@example.com"],renotifyConfig:{mode:"each",renotificationStates:["alert"],renotifyIntervalMinutes:30}}}]},E9={id:"123-456-abc",...SN};Object.assign(zs,{examples:[E9]});var AN=d({description:"Lists notification rules visible to the authenticated operation key. Use this endpoint to audit alert delivery routing. Pagination fields limit the returned page.",operationId:"listNotificationRules",tags:["notification-rules"],url:Ks,method:"GET",paginated:!0,query:r.Object(Ze),response:r.Array(zs)}),ON=d({description:"Retrieves one notification rule by ID.",operationId:"getNotificationRule",tags:["notification-rules"],url:`${Ks}/:id`,method:"GET",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the notification rule to retrieve. Use the `id` returned by notification rule list or create responses."})}),response:zs}),Vg=r.Pick(ss,["name","queryString","teamsFilter","prioritiesFilter","transitionTypesFilter","clusterIdsFilter","owner","tags","isActive","targets"],{description:"Notification rule create or update request. Provide matching filters, owner, tags, active state, and delivery targets."}),_9=SN;Object.assign(Vg,{examples:[_9]});var xN=d({description:"Creates a notification rule that matches alert transitions and sends notifications to configured targets. Monitors keep evaluating separately from notification rules.",operationId:"createNotificationRule",tags:["notification-rules"],url:Ks,method:"POST",body:Vg,response:zs}),RN=d({description:"Updates an existing notification rule by ID. Required fields and the submitted target list are overwritten; omitted optional fields keep their existing values.",operationId:"updateNotificationRule",tags:["notification-rules"],url:`${Ks}/:id`,method:"PUT",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the notification rule to update. Use the `id` returned by notification rule list, get, or create responses."})}),body:Vg,response:zs}),I9=r.Object({id:u({allowEmpty:!1,description:"Identifier of the notification rule to delete. Use the `id` returned by notification rule list, get, create, or update responses."})}),CN=d({description:"Deletes a notification rule by ID. Alerting monitors continue to evaluate, but this rule no longer sends notifications.",operationId:"deleteNotificationRule",tags:["notification-rules"],url:`${Ks}/:id`,method:"DELETE",params:I9,response:N});var Zi=`${fi}/silences`,PN=r.Union([r.Literal("monday"),r.Literal("tuesday"),r.Literal("wednesday"),r.Literal("thursday"),r.Literal("friday"),r.Literal("saturday"),r.Literal("sunday")]),b9=r.Partial(r.Record(PN,r.Array(r.Object({startTime:r.String({format:Gm,description:"Local start time for this recurring silence window on this day, using the schedule time zone."}),endTime:r.String({format:Gm,description:"Local end time for this recurring silence window on this day. It must be after `startTime`, and ranges on the same day cannot overlap."})},{title:"SilenceTimeRange"}),{minItems:1,description:"Silence windows for this day. Each window uses the schedule time zone, and windows on the same day cannot overlap."})),{description:"Recurring silence windows keyed by day of week, evaluated in the schedule `timeZone` or in UTC when it is omitted. At least one day must be listed, and a day with no entry is never silenced. Each window covers `startTime` up to but not including `endTime`."}),S9=r.Partial(r.Record(PN,r.Array(r.Object({startTime:r.String({description:"Local start time for this recurring silence window on this day, using the schedule time zone."}),endTime:r.String({description:"Local end time for this recurring silence window on this day. It must be after `startTime`, and ranges on the same day cannot overlap."})},{title:"SilenceTimeRange"}),{description:"Silence windows for this day. Each window uses the schedule time zone, and windows on the same day cannot overlap."})),{description:"Recurring silence windows keyed by day of week, evaluated in the schedule `timeZone` or in UTC when it is omitted. A day with no entry is never silenced. Each window covers `startTime` up to but not including `endTime`."}),ml='IANA timezone identifier (e.g. "America/New_York"). Defaults to UTC if omitted.',UN="One-time silence schedule with specific start and end times",wN="Recurring weekly silence schedule",A9=C("type",[r.Object({type:r.Literal("one-time",{description:"Silence active once between the configured start and end times."}),startTime:r.String({format:$m,description:"Local start date and time for the one-time silence, interpreted in `timeZone` when provided."}),endTime:r.String({format:$m,description:"Local end date and time for the one-time silence. It must be after `startTime` and in the future."}),timeZone:r.Optional(r.String({format:Dm,description:ml}))},{$id:"InputSilenceScheduleOneTime",description:UN}),r.Object({type:r.Literal("recurring",{description:"Silence active on a recurring weekly schedule."}),weeklySchedule:b9,timeZone:r.Optional(r.String({format:Dm,description:ml}))},{$id:"InputSilenceScheduleRecurring",description:wN})],{description:"Schedule defining when the silence is active. The `type` field discriminates between a `one-time` window and a `recurring` weekly window. Once a one-time schedule's `endTime` passes, or a recurring window closes, the silence stops suppressing notifications but is not deleted; delete it explicitly if it is no longer needed."}),O9=C("type",[r.Object({type:r.Literal("one-time",{description:"Silence active once between the configured start and end times."}),startTime:r.String({description:"Local start date and time for the one-time silence, interpreted in `timeZone` when provided."}),endTime:r.String({description:"Local end date and time for the one-time silence. It must be after `startTime` and in the future when created or updated."}),timeZone:r.Optional(r.String({description:ml}))},{$id:"OutputSilenceScheduleOneTime",description:UN}),r.Object({type:r.Literal("recurring",{description:"Silence active on a recurring weekly schedule."}),weeklySchedule:S9,timeZone:r.Optional(r.String({description:ml}))},{$id:"OutputSilenceScheduleRecurring",description:wN})],{description:"Schedule defining when the silence is active. The `type` field discriminates between a `one-time` window and a `recurring` weekly window. Once a one-time schedule's `endTime` passes, or a recurring window closes, the silence stops suppressing notifications but is not deleted; delete it explicitly if it is no longer needed."}),x9="monitor_id",vN=`Query on the alerting monitor tags and group-by dimensions, e.g. \`env:prod AND service:bridge\`. The monitor itself can be targeted with \`${x9}:<monitor id>\`.`,dl=r.Object({name:u({description:"Display name of the silence"}),reason:u({allowEmpty:!1,type:"long",description:"Free-text explanation of why notifications are being silenced, shown to other operators reviewing active silences."}),owner:u({allowEmpty:!1,description:"Team ID that owns and manages the silence"}),tags:Xe,isActive:r.Boolean({description:"Set to true for the silence to suppress matching notifications while its schedule is active. Set to false to keep the silence without suppressing anything."}),schedule:A9,notificationRuleIds:r.Optional(r.Array(u(),{description:"Notification rule IDs this silence applies to directly, matching any notification produced by one of these rules regardless of priority or transition type. Mutually exclusive with `prioritiesFilter`, `transitionTypesFilter`, and `queryString`: a request combining this field with any of those is rejected."})),queryString:r.Optional(u({type:"tags-query",description:vN})),teamsFilter:Bd,prioritiesFilter:r.Array(r.Enum(St),{maxItems:St.length,description:"Monitor priorities that must match for this silence to apply. An empty array matches every priority."}),transitionTypesFilter:r.Array(r.Enum(uo),{maxItems:uo.length,description:"Alert state transitions that must match for this silence to apply. An empty array matches every transition type."})}),Xi=r.Object({id:r.String({description:"Tsuga-generated notification silence ID assigned when the silence is created."}),name:r.String({description:"Display name of the silence"}),reason:r.String({description:"Free-text explanation of why notifications are being silenced, shown to other operators reviewing active silences."}),owner:r.String({description:"Team ID that owns and manages the silence"}),tags:De,isActive:r.Boolean({description:"Whether the silence suppresses matching notifications while its schedule is active. When false, the silence is kept but never suppresses anything."}),schedule:O9,notificationRuleIds:r.Optional(r.Array(r.String(),{description:"Notification rule IDs this silence applies to directly, matching any notification produced by one of these rules regardless of priority or transition type. Set only when `prioritiesFilter`, `transitionTypesFilter`, and `queryString` are not used to filter alerts."})),queryString:r.Optional(r.String({description:vN})),teamsFilter:qd,prioritiesFilter:r.Array(r.Enum(St),{description:"Monitor priorities that must match for this silence to apply. An empty array matches every priority."}),transitionTypesFilter:r.Array(r.Enum(uo),{description:"Alert state transitions that must match for this silence to apply. An empty array matches every transition type."}),createdAt:A(),updatedAt:A(),creator:r.Optional(pe),updater:r.Optional(pe)}),EJe=d({tags:["notification-silences"],url:Zi,method:"GET",response:r.Array(Xi)}),_Je=d({tags:["notification-silences"],url:`${Zi}/:id`,params:r.Object({id:u()}),method:"GET",response:Xi}),IJe=d({tags:["notification-silences"],url:Zi,method:"POST",body:dl,response:Xi}),bJe=d({tags:["notification-silences"],url:`${Zi}/:id`,method:"PUT",params:r.Object({id:u()}),body:dl,response:Xi}),SJe=d({tags:["notification-silences"],url:`${Zi}/:id`,method:"DELETE",params:r.Object({id:u()}),response:N}),AJe=d({tags:["notification-silences"],url:`${Zi}/bulk-delete`,method:"DELETE",body:r.Object({ids:r.Array(u())}),response:r.Object({})});var Ys=`/${"v1"}/notification-silences`,Vs=r.Pick(Xi,["id","name","reason","owner","tags","isActive","schedule","notificationRuleIds","queryString","teamsFilter","prioritiesFilter","transitionTypesFilter"],{$id:"NotificationSilence",description:"Scheduled mute rule that suppresses matching notification delivery while monitors continue evaluating. See [Silences](/documentation/alert/notifications/silences)."}),R9={id:"sil-weekend-maintenance",name:"Weekend maintenance",reason:"Suppress expected alerts during the weekly maintenance window.",owner:"team-123-abc",tags:[{key:"environment",value:"production"}],isActive:!0,schedule:{type:"recurring",weeklySchedule:{saturday:[{startTime:"02:00",endTime:"06:00"}],sunday:[{startTime:"02:00",endTime:"06:00"}]},timeZone:"UTC"},teamsFilter:{type:"specific-teams",teams:["team-123-abc"]},prioritiesFilter:[1,2],transitionTypesFilter:["triggered","resolved"]},C9={id:"sil-critical-routing",name:"Critical routing maintenance",reason:"Temporarily suppress notifications from the critical routing rule.",owner:"team-123-abc",tags:[{key:"change",value:"chg-1234"}],isActive:!0,schedule:{type:"one-time",startTime:"2026-07-04T02:00:00",endTime:"2026-07-04T04:00:00",timeZone:"UTC"},notificationRuleIds:["rule-critical-routing"],teamsFilter:{type:"specific-teams",teams:["team-123-abc"]},prioritiesFilter:[],transitionTypesFilter:[]};Object.assign(Vs,{examples:[R9,C9]});var NN=d({description:"Lists notification silences visible to the authenticated operation key. Use this endpoint to audit maintenance windows and notification muting rules.",operationId:"listNotificationSilences",tags:["notification-silences"],url:Ys,method:"GET",response:r.Array(Vs)}),LN=d({description:"Retrieves one notification silence by ID.",operationId:"getNotificationSilence",tags:["notification-silences"],url:`${Ys}/:id`,method:"GET",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the notification silence to retrieve. Use the `id` returned by notification silence list or create responses."})}),response:Vs}),Qg=r.Pick(dl,["name","reason","owner","tags","isActive","schedule","notificationRuleIds","queryString","teamsFilter","prioritiesFilter","transitionTypesFilter"],{description:"Notification silence create or update request. Provide the mute reason, owner, schedule, filters, active state, and tags."}),P9={name:"Weekend maintenance",reason:"Suppress expected alerts during the weekly maintenance window.",owner:"team-123-abc",tags:[{key:"environment",value:"production"}],isActive:!0,schedule:{type:"recurring",weeklySchedule:{saturday:[{startTime:"02:00",endTime:"06:00"}],sunday:[{startTime:"02:00",endTime:"06:00"}]},timeZone:"UTC"},teamsFilter:{type:"specific-teams",teams:["team-123-abc"]},prioritiesFilter:[1,2],transitionTypesFilter:["triggered","resolved"]},U9={name:"Critical routing maintenance",reason:"Temporarily suppress notifications from the critical routing rule.",owner:"team-123-abc",tags:[{key:"change",value:"chg-1234"}],isActive:!0,schedule:{type:"one-time",startTime:"2026-07-04T02:00:00",endTime:"2026-07-04T04:00:00",timeZone:"UTC"},notificationRuleIds:["rule-critical-routing"],teamsFilter:{type:"specific-teams",teams:["team-123-abc"]},prioritiesFilter:[],transitionTypesFilter:[]};Object.assign(Qg,{examples:[P9,U9]});var kN=d({description:"Creates a notification silence. Matching notifications that have not yet been sent are suppressed as soon as the schedule becomes active, including ones already queued when the silence is created; monitor evaluation itself is not paused, so alerts still transition and are visible in the UI.",operationId:"createNotificationSilence",tags:["notification-silences"],url:Ys,method:"POST",body:Qg,response:Vs}),MN=d({description:"Updates an existing notification silence by ID. Required fields are overwritten; omitted optional fields keep their existing values.",operationId:"updateNotificationSilence",tags:["notification-silences"],url:`${Ys}/:id`,method:"PUT",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the notification silence to update. Use the `id` returned by notification silence list, get, or create responses."})}),body:Qg,response:Vs}),w9=r.Object({id:u({allowEmpty:!1,description:"Identifier of the notification silence to delete. Use the `id` returned by notification silence list, get, create, or update responses."})}),DN=d({description:"Deletes a notification silence. Any notification not yet sent is re-evaluated against the remaining silences and, if none match, is delivered normally; notifications already marked as silenced are not resent.",operationId:"deleteNotificationSilence",tags:["notification-silences"],url:`${Ys}/:id`,method:"DELETE",params:w9,response:N});var v9={critical:3,important:2,normal:1},se=e=>({label:e,weight:v9[e]}),N9={"unrouted-logs":{key:"unrouted-logs",title:"Logs with no matching route",summary:"Any log that reaches processing without a matched route is flagged.",rationale:"Close gaps by ensuring each event flows through a governed route.",objectType:"route",category:"observability-assets",impact:se("important"),recommendation:"Ensure each team maintains a route that captures all of its logs exactly once."},"no-over-routed-logs":{key:"no-over-routed-logs",title:"No logs matching 3+ routes",summary:"Detects logs that match 3 or more processing routes during the lookback window.",rationale:"A log usually only needs one or two routes. Matching many routes typically means the route queries overlap unintentionally, multiplying the processing and storage cost without adding observability value.",objectType:"route",category:"observability-assets",impact:se("important"),recommendation:"Review the route queries owned by this team for overlap. Tighten the filter on each route so a given log matches the minimum number of routes needed (usually one)."},"team-has-route":{key:"team-has-route",title:"\u22651 route per team",summary:"Each team owns at least one active route that filters on its team name.",rationale:"Provides clear governance boundaries for routing and enrichment.",objectType:"route",category:"observability-assets",impact:se("important"),recommendation:"Ensure every team manages a dedicated route scoped to its context.team value."},"no-team-override-mismatch":{key:"no-team-override-mismatch",title:`${Id} matches ${eu}`,summary:`Detects logs and spans whose ${Id} resource attribute names a different team than the ${eu} resolved at ingestion.`,rationale:`${eu} is reserved and comes from the ingestion API key, so a \`team\` resource attribute never reassigns ownership. A disagreement means the sender expects an ownership Tsuga did not apply.`,objectType:"resource",category:"telemetry-hygiene",impact:se("important"),recommendation:"Drop the `team` resource attribute, or set the ingestion API key team override fields to read ownership from a differently named attribute."},"service-name-present":{key:"service-name-present",title:`${tu} present`,summary:`Logs and spans must populate ${tu} with a non-empty value.`,rationale:"Core identifier used to correlate telemetry across services.",objectType:"resource",category:"telemetry-hygiene",impact:se("critical"),recommendation:`Populate ${tu} in all log and span payloads.`},"no-orphan-spans":{key:"no-orphan-spans",title:"No orphan spans",summary:"Every span with parent_span_id references an existing span in the same trace.",rationale:"Trace integrity depends on preserving parent-child hierarchies.",objectType:"span",category:"telemetry-hygiene",impact:se("normal"),recommendation:"Emit parent spans before their children so references always resolve."},"metric-unit-consistency":{key:"metric-unit-consistency",title:"Name\u2192unit consistency",summary:"All series for a metric name report the same UCUM-compliant unit across the lookback period.",rationale:"Avoid ambiguity when charting and alerting on metrics with shared names.",objectType:"metric",category:"telemetry-hygiene",impact:se("important"),recommendation:"Align exporters so each metric name emits a single consistent unit across services and environments."},"host-name-present":{key:"host-name-present",title:`${ns} presence`,summary:`Logs and spans must populate ${ns} with a non-empty value.`,rationale:"Core identifier used to correlate telemetry across services.",objectType:"resource",category:"telemetry-hygiene",impact:se("important"),recommendation:`Populate ${ns} in all log and span payloads.`},"inconsistent-attribute-naming":{key:"inconsistent-attribute-naming",title:"Consistent attribute naming",summary:"Detects attributes with multiple naming variants (e.g., userId vs user_id).",rationale:"Consistent naming improves queryability.",objectType:"log",category:"telemetry-hygiene",impact:se("normal"),recommendation:"Standardize attribute naming conventions across all log sources."},"no-duplicate-attr-values":{key:"no-duplicate-attr-values",title:"No duplicate attribute values",summary:"Detects when different attributes consistently carry identical values across logs (e.g., err.type and error.type always having the same value).",rationale:"Redundant attributes waste storage and complicate querying. Consolidate to one.",objectType:"log",category:"telemetry-hygiene",impact:se("normal"),recommendation:"Consolidate duplicate attributes at the source to reduce storage costs."},"no-debug-logs-in-prod":{key:"no-debug-logs-in-prod",title:"No DEBUG logs in production",summary:"Detects DEBUG-level logs emitted in production environments.",rationale:"DEBUG logs in production increase costs and risk exposing sensitive data.",objectType:"log",category:"telemetry-hygiene",impact:se("important"),recommendation:"Remove DEBUG-level logging from production environment or adjust log level configuration."},"no-multiline-logs":{key:"no-multiline-logs",title:"No ungrouped multiline logs",summary:"Detects orphaned stack-trace and traceback continuation lines that should have been grouped into a single log entry by the collector.",rationale:"Ungrouped multiline logs fragment errors across many entries, making them harder to read, search, and alert on.",objectType:"log",category:"telemetry-hygiene",impact:se("important"),recommendation:"Configure multiline grouping on the log collector using a line_start_pattern (e.g. a timestamp regex) so stack traces are sent as a single entry."},"no-error-logs-as-info":{key:"no-error-logs-as-info",title:"No error logs mapped as info",summary:"Detects INFO-level logs that carry error fields such as error.*, err.*, exception.*, or a stack trace.",rationale:"A log with error or exception attributes but an INFO severity is never surfaced as an error, so teams miss real failures caused by a misconfigured level mapper or bad logging.",objectType:"log",category:"telemetry-hygiene",impact:se("important"),recommendation:"Map these logs to ERROR in the level mapper, or fix the source logging so errors and exceptions are emitted at the right severity."},"no-empty-dashboards":{key:"no-empty-dashboards",title:"No empty dashboards",summary:"Flags dashboards with 1 or fewer widgets.",rationale:"Empty or near-empty dashboards add clutter and make it harder to find useful dashboards.",objectType:"dashboard",category:"observability-assets",impact:se("normal"),recommendation:"Add meaningful widgets to dashboards or remove empty ones to reduce clutter."},"monitor-has-notification":{key:"monitor-has-notification",title:"No monitors without notification",summary:"Every monitor has at least one active notification destination configured.",rationale:"A monitor without notifications is effectively silent - it detects issues but nobody is alerted.",objectType:"monitor",category:"observability-assets",impact:se("important"),recommendation:"Add a notification destination to every monitor - a monitor without notifications is effectively silent."},"no-future-dated-logs":{key:"no-future-dated-logs",title:"No future-dated logs",summary:"Detects logs with timestamps more than 59 minutes ahead of their intake time.",rationale:"Future-dated logs break dashboards, alerting, and log ordering - they indicate clock skew or incorrect timestamp generation.",objectType:"log",category:"telemetry-hygiene",impact:se("important"),recommendation:"Fix clock synchronization or timestamp generation for services emitting future-dated logs - they break dashboards and alerting."},"metric-usage":{key:"metric-usage",title:"Metric usage",summary:"Percentage of ingested metrics that are referenced by a dashboard or monitor, or were queried in the last 30 days.",rationale:"Metrics that are never visualized, alerted on, or queried add ingestion cost and cardinality without providing value.",objectType:"metric",category:"telemetry-adoption",impact:se("important"),recommendation:"Stop emitting metrics that are never referenced or queried to reduce ingestion cost and cardinality.",scope:"global"},"no-stale-dashboards":{key:"no-stale-dashboards",title:"No stale dashboards",summary:"Flags dashboards that have not been edited in over 180 days.",rationale:"Stale dashboards may contain outdated queries or irrelevant data, making it harder for teams to find useful, up-to-date information.",objectType:"dashboard",category:"observability-assets",impact:se("normal"),recommendation:"Review and update dashboards that haven't been edited in 180+ days, or archive them if no longer relevant."},"no-unused-dashboards":{key:"no-unused-dashboards",title:"No unused dashboards",summary:"Flags dashboards with zero views in the last 60 days.",rationale:"Dashboards that nobody views add clutter and may confuse team members looking for relevant information.",objectType:"dashboard",category:"telemetry-adoption",impact:se("important"),recommendation:"Archive or delete dashboards that nobody has viewed in the last 60 days to reduce noise."},"no-orphan-monitors":{key:"no-orphan-monitors",title:"No monitors without dashboards",summary:"Every monitor should be linked to at least one dashboard.",rationale:"Monitors without a linked dashboard make it harder for teams to investigate alerts \u2014 responders need a dashboard to quickly understand the context and scope of an issue.",objectType:"monitor",category:"observability-assets",impact:se("important"),recommendation:"Link monitors to relevant dashboards so teams can quickly investigate when alerts fire."},"no-flapping-monitors":{key:"no-flapping-monitors",title:"No flappy monitors",summary:"P1/P2 monitors should not have any group (or the monitor itself) trigger 7+ alerts within 7 days.",rationale:"Monitors that constantly flip between alert and OK cause alert fatigue. Teams start ignoring notifications, increasing the risk of missing real incidents.",objectType:"monitor",category:"observability-assets",impact:se("important"),recommendation:"Tune thresholds, add hysteresis, or adjust evaluation windows to reduce flapping."},"no-noisy-group-monitors":{key:"no-noisy-group-monitors",title:"No noisy group-by monitors",summary:"P1/P2 group-by monitors should not have 5+ groups triggering alerts simultaneously on 2+ occasions within 7 days.",rationale:"When a group-by monitor triggers alerts for many groups at once repeatedly, the signal gets lost in noise. Responders cannot prioritize and the monitor effectively becomes useless.",objectType:"monitor",category:"observability-assets",impact:se("important"),recommendation:"Narrow the group-by scope, raise thresholds, or split into more targeted monitors."},"no-long-alert-monitors":{key:"no-long-alert-monitors",title:"No monitors stuck in alert",summary:"P1/P2 monitors should not remain in alert state for more than 15 days.",rationale:"A high-priority monitor stuck in alert for weeks signals an unresolved issue or a misconfigured threshold. Either way, the alert loses meaning and contributes to alert fatigue.",objectType:"monitor",category:"observability-assets",impact:se("important"),recommendation:"Investigate and resolve the underlying issue, adjust the threshold, or acknowledge and close the alert."},"no-redundant-monitors":{key:"no-redundant-monitors",title:"No redundant monitors",summary:"P1/P2 monitors should not always trigger at the same time as another monitor (3+ co-triggers within 7 days).",rationale:"A monitor that always fires alongside another monitor is redundant. It adds noise without providing additional signal, making it harder for responders to identify the root cause.",objectType:"monitor",category:"observability-assets",impact:se("important"),recommendation:"Investigate whether the redundant monitor can be removed or consolidated with the one it always co-triggers with."},"no-absent-log-fields":{key:"no-absent-log-fields",title:"No absent log fields",summary:"Dashboards and monitors should reference log fields that still appear in recent logs (last 24 hours).",rationale:"References to log fields that no longer exist silently break dashboards and monitors, eroding trust in observability.",objectType:"dashboard",category:"observability-assets",impact:se("important"),recommendation:"Remove, rename, or backfill log fields that are referenced by dashboards or monitors but have not been seen in the last 24 hours.",scope:"global"},"k8s-recommended-attributes":{key:"k8s-recommended-attributes",title:"Kubernetes recommended resource attributes",summary:"Kubernetes logs and spans should populate core identity attributes and at least one workload-ownership attribute.",rationale:"These attributes let Tsuga correlate telemetry with the Kubernetes objects that produced it, which is required for faulty-deployment detection and rollback suggestions.",objectType:"resource",category:"collection-coverage",impact:se("important"),recommendation:"Make sure every Kubernetes workload emits k8s.cluster.name, k8s.namespace.name, k8s.pod.name, k8s.pod.uid, k8s.container.name, k8s.node.name and one workload-ownership attribute (for example via the OpenTelemetry Collector k8s_attributes processor)."},"k8s-recommended-metrics":{key:"k8s-recommended-metrics",title:"Kubernetes recommended cluster metrics",summary:"All recommended Kubernetes cluster metrics are collected.",rationale:"These metrics are the primary signals for faulty-deployment detection; without k8s.container.status.reason and the usage/limit pairs, container crash loops and resource starvation cannot be diagnosed.",objectType:"metric",category:"collection-coverage",impact:se("important"),recommendation:"Enable the OpenTelemetry Collector k8s_cluster receiver (for example via the Tsuga Helm chart) so the required Kubernetes metrics are emitted.",scope:"global"},"k8s-recommended-change-events":{key:"k8s-recommended-change-events",title:"Kubernetes recommended change events",summary:"Change events are collected for the Kubernetes object kinds recommended for rollback suggestions.",rationale:"Faulty-deployment detection needs the history of ReplicaSet, Deployment, Pod and Node changes to identify failing revisions and propose rollbacks.",objectType:"log",category:"collection-coverage",impact:se("important"),recommendation:"Configure the Kubernetes change-event collector (for example the OpenTelemetry k8sobjects receiver) so change events for Pod, Deployment, ReplicaSet, StatefulSet, DaemonSet, Namespace and Node are ingested."},"otel-collector-self-metrics":{key:"otel-collector-self-metrics",title:"OpenTelemetry Collector self-metrics",summary:"A cluster collecting Kubernetes metrics through an OpenTelemetry Collector also emits the collector self-metrics (otelcol_*).",rationale:"The Kubernetes receivers feed the Kubernetes explorer. Without the collector self-metrics there is no way to tell a healthy pipeline from one that drops data or fails to export, so a stale or missing Kubernetes view cannot be explained.",objectType:"metric",category:"collection-coverage",impact:se("important"),recommendation:"Enable the collector's internal telemetry (service.telemetry.metrics) and export it to Tsuga so otelcol_* metrics are available.",scope:"global"},"use-standard-attributes":{key:"use-standard-attributes",title:"Standard attribute usage",summary:"Detects log attributes that should be remapped to Tsuga standard attributes.",rationale:"Standard attributes enable consistent querying, out-of-the-box dashboards, and cross-team correlation.",objectType:"log",category:"telemetry-hygiene",impact:se("important"),recommendation:"Use the attribute remapper in your routes to rename attributes to their standard equivalents."},"no-unused-operation-api-keys":{key:"no-unused-operation-api-keys",title:"No unused operation API keys",summary:"Flags operation API keys with no activity in the last 180 days.",rationale:"Long-idle operation credentials add risk if leaked and clutter the inventory. Tracking last-used activity makes it easy to rotate or delete the unused ones.",objectType:"api-key",category:"observability-assets",impact:se("important"),recommendation:"Rotate or delete operation API keys that have not been used in the last 180 days."},"no-unused-ingestion-api-keys":{key:"no-unused-ingestion-api-keys",title:"No unused ingestion API keys",summary:"Flags ingestion API keys with no telemetry in the last 30 days across any cluster.",rationale:"Dormant ingestion credentials add risk if leaked and clutter the inventory. Tracking key activity makes it easy to rotate or delete the unused ones.",objectType:"api-key",category:"observability-assets",impact:se("important"),recommendation:"Rotate or delete ingestion API keys that have sent no data in the last 30 days."},"db-logs-trace-correlation":{key:"db-logs-trace-correlation",title:"Database logs correlated with traces",summary:`Database logs should carry ${Ax} so they can be tied back to the trace that issued the query.`,rationale:"Linking database server logs to client traces lets users jump from a slow request to the exact query log. Without a trace id, database logs cannot be joined to the request that produced them.",objectType:"log",category:"telemetry-hygiene",impact:se("normal"),recommendation:"Enable trace correlation on the database log pipeline (for example via SQLcommenter, which embeds the traceparent in each statement) so query logs carry a trace id.",scope:"team"}},GN={"postgresql-server-metrics-collected":{label:"PostgreSQL",systemValues:["postgresql"],metricPrefixes:["postgresql.","pg_"],receiver:"postgresqlreceiver"},"mysql-server-metrics-collected":{label:"MySQL",systemValues:["mysql","mariadb"],metricPrefixes:["mysql.","mysql_"],receiver:"mysqlreceiver"},"mongodb-server-metrics-collected":{label:"MongoDB",systemValues:["mongodb"],metricPrefixes:["mongodb.","mongodbatlas.","mongodb_"],receiver:"mongodbreceiver"},"redis-server-metrics-collected":{label:"Redis",systemValues:["redis"],metricPrefixes:["redis.","redis_"],receiver:"redisreceiver"},"memcached-server-metrics-collected":{label:"Memcached",systemValues:["memcached"],metricPrefixes:["memcached.","memcached_"],receiver:"memcachedreceiver"},"couchdb-server-metrics-collected":{label:"CouchDB",systemValues:["couchdb"],metricPrefixes:["couchdb.","couchdb_"],receiver:"couchdbreceiver"},"elasticsearch-server-metrics-collected":{label:"Elasticsearch",systemValues:["elasticsearch"],metricPrefixes:["elasticsearch.","elasticsearch_"],receiver:"elasticsearchreceiver"},"oracledb-server-metrics-collected":{label:"Oracle DB",systemValues:["oracle.db","oracle"],metricPrefixes:["oracledb.","oracledb_"],receiver:"oracledbreceiver"},"sqlserver-server-metrics-collected":{label:"Microsoft SQL Server",systemValues:["microsoft.sql_server","mssql"],metricPrefixes:["sqlserver.","mssql_"],receiver:"sqlserverreceiver"},"saphana-server-metrics-collected":{label:"SAP HANA",systemValues:["sap.hana","hanadb"],metricPrefixes:["saphana."],receiver:"saphanareceiver"},"cassandra-server-metrics-collected":{label:"Cassandra",systemValues:["cassandra"],metricPrefixes:["cassandra.","cassandra_"]},"clickhouse-server-metrics-collected":{label:"ClickHouse",systemValues:["clickhouse"],metricPrefixes:["ClickHouse"]},"couchbase-server-metrics-collected":{label:"Couchbase",systemValues:["couchbase"],metricPrefixes:["couchbase_"]},"neo4j-server-metrics-collected":{label:"Neo4j",systemValues:["neo4j"],metricPrefixes:["neo4j_"]},"opensearch-server-metrics-collected":{label:"OpenSearch",systemValues:["opensearch"],metricPrefixes:["opensearch_"]},"db2-server-metrics-collected":{label:"IBM Db2",systemValues:["ibm.db2","db2"],metricPrefixes:["ibm_db2_"]}},L9=Object.fromEntries(Object.keys(GN).map(e=>{let{label:t,receiver:n}=GN[e];return[e,{key:e,title:`${t} server metrics collected`,summary:`${t} seen in client spans should have its server metrics collected.`,rationale:"Server metrics (connections, throughput, replication, contention) are needed to investigate database slowness beyond what client spans show. A detected database with no server metrics has a gap in its monitoring setup.",objectType:"metric",category:"collection-coverage",impact:se("important"),recommendation:n?`Configure the ${n} OpenTelemetry receiver so ${t} server metrics are collected.`:`Collect ${t} server metrics, for example via its Prometheus exporter.`,scope:"global"}]})),k9=new Set(["azure_container_registry","azure_container_registry_image","azure_app_service_certificate","azure_virtual_network"]),M9=ks.filter(e=>e.startsWith("azure_")&&!k9.has(e)),$N={"aws-sqs-metrics-collected":{label:"Amazon SQS",source:"AWS/SQS",nativeResourceTypes:["aws_sqs_queue"],metricPrefixes:["aws_sqs_"]},"aws-sns-metrics-collected":{label:"Amazon SNS",source:"AWS/SNS",nativeResourceTypes:["aws_sns_topic"],metricPrefixes:["aws_sns_"]},"aws-kinesis-metrics-collected":{label:"Amazon Kinesis Data Streams",source:"AWS/Kinesis",nativeResourceTypes:["aws_kinesis_data_stream"],metricPrefixes:["aws_kinesis_"]},"aws-dynamodb-metrics-collected":{label:"Amazon DynamoDB",source:"AWS/DynamoDB",nativeResourceTypes:["aws_dynamodb_table"],metricPrefixes:["aws_dynamodb_"]},"aws-rds-metrics-collected":{label:"Amazon RDS",source:"AWS/RDS",nativeResourceTypes:["aws_rds_instance"],metricPrefixes:["aws_rds_"]},"aws-elasticache-metrics-collected":{label:"Amazon ElastiCache",source:"AWS/ElastiCache",nativeResourceTypes:["aws_elasticache"],metricPrefixes:["aws_elasticache_"]},"aws-s3-metrics-collected":{label:"Amazon S3",source:"AWS/S3",nativeResourceTypes:["aws_s3_bucket"],metricPrefixes:["aws_s3_"]},"aws-ebs-metrics-collected":{label:"Amazon EBS",source:"AWS/EBS",nativeResourceTypes:["aws_ebs_volume"],metricPrefixes:["aws_ebs_"]},"aws-efs-metrics-collected":{label:"Amazon EFS",source:"AWS/EFS",nativeResourceTypes:["aws_efs"],metricPrefixes:["aws_efs_"]},"aws-ec2-metrics-collected":{label:"Amazon EC2",source:"AWS/EC2",nativeResourceTypes:["aws_ec2_instance"],metricPrefixes:["aws_ec2_"]},"aws-lambda-metrics-collected":{label:"AWS Lambda",source:"AWS/Lambda",nativeResourceTypes:["aws_lambda_function"],metricPrefixes:["aws_lambda_"]},"aws-ecs-metrics-collected":{label:"Amazon ECS",source:"AWS/ECS",nativeResourceTypes:["aws_ecs_cluster","aws_ecs_service","aws_ecs_task"],metricPrefixes:["aws_ecs_"]},"aws-ecr-metrics-collected":{label:"Amazon ECR",source:"AWS/ECR",nativeResourceTypes:["aws_ecr_repository"],metricPrefixes:["aws_ecr_"]},"aws-elb-metrics-collected":{label:"Elastic Load Balancing",source:"AWS/ApplicationELB, AWS/NetworkELB",nativeResourceTypes:["aws_elastic_load_balancer"],metricPrefixes:["aws_applicationelb_","aws_networkelb_","aws_gatewayelb_","aws_elb_"]},"aws-cloudfront-metrics-collected":{label:"Amazon CloudFront",source:"AWS/CloudFront",nativeResourceTypes:["aws_cloudfront_distribution"],metricPrefixes:["aws_cloudfront_"]},"aws-acm-metrics-collected":{label:"AWS Certificate Manager",source:"AWS/CertificateManager",nativeResourceTypes:["aws_acm_certificate"],metricPrefixes:["aws_certificatemanager_"]},"gcp-pubsub-metrics-collected":{label:"Google Cloud Pub/Sub",source:"pubsub.googleapis.com",nativeResourceTypes:["gcp_pubsub_topic"],metricPrefixes:["pubsub.googleapis.com/"]},"gcp-storage-metrics-collected":{label:"Google Cloud Storage",source:"storage.googleapis.com",nativeResourceTypes:["gcp_bucket"],metricPrefixes:["storage.googleapis.com/"]},"gcp-compute-metrics-collected":{label:"Google Compute Engine",source:"compute.googleapis.com",nativeResourceTypes:["gcp_compute_instance","gcp_compute_disk"],metricPrefixes:["compute.googleapis.com/"]},"gcp-cloud-sql-metrics-collected":{label:"Google Cloud SQL",source:"cloudsql.googleapis.com",nativeResourceTypes:["gcp_cloud_sql_instance"],metricPrefixes:["cloudsql.googleapis.com/"]},"gcp-gke-metrics-collected":{label:"Google Kubernetes Engine",source:"kubernetes.io, container.googleapis.com",nativeResourceTypes:["gcp_gke_cluster"],metricPrefixes:["kubernetes.io/","container.googleapis.com/"]},"gcp-cloud-run-metrics-collected":{label:"Google Cloud Run",source:"run.googleapis.com",nativeResourceTypes:["gcp_cloud_run_service","gcp_cloud_run_job","gcp_cloud_run_function"],metricPrefixes:["run.googleapis.com/"]},"gcp-artifact-registry-metrics-collected":{label:"Google Artifact Registry",source:"artifactregistry.googleapis.com",nativeResourceTypes:["gcp_artifact_registry_repository"],metricPrefixes:["artifactregistry.googleapis.com/"]},"gcp-load-balancing-metrics-collected":{label:"Google Cloud Load Balancing",source:"loadbalancing.googleapis.com",nativeResourceTypes:["gcp_forwarding_rule"],metricPrefixes:["loadbalancing.googleapis.com/"]},"gcp-bigtable-metrics-collected":{label:"Google Cloud Bigtable",source:"bigtable.googleapis.com",nativeResourceTypes:["gcp_bigtable_instance"],metricPrefixes:["bigtable.googleapis.com/"]},"gcp-spanner-metrics-collected":{label:"Google Cloud Spanner",source:"spanner.googleapis.com",nativeResourceTypes:["gcp_spanner_instance"],metricPrefixes:["spanner.googleapis.com/"]},"gcp-firestore-metrics-collected":{label:"Google Cloud Firestore",source:"firestore.googleapis.com",nativeResourceTypes:["gcp_firestore_database"],metricPrefixes:["firestore.googleapis.com/"]},"gcp-app-engine-metrics-collected":{label:"Google App Engine",source:"appengine.googleapis.com",nativeResourceTypes:["gcp_app_engine_service"],metricPrefixes:["appengine.googleapis.com/"]},"azure-metrics-collected":{label:"Azure",source:"Azure Monitor",nativeResourceTypes:M9,metricPrefixes:["azure_"]}},D9=Object.fromEntries(Object.keys($N).map(e=>{let{label:t,source:n}=$N[e];return[e,{key:e,title:`${t} metrics collected`,summary:`${t} resources found in inventory should have their metrics collected.`,rationale:"A resource that appears in inventory but whose metrics are not collected leaves its dashboards and resource-explorer views empty and impossible to alert on.",objectType:"metric",category:"collection-coverage",impact:se("important"),recommendation:`Enable the ${n} metrics integration so ${t} metrics are ingested.`,scope:"global"}]})),G9={...N9,...L9,...D9},jN=Object.values(G9);var FN=["passed","failed","ignored"],$9=10,j9=r.Enum(FN,{description:"Evaluation outcome for this rule row. Allowed values are passed, failed, and ignored; ignored means the rule was not applicable to the available data."}),F9=["aws-sqs-metrics-collected","aws-sns-metrics-collected","aws-kinesis-metrics-collected","aws-dynamodb-metrics-collected","aws-rds-metrics-collected","aws-elasticache-metrics-collected","aws-s3-metrics-collected","aws-ebs-metrics-collected","aws-efs-metrics-collected","aws-ec2-metrics-collected","aws-lambda-metrics-collected","aws-ecs-metrics-collected","aws-ecr-metrics-collected","aws-elb-metrics-collected","aws-cloudfront-metrics-collected","aws-acm-metrics-collected","gcp-pubsub-metrics-collected","gcp-storage-metrics-collected","gcp-compute-metrics-collected","gcp-cloud-sql-metrics-collected","gcp-gke-metrics-collected","gcp-cloud-run-metrics-collected","gcp-artifact-registry-metrics-collected","gcp-load-balancing-metrics-collected","gcp-bigtable-metrics-collected","gcp-spanner-metrics-collected","gcp-firestore-metrics-collected","gcp-app-engine-metrics-collected","azure-metrics-collected"],q9=["postgresql-server-metrics-collected","mysql-server-metrics-collected","mongodb-server-metrics-collected","redis-server-metrics-collected","memcached-server-metrics-collected","couchdb-server-metrics-collected","elasticsearch-server-metrics-collected","oracledb-server-metrics-collected","sqlserver-server-metrics-collected","saphana-server-metrics-collected","cassandra-server-metrics-collected","clickhouse-server-metrics-collected","couchbase-server-metrics-collected","neo4j-server-metrics-collected","opensearch-server-metrics-collected","db2-server-metrics-collected"],Zg=["unrouted-logs","no-over-routed-logs","team-has-route","no-team-override-mismatch","service-name-present","no-orphan-spans","metric-unit-consistency","host-name-present","inconsistent-attribute-naming","no-duplicate-attr-values","no-debug-logs-in-prod","no-multiline-logs","no-error-logs-as-info","no-empty-dashboards","monitor-has-notification","no-future-dated-logs","metric-usage","no-stale-dashboards","no-unused-dashboards","no-orphan-monitors","no-flapping-monitors","no-noisy-group-monitors","no-long-alert-monitors","no-redundant-monitors","no-absent-log-fields","k8s-recommended-attributes","k8s-recommended-metrics","k8s-recommended-change-events","otel-collector-self-metrics","use-standard-attributes","no-unused-operation-api-keys","no-unused-ingestion-api-keys","db-logs-trace-correlation",...q9,...F9],B9=r.Enum(Zg),H9=["log","metric","resource","span","api-key","dashboard","monitor","route"],K9=["collection-coverage","telemetry-hygiene","observability-assets","telemetry-adoption"],z9=["critical","important","normal"],Y9=["team","global"],Xg=r.Object({key:r.Enum(Zg),title:r.String(),summary:r.String(),rationale:r.String(),objectType:r.Enum(H9),category:r.Enum(K9),impact:r.Object({label:r.Enum(z9),weight:r.Number()}),recommendation:r.String(),scope:r.Optional(r.Enum(Y9))}),Qs=r.Object({type:r.String({description:"Tsuga asset or telemetry kind referenced by this example. Set by the rule evaluator from the failing object, record, or lookup result; examples include `monitor`, `dashboard`, `metric`, `log`, and `api-key`."}),label:r.String({description:"Human-readable summary of the example. Set by the rule evaluator from the asset name, telemetry identifier, or lookup result so clients can display the example without following the link."}),link:r.Object({to:r.String({description:"In-app route that opens the example in Tsuga. Set by the rule evaluator when the example has a product surface for inspection."}),search:r.Optional(r.Unknown({description:"Route search payload for the in-app link. Set when the destination needs query-string state such as a search query, time range, or table filter."})),params:r.Optional(r.Unknown({description:"Route params for the in-app link. Set when the destination route needs path parameters such as an asset identifier."}))},{description:"In-app deep link for inspecting the example. Returned when Tsuga can route from the quality-report row to a relevant product page."})}),Wg=r.Intersect([Xg,r.Object({id:r.Optional(r.String()),status:j9,normalizedScore:r.Number(),details:r.Optional(r.Record(r.String(),r.Unknown())),recommendation:r.Optional(r.String()),examples:r.Optional(r.Array(Qs)),exampleCount:r.Optional(r.Integer())})]),V9=r.Object({generatedAt:r.String(),overallScore:r.Optional(r.Number()),rules:r.Array(Xg),teamResults:r.Array(r.Object({teamId:r.String(),teamName:r.String(),teamWeight:r.Number(),score:r.Number(),weightedScore:r.Number(),totalWeight:r.Number(),ruleResults:r.Array(Wg)})),globalResults:r.Optional(r.Object({score:r.Optional(r.Number()),ruleResults:r.Array(Wg)}))}),Jg=r.Object({id:r.String({description:"Identifier of this persisted quality-report row. Generated by Tsuga when report rows are stored. Returned on every row. Treat it as an opaque ID."}),reportId:r.String({description:"Identifier shared by rows from the same report generation for the same team or global cluster-wide scope. Generated by Tsuga when the report is stored. Returned on every row."}),ruleId:r.Enum(Zg,{description:"Stable key for the telemetry-quality rule evaluated by this row. Set by Tsuga from the quality-rule catalog. Returned on every row. The enum may grow as Tsuga adds rules; clients should display unknown future values as opaque rule keys if they do not have local labels."}),owner:r.Optional(r.String({description:"Team identifier this row applies to. Set to the owning team ID for team-scoped rules. Returned for team rows; omitted for global cluster-wide rows."})),status:r.Enum(FN,{description:"Evaluation outcome for this rule row. Set by the rule evaluator when the report is generated. Returned on every row. Allowed values are passed, failed, and ignored; ignored means the rule was not applicable to the available data."}),score:r.Number({description:"Normalized score for this rule row. Set by the rule evaluator when the report is generated. Returned on every row. Values are between 0 and 1."}),weight:r.Number({description:"Impact weight of this rule, captured at report-generation time. Set by Tsuga from the rule's impact label: 1 for normal, 2 for important, 3 for critical. Used with score to compute reportOverallScore."}),reportOverallScore:r.Number({description:"Aggregate score for this row's report group. Calculated by Tsuga from non-ignored rows in the same team or global cluster-wide report. Returned on every row in that group with the same value."}),reportTotalWeight:r.Number({description:"Sum of non-ignored rule weights for this row's report group. Calculated by Tsuga when the report is generated. Returned on every row in that group with the same value."}),recommendation:r.Optional(r.String({description:"Recommendation stored with this row. Set by the rule evaluator when the report is generated. Returned when a recommendation was persisted; omitted otherwise. The latest-report endpoint does not recompute or default it at read time."})),examples:r.Optional(r.Array(Qs,{description:`Assets, logs, metrics, or links supporting this rule result. Set by the rule evaluator when the report is generated. Returned when examples were persisted and visible to the caller; global row examples are returned only to admin users. Truncated to the first ${$9}; compare against exampleCount to detect truncation.`})),exampleCount:r.Optional(r.Integer({description:"Total number of examples persisted for this row, before the preview truncation applied to examples. Returned whenever examples are visible to the caller."})),createdAt:r.String({description:"ISO timestamp the row was generated at"})}),jJe=d({tags:["quality-reports"],url:"/v0/quality-reports",method:"POST",response:V9}),eh=r.Optional(u({allowEmpty:!1,description:"Identifier of the cluster whose latest quality-report rows are returned. Use the id from the clusters API. Required when the organization has multiple clusters; omit only in single-cluster organizations. Unknown cluster IDs return RESOURCE_NOT_FOUND."})),FJe=d({tags:["quality-reports"],url:"/v0/quality-reports/latest",method:"GET",query:r.Object({clusterId:eh,team:r.Optional(u({allowEmpty:!1}))}),response:r.Array(Jg,{description:"Latest persisted rule evaluation rows for the cluster"})}),qJe=d({tags:["quality-reports"],url:"/v0/quality-reports/:id/examples",method:"GET",params:r.Object({id:u({allowEmpty:!1})}),response:r.Object({examples:r.Array(Qs)})}),BJe=d({tags:["quality-reports"],url:"/v0/quality-reports/preview",method:"POST",body:r.Object({ruleKey:B9,teamId:r.Optional(u({allowEmpty:!1})),lookbackMinutes:r.Optional(r.Integer({minimum:1,maximum:60})),clusterId:r.Optional(u({allowEmpty:!1}))}),response:r.Object({rule:Xg,result:Wg,teamId:r.Optional(r.String()),teamName:r.Optional(r.String())})}),HJe=new Map(jN.map(e=>[e.key,e]));var qN=`/${"v1"}/quality-reports`,BN=r.Pick(Jg,["id","reportId","ruleId","owner","status","score","weight","reportOverallScore","reportTotalWeight","recommendation","examples","exampleCount","createdAt"],{$id:"QualityReportRow",description:"Persisted evaluation of one telemetry-quality rule for a team or cluster-wide scope. See [Quality reports](/documentation/account-and-settings/quality-reports)."}),Q9={id:"01j9x3z4vyabcdfghjkmnpqrst",reportId:"01j9x3z4vyabcdfghjkmnpqrsu",ruleId:"team-has-route",owner:"01j9x3z4vyabcdfghjkmnpqrr",status:"passed",score:1,weight:2,reportOverallScore:.85,reportTotalWeight:2,createdAt:"2026-02-26T12:00:00.000Z"};Object.assign(BN,{examples:[Q9]});var W9=r.Object({clusterId:eh,team:r.Optional(u({allowEmpty:!1,description:"Team name used to scope the report. Matched against Tsuga team names. Optional; when set, returns only rows for that team and omits global rows. Unknown team names return RESOURCE_NOT_FOUND; teams the caller cannot access return an empty result."}))},{description:"Latest quality report lookup query."}),HN=d({description:"Retrieves the latest persisted quality-report rows for a cluster, optionally scoped to one team. Use this to audit telemetry hygiene and routing recommendations.",operationId:"getLatestQualityReport",tags:["quality-reports"],url:`${qN}/latest`,method:"GET",query:W9,response:r.Array(BN)}),ZJe=d({description:"Retrieves every example stored for one quality-report row. The latest-report endpoint returns only a preview of each row's examples, so use this to page past that preview when exampleCount exceeds the number of examples returned there.",operationId:"getQualityReportExamples",tags:["quality-reports"],url:`${qN}/:id/examples`,method:"GET",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the quality-report row whose examples are returned. Use the id from the latest-report endpoint. Unknown ids, rows the caller cannot access, and cluster-wide rows requested by a non-admin all return RESOURCE_NOT_FOUND."})}),response:r.Object({examples:r.Array(Qs,{description:"Every example stored for this row, untruncated. Empty when the rule evaluation produced none."})},{description:"All examples stored for one quality-report row."})});var Ws="/v0/admin-center";var Ur=`${Ws}/retention-policies`,KN=3650,Z9=r.Integer({description:"Number of days Tsuga retains matching telemetry."}),zN=r.Integer({minimum:1,maximum:KN,description:`Number of days Tsuga should retain matching telemetry. Valid values are 1 through ${KN}.`}),Jr=r.Object({id:r.String({description:"Unique identifier of the retention policy. Generated by Tsuga."}),env:r.Optional(r.String({description:"Environment tag value this policy applies to. Omitted policies apply across environments unless a more specific policy exists."})),teamId:r.Optional(r.String({description:"Team ID this policy applies to. Omitted policies apply globally unless a team-specific policy exists."})),dataSource:r.Enum(Ir,{description:"Telemetry signal retained by this policy: logs, metrics, traces or rum."}),durationDays:Z9,isEnabled:r.Boolean({description:"Whether this policy participates in retention resolution."}),createdAt:A({description:"Timestamp when Tsuga created the retention policy."}),updatedAt:A({description:"Timestamp when Tsuga last updated the retention policy."})}),fl=r.Object({env:r.Optional(u({description:"Environment tag value this policy applies to. Omit for a policy that is not environment-specific."})),teamId:r.Optional(u({description:"Team ID this policy applies to. Omit for a policy that is not team-specific."})),dataSource:r.Enum(Ir,{description:"Telemetry signal retained by this policy: logs, metrics, traces or rum."}),durationDays:zN,isEnabled:r.Boolean({description:"Set to true for the policy to participate in retention resolution."})}),YN=r.Array(r.Object({env:u(),dataSource:r.Enum(Ir),durationDays:r.Union([zN,r.Null()]),isEnabled:r.Boolean()})),VN=r.Object({inserted:r.Array(Jr),updated:r.Array(Jr),deleted:r.Array(Jr)}),aet=d({tags:["retention-policies"],url:Ur,method:"POST",body:fl,response:Jr}),set=d({tags:["retention-policies"],url:Ur,method:"GET",response:r.Array(Jr)}),cet=d({tags:["retention-policies"],url:`${Ur}/:id`,method:"GET",params:r.Object({id:u()}),response:Jr}),pet=d({tags:["retention-policies"],url:`${Ur}/:id`,method:"PUT",params:r.Object({id:u()}),body:fl,response:Jr}),uet=d({tags:["retention-policies"],url:`${Ur}/bulk-update`,method:"POST",body:YN,response:VN}),met=d({tags:["retention-policies"],url:`${Ur}/bulk-update-for-team`,method:"POST",body:r.Object({teamId:u(),policies:YN}),response:VN}),det=d({tags:["retention-policies"],url:`${Ur}/:id`,method:"DELETE",params:r.Object({id:u()}),response:N}),Zs=["past-24-hours","past-7-days","past-30-days"],fet=d({tags:["retention-policies"],url:`${Ur}/requested-history-percentile/:teamId`,method:"POST",params:r.Object({teamId:u()}),body:r.Object({percentile:r.Number({minimum:0,maximum:1}),observationWindow:r.Enum(Zs),dataSource:r.Enum(Ir)}),response:r.Object({percentile:r.Number(),observationWindow:r.Enum(Zs),dataSource:r.Enum(Ir),teamId:r.String(),requestedHistoryDays:r.Number()})}),X9=["1-day","3-days","7-days","1-month","6-months","more-than-6-months"];var J9=r.Array(r.Object({bucket:r.Enum(X9),count:r.Number()})),get=d({tags:["retention-policies"],url:`${Ur}/requested-history-histogram/:teamId`,method:"POST",params:r.Object({teamId:u()}),body:r.Object({observationWindow:r.Enum(Zs),dataSource:r.Enum(Ir)}),response:r.Object({observationWindow:r.Enum(Zs),dataSource:r.Enum(Ir),teamId:r.String(),histogram:J9})}),het=d({tags:["retention-policies"],url:`${Ur}/top-teams-with-retention-surplus`,method:"POST",body:r.Object({dataSource:r.Enum(Ir),observationWindow:r.Enum(Zs),percentile:r.Number({minimum:0,maximum:1}),topN:r.Optional(r.Number({minimum:1,maximum:20}))}),response:r.Array(r.Object({teamId:r.String(),retentionSurplusDays:r.Number()}))});var Xs=`/${"v1"}/retention-policies`,Js=r.Pick(Jr,["id","env","teamId","dataSource","durationDays","isEnabled"],{$id:"RetentionPolicy",description:"Retention rule for logs, metrics, or traces. Policies can apply globally, to an environment, or to a team depending on which scope fields are present. See [Retention](/documentation/account-and-settings/retention)."}),eV={id:"123-456-abc",env:"production",teamId:"team-123-abc",dataSource:"logs",durationDays:30,isEnabled:!0};Object.assign(Js,{examples:[eV]});var QN=d({description:"Lists retention policy rows visible to the authenticated operation key. Use this to audit retention duration by signal, environment, and team.",operationId:"listRetentionPolicies",tags:["retention-policies"],url:Xs,method:"GET",response:r.Array(Js)}),WN=d({description:"Retrieves one retention policy by ID.",operationId:"getRetentionPolicy",tags:["retention-policies"],url:`${Xs}/:id`,method:"GET",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the retention policy to retrieve. Use the `id` returned by retention policy list or create responses."})}),response:Js}),th=r.Pick(fl,["env","teamId","dataSource","durationDays","isEnabled"],{description:"Retention policy create or update request. Provide the telemetry signal, retention duration, enabled state, and optional environment or team scope."}),tV={env:"production",teamId:"team-123-abc",dataSource:"logs",durationDays:30,isEnabled:!0};Object.assign(th,{examples:[tV]});var ZN=d({description:"Creates a retention policy row for a telemetry signal, optionally scoped to an environment or team. Only one policy may exist per combination of data source, environment, and team; creating a duplicate combination fails.",operationId:"createRetentionPolicy",tags:["retention-policies"],url:Xs,method:"POST",body:th,response:Js}),XN=d({description:"Replaces an existing retention policy by ID, including signal, scope fields, duration, and enabled state.",operationId:"updateRetentionPolicy",tags:["retention-policies"],url:`${Xs}/:id`,method:"PUT",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the retention policy to update. Use the `id` returned by retention policy list, get, or create responses."})}),body:th,response:Js}),JN=d({description:"Deletes a retention policy by ID. Retention resolution falls back to the next broader matching policy when one exists.",operationId:"deleteRetentionPolicy",tags:["retention-policies"],url:`${Xs}/:id`,method:"DELETE",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the retention policy to delete. Use the `id` returned by retention policy list, create, or update responses."})}),response:N});var ec=`/${"v1"}/slos`,rV=r.Pick(Dd,["id","sloId","priority","configuration"],{$id:"SloAlert",description:"Alert attached to an SLO, triggered on a burn-rate multiplier or an SLO target threshold"}),tc=r.Object({...r.Pick(di,["id","name","description","tags","configuration","target","timeframeDays","owner","permissions","clusterIds"]).properties,alerts:r.Array(rV,{description:"Alerts attached to this SLO"})},{$id:"Slo",description:"Service Level Objective definition: its SLI configuration, target percentage, rolling timeframe, cluster scope, and attached alerts"}),nV={id:"123-456-abc",name:"API availability 99.9%",description:"Overall API gateway availability over the last 30 days",tags:[{key:"team",value:"platform"}],configuration:{type:"event",dataSource:"logs",goodQuery:{queries:[{filter:"status:ok",aggregate:{type:"count"}}],formula:"q1"},totalQuery:{queries:[{filter:"*",aggregate:{type:"count"}}],formula:"q1"},noDataBehavior:"good"},target:99.9,timeframeDays:30,owner:"team-123-abc",permissions:"all",clusterIds:[],alerts:[{id:"alert-123-abc",sloId:"123-456-abc",priority:1,configuration:{type:"burn-rate",burnRate:14.4}}]};Object.assign(tc,{examples:[nV]});var eL=r.Pick(jd,["filters","sort","limit","offset"]),tL=r.Object({...eL.properties,...Ze,filters:eL.properties.filters},{description:"SLO query request. Use filters, sorting, limit, and offset to page through visible SLOs."}),oV={filters:{owners:{values:["team-123-abc"]},searchQuery:{value:"availability"},tags:{values:[{key:"team",value:"platform"}]},statuses:{values:["breached"]},clusterIds:{values:["cluster-123-abc"]}},sort:{by:"name",direction:"asc"},limit:10,offset:0};Object.assign(tL,{examples:[oV]});var rL=d({description:"Queries SLOs visible to the authenticated operation key. Use this endpoint to inventory SLO definitions, filter by owner, tag, status, or cluster, and page through results.",operationId:"querySlos",tags:["slos"],url:`${ec}/query`,method:"POST",paginated:!0,body:tL,response:r.Array(tc)}),nL=d({description:"Retrieves one SLO definition by ID.",operationId:"getSlo",tags:["slos"],url:`${ec}/:id`,method:"GET",params:r.Object({id:u({allowEmpty:!1,description:"SLO ID returned by SLO query, create, or update operations."})}),response:tc}),oL=["name","description","tags","configuration","target","timeframeDays","owner","permissions","clusterIds","alerts"],iL=r.Pick(mu,oL,{$id:"CreateSloRequest",description:"SLO creation request. Provide ownership, data access, SLI configuration, target, timeframe, optional cluster scope, and the alerts to create."}),aL=r.Pick(Gd,oL,{$id:"UpdateSloRequest",description:"SLO update request. Send all required SLO fields and the full alert list. Alerts are reconciled to exactly the provided list: alerts with a known id are updated, alerts without an id are created, and existing alerts absent from the list are deleted. Omit `clusterIds` to preserve the current cluster scope; send an empty array to run on all clusters."}),sL={name:"API availability 99.9%",description:"Overall API gateway availability over the last 30 days",tags:[{key:"team",value:"platform"}],configuration:{type:"event",dataSource:"logs",goodQuery:{queries:[{filter:"status:ok",aggregate:{type:"count"}}],formula:"q1"},totalQuery:{queries:[{filter:"*",aggregate:{type:"count"}}],formula:"q1"},noDataBehavior:"good"},target:99.9,timeframeDays:30,owner:"team-123-abc",permissions:"all",clusterIds:[],alerts:[{priority:1,configuration:{type:"burn-rate",burnRate:14.4}}]};Object.assign(iL,{examples:[sL]});Object.assign(aL,{examples:[sL]});var cL=d({description:"Creates an SLO owned by the specified team. The SLO can be event-based (good/total queries) or time-based (a thresholded query over evaluation slices) depending on its configuration.",operationId:"createSlo",tags:["slos"],url:ec,method:"POST",body:iL,response:tc}),pL=d({description:"Replaces an existing SLO definition by ID. Send the full SLO input shape, including configuration, ownership, permissions, cluster scope, and the reconciled alert list. Changing configuration, target, timeframe, permissions, or cluster scope resets evaluated SLO state, so returned status and error budget are based on data evaluated after the update.",operationId:"updateSlo",tags:["slos"],url:`${ec}/:id`,method:"PUT",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the SLO to update. Use the `id` returned by SLO query or create."})}),body:aL,response:tc}),uL=d({description:"Deletes an SLO by ID. Deleting an SLO stops future evaluations and removes its attached alerts.",operationId:"deleteSlo",tags:["slos"],url:`${ec}/:id`,method:"DELETE",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the SLO to delete. Use the `id` returned by SLO query or create."})}),response:N});var Ao=`${Ws}/tag-policies`;var iV=["logs","metrics","traces"],rh=r.Array(r.Enum(iV,{description:"Telemetry signal covered by a data tag policy."}),{description:"Telemetry signals covered by the policy. An empty array means logs, metrics, and traces."}),aV=r.Union([Mp,rh]),sV=r.Object({teamIds:r.Array(r.String(),{description:"Team IDs used by this policy scope."}),mode:r.Enum(["include","exclude"],{description:"`include` applies the policy only to listed teams. `exclude` applies it to all teams except the listed teams."})},{description:"Team scope that limits where this policy applies. Omitted means the policy applies to all teams."}),cV=C("type",[r.Object({type:r.Literal("telemetry",{description:"Policy applies to telemetry data points during ingestion or evaluation."}),assetTypes:rh,shouldInsertWarning:r.Boolean({description:"When true, Tsuga annotates non-compliant telemetry with tag policy warnings instead of only measuring violations."}),dropSample:r.Optional(r.Number({description:"Percentage of non-compliant telemetry datapoints to drop. Omitted means no sampling drop is configured."}))},{title:"TelemetryTagPolicy"}),r.Object({type:r.Literal("tsuga_asset",{description:"Policy applies to Tsuga-managed resources such as dashboards, routes, and keys."}),assetTypes:Mp},{title:"TsugaAssetTagPolicy"})]),pV=C("type",[r.Object({type:r.Literal("telemetry",{description:"Policy applies to telemetry data points during ingestion or evaluation."}),assetTypes:rh,shouldInsertWarning:r.Boolean({description:"When true, Tsuga annotates non-compliant telemetry with tag policy warnings instead of only measuring violations."}),dropSample:r.Optional(r.Number({minimum:0,maximum:100,description:"Percentage of non-compliant telemetry datapoints to drop. Valid values are 0 through 100."}))},{title:"TelemetryTagPolicy"}),r.Object({type:r.Literal("tsuga_asset",{description:"Policy applies to Tsuga-managed resources such as dashboards, routes, and keys."}),assetTypes:Mp},{title:"TsugaAssetTagPolicy"})]),lL="Policy surface and enforcement behavior. Use `telemetry` for telemetry data or `tsuga_asset` for Tsuga-managed resources.",uV=r.Unsafe({...cV,description:lL}),lV=r.Unsafe({...pV,description:lL}),Ji=r.Object({id:r.String({description:"Tsuga-generated tag policy ID assigned when the policy is created."}),name:r.String({description:"Human-readable tag policy name."}),description:r.Optional(r.String({description:"Optional user-provided policy description."})),isActive:r.Boolean({description:"Whether Tsuga currently evaluates this policy. Reserved policies (for example the built-in `env` policy on ingestion API keys) cannot be set to false."}),tagKey:r.String({description:"Tag key enforced by this policy."}),allowedTagValues:r.Array(r.String(),{description:"Allowed values for `tagKey`. An empty array means any value is accepted when the tag exists."}),isRequired:r.Boolean({description:"Whether the tag must be present. If false, `allowedTagValues` is still enforced when the tag exists. Reserved policies cannot be set to false."}),teamScope:r.Optional(sV),configuration:uV,creator:r.Optional(pe),updater:r.Optional(pe),owner:r.Optional(r.String({description:"Team ID that owns and manages the policy."})),createdAt:A({description:"Timestamp when Tsuga created the tag policy."}),updatedAt:A({description:"Timestamp when Tsuga last updated the tag policy."}),assetUpdatedAt:A({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})});var rc=r.Object({name:u({description:"Human-readable tag policy name."}),description:r.Optional(u({description:"Optional policy description."})),isActive:r.Boolean({description:"Set to true for Tsuga to evaluate this policy. Reserved policies (for example the built-in `env` policy on ingestion API keys) reject a false value."}),tagKey:u({allowEmpty:!1,description:"Tag key enforced by this policy. Tsuga trims surrounding whitespace before storing the policy."}),allowedTagValues:r.Array(u({allowEmpty:!1}),{maxItems:1e3,description:"Allowed values for `tagKey`. Leave empty to allow any value when the tag exists. Tsuga trims each submitted value before storing the policy."}),isRequired:r.Boolean({description:"Set to true to require the tag. If false, allowed values still apply when the tag exists. Reserved policies reject a false value."}),teamScope:r.Optional(r.Object({teamIds:r.Array(u(),{minItems:1,maxItems:100,description:"Team IDs used by this policy scope."}),mode:r.Enum(["include","exclude"],{description:"`include` applies the policy only to listed teams. `exclude` applies it to all teams except the listed teams."})},{description:"Team scope to store for this policy. Omit this field to apply the policy to all teams."})),configuration:lV,owner:u({allowEmpty:!1,description:"Team ID that will own and manage the policy."})}),jet=d({tags:["tag-policies"],url:Ao,method:"GET",query:r.Object({teamIds:r.Optional(r.Array(u(),{maxItems:100})),assetTypes:r.Optional(aV),searchQuery:r.Optional(u())}),response:r.Array(Ji)}),Fet=d({tags:["tag-policies"],url:`${Ao}/:id`,method:"GET",params:r.Object({id:u()}),response:Ji}),qet=d({tags:["tag-policies"],url:Ao,method:"POST",body:rc,response:Ji}),Bet=d({tags:["tag-policies"],url:`${Ao}/:id`,method:"PUT",params:r.Object({id:u()}),body:rc,response:Ji}),Het=d({tags:["tag-policies"],url:`${Ao}/:id`,method:"DELETE",params:r.Object({id:u()}),response:N}),Ket=d({tags:["tag-policies"],url:`${Ws}/applicable-tag-rules`,method:"GET",query:r.Object({assetType:r.Enum(Ba),teamId:u()}),response:r.Array(r.Object({tagKey:r.String(),allowedTagValues:r.Array(r.String()),isRequired:r.Boolean(),tagPolicyId:r.String()}))}),mL=r.Object({total:r.Number(),totalNonCompliant:r.Number(),idsNonCompliant:r.Array(r.String())}),dL=r.Union([r.Literal("ingestion-api-key"),r.Literal("operation-api-key"),r.Literal("rum-public-token"),r.Literal("dashboard"),r.Literal("log-route"),r.Literal("metric-route"),r.Literal("monitor"),r.Literal("notification-rule"),r.Literal("notification-silence"),r.Literal("slo")]),mV=r.Object({total:r.Number(),totalNonCompliant:r.Number(),byAssetType:r.Record(dL,mL)}),dV=r.Omit(mL,["total"]),fV=r.Object({totalNonCompliant:r.Number(),byAssetType:r.Record(dL,dV)}),fL=r.Object({totals:mV,byTeam:r.Record(r.String(),fV)}),zet=d({tags:["tag-policies"],url:`${Ao}/:id/stats`,method:"GET",params:r.Object({id:u()}),response:fL}),Yet=d({tags:["tag-policies"],url:`${Ao}/new-policy-stats`,method:"POST",body:rc,response:fL});var nc=`/${"v1"}/tag-policies`,gL={name:"Required Environment Tag",description:"Requires dashboards and monitors to declare an environment.",isActive:!0,tagKey:"environment",allowedTagValues:["production","staging"],isRequired:!0,teamScope:{teamIds:["team-123-abc"],mode:"include"},configuration:{type:"tsuga_asset",assetTypes:["dashboard","monitor"]},owner:"team-123-abc"},hL={name:"Telemetry Environment Policy",description:"Warns when telemetry is missing a known deployment environment.",isActive:!0,tagKey:"deployment.environment.name",allowedTagValues:["production","staging","development"],isRequired:!0,configuration:{type:"telemetry",assetTypes:[],shouldInsertWarning:!0,dropSample:25},owner:"team-123-abc"},gV={id:"123-456-abc",...gL},hV={id:"456-789-def",...hL},oc=r.Pick(Ji,["id","name","description","isActive","tagKey","allowedTagValues","isRequired","teamScope","configuration","owner"],{$id:"TagPolicy",description:"Policy that enforces tag requirements on Tsuga-managed assets or telemetry data. See [Tag policies](/documentation/account-and-settings/tag-policies)."}),yV=gV,TV=hV;Object.assign(oc,{examples:[yV,TV]});var nh=r.Pick(rc,["name","description","isActive","tagKey","allowedTagValues","isRequired","teamScope","configuration","owner"],{description:"Tag policy create or update request. Provide policy identity, owner, enforced tag key, allowed values, team scope, active state, and asset or telemetry configuration."}),EV=gL,_V=hL;Object.assign(nh,{examples:[EV,_V]});var yL=d({description:"Lists tag policies visible to the authenticated operation key. Use this to audit required tags, allowed values, team scope, and whether each policy applies to assets or telemetry.",operationId:"listTagPolicies",tags:["tag-policies"],url:nc,method:"GET",response:r.Array(oc)}),TL=d({description:"Retrieves one tag policy by ID.",operationId:"getTagPolicy",tags:["tag-policies"],url:`${nc}/:id`,method:"GET",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the tag policy to retrieve. Use the `id` returned by tag policy list or create responses."})}),response:oc}),EL=d({description:"Creates a tag policy for Tsuga-managed assets or telemetry data. Use the configuration type to choose the policy surface.",operationId:"createTagPolicy",tags:["tag-policies"],url:nc,method:"POST",body:nh,response:oc}),_L=d({description:"Replaces an existing tag policy by ID, including scope, requiredness, allowed values, owner, active state, and configuration. Reserved policies (for example the built-in `env` policy on ingestion API keys) reject changes to `tagKey` and reject `isActive: false` or `isRequired: false`.",operationId:"updateTagPolicy",tags:["tag-policies"],url:`${nc}/:id`,method:"PUT",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the tag policy to update. Use the `id` returned by tag policy list, get, or create responses."})}),body:nh,response:oc}),IL=d({description:"Deletes a tag policy by ID. Tsuga stops evaluating the policy after deletion. Reserved policies (for example the built-in `env` policy on ingestion API keys) cannot be deleted.",operationId:"deleteTagPolicy",tags:["tag-policies"],url:`${nc}/:id`,method:"DELETE",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the tag policy to delete. Use the `id` returned by tag policy list, create, or update responses."})}),response:N});var ic=`/${"v1"}/teams`,ac=r.Pick(ui,["id","name","description","visibility","tags"],{$id:"Team",description:"Collection of users used to manage ownership, visibility, and access to team-owned Tsuga resources. See [Teams](/documentation/account-and-settings/teams)."}),IV={id:"team-123-abc",name:"platform-engineering",visibility:"public",tags:[{key:"department",value:"engineering"}]};Object.assign(ac,{examples:[IV]});var bL=d({description:"Lists teams visible to the authenticated operation key. Use this endpoint to inventory owners for resources, dashboards, monitors, routes, and policies. Pagination fields limit the returned page.",operationId:"listTeams",tags:["teams"],url:ic,method:"GET",paginated:!0,query:r.Object(Ze),response:r.Array(ac)}),SL=d({description:"Retrieves one team by ID.",operationId:"getTeam",tags:["teams"],url:`${ic}/:id`,method:"GET",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the team to retrieve. Use the `id` returned by team list or create responses."})}),response:ac}),oh=r.Pick(cu,["name","description","visibility","tags"],{description:"Team create or update request. Provide the team name, optional description, visibility, and tags."}),bV={name:"platform-engineering",visibility:"public",tags:[{key:"department",value:"engineering"}]};Object.assign(oh,{examples:[bV]});var AL=d({description:"Creates a team for ownership and access control. Use this before assigning resources to a new owner team. A new team sits outside every existing team, so the operation key must be scoped to all teams: a key scoped to its owning team cannot create teams, even with write access to teams.",operationId:"createTeam",tags:["teams"],url:ic,method:"POST",body:oh,response:ac}),OL=d({description:"Replaces a team definition by ID, including name, description, visibility, and tags.",operationId:"updateTeam",tags:["teams"],url:`${ic}/:id`,method:"PUT",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the team to update. Use the `id` returned by team list, get, or create responses."})}),body:oh,response:ac}),xL=d({description:"Deletes a team. Fails while the team still owns resources (dashboards, monitors, routes, API keys, etc.); reassign or delete those first. Team memberships are removed automatically as part of the deletion.",operationId:"deleteTeam",tags:["teams"],url:`${ic}/:id`,method:"DELETE",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the team to delete. Use the `id` returned by team list, create, or update responses."})}),response:N});function SV(e){return/^[aeiou]/i.test(e)||e==="SLO"?"an":"a"}function RL(e,t){let n=Number(t);if(Number.isNaN(n))throw new Error(`--${e} must be a number (got: ${t})`);return n}function CL(e){let t={};return e.limit!==void 0&&(t.limit=RL("limit",e.limit)),e.offset!==void 0&&(t.offset=RL("offset",e.offset)),t}function ih(e){let t=e.params;if(t?.properties){let n=Object.keys(t.properties);if(n.length===1&&n[0])return n[0]}return"id"}function PL(e,t,n){let o=e.command(t.commandName).description(t.description),i=t.singularOverride??xx(t.commandName).replace(/-/g," "),a=t.pluralOverride??t.commandName.replace(/-/g," "),c=SV(i),l=o.command("list").description(t.listDescription??`List all ${a}`);if(t.listOptions)for(let m of t.listOptions)l.option(m.flag,m.description);if(t.endpoints.list.paginated===!0&&l.option("--limit <n>",`Maximum number of items to return, up to ${ti} (default: ${kp})`).option("--offset <n>","Number of items to skip, to request a later page"),t.enableListBody?l.option("-d, --data <JSON>","Inline JSON body").option("--generate-skeleton","Print a JSON skeleton for the request body and exit").action(async m=>{if(m.generateSkeleton){ee(vi(t.endpoints.list));return}let f=m.data?Ei({data:m.data}):{},h=await n()(t.endpoints.list,{body:{...f,...CL(m)}});ee(h)}):l.action(async m=>{let f=CL(m);if(t.listOptions)for(let E of t.listOptions){let I=m[E.queryParam];I!==void 0&&(f[E.queryParam]=I)}let h=await n()(t.endpoints.list,Object.keys(f).length>0?{query:f}:void 0);ee(h)}),t.endpoints.get){let m=t.endpoints.get,f=ih(m);o.command("get <ID>").description(`Get ${c} ${i} by ID`).action(async h=>{let E=await n()(m,{params:{[f]:h}});ee(E)})}if(t.endpoints.create){let m=t.endpoints.create;o.command("create").description(`Create a new ${i}`).option("-f, --file <FILE_PATH>","Read body from file (use - for stdin)").option("-d, --data <JSON>","Inline JSON body").option("--generate-skeleton","Print a JSON skeleton for the request body and exit").action(async f=>{if(f.generateSkeleton){ee(vi(m));return}let h=Ei(f),E=await n()(m,{body:h});ee(E)})}if(t.endpoints.update){let m=t.endpoints.update,f=ih(m);o.command("update <ID>").description(`Update ${c} ${i} by ID`).option("-f, --file <FILE_PATH>","Read body from file (use - for stdin)").option("-d, --data <JSON>","Inline JSON body").option("--generate-skeleton","Print a JSON skeleton for the request body and exit").action(async(h,E)=>{if(E.generateSkeleton){ee(vi(m));return}let I=Ei(E),g=await n()(m,{params:{[f]:h},body:I});ee(g)})}if(t.endpoints.delete){let m=t.endpoints.delete,f=ih(m);o.command("delete <ID>").description(`Delete ${c} ${i} by ID`).action(async h=>{let E=await n()(m,{params:{[f]:h}});ee(E)})}}var AV=[{commandName:"cloud-resources",description:"List cloud resources discovered by inventory scans",endpoints:{list:kv},enableListBody:!0},{commandName:"dashboard-folders",description:"Manage dashboard folders",endpoints:{list:Fw,get:qw,create:Bw,update:Hw,delete:Kw},enableListBody:!0},{commandName:"dashboards",description:"Manage dashboards",endpoints:{list:dv,get:fv,create:gv,update:hv,delete:yv},enableListBody:!0},{commandName:"ingestion-api-keys",description:"Manage ingestion API keys",singularOverride:"ingestion API key",pluralOverride:"ingestion API keys",endpoints:{list:Av,create:Ov,update:xv,delete:Rv}},{commandName:"investigations",description:"Manage investigations (beta)",endpoints:{list:Dv,get:Gv,create:$v,update:jv,delete:Fv}},{commandName:"monitors",description:"Manage monitors",endpoints:{list:lN,get:mN,create:_N,update:IN,delete:bN},enableListBody:!0},{commandName:"notification-rules",description:"Manage notification rules",endpoints:{list:AN,get:ON,create:xN,update:RN,delete:CN}},{commandName:"notification-silences",description:"Manage notification silences",endpoints:{list:NN,get:LN,create:kN,update:MN,delete:DN}},{commandName:"quality-reports",description:"Get the latest quality report rows for a cluster",listDescription:"Get the latest quality report rows for a cluster (pass --cluster <CLUSTER_ID> when the org has more than one cluster)",endpoints:{list:HN},listOptions:[{flag:"--team <TEAM_NAME>",description:"Only return rows for this team by name (omits cluster-wide global rows)",queryParam:"team"}]},{commandName:"retention-policies",description:"Manage retention policies",endpoints:{list:QN,get:WN,create:ZN,update:XN,delete:JN}},{commandName:"log-routes",description:"Manage log routes",endpoints:{list:eN,get:tN,create:rN,update:nN,delete:oN}},{commandName:"services",description:"List and inspect services (read-only; services are inferred from telemetry)",endpoints:{list:wR,get:vR}},{commandName:"slos",description:"Manage SLOs",singularOverride:"SLO",pluralOverride:"SLOs",endpoints:{list:rL,get:nL,create:cL,update:pL,delete:uL},enableListBody:!0},{commandName:"tag-policies",description:"Manage tag policies",endpoints:{list:yL,get:TL,create:EL,update:_L,delete:IL}},{commandName:"teams",description:"Manage teams",endpoints:{list:bL,get:SL,create:AL,update:OL,delete:xL}}];function UL(e,t){for(let n of AV)PL(e,n,t)}var wL=require("node:child_process");var gl="@tsuga/cli@latest";function OV(){V(`Updating ${gl}`),V(` $ npm install -g ${gl}`);try{(0,wL.execFileSync)("npm",["install","-g",gl],{stdio:["ignore","inherit","inherit"]})}catch(e){let t=e.status??1;throw new Error(`npm install -g ${gl} exited ${t}`,{cause:e})}V("Updated. Run `tsuga --version` to confirm the new version.")}function vL(e){e.command("self-update").description("Update the Tsuga CLI to the latest version via npm").action(()=>{OV()})}var mh=require("node:fs"),lh=require("node:os"),ta=require("node:path");var xV=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i,sc=class e extends Date{#t=!1;#r=!1;#e=null;constructor(t){let n=!0,o=!0,i="Z";if(typeof t=="string"){let a=t.match(xV);a?(a[1]||(n=!1,t=`0000-01-01T${t}`),o=!!a[2],o&&t[10]===" "&&(t=t.replace(" ","T")),a[2]&&+a[2]>23?t="":(i=a[3]||null,t=t.toUpperCase(),!i&&o&&(t+="Z"))):t=""}super(t),isNaN(this.getTime())||(this.#t=n,this.#r=o,this.#e=i)}isDateTime(){return this.#t&&this.#r}isLocal(){return!this.#t||!this.#r||!this.#e}isDate(){return this.#t&&!this.#r}isTime(){return this.#r&&!this.#t}isValid(){return this.#t||this.#r}toISOString(){let t=super.toISOString();if(this.isDate())return t.slice(0,10);if(this.isTime())return t.slice(11,23);if(this.#e===null)return t.slice(0,-1);if(this.#e==="Z")return t;let n=+this.#e.slice(1,3)*60+ +this.#e.slice(4,6);return n=this.#e[0]==="-"?n:-n,new Date(this.getTime()-n*6e4).toISOString().slice(0,-1)+this.#e}static wrapAsOffsetDateTime(t,n="Z"){let o=new e(t);return o.#e=n,o}static wrapAsLocalDateTime(t){let n=new e(t);return n.#e=null,n}static wrapAsLocalDate(t){let n=new e(t);return n.#r=!1,n.#e=null,n}static wrapAsLocalTime(t){let n=new e(t);return n.#t=!1,n.#e=null,n}};function RV(e,t){let n=e.slice(0,t).split(/\r\n|\n|\r/g);return[n.length,n.pop().length+1]}function CV(e,t,n){let o=e.split(/\r\n|\n|\r/g),i="",a=(Math.log10(t+1)|0)+1;for(let c=t-1;c<=t+1;c++){let l=o[c-1];l&&(i+=c.toString().padEnd(a," "),i+=": ",i+=l,i+=`
|
|
139
|
+
fish: tsuga completion fish > ~/.config/fish/completions/tsuga.fish`).action(t=>{let{rows:n,valueFlags:o}=XF(e);if(t==="bash")V(JF(Nx(n),o));else if(t==="zsh")V(eB(Nx(n),o));else if(t==="fish")V(rB(tB(n),o));else throw new Error(`Unsupported shell "${t}". Supported: bash, zsh, fish.`)})}function Mx(e){let t=e.command("config").description("Show or manage configuration");t.action(()=>{let n=e.opts(),o=oi({operationApiKey:n.operationApiKey,clusterId:n.cluster});V(GO(o,zp()).trimEnd())}),t.command("set").description("Set a configuration value").command("default <FLAG_NAME> <VALUE>").description("Set a custom default value for a command flag").allowUnknownOption(!0).action((n,o)=>{MO(n,o),V(`Default set: ${n} = ${o}`)}),t.command("reset").description("Reset configuration values").command("defaults").description("Clear all custom defaults").action(()=>{DO(),V("Custom defaults cleared")})}var Dx=`/${"v1"}/docs`,Gx=r.Object({path:r.String({description:"Path identifying the page. Documentation pages use a slug path (e.g. `getting-started/send-your-first-logs`). API-reference pages use `api/<operationId>` (e.g. `api/aggregateScalar`)."}),title:r.String({description:'Title of the page (e.g. "Send your first logs" or "POST /v1/aggregation/multi-query/scalar")'}),content:r.String({description:"Raw markdown content of the page"})},{$id:"DocPage",description:"A documentation or API-reference page with its raw markdown content"}),nB={path:"getting-started/send-your-first-logs",title:"Send your first logs",content:`# Send your first logs
|
|
140
|
+
...`};Object.assign(Gx,{examples:[nB]});var $x=r.Object({kind:r.Enum(["doc","api"],{description:"`doc` for documentation pages (guides, references, release notes); `api` for API-reference endpoints indexed from the OpenAPI spec. Use this to decide how to present or follow up on the result."}),path:r.String({description:"Path identifying the result. Documentation pages use a slug path (e.g. `data-collection/guides/how-to-add-resource-attributes`). API-reference results use `api/<operationId>` (e.g. `api/aggregateScalar`)."}),title:r.String({description:'Title of the result (e.g. "How to Add Resource Attributes" or "POST /v1/aggregation/multi-query/scalar")'}),subsection:r.Optional(r.String({description:'For documentation pages: the heading path inside the page that matched (e.g. "Language setup"). For API results: the matched field or parameter breadcrumb (e.g. "Body \u203A queries"). Absent when the match is the page or endpoint intro.'})),tab:r.Optional(r.String({description:'Tab label inside the page that the result matched. Set when the matching content is inside a <Tabs><Tab label="\u2026"> block. Always absent for API results.'})),anchor:r.Optional(r.String({description:"For documentation pages: the slugified heading ID used as the URL fragment (e.g. `language-setup`). For API results: the Scalar deep-link fragment (`tag/<tag>/<METHOD><path>`). The `link` field already has this baked in."})),score:r.Number({description:"Relevance score between 0 and 1 (higher is more relevant)"}),excerpt:r.String({description:"Short snippet of matching content"}),link:r.String({description:"URL to the result in the Tsuga app. Documentation pages include the section anchor and tab query parameter when applicable. API results deep-link into the API reference at `/documentation/api#tag/\u2026`."})},{$id:"DocSearchResult",description:"A documentation page or API-reference endpoint search result"}),oB={kind:"doc",path:"data-collection/guides/how-to-add-resource-attributes",title:"How to Add Resource Attributes",subsection:"Set resource attributes by language",tab:"Python",anchor:"set-resource-attributes-by-language",score:.9,excerpt:"...Python SDK setup should use the default resource detectors...",link:"https://www.app.tsuga.com/documentation/data-collection/guides/how-to-add-resource-attributes?tab=Python#set-resource-attributes-by-language"};Object.assign($x,{examples:[oB]});var jx=d({description:"Retrieve the raw markdown content of a documentation or API-reference page by its path. Documentation pages use slug paths (e.g. `getting-started/send-your-first-logs`); API-reference pages use `api/<operationId>` (e.g. `api/aggregateScalar`).",operationId:"getDocPage",tags:["public","docs"],url:Dx,method:"GET",query:r.Object({path:u({allowEmpty:!1,description:"Documentation path to fetch. Use page slug paths for docs or `api/<operationId>` for API-reference pages."})},{description:"Documentation page lookup query."}),response:Gx}),qx=d({description:"Searches public documentation pages and API-reference endpoints. Use this to build help search or route users to Tsuga docs and API reference results. Results are ranked by relevance; an empty array means no page or endpoint matched the query.",operationId:"searchDocs",tags:["public","docs"],url:`${Dx}/search`,method:"GET",query:r.Object({query:u({allowEmpty:!1,description:"Search text to match against documentation and API-reference content."})},{description:"Documentation search query."}),response:r.Array($x)});function Fx(e,t){let n=e.command("docs").description("Search and fetch Tsuga documentation and API-reference pages");n.command("get <DOC_PATH>").description("Get a documentation or API-reference page by path (e.g. 'getting-started/send-your-first-logs' or 'api/aggregateScalar')").action(async o=>{let i=await t()(jx,{query:{path:o}});ee(i)}),n.command("search <SEARCH_TEXT>").description("Search Tsuga documentation and the full API reference, ranked by relevance").action(async o=>{let i=await t()(qx,{query:{query:o}});ee(i)})}var iB=`/${"v1"}/feedback`,Bx=r.Object({id:r.String({description:"API request ID recorded with the feedback."})},{$id:"Feedback",description:"A recorded piece of feedback"}),aB={id:"request-123-abc"};Object.assign(Bx,{examples:[aB]});var Hx=r.Object({content:u({allowEmpty:!1,type:"long",description:"Free-text feedback content, e.g. what went wrong, what was confusing, or a suggestion. Required and must be non-empty."})}),sB={content:"The traces command times out for large services."};Object.assign(Hx,{examples:[sB]});var Kx=d({description:"Submit free-text feedback about Tsuga tools or APIs, e.g. a tool that failed, returned unusable output, or was confusing to use. Feedback is recorded for the Tsuga team to review and improve tooling.",operationId:"createFeedback",tags:["public","feedback"],url:iB,method:"POST",body:Hx,response:Bx});function zx(e,t){e.command("feedback <MESSAGE...>").description("Send feedback about Tsuga tools or APIs (e.g. a tool that failed or was confusing)").action(async n=>{let o=await t()(Kx,{body:{content:n.join(" ")}});ee(o)})}var cB="^\\S(.*\\S)?$",pB=128,uB=256,lB=r.Object({key:r.String({description:"Tag key attached to the resource. Consumers can use key/value tags for filtering, ownership context, and policy checks."}),value:r.String({description:"Tag value attached to the resource for this key. Tsuga returns the value exactly as stored."})},{title:"Tag"}),mB=r.Object({key:r.String({maxLength:pB,description:"Tag key to attach to the resource."}),value:r.String({maxLength:uB,pattern:cB,description:"Tag value to attach to the resource. Leading or trailing whitespace is rejected."})},{title:"Tag"}),Ft=r.Array(lB,{title:"Tags",description:"Key/value tags applied to the resource. Use them to organize resources and to satisfy tag policies."}),Bt=r.Array(mB,{title:"Tags",maxItems:50,description:"Key/value tags to apply to the resource. Tag policies may require specific keys or values."}),De=r.Optional(Ft),Xe=r.Optional(Bt);var In="/v0/teams",su=["public","private"],au={NAME:"name",CREATED_AT:"createdAt",MEMBER_COUNT:"memberCount",VISIBILITY:"visibility"},dB=r.Enum([au.NAME,au.CREATED_AT,au.MEMBER_COUNT,au.VISIBILITY],{description:"Team field used for sorting list responses. Use `name`, `createdAt`, `memberCount`, or `visibility`."}),Qx=r.Object({color:r.Enum(Ed,{description:"Color token used by Tsuga when rendering the team avatar."}),mode:r.Enum(_d,{description:"Avatar rendering mode selected for the team."}),iconName:r.Enum(Ax,{description:"Icon name rendered inside the team avatar when icon mode is used."})}),Od=r.Object({color:r.Enum(Ed),mode:r.Enum(_d)}),Yx=100,Vx=250,ui=r.Object({id:r.String({description:"Unique identifier of the team. Generated by Tsuga and stable for the team lifetime."}),name:r.String({description:"Human-readable team name displayed throughout Tsuga and used in team search."}),description:r.Optional(r.String({description:"Optional free-text description of the team."})),visibility:r.Enum(su,{description:"`public` makes team-owned resources discoverable according to access controls. `private` restricts discovery to team members and authorized users."}),tags:De,createdAt:A({description:"Timestamp when Tsuga created the team."}),updatedAt:A({description:"Timestamp when Tsuga last updated the team metadata."}),memberCount:r.Optional(r.Number({description:"Number of members currently in the team"})),avatar:r.Optional(Qx)}),cu=r.Object({name:r.String({minLength:1,maxLength:Yx,format:Jo,description:`Name to assign to the team. Must be kebab-case (lowercase letters, numbers, and dashes only) and unique in the organization. Maximum length is ${Yx} characters.`}),description:r.Optional(r.String({maxLength:Vx,description:`Optional team description. Maximum length is ${Vx} characters.`})),visibility:r.Enum(su,{description:"`public` makes team-owned resources discoverable according to access controls. `private` restricts discovery to team members and authorized users."}),tags:Xe,avatar:r.Optional(Qx)}),fB=r.Object({id:r.String(),name:r.String(),email:r.String(),role:r.Enum(ii),joinedTeamAt:A(),orgRole:r.Enum(BO),avatar:r.Optional(Od)}),Wx=r.Object({searchQuery:r.Optional(u({description:"Substring matched against team names and descriptions."})),visibility:r.Optional(r.Enum(su,{description:"Restrict results to teams with this visibility."})),myTeamsOnly:r.Optional(r.Boolean({description:"If true, return only teams that include the authenticated user."}))}),GNe=d({tags:["teams"],url:In,method:"GET",paginated:!0,response:r.Array(ui),query:r.Object({...ge,includeMemberCount:r.Optional(r.Boolean()),...Wx.properties,sortBy:r.Optional(dB),sortDirection:r.Optional(r.Enum(["asc","desc"],{description:"Sort direction: ascending or descending."}))})}),$Ne=d({tags:["teams"],url:`${In}/:id`,method:"GET",params:r.Object({id:u()}),response:ui}),jNe=d({tags:["teams"],url:`${In}/:id/members`,method:"GET",params:r.Object({id:u()}),response:r.Array(fB)}),qNe=d({tags:["teams"],url:`${In}/:id/assets`,method:"GET",params:r.Object({id:u()}),response:r.Object({apiKeyCount:r.Number(),logRouteCount:r.Number(),monitorCount:r.Number(),notificationRuleCount:r.Number(),dashboardCount:r.Number()})}),FNe=d({tags:["teams"],url:In,method:"POST",body:cu,response:ui}),BNe=d({tags:["teams"],url:`${In}/:id`,method:"PUT",params:r.Object({id:u()}),body:cu,response:ui}),gB=C("type",[r.Object({type:r.Literal("ids"),teamIds:r.Array(u({allowEmpty:!1}),{minItems:1,maxItems:100})}),r.Object({type:r.Literal("all"),filters:r.Optional(Wx)})]),HNe=d({tags:["teams"],url:`${In}/bulk-update`,method:"POST",body:r.Object({selection:gB,config:r.Object({visibility:r.Enum(su)})}),response:r.Object({})}),KNe=d({tags:["teams"],url:`${In}/:id`,method:"DELETE",params:r.Object({id:u()}),response:N});var hB=r.Enum(["agent","cli","mcp-codemode","mcp-server","terraform-provider","web-frontend"],{description:"Tsuga client surface that performed the operation. Use this to distinguish UI, CLI, MCP, and Terraform-originated changes."}),pe=C("type",[r.Object({type:r.Literal("user",{description:"The resource was created or updated by a user."}),id:r.String({description:"Unique identifier of the user actor."}),name:r.String({description:"Display name of the user actor at the time of response."}),avatar:r.Optional(Od)}),r.Object({type:r.Literal("operation-api-key",{description:"The resource was created or updated by an operation API key."}),id:r.String({description:"Unique identifier of the operation API key actor."}),name:r.String({description:"Display name of the operation API key actor."}),source:r.Optional(hB)})],{description:"User or operation API key responsible for creating or updating a resource. Returned by Tsuga for audit context."});var At="/v0/monitors",li=["alert","resolve","keep_last_status","consider_zero"],mi=["alert","resolve","keep_last_status"];var Xx=["no_aggregation","all","any","each","proportion"],Jx=["greater_than","less_than","equal","not_equal","greater_than_or_equal","less_than_or_equal"];var yB=r.Object({formula:r.String({description:"Formula result to compare against the threshold, usually `q1` or a formula alias."}),operator:r.Enum(Jx,{description:"Comparison operator used to evaluate the threshold condition."}),threshold:r.Number({description:"Numeric threshold value used by the comparison. May be negative when the formula result can be below zero."})}),TB=r.Object({formula:u({type:"tsuga-formula",description:"Formula result to compare against the threshold, usually `q1` or a formula alias."}),operator:r.Enum(Jx,{description:"Comparison operator used to evaluate the threshold condition."}),threshold:r.Number({description:"Numeric threshold value used by the comparison. May be negative when the formula result can be below zero."})}),EB=5,xd=r.Array(yB,{description:"Threshold conditions evaluated against query and formula results. All listed conditions must match for a non-grouped threshold monitor to alert."}),Rd=r.Array(TB,{minItems:1,maxItems:EB,description:"Threshold conditions evaluated against query and formula results. All listed conditions must match for a non-grouped threshold monitor to alert."}),Cd=r.Object({formula:r.String({description:"Formula result analyzed for anomalous behavior, usually `q1` or a formula alias."}),conditionType:r.Enum(["rate","error","cpu","general","to_be_set"],{description:"Anomaly model type Tsuga uses to classify expected behavior: `rate` flags downward anomalies (e.g. count rates), `error` and `cpu` flag upward anomalies (e.g. error counts/rates, CPU usage), `general` flags both directions, and `to_be_set` is a placeholder Tsuga replaces by inferring the model type from the monitor query when the monitor is created or updated."})},{description:"Anomaly detection condition evaluated by this monitor. The `formula` result is compared against behavior learned from historical query results, and the monitor alerts on deviations in the direction implied by `conditionType`."}),Pd=r.Object({formula:u({type:"tsuga-formula",description:"Formula result analyzed for anomalous behavior, usually `q1` or a formula alias."}),conditionType:r.Enum(["rate","error","cpu","general","to_be_set"],{description:"Anomaly model type used to classify expected behavior: `rate` flags downward anomalies (e.g. count rates), `error` and `cpu` flag upward anomalies (e.g. error counts/rates, CPU usage), and `general` flags both directions. Use `to_be_set` to let Tsuga infer the model type from the monitor query during create or update."})},{description:"Anomaly detection condition evaluated by this monitor. The `formula` result is compared against behavior learned from historical query results, and the monitor alerts on deviations in the direction implied by `conditionType`."}),St=[1,2,3,4,5];var pu={timeframe:r.Number({description:"Lookback window, in minutes, that each query-backed threshold monitor evaluation aggregates over. Always a whole number, at least 1."}),groupByFields:r.Array(r.Object({fields:r.Array(r.String(),{description:"Attribute names the monitor splits results by, evaluating each resulting group independently. Empty means the monitor evaluates a single ungrouped series."}),limit:r.Number({description:"Configured limit for this group by. Currently ignored; monitor evaluation applies a fixed limit of 100 groups per field."}),sortOrder:r.Optional(r.Enum(["asc","desc"],{description:"Sort direction applied to groups: ascending or descending."})),replaceNullWith:r.Optional(r.String({description:"Value used to group documents that have no value for a grouped field."}))}),{description:"Monitor group by configuration. The `limit` setting is currently ignored; evaluation applies a fixed limit of 100 groups per field."}),aggregationAlertLogic:r.Optional(r.Enum(Xx,{description:"How grouped results are combined into alert state. Use `no_aggregation` only when `groupByFields` is empty; use `all`, `any`, `each`, or `proportion` with non-empty `groupByFields`. `proportion` also requires `proportionAlertThreshold`."})),proportionAlertThreshold:r.Optional(r.Integer({description:"Percentage threshold used when `aggregationAlertLogic` is `proportion`."}))},uu={timeframe:r.Integer({minimum:1,description:"Lookback window, in minutes, that each query-backed threshold monitor evaluation aggregates over."}),groupByFields:r.Array(r.Object({fields:r.Array(u(),{description:"Attribute names the monitor splits results by, evaluating each resulting group independently. Empty or omitted means the monitor evaluates a single ungrouped series."}),limit:r.Number({description:"Configured limit for this group by. Currently ignored; monitor evaluation applies a fixed limit of 100 groups per field."}),sortOrder:r.Optional(r.Enum(["asc","desc"],{description:"Sort direction applied to groups: ascending or descending."})),replaceNullWith:r.Optional(u({allowEmpty:!1,description:"Value used to group documents that have no value for a grouped field."}))}),{maxItems:1,description:"Monitor group by configuration. The `limit` setting is currently ignored; evaluation applies a fixed limit of 100 groups per field."}),aggregationAlertLogic:r.Optional(r.Enum(Xx,{description:"How grouped results are combined into alert state. Use `no_aggregation` only when `groupByFields` is empty; use `all`, `any`, `each`, or `proportion` with non-empty `groupByFields`. `proportion` also requires `proportionAlertThreshold`. On create, omitted query-monitor values default to `no_aggregation`; on update, omitted values keep the existing aggregation logic."})),proportionAlertThreshold:r.Optional(r.Integer({minimum:1,maximum:99,description:"Percentage threshold used when `aggregationAlertLogic` is `proportion`."}))},Ud={...pu,timeframe:r.Number({description:"Lookback window, in minutes, that each anomaly monitor evaluation aggregates over. Always a whole number from 5 through 1440."})},wd={...uu,timeframe:r.Integer({minimum:5,maximum:1440,description:"Lookback window, in minutes, that each anomaly monitor evaluation aggregates over."})},eR=r.Object({type:r.Literal("metric",{description:"Threshold monitor over metric aggregations."}),conditions:xd,noDataBehavior:r.Enum(li,{description:"How the monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, `keep_last_status` preserves the previous state, and `consider_zero` evaluates missing values as zero."}),...pu,queries:jr},{$id:"MonitorConfigurationMetric"}),tR=r.Object({type:r.Literal("metric",{description:"Threshold monitor over metric aggregations."}),conditions:Rd,noDataBehavior:r.Enum(li,{description:"How the monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, `keep_last_status` preserves the previous state, and `consider_zero` evaluates missing values as zero."}),...uu,queries:En},{$id:"InputMonitorConfigurationMetric"}),rR=r.Object({type:r.Literal("log",{description:"Threshold monitor over log aggregations."}),conditions:xd,noDataBehavior:r.Enum(li,{description:"How the monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, `keep_last_status` preserves the previous state, and `consider_zero` evaluates missing values as zero."}),...pu,queries:jr},{$id:"MonitorConfigurationLog"}),nR=r.Object({type:r.Literal("log",{description:"Threshold monitor over log aggregations."}),conditions:Rd,noDataBehavior:r.Enum(li,{description:"How the monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, `keep_last_status` preserves the previous state, and `consider_zero` evaluates missing values as zero."}),...uu,queries:En},{$id:"InputMonitorConfigurationLog"}),oR=r.Object({type:r.Literal("trace",{description:"Threshold monitor over trace aggregations."}),conditions:xd,noDataBehavior:r.Enum(li,{description:"How the monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, `keep_last_status` preserves the previous state, and `consider_zero` evaluates missing values as zero."}),...pu,queries:jr},{$id:"MonitorConfigurationTrace"}),_B=r.Object({type:r.Literal("trace",{description:"Threshold monitor over trace aggregations."}),conditions:Rd,noDataBehavior:r.Enum(li,{description:"How the monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, `keep_last_status` preserves the previous state, and `consider_zero` evaluates missing values as zero."}),...uu,queries:En},{$id:"InputMonitorConfigurationTrace"}),iR=r.Object({type:r.Literal("anomaly-log",{description:"Anomaly monitor over log aggregations."}),condition:Cd,noDataBehavior:r.Enum(mi,{description:"How the anomaly monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, and `keep_last_status` preserves the previous state."}),...Ud,queries:jr},{$id:"MonitorConfigurationAnomalyLog"}),aR=r.Object({type:r.Literal("anomaly-log",{description:"Anomaly monitor over log aggregations."}),condition:Pd,noDataBehavior:r.Enum(mi,{description:"How the anomaly monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, and `keep_last_status` preserves the previous state."}),...wd,queries:En},{$id:"InputMonitorConfigurationAnomalyLog"}),sR=r.Object({type:r.Literal("anomaly-metric",{description:"Anomaly monitor over metric aggregations."}),condition:Cd,noDataBehavior:r.Enum(mi,{description:"How the anomaly monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, and `keep_last_status` preserves the previous state."}),...Ud,queries:jr},{$id:"MonitorConfigurationAnomalyMetric"}),cR=r.Object({type:r.Literal("anomaly-metric",{description:"Anomaly monitor over metric aggregations."}),condition:Pd,noDataBehavior:r.Enum(mi,{description:"How the anomaly monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, and `keep_last_status` preserves the previous state."}),...wd,queries:En},{$id:"InputMonitorConfigurationAnomalyMetric"}),pR=r.Object({type:r.Literal("anomaly-trace",{description:"Anomaly monitor over trace aggregations. Use this configuration when Tsuga should learn historical trace query behavior and alert on unusual movement in trace-derived values."}),condition:Cd,noDataBehavior:r.Enum(mi,{description:"How the anomaly monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, and `keep_last_status` preserves the previous state."}),...Ud,queries:jr},{$id:"MonitorConfigurationAnomalyTrace"}),IB=r.Object({type:r.Literal("anomaly-trace",{description:"Anomaly monitor over trace aggregations. Set this value to create or update an anomaly monitor that learns historical trace query behavior and alerts on unusual movement in trace-derived values."}),condition:Pd,noDataBehavior:r.Enum(mi,{description:"How the anomaly monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, and `keep_last_status` preserves the previous state."}),...wd,queries:En},{$id:"InputMonitorConfigurationAnomalyTrace"}),uR=r.Object({type:r.Literal("certificate-expiry",{description:"Monitor that alerts before discovered certificates expire."}),warnBeforeInDays:r.Integer({description:"Number of days before certificate expiry when the monitor should warn."}),cloudAccounts:r.Optional(r.Array(r.String(),{description:"Cloud account IDs whose certificates are checked. Omitted means certificates from all cloud accounts are checked."})),aggregationAlertLogic:r.Literal("each",{description:"Certificate expiry monitors alert independently for each certificate."}),noDataBehavior:r.Literal("resolve",{description:"Certificate expiry monitors resolve when matching certificate data disappears."})},{$id:"MonitorConfigurationCertificateExpiry"}),bB=r.Object({type:r.Literal("certificate-expiry",{description:"Monitor that alerts before discovered certificates expire."}),warnBeforeInDays:r.Integer({minimum:1,maximum:365,description:"Number of days before certificate expiry when the monitor should warn. Valid values are 1 through 365."}),cloudAccounts:r.Optional(r.Array(r.String(),{minItems:1,description:"Cloud account IDs whose certificates are checked. Omit to check certificates from all cloud accounts."})),aggregationAlertLogic:r.Literal("each",{description:"Certificate expiry monitors alert independently for each certificate."}),noDataBehavior:r.Literal("resolve",{description:"Certificate expiry monitors resolve when matching certificate data disappears."})},{$id:"InputMonitorConfigurationCertificateExpiry"}),SB=r.Object({type:r.Literal("log-error-pattern",{description:"Monitor that alerts on newly detected log error patterns for the configured team, environment, and optional service. Recovery notifications are not sent for this monitor type."}),aggregationAlertLogic:r.Literal("each",{description:"Fixed aggregation logic for log error pattern monitors. Each new pattern is evaluated as its own alert group."}),noDataBehavior:r.Literal("keep_last_status",{description:"Fixed no-data behavior for log error pattern monitors. Pattern state is kept until inactive pattern groups expire."}),filter:r.Object({teamIds:r.Array(r.String(),{description:"Team IDs whose logs are searched for new error patterns. Tsuga resolves these team IDs to team names when exporting monitor assets."}),env:r.String({description:"Environment whose logs are searched for new error patterns."}),service:r.Optional(r.String({description:"Optional service name whose logs are searched for new error patterns. If omitted, the monitor searches all services matching the team and environment filter."}))},{description:"Log selection used for new error pattern detection. All configured fields must match for logs to be included."})},{$id:"MonitorConfigurationLogErrorPattern"}),AB=r.Object({type:r.Literal("log-error-pattern",{description:"Monitor that alerts on newly detected log error patterns for the configured team, environment, and optional service. Recovery notifications are not sent for this monitor type."}),aggregationAlertLogic:r.Literal("each",{description:"Fixed aggregation logic for log error pattern monitors. Each new pattern is evaluated as its own alert group."}),noDataBehavior:r.Literal("keep_last_status",{description:"Fixed no-data behavior for log error pattern monitors. Pattern state is kept until inactive pattern groups expire."}),filter:r.Object({teamIds:r.Array(u(),{description:"Team IDs whose logs are searched for new error patterns. Tsuga resolves these team IDs to team names when exporting monitor assets."}),env:u({description:"Environment whose logs are searched for new error patterns."}),service:r.Optional(u({description:"Optional service name whose logs are searched for new error patterns. If omitted, the monitor searches all services matching the team and environment filter."}))},{description:"Log selection used for new error pattern detection. All configured fields must match for logs to be included."})},{$id:"InputMonitorConfigurationLogErrorPattern"}),OB=C("type",[eR,rR,oR,iR,sR,SB,pR,uR],{description:"Monitor evaluation configuration. The `type` discriminator determines which telemetry source, condition shape, and evaluation rules Tsuga uses."}),xB=C("type",[tR,nR,_B,aR,cR,IB,AB,bB],{description:"Monitor evaluation configuration. The `type` discriminator determines which telemetry source, condition shape, and evaluation rules Tsuga uses."});var Fr=r.Object({id:r.String({description:"Tsuga-generated monitor ID assigned when the monitor is created."}),name:r.String({description:"Display name of the monitor and alert source."}),owner:r.String({description:"Team ID that owns and manages the monitor."}),message:r.Optional(r.String({description:"Caller-supplied message included in notifications triggered by this monitor. Omitted when the monitor was created or last updated without one."})),tags:De,configuration:OB,priority:r.Enum(St,{description:"Monitor priority from 1 through 5, where 1 is highest priority."}),permissions:Tn,dashboardId:r.Optional(r.String({description:"ID of the dashboard linked to this monitor for context when investigating alerts. Caller-supplied. Omitted when no dashboard is linked."})),pauseUntil:r.Optional(A({description:"Timestamp until which the monitor is snoozed."})),creator:r.Optional(pe),updater:r.Optional(pe),createdAt:A({description:"Timestamp when Tsuga created the monitor."}),updatedAt:A({description:"Timestamp when Tsuga last updated the monitor."}),assetUpdatedAt:A({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."}),clusterIds:r.Array(r.String(),{description:"Cluster IDs where the monitor is deployed. Empty means all eligible clusters."})},{title:"Monitor"}),RB=C("type",[eR,rR,oR,iR,sR,pR,uR]),cLe=r.Object({...Fr.properties,configuration:RB},{title:"Monitor"}),pLe=r.Object({...Fr.properties,configuration:C("type",[tR,nR,aR,cR])},{title:"Monitor"}),os=r.Object({name:u({description:"Display name of the monitor and alert source."}),message:r.Optional(u({type:"long",description:"Message included in notifications triggered by this monitor. Optional on create. On update, omitting it keeps the existing message."})),tags:Xe,configuration:xB,priority:r.Enum(St,{description:"Monitor priority from 1 through 5, where 1 is highest priority."}),owner:u({allowEmpty:!1,description:"Team ID that owns and manages the monitor."}),dashboardId:r.Optional(r.Union([r.Null(),u({allowEmpty:!1})],{description:"ID of the dashboard to link to this monitor for context when investigating alerts. On create: omit or send `null` to leave the monitor unlinked. On update: omit to skip updating this field, send `null` to clear an existing link."})),pauseUntil:r.Optional(u({allowEmpty:!1,type:"date-time",description:"ISO timestamp until which the monitor should be snoozed."})),permissions:Tn,clusterIds:r.Optional(r.Array(u({allowEmpty:!1}),{description:"Cluster IDs where the monitor should be deployed. Empty or omitted means all eligible clusters for cluster-deployed monitor types."}))}),Zx=["threshold","certificate-expiry","anomaly-detection","log-error-pattern"],bn={PRIORITY:"priority",TYPE:"type",NAME:"name",OWNER:"owner",TAGS:"tags",CLUSTER_IDS:"clusterIds",PAUSE_UNTIL:"pauseUntil",ASSET_UPDATED_AT:"assetUpdatedAt"};var vd=r.Object({owners:_e(u({allowEmpty:!1}),{description:"Restrict results to monitors owned by any of these team IDs",maxItems:50}),searchQuery:r.Object({value:u({allowEmpty:!1,description:"Case-insensitive substring matched against monitor ID, monitor name, query filters, and aggregate fields. Wildcard characters are treated literally."}),exclude:r.Optional(r.Boolean({description:"If true, exclude monitors matching this value instead of including them"}))},{description:"Search query filter for monitors."}),tags:_e(Bt.items,{description:"Restrict results to monitors that have at least one of the listed key/value tags",maxItems:50}),priorities:_e(r.Enum(St),{description:"Restrict results to monitors with one of these priorities",maxItems:St.length}),types:_e(r.Enum(Zx),{description:"Restrict results to monitors with these types",maxItems:Zx.length}),activity:r.Enum(["active","snoozed"],{description:"Restrict results by activity status: active monitors or currently snoozed monitors"}),clusterIds:_e(u({allowEmpty:!1}),{description:"Restrict results to monitors deployed to any of these cluster IDs (monitors with no cluster restriction are always included)",maxItems:50})},{description:"Optional filters applied to narrow the returned monitors"}),Nd=r.Partial(r.Object({...ge,filters:r.Partial(vd),sort:r.Object({by:r.Enum([bn.PRIORITY,bn.TYPE,bn.NAME,bn.OWNER,bn.TAGS,bn.CLUSTER_IDS,bn.PAUSE_UNTIL,bn.ASSET_UPDATED_AT],{description:"Field to sort the returned monitors by. For `priority`, `desc` returns highest-priority monitors first because priority 1 is highest."}),direction:r.Enum(["asc","desc"],{description:"Sort direction. For `priority`, `desc` returns priority 1 first and `asc` returns priority 5 first."})},{description:"Optional sorting applied to the returned monitors. Ties are broken by creation time and monitor ID for stable pagination."})})),uLe=d({tags:["monitors"],url:`${At}/query`,method:"POST",paginated:!0,response:r.Array(Fr),body:Nd}),lLe=d({tags:["monitors"],url:`${At}/tags/query`,method:"POST",body:r.Object({filters:r.Optional(r.Partial(r.Omit(vd,["tags"])))}),response:Ft}),mLe=d({tags:["monitors"],url:`${At}/counts/query`,method:"POST",body:r.Object({filters:r.Optional(r.Partial(r.Omit(vd,["activity"])))}),response:r.Object({all:r.Integer({description:"Total number of monitors matching the filters that the user can read."}),active:r.Integer({description:"Number of matching readable monitors that are not currently snoozed."}),snoozed:r.Integer({description:"Number of matching readable monitors that are currently snoozed."})})}),dLe=d({tags:["monitors"],url:`${At}/:id`,method:"GET",params:r.Object({id:u()}),response:Fr}),fLe=d({tags:["monitors"],url:At,method:"POST",body:os,response:Fr}),gLe=d({tags:["monitors"],url:`${At}/:id`,method:"PUT",params:r.Object({id:u()}),body:os,response:Fr}),hLe=d({tags:["monitors"],url:`${At}/bulk-update`,method:"PUT",body:r.Object({monitorIds:r.Array(u({allowEmpty:!1}),{minItems:1}),owner:u({allowEmpty:!1})}),response:r.Object({})}),yLe=d({tags:["monitors"],url:`${At}/:id`,method:"DELETE",params:r.Object({id:u()}),response:N}),TLe=d({tags:["monitors"],url:`${At}/bulk-delete`,method:"DELETE",body:r.Object({ids:r.Array(u())}),response:r.Object({})}),ELe=d({tags:["monitors"],url:`${At}/:id/snooze`,method:"POST",params:r.Object({id:u()}),body:r.Object({pauseUntil:u({allowEmpty:!1,type:"date-time"})}),response:Fr}),_Le=d({tags:["monitors"],url:`${At}/bulk-snooze`,method:"POST",body:r.Object({monitorIds:r.Array(u()),pauseUntil:u({allowEmpty:!1,type:"date-time"})}),response:r.Object({})}),CB=["alert","alert_consider_zero","alert_no_data","keep_last_status_alert"],PB=["ok","ok_consider_zero","ok_no_data","keep_last_status_ok"],UB=[...CB,...PB],po=r.Enum(UB),wB=C("type",[r.Object({type:r.Literal("each"),subStates:r.Record(r.String(),r.Object({stateValue:r.Union([po,r.Null()]),lastChangedAt:A()}))}),r.Object({type:r.Literal("no_aggregation"),stateValue:r.Optional(po)}),r.Object({type:r.Literal("any"),stateValue:r.Optional(po)}),r.Object({type:r.Literal("all"),stateValue:r.Optional(po)}),r.Object({type:r.Literal("proportion"),stateValue:r.Optional(po)})]),vB=r.Object({monitorId:r.String(),currentState:wB,lastChangedAt:r.Optional(A())}),ILe=d({tags:["monitors"],url:`${At}/states/:id`,method:"GET",params:r.Object({id:u()}),response:vB}),bLe=d({tags:["monitors"],url:`${At}/:id/transitions`,method:"GET",params:r.Object({id:u()}),query:r.Object({from:r.Number(),to:r.Number()}),response:r.Array(r.Object({id:r.String(),createdAt:A(),fromState:r.Optional(po),toState:r.Optional(po),dimension:r.Optional(r.String())}))}),NB=["unprocessed","processed","failed-to-process"],SLe=d({tags:["monitors"],url:`${At}/:id/results`,method:"GET",params:r.Object({id:u()}),query:r.Object({from:r.Number(),to:r.Number()}),response:r.Object({isTruncated:r.Boolean(),results:r.Array(r.Object({id:r.String(),evaluationAt:A(),formulaResult:r.Object({groups:r.Array(r.Object({groupKey:r.Record(r.String(),ts),results:r.Array(r.Union([r.Number(),r.Null()])),conditionMet:r.Enum(["true","false","nan-no-data"])}))}),createdAt:A(),status:r.Enum(NB)}))})});var Br="/v0/slos",LB=[7,30,90],kB=["good","bad"],fR=r.Enum(kB,{description:"How to treat SLO with no data: good (count as meeting the SLO), bad (count as breaching it)"}),MB=["good","bad","ignore"],gR=r.Enum(MB,{description:"How to treat time buckets with no data: good (count as meeting the SLO), bad (count as breaching it), or ignore (exclude from the error budget)"}),lR=30,mR=1440,hR=["greater_than","less_than","greater_than_or_equal","less_than_or_equal"],DB=["healthy","breached","no_data"],lu=r.Enum(DB,{description:"SLO status: healthy (meeting the target), breached (breaching it), or no_data (not evaluated yet)"}),dR={sli:r.Optional(r.Number({description:"Service level indicator for the latest evaluation; absent when there is no data"})),errorBudget:r.Optional(r.Number({description:"Remaining error budget at the latest evaluation; negative when exhausted, absent when there is no data"})),status:lu},GB=r.Object({overall:r.Object(dR,{description:"Latest overall evaluation for the cluster"}),perGroup:r.Array(r.Object({groupKey:r.Record(r.String(),ts,{description:"Group-by field values identifying this group, keyed by field name. Present only when the SLO configuration sets `groupByFields`."}),...dR}),{description:"Latest evaluation for each group produced by the SLO configuration's `groupByFields`. Empty when the SLO is not grouped."})},{title:"SloClusterResults"}),yR=r.Record(r.String(),GB,{description:"Latest evaluation results keyed by cluster ID."}),Ld=r.Object({queries:jr,formula:iu},{title:"SloQueryFormula",description:"Aggregation queries combined by a formula to produce the SLO signal. Tsuga evaluates this query formula during SLO evaluation and returns it as part of the saved SLO configuration. Returned queries include Tsuga-derived missing-point fill: event SLO queries use zero fill, and time SLO queries keep missing points null."}),kd=r.Object({queries:bx,formula:co},{title:"SloQueryFormula",description:"Aggregation queries combined by a formula to produce the SLO signal. Formulas reference queries as q1, q2, and so on. Do not send per-query fill; Tsuga derives the fill behavior from the SLO type."}),$B=r.Object({type:r.Literal("burn-rate",{description:"Alert configuration kind. Set to `burn-rate` for alerts that fire when the SLO consumes error budget faster than the configured multiplier."}),burnRate:r.Number({description:"Burn-rate multiplier that triggers this alert. The short and long evaluation windows are derived from the predefined template with the closest burn rate."})},{title:"BurnRateAlert"}),jB=r.Object({type:r.Literal("burn-rate",{description:"Alert configuration kind. Set to `burn-rate` for alerts that fire when the SLO consumes error budget faster than the configured multiplier."}),burnRate:r.Number({minimum:1,maximum:100,description:"Burn-rate multiplier that triggers this alert. Required for burn-rate alerts; valid input is 1 through 100. Non-template values are accepted; short and long evaluation windows are derived from the predefined template with the closest burn rate."})},{title:"BurnRateAlert"});var qB=r.Object({type:r.Literal("threshold",{description:"Alert configuration kind. Set to `threshold` for alerts that fire when the SLO indicator falls below a percentage threshold."}),threshold:r.Number({description:"SLI percentage threshold for this alert. The alert passes when SLI is at or above this value and fires when SLI is strictly below it."})},{title:"ThresholdAlert"}),FB=r.Object({type:r.Literal("threshold",{description:"Alert configuration kind. Set to `threshold` for alerts that fire when the SLO indicator falls below a percentage threshold."}),threshold:r.Number({exclusiveMinimum:0,exclusiveMaximum:100,description:"SLI percentage threshold for this alert. Required for threshold alerts; valid input is greater than 0 and less than 100. The alert passes when SLI is at or above this value and fires when SLI is strictly below it."})},{title:"ThresholdAlert"}),BB=C("type",[$B,qB],{description:"Alert trigger configuration: burn-rate or threshold"}),TR=C("type",[jB,FB],{description:"Alert trigger configuration: burn-rate or threshold"}),Md=r.Enum(St,{description:"Alert priority (1 is highest, 5 is lowest)"}),Dd=r.Object({id:r.String({description:"Tsuga-generated SLO alert ID assigned when the alert is created."}),sloId:r.String({description:"Parent SLO ID for this alert."}),priority:Md,configuration:BB,createdAt:A({description:"Timestamp when Tsuga created the alert."}),updatedAt:A({description:"Timestamp when Tsuga last updated the alert."}),assetUpdatedAt:A({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})},{title:"SloAlert"}),HB=r.Object({priority:Md,configuration:TR}),KB=r.Object({id:r.Optional(u({allowEmpty:!1,description:"Identifier of an existing alert to update. Omit to create a new alert on this SLO."})),priority:Md,configuration:TR}),zB=C("type",[r.Object({type:r.Literal("event",{description:"Configuration kind. Set to `event` for SLOs that compute SLI from good and total query formulas over the rolling timeframe."}),dataSource:or,goodQuery:Ld,totalQuery:Ld,groupByFields:r.Optional(pi),noDataBehavior:fR},{title:"EventSloConfiguration"}),r.Object({type:r.Literal("time",{description:"Configuration kind. Set to `time` for SLOs that evaluate a query against a threshold in fixed-size time slices."}),dataSource:or,query:Ld,sliceSizeMinutes:r.Integer({description:"Length of each time-SLO evaluation slice in minutes. Required for `type: time`."}),threshold:r.Object({operator:r.Enum(hR,{description:"Comparison operator between the query value and the threshold"}),value:r.Number({description:"Threshold value compared against the query signal"})},{description:"Threshold comparison applied to each time-SLO evaluation slice"}),groupByFields:r.Optional(pi),noDataBehavior:gR},{title:"TimeSliceSloConfiguration"})],{description:"SLI configuration for this SLO. Use `event` for good/total event-ratio SLOs or `time` for thresholded time-slice SLOs."}),YB=C("type",[r.Object({type:r.Literal("event",{description:"Configuration kind. Set to `event` for SLOs that compute SLI from good and total query formulas over the rolling timeframe."}),dataSource:or,goodQuery:kd,totalQuery:kd,groupByFields:r.Optional(qr),noDataBehavior:fR},{title:"EventSloConfiguration"}),r.Object({type:r.Literal("time",{description:"Configuration kind. Set to `time` for SLOs that evaluate a query against a threshold in fixed-size time slices."}),dataSource:or,query:kd,sliceSizeMinutes:r.Integer({minimum:lR,maximum:mR,description:`Length of each time-SLO evaluation slice in minutes. Required for \`type: time\`. Valid input is ${lR} through ${mR}.`}),threshold:r.Object({operator:r.Enum(hR,{description:"Comparison operator between the query value and the threshold"}),value:r.Number({description:"Threshold value compared against the query signal"})},{description:"Threshold comparison applied to each time-SLO evaluation slice"}),groupByFields:r.Optional(qr),noDataBehavior:gR},{title:"TimeSliceSloConfiguration"})],{description:"SLI configuration for this SLO. Use `event` for good/total event-ratio SLOs or `time` for thresholded time-slice SLOs."}),VB=r.Number({exclusiveMinimum:0,exclusiveMaximum:100,description:"Target percentage (0 < target < 100, e.g. 99.9)"}),ER=r.Enum(LB,{type:"integer",description:"Rolling SLO evaluation window in days. Set by the caller on create or update and returned on read and list responses. Allowed values are 7, 30, and 90."}),QB=r.Array(r.String(),{description:"Cluster IDs this SLO is evaluated on. Omit or send an empty array on input to run on all clusters; responses use an empty array to mean all clusters. Non-empty input values must reference existing clusters."}),WB=r.Array(u({allowEmpty:!1}),{description:"Cluster IDs this SLO is evaluated on. Omit or send an empty array on input to run on all clusters; responses use an empty array to mean all clusters. Non-empty input values must reference existing clusters."}),di=r.Object({id:r.String({description:"Tsuga-generated SLO ID assigned when the SLO is created."}),name:r.String({description:"Display name of the SLO, set by the caller."}),description:r.Optional(r.String({description:"Free-form, caller-provided description of what the SLO measures. Absent when not set."})),tags:De,configuration:zB,target:r.Number({description:"Target percentage (0 < target < 100, e.g. 99.9)"}),timeframeDays:ER,owner:r.String({description:"Team ID that owns the SLO"}),permissions:Tn,clusterIds:QB,creator:r.Optional(pe),updater:r.Optional(pe),alerts:r.Array(Dd,{description:"Alerts attached to this SLO"}),createdAt:A({description:"Timestamp when Tsuga created the SLO."}),updatedAt:A({description:"Timestamp when Tsuga last updated the SLO."}),assetUpdatedAt:A({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})},{title:"Slo"}),ZB=r.Object({...di.properties,results:yR},{title:"SloWithResults"}),mu=r.Object({name:u({allowEmpty:!1,description:"Display name of the SLO."}),description:r.Optional(u({type:"long",description:"Free-form, caller-provided description of what the SLO measures. Optional."})),tags:Xe,configuration:YB,target:VB,timeframeDays:ER,owner:u({allowEmpty:!1,description:"Team ID that owns the SLO"}),permissions:Tn,clusterIds:r.Optional(WB),alerts:r.Array(HB,{description:"Alerts to create on this SLO. Send an empty array for none."})}),Gd=r.Object({...r.Omit(mu,["alerts"]).properties,alerts:r.Array(KB,{description:"Alerts attached to this SLO. The SLO owns its alerts: the set is reconciled to exactly this list \u2014 existing alerts are matched by id, alerts without an id are created, and existing alerts absent from the list are deleted. Send an empty array to clear all alerts."})}),_R=r.Object({owners:_e(u({allowEmpty:!1}),{description:"Restrict results to SLOs owned by any of these team IDs",maxItems:50}),searchQuery:r.Object({value:u({allowEmpty:!1,description:"Substring matched case-insensitively against the SLO name or SLO ID."}),exclude:r.Optional(r.Boolean({description:"If true, exclude SLOs matching this value instead of including them"}))},{description:"Text filter for SLO names or IDs. Optional; `exclude: true` removes matching SLOs."}),tags:_e(Bt.items,{description:"Restrict results to SLOs that have at least one of the listed key/value tags",maxItems:50}),clusterIds:_e(u({allowEmpty:!1}),{description:"Restrict results to SLOs that run against any of these cluster IDs (SLOs with no cluster restriction are always included)",maxItems:50}),statuses:_e(lu,{description:"Restrict results to SLOs whose status is one of these values",maxItems:3})},{description:"Optional filters applied to narrow the returned SLOs"}),$d=r.Partial(_R),jd=r.Partial(r.Object({...ge,filters:$d,sort:r.Object({by:r.Enum(["name","owner","tags","updatedAt","sli","errorBudget","status"],{description:"Field to sort by"}),direction:r.Enum(["asc","desc"],{description:"Sort direction: ascending or descending"})},{description:"Optional sorting applied to the returned SLOs"})})),kLe=d({tags:["slos"],url:`${Br}/query`,method:"POST",paginated:!0,response:r.Array(ZB),body:jd}),MLe=d({tags:["slos"],url:`${Br}/tags/query`,method:"POST",body:r.Object({filters:r.Optional(r.Partial(r.Omit(_R,["tags","statuses"])))}),response:Ft}),DLe=d({tags:["slos"],url:`${Br}/:id`,method:"GET",params:r.Object({id:u()}),response:di}),GLe=d({tags:["slos"],url:`${Br}/:id/results`,method:"GET",params:r.Object({id:u()}),response:yR}),$Le=d({tags:["slos"],url:Br,method:"POST",body:mu,response:di}),jLe=d({tags:["slos"],url:`${Br}/:id`,method:"PUT",params:r.Object({id:u()}),body:Gd,response:di}),qLe=d({tags:["slos"],url:`${Br}/:id`,method:"DELETE",params:r.Object({id:u()}),response:N}),XB=jm($d),FLe=d({tags:["slos"],url:`${Br}/bulk-delete`,method:"DELETE",body:r.Object({selection:XB}),response:r.Object({})}),JB=jm($d,{maxIds:100}),BLe=d({tags:["slos"],url:`${Br}/bulk-update`,method:"PUT",body:r.Object({selection:JB,owner:u({allowEmpty:!1})}),response:r.Object({})});var fi="/v0/notifications",Sn=`${fi}/rules`,IR=`${fi}/slack/setup`,is=`${fi}/integrations`,uo=["triggered","resolved","no-data"],eH=["sent","stale","pending","rate-limited","failed","silenced"],tH=r.Optional(r.Object({maxMessages:r.Integer({description:"Maximum number of notifications this target can send during the rate-limiting window."}),minutes:r.Integer({description:"Length of the rate-limiting window, in minutes."})},{description:"Per-target rate limit used when sending notifications. If omitted, Tsuga allows up to 1000 notifications every 10 minutes for this target."})),qd=r.Object({maxMessages:r.Integer({minimum:1,description:"Maximum number of notifications this target can send during the rate-limiting window. The ratio of `maxMessages` to `minutes` cannot exceed 100 notifications per minute."}),minutes:r.Integer({minimum:1,description:"Length of the rate-limiting window, in minutes. The ratio of `maxMessages` to `minutes` cannot exceed 100 notifications per minute."})},{description:"Per-target rate limit used when sending notifications. If omitted, Tsuga allows up to 1000 notifications every 10 minutes for this target."}),rH=r.Optional(qd),br=r.Optional(r.Object({mode:r.Literal("each",{description:"Renotification mode. `each` sends repeat notifications for each matching monitor alert that remains in a configured state."}),renotificationStates:r.Array(r.Enum(["alert","alert_no_data"]),{description:"Monitor alert states that trigger repeat notifications while the target remains configured for renotification."}),renotifyIntervalMinutes:r.Integer({description:"Minimum number of minutes to wait after the previous notification."})},{description:"Configuration for repeat monitor notifications on this target. If omitted, Tsuga sends only the original notification for each alert transition."})),Sr=r.Optional(r.Object({mode:r.Literal("each",{description:"Renotification mode. `each` sends repeat notifications for each matching monitor alert that remains in a configured state."}),renotificationStates:r.Array(r.Enum(["alert","alert_no_data"]),{description:"Monitor alert states that trigger repeat notifications while the target remains configured for renotification."}),renotifyIntervalMinutes:r.Integer({minimum:1,description:"Minimum number of minutes to wait after the previous notification."})},{description:"Configuration for repeat monitor notifications on this target. If omitted, Tsuga sends only the original notification for each alert transition."})),as=r.Object({id:r.String({description:"Identifier of the notification target within this rule, used with the rule ID for per-target delivery state such as rate limiting."}),rateLimit:tH,config:C("type",[r.Object({type:r.Literal("slack",{description:"Slack target backed by a configured Slack integration."}),channel:r.String({description:"Slack channel ID that receives the notification"}),integrationId:r.String({description:"Slack workspace ID that receives the notification"}),integrationName:r.String({description:"Human readable name of the Slack integration"}),renotifyConfig:br},{$id:"RuleTargetConfigSlack"}),r.Object({type:r.Literal("incident-io",{description:"incident.io target backed by a configured incident.io integration."}),integrationId:r.String({description:"Identifier of the incident.io integration to use"}),integrationName:r.String({description:"Human readable name of the incident.io integration"}),renotifyConfig:br},{$id:"RuleTargetConfigIncidentIo"}),r.Object({type:r.Literal("email",{description:"Email target that sends directly to the listed addresses and does not require an integration."}),addresses:r.Array(r.String(),{description:"Email addresses that will receive the alert"}),renotifyConfig:br},{$id:"RuleTargetConfigEmail"}),r.Object({type:r.Literal("grafana-irm",{description:"Grafana IRM target backed by a configured Grafana IRM integration."}),integrationId:r.String({description:"Identifier of the Grafana IRM integration to use"}),integrationName:r.String({description:"Human readable name of the Grafana IRM integration"}),renotifyConfig:br},{$id:"RuleTargetConfigGrafanaIrm"}),r.Object({type:r.Literal("pagerduty",{description:"PagerDuty target backed by a configured PagerDuty integration."}),integrationId:r.String({description:"Identifier of the PagerDuty integration to use"}),integrationName:r.String({description:"Human readable name of the PagerDuty integration"}),renotifyConfig:br},{$id:"RuleTargetConfigPagerDuty"}),r.Object({type:r.Literal("microsoft-teams",{description:"Microsoft Teams target backed by a configured Microsoft Teams integration."}),integrationId:r.String({description:"Identifier of the Microsoft Teams integration to use"}),integrationName:r.String({description:"Human readable name of the Microsoft Teams integration"}),renotifyConfig:br},{$id:"RuleTargetConfigMicrosoftTeams"}),r.Object({type:r.Literal("webhook",{description:"Webhook target backed by a configured webhook integration."}),integrationId:r.String({description:"Identifier of the webhook integration to use"}),integrationName:r.String({description:"Human readable name of the webhook integration"}),renotifyConfig:br},{$id:"RuleTargetConfigWebhook"}),r.Object({type:r.Literal("servicenow",{description:"ServiceNow target backed by a configured ServiceNow integration."}),integrationId:r.String({description:"Identifier of the ServiceNow integration to use"}),integrationName:r.String({description:"Human readable name of the ServiceNow integration"}),renotifyConfig:br},{$id:"RuleTargetConfigServiceNow"}),r.Object({type:r.Literal("google-chat",{description:"Google Chat target backed by a configured Google Chat integration."}),integrationId:r.String({description:"Identifier of the Google Chat integration to use"}),integrationName:r.String({description:"Human readable name of the Google Chat integration"}),renotifyConfig:br},{$id:"RuleTargetConfigGoogleChat"}),r.Object({type:r.Literal("squadcast",{description:"Squadcast target backed by a configured Squadcast integration."}),integrationId:r.String({description:"Identifier of the Squadcast integration to use"}),integrationName:r.String({description:"Human readable name of the Squadcast integration"}),renotifyConfig:br},{$id:"RuleTargetConfigSquadcast"}),r.Object({type:r.Literal("jira",{description:"Jira target backed by a configured Jira integration. Jira targets file one issue per notification and do not support renotification."}),integrationId:r.String({description:"Identifier of the Jira integration to use"}),integrationName:r.String({description:"Human readable name of the Jira integration"}),projectKey:r.String({description:'Key of the Jira project that alert issues are filed into, like "OPS".'}),issueType:r.String({description:'Name of the Jira issue type created for alerts, like "Bug" or "Task".'}),openStatus:r.Optional(r.String({description:"Jira status the alert ticket is moved to right after it is filed for a firing alert. A later transition between two firing states leaves the ticket status alone."})),closedStatus:r.Optional(r.String({description:"Jira status the alert ticket is moved to when the alert resolves. Only takes effect when the rule delivers recovery transitions."}))},{$id:"RuleTargetConfigJira"})],{description:"Destination that received the notification. The `type` field discriminates the variant: `email` sends directly to the listed addresses, and every other type routes through the named integration referenced by `integrationId`."})}),gi=r.Object({id:u({description:"Identifier of the notification target within this rule. Choose a stable ID that is unique among this rule's targets; Tsuga uses it with the rule ID for per-target delivery state such as rate limiting."}),rateLimit:rH,config:C("type",[r.Object({type:r.Literal("slack",{description:"Slack target backed by a configured Slack integration."}),channel:u({allowEmpty:!1,description:"Slack channel ID that receives the notification"}),integrationId:u({allowEmpty:!1,description:"Slack workspace ID that receives the notification"}),renotifyConfig:Sr},{$id:"RuleTargetInputSlack"}),r.Object({type:r.Literal("incident-io",{description:"incident.io target backed by a configured incident.io integration."}),integrationId:u({allowEmpty:!1,description:"Identifier of the incident.io integration to use"}),renotifyConfig:Sr},{$id:"RuleTargetInputIncidentIo"}),r.Object({type:r.Literal("pagerduty",{description:"PagerDuty target backed by a configured PagerDuty integration."}),integrationId:u({allowEmpty:!1,description:"Identifier of the PagerDuty integration to use"}),renotifyConfig:Sr},{$id:"RuleTargetInputPagerDuty"}),r.Object({type:r.Literal("email",{description:"Email target that sends directly to the listed addresses and does not require an integration."}),addresses:r.Array(u({type:"email"}),{minItems:1,maxItems:20,description:"Email addresses that will receive the alert"}),renotifyConfig:Sr},{$id:"RuleTargetInputEmail"}),r.Object({type:r.Literal("grafana-irm",{description:"Grafana IRM target backed by a configured Grafana IRM integration."}),integrationId:u({allowEmpty:!1,description:"Identifier of the Grafana IRM integration to use"}),renotifyConfig:Sr},{$id:"RuleTargetInputGrafanaIrm"}),r.Object({type:r.Literal("microsoft-teams",{description:"Microsoft Teams target backed by a configured Microsoft Teams integration."}),integrationId:u({allowEmpty:!1,description:"Identifier of the Microsoft Teams integration to use"}),renotifyConfig:Sr},{$id:"RuleTargetInputMicrosoftTeams"}),r.Object({type:r.Literal("webhook",{description:"Webhook target backed by a configured webhook integration."}),integrationId:u({allowEmpty:!1,description:"Identifier of the webhook integration to use"}),renotifyConfig:Sr},{$id:"RuleTargetInputWebhook"}),r.Object({type:r.Literal("servicenow",{description:"ServiceNow target backed by a configured ServiceNow integration."}),integrationId:u({allowEmpty:!1,description:"Identifier of the ServiceNow integration to use"}),renotifyConfig:Sr},{$id:"RuleTargetInputServiceNow"}),r.Object({type:r.Literal("google-chat",{description:"Google Chat target backed by a configured Google Chat integration."}),integrationId:u({allowEmpty:!1,description:"Identifier of the Google Chat integration to use"}),renotifyConfig:Sr},{$id:"RuleTargetInputGoogleChat"}),r.Object({type:r.Literal("squadcast",{description:"Squadcast target backed by a configured Squadcast integration."}),integrationId:u({allowEmpty:!1,description:"Identifier of the Squadcast integration to use"}),renotifyConfig:Sr},{$id:"RuleTargetInputSquadcast"}),r.Object({type:r.Literal("jira",{description:"Jira target backed by a configured Jira integration. Jira targets file one issue per notification and do not support renotification."}),integrationId:u({allowEmpty:!1,description:"Identifier of the Jira integration to use"}),projectKey:u({allowEmpty:!1,description:'Key of the Jira project that alert issues are filed into, like "OPS".'}),issueType:u({allowEmpty:!1,description:'Name of the Jira issue type created for alerts, like "Bug" or "Task".'}),openStatus:r.Optional(u({allowEmpty:!1,description:"Jira status the alert ticket is moved to right after it is filed for a firing alert. A later transition between two firing states leaves the ticket status alone."})),closedStatus:r.Optional(u({allowEmpty:!1,description:"Jira status the alert ticket is moved to when the alert resolves. Only takes effect when the rule delivers recovery transitions."}))},{$id:"RuleTargetInputJira"})],{description:"Destination that should receive the notification. The `type` field discriminates the variant: `email` sends directly to the listed addresses and needs no integration; every other type routes through the integration identified by `integrationId`, which must already exist (create it first with the notification integration endpoints)."})}),Fd=C("type",[r.Object({type:r.Literal("specific-teams",{description:"Match alert transitions associated with the listed teams. The caller must be allowed to access every listed team."}),teams:r.Array(r.String(),{description:"Team IDs selected by this filter."})},{title:"SpecificTeams"}),r.Object({type:r.Literal("all-teams",{description:"Match alert transitions for every team in the organization. Public API callers need an API key with `all` scope to create or update this filter."})},{title:"AllTeams"}),r.Object({type:r.Literal("all-public-teams",{description:"Match alert transitions for all public teams. Public API callers need an API key with `all` or `owning-team-and-public` scope to create or update this filter."})},{title:"AllPublicTeams"})],{description:"Team visibility filter used when matching alert transitions. Tsuga validates create and update requests against the caller permissions."}),Bd=C("type",[r.Object({type:r.Literal("specific-teams",{description:"Match alert transitions associated with the listed teams. The caller must be allowed to access every listed team."}),teams:r.Array(u(),{minItems:1,maxItems:100,description:"Team IDs selected by this filter."})},{title:"SpecificTeams"}),r.Object({type:r.Literal("all-teams",{description:"Match alert transitions for every team in the organization. Public API callers need an API key with `all` scope to create or update this filter."})},{title:"AllTeams"}),r.Object({type:r.Literal("all-public-teams",{description:"Match alert transitions for all public teams. Public API callers need an API key with `all` or `owning-team-and-public` scope to create or update this filter."})},{title:"AllPublicTeams"})],{description:"Team visibility filter used when matching alert transitions. Tsuga validates create and update requests against the caller permissions."}),hi=r.Object({id:r.String({description:"Tsuga-generated notification rule ID assigned when the rule is created."}),name:r.String({description:"Display name of the notification rule."}),queryString:r.Optional(r.String({description:"Optional query that narrows which alert transitions trigger the rule. Matches on the monitor transition group key and the monitor tags, e.g. `env:prod service:api`. Omit or leave empty to match regardless of tags."})),teamsFilter:Fd,prioritiesFilter:r.Array(r.Enum(St),{description:"Monitor priorities that must match for this rule to fire. An empty array matches every priority."}),transitionTypesFilter:r.Array(r.Enum(uo),{description:"Alert state transitions that must match for this rule to fire. An empty array matches every transition type."}),clusterIdsFilter:r.Array(r.String(),{description:"Cluster IDs that must match for this rule to fire. An empty array matches every cluster, as does a transition that has no cluster ID."}),owner:r.String({description:"Team ID that owns and manages the rule."}),createdAt:A({description:"Timestamp when Tsuga created the rule."}),updatedAt:A({description:"Timestamp when Tsuga last updated the rule."}),isActive:r.Boolean({description:"Whether the rule currently sends notifications when its filters match."}),tags:De,targets:r.Array(as,{description:"Destinations that receive a notification whenever this rule matches an alert transition. Every target in the list is notified independently, subject to its own rate limit and renotification settings."}),creator:r.Optional(pe),updater:r.Optional(pe)}),ss=r.Object({name:u({description:"Display name of the notification rule."}),queryString:r.Optional(u({type:"tags-query",description:"Optional query that narrows which alert transitions trigger the rule. Matches on the monitor transition group key and the monitor tags, e.g. `env:prod service:api`. Omit or leave empty to match regardless of tags."})),teamsFilter:Bd,prioritiesFilter:r.Array(r.Enum(St),{maxItems:St.length,description:"Monitor priorities that must match for this rule to fire. An empty array matches every priority."}),transitionTypesFilter:r.Array(r.Enum(uo),{maxItems:uo.length,description:"Alert state transitions that must match for this rule to fire. An empty array matches every transition type."}),clusterIdsFilter:r.Optional(r.Array(u({allowEmpty:!1}),{description:"Cluster IDs that must match for this rule to fire. Omit it, or leave it empty, to match every cluster."})),owner:u({allowEmpty:!1,description:"Team ID that owns and manages the rule"}),tags:Xe,isActive:r.Boolean({description:"Set to true for the rule to send notifications when its filters match."}),targets:r.Array(gi,{minItems:1,description:"Destinations that receive a notification whenever this rule matches an alert transition. This list replaces the existing targets on update."})}),du=r.Object({id:r.String({description:"Unique identifier of the adaptive notification rule. Generated by Tsuga."}),name:r.String({description:"Display name of the adaptive notification rule."}),owner:r.String({description:"Team ID that owns and manages the rule."}),createdAt:A({description:"Timestamp when Tsuga created the rule."}),updatedAt:A({description:"Timestamp when Tsuga last updated the rule."}),isActive:r.Boolean({description:"Whether the rule currently sends notifications when one of its monitors fires."}),shouldCreateInvestigation:r.Boolean({description:"Whether each page records an investigation holding the sampled traces and the call graph the destination was resolved from, linked from the notification body."}),tags:De,monitorIds:r.Array(r.String(),{description:"Monitors this rule reacts to."}),sloIds:r.Array(r.String(),{description:"SLOs this rule reacts to."}),fallbackTarget:as,creator:r.Optional(pe),updater:r.Optional(pe)}),bR=r.Object({name:u({description:"Display name of the adaptive notification rule."}),owner:u({allowEmpty:!1,description:"Team ID that owns and manages the rule"}),tags:Xe,isActive:r.Boolean({description:"Set to true for the rule to send notifications when one of its monitors fires."}),shouldCreateInvestigation:r.Optional(r.Boolean({description:"Set to true to record an investigation for each page, holding the sampled traces and the call graph the destination was resolved from, and to link it from the notification body. Defaults to false."})),monitorIds:r.Optional(r.Array(u({allowEmpty:!1}),{maxItems:100,description:"Monitors this rule reacts to. Only trace monitors and metric monitors over OTel span metrics are eligible. Send at least one monitor or SLO."})),sloIds:r.Optional(r.Array(u({allowEmpty:!1}),{maxItems:100,description:"SLOs this rule reacts to. Only SLOs over traces or OTel span metrics are eligible. Omit for a rule that reacts to monitors only; send at least one monitor or SLO."})),fallbackTarget:gi}),XLe=d({tags:["notification-rules"],url:Sn,method:"GET",paginated:!0,query:r.Object(ge),response:r.Array(hi)}),JLe=d({tags:["notification-rules"],url:`${Sn}/:id`,params:r.Object({id:u()}),method:"GET",response:hi}),eke=d({tags:["notification-rules"],url:Sn,method:"POST",body:ss,response:hi}),tke=d({tags:["notification-rules"],url:`${Sn}/:id`,method:"PUT",params:r.Object({id:u()}),body:ss,response:hi}),rke=d({tags:["notification-rules"],url:`${Sn}/:id`,method:"DELETE",params:r.Object({id:u()}),response:N}),nke=d({tags:["notification-rules"],url:`${Sn}/bulk-delete`,method:"DELETE",body:r.Object({ids:r.Array(u())}),response:r.Object({})}),yi=`${fi}/adaptive-rules`,oke=d({tags:["notification-rules"],url:yi,method:"GET",paginated:!0,query:r.Object(ge),response:r.Array(du)}),ike=d({tags:["notification-rules"],url:`${yi}/:id`,params:r.Object({id:u()}),method:"GET",response:du}),ake=d({tags:["notification-rules"],url:yi,method:"POST",body:bR,response:du}),ske=d({tags:["notification-rules"],url:`${yi}/:id`,method:"PUT",params:r.Object({id:u()}),body:bR,response:du}),cke=d({tags:["notification-rules"],url:`${yi}/:id`,method:"DELETE",params:r.Object({id:u()}),response:N}),pke=d({tags:["notification-rules"],url:`${yi}/bulk-delete`,method:"DELETE",body:r.Object({ids:r.Array(u())}),response:r.Object({})}),uke=d({tags:["notification-integrations"],url:`${IR}/start`,method:"POST",response:r.Object({redirectUrl:r.String()})}),nH=["google-chat","grafana-irm","incident-io","jira","microsoft-teams","pagerduty","servicenow","slack","squadcast","webhook"],oH=r.Object({id:r.String(),name:r.String(),type:r.Enum(nH),createdAt:A(),ruleCount:r.Number(),creator:r.Optional(pe)}),lke=d({tags:["notification-integrations"],url:`${Sn}/integrations`,method:"GET",paginated:!0,query:r.Object(ge),response:r.Array(oH)}),mke=d({tags:["notification-integrations"],url:`${IR}/callback`,method:"GET",query:r.Object({code:u()}),response:r.Object({success:r.Boolean()})}),Hd=["POST","PUT"],iH=r.Record(r.String(),r.String()),aH=r.Record(r.String(),r.Unknown()),sH=r.Record(r.String(),r.Union([r.String(),r.Number(),r.Boolean(),r.Null(),r.Array(r.Union([r.String(),r.Number(),r.Boolean()]))])),cH=C("type",[r.Object({type:r.Literal("json"),value:aH}),r.Object({type:r.Literal("form"),value:sH})]),pH=r.Object({ok:r.String(),alert:r.String()}),Kd=r.Object({id:r.String(),name:r.String(),setting:C("type",[r.Object({type:r.Literal("incident-io"),alertSourceConfigId:r.String(),tokenLastChars:r.String()}),r.Object({type:r.Literal("grafana-irm"),urlLastChars:r.String()}),r.Object({type:r.Literal("pagerduty"),integrationKeyLastChars:r.String()}),r.Object({type:r.Literal("microsoft-teams"),webhookUrlLastChars:r.String()}),r.Object({type:r.Literal("webhook"),urlLastChars:r.String(),method:r.Enum(Hd),authentication:C("type",[r.Object({type:r.Literal("bearer"),tokenLastChars:r.String()}),r.Object({type:r.Literal("basic"),username:r.String(),passwordLastChars:r.String()}),r.Object({type:r.Literal("custom-header"),key:r.String(),valueLastChars:r.String()}),r.Object({type:r.Literal("none")})]),customHeaders:r.Optional(iH),payloadTemplate:cH,eventNameMapping:r.Optional(pH)}),r.Object({type:r.Literal("servicenow"),instanceName:r.String(),username:r.String(),passwordLastChars:r.String()}),r.Object({type:r.Literal("google-chat"),webhookUrlLastChars:r.String()}),r.Object({type:r.Literal("squadcast"),webhookUrlLastChars:r.String()}),r.Object({type:r.Literal("jira"),siteUrl:r.String(),email:r.String(),apiTokenLastChars:r.String()})]),tags:De}),uH=r.Object({type:r.Literal("webhook"),url:u({type:"uri"}),method:r.Enum(Hd),authentication:C("type",[r.Object({type:r.Literal("bearer"),token:u({allowEmpty:!1})}),r.Object({type:r.Literal("basic"),username:u({allowEmpty:!1}),password:u({allowEmpty:!1})}),r.Object({type:r.Literal("custom-header"),key:u({allowEmpty:!1}),value:u({allowEmpty:!1})}),r.Object({type:r.Literal("none")})]),customHeaders:r.Record(u({allowEmpty:!1}),u()),payloadTemplate:C("type",[r.Object({type:r.Literal("json"),value:r.Record(u({allowEmpty:!1}),r.Unknown())}),r.Object({type:r.Literal("form"),value:r.Record(u({allowEmpty:!1}),r.Union([r.String(),r.Number(),r.Boolean(),r.Null(),r.Array(r.Union([r.String(),r.Number(),r.Boolean()]))]))})]),eventNameMapping:r.Optional(r.Object({ok:u({allowEmpty:!1}),alert:u({allowEmpty:!1})}))}),SR=r.Object({type:r.Literal("incident-io"),alertSourceConfigId:u(),token:u()}),AR=r.Object({type:r.Literal("grafana-irm"),url:u({type:"uri"})}),OR=r.Object({type:r.Literal("pagerduty"),integrationKey:u()}),xR=r.Object({type:r.Literal("microsoft-teams"),webhookUrl:u({type:"uri"})}),lH=r.Object({type:r.Literal("servicenow"),instanceName:u({allowEmpty:!1,description:'Instance name of the ServiceNow instance. This corresponds to the subdomain part of the instance URL, like "my-instance" in "my-instance.service-now.com"'}),username:u({allowEmpty:!1}),password:u({allowEmpty:!1})}),mH=r.Object({type:r.Literal("google-chat"),webhookUrl:u({type:"uri"})}),dH=r.Object({type:r.Literal("squadcast"),webhookUrl:u({type:"uri"})}),fH=r.Object({type:r.Literal("jira"),siteUrl:u({type:"uri",allowEmpty:!1,description:'Base URL of the Jira Cloud site, like "https://your-company.atlassian.net". Tsuga files issues against this site.'}),email:u({type:"email",allowEmpty:!1,description:"Atlassian account email used together with the API token for Basic authentication."}),apiToken:u({allowEmpty:!1,description:"Atlassian API token minted for the account, used as the Basic auth password."})}),gH=r.Object({name:u(),setting:C("type",[SR,AR,OR,xR,uH,lH,mH,dH,fH]),tags:Xe}),hH=r.Object({type:r.Literal("webhook"),url:r.Optional(u({type:"uri"})),method:r.Optional(r.Enum(Hd)),authentication:r.Optional(C("type",[r.Object({type:r.Literal("bearer"),token:r.Optional(u({allowEmpty:!1}))}),r.Object({type:r.Literal("basic"),username:r.Optional(u({allowEmpty:!1})),password:r.Optional(u({allowEmpty:!1}))}),r.Object({type:r.Literal("custom-header"),key:r.Optional(u({allowEmpty:!1})),value:r.Optional(u({allowEmpty:!1}))}),r.Object({type:r.Literal("none")})])),customHeaders:r.Optional(r.Record(u({allowEmpty:!1}),u())),payloadTemplate:r.Optional(C("type",[r.Object({type:r.Literal("json"),value:r.Record(u({allowEmpty:!1}),r.Unknown())}),r.Object({type:r.Literal("form"),value:r.Record(u({allowEmpty:!1}),r.Union([r.String(),r.Number(),r.Boolean(),r.Null(),r.Array(r.Union([r.String(),r.Number(),r.Boolean()]))]))})])),eventNameMapping:r.Optional(r.Object({ok:r.Optional(u({allowEmpty:!1})),alert:r.Optional(u({allowEmpty:!1}))}))}),yH=r.Object({type:r.Literal("servicenow"),instanceName:r.Optional(u({allowEmpty:!1})),username:r.Optional(u({allowEmpty:!1})),password:r.Optional(u({allowEmpty:!1}))}),TH=r.Object({type:r.Literal("jira"),siteUrl:r.Optional(u({type:"uri",allowEmpty:!1})),email:r.Optional(u({allowEmpty:!1})),apiToken:r.Optional(u({allowEmpty:!1}))}),EH=r.Object({type:r.Literal("google-chat"),webhookUrl:u({type:"uri"})}),_H=r.Object({type:r.Literal("squadcast"),webhookUrl:u({type:"uri"})}),IH=r.Object({name:r.Optional(u()),setting:r.Optional(C("type",[SR,AR,OR,xR,hH,yH,EH,_H,TH]))}),dke=d({tags:["notification-integrations"],url:is,method:"POST",body:gH,response:Kd}),fke=d({tags:["notification-integrations"],url:`${is}/:id`,method:"GET",params:r.Object({id:u()}),response:Kd}),gke=d({tags:["notification-integrations"],url:`${is}/:id`,method:"PUT",params:r.Object({id:u()}),body:IH,response:Kd}),hke=d({tags:["notification-integrations"],url:`${is}/:id`,method:"DELETE",params:r.Object({id:u()}),response:N}),bH=C("status",[r.Object({status:r.Literal("ok",{description:"Tsuga reached Jira and listed the projects the credentials can file into."}),projects:r.Array(r.Object({key:r.String({description:'Jira project key, like "OPS".'}),name:r.String({description:"Human readable Jira project name."}),issueTypes:r.Array(r.String(),{description:"Issue type names available when creating an issue in this project."}),statuses:r.Optional(r.Array(r.String(),{description:"Status names an issue in this project can be transitioned to. Omitted when Jira refused the status lookup for this project."}))}),{description:"Projects the connected Jira account can file issues into."})},{title:"JiraMetadataOk"}),r.Object({status:r.Literal("error",{description:"Tsuga could not load Jira metadata with the stored credentials."}),message:r.String({description:"Human readable reason the Jira metadata could not be loaded."})},{title:"JiraMetadataError"})],{description:"Result of probing Jira for the projects, issue types and statuses reachable with a stored integration. Returns a typed error instead of failing so the rule editor can fall back to free-text entry."}),yke=d({tags:["notification-integrations"],url:`${is}/:id/jira-metadata`,method:"GET",params:r.Object({id:u()}),response:bH}),Tke=d({tags:["notification-rules"],url:`${At}/:id/notifications`,method:"GET",params:r.Object({id:u()}),query:r.Optional(r.Object({from:r.Optional(r.Number()),to:r.Optional(r.Number())})),response:r.Object({notifications:r.Array(r.Object({id:r.String(),monitorId:r.String(),monitorResultId:r.String(),ruleId:r.Optional(r.String()),targetId:r.Optional(r.String()),status:r.Enum(eH),tryCount:r.Number(),nextTryAt:A(),createdAt:A(),updatedAt:A(),sentAt:r.Optional(A())})),isTruncated:r.Boolean()})}),SH=["slack","incident-io","pagerduty","email","grafana-irm","microsoft-teams","webhook","servicenow","google-chat","squadcast","jira"],Eke=d({tags:["notification-rules"],url:`${Sn}/test`,method:"POST",body:r.Object({notificationRule:ss,targetIds:r.Optional(r.Array(u({allowEmpty:!1}),{description:"Target IDs to test specific targets",minItems:1,maxItems:10}))}),response:r.Union([r.Object({success:r.Literal(!1),overallMessage:r.String({description:"Message when there is an overall error"})}),r.Object({success:r.Boolean(),results:r.Array(r.Object({targetId:r.String({description:"The ID of the target that was tested"}),targetType:r.Enum(SH,{description:"The type of the target (e.g., slack, webhook)"}),status:r.Enum(["success","failure"],{description:"Whether the test notification was sent successfully"}),message:r.Optional(r.String({description:"Message if the notification failed for this specific target"}))}))})])});var Dt="/v0/service-catalog";var AH=r.Object({team:r.String({description:"Team name observed on telemetry for this service."}),lastSeenAt:A({description:"Most recent time this team was observed for the service."})},{description:"A team name observed on telemetry for this service, with the last time it was seen."}),OH=r.Object({ingestionApiKey:r.String({description:"Ingestion API key name or identifier observed on telemetry for this service."}),lastSeenAt:A({description:"Most recent time this ingestion key was observed for the service."})},{description:"An ingestion API key observed on telemetry for this service, with the last time it was seen."}),xH=r.Object({version:r.String({description:"Service version value observed in telemetry."}),firstSeenAt:A({description:"First time this version was observed for the service."}),lastSeenAt:A({description:"Most recent time this version was observed for the service."}),faulty:r.Optional(r.Boolean({description:"Whether Tsuga detected this version as associated with faulty behavior."})),faultyLatency:r.Optional(r.Boolean({description:"Whether the faulty behavior Tsuga detected for this version is a latency degradation. Only set by faulty deployment detection when it reports on latency; absent when the detection did not evaluate latency."})),detectionTriggered:r.Optional(r.Boolean({description:"Whether faulty deployment detection has already been triggered for this version. Set when the detection job is launched to avoid re-triggering it. Absent on versions predating this field."}))},{description:"A service version observed in telemetry, with first and last seen timestamps and faulty deployment detection results."}),RH=r.Object({language:r.String({description:"Programming language observed for this service."}),lastSeenAt:A({description:"Most recent time this language was observed."})},{description:"A programming language observed for this service, with the last time it was seen."}),CH=r.Object({runtime:r.String({description:"Runtime observed for this service."}),lastSeenAt:A({description:"Most recent time this runtime was observed."})},{description:"A runtime observed for this service, with the last time it was seen."}),RR=r.Object({protocol:r.String({description:"Observed API protocol (e.g. 'http', 'grpc', 'graphql')"}),lastSeenAt:A({description:"Most recent observation timestamp"})},{description:"An API protocol observed for this service, with the last time it was seen."}),PH=r.Object({framework:r.String({description:"Observed application framework (e.g. 'express', 'fastify', 'django', 'rails')"}),lastSeenAt:A({description:"Most recent observation timestamp"})},{description:"An application framework detected from OpenTelemetry instrumentation scope, with the last time it was seen."}),UH=r.Object({platform:r.String({description:"Observed cloud or orchestration platform (e.g. 'aws_eks', 'kubernetes')"}),lastSeenAt:A({description:"Most recent observation timestamp"})},{description:"A cloud or orchestration platform this service runs on, with the last time it was seen."}),wH=r.Object({provider:r.String({description:"Observed cloud provider (e.g. 'aws', 'gcp', 'azure')"}),lastSeenAt:A({description:"Most recent observation timestamp"})},{description:"A cloud provider this service runs on, with the last time it was seen."}),Ti=r.Object({id:r.String({description:"Tsuga-generated identifier of this service target, unique across all services. Used with delivery state such as rate limiting and re-notification."}),serviceId:r.String({description:"Identifier of the service catalog entry this target is attached to."}),config:as.properties.config,rateLimit:as.properties.rateLimit,createdAt:A({description:"Timestamp when user created this service target."}),updatedAt:A({description:"Timestamp when user last updated this service target."})}),zd=r.Object({config:gi.properties.config,rateLimit:gi.properties.rateLimit}),Yd=r.Object({config:gi.properties.config,rateLimit:r.Union([qd,r.Null()],{description:"Per-target rate limit to apply when sending notifications. Set it to `null` to drop the current limit and fall back to the default of 1000 notifications every 10 minutes."})}),cs=r.Object({id:r.String({description:"Unique identifier of this service. Use it with service detail and graph endpoints."}),serviceName:r.String({description:"OpenTelemetry service name observed in telemetry."}),serviceNamespace:r.Optional(r.String({description:"OpenTelemetry service namespace observed in telemetry."})),env:r.Optional(r.String({description:"Environment value observed for this service."})),teams:r.Array(AH,{description:"Team names observed on telemetry for this service and when each was last seen."}),ingestionApiKeys:r.Array(OH,{description:"Ingestion API keys observed on telemetry for this service and when each was last seen."}),versions:r.Array(xH,{description:"Service version values observed in telemetry, including first and last seen timestamps."}),languages:r.Array(RH,{description:"Programming languages observed for this service."}),runtimes:r.Array(CH,{description:"Runtime values observed for this service."}),serverProtocols:r.Array(RR,{description:"API protocols this service exposes (from server-kind spans)"}),clientProtocols:r.Array(RR,{description:"API protocols this service calls out over (from client-kind spans)"}),frameworks:r.Array(PH,{description:"Application frameworks detected from OTel instrumentation scope"}),cloudPlatforms:r.Array(UH,{description:"Cloud platforms this service is running on"}),cloudProviders:r.Array(wH,{description:"Cloud providers this service is running on"}),lastSeenAt:A({description:"Most recent time Tsuga observed telemetry for this service."}),firstSeenAt:A({description:"First time Tsuga observed telemetry for this service."}),sources:r.Array(r.String(),{description:"Telemetry sources that contributed evidence for this service entry."}),additionalUserFields:r.Optional(r.Unsafe({type:"object",additionalProperties:!0,description:"Additional user-defined service metadata, when configured."})),logsCount24h:r.Number({description:"Number of logs observed for this service in the last 24 hours."}),errorLogsCount24h:r.Number({description:"Number of error logs observed for this service in the last 24 hours."}),tracesCount24h:r.Number({description:"Number of traces observed for this service in the last 24 hours."}),errorTracesCount24h:r.Number({description:"Number of error traces observed for this service in the last 24 hours."}),notificationTargets:r.Array(Ti,{description:"Notification targets attached to this service, used by adaptive notification rules to page its owners."}),createdAt:A({description:"Timestamp when Tsuga created this service catalog entry."}),updatedAt:A({description:"Timestamp when Tsuga last updated this service catalog entry."})}),Uke=d({tags:["service-catalog"],query:r.Object({...ge,clusterId:r.Optional(u())}),method:"GET",paginated:!0,url:`${Dt}/services`,response:r.Array(cs)}),vH=r.Object({spanKind:r.Enum(ZO),count:r.Number()}),Vd=r.Object({...cs.properties,spanKindCounts:r.Array(vH),envs:r.Object({primaryEnv:r.String(),allEnvs:r.Array(r.String())})}),wke=d({tags:["service-catalog"],query:r.Object({...ge,clusterId:r.Optional(u()),env:r.Optional(u())}),method:"GET",paginated:!0,url:`${Dt}/v2/services`,response:r.Array(Vd)}),NH=["serviceName","envs","lastDeploy","traceErrorRate","traceRequestRate","logErrorRate","logRequestRate","teams","api","frameworks","languages","pagingDestination"],LH=r.Object({searchQuery:r.Object({value:u({allowEmpty:!1,description:"Substring matched case-insensitively against service names."})},{description:"Text filter for service names."}),teams:_e(u({allowEmpty:!1}),{description:"Restrict results to services observed under any of these team names",maxItems:50}),envs:_e(u({allowEmpty:!1}),{description:"Restrict results to services observed in any of these environments",maxItems:50}),versions:_e(u({allowEmpty:!1}),{description:"Restrict results to services whose latest observed version is one of these",maxItems:50}),languages:_e(u({allowEmpty:!1}),{description:"Restrict results to services written in any of these languages",maxItems:50}),hasRecentData:r.Boolean({description:"When true, only return services that received logs or traces in the last 24 hours"})}),kH=r.Partial(r.Object({...ge,clusterId:u(),filters:r.Partial(LH,{description:"Optional filters applied to narrow the returned services"}),sort:r.Object({by:r.Enum(NH,{description:"Field to sort the returned services by"}),direction:r.Enum(["asc","desc"],{description:"Sort direction: ascending or descending"})},{description:"Optional sorting applied to the returned services"})})),vke=d({tags:["service-catalog"],url:`${Dt}/v2/services/query`,method:"POST",paginated:!0,body:kH,response:r.Array(Vd)}),Nke=d({tags:["service-catalog"],query:r.Object({serviceName:u({allowEmpty:!1}),serviceNamespace:r.Optional(u({allowEmpty:!1})),env:u({allowEmpty:!1}),clusterId:r.Optional(u())}),method:"GET",url:`${Dt}/v2/service`,response:Vd}),Lke=d({tags:["service-catalog"],method:"GET",url:`${Dt}/services/:serviceId`,params:r.Object({serviceId:u()}),response:cs}),kke=d({tags:["service-catalog"],method:"GET",url:`${Dt}/services/:serviceId/targets`,params:r.Object({serviceId:u()}),response:r.Array(Ti)}),Mke=d({tags:["service-catalog"],method:"POST",url:`${Dt}/services/:serviceId/targets`,params:r.Object({serviceId:u()}),body:zd,response:Ti}),Dke=d({tags:["service-catalog"],method:"PUT",url:`${Dt}/services/:serviceId/targets/:targetId`,params:r.Object({serviceId:u(),targetId:u()}),body:Yd,response:Ti}),Gke=d({tags:["service-catalog"],method:"DELETE",url:`${Dt}/services/:serviceId/targets/:targetId`,params:r.Object({serviceId:u(),targetId:u()}),response:N}),MH=["otel_kube","otel_host_kube","otel_host","prometheus","aws_ec2","gcp_compute_engine"];var CR=r.Object({id:r.String(),hostName:r.String(),env:r.Optional(r.String()),cpuUtilizationAverage:r.Number(),hostType:r.Enum(MH),teams:r.Array(r.String()),tags:r.Array(r.String()),firstSeenAt:A(),lastSeenAt:A(),clusterId:r.String()}),$ke=d({tags:["service-catalog"],method:"GET",url:`${Dt}/hosts`,response:r.Array(CR)}),jke=d({tags:["service-catalog"],method:"GET",url:`${Dt}/hosts/:hostId`,params:r.Object({hostId:u()}),response:CR}),DH=["http","rpc","messaging","genai","object_store"],PR={name:r.String({description:"Service or inferred dependency name shown in the graph."}),env:r.Optional(r.String({description:"Environment observed from spans."}))},Qd=r.Object({...PR,nodeType:r.Literal("observed",{description:"Discriminator for this node variant. Always `observed` for a graph node matched to a service catalog entry by name and env."}),id:r.Union([r.String(),r.Null()],{description:"Service ID, or null when multiple namespaces match the observed service name."}),namespace:r.Union([r.String(),r.Null()],{description:"Service namespace, or null when multiple namespaces match the observed service name."}),errorRate:r.Optional(r.Number({description:"Ratio of entry requests with at least one error to total entry requests observed on this service. Omitted when no entry requests were observed."})),entryErrorRequestCount:r.Number({description:"Number of entry requests on this service where at least one entry span had error status."}),entryRequestCount:r.Number({description:"Number of entry requests observed on this service, counted as unique trace IDs that have at least one entry span on this service. An entry span is a consumer-kind span, a root span (no parent), or any span whose parent belongs to a different service."})}),UR={...PR,endpoint:r.Optional(r.String({description:"Inferred service endpoint address"})),resourceName:r.Optional(r.String({description:"Inferred resource name, e.g. table or queue name"}))},Wd=r.Object({...UR,nodeType:r.Literal("inferred_db",{description:"Discriminator for this node variant. Always `inferred_db` for a database dependency detected from client-span attributes that could not be matched to a service catalog entry."}),serviceType:r.Literal("db",{description:"Inferred dependency type. Always `db` for this node variant."}),databaseName:r.Optional(r.String({description:"Database name from span_attributes db.namespace (falling back to legacy db.name). Matches the database catalog `name`."})),databaseSystem:r.String({description:"Database system from span_attributes db.system.name (falling back to legacy db.system). Matches the database catalog `databaseSystem`."})}),Zd=r.Object({...UR,nodeType:r.Literal("inferred",{description:"Discriminator for this node variant. Always `inferred` for a non-database dependency detected from client-span attributes (e.g. a queue or external HTTP call) that could not be matched to a service catalog entry. Database dependencies use the `inferred_db` variant."}),serviceType:r.Enum(DH,{description:"Inferred dependency type from span metadata: http, rpc, messaging, genai, or object_store."})}),GH=C("nodeType",[Qd,Wd,Zd]),Xd=r.Object({from:r.Object({env:r.Optional(r.String({description:"Environment of the source node"})),name:r.String({description:"Name of the source node"})},{description:"Reference to the caller node, i.e. the service or dependency that issued the request."}),to:r.Object({env:r.Optional(r.String({description:"Environment of the target node"})),name:r.String({description:"Name of the target node"}),databaseSystem:r.Optional(r.String({description:"Database system of the target when it is an inferred database node (`inferred_db`). Together with `name` and `env` it identifies the target node, distinguishing a database from a same-named service or a same-named database on another system."}))},{description:"Reference to the callee node, i.e. the service or dependency that received the request."}),count:r.Number({description:"Number of cross-service transitions observed on this directed edge in the graph query window."}),errorRate:r.Optional(r.Number({description:"Ratio of errored client spans to total client spans observed on this edge. Omitted when no client spans were observed. For edges to inferred services, the originating span is treated as the client span regardless of its kind."})),errorCount:r.Number({description:"Number of client spans with error status observed on this edge"}),clientSpanCount:r.Number({description:"Number of client spans observed on this edge"})},{description:"Directed dependency edge from a caller node (`from`) to a callee node (`to`) in the service graph, with call-volume and error counts observed over the query window."}),qke=d({tags:["service-catalog"],url:`${Dt}/services/:serviceId/graph`,method:"GET",params:r.Object({serviceId:u()}),query:r.Object({...at.properties,query:r.Optional(u({type:"tsuga-query"}))}),response:r.Object({clusterId:r.String(),nodes:r.Array(GH),edges:r.Array(Xd)})}),$H=r.Object({monitors:r.Array(r.Object({id:r.String({description:"Identifier of the monitor"}),name:r.String({description:"Display name of the monitor"}),owner:r.String({description:"Team ID that owns the monitor"}),priority:r.Enum(St,{description:"Priority of the monitor"})})),slos:r.Array(r.Object({id:r.String({description:"Identifier of the SLO"}),name:r.String({description:"Display name of the SLO"}),owner:r.String({description:"Team ID that owns the SLO"}),statusCount:r.Partial(r.Record(lu,r.Number()),{description:"Count of SLO statuses for this service: one entry per group matching the service when the SLO groups by service.name, otherwise the overall status"})}))}),Fke=d({tags:["service-catalog"],method:"GET",url:`${Dt}/services/:serviceId/related-resources`,params:r.Object({serviceId:u()}),response:$H}),Bke=d({tags:["service-catalog"],method:"GET",url:`${Dt}/services/by-api-keys`,response:r.Record(r.String(),r.Array(r.Object({serviceName:r.String(),serviceNamespace:r.Optional(r.String())})))});var fu=`/${"v1"}/services`,Jd=r.Pick(cs,["id","serviceName","serviceNamespace","env","teams","versions","languages","runtimes","serverProtocols","clientProtocols","frameworks","cloudPlatforms","cloudProviders","lastSeenAt","firstSeenAt","sources","logsCount24h","errorLogsCount24h","tracesCount24h","errorTracesCount24h"],{$id:"Service",description:"Service inferred from telemetry, with observed metadata, activity counts, and version signals. See [Services](/documentation/categorize/services/index)."}),jH={id:"123-456-abc",serviceName:"api-gateway",serviceNamespace:"platform",env:"production",teams:[{team:"platform",lastSeenAt:"2024-01-15T12:34:56.000Z"}],versions:[{version:"1.2.3",firstSeenAt:"2024-01-01T08:00:00.000Z",lastSeenAt:"2024-01-15T12:34:56.000Z",faulty:!0,faultyLatency:!0}],languages:[{language:"go",lastSeenAt:"2024-01-15T12:34:56.000Z"}],runtimes:[{runtime:"go",lastSeenAt:"2024-01-15T12:34:56.000Z"}],serverProtocols:[{protocol:"http",lastSeenAt:"2024-01-15T12:34:56.000Z"}],clientProtocols:[{protocol:"grpc",lastSeenAt:"2024-01-15T12:34:56.000Z"}],frameworks:[{framework:"gin",lastSeenAt:"2024-01-15T12:34:56.000Z"}],cloudPlatforms:[{platform:"aws_eks",lastSeenAt:"2024-01-15T12:34:56.000Z"},{platform:"kubernetes",lastSeenAt:"2024-01-15T12:34:56.000Z"}],cloudProviders:[{provider:"aws",lastSeenAt:"2024-01-15T12:34:56.000Z"}],lastSeenAt:"2024-01-15T12:34:56.000Z",firstSeenAt:"2024-01-01T08:00:00.000Z",sources:["logs","metrics","traces"],logsCount24h:12e3,errorLogsCount24h:42,tracesCount24h:8500,errorTracesCount24h:17};Object.assign(Jd,{examples:[jH]});var wR=d({description:"Lists services inferred from telemetry. Use this endpoint to inventory service ownership, environments, versions, runtimes, and recent activity. Pagination fields limit the returned page.",operationId:"listServices",tags:["services"],url:fu,method:"GET",paginated:!0,query:r.Object({...Ze,clusterId:r.Optional(u({allowEmpty:!1,description:"Telemetry cluster to target. Omit to use the first cluster in the organization; this does not query all clusters."}))},{description:"Service list query. Use pagination and optional cluster scope."}),response:r.Array(Jd)}),vR=d({description:"Retrieves one telemetry-inferred service by service ID.",operationId:"getService",tags:["services"],url:`${fu}/:serviceId`,method:"GET",params:r.Object({serviceId:u({allowEmpty:!1,description:"Identifier of the service to retrieve. Use the `id` returned by service list responses."})}),response:Jd}),qH=r.Pick(Qd,["name","env","nodeType","id","namespace","errorRate","entryErrorRequestCount","entryRequestCount"],{$id:"ObservedServiceGraphNode",description:"Service graph node matched to a service catalog entry by name and env. `id`/`namespace` are null when multiple namespaces share the observed service name."}),FH=r.Pick(Zd,["name","env","nodeType","serviceType","endpoint","resourceName"],{$id:"InferredServiceGraphNode",description:"Dependency node detected from client-span attributes (e.g. a queue or external HTTP call) that could not be matched to a service catalog entry. Database dependencies use the `inferred_db` variant."}),BH=r.Pick(Wd,["name","env","nodeType","serviceType","endpoint","resourceName"],{$id:"InferredDbServiceGraphNode",description:"Database dependency node detected from client-span attributes that could not be matched to a service catalog entry."}),HH=C("nodeType",[qH,BH,FH]),KH=r.Pick(Xd,["from","to","count","errorRate","errorCount","clientSpanCount"],{$id:"ServiceGraphEdge",description:"Directed dependency edge from a caller node (`from`) to a callee node (`to`), with call-volume and error counts observed over the query window."}),zH=r.Optional(r.Integer({...at.properties.from,description:"Start of the service graph query window as a Unix timestamp in seconds. Provide both `from` and `to` for a deterministic graph window; otherwise Tsuga uses backend graph defaults."})),YH=r.Optional(r.Integer({...at.properties.to,description:"End of the service graph query window as a Unix timestamp in seconds. Provide both `from` and `to` for a deterministic graph window; otherwise Tsuga uses backend graph defaults."})),VH=u({type:"tsuga-query",default:"*",description:"Tsuga query used to filter spans considered for the graph. Defaults to `*`, which applies no additional filter beyond the service identity."}),NR=d({description:"Retrieves a dependency graph for one service over an optional time range and query filter. Provide an explicit time range for deterministic results. Use this to inspect observed downstream and upstream service relationships. See [Service page](/documentation/categorize/services/service-page).",operationId:"getServiceGraph",tags:["services"],url:`${fu}/:serviceId/graph`,method:"GET",params:r.Object({serviceId:u({allowEmpty:!1,description:"Identifier of the service to use as the graph root. Use the `id` returned by service list or get responses."})}),query:r.Object({from:zH,to:YH,query:r.Optional(VH)},{description:"Service graph query. Use time range and optional span query filters."}),response:r.Object({clusterId:r.String({description:"Cluster ID the graph was built from"}),nodes:r.Array(HH,{description:"Observed and inferred nodes included in the service dependency graph."}),edges:r.Array(KH,{description:"Directed dependency edges between graph nodes."})})}),gu=`${fu}/:serviceId/notification-targets`,hu=r.Pick(Ti,["id","serviceId","config","rateLimit"],{$id:"ServiceNotificationTarget",description:"Notification target attached to a service, used by adaptive notification rules to page the service owners. See [Rules](/documentation/alert/notifications/rules)."}),ef={rateLimit:{maxMessages:10,minutes:5},config:{type:"email",addresses:["oncall@example.com"],renotifyConfig:{mode:"each",renotificationStates:["alert"],renotifyIntervalMinutes:30}}},QH={id:"789-abc-def",serviceId:"123-456-abc",...ef};Object.assign(hu,{examples:[QH]});var yu=u({allowEmpty:!1,description:"Identifier of the service the notification target belongs to. Use the `id` returned by service list or get responses."}),Xke=d({description:"Lists the notification targets attached to one service. Use this to discover target IDs before updating or deleting a target.",operationId:"listServiceNotificationTargets",tags:["services"],url:gu,method:"GET",params:r.Object({serviceId:yu}),response:r.Array(hu)}),WH=r.Pick(zd,["config","rateLimit"],{description:"Service notification target create request. Provide the delivery destination and an optional per-target rate limit.",examples:[ef]}),ZH=r.Pick(Yd,["config","rateLimit"],{description:"Service notification target update request. The submitted destination and rate limit overwrite the stored ones.",examples:[ef]}),Jke=d({description:"Attaches a notification target to a service. Adaptive notification rules matching the service page this target on alert transitions.",operationId:"createServiceNotificationTarget",tags:["services"],url:gu,method:"POST",params:r.Object({serviceId:yu}),body:WH,response:hu}),eMe=d({description:"Updates one notification target attached to a service.",operationId:"updateServiceNotificationTarget",tags:["services"],url:`${gu}/:targetId`,method:"PUT",params:r.Object({serviceId:yu,targetId:u({allowEmpty:!1,description:"Identifier of the notification target to update. Use the `id` returned by service notification target list or create responses."})}),body:ZH,response:hu}),tMe=d({description:"Detaches a notification target from a service. Notification rules stop paging this destination for the service.",operationId:"deleteServiceNotificationTarget",tags:["services"],url:`${gu}/:targetId`,method:"DELETE",params:r.Object({serviceId:yu,targetId:u({allowEmpty:!1,description:"Identifier of the notification target to delete. Use the `id` returned by service notification target list or create responses."})}),response:N});var Ge=" (unix seconds, ISO 8601, or relative like -1h/-30m/now)";function LR(e,t){let n=t??$r(e);return n===void 0?void 0:Ic(n)}function tf(e){let t=$r(e);return t===void 0?"":` (default: ${t})`}function kR(e,t){e.command("service-graph").description("Inspect service dependency graphs").command("get <SERVICE_ID>").description("Retrieve the dependency graph for a service").option("--from <TIMESTAMP>",`Start of time range${Ge}${tf("from")}`).option("--to <TIMESTAMP>",`End of time range${Ge}${tf("to")}`).option("--query <TSUGA_QUERY>",`Tsuga query to filter graph spans${tf("query")}`).action(async(o,i)=>{let a={},c=LR("from",i.from),l=LR("to",i.to);c!==void 0&&(a.from=c),l!==void 0&&(a.to=l),i.query!==void 0&&(a.query=i.query);let m=await t()(NR,{params:{serviceId:o},query:a});ee(m)})}var XH=`/${"v1"}/grok`,JH=25,e2=100,MR=r.Object({rules:r.Array(u({allowEmpty:!1,type:"long",description:"Grok parsing rule to preview against each sample. The rule uses the same Grok syntax as the log route **Grok parser** processor, for example `pod:%{DATA:namespace}/%{DATA:name}`."}),{minItems:1,maxItems:JH,description:"Ordered Grok parsing rules to preview. For each sample, Tsuga tries the rules in order and returns the first successful match, matching route Grok processor semantics."}),samples:r.Array(u({allowEmpty:!1,type:"long",description:"Raw log line to parse with the provided Grok rules. The value is parsed as preview input only; this endpoint does not ingest or store the sample."}),{minItems:1,maxItems:e2,description:"Sample log lines to run against the rules. Results are returned in the same order as this array."})},{description:"Grok rules and sample log lines to preview extraction before saving a route processor. The endpoint uses the same parser as the route builder preview and does not create or update routes."}),t2={rules:['pod:%{DATA:pod_namespace}/%{DATA:pod_name}\\] "%{DATA:request}" HTTP/%{POSINT:status}'],samples:['[conn-id:abc pod:tsuga-events/tsuga-events-searcher-0] "/token" HTTP/200']};Object.assign(MR,{examples:[t2]});var DR=r.Object({results:r.Array(r.Object({sample:r.String({description:"Echo of the submitted log line, so results can be matched to the samples in the request."}),matched:r.Boolean({description:"Whether any submitted rule matched this sample. `true` means `extracted` contains the captured fields; `false` means no rule matched."}),extracted:r.Union([r.Record(r.String(),r.Unknown()),r.Null()],{description:"Fields extracted from the first matching Grok rule when `matched` is `true`; dotted capture names are expanded into nested objects. `null` when no rule matched."})}),{description:"Preview result for each submitted sample, in the same order as the request `samples` array."})},{description:"Grok extraction preview results from applying the ordered rules to each submitted sample."}),r2={results:[{sample:'[conn-id:abc pod:tsuga-events/tsuga-events-searcher-0] "/token" HTTP/200',matched:!0,extracted:{pod_namespace:"tsuga-events",pod_name:"tsuga-events-searcher-0",request:"/token",status:"200"}}]};Object.assign(DR,{examples:[r2]});var GR=d({url:`${XH}/parse`,method:"POST",operationId:"parseGrok",tags:["public","grok"],body:MR,response:DR,description:"Parses sample log lines with Grok rules and returns extracted fields, using the same Grok engine as the log route processor. Use this endpoint to author and test route Grok rules before saving them. The operation requires public API read access to log routes. A rule that fails to compile returns a 400 response with error code `GROK_RULE_VALIDATION_ERROR` and structured details in `error.details.ruleErrors`."});var $R=rn(require("node:fs"));function Ei(e){if(e.file){let t=$R.default.readFileSync(e.file==="-"?0:e.file,"utf-8");return JSON.parse(t)}if(e.data)return JSON.parse(e.data);throw new Error("Provide a request body with -f <FILE_PATH> or -d <JSON>. Use --generate-skeleton to get a template.")}function rf(e){return s.HasPropertyKey(e,"~refine")&&s.IsArray(e["~refine"])&&s.Every(e["~refine"],0,t=>s.IsObject(t)&&s.HasPropertyKey(t,"check")&&s.HasPropertyKey(t,"error")&&s.IsFunction(t.check)&&s.IsFunction(t.error))}function ir(e){return s.IsObject(e)&&!s.IsArray(e)}function Tu(e){return s.IsBoolean(e)}function q(e){return ir(e)||Tu(e)}function nf(e){return s.HasPropertyKey(e,"additionalItems")&&q(e.additionalItems)}function Hr(e){return s.HasPropertyKey(e,"additionalProperties")&&q(e.additionalProperties)}function of(e){return s.HasPropertyKey(e,"allOf")&&s.IsArray(e.allOf)&&e.allOf.every(t=>q(t))}function ps(e){return s.HasPropertyKey(e,"$anchor")&&s.IsString(e.$anchor)}function af(e){return s.HasPropertyKey(e,"anyOf")&&s.IsArray(e.anyOf)&&e.anyOf.every(t=>q(t))}function sf(e){return s.HasPropertyKey(e,"const")}function lo(e){return s.HasPropertyKey(e,"contains")&&q(e.contains)}function Ht(e){return s.HasPropertyKey(e,"default")}function cf(e){return s.HasPropertyKey(e,"dependencies")&&s.IsObject(e.dependencies)&&Object.values(e.dependencies).every(t=>q(t)||s.IsArray(t)&&t.every(n=>s.IsString(n)))}function pf(e){return s.HasPropertyKey(e,"dependentRequired")&&s.IsObject(e.dependentRequired)&&Object.values(e.dependentRequired).every(t=>s.IsArray(t)&&t.every(n=>s.IsString(n)))}function uf(e){return s.HasPropertyKey(e,"dependentSchemas")&&s.IsObject(e.dependentSchemas)&&Object.values(e.dependentSchemas).every(t=>q(t))}function An(e){return s.HasPropertyKey(e,"$dynamicAnchor")&&s.IsString(e.$dynamicAnchor)}function lf(e){return s.HasPropertyKey(e,"$dynamicRef")&&s.IsString(e.$dynamicRef)}function mf(e){return s.HasPropertyKey(e,"else")&&q(e.else)}function df(e){return s.HasPropertyKey(e,"enum")&&s.IsArray(e.enum)}function ff(e){return s.HasPropertyKey(e,"exclusiveMaximum")&&(s.IsNumber(e.exclusiveMaximum)||s.IsBigInt(e.exclusiveMaximum))}function Kr(e){return s.HasPropertyKey(e,"exclusiveMinimum")&&(s.IsNumber(e.exclusiveMinimum)||s.IsBigInt(e.exclusiveMinimum))}function us(e){return s.HasPropertyKey(e,"format")&&s.IsString(e.format)}function zr(e){return s.HasPropertyKey(e,"$id")&&s.IsString(e.$id)}function gf(e){return s.HasPropertyKey(e,"if")&&q(e.if)}function _i(e){return s.HasPropertyKey(e,"items")&&(q(e.items)||s.IsArray(e.items)&&e.items.every(t=>q(t)))}function hf(e){return _i(e)&&s.IsArray(e.items)}function yf(e){return s.HasPropertyKey(e,"maximum")&&(s.IsNumber(e.maximum)||s.IsBigInt(e.maximum))}function Tf(e){return s.HasPropertyKey(e,"maxContains")&&s.IsNumber(e.maxContains)}function Eu(e){return s.HasPropertyKey(e,"maxItems")&&s.IsNumber(e.maxItems)}function Ef(e){return s.HasPropertyKey(e,"maxLength")&&s.IsNumber(e.maxLength)}function _f(e){return s.HasPropertyKey(e,"maxProperties")&&s.IsNumber(e.maxProperties)}function Yr(e){return s.HasPropertyKey(e,"minimum")&&(s.IsNumber(e.minimum)||s.IsBigInt(e.minimum))}function mo(e){return s.HasPropertyKey(e,"minContains")&&s.IsNumber(e.minContains)}function Ii(e){return s.HasPropertyKey(e,"minItems")&&s.IsNumber(e.minItems)}function ls(e){return s.HasPropertyKey(e,"minLength")&&s.IsNumber(e.minLength)}function ms(e){return s.HasPropertyKey(e,"minProperties")&&s.IsNumber(e.minProperties)}function If(e){return s.HasPropertyKey(e,"multipleOf")&&(s.IsNumber(e.multipleOf)||s.IsBigInt(e.multipleOf))}function bf(e){return s.HasPropertyKey(e,"not")&&q(e.not)}function Sf(e){return s.HasPropertyKey(e,"oneOf")&&s.IsArray(e.oneOf)&&e.oneOf.every(t=>q(t))}function ds(e){return s.HasPropertyKey(e,"pattern")&&(s.IsString(e.pattern)||e.pattern instanceof RegExp)}function fs(e){return s.HasPropertyKey(e,"patternProperties")&&s.IsObject(e.patternProperties)&&Object.values(e.patternProperties).every(t=>q(t))}function bi(e){return s.HasPropertyKey(e,"prefixItems")&&s.IsArray(e.prefixItems)&&e.prefixItems.every(t=>q(t))}function gs(e){return s.HasPropertyKey(e,"properties")&&s.IsObject(e.properties)&&Object.values(e.properties).every(t=>q(t))}function Af(e){return s.HasPropertyKey(e,"propertyNames")&&(s.IsObject(e.propertyNames)||q(e.propertyNames))}function n2(e){return s.HasPropertyKey(e,"$recursiveAnchor")&&s.IsBoolean(e.$recursiveAnchor)}function _u(e){return n2(e)&&s.IsEqual(e.$recursiveAnchor,!0)}function Of(e){return s.HasPropertyKey(e,"$recursiveRef")&&s.IsString(e.$recursiveRef)}function xf(e){return s.HasPropertyKey(e,"$ref")&&s.IsString(e.$ref)}function fo(e){return s.HasPropertyKey(e,"required")&&s.IsArray(e.required)&&e.required.every(t=>s.IsString(t))}function Rf(e){return s.HasPropertyKey(e,"then")&&q(e.then)}function Cf(e){return s.HasPropertyKey(e,"type")&&(s.IsString(e.type)||s.IsArray(e.type)&&e.type.every(t=>s.IsString(t)))}function Si(e){return s.HasPropertyKey(e,"uniqueItems")&&s.IsBoolean(e.uniqueItems)}function Iu(e){return s.HasPropertyKey(e,"unevaluatedItems")&&q(e.unevaluatedItems)}function bu(e){return s.HasPropertyKey(e,"unevaluatedProperties")&&q(e.unevaluatedProperties)}var xt=class{constructor(){let t=new Set,n=new Set;this.stack=[{indices:t,keys:n}]}Push(){let t=new Set,n=new Set;return this.stack.push({indices:t,keys:n}),!0}Pop(){return this.stack.pop(),!0}AddIndex(t){return this.GetIndices().add(t),!0}AddKey(t){return this.GetKeys().add(t),!0}GetIndices(){return this.stack[this.stack.length-1].indices}GetKeys(){return this.stack[this.stack.length-1].keys}Merge(t){for(let n of t)n.GetIndices().forEach(o=>this.GetIndices().add(o)),n.GetKeys().forEach(o=>this.GetKeys().add(o));return!0}},hs=class extends xt{constructor(t){super(),this.callback=t}AddError(t){return this.callback(t),!1}},st=class extends hs{constructor(){super(t=>this.errors.push(t)),this.errors=[]}AddError(t){return this.errors.push(t),!1}GetErrors(){return this.errors}};function jR(e,t,n,o){return s.Every(n["~refine"],0,(i,a)=>i.check(o))}function qR(e,t,n,o,i,a){return s.EveryAll(i["~refine"],0,(c,l)=>c.check(a)||t.AddError({keyword:"~refine",schemaPath:n,instancePath:o,params:{index:l,message:c.error(a)}}))}function FR(e){return _i(e)&&s.IsArray(e.items)}function BR(e,t,n,o){return FR(n)?s.Every(o,0,(a,c)=>s.IsLessThan(c,n.items.length)||Kt(e,t,n.additionalItems,a)&&t.AddIndex(c)):!0}function HR(e,t,n,o,i,a){return FR(i)?s.Every(a,0,(l,m)=>{let f=`${n}/additionalItems`,h=`${o}/${m}`;return s.IsLessThan(m,i.items.length)||zt(e,t,f,h,i.additionalItems,l)&&t.AddIndex(m)}):!0}function o2(e){return`^${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}$`}function KR(e){let t=[];return fs(e)&&t.push(...s.Keys(e.patternProperties)),gs(e)&&t.push(...s.Keys(e.properties).map(o2)),s.IsEqual(t.length,0)?"(?!)":`(${t.join("|")})`}function zR(e,t,n,o){let i=new RegExp(KR(n));return s.Every(s.Keys(o),0,(c,l)=>i.test(c)||Kt(e,t,n.additionalProperties,o[c])&&t.AddKey(c))}function YR(e,t,n,o,i,a){let c=new RegExp(KR(i)),l=[];return s.EveryAll(s.Keys(a),0,(f,h)=>{let E=`${n}/additionalProperties`,I=`${o}/${f}`,g=new st,T=c.test(f)||zt(e,g,E,I,i.additionalProperties,a[f])&&t.AddKey(f);return T||l.push(f),T})||t.AddError({keyword:"additionalProperties",schemaPath:n,instancePath:o,params:{additionalProperties:l}})}function VR(e,t,n,o){let i=n.allOf.reduce((a,c)=>{let l=new xt;return ne(e,l,c,o)?[...a,l]:a},[]);return s.IsEqual(i.length,n.allOf.length)&&t.Merge(i)}function QR(e,t,n,o,i,a){let c=[],l=i.allOf.reduce((f,h,E)=>{let I=`${n}/allOf/${E}`,g=new st,T=Ie(e,g,I,o,h,a);return T||c.push(g),T?[...f,g]:f},[]),m=s.IsEqual(l.length,i.allOf.length)&&t.Merge(l);return m||c.forEach(f=>f.GetErrors().forEach(h=>t.AddError(h))),m}function WR(e,t,n,o){let i=n.anyOf.reduce((a,c)=>{let l=new xt;return ne(e,l,c,o)?[...a,l]:a},[]);return s.IsGreaterThan(i.length,0)&&t.Merge(i)}function ZR(e,t,n,o,i,a){let c=[],l=i.anyOf.reduce((f,h,E)=>{let I=new st,g=`${n}/anyOf/${E}`,T=Ie(e,I,g,o,h,a);return T||c.push(I),T?[...f,I]:f},[]),m=s.IsGreaterThan(l.length,0)&&t.Merge(l);return m||c.forEach(f=>f.GetErrors().forEach(h=>t.AddError(h))),m||t.AddError({keyword:"anyOf",schemaPath:n,instancePath:o,params:{}})}function Uf(e,t,n,o){return n}function XR(e,t,n,o,i,a){return Uf(e,t,i,a)||t.AddError({keyword:"boolean",schemaPath:n,instancePath:o,params:{}})}function wf(e,t,n,o){return s.IsValueLike(n.const)?s.IsEqual(o,n.const):s.IsDeepEqual(o,n.const)}function JR(e,t,n,o,i,a){return wf(e,t,i,a)||t.AddError({keyword:"const",schemaPath:n,instancePath:o,params:{allowedValue:i.const}})}function i2(e){return!(mo(e)&&s.IsEqual(e.minContains,0))}function vf(e,t,n,o){return i2(n)?!s.IsEqual(o.length,0)&&s.SomeAll(o,(i,a)=>ne(e,t,n.contains,i)&&t.AddIndex(a)):!0}function eC(e,t,n,o,i,a){return vf(e,t,i,a)||t.AddError({keyword:"contains",schemaPath:n,instancePath:o,params:{minContains:1}})}function tC(e,t,n,o){let i=s.IsEqual(s.Keys(o).length,0),a=s.Every(s.Entries(n.dependencies),0,([c,l])=>!s.HasPropertyKey(o,c)||(s.IsArray(l)?l.every(m=>s.HasPropertyKey(o,m)):ne(e,t,l,o)));return i||a}function rC(e,t,n,o,i,a){let c=s.IsEqual(s.Keys(a).length,0),l=s.EveryAll(s.Entries(i.dependencies),0,([m,f])=>{let h=`${n}/dependencies/${m}`;return!s.HasPropertyKey(a,m)||(s.IsArray(f)?f.every(E=>s.HasPropertyKey(a,E)||t.AddError({keyword:"dependencies",schemaPath:n,instancePath:o,params:{property:m,dependencies:f}})):Ie(e,t,h,o,f,a))});return c||l}function nC(e,t,n,o){let i=s.IsEqual(s.Keys(o).length,0),a=s.Every(s.Entries(n.dependentRequired),0,([c,l])=>!s.HasPropertyKey(o,c)||l.every(m=>s.HasPropertyKey(o,m)));return i||a}function oC(e,t,n,o,i,a){let c=s.IsEqual(s.Keys(a).length,0),l=s.EveryAll(s.Entries(i.dependentRequired),0,([m,f])=>!s.HasPropertyKey(a,m)||s.EveryAll(f,0,h=>s.HasPropertyKey(a,h)||t.AddError({keyword:"dependentRequired",schemaPath:n,instancePath:o,params:{property:m,dependencies:f}})));return c||l}function iC(e,t,n,o){let i=s.IsEqual(s.Keys(o).length,0),a=s.Every(s.Entries(n.dependentSchemas),0,([c,l])=>!s.HasPropertyKey(o,c)||ne(e,t,l,o));return i||a}function aC(e,t,n,o,i,a){let c=s.IsEqual(s.Keys(a).length,0),l=s.EveryAll(s.Entries(i.dependentSchemas),0,([m,f])=>{let h=`${n}/dependentSchemas/${m}`;return!s.HasPropertyKey(a,m)||Ie(e,t,h,o,f,a)});return c||l}function sC(e,t,n,o){let i=e.DynamicRef(n)??!1;return q(i)&&ne(e,t,i,o)}function cC(e,t,n,o,i,a){let c=e.DynamicRef(i)??!1;return q(c)&&Ie(e,t,"#",o,c,a)}function kf(e,t,n,o){return s.Some(n.enum,i=>s.IsValueLike(i)?s.IsEqual(o,i):s.IsDeepEqual(o,i))}function pC(e,t,n,o,i,a){return kf(e,t,i,a)||t.AddError({keyword:"enum",schemaPath:n,instancePath:o,params:{allowedValues:i.enum}})}function Mf(e,t,n,o){return s.IsLessThan(o,n.exclusiveMaximum)}function uC(e,t,n,o,i,a){return Mf(e,t,i,a)||t.AddError({keyword:"exclusiveMaximum",schemaPath:n,instancePath:o,params:{comparison:"<",limit:i.exclusiveMaximum}})}function Df(e,t,n,o){return s.IsGreaterThan(o,n.exclusiveMinimum)}function lC(e,t,n,o,i,a){return Df(e,t,i,a)||t.AddError({keyword:"exclusiveMinimum",schemaPath:n,instancePath:o,params:{comparison:">",limit:i.exclusiveMinimum}})}var Ri={};Yt(Ri,{Clear:()=>bC,Entries:()=>H2,Get:()=>Y2,Has:()=>z2,IsDate:()=>Oi,IsDateTime:()=>Su,IsDuration:()=>Au,IsEmail:()=>Ou,IsHostname:()=>Ru,IsIPv4:()=>Uu,IsIPv6:()=>wu,IsIdnEmail:()=>Cu,IsIdnHostname:()=>Pu,IsIri:()=>Nu,IsIriReference:()=>vu,IsJsonPointer:()=>ku,IsJsonPointerUriFragment:()=>Lu,IsRegex:()=>Mu,IsRelativeJsonPointer:()=>Du,IsTime:()=>xi,IsUri:()=>qu,IsUriReference:()=>Gu,IsUriTemplate:()=>$u,IsUrl:()=>Fu,IsUuid:()=>Bu,Reset:()=>SC,Set:()=>K2,Test:()=>V2});var a2=[0,31,28,31,30,31,30,31,31,30,31,30,31],s2=/^(\d\d\d\d)-(\d\d)-(\d\d)$/;function c2(e){return e%4===0&&(e%100!==0||e%400===0)}function Oi(e){let t=s2.exec(e);if(!t)return!1;let n=+t[1],o=+t[2],i=+t[3];return o>=1&&o<=12&&i>=1&&i<=(o===2&&c2(n)?29:a2[o])}var p2=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(?:Z|([+-])(\d\d):(\d\d))?$/i;function xi(e,t=!0){let n=p2.exec(e);if(!n)return!1;let o=+n[1],i=+n[2],a=+n[3],c=n[4]==="-"?-1:1,l=+(n[5]||0),m=+(n[6]||0);if(l>23||m>59||t&&!n[4]&&e.toLowerCase().indexOf("z")===-1)return!1;if(o<=23&&i<=59&&a<60)return!0;let f=i-m*c,h=o-l*c-(f<0?1:0);return(h===23||h===-1)&&(f===59||f===-1)&&a<61}function Su(e,t=!0){let n=e.split(/T/i);return n.length===2&&Oi(n[0])&&xi(n[1],t)}var u2=/^P((\d+Y(\d+M(\d+D)?)?|\d+M(\d+D)?|\d+D)(T(\d+H(\d+M(\d+S)?)?|\d+M(\d+S)?|\d+S))?|T(\d+H(\d+M(\d+S)?)?|\d+M(\d+S)?|\d+S)|\d+W)$/;function Au(e){return u2.test(e)}var l2=/^(?!.*\.\.)[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i;function Ou(e){return l2.test(e)}var go=36,xu=1,Gf=26,m2=38,d2=700,f2=72,g2=128;function h2(e,t,n){e=n?Math.floor(e/d2):e>>1,e+=Math.floor(e/t);let o=0;for(;e>(go-xu)*Gf>>1;)e=Math.floor(e/(go-xu)),o+=go;return o+Math.floor((go-xu+1)*e/(e+m2))}function mC(e){let t=[],n=g2,o=0,i=f2,a=e.lastIndexOf("-");if(a>0)for(let l=0;l<a;l++){let m=e.charCodeAt(l);if(m>=128)throw new Error("Invalid punycode: non-basic before delimiter");t.push(m)}let c=a<0?0:a+1;for(;c<e.length;){let l=o,m=1,f=go;for(;;){if(c>=e.length)throw new Error("Invalid punycode: unexpected end of input");let E=e.charCodeAt(c++),I;if(E>=97&&E<=122)I=E-97;else if(E>=48&&E<=57)I=E-48+26;else if(E>=65&&E<=90)fe();else throw new Error("Invalid punycode: bad digit character");o+=I*m;let g=f<=i?xu:f>=i+Gf?Gf:f-i;if(I<g)break;m*=go-g,f+=go}let h=t.length+1;i=h2(o-l,h,l===0),n+=Math.floor(o/h),o%=h,t.splice(o,0,n),o++}return globalThis.String.fromCodePoint(...t)}function T2(e){return new RegExp("\\p{Mn}","u").test(String.fromCodePoint(e))}function E2(e){return new RegExp("\\p{Mc}","u").test(String.fromCodePoint(e))}function _2(e){return new RegExp("\\p{Me}","u").test(String.fromCodePoint(e))}function I2(e){return T2(e)||E2(e)||_2(e)}var b2=new Set([1600,2042,12334,12335,12337,12338,12339,12340,12341,12347]),S2=new Set([2381,2509,2637,2765,2893,3021,3149,3277,3387,3388,3405,3530,6980,7082,7083,43456,69702,69759,69817,69939,69940,70080,70197,70477,70722,70850,71103,71231,71350,72767,73028,73029]);function A2(e){return new RegExp("\\p{Script=Greek}","u").test(String.fromCodePoint(e))}function O2(e){return new RegExp("\\p{Script=Hebrew}","u").test(String.fromCodePoint(e))}function x2(e){return new RegExp("\\p{Script=Hiragana}","u").test(String.fromCodePoint(e))}function R2(e){return new RegExp("\\p{Script=Katakana}","u").test(String.fromCodePoint(e))}function C2(e){return new RegExp("\\p{Script=Han}","u").test(String.fromCodePoint(e))}function P2(e){return e>=1632&&e<=1641}function U2(e){return e>=1776&&e<=1785}function dC(e){return S2.has(e)}function fC(e){if(e.length===0)return fe();let t=[...e].map(c=>c.codePointAt(0)),n=t.length;if(t[0]===45||t[n-1]===45||n>=4&&t[2]===45&&t[3]===45||I2(t[0]))return!1;let o=!1,i=!1,a=!1;for(let c=0;c<n;c++){let l=t[c];if(b2.has(l))return!1;(x2(l)||R2(l)||C2(l))&&(o=!0),P2(l)&&(i=!0),U2(l)&&(a=!0);let m=t[c-1],f=t[c+1];switch(l){case 183:if(m!==108||f!==108)return!1;break;case 885:if(f===void 0||!A2(f))return!1;break;case 1523:case 1524:if(m===void 0||!O2(m))return!1;break;case 8204:if(m===void 0||m<128&&!dC(m))return!1;break;case 8205:if(m===void 0||!dC(m))return!1;break;case 12539:break}}return!(e.includes("\u30FB")&&!o||i&&a)}function w2(e){if(e.charCodeAt(0)===45||e.charCodeAt(e.length-1)===45||e.length>=4&&e.charCodeAt(2)===45&&e.charCodeAt(3)===45)return!1;for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(!(n>=97&&n<=122||n>=65&&n<=90||n>=48&&n<=57||n===45))return!1}return!0}function gC(e){return e.toLowerCase().startsWith("xn--")}function hC(e){try{let t=e.slice(4).toLowerCase();if(t.lastIndexOf("-")===0)return!1;let o=mC(t);return o?fC(o):!1}catch{return!1}}function yC(e){return e.length===0||e.length>63?!1:gC(e)?hC(e):fC(e)}function TC(e){return e.length===0||e.length>63?!1:gC(e)?hC(e):w2(e)}function Ru(e){if(e.length===0||e.length>253||e.charCodeAt(e.length-1)===46)return!1;for(let t of e.split("."))if(!TC(t))return!1;return!0}var N2=/^(?!.*\.\.)[\p{L}\p{N}!#$%&'*+/=?^_`{|}~-]+(?:\.[\p{L}\p{N}!#$%&'*+/=?^_`{|}~-]+)*@[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,61}[\p{L}\p{N}])?(?:\.[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,61}[\p{L}\p{N}])?)*$/iu;function Cu(e){return N2.test(e)}function Pu(e){if(e.length===0||e.includes(" "))return!1;let t=e.normalize("NFC").replace(/[\u002E\u3002\uFF0E\uFF61]/g,".");if(t.length>253)return!1;for(let n of t.split("."))if(!yC(n))return!1;return!0}function $f(e,t,n){let o=0,i=0,a=0,c=0;for(let l=t;l<n;l++){let m=e.charCodeAt(l);if(m===46){if(a===0||i>255||c===48&&a>1)return!1;o++,i=0,a=0,c=0}else if(m>=48&&m<=57)a===0&&(c=m),i=i*10+(m-48),a++;else return!1}return o===3&&a>0&&i<=255&&!(c===48&&a>1)}function Uu(e){return $f(e,0,e.length)}function L2(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function wu(e){let t=e.length;if(t===0)return!1;let n=0,o=!1,i=0;if(e.charCodeAt(0)===58&&e.charCodeAt(1)===58){if(t===2)return!0;o=!0,i=2}for(;i<t;){let a=0,c=i;for(;i<t&&L2(e.charCodeAt(i));)i++,a++;if(a===0)return!1;let l=e.charCodeAt(i);if(l===46){if(!$f(e,c,t))return!1;n+=2,i=t;break}if(a>4)return!1;if(n++,i===t)break;if(l!==58)return!1;if(i++,e.charCodeAt(i)===58){if(o||e.charCodeAt(i+1)===58)return!1;if(o=!0,i++,i===t)break}}return o?n<=7:n===8}function EC(e){try{return new URL(e,"http://example.com"),!0}catch{return!1}}function vu(e){if(e.includes(" ")||e.includes("\\")||/[\x00-\x1F\x7F]/.test(e)||/%(?![0-9a-fA-F]{2})/.test(e))return!1;if(e==="")return!0;let t=e.indexOf(":");return t>0&&/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e.substring(0,t))?EC(e):e.match(/^([a-zA-Z][a-zA-Z0-9+\-.]*)(\/\/)/)&&t===-1?!1:EC(e)}function Nu(e){try{return new URL(e),!0}catch{return!1}}var k2=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;function Lu(e){return k2.test(e)}var M2=/^(?:\/(?:[^~/]|~0|~1)*)*$/;function ku(e){return M2.test(e)}function Mu(e){if(e.length===0)return!1;try{return new RegExp(e),!0}catch{return!1}}var D2=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function Du(e){return D2.test(e)}var G2=/^(?!.*[^\x00-\x7F])(?!.*\\)(?:(?:[a-z][a-z0-9+\-.]*:)?(?:\/\/[^\s[\]{}<>^`|]*)?|[^\s[\]{}<>^`|]*)(?:\?[^\s[\]{}<>^`|]*)?(?:#[^\s[\]{}<>^`|]*)?$/i;function Gu(e){return G2.test(e)}var $2=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i;function $u(e){return $2.test(e)}function _C(e){return e>=97&&e<=122||e>=65&&e<=90}function IC(e){return _C(e)||e>=48&&e<=57}function ju(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function j2(e){return IC(e)||e===43||e===45||e===46}function jf(e){return IC(e)||e===45||e===46||e===95||e===126}function qf(e){return e===33||e===36||e===38||e===39||e===40||e===41||e===42||e===43||e===44||e===59||e===61}function q2(e){return jf(e)||qf(e)||e===58||e===64}function qu(e){let t=e.length;if(t===0||!_C(e.charCodeAt(0)))return!1;let n=1;for(;n<t;){let o=e.charCodeAt(n);if(o===58)break;if(!j2(o))return!1;n++}if(e.charCodeAt(n)!==58)return!1;if(n++,e.charCodeAt(n)===47&&e.charCodeAt(n+1)===47){n+=2;let o=n,i=-1;for(let a=n;a<t;a++){let c=e.charCodeAt(a);if(c===64){i=a;break}if(c===47||c===63||c===35)break}if(i!==-1){for(let a=o;a<i;a++){let c=e.charCodeAt(a);if(c===91||c===93)return!1;if(c===37){if(a+2>=i||!ju(e.charCodeAt(a+1))||!ju(e.charCodeAt(a+2)))return!1;a+=2}else if(!jf(c)&&!qf(c)&&c!==58)return!1}n=i+1}if(e.charCodeAt(n)===91){for(n++;n<t&&e.charCodeAt(n)!==93;)n++;if(e.charCodeAt(n)!==93)return!1;n++}else for(;n<t;){let a=e.charCodeAt(n);if(a===47||a===63||a===35||a===58)break;if(a<128&&!jf(a)&&!qf(a))return!1;n++}if(e.charCodeAt(n)===58)for(n++;n<t;){let a=e.charCodeAt(n);if(a===47||a===63||a===35)break;if(a<48||a>57)return!1;n++}}for(;n<t;){let o=e.charCodeAt(n);if(o===37){if(n+2>=t||!ju(e.charCodeAt(n+1))||!ju(e.charCodeAt(n+2)))return!1;n+=2}else{if(o>127)return!1;if(!(q2(o)||o===47||o===63||o===35))return!1}n++}return!0}var F2=/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu;function Fu(e){return F2.test(e)}var B2=/^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;function Bu(e){return B2.test(e)}var Oe=new Map;function bC(){Oe.clear()}function H2(){return[...Oe.entries()]}function K2(e,t){Oe.set(e,t)}function z2(e){return Oe.has(e)}function Y2(e){return Oe.get(e)}function V2(e,t){return Oe.get(e)?.(t)??!0}function SC(){bC(),Oe.set("date-time",Su),Oe.set("date",Oi),Oe.set("duration",Au),Oe.set("email",Ou),Oe.set("hostname",Ru),Oe.set("idn-email",Cu),Oe.set("idn-hostname",Pu),Oe.set("ipv4",Uu),Oe.set("ipv6",wu),Oe.set("iri-reference",vu),Oe.set("iri",Nu),Oe.set("json-pointer-uri-fragment",Lu),Oe.set("json-pointer",ku),Oe.set("regex",Mu),Oe.set("relative-json-pointer",Du),Oe.set("time",xi),Oe.set("uri-reference",Gu),Oe.set("uri-template",$u),Oe.set("uri",qu),Oe.set("url",Fu),Oe.set("uuid",Bu)}SC();function Ff(e,t,n,o){return Ri.Test(n.format,o)}function AC(e,t,n,o,i,a){return Ff(e,t,i,a)||t.AddError({keyword:"format",schemaPath:n,instancePath:o,params:{format:i.format}})}function OC(e,t,n,o){let i=Rf(n)?n.then:!0,a=mf(n)?n.else:!0;return ne(e,t,n.if,o)?ne(e,t,i,o):ne(e,t,a,o)}function xC(e,t,n,o,i,a){let c=Rf(i)?i.then:!0,l=mf(i)?i.else:!0,m=new st,f=Ie(e,m,`${n}/if`,o,i.if,a)?Ie(e,m,`${n}/then`,o,c,a)||t.AddError({keyword:"if",schemaPath:n,instancePath:o,params:{failingKeyword:"then"}}):Ie(e,t,`${n}/else`,o,l,a)||t.AddError({keyword:"if",schemaPath:n,instancePath:o,params:{failingKeyword:"else"}});return f&&t.Merge([m]),f}function Q2(e,t,n,o){return s.Every(n.items,0,(i,a)=>s.IsLessEqualThan(o.length,a)||Kt(e,t,i,o[a])&&t.AddIndex(a))}function W2(e,t,n,o,i,a){return s.EveryAll(i.items,0,(c,l)=>{let m=`${n}/items/${l}`,f=`${o}/${l}`;return s.IsLessEqualThan(a.length,l)||zt(e,t,m,f,c,a[l])&&t.AddIndex(l)})}function Z2(e,t,n,o){let i=bi(n)?n.prefixItems.length:0;return s.Every(o,i,(a,c)=>Kt(e,t,n.items,a)&&t.AddIndex(c))}function X2(e,t,n,o,i,a){let c=bi(i)?i.prefixItems.length:0;return s.EveryAll(a,c,(l,m)=>{let f=`${n}/items`,h=`${o}/${m}`;return zt(e,t,f,h,i.items,l)&&t.AddIndex(m)})}function RC(e,t,n,o){return hf(n)?Q2(e,t,n,o):Z2(e,t,n,o)}function CC(e,t,n,o,i,a){return hf(i)?W2(e,t,n,o,i,a):X2(e,t,n,o,i,a)}function J2(e){return lo(e)}function Bf(e,t,n,o){if(!J2(n))return!0;let i=s.Counted(o,a=>ne(e,t,n.contains,a));return s.IsLessEqualThan(i,n.maxContains)}function PC(e,t,n,o,i,a){let c=mo(i)?i.minContains:1;return Bf(e,t,i,a)||t.AddError({keyword:"contains",schemaPath:n,instancePath:o,params:{minContains:c,maxContains:i.maxContains}})}function Hf(e,t,n,o){return s.IsLessEqualThan(o,n.maximum)}function UC(e,t,n,o,i,a){return Hf(e,t,i,a)||t.AddError({keyword:"maximum",schemaPath:n,instancePath:o,params:{comparison:"<=",limit:i.maximum}})}function Kf(e,t,n,o){return s.IsLessEqualThan(o.length,n.maxItems)}function wC(e,t,n,o,i,a){return Kf(e,t,i,a)||t.AddError({keyword:"maxItems",schemaPath:n,instancePath:o,params:{limit:i.maxItems}})}function zf(e,t,n,o){return s.IsMaxLength(o,n.maxLength)}function vC(e,t,n,o,i,a){return zf(e,t,i,a)||t.AddError({keyword:"maxLength",schemaPath:n,instancePath:o,params:{limit:i.maxLength}})}function Yf(e,t,n,o){return s.IsLessEqualThan(s.Keys(o).length,n.maxProperties)}function NC(e,t,n,o,i,a){return Yf(e,t,i,a)||t.AddError({keyword:"maxProperties",schemaPath:n,instancePath:o,params:{limit:i.maxProperties}})}function eK(e){return lo(e)}function Vf(e,t,n,o){if(!eK(n))return!0;let i=s.Counted(o,(a,c)=>ne(e,t,n.contains,a)&&t.AddIndex(c));return s.IsGreaterEqualThan(i,n.minContains)}function LC(e,t,n,o,i,a){return Vf(e,t,i,a)||t.AddError({keyword:"contains",schemaPath:n,instancePath:o,params:{minContains:i.minContains}})}function Qf(e,t,n,o){return s.IsGreaterEqualThan(o,n.minimum)}function kC(e,t,n,o,i,a){return Qf(e,t,i,a)||t.AddError({keyword:"minimum",schemaPath:n,instancePath:o,params:{comparison:">=",limit:i.minimum}})}function Wf(e,t,n,o){return s.IsGreaterEqualThan(o.length,n.minItems)}function MC(e,t,n,o,i,a){return Wf(e,t,i,a)||t.AddError({keyword:"minItems",schemaPath:n,instancePath:o,params:{limit:i.minItems}})}function Zf(e,t,n,o){return s.IsMinLength(o,n.minLength)}function DC(e,t,n,o,i,a){return Zf(e,t,i,a)||t.AddError({keyword:"minLength",schemaPath:n,instancePath:o,params:{limit:i.minLength}})}function Xf(e,t,n,o){return s.IsGreaterEqualThan(s.Keys(o).length,n.minProperties)}function GC(e,t,n,o,i,a){return Xf(e,t,i,a)||t.AddError({keyword:"minProperties",schemaPath:n,instancePath:o,params:{limit:i.minProperties}})}function Jf(e,t,n,o){return s.IsMultipleOf(o,n.multipleOf)}function $C(e,t,n,o,i,a){return Jf(e,t,i,a)||t.AddError({keyword:"multipleOf",schemaPath:n,instancePath:o,params:{multipleOf:i.multipleOf}})}function eg(e,t,n,o){let i=new xt;return!ne(e,i,n.not,o)&&t.Merge([i])}function jC(e,t,n,o,i,a){return eg(e,t,i,a)||t.AddError({keyword:"not",schemaPath:n,instancePath:o,params:{}})}function qC(e,t,n,o){let i=n.oneOf.reduce((a,c)=>{let l=new xt;return ne(e,l,c,o)?[...a,l]:a},[]);return s.IsEqual(i.length,1)&&t.Merge(i)}function FC(e,t,n,o,i,a){let c=[],l=[],m=i.oneOf.reduce((h,E,I)=>{let g=new st,T=`${n}/oneOf/${I}`,S=Ie(e,g,T,o,E,a);return S&&l.push(I),S||c.push(g),S?[...h,g]:h},[]),f=s.IsEqual(m.length,1)&&t.Merge(m);return!f&&s.IsEqual(l.length,0)&&c.forEach(h=>h.GetErrors().forEach(E=>t.AddError(E))),f||t.AddError({keyword:"oneOf",schemaPath:n,instancePath:o,params:{passingSchemas:l}})}function tg(e,t,n,o){return(s.IsString(n.pattern)?new RegExp(n.pattern,"u"):n.pattern).test(o)}function BC(e,t,n,o,i,a){return tg(e,t,i,a)||t.AddError({keyword:"pattern",schemaPath:n,instancePath:o,params:{pattern:i.pattern}})}function HC(e,t,n,o){return s.Every(s.Entries(n.patternProperties),0,([i,a])=>{let c=new RegExp(i,"u");return s.Every(s.Entries(o),0,([l,m])=>!c.test(l)||Kt(e,t,a,m)&&t.AddKey(l))})}function KC(e,t,n,o,i,a){return s.EveryAll(s.Entries(i.patternProperties),0,([c,l])=>{let m=`${n}/patternProperties/${c}`,f=new RegExp(c,"u");return s.EveryAll(s.Entries(a),0,([h,E])=>{let I=`${o}/${h}`;return!f.test(h)||zt(e,t,m,I,l,E)&&t.AddKey(h)})})}function zC(e,t,n,o){return s.IsEqual(o.length,0)||s.Every(n.prefixItems,0,(i,a)=>s.IsLessEqualThan(o.length,a)||Kt(e,t,i,o[a])&&t.AddIndex(a))}function YC(e,t,n,o,i,a){return s.IsEqual(a.length,0)||s.EveryAll(i.prefixItems,0,(c,l)=>{let m=`${n}/prefixItems/${l}`,f=`${o}/${l}`;return s.IsLessEqualThan(a.length,l)||zt(e,t,m,f,c,a[l])&&t.AddIndex(l)})}function rg(e,t){return e.includes(t)||rt.Get().exactOptionalPropertyTypes}function ng(e,t){return s.IsUndefined(e[t])}function VC(e,t,n,o){let i=fo(n)?n.required:[];return s.Every(s.Entries(n.properties),0,([c,l])=>{let m=!s.HasPropertyKey(o,c)||Kt(e,t,l,o[c])&&t.AddKey(c);return rg(i,c)?m:ng(o,c)||m})}function QC(e,t,n,o,i,a){let c=fo(i)?i.required:[];return s.EveryAll(s.Entries(i.properties),0,([m,f])=>{let h=`${n}/properties/${m}`,E=`${o}/${m}`,I=()=>!s.HasPropertyKey(a,m)||zt(e,t,h,E,f,a[m])&&t.AddKey(m);return rg(c,m)?I():ng(a,m)||I()})}function WC(e,t,n,o){return s.Every(s.Keys(o),0,(i,a)=>ne(e,t,n.propertyNames,i))}function ZC(e,t,n,o,i,a){let c=[];return s.EveryAll(s.Keys(a),0,(m,f)=>{let h=`${o}/${m}`,E=`${n}/propertyNames`,I=new st,g=Ie(e,I,E,h,i.propertyNames,m);return g||c.push(m),g})||t.AddError({keyword:"propertyNames",schemaPath:n,instancePath:o,params:{propertyNames:c}})}function XC(e,t,n,o){let i=e.RecursiveRef(n)??!1;return q(i)&&ne(e,t,i,o)}function JC(e,t,n,o,i,a){let c=e.RecursiveRef(i)??!1;return q(c)&&Ie(e,t,"#",o,c,a)}function eP(e,t,n,o){let i=e.Ref(n)??!1,a=new xt,c=q(i)&&ne(e,a,i,o);return c&&t.Merge([a]),c}function tP(e,t,n,o,i,a){let c=e.Ref(i)??!1,l=new st,m=q(c)&&Ie(e,l,"#",o,c,a);return m&&t.Merge([l]),m||l.GetErrors().forEach(f=>t.AddError(f)),m}function rP(e,t,n,o){return s.Every(n.required,0,i=>s.HasPropertyKey(o,i))}function nP(e,t,n,o,i,a){let c=[];return s.EveryAll(i.required,0,m=>{let f=s.HasPropertyKey(a,m);return f||c.push(m),f})||t.AddError({keyword:"required",schemaPath:n,instancePath:o,params:{requiredProperties:c}})}function og(e,t,n,o,i){return s.IsEqual(n,"object")?s.IsObjectNotArray(i):s.IsEqual(n,"array")?s.IsArray(i):s.IsEqual(n,"boolean")?s.IsBoolean(i):s.IsEqual(n,"integer")?s.IsInteger(i):s.IsEqual(n,"number")?s.IsNumber(i):s.IsEqual(n,"null")?s.IsNull(i):s.IsEqual(n,"string")?s.IsString(i):s.IsEqual(n,"bigint")?s.IsBigInt(i):s.IsEqual(n,"constructor")?s.IsConstructor(i):s.IsEqual(n,"function")?s.IsFunction(i):s.IsEqual(n,"symbol")?s.IsSymbol(i):s.IsEqual(n,"undefined")?s.IsUndefined(i):s.IsEqual(n,"void")?s.IsUndefined(i):!0}function oP(e,t,n,o,i){return s.Some(n,a=>og(e,t,a,o,i))}function iP(e,t,n,o){return s.IsArray(n.type)?oP(e,t,n.type,n,o):og(e,t,n.type,n,o)}function aP(e,t,n,o,i,a){return(s.IsArray(i.type)?oP(e,t,i.type,i,a):og(e,t,i.type,i,a))||t.AddError({keyword:"type",schemaPath:n,instancePath:o,params:{type:i.type}})}function sP(e,t,n,o){let i=t.GetIndices();return s.Every(o,0,(a,c)=>(i.has(c)||ne(e,t,n.unevaluatedItems,a))&&t.AddIndex(c))}function cP(e,t,n,o,i,a){let c=t.GetIndices(),l=[];return s.EveryAll(a,0,(f,h)=>{let E=new st,I=(c.has(h)||Ie(e,E,n,o,i.unevaluatedItems,f))&&t.AddIndex(h);return I||l.push(h),I})||t.AddError({keyword:"unevaluatedItems",schemaPath:n,instancePath:o,params:{unevaluatedItems:l}})}function pP(e,t,n,o){let i=t.GetKeys();return s.Every(s.Entries(o),0,([a,c])=>i.has(a)||ne(e,t,n.unevaluatedProperties,c)&&t.AddKey(a))}function uP(e,t,n,o,i,a){let c=t.GetKeys(),l=[];return s.EveryAll(s.Entries(a),0,([f,h])=>{let E=new st,I=c.has(f)||Ie(e,E,n,o,i.unevaluatedProperties,h)&&t.AddKey(f);return I||l.push(f),I})||t.AddError({keyword:"unevaluatedProperties",schemaPath:n,instancePath:o,params:{unevaluatedProperties:l}})}function lP(e){return!s.IsEqual(e.uniqueItems,!1)}function mP(e,t,n,o){if(!lP(n))return!0;let i=new Set(o.map(Bn.Hash)).size,a=o.length;return s.IsEqual(i,a)}function dP(e,t,n,o,i,a){if(!lP(i))return!0;let c=new Set,l=a.reduce((f,h,E)=>{let I=Bn.Hash(h);return c.has(I)?[...f,E]:(c.add(I),f)},[]);return s.IsEqual(l.length,0)||t.AddError({keyword:"uniqueItems",schemaPath:n,instancePath:o,params:{duplicateItems:l}})}function Kt(e,t,n,o){return t.Push()&&ne(e,t,n,o)&&t.Pop()}function ne(e,t,n,o){e.Push(n);let i=Tu(n)?Uf(e,t,n,o):(!Cf(n)||iP(e,t,n,o))&&(!(s.IsObject(o)&&!s.IsArray(o))||(!fo(n)||rP(e,t,n,o))&&(!Hr(n)||zR(e,t,n,o))&&(!cf(n)||tC(e,t,n,o))&&(!pf(n)||nC(e,t,n,o))&&(!uf(n)||iC(e,t,n,o))&&(!fs(n)||HC(e,t,n,o))&&(!gs(n)||VC(e,t,n,o))&&(!Af(n)||WC(e,t,n,o))&&(!ms(n)||Xf(e,t,n,o))&&(!_f(n)||Yf(e,t,n,o)))&&(!s.IsArray(o)||(!nf(n)||BR(e,t,n,o))&&(!lo(n)||vf(e,t,n,o))&&(!_i(n)||RC(e,t,n,o))&&(!Tf(n)||Bf(e,t,n,o))&&(!Eu(n)||Kf(e,t,n,o))&&(!mo(n)||Vf(e,t,n,o))&&(!Ii(n)||Wf(e,t,n,o))&&(!bi(n)||zC(e,t,n,o))&&(!Si(n)||mP(e,t,n,o)))&&(!s.IsString(o)||(!Ef(n)||zf(e,t,n,o))&&(!ls(n)||Zf(e,t,n,o))&&(!us(n)||Ff(e,t,n,o))&&(!ds(n)||tg(e,t,n,o)))&&(!(s.IsNumber(o)||s.IsBigInt(o))||(!ff(n)||Mf(e,t,n,o))&&(!Kr(n)||Df(e,t,n,o))&&(!yf(n)||Hf(e,t,n,o))&&(!Yr(n)||Qf(e,t,n,o))&&(!If(n)||Jf(e,t,n,o)))&&(!xf(n)||eP(e,t,n,o))&&(!Of(n)||XC(e,t,n,o))&&(!lf(n)||sC(e,t,n,o))&&(!sf(n)||wf(e,t,n,o))&&(!df(n)||kf(e,t,n,o))&&(!gf(n)||OC(e,t,n,o))&&(!bf(n)||eg(e,t,n,o))&&(!of(n)||VR(e,t,n,o))&&(!af(n)||WR(e,t,n,o))&&(!Sf(n)||qC(e,t,n,o))&&(!Iu(n)||!s.IsArray(o)||sP(e,t,n,o))&&(!bu(n)||!s.IsObject(o)||pP(e,t,n,o))&&(!rf(n)||jR(e,t,n,o));return e.Pop(n),i}function zt(e,t,n,o,i,a){return t.Push()&&Ie(e,t,n,o,i,a)&&t.Pop()}function Ie(e,t,n,o,i,a){e.Push(i);let c=Tu(i)?XR(e,t,n,o,i,a):!!(+(!Cf(i)||aP(e,t,n,o,i,a))&+(!(s.IsObject(a)&&!s.IsArray(a))||!!(+(!fo(i)||nP(e,t,n,o,i,a))&+(!Hr(i)||YR(e,t,n,o,i,a))&+(!cf(i)||rC(e,t,n,o,i,a))&+(!pf(i)||oC(e,t,n,o,i,a))&+(!uf(i)||aC(e,t,n,o,i,a))&+(!fs(i)||KC(e,t,n,o,i,a))&+(!gs(i)||QC(e,t,n,o,i,a))&+(!Af(i)||ZC(e,t,n,o,i,a))&+(!ms(i)||GC(e,t,n,o,i,a))&+(!_f(i)||NC(e,t,n,o,i,a))))&+(!s.IsArray(a)||!!(+(!nf(i)||HR(e,t,n,o,i,a))&+(!lo(i)||eC(e,t,n,o,i,a))&+(!_i(i)||CC(e,t,n,o,i,a))&+(!Tf(i)||PC(e,t,n,o,i,a))&+(!Eu(i)||wC(e,t,n,o,i,a))&+(!mo(i)||LC(e,t,n,o,i,a))&+(!Ii(i)||MC(e,t,n,o,i,a))&+(!bi(i)||YC(e,t,n,o,i,a))&+(!Si(i)||dP(e,t,n,o,i,a))))&+(!s.IsString(a)||!!(+(!Ef(i)||vC(e,t,n,o,i,a))&+(!ls(i)||DC(e,t,n,o,i,a))&+(!us(i)||AC(e,t,n,o,i,a))&+(!ds(i)||BC(e,t,n,o,i,a))))&+(!(s.IsNumber(a)||s.IsBigInt(a))||!!(+(!ff(i)||uC(e,t,n,o,i,a))&+(!Kr(i)||lC(e,t,n,o,i,a))&+(!yf(i)||UC(e,t,n,o,i,a))&+(!Yr(i)||kC(e,t,n,o,i,a))&+(!If(i)||$C(e,t,n,o,i,a))))&+(!xf(i)||tP(e,t,n,o,i,a))&+(!Of(i)||JC(e,t,n,o,i,a))&+(!lf(i)||cC(e,t,n,o,i,a))&+(!sf(i)||JR(e,t,n,o,i,a))&+(!df(i)||pC(e,t,n,o,i,a))&+(!gf(i)||xC(e,t,n,o,i,a))&+(!bf(i)||jC(e,t,n,o,i,a))&+(!of(i)||QR(e,t,n,o,i,a))&+(!af(i)||ZR(e,t,n,o,i,a))&+(!Sf(i)||FC(e,t,n,o,i,a))&+(!Iu(i)||!s.IsArray(a)||cP(e,t,n,o,i,a))&+(!bu(i)||!s.IsObject(a)||uP(e,t,n,o,i,a)))&&(!rf(i)||qR(e,t,n,o,i,a));return e.Pop(i),c}var On={};Yt(On,{DynamicRef:()=>gK,Ref:()=>ag});var Ci={};Yt(Ci,{Delete:()=>cK,Get:()=>aK,Has:()=>iK,Indices:()=>Es,Set:()=>sK});function fP(e){if(e.length===0)throw Error("Cannot set root")}function gP(e){if(!s.IsObject(e))throw Error("Cannot set value")}function tK(e){if(s.IsUnsafePropertyKey(e))throw Error("Pointer contains unsafe property key")}function hP(e){for(let t of e)tK(t)}function rK(e){return/^(0|[1-9]\d*)$/.test(e)}function yP(e){return[e.slice(0,e.length-1),e.slice(e.length-1)[0]]}function nK(e,t){return s.IsObject(t)&&s.HasPropertyKey(t,e)}function oK(e,t){return s.IsObject(t)&&!s.IsUnsafePropertyKey(e)?t[e]:void 0}function ig(e,t){return e.reduce((n,o)=>oK(o,n),t)}function Es(e){if(s.IsEqual(e.length,0))return[];let t=e.split("/").map(n=>n.replace(/~1/g,"/").replace(/~0/g,"~"));return t.length>0&&t[0]===""?t.slice(1):t}function iK(e,t){let n=e;return Es(t).every(o=>nK(o,n)?(n=n[o],!0):!1)}function aK(e,t){let n=Es(t);return ig(n,e)}function sK(e,t,n){let o=Es(t);fP(o),hP(o);let[i,a]=yP(o),c=ig(i,e);return gP(c),c[a]=n,e}function cK(e,t){let n=Es(t);fP(n),hP(n);let[o,i]=yP(n),a=ig(o,e);return gP(a),s.IsArray(a)&&rK(i)?a.splice(+i,1):delete a[i],e}function pK(e,t,n){if(e.$id===n.hash)return e;let o=new URL(e.$id,t.href),i=new URL(n.href,t.href);if(s.IsEqual(o.pathname,i.pathname))return n.hash.startsWith("#")?TP(e,t,n):e}function uK(e,t,n){let o=new URL(`#${e.$anchor}`,t.href),i=new URL(n.href,t.href);return s.IsEqual(o.href,i.href)?e:void 0}function lK(e,t,n){let o=new URL(`#${e.$dynamicAnchor}`,t.href),i=new URL(n.href,t.href);return s.IsEqual(o.href,i.href)?e:void 0}function TP(e,t,n){if(n.href.endsWith("#"))return e;if(!n.hash.startsWith("#"))return;let o=decodeURIComponent(n.hash.slice(1));if(o.startsWith("/"))return Ci.Get(e,o)}function mK(e,t,n){if(zr(e)){let o=pK(e,t,n);if(!s.IsUndefined(o))return o}if(ps(e)){let o=uK(e,t,n);if(!s.IsUndefined(o))return o}if(An(e)){let o=lK(e,t,n);if(!s.IsUndefined(o))return o}return TP(e,t,n)}function dK(e,t,n){return e.reduce((o,i)=>{let a=sg(i,t,n);return s.IsUndefined(a)?o:a},void 0)}function fK(e,t,n){return s.Keys(e).reduce((o,i)=>{let a=sg(e[i],t,n);return s.IsUndefined(a)?o:a},void 0)}function sg(e,t,n){let o=ir(e)&&zr(e)?new URL(e.$id,t.href):t;if(ir(e)){let i=mK(e,o,n);if(!s.IsUndefined(i))return i}if(s.IsArray(e))return dK(e,o,n);if(s.IsObject(e))return fK(e,o,n)}function ag(e,t){let n=new URL("http://unknown/"),o=zr(e)?new URL(e.$id,n.href):n,i=new URL(t,o.href);return sg(e,o,i)}function gK(e,t,n,o){let i=n.$dynamicRef.startsWith("#")?ag(t,n.$dynamicRef):ag(e,n.$dynamicRef);return s.IsUndefined(i)?void 0:!ir(i)||!An(i)||new URL(n.$dynamicRef,"http://unknown/").hash.startsWith("#/")?i:o.find(l=>l.$dynamicAnchor===i.$dynamicAnchor)??i}var Pi=function(e,t,n,o){if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?o:n==="a"?o.call(e):o?o.value:t.get(e)},xn,EP,_P,IP,bP,ho=class{constructor(t,n){xn.add(this),this.context=t,this.schema=n,this.ids=[],this.anchors=[],this.recursiveAnchors=[],this.dynamicAnchors=[]}BaseURL(){return this.ids.reduce((t,n)=>new URL(n.$id,t),new URL("http://unknown"))}Base(){return this.ids[this.ids.length-1]??this.schema}Push(t){ir(t)&&(zr(t)&&(this.ids.push(t),Pi(this,xn,"m",EP).call(this,t)),ps(t)&&this.anchors.push(t),_u(t)&&this.recursiveAnchors.push(t),An(t)&&this.dynamicAnchors.push(t))}Pop(t){ir(t)&&(zr(t)&&(this.ids.pop(),Pi(this,xn,"m",_P).call(this,t)),ps(t)&&this.anchors.pop(),_u(t)&&this.recursiveAnchors.pop(),An(t)&&this.dynamicAnchors.pop())}Ref(t){return Pi(this,xn,"m",IP).call(this,t)??Pi(this,xn,"m",bP).call(this,t)}RecursiveRef(t){return _u(this.Base())?On.Ref(this.recursiveAnchors[0],t.$recursiveRef):On.Ref(this.Base(),t.$recursiveRef)}DynamicRef(t){let n=this.schema;return On.DynamicRef(n,this.Base(),t,this.dynamicAnchors)}};xn=new WeakSet,EP=function e(t,n=!0){if(!ir(t))return;let o=t;if(!(!n&&zr(o))){!n&&An(o)&&this.dynamicAnchors.push(o);for(let i of s.Keys(o))Pi(this,xn,"m",e).call(this,o[i],!1)}},_P=function e(t,n=!0){if(!ir(t))return;let o=t;if(!(!n&&zr(o))){!n&&An(o)&&this.dynamicAnchors.pop();for(let i of s.Keys(o))Pi(this,xn,"m",e).call(this,o[i],!1)}},IP=function(t){return s.HasPropertyKey(this.context,t.$ref)?this.context[t.$ref]:void 0},bP=function(t){let n=this.schema;return t.$ref.startsWith("#")?On.Ref(this.Base(),t.$ref):On.Ref(n,t.$ref)};function Hu(...e){let[t,n,o]=oe.Match(e,{3:(h,E,I)=>[h,E,I],2:(h,E)=>[{},h,E]}),i=rt.Get(),a=Xy(),c=[],l=new ho(t,n),m=new hs(h=>{if(!s.IsGreaterEqualThan(c.length,i.maxErrors))return c.push({...h,message:a(h)})});return[Ie(l,m,"#","",n,o),c]}function pg(...e){let[t,n,o]=oe.Match(e,{3:(c,l,m)=>[c,l,m],2:(c,l)=>[{},c,l]}),i=new ho(t,n),a=new xt;return ne(i,a,n,o)}function he(...e){let[t,n,o]=oe.Match(e,{3:(i,a,c)=>[i,a,c],2:(i,a)=>[{},i,a]});return pg(t,n,o)}function Rn(...e){let[t,n,o]=oe.Match(e,{3:(c,l,m)=>[c,l,m],2:(c,l)=>[{},c,l]}),[i,a]=Hu(t,n,o);return a}var Cn=class extends Error{constructor(t,n,o){super(t),Object.defineProperty(this,"cause",{value:{source:t,errors:o,value:n},writable:!1,configurable:!1,enumerable:!1})}};function SP(e,t,n){return s.IsArray(n)?n.map(o=>ct(e,t.items,o)):n}function AP(e,t,n){return ct({...e,...t.$defs},nt(t.$ref),n)}function TK(e,t){let n=s.HasPropertyKey(t,"unevaluatedProperties")?{additionalProperties:t.unevaluatedProperties}:{},o=Qt(e,t),i=ft(o);return D(i)?Np(i,n):i}function OP(e,t,n){let o=TK(e,t);return ct(e,o,n)}function Ku(e){return s.HasPropertyKey(e,"additionalProperties")?e.additionalProperties:void 0}function xP(e,t,n){if(!s.IsObject(n)||s.IsArray(n))return n;let o=Ku(t);for(let i of s.Keys(n)){if(s.HasPropertyKey(t.properties,i)){n[i]=ct(e,t.properties[i],n[i]);continue}if(s.IsBoolean(o)&&s.IsEqual(o,!0)||Ue(o)&&he(e,o,n[i])){n[i]=ct(e,o,n[i]);continue}delete n[i]}return n}function RP(e,t,n){if(!s.IsObject(n))return n;let o=Ku(t),[i,a]=[new RegExp(it(t)),Se(t)];for(let c of s.Keys(n)){if(i.test(c)){n[c]=ct(e,a,n[c]);continue}if(s.IsBoolean(o)&&s.IsEqual(o,!0)||Ue(o)&&he(e,o,n[c])){n[c]=ct(e,o,n[c]);continue}delete n[c]}return n}function CP(e,t,n){return s.HasPropertyKey(e,t.$ref)?ct(e,e[t.$ref],n):n}function PP(e,t,n){if(!s.IsArray(n))return n;let o=Math.min(n.length,t.items.length);for(let i=0;i<o;i++)n[i]=ct(e,t.items[i],n[i]);return s.IsGreaterThan(n.length,o)?n.slice(0,o):n}function $e(e){return jn(e)}function UP(e,t,n){for(let o of t.anyOf){let i=ct(e,o,$e(n));if(he(e,o,i))return i}return n}function ct(e,t,n){return Z(t)?SP(e,t,n):Te(t)?AP(e,t,n):M(t)?OP(e,t,n):D(t)?xP(e,t,n):de(t)?RP(e,t,n):ce(t)?CP(e,t,n):Y(t)?PP(e,t,n):R(t)?UP(e,t,n):n}function EK(e,t){for(let n of Cc.Keys(e))Cc.HasPropertyKey(t,n)||(t[n]=e[n]);return t}function _K(e){let t={};for(let n of Cc.Keys(e))t[n]=_s(e[n]);return t}function IK(e){return ug(FA(e))}function ug(e){return e.map(t=>_s(t))}function _s(e){let t=Z(e)?Pt(_s(e.items),wo(e)):M(e)?ut(ug(e.allOf)):R(e)?F(IK(e.anyOf)):D(e)?k(_K(e.properties)):de(e)?jo(un(e),_s(Se(e))):Y(e)?ke(ug(e.items)):e;return EK(e,t)}function Ui(e){return _s(e)}function Ar(...e){let[t,n,o]=oe.Match(e,{3:(a,c,l)=>[a,c,l],2:(a,c)=>[{},a,c]}),i=rt.Get().unionPrioritySort?Ui(n):n;return ct(t,i,o)}var ie={};Yt(ie,{Fail:()=>To,IsOk:()=>lg,Ok:()=>L,TryArray:()=>bK,TryBigInt:()=>mg,TryBoolean:()=>LK,TryNull:()=>$K,TryNumber:()=>BK,TryString:()=>HK,TryUndefined:()=>QK});function lg(e){return s.IsObject(e)&&s.HasPropertyKey(e,"value")}function L(e){return{value:e}}function To(){}function bK(e){return s.IsArray(e)?L(e):L([e])}function SK(e){return s.IsEqual(e,!0)?L(BigInt(1)):L(BigInt(0))}var AK=/^-?(0|[1-9]\d*)n$/,OK=/^-?(0|[1-9]\d*)\.\d+$/,xK=/^-?(0|[1-9]\d*)$/;function RK(e){return AK.test(e)}function CK(e){return OK.test(e)}function PK(e){return xK.test(e)}function UK(e){let t=e.toLowerCase();return RK(e)?L(BigInt(e.slice(0,e.length-1))):CK(e)?L(BigInt(e.split(".")[0])):PK(e)?L(BigInt(e)):s.IsEqual(t,"false")?L(BigInt(0)):s.IsEqual(t,"true")?L(BigInt(1)):void 0}function mg(e){return s.IsBigInt(e)?L(e):s.IsBoolean(e)?SK(e):s.IsNumber(e)?L(BigInt(Math.trunc(e))):s.IsNull(e)?L(BigInt(0)):s.IsString(e)?UK(e):s.IsUndefined(e)?L(BigInt(0)):void 0}function wK(e){return s.IsEqual(e,BigInt(0))?L(!1):s.IsEqual(e,BigInt(1))?L(!0):void 0}function vK(e){return s.IsEqual(e,0)?L(!1):s.IsEqual(e,1)?L(!0):void 0}function NK(e){return s.IsEqual(e.toLowerCase(),"false")?L(!1):s.IsEqual(e.toLowerCase(),"true")?L(!0):s.IsEqual(e,"0")?L(!1):s.IsEqual(e,"1")?L(!0):void 0}function LK(e){return s.IsBigInt(e)?wK(e):s.IsBoolean(e)?L(e):s.IsNumber(e)?vK(e):s.IsNull(e)?L(!1):s.IsString(e)?NK(e):s.IsUndefined(e)?L(!1):void 0}function kK(e){return s.IsEqual(e,BigInt(0))?L(null):void 0}function MK(e){return s.IsEqual(e,!1)?L(null):void 0}function DK(e){return s.IsEqual(e,0)?L(null):void 0}function GK(e){let t=e.toLowerCase();return s.IsEqual(t,"undefined")||s.IsEqual(t,"null")||s.IsEqual(e,"")||s.IsEqual(e,"0")?L(null):void 0}function $K(e){return s.IsBigInt(e)?kK(e):s.IsBoolean(e)?MK(e):s.IsNumber(e)?DK(e):s.IsNull(e)?L(null):s.IsString(e)?GK(e):s.IsUndefined(e)?L(null):void 0}var wP=BigInt(Number.MAX_SAFE_INTEGER),vP=BigInt(Number.MIN_SAFE_INTEGER);function jK(e){return e<=wP&&e>=vP?L(Number(e)):void 0}function qK(e){return L(e?1:0)}function FK(e){let t=+e;if(s.IsNumber(t))return L(t);let n=e.toLowerCase();if(s.IsEqual(n,"false"))return L(0);if(s.IsEqual(n,"true"))return L(1);let o=mg(e);return lg(o)?o.value<=wP&&o.value>=vP?L(Number(o.value)):void 0:void 0}function BK(e){return s.IsBigInt(e)?jK(e):s.IsBoolean(e)?qK(e):s.IsNumber(e)?L(e):s.IsNull(e)?L(0):s.IsString(e)?FK(e):s.IsUndefined(e)?L(0):void 0}function HK(e){return s.IsBigInt(e)?L(e.toString()):s.IsBoolean(e)?L(e.toString()):s.IsNumber(e)?L(e.toString()):s.IsNull(e)?L("null"):s.IsString(e)?L(e):s.IsUndefined(e)?L(""):void 0}function KK(e){return s.IsEqual(e,BigInt(0))?L(void 0):void 0}function zK(e){return s.IsEqual(e,!1)?L(void 0):void 0}function YK(e){return s.IsEqual(e,0)?L(void 0):void 0}function VK(e){let t=e.toLowerCase();return s.IsEqual(t,"undefined")||s.IsEqual(t,"null")||s.IsEqual(e,"")||s.IsEqual(e,"0")?L(void 0):void 0}function QK(e){return s.IsBigInt(e)?KK(e):s.IsBoolean(e)?zK(e):s.IsNumber(e)?YK(e):s.IsNull(e)?L(void 0):s.IsString(e)?VK(e):s.IsUndefined(e)?L(e):void 0}function NP(e,t,n){return ie.TryArray(n).value.map(i=>je(e,t.items,i))}function LP(e,t,n){let o=ie.TryBigInt(n);return ie.IsOk(o)?o.value:n}function kP(e,t,n){let o=ie.TryBoolean(n);return ie.IsOk(o)?o.value:n}function MP(e,t,n){return je({...e,...t.$defs},nt(t.$ref),n)}function DP(e,t,n){return je(e,ft(t),n)}function GP(e,t,n){let o=ie.TryNumber(n);return ie.IsOk(o)?Math.trunc(o.value):n}function $P(e,t,n){let o=Qt(e,t),i=ft(o);return je(e,i,n)}function WK(e,t,n){let o=ie.TryBigInt(n);return ie.IsOk(o)&&s.IsEqual(t.const,o.value)?o.value:n}function ZK(e,t,n){let o=ie.TryBoolean(n);return ie.IsOk(o)&&s.IsEqual(t.const,o.value)?o.value:n}function XK(e,t,n){let o=ie.TryNumber(n);return ie.IsOk(o)&&s.IsEqual(t.const,o.value)?o.value:n}function JK(e,t,n){let o=ie.TryString(n);return ie.IsOk(o)&&s.IsEqual(t.const,o.value)?o.value:n}function jP(e,t,n){return s.IsEqual(t.const,n)?n:sT(t)?WK(e,t,n):cT(t)?ZK(e,t,n):Dc(t)?XK(e,t,n):Gc(t)?JK(e,t,n):fe()}function qP(e,t,n){let o=ie.TryNull(n);return ie.IsOk(o)?o.value:n}function FP(e,t,n){let o=ie.TryNumber(n);return ie.IsOk(o)?o.value:n}function zu(e,t,n,o){let i=s.Keys(o);for(let[a,c]of t)for(let l of i)a.test(l)||(o[l]=je(e,n,o[l]));return o}function Is(e,t,n){return et(e)&&s.IsUndefined(n[t])}function ez(e,t,n){let o=s.EntriesRegExp(t.properties),i=s.Keys(n);for(let[a,c]of o)for(let l of i)!a.test(l)||Is(c,l,n)||(n[l]=je(e,c,n[l]));return s.HasPropertyKey(t,"additionalProperties")&&s.IsObject(t.additionalProperties)?zu(e,o,t.additionalProperties,n):n}function BP(e,t,n){return s.IsObjectNotArray(n)?ez(e,t,n):n}function tz(e,t,n){let o=s.EntriesRegExp(t.patternProperties),i=s.Keys(n);for(let[a,c]of o)for(let l of i)a.test(l)&&(n[l]=je(e,c,n[l]));return s.HasPropertyKey(t,"additionalProperties")&&s.IsObject(t.additionalProperties)?zu(e,o,t.additionalProperties,n):n}function HP(e,t,n){return s.IsObjectNotArray(n)?tz(e,t,n):n}function KP(e,t,n){return s.HasPropertyKey(e,t.$ref)?je(e,e[t.$ref],n):n}function zP(e,t,n){let o=ie.TryString(n);return ie.IsOk(o)?o.value:n}function YP(e,t,n){return je(e,ft(t),n)}function VP(e,t,n){if(!s.IsArray(n))return n;for(let o=0;o<Math.min(t.items.length,n.length);o++)n[o]=je(e,t.items[o],n[o]);return n}function QP(e,t,n){let o=ie.TryUndefined(n);return ie.IsOk(o)?o.value:n}function WP(e,t,n){if(t.anyOf.some(c=>he(e,c,n)))return n;let a=t.anyOf.map(c=>je(e,c,$e(n))).find(c=>he(e,t,c));return s.IsUndefined(a)?n:a}function ZP(e,t,n){let o=ie.TryUndefined(n);return ie.IsOk(o)?void 0:n}function je(e,t,n){return Z(t)?NP(e,t,n):vt(t)?LP(e,t,n):_t(t)?kP(e,t,n):Te(t)?MP(e,t,n):ze(t)?DP(e,t,n):ot(t)?GP(e,t,n):M(t)?$P(e,t,n):Q(t)?jP(e,t,n):gr(t)?qP(e,t,n):Ce(t)?FP(e,t,n):D(t)?BP(e,t,n):de(t)?HP(e,t,n):ce(t)?KP(e,t,n):We(t)?zP(e,t,n):Ee(t)?YP(e,t,n):Y(t)?VP(e,t,n):nr(t)?QP(e,t,n):R(t)?WP(e,t,n):kt(t)?ZP(e,t,n):n}function Pn(...e){let[t,n,o]=oe.Match(e,{3:(i,a,c)=>[i,a,c],2:(i,a)=>[{},i,a]});return je(t,n,o)}function XP(e,t,n){if(!s.IsArray(n))return n;for(let o=0;o<n.length;o++)n[o]=pt(e,t.items,n[o]);return n}function JP(e,t,n){return pt({...e,...t.$defs},nt(t.$ref),n)}function eU(e,t){return s.IsUndefined(t)?s.IsFunction(e.default)?e.default():$e(e.default):t}function tU(e,t,n){let o=Qt(e,t),i=ft(o);return pt(e,i,n)}function rU(e,t,n){if(!s.IsObject(n))return n;let o=s.Keys(t.properties);for(let i of o){let a=pt(e,t.properties[i],n[i]);s.IsUndefined(a)&&(et(t.properties[i])||!s.HasPropertyKey(t.properties[i],"default"))||(n[i]=a)}if(!Hr(t)||s.IsBoolean(t.additionalProperties))return n;for(let i of s.Keys(n))o.includes(i)||(n[i]=pt(e,t.additionalProperties,n[i]));return n}function nU(e,t,n){if(!s.IsObject(n))return n;let[o,i]=[new RegExp(it(t)),Se(t)];for(let a of s.Keys(n))o.test(a)&&Ht(i)&&(n[a]=pt(e,i,n[a]));if(!Hr(t))return n;for(let a of s.Keys(n))o.test(a)||(n[a]=pt(e,t.additionalProperties,n[a]));return n}function oU(e,t,n){return s.HasPropertyKey(e,t.$ref)?pt(e,e[t.$ref],n):n}function iU(e,t,n){if(!s.IsArray(n))return n;let[o,i]=[t.items,Math.max(t.items.length,n.length)];for(let a=0;a<i;a++)a<o.length&&(n[a]=pt(e,o[a],n[a]));return n}function aU(e,t,n){for(let o of t.anyOf){let i=pt(e,o,$e(n));if(he(e,o,i))return i}return n}function pt(e,t,n){let o=Ht(t)?eU(t,n):n;return Z(t)?XP(e,t,o):Te(t)?JP(e,t,o):M(t)?tU(e,t,o):D(t)?rU(e,t,o):de(t)?nU(e,t,o):ce(t)?oU(e,t,o):Y(t)?iU(e,t,o):R(t)?aU(e,t,o):o}function Eo(...e){let[t,n,o]=oe.Match(e,{3:(i,a,c)=>[i,a,c],2:(i,a)=>[{},i,a]});return pt(t,n,o)}function wi(e){return(...t)=>{let[n,o,i]=oe.Match(t,{3:(a,c,l)=>[a,c,l],2:(a,c)=>[{},a,c]});return e.reduce((a,c)=>c(n,o,a),i)}}function rz(e,t,n){return t["~codec"].decode(n)}function nz(e,t,n){return t["~codec"].encode(n)}function xe(e,t,n,o){return Hn(n)?s.IsEqual(e,"Decode")?rz(t,n,o):nz(t,n,o):o}function oz(e,t,n,o){if(!s.IsArray(o))return o;for(let i=0;i<o.length;i++)o[i]=Pe(e,t,n.items,o[i]);return xe(e,t,n,o)}function iz(e,t,n,o){let i=xe(e,t,n,o);if(!s.IsArray(i))return i;for(let a=0;a<i.length;a++)i[a]=Pe(e,t,n.items,i[a]);return i}function sU(e,t,n,o){return s.IsEqual(e,"Decode")?oz(e,t,n,o):iz(e,t,n,o)}function cU(e,t,n,o){return o=Pe(e,{...t,...n.$defs},nt(n.$ref),o),xe(e,t,n,o)}function pU(e){return e.reduce((t,n)=>({...t,...n}),{})}function uU(e,t){for(let n of t)if(!s.IsDeepEqual(e,n))return n;return e}function az(e,t,n,o){if(s.IsEqual(n.allOf.length,0))return xe(e,t,n,o);let i=n.allOf.map(l=>Pe(e,t,l,Ar(l,$e(o)))),c=i.every(l=>s.IsObject(l))?pU(i):uU(o,i);return xe(e,t,n,c)}function sz(e,t,n,o){if(s.IsEqual(n.allOf.length,0))return xe(e,t,n,o);let i=xe(e,t,n,o),a=n.allOf.map(l=>Pe(e,t,l,Ar(l,$e(i))));return a.every(l=>s.IsObject(l))?pU(a):uU(i,a)}function lU(e,t,n,o){return s.IsEqual(e,"Decode")?az(e,t,n,o):sz(e,t,n,o)}function cz(e,t,n,o){if(!s.IsObjectNotArray(o))return o;for(let i of s.Keys(n.properties))!s.HasPropertyKey(o,i)||Is(n.properties[i],i,o)||(o[i]=Pe(e,t,n.properties[i],o[i]));return xe(e,t,n,o)}function pz(e,t,n,o){let i=xe(e,t,n,o);if(!s.IsObjectNotArray(i))return i;for(let a of s.Keys(n.properties))!s.HasPropertyKey(i,a)||Is(n.properties[a],a,i)||(i[a]=Pe(e,t,n.properties[a],i[a]));return i}function mU(e,t,n,o){return s.IsEqual(e,"Decode")?cz(e,t,n,o):pz(e,t,n,o)}function uz(e,t,n,o){if(!s.IsObjectNotArray(o))return o;let i=new RegExp(it(n));for(let a of s.Keys(o))i.test(a)&&(o[a]=Pe(e,t,Se(n),o[a]));return xe(e,t,n,o)}function lz(e,t,n,o){let i=xe(e,t,n,o);if(!s.IsObjectNotArray(i))return i;let a=new RegExp(it(n));for(let c of s.Keys(i))a.test(c)&&(i[c]=Pe(e,t,Se(n),i[c]));return i}function dU(e,t,n,o){return s.IsEqual(e,"Decode")?uz(e,t,n,o):lz(e,t,n,o)}function fU(e,t,n,o){return s.HasPropertyKey(t,n.$ref)?Pe(e,t,t[n.$ref],o):o}function gU(e,t,n,o){return s.IsEqual(e,"Decode")?xe(e,t,n,fU(e,t,n,o)):fU(e,t,n,xe(e,t,n,o))}function mz(e,t,n,o){if(!s.IsArray(o))return o;for(let i=0;i<Math.min(n.items.length,o.length);i++)o[i]=Pe(e,t,n.items[i],o[i]);return xe(e,t,n,o)}function dz(e,t,n,o){let i=xe(e,t,n,o);if(!s.IsArray(i))return o;for(let a=0;a<Math.min(n.items.length,i.length);a++)i[a]=Pe(e,t,n.items[a],i[a]);return i}function hU(e,t,n,o){return s.IsEqual(e,"Decode")?mz(e,t,n,o):dz(e,t,n,o)}function fz(e,t,n,o){for(let i of n.anyOf){if(!he(t,i,o))continue;let a=Pe(e,t,i,o);return xe(e,t,n,a)}return o}function gz(e,t,n,o){let i=xe(e,t,n,o);for(let a of n.anyOf){let c=Pe(e,t,a,$e(i));if(he(t,a,c))return c}return i}function yU(e,t,n,o){return s.IsEqual(e,"Decode")?fz(e,t,n,o):gz(e,t,n,o)}function Pe(e,t,n,o){return Z(n)?sU(e,t,n,o):Te(n)?cU(e,t,n,o):M(n)?lU(e,t,n,o):D(n)?mU(e,t,n,o):de(n)?dU(e,t,n,o):ce(n)?gU(e,t,n,o):Y(n)?hU(e,t,n,o):R(n)?yU(e,t,n,o):xe(e,t,n,o)}var dg=class extends Cn{constructor(t,n){super("Decode",t,n)}};function hz(e,t,n){if(!he(e,t,n))throw new dg(n,Rn(e,t,n));return n}function yz(e,t,n){let o=rt.Get().unionPrioritySort?Ui(t):t;return Pe("Decode",e,o,n)}var JYe=wi([(e,t,n)=>$e(n),(e,t,n)=>Eo(e,t,n),(e,t,n)=>Pn(e,t,n),(e,t,n)=>Ar(e,t,n),(e,t,n)=>hz(e,t,n),(e,t,n)=>yz(e,t,n)]);var fg=class extends Cn{constructor(t,n){super("Encode",t,n)}};function Tz(e,t,n){if(!he(e,t,n))throw new fg(n,Rn(e,t,n));return n}function Ez(e,t,n){let o=rt.Get().unionPrioritySort?Ui(t):t;return Pe("Encode",e,o,n)}var m9e=wi([(e,t,n)=>$e(n),(e,t,n)=>Ez(e,t,n),(e,t,n)=>Eo(e,t,n),(e,t,n)=>Pn(e,t,n),(e,t,n)=>Ar(e,t,n),(e,t,n)=>Tz(e,t,n)]);var Zt=class extends Error{constructor(t,n){super(n),this.type=t}};function TU(e,t){return s.IsFunction(t.default)?t.default(t):s.IsObject(t.default)?$e(t.default):t.default}function EU(e,t){if(Si(t)&&!Ht(t))throw new Zt(t,"Arrays with uniqueItems constraints must specify a default annotation");let n=Ii(t)?t.minItems:0;return Array.from({length:n},()=>qe(e,t.items))}function _U(e,t){return Kr(t)?BigInt(t.exclusiveMinimum)+BigInt(1):Yr(t)?BigInt(t.minimum):BigInt(0)}function IU(e,t){return!1}function bU(e,t){let n=qe(e,t.instanceType);return class{constructor(){Object.assign(this,n)}}}function SU(e,t){return qe({...e,...t.$defs},nt(t.$ref))}function AU(e,t){return qe(e,ft(t))}function OU(e,t){let n=qe(e,t.returnType);return()=>n}function xU(e,t){return Kr(t)&&s.IsNumber(t.exclusiveMinimum)?t.exclusiveMinimum+1:Yr(t)?t.minimum:0}function RU(e,t){let n=Qt(e,t),o=ft(n);return qe(e,o)}function CU(e,t){return t.const}function PU(e,t){throw new Zt(t,"Cannot create TNever types")}function UU(e,t){return null}function wU(e,t){return Kr(t)&&s.IsNumber(t.exclusiveMinimum)?t.exclusiveMinimum+1:Yr(t)?t.minimum:0}function vU(e,t){return(s.IsUndefined(t.required)?[]:t.required).reduce((o,i)=>({...o,[i]:qe(e,t.properties[i])}),{})}function NU(e,t){if(ms(t)&&!Ht(t))throw new Zt(t,"Record with the minProperties constraint must have a default annotation");return{}}function LU(e,t){return s.HasPropertyKey(e,t.$ref)?qe(e,e[t.$ref]):(()=>{throw new Zt(t,"Unable to deref Ref")})()}function kU(e,t){if((ds(t)||us(t))&&!Ht(t))throw Error("Strings with format or pattern constraints must specify default");let o=ls(t)?t.minLength:0;return"".padEnd(o)}function MU(e,t){return Symbol()}function DU(e,t){let n=Ea(t.pattern);if(We(n))throw new Zt(t,"Unable to create TemplateLiteral due to infinite type expansion");return qe(e,n)}function GU(e,t){return Array.from({length:t.minItems},(n,o)=>qe(e,t.items[o]))}function $U(e,t){if(s.IsEqual(t.anyOf.length,0))throw Error("Unable to create Union with no variants");return qe(e,t.anyOf[0])}function qe(e,t){return Ht(t)?TU(e,t):Z(t)?EU(e,t):vt(t)?_U(e,t):_t(t)?IU(e,t):Be(t)?bU(e,t):Te(t)?SU(e,t):ze(t)?AU(e,t):He(t)?OU(e,t):ot(t)?xU(e,t):M(t)?RU(e,t):Q(t)?CU(e,t):tr(t)?PU(e,t):gr(t)?UU(e,t):Ce(t)?wU(e,t):D(t)?vU(e,t):de(t)?NU(e,t):ce(t)?LU(e,t):We(t)?kU(e,t):hr(t)?MU(e,t):Ee(t)?DU(e,t):Y(t)?GU(e,t):nr(t)?void 0:R(t)?$U(e,t):kt(t)?void 0:void 0}function Or(...e){let[t,n]=oe.Match(e,{2:(o,i)=>[o,i],1:o=>[{},o]});return qe(t,n)}var gg=class extends Cn{constructor(t,n){super("Parse",t,n)}};function _z(e,t,n){if(!he(e,t,n))throw new gg(n,Rn(e,t,n));return n}var N6e=wi([(e,t,n)=>$e(n),(e,t,n)=>Eo(e,t,n),(e,t,n)=>Pn(e,t,n),(e,t,n)=>Ar(e,t,n),(e,t,n)=>_z(e,t,n)]);var bz=k({type:z("insert"),path:It(),value:Qe()}),Sz=Object({type:z("update"),path:It(),value:Qe()}),Az=k({type:z("delete"),path:It()}),j6e=F([bz,Sz,Az]);function vi(e){if(!e.body)throw new Error("This command does not accept a request body");let t=e.body;return t.examples?.length?t.examples[0]:Or(t)}function Wr(e,t,n,o,i){e.command(t).description(n).option("-f, --file <FILE_PATH>","Read body from file (use - for stdin)").option("-d, --data <JSON>","Inline JSON body").option("--generate-skeleton","Print a JSON skeleton for the request body and exit").action(async a=>{if(a.generateSkeleton){ee(vi(o));return}let c=Ei(a),l=await i()(o,{body:c});ee(l)})}function FU(e,t){let n=e.command("grok").description("Test and preview grok parsing rules");Wr(n,"parse","Parse sample log lines with grok rules and return the extracted fields",GR,t)}var BU=require("node:child_process"),HU=require("node:fs"),KU=require("node:os"),Qu=require("node:path");var _o=require("node:fs");function bs(e,t){let n=`${e}.tmp.${process.pid}`;(0,_o.writeFileSync)(n,t),(0,_o.renameSync)(n,e)}function Ss(e){try{return(0,_o.readFileSync)(e,"utf8")}catch(t){if(t.code==="ENOENT")return;throw t}}function As(e,t){if(t===void 0)return;let n=`${e}.bak.${new Date().toISOString().replaceAll(":","-")}`;return(0,_o.writeFileSync)(n,t),n}function Io(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var hg="tsuga-dev/agent-plugins",Yu="tsuga";function Vu(e,t){V(` $ ${e} ${t.join(" ")}`);try{(0,BU.execFileSync)(e,t,{stdio:["ignore","inherit","inherit"]})}catch(n){let o=n.status??1;throw new Error(`${e} ${t.join(" ")} exited ${o}`,{cause:n})}}function Rz(e,t){V("Claude Code \u2192 installing Tsuga plugin"),Vu("claude",["plugin","marketplace","add",hg]),Vu("claude",["plugin","install",`tsuga@${Yu}`]),t.autoUpdate&&Cz(e)}function Cz(e){let t=(0,Qu.join)(e,".claude","settings.json");V(`Claude Code \u2192 ${t} (autoUpdate)`),(0,HU.mkdirSync)((0,Qu.dirname)(t),{recursive:!0});let n=Ss(t),o=JSON.parse(n??"{}");if(!Io(o))throw new Error(`${t} must contain a JSON object`);let i=o.extraKnownMarketplaces??{};if(!Io(i))throw new Error(`${t} "extraKnownMarketplaces" must be a JSON object`);let a=i[Yu],c=Io(a)?a:{};o.extraKnownMarketplaces={...i,[Yu]:{source:{source:"github",repo:hg},...c,autoUpdate:!0}};let l=As(t,n);bs(t,`${JSON.stringify(o,null,2)}
|
|
141
|
+
`),V(l===void 0?" created":` patched (backup: ${l})`)}function Pz(){V("Codex \u2192 installing Tsuga plugin"),Vu("codex",["plugin","marketplace","add",hg]),Vu("codex",["plugin","add",`tsuga@${Yu}`])}function zU(e){let t=e.command("install").description("Install Tsuga plugins into local LLM CLIs").command("plugin").description("Install the Tsuga plugin into a specific LLM CLI");t.command("claude-code").description("Install the Tsuga plugin into Claude Code (requires the claude CLI in PATH)").option("--no-auto-update","Skip patching ~/.claude/settings.json with autoUpdate=true").action(n=>{Rz((0,KU.homedir)(),n),V("Restart your claude session to load the new plugins.")}),t.command("codex").description("Install the Tsuga plugin into Codex (requires the codex CLI in PATH)").action(()=>{Pz(),V("Restart your codex session to load the new plugins.")})}var Uz=10,wz=r.Object({key:u({allowEmpty:!1,description:"Telemetry attribute key to scope the ranking by: a service, environment, team, route, or other positive equality term in the population you want fields for. Use dot-path keys such as `context.service.name`."}),value:r.Optional(u({allowEmpty:!1,description:"Attribute value the scoped telemetry should match, when the scope is a specific service, environment, team, route, or other known value. When omitted, artifacts that reference the key match this entry at full weight regardless of value."})),valueMustMatch:r.Optional(r.Boolean({description:"When true, this entry is a hard filter rather than a weight: any widget or monitor that does not match it exactly (key = value) contributes no fields at all, instead of contributing at a reduced weight. Other widgets of the same dashboard still contribute if they match. Requires `value`."}))}),yg=r.Object({field:r.String({description:"Field name to use in queries. For `kind: attribute`, this is an attribute dot path. For `kind: metric`, this is either a metric name or a `metricName.context.attribute` path when the metric query used a metric attribute."}),kind:r.Enum(["attribute","metric"],{description:"Whether the field is a telemetry attribute or a metric name. `metric` appears only in the metrics bucket, for fields referenced as the aggregated field of a metrics-source query."}),inferredType:r.Enum(["numeric","categorical","unknown"],{description:"Value type inferred from how the field is used: `numeric` when aggregated with sum/average/percentile, referenced by numeric or range filters, or a metric name; `categorical` when only grouped by or matched with equality/text filters; `unknown` otherwise. Evidence-based \u2014 a numeric field used only in equality filters reads as categorical."}),score:r.Number({description:"Relative relevance score computed by Tsuga from how strongly readable dashboards and monitors use this field for the requested scope, discounted when the field is common across the whole organization. Higher values mean stronger evidence that the field is useful for this scope. Scores are intended for ranking, not for comparison across unrelated scopes."}),artifacts:r.Number({description:"Number of distinct readable dashboards and monitors that reference this field and match the requested scope. Tsuga counts an artifact once per field even if it uses the field in multiple widgets or queries."}),globalArtifacts:r.Number({description:"Number of organization-wide dashboards and monitors that reference this field, regardless of the requested scope or caller permissions. Tsuga uses this anonymous baseline to down-rank fields that are common everywhere."}),usage:r.Object({groupBy:r.Number({description:"Number of distinct readable matching artifacts that use this field as a group-by or split dimension."}),filter:r.Number({description:"Number of distinct readable matching artifacts that filter on this field in widget queries, monitor queries, or dashboard-wide filters."}),measure:r.Number({description:"Number of distinct readable matching artifacts that aggregate this field as `aggregate.field`."}),column:r.Number({description:"Number of distinct readable matching artifacts that pin this field as a list-widget column."})},{description:"Distinct-artifact counts by usage kind, explaining why the field ranked where it did; a dashboard referencing the field the same way in many widgets counts once for that usage kind."})}),Tg=r.Object({logs:r.Array(yg,{description:"Top log fields for the requested scope, ranked by score and mined from readable logs-sourced dashboards and monitors."}),traces:r.Array(yg,{description:"Top trace fields for the requested scope, ranked by score and mined from readable traces-sourced dashboards and monitors."}),metrics:r.Array(yg,{description:"Top metric names and metric-attribute fields for the requested scope, ranked by score and mined from readable metrics-sourced dashboards and monitors."}),dashboardsMatched:r.Number({description:"Number of dashboards that matched the requested scope and that the caller can read. Dashboards the caller cannot read are removed before field rankings are returned."}),monitorsMatched:r.Number({description:"Number of monitors that matched the requested scope and that the caller can read. Monitors the caller cannot read are removed before field rankings are returned."})}),Eg=r.Object({scope:r.Array(wz,{minItems:1,maxItems:Uz,description:"Scope entries that define the population to rank fields for, drawn from positive equality pairs in a TQL query, such as service and environment. Tsuga matches entries softly by default: an artifact's contribution is weighted by the fraction of entries it matches."})}),G8e=d({tags:["interesting-fields"],url:"/v0/interesting-fields",method:"POST",body:Eg,response:Tg});var vz=`/${"v1"}/interesting-fields`,Nz={scope:[{key:"context.service.name",value:"payments"},{key:"context.env",value:"prod",valueMustMatch:!0}]},Lz=r.Object(Eg.properties,{description:"The scope to rank fields for, as attribute key/value pairs such as a service name and an environment. Entries are matched softly by default: a widget contributes in proportion to how many entries it matches, so a broader scope returns a broader ranking. Set `valueMustMatch` on an entry to make it a hard filter instead: a widget that does not match it exactly contributes nothing, even when other entries match.",examples:[Nz]}),YU=d({url:vz,method:"POST",operationId:"getInterestingFields",tags:["public","interesting-fields"],body:Lz,response:Tg,description:"Ranks the telemetry fields most relevant to a scope, mined from how the org already uses them in dashboards and monitors, bucketed by logs, traces, and metrics. Use this before guessing a field or metric name: a field that many scope-matching dashboards group or filter on is the one an operator would reach for. Ranking is TF-IDF style, so a field used everywhere in the org scores below one that is distinctive to the scope. Dashboards and monitors the caller cannot read never contribute field names, only the anonymous frequency baseline. The operation requires public API read access to dashboards and monitors."});function VU(e,t){let n=e.command("interesting-fields").description("Discover the telemetry fields an org already uses for a scope");Wr(n,"list","Rank the log, trace and metric fields most relevant to a scope, mined from dashboards and monitors",YU,t)}var ar="/v0/kubernetes-explorer",kz="^[a-z0-9.-]+$",Mz="^[A-Za-z0-9._-]+$",QU=256,WU=r.Optional(u({allowEmpty:!1,description:"Tsuga cluster ID to target. Tsuga assigns it when a cluster is connected to the organization. Optional for single-cluster organizations and required for organizations with multiple clusters to scope the request to one cluster."}));var xr=e=>r.Optional(r.Array(u({allowEmpty:!1}),{description:e})),ZU={clusterId:WU,search:r.Optional(r.String({pattern:kz,minLength:1,maxLength:QU,description:"Substring matched against the resource name. Kubernetes names are lowercase RFC 1123, so only lowercase letters, digits, `.` and `-` are accepted; uppercase and other characters are rejected. Wildcard and other query-syntax characters are treated literally."}))},XU={clusterId:WU,search:r.Optional(r.String({pattern:Mz,minLength:1,maxLength:QU,description:"Substring matched against the Kubernetes cluster name. Unlike Kubernetes resource names this is a collector-assigned identifier, so uppercase letters, digits, `.`, `-` and `_` are accepted. Wildcard and other query-syntax characters are treated literally."}))},JU=r.Object(ZU),ew=r.Object(XU),Os={...ZU,includeInternalNamespaces:r.Optional(r.Boolean({description:"When false or omitted, resources in internal namespaces (kube-system, kube-public, kube-node-lease, local-path-storage, gke-managed-*) are excluded."})),clusters:xr("Restrict results to these Kubernetes cluster names."),namespaces:xr("Restrict results to these namespaces."),teams:xr("Restrict results to these team names."),envs:xr("Restrict results to these environments."),...ge},tw=["Pending","Running","Succeeded","Failed","Unknown","CrashLoopBackOff","Error"],Dz={...Os,nodes:xr("Restrict results to pods scheduled on these nodes."),deployments:xr("Restrict results to pods owned by these Deployments."),statefulsets:xr("Restrict results to pods owned by these StatefulSets."),daemonsets:xr("Restrict results to pods owned by these DaemonSets."),podStatus:r.Optional(r.Array(r.Enum(tw),{description:"Restrict results to pods whose resolved status matches any of these values. Includes the five Kubernetes phases plus Tsuga-derived CrashLoopBackOff and Error. Applied after stitching pod phase and container status reason telemetry, because phase is not a filterable metric attribute."}))},Ni=r.Enum(["asc","desc"],{description:"Sort direction. Defaults to ascending."}),Gz=["deployment","statefulset","daemonset"],rw=r.Object({kind:r.Enum(Gz,{description:"Kind of Kubernetes workload associated with the pod. Derived from workload attributes in pod telemetry."}),name:r.String({description:"Name of the workload associated with the pod. Derived from workload attributes in pod telemetry."})},{description:"Kubernetes workload controller that owns the pod. Present when workload attributes are observed in pod telemetry."}),nw=r.Object({podName:r.String({description:"Name of the Kubernetes pod. Set when the pod is created."}),namespace:r.Optional(r.String({description:"Kubernetes namespace that contains the pod. Present when namespace telemetry is observed."})),cluster:r.Optional(r.String({description:"Kubernetes cluster name that reported the pod. Present when cluster telemetry is observed."})),team:r.Optional(r.String({description:"Team metadata associated with the pod. Present when a team label or mapping is observed."})),env:r.Optional(r.String({description:"Environment metadata associated with the pod, such as production or staging. Present when an environment label or mapping is observed."})),node:r.Optional(r.String({description:"Kubernetes node currently or most recently running the pod. Present when node telemetry is observed."})),phase:r.Enum(tw,{description:"Current or most recently observed pod status. From pod status and container state telemetry. Values include the Kubernetes phases Pending, Running, Succeeded, Failed, and Unknown, plus Tsuga-derived CrashLoopBackOff and Error values."}),readyContainers:r.Integer({description:"Number of containers in the pod that are currently ready. From container readiness telemetry. Zero or greater."}),totalContainers:r.Integer({description:"Number of observed containers for the pod based on container readiness telemetry. Zero or greater."}),restarts:r.Integer({description:"Total restart count across containers in the pod. From container restart telemetry. Zero or greater."}),createdAt:r.Optional(A({description:"Timestamp from pod start time telemetry for the selected pod instance. Present when pod start time telemetry is observed."}))}),_g=r.Object({...nw.properties,workload:r.Optional(rw),cpuUsageMilli:r.Optional(r.Number({description:"Recent pod CPU usage in millicores. Present when CPU usage telemetry is observed."})),cpuLimitMilli:r.Optional(r.Number({description:"Configured pod CPU limit in millicores, summed across observed containers. Present when a CPU limit is configured and observed."})),cpuRequestMilli:r.Optional(r.Number({description:"Configured pod CPU request in millicores, summed across observed containers. Present when a CPU request is configured and observed."})),memoryUsageBytes:r.Optional(r.Number({description:"Recent pod memory usage in bytes. Present when memory usage telemetry is observed."})),memoryLimitBytes:r.Optional(r.Number({description:"Configured pod memory limit in bytes, summed across observed containers. Present when a memory limit is configured and observed."})),memoryRequestBytes:r.Optional(r.Number({description:"Configured pod memory request in bytes, summed across observed containers. Present when a memory request is configured and observed."})),cpuUtilization:r.Optional(r.Number({description:"Recent CPU usage divided by the configured CPU limit. Present when both usage and limit are observed."})),memoryUtilization:r.Optional(r.Number({description:"Recent memory usage divided by the configured memory limit. Present when both usage and limit are observed."})),cpuRequestUtilization:r.Optional(r.Number({description:"Recent CPU usage divided by the configured CPU request. Present when both usage and request are observed."})),memoryRequestUtilization:r.Optional(r.Number({description:"Recent memory usage divided by the configured memory request. Present when both usage and request are observed."}))}),$z=["podName","namespace","cluster","team","env","node","phase","restarts","cpuUsageMilli","cpuUtilization","cpuRequestUtilization","memoryUsageBytes","memoryUtilization","memoryRequestUtilization","createdAt"],Z8e=d({tags:["kubernetes-explorer"],method:"GET",url:`${ar}/pods`,query:r.Object({...Dz,sortBy:r.Optional(r.Enum($z,{description:"Field to sort pods by."})),sortDirection:r.Optional(Ni)}),paginated:!0,response:r.Array(_g)}),Ig=r.Object({cluster:r.String({description:"Kubernetes cluster name from cluster telemetry."}),teams:r.Optional(r.Array(r.String(),{description:"Team metadata values observed on pods in non-default Kubernetes namespaces on the cluster. Present when team labels or mappings are observed."})),envs:r.Optional(r.Array(r.String(),{description:"Environment metadata values observed on pods in non-default Kubernetes namespaces on the cluster. Present when environment labels or mappings are observed."})),cpuUsageMilli:r.Optional(r.Number({description:"Aggregate recent CPU usage for observed pods in the cluster, excluding default Kubernetes namespaces, in millicores. Present when CPU usage telemetry is observed."})),memoryUsageBytes:r.Optional(r.Number({description:"Aggregate recent memory usage for observed pods in the cluster, excluding default Kubernetes namespaces, in bytes. Present when memory usage telemetry is observed."})),readyNodes:r.Optional(r.Integer({description:"Number of Kubernetes nodes in the cluster that are ready. Present when node readiness telemetry is observed."})),podPhaseCounts:r.Optional(r.Object({Pending:r.Integer({description:"Number of observed pods currently in the Pending phase."}),Running:r.Integer({description:"Number of observed pods currently in the Running phase."}),Succeeded:r.Integer({description:"Number of observed pods currently in the Succeeded phase."}),Failed:r.Integer({description:"Number of observed pods currently in the Failed phase."}),Unknown:r.Integer({description:"Number of observed pods currently in the Unknown phase."})},{description:"Counts of observed pods by Kubernetes phase, excluding default Kubernetes namespaces. Present when pod phase telemetry is observed."}))}),jz=["cluster","teams","envs","cpuUsageMilli","memoryUsageBytes","readyNodes"],X8e=d({tags:["kubernetes-explorer"],method:"GET",url:`${ar}/clusters`,query:r.Object({...XU,teams:xr("Restrict to clusters that host workloads from these team names."),envs:xr("Restrict to clusters that host workloads in these environments."),sortBy:r.Optional(r.Enum(jz,{description:"Field to sort clusters by."})),sortDirection:r.Optional(Ni),...ge}),paginated:!0,response:r.Array(Ig)}),bg=r.Object({namespace:r.String({description:"Kubernetes namespace name from namespace telemetry. Includes namespaces with no observed pods when namespace telemetry is observed."}),cluster:r.Optional(r.String({description:"Kubernetes cluster name that contains the namespace. Present when cluster telemetry is observed."})),teams:r.Optional(r.Array(r.String(),{description:"Team metadata values observed in workloads in the namespace. Present when team labels or mappings are observed."})),envs:r.Optional(r.Array(r.String(),{description:"Environment metadata values observed in workloads in the namespace. Present when environment labels or mappings are observed."})),pods:r.Optional(r.Integer({description:"Number of observed pods in the namespace. Present when pod telemetry is observed."})),cpuUsageMilli:r.Optional(r.Number({description:"Aggregate recent CPU usage for observed pods in the namespace, in millicores. Present when CPU usage telemetry is observed."})),memoryUsageBytes:r.Optional(r.Number({description:"Aggregate recent memory usage for observed pods in the namespace, in bytes. Present when memory usage telemetry is observed."}))}),qz=["namespace","cluster","teams","envs","pods","cpuUsageMilli","memoryUsageBytes"],J8e=d({tags:["kubernetes-explorer"],method:"GET",url:`${ar}/namespaces`,query:r.Object({...Os,sortBy:r.Optional(r.Enum(qz,{description:"Field to sort namespaces by."})),sortDirection:r.Optional(Ni)}),paginated:!0,response:r.Array(bg)}),Sg=r.Object({deployment:r.String({description:"Kubernetes Deployment name from workload telemetry."}),namespace:r.Optional(r.String({description:"Kubernetes namespace that contains the Deployment. Present when namespace telemetry is observed."})),cluster:r.Optional(r.String({description:"Kubernetes cluster name that contains the Deployment. Present when cluster telemetry is observed."})),team:r.Optional(r.String({description:"Team metadata associated with the Deployment. Present when a team label or mapping is observed."})),env:r.Optional(r.String({description:"Environment metadata associated with the Deployment. Present when an environment label or mapping is observed."})),pods:r.Optional(r.Integer({description:"Number of observed pods associated with the Deployment. Present when pod telemetry and workload attributes are observed."})),availableReplicas:r.Optional(r.Integer({description:"Number of available Deployment replicas from Deployment status telemetry. Present when deployment status is observed."})),desiredReplicas:r.Optional(r.Integer({description:"Desired replica count configured for the Deployment. Present when Deployment spec telemetry is observed."})),cpuUsageMilli:r.Optional(r.Number({description:"Recent aggregate CPU usage for observed Deployment pods, in millicores. Present when CPU usage telemetry is observed."})),memoryUsageBytes:r.Optional(r.Number({description:"Recent aggregate memory usage for observed Deployment pods, in bytes. Present when memory usage telemetry is observed."}))}),Fz=["deployment","namespace","cluster","team","env","pods","availableReplicas","cpuUsageMilli","memoryUsageBytes"],eWe=d({tags:["kubernetes-explorer"],method:"GET",url:`${ar}/deployments`,query:r.Object({...Os,sortBy:r.Optional(r.Enum(Fz,{description:"Field to sort deployments by."})),sortDirection:r.Optional(Ni)}),paginated:!0,response:r.Array(Sg)}),Ag=r.Object({statefulSet:r.String({description:"Kubernetes StatefulSet name from workload telemetry."}),namespace:r.Optional(r.String({description:"Kubernetes namespace that contains the StatefulSet. Present when namespace telemetry is observed."})),cluster:r.Optional(r.String({description:"Kubernetes cluster name that contains the StatefulSet. Present when cluster telemetry is observed."})),team:r.Optional(r.String({description:"Team metadata associated with the StatefulSet. Present when a team label or mapping is observed."})),env:r.Optional(r.String({description:"Environment metadata associated with the StatefulSet. Present when an environment label or mapping is observed."})),pods:r.Optional(r.Integer({description:"Number of observed pods associated with the StatefulSet. Present when pod telemetry and workload attributes are observed."})),readyReplicas:r.Optional(r.Integer({description:"Number of ready StatefulSet replicas from StatefulSet status telemetry. Present when StatefulSet status is observed."})),desiredReplicas:r.Optional(r.Integer({description:"Desired replica count configured for the StatefulSet. Present when StatefulSet spec telemetry is observed."})),cpuUsageMilli:r.Optional(r.Number({description:"Recent aggregate CPU usage for observed StatefulSet pods, in millicores. Present when CPU usage telemetry is observed."})),memoryUsageBytes:r.Optional(r.Number({description:"Recent aggregate memory usage for observed StatefulSet pods, in bytes. Present when memory usage telemetry is observed."}))}),Bz=["statefulSet","namespace","cluster","team","env","pods","cpuUsageMilli","memoryUsageBytes"],tWe=d({tags:["kubernetes-explorer"],method:"GET",url:`${ar}/statefulsets`,query:r.Object({...Os,sortBy:r.Optional(r.Enum(Bz,{description:"Field to sort StatefulSets by."})),sortDirection:r.Optional(Ni)}),paginated:!0,response:r.Array(Ag)}),Og=r.Object({daemonSet:r.String({description:"Kubernetes DaemonSet name from workload telemetry."}),namespace:r.Optional(r.String({description:"Kubernetes namespace that contains the DaemonSet. Present when namespace telemetry is observed."})),cluster:r.Optional(r.String({description:"Kubernetes cluster name that contains the DaemonSet. Present when cluster telemetry is observed."})),team:r.Optional(r.String({description:"Team metadata associated with the DaemonSet. Present when a team label or mapping is observed."})),env:r.Optional(r.String({description:"Environment metadata associated with the DaemonSet. Present when an environment label or mapping is observed."})),pods:r.Optional(r.Integer({description:"Number of observed pods associated with the DaemonSet. Present when pod telemetry and workload attributes are observed."})),readyNodes:r.Optional(r.Integer({description:"Number of eligible nodes with a ready DaemonSet pod. Present when DaemonSet status telemetry is observed."})),desiredNodes:r.Optional(r.Integer({description:"Number of eligible nodes where the DaemonSet should run a pod. Present when DaemonSet status telemetry is observed."})),cpuUsageMilli:r.Optional(r.Number({description:"Recent aggregate CPU usage for observed DaemonSet pods, in millicores. Present when CPU usage telemetry is observed."})),memoryUsageBytes:r.Optional(r.Number({description:"Recent aggregate memory usage for observed DaemonSet pods, in bytes. Present when memory usage telemetry is observed."}))}),Hz=["daemonSet","namespace","cluster","team","env","pods","readyNodes","cpuUsageMilli","memoryUsageBytes"],rWe=d({tags:["kubernetes-explorer"],method:"GET",url:`${ar}/daemonsets`,query:r.Object({...Os,sortBy:r.Optional(r.Enum(Hz,{description:"Field to sort DaemonSets by."})),sortDirection:r.Optional(Ni)}),paginated:!0,response:r.Array(Og)}),xg=r.Object({overview:r.Object({...nw.properties,workload:r.Optional(rw)},{description:"Pod identity, status, and owning workload, derived from recent pod metrics."}),healthMetrics:r.Object({cpu:r.Object({usage:r.String({description:"Metric name callers can use to query pod CPU usage. This is not the current CPU value."}),limit:r.String({description:"Metric name callers can use to query configured container CPU limits for the pod. This is not the current CPU limit value."}),request:r.String({description:"Metric name callers can use to query configured container CPU requests for the pod. This is not the current CPU request value."})},{description:"Metric names for pod CPU usage and for configured container CPU limits and requests."}),memory:r.Object({usage:r.String({description:"Metric name callers can use to query pod memory usage. This is not the current memory value."}),limit:r.String({description:"Metric name callers can use to query configured container memory limits for the pod. This is not the current memory limit value."}),request:r.String({description:"Metric name callers can use to query configured container memory requests for the pod. This is not the current memory request value."})},{description:"Metric names for pod memory usage and for configured container memory limits and requests."})},{description:"Metric names callers can use to query pod CPU and memory telemetry. These are fixed metric identifiers, not current values."}),searchFilters:r.Object({logs:r.String({description:"TQL log search filter scoped to this pod. Built from cluster, namespace, and pod identifiers."}),traces:r.String({description:"TQL trace search filter scoped to this pod. Built from cluster, namespace, and pod identifiers."})},{description:"TQL filters scoped to this pod, ready to use as the query for log and trace search."})}),ow=r.Object({clusterId:r.Optional(u({allowEmpty:!1})),k8sCluster:u({allowEmpty:!1}),k8sNamespace:u({allowEmpty:!1}),podName:u({allowEmpty:!1})}),nWe=d({tags:["kubernetes-explorer"],method:"GET",url:`${ar}/pod-details`,query:ow,response:xg}),Rg=r.Object({configuration:r.Optional(r.Object({spec:r.Record(r.String(),r.Unknown(),{description:"Kubernetes PodSpec from the latest observed pod manifest. Fields outside `object.spec` are stripped."}),lastObservedAt:A({description:"Timestamp when Tsuga last observed the pod manifest used for configuration."})},{description:"Pod configuration from the latest observed pod manifest. Present when a pod manifest log is found for the pod."})),labels:r.Record(r.String(),r.String(),{description:"Kubernetes labels on the pod from the latest observed pod manifest. Key-value strings."}),annotations:r.Record(r.String(),r.String(),{description:"Kubernetes annotations on the pod from the latest observed pod manifest. Key-value strings."}),deletedAt:r.Optional(A({description:"Timestamp when Tsuga last observed the pod deletion event. Present when the latest observed pod event is deleted."}))}),oWe=d({tags:["kubernetes-explorer"],method:"GET",url:`${ar}/pod-manifest`,query:ow,response:Rg}),Cg=r.Object({podName:r.String({description:"Name of a pod instance associated with the workload. Resolved from recent pod usage telemetry and workload attributes."}),podUid:r.Optional(r.String({description:"Kubernetes UID for the pod replica. Present when UID telemetry is observed."})),cpuUsageMilli:r.Optional(r.Number({description:"Recent CPU usage for the pod replica, in millicores. Present when CPU usage telemetry is observed."})),memoryUsageBytes:r.Optional(r.Number({description:"Recent memory usage for the pod replica, in bytes. Present when memory usage telemetry is observed."}))},{description:"A single pod instance with recent CPU or memory telemetry for the workload, resolved from pod usage telemetry and workload attributes."}),Pg=r.Object({overview:r.Object({deploymentName:r.String({description:"Kubernetes Deployment name for this detail response."}),namespace:r.Optional(r.String({description:"Kubernetes namespace for this detail response. Present when any deployment signal is found."})),cluster:r.Optional(r.String({description:"Kubernetes cluster name for this detail response. Present when any deployment signal is found."})),team:r.Optional(r.String({description:"Team metadata from the Deployment available-replica metric. Present when the metric includes team metadata."})),env:r.Optional(r.String({description:"Environment metadata from the Deployment available-replica metric. Present when the metric includes environment metadata."})),availableReplicas:r.Optional(r.Integer({description:"Number of available Deployment replicas from Deployment status telemetry. Present when deployment status is observed."})),desiredReplicas:r.Optional(r.Integer({description:"Desired replica count configured for the Deployment. Present when Deployment spec telemetry is observed."})),latestRevisionAt:r.Optional(A({description:"Latest ReplicaSet metadata.creationTimestamp observed for the Deployment. Present when ReplicaSet object telemetry is observed."}))}),podReplicas:r.Array(Cg,{description:"Pod instances with recent CPU or memory telemetry for the Deployment. Tsuga builds this list from pod usage telemetry and workload attributes. Empty when no matching pod usage telemetry is observed."}),revisions:r.Array(r.Object({replicaSetName:r.String({description:"ReplicaSet name for a Deployment revision from workload telemetry."}),revision:r.Integer({description:"Deployment revision number from ReplicaSet annotations. Integer greater than or equal to zero."}),firstSeen:r.Optional(A({description:"ReplicaSet metadata.creationTimestamp from the latest observed ReplicaSet object. Present when creation time is observed."})),observedGeneration:r.Optional(r.Integer({description:"Latest generation observed for the ReplicaSet revision. Present when generation telemetry is observed."})),readyReplicas:r.Optional(r.Integer({description:"Number of ready replicas for the ReplicaSet revision. Present when ReplicaSet status telemetry is observed."})),replicas:r.Optional(r.Integer({description:"Total replica count for the ReplicaSet revision. Present when ReplicaSet status telemetry is observed."})),logsSearchFilter:r.String({description:"TQL log search filter scoped to this ReplicaSet revision. Built from cluster, namespace, and ReplicaSet identifiers."})}),{description:"Deployment rollout revisions from recent ReplicaSet object telemetry. Includes the latest observed event per ReplicaSet, excludes ReplicaSets whose latest observed spec.replicas is 0, and returns up to 8 revisions sorted by revision number descending."})}),iWe=d({tags:["kubernetes-explorer"],method:"GET",url:`${ar}/deployment-details`,query:r.Object({clusterId:r.Optional(u({allowEmpty:!1})),k8sCluster:u({allowEmpty:!1}),k8sNamespace:u({allowEmpty:!1}),deploymentName:u({allowEmpty:!1})}),response:Pg}),Kz=r.Object({overview:r.Object({statefulSetName:r.String(),namespace:r.Optional(r.String()),cluster:r.Optional(r.String()),team:r.Optional(r.String()),env:r.Optional(r.String()),readyReplicas:r.Optional(r.Integer()),desiredReplicas:r.Optional(r.Integer()),latestRevisionAt:r.Optional(A())}),podReplicas:r.Array(Cg,{description:"Pod instances with recent CPU or memory telemetry for the StatefulSet. Tsuga builds this list from pod usage telemetry and workload attributes. Empty when no matching pod usage telemetry is observed."}),revisions:r.Array(r.Object({revisionName:r.String(),firstSeen:r.Optional(A())}))}),aWe=d({tags:["kubernetes-explorer"],method:"GET",url:`${ar}/statefulset-details`,query:r.Object({clusterId:r.Optional(u({allowEmpty:!1})),k8sCluster:u({allowEmpty:!1}),k8sNamespace:u({allowEmpty:!1}),statefulSetName:u({allowEmpty:!1})}),response:Kz}),zz=r.Object({overview:r.Object({daemonSetName:r.String(),namespace:r.Optional(r.String()),cluster:r.Optional(r.String()),team:r.Optional(r.String()),env:r.Optional(r.String()),readyNodes:r.Optional(r.Integer()),desiredNodes:r.Optional(r.Integer()),latestRevisionAt:r.Optional(A())}),podReplicas:r.Array(Cg,{description:"Pod instances with recent CPU or memory telemetry for the DaemonSet. Tsuga builds this list from pod usage telemetry and workload attributes. Empty when no matching pod usage telemetry is observed."}),revisions:r.Array(r.Object({observedGeneration:r.Integer(),firstSeen:r.Optional(A())}))}),sWe=d({tags:["kubernetes-explorer"],method:"GET",url:`${ar}/daemonset-details`,query:r.Object({clusterId:r.Optional(u({allowEmpty:!1})),k8sCluster:u({allowEmpty:!1}),k8sNamespace:u({allowEmpty:!1}),daemonSetName:u({allowEmpty:!1})}),response:zz});var Zr=`/${"v1"}/kubernetes-explorer`,iw=r.Pick(_g,["podName","namespace","cluster","team","env","node","phase","readyContainers","totalContainers","restarts","createdAt","workload","cpuUsageMilli","cpuLimitMilli","memoryUsageBytes","memoryLimitBytes","cpuUtilization","memoryUtilization"],{description:"A Kubernetes pod with its current phase, owning workload, and resource usage."}),Yz={podName:"api-gateway-7d9f8c6b5-2xk4p",namespace:"production",cluster:"prod-us-east",team:"platform",env:"production",node:"ip-10-0-1-23.ec2.internal",phase:"Running",readyContainers:1,totalContainers:1,restarts:0,createdAt:"2024-01-15T12:34:56.000Z",workload:{kind:"deployment",name:"api-gateway"},cpuUsageMilli:125,cpuLimitMilli:500,memoryUsageBytes:134217728,memoryLimitBytes:536870912,cpuUtilization:.25,memoryUtilization:.25};Object.assign(iw,{examples:[Yz]});var aw=r.Pick(Ig,["cluster","teams","envs","cpuUsageMilli","memoryUsageBytes","readyNodes","podPhaseCounts"],{description:"A Kubernetes cluster with aggregate resource usage, node readiness, and pod phase counts."}),Vz={cluster:"prod-us-east",teams:["platform","payments"],envs:["production"],cpuUsageMilli:4200,memoryUsageBytes:8589934592,readyNodes:6,podPhaseCounts:{Pending:1,Running:42,Succeeded:3,Failed:0,Unknown:0}};Object.assign(aw,{examples:[Vz]});var sw=r.Pick(bg,["namespace","cluster","teams","envs","pods","cpuUsageMilli","memoryUsageBytes"],{description:"A Kubernetes namespace with pod count and aggregate resource usage."}),Qz={namespace:"production",cluster:"prod-us-east",teams:["platform"],envs:["production"],pods:24,cpuUsageMilli:1800,memoryUsageBytes:3221225472};Object.assign(sw,{examples:[Qz]});var cw=r.Pick(Sg,["deployment","namespace","cluster","team","env","pods","availableReplicas","desiredReplicas","cpuUsageMilli","memoryUsageBytes"],{description:"A Kubernetes deployment with replica counts and aggregate resource usage."}),Wz={deployment:"api-gateway",namespace:"production",cluster:"prod-us-east",team:"platform",env:"production",pods:3,availableReplicas:3,desiredReplicas:3,cpuUsageMilli:375,memoryUsageBytes:402653184};Object.assign(cw,{examples:[Wz]});var pw=r.Pick(Ag,["statefulSet","namespace","cluster","team","env","pods","readyReplicas","desiredReplicas","cpuUsageMilli","memoryUsageBytes"],{description:"A Kubernetes StatefulSet with replica counts and aggregate resource usage."}),Zz={statefulSet:"postgres",namespace:"production",cluster:"prod-us-east",team:"platform",env:"production",pods:3,readyReplicas:3,desiredReplicas:3,cpuUsageMilli:900,memoryUsageBytes:2147483648};Object.assign(pw,{examples:[Zz]});var uw=r.Pick(Og,["daemonSet","namespace","cluster","team","env","pods","readyNodes","desiredNodes","cpuUsageMilli","memoryUsageBytes"],{description:"A Kubernetes DaemonSet with eligible-node readiness and aggregate resource usage."}),Xz={daemonSet:"otel-collector",namespace:"observability",cluster:"prod-us-east",team:"platform",env:"production",pods:6,readyNodes:6,desiredNodes:6,cpuUsageMilli:300,memoryUsageBytes:805306368};Object.assign(uw,{examples:[Xz]});var lw=r.Pick(xg,["overview","healthMetrics","searchFilters"],{description:"Metrics-derived information for a single Kubernetes pod: status, owning workload, CPU/memory metric identifiers, and log/trace filters."}),Jz={overview:{podName:"api-gateway-7d9f8c6b5-2xk4p",namespace:"production",cluster:"prod-us-east",team:"platform",env:"production",node:"ip-10-0-1-23.ec2.internal",phase:"Running",readyContainers:1,totalContainers:1,restarts:0,createdAt:"2024-01-15T12:34:56.000Z",workload:{kind:"deployment",name:"api-gateway"}},healthMetrics:{cpu:{usage:"k8s.pod.cpu.usage",limit:"k8s.container.cpu_limit",request:"k8s.container.cpu_request"},memory:{usage:"k8s.pod.memory.usage",limit:"k8s.container.memory_limit",request:"k8s.container.memory_request"}},searchFilters:{logs:'context.k8s.cluster.name:"prod-us-east" AND context.k8s.namespace.name:"production" AND context.k8s.pod.name:"api-gateway-7d9f8c6b5-2xk4p"',traces:'context.k8s.cluster.name:"prod-us-east" AND context.k8s.namespace.name:"production" AND context.k8s.pod.name:"api-gateway-7d9f8c6b5-2xk4p"'}};Object.assign(lw,{examples:[Jz]});var mw=r.Pick(Rg,["configuration","labels","annotations","deletedAt"],{description:"Manifest-derived details for a single Kubernetes pod: the pod manifest spec, labels, and annotations from the pod's most recently observed manifest."}),e4={configuration:{spec:{restartPolicy:"Always",serviceAccountName:"api-gateway"},lastObservedAt:"2024-01-15T12:30:00.000Z"},labels:{app:"api-gateway","pod-template-hash":"7d9f8c6b5"},annotations:{"prometheus.io/scrape":"true"}};Object.assign(mw,{examples:[e4]});var dw=r.Pick(Pg,["overview","podReplicas","revisions"],{description:"Detailed information for a single Kubernetes deployment: replica status, backing pods, and rollout revisions."}),t4={overview:{deploymentName:"api-gateway",namespace:"production",cluster:"prod-us-east",team:"platform",env:"production",availableReplicas:3,desiredReplicas:3,latestRevisionAt:"2024-01-15T12:00:00.000Z"},podReplicas:[{podName:"api-gateway-7d9f8c6b5-2xk4p",podUid:"a1b2c3d4-e5f6-7890-abcd-ef1234567890",cpuUsageMilli:125,memoryUsageBytes:134217728}],revisions:[{replicaSetName:"api-gateway-7d9f8c6b5",revision:7,firstSeen:"2024-01-15T12:00:00.000Z",observedGeneration:7,readyReplicas:3,replicas:3,logsSearchFilter:'context.k8s.cluster.name:"prod-us-east" context.k8s.namespace.name:"production" context.k8s.replicaset.name:"api-gateway-7d9f8c6b5"'}]};Object.assign(dw,{examples:[t4]});var fw=r.Object({clusterId:r.Optional(u({allowEmpty:!1,description:"Tsuga cluster ID to target. Tsuga assigns it when a cluster is connected to the organization. Optional for single-cluster organizations and required for organizations with multiple clusters to scope the request to one cluster."}))}),xs=r.Pick(JU,["clusterId","search"]),r4=r.Pick(ew,["clusterId","search"]),gw=d({description:"Lists Kubernetes pods observed across the organization with their current phase, owning workload, and resource usage.",operationId:"listKubernetesPods",tags:["public","kubernetes-explorer"],method:"GET",url:`${Zr}/pods`,query:xs,response:r.Array(iw)}),hw=d({description:"Lists Kubernetes clusters observed across the organization with aggregate resource usage, node readiness, and pod phase counts.",operationId:"listKubernetesClusters",tags:["public","kubernetes-explorer"],method:"GET",url:`${Zr}/clusters`,query:r4,response:r.Array(aw)}),yw=d({description:"Lists Kubernetes namespaces observed across the organization with pod counts and aggregate resource usage.",operationId:"listKubernetesNamespaces",tags:["public","kubernetes-explorer"],method:"GET",url:`${Zr}/namespaces`,query:xs,response:r.Array(sw)}),Tw=d({description:"Lists Kubernetes deployments observed across the organization with replica counts and aggregate resource usage.",operationId:"listKubernetesDeployments",tags:["public","kubernetes-explorer"],method:"GET",url:`${Zr}/deployments`,query:xs,response:r.Array(cw)}),Ew=d({description:"Lists Kubernetes StatefulSets observed across the organization with replica counts and aggregate resource usage.",operationId:"listKubernetesStatefulSets",tags:["public","kubernetes-explorer"],method:"GET",url:`${Zr}/statefulsets`,query:xs,response:r.Array(pw)}),_w=d({description:"Lists Kubernetes DaemonSets observed across the organization with eligible-node readiness and aggregate resource usage.",operationId:"listKubernetesDaemonSets",tags:["public","kubernetes-explorer"],method:"GET",url:`${Zr}/daemonsets`,query:xs,response:r.Array(uw)}),Iw=r.Object({...fw.properties,k8sCluster:u({allowEmpty:!1,description:"Kubernetes cluster name that contains the pod. From cluster telemetry. Required to identify the pod because pod names are only unique within a namespace and cluster."}),k8sNamespace:u({allowEmpty:!1,description:"Kubernetes namespace that contains the pod. From pod metadata. Required to identify the pod because pod names are only unique within a namespace and cluster."}),podName:u({allowEmpty:!1,description:"Kubernetes pod name to retrieve. Set when the pod is created. Required to fetch pod details for the selected cluster and namespace."})}),bw=d({description:"Retrieves metrics-derived information for a single Kubernetes pod: status, owning workload, CPU/memory metric identifiers, and ready-to-use log and trace filters. Manifest configuration, labels, and annotations are served by the pod-manifest endpoint.",operationId:"getKubernetesPodDetails",tags:["public","kubernetes-explorer"],method:"GET",url:`${Zr}/pod-details`,query:Iw,response:lw}),Sw=d({description:"Retrieves the manifest-derived details for a single Kubernetes pod: the pod manifest spec, labels, and annotations from the pod's most recently observed manifest.",operationId:"getKubernetesPodManifest",tags:["public","kubernetes-explorer"],method:"GET",url:`${Zr}/pod-manifest`,query:Iw,response:mw}),Aw=d({description:"Retrieves detailed information for a single Kubernetes deployment: replica status, backing pods, and rollout revisions with ready-to-use log filters.",operationId:"getKubernetesDeploymentDetails",tags:["public","kubernetes-explorer"],method:"GET",url:`${Zr}/deployment-details`,query:r.Object({...fw.properties,k8sCluster:u({allowEmpty:!1,description:"Kubernetes cluster name that contains the Deployment. From cluster telemetry. Required to identify the Deployment because names are only unique within a namespace and cluster."}),k8sNamespace:u({allowEmpty:!1,description:"Kubernetes namespace that contains the Deployment. From workload metadata. Required to identify the Deployment because names are only unique within a namespace and cluster."}),deploymentName:u({allowEmpty:!1,description:"Kubernetes Deployment name to retrieve. From workload telemetry. Required to fetch deployment details for the selected cluster and namespace."})}),response:dw});var n4="clusterId";function Ow(e,t,n){let o=t.query.properties??{},i=Object.keys(o).filter(a=>a!==n4);for(let a of i){let c=a.replace(/([A-Z])/g,"-$1").toLowerCase(),l=c.replace(/-/g,"_").toUpperCase(),m=o[a]?.description??"";n?e.requiredOption(`--${c} <${l}>`,m):e.option(`--${c} <${l}>`,m)}return i}function Li(e,t,n,o){let i=e.command(t).description(n.description??`List Kubernetes ${t}`),a=Ow(i,n,!1);i.action(async c=>{let l={};for(let m of a)c[m]!==void 0&&(l[m]=c[m]);ee(Object.keys(l).length>0?await o()(n,{query:l}):await o()(n))})}function Ug(e,t,n,o){let i=e.command(t).description(n.description??`Get Kubernetes ${t}`),a=Ow(i,n,!0);i.action(async c=>{let l={};for(let m of a)l[m]=c[m];ee(await o()(n,{query:l}))})}function xw(e,t){let n=e.command("kubernetes").description("Explore Kubernetes resources observed across the organization");Li(n,"pods",gw,t),Li(n,"clusters",hw,t),Li(n,"namespaces",yw,t),Li(n,"deployments",Tw,t),Li(n,"statefulsets",Ew,t),Li(n,"daemonsets",_w,t),Ug(n,"pod-details",bw,t),Ug(n,"pod-manifest",Sw,t),Ug(n,"deployment-details",Aw,t)}var o4=r.Union([r.Literal("scalar"),r.Literal("timeseries")]),i4="/v0/promql",Wu=r.Object({query:u({type:"long",allowEmpty:!1,description:"PromQL expression to evaluate."}),timeRange:ci,step:u({allowEmpty:!1,description:"Evaluation step interval (e.g. `1m`, `5m`, `1h`). Must be a valid Prometheus duration string."}),returnType:r.Optional(o4),executionOptions:yd,shouldStreamResults:r.Optional(r.Boolean()),clusterId:r.Optional(u({allowEmpty:!1,description:"Cluster to target. Defaults to the first cluster created in the organization when omitted."}))}),a4={query:'rate({"otel.trace.span_processor.spans"}[5m])',timeRange:{from:17822015e5,to:17822034e5},step:"1m",executionOptions:{parallelism:1,engine:"q"},clusterId:"cluster-abc"};Object.assign(Wu,{examples:[a4]});var AWe=d({tags:["promql"],url:i4,method:"POST",body:Wu,response:tu});var Rw=`/${"v1"}/aggregation`,Cw=r.Object({id:r.String({description:"Result identifier. Query results use `q1`, `q2`, and so on; formula results use `formula`."}),group:r.Record(r.String(),r.Union([r.String(),r.Number()]),{description:"Group-by field values for this result. Empty when no group-by is requested."})}),Pw=r.Object({results:r.Array(r.Object({...Cw.properties,value:r.Number({description:"Aggregated value for this query or formula and group, over the full time range."})},{title:"ScalarResult"}),{description:"One aggregated value per query or formula and group."})},{$id:"ScalarAggregationResponse",title:"ScalarAggregationResponse",description:"Scalar aggregation response with one value per query or formula and group."}),s4={results:[{id:"q1",group:{host:"server-1"},value:123.45}]};Object.assign(Pw,{examples:[s4]});var Zu=r.Object({series:r.Array(r.Object({...Cw.properties,points:r.Array(r.Object({timestamp:r.Integer({description:"Unix timestamp in milliseconds for this point, spaced by `aggregationWindow`."}),value:r.Number({description:"Aggregated value at this timestamp."})}),{description:"Ordered data points for this query or formula and group."})},{title:"Series"}),{description:"One time series per query or formula and group."})},{$id:"TimeseriesAggregationResponse",title:"TimeseriesAggregationResponse",description:"Timeseries aggregation response with timestamped points over time."}),c4={series:[{id:"q1",group:{host:"server-1"},points:[{timestamp:16094592e5,value:123.45},{timestamp:160945926e4,value:456.78}]}]};Object.assign(Zu,{examples:[c4]});var p4=r.Omit(ns.items,["fill"],{title:"AggregationQuery",description:"Aggregation query. Omit `filter` for an unfiltered query and omit `functions` when no post-processing is needed."}),u4=r.Optional(qr),Uw={timeRange:bt,queries:r.Array(p4,{maxItems:rs,description:`Aggregations that may be combined together in the same query. Each item is referenced from \`formula\` as q1, q2, and so on, in submission order. Limited to ${rs} items. For dataSource "metrics", each aggregate's \`field\` is the metric name, not an attribute; to count distinct values of an attribute use unique-count with field "<metricName>.context.<attribute>" (e.g. "system.cpu.utilization.context.host.name").`}),groupBy:u4,dataSource:sx,formula:r.Optional(co)},ww=r.Object({clusterId:r.Optional(u({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))}),vw=r.Object(Uw,{description:"Scalar aggregation request. Provide a time range, one or more queries, a telemetry data source, and optional grouping or formula. Omit `groupBy` for ungrouped results. Send `clusterId` as a query parameter, not in the JSON body."}),l4={timeRange:{from:1782201500,to:1782203400},dataSource:"logs",queries:[{aggregate:{type:"count"},filter:"context.service.name:checkout"}],groupBy:[{fields:["level"],limit:5}]};Object.assign(vw,{examples:[l4]});var Nw=d({description:"Runs one or more aggregation queries over logs, metrics, or traces and returns scalar values. Use optional group-by and formula fields to compute grouped or derived results. See [Analytics queries](/documentation/visualize/analytics/queries).",operationId:"aggregateScalar",tags:["public","aggregation"],url:`${Rw}/multi-query/scalar`,method:"POST",body:vw,query:ww,response:Pw}),Lw=r.Object({...Uw,aggregationWindow:u({description:"Time bucket size for timeseries aggregation, such as `10s`, `1m`, or `1h`."})},{description:"Timeseries aggregation request. Provide a time range, bucket size, one or more queries, a telemetry data source, and optional grouping or formula. Omit `groupBy` for ungrouped series. Send `clusterId` as a query parameter, not in the JSON body."}),m4={timeRange:{from:1782201500,to:1782203400},aggregationWindow:"1m",dataSource:"logs",queries:[{aggregate:{type:"count"},filter:"context.service.name:checkout"}],groupBy:[{fields:["level"],limit:5}]};Object.assign(Lw,{examples:[m4]});var kw=d({description:"Runs one or more aggregation queries over logs, metrics, or traces and returns timestamped series. Use `aggregationWindow` to choose the time bucket size. See [Analytics queries](/documentation/visualize/analytics/queries).",operationId:"aggregateTimeseries",tags:["public","aggregation"],url:`${Rw}/multi-query/timeseries`,method:"POST",body:Lw,query:ww,response:Zu});var d4=`/${"v1"}/promql`,f4=r.Object({...r.Pick(Wu,["query","step"]).properties,timeRange:bt},{description:"PromQL range-query request. Send clusterId as a query parameter, not in this JSON body.",examples:[{query:'sum by ("context.service.name") (sum_over_time({"traces.span.metrics.calls", "span.kind"="SPAN_KIND_SERVER"}[5m]))',timeRange:{from:1782201500,to:1782203400},step:"1m"}]}),g4=r.Object({clusterId:r.Optional(u({allowEmpty:!1,description:"Telemetry cluster to query. Set by the client as the clusterId query parameter, not in the JSON body. Required when the organization has multiple clusters; omit only for single-cluster organizations. Unknown cluster IDs return 404."}))}),Mw=d({description:"Runs a PromQL range query over Tsuga metric data and returns timeseries results. Authenticate with a bearer operation API key or OAuth access token that can read metrics. Send clusterId as a query parameter; multi-cluster organizations must provide it. See [How to write PromQL queries](/documentation/visualize/guides/how-to-write-promql-queries) for query syntax and examples.",operationId:"queryPromql",tags:["public","promql"],url:d4,method:"POST",body:f4,query:g4,response:Zu});function Dw(e,t){let n=e.command("promql").description("Run PromQL queries over metric data");Wr(n,"query","Run a PromQL range query over metric data",Mw,t)}var Mi="/v0/dashboard-folders",Di=r.Object({id:r.String({description:"Tsuga-generated dashboard folder ID assigned when the folder is created. Use it as dashboard `folderId` or child-folder `parentFolderId`."}),name:r.String({description:"Display name of the dashboard folder. Set by the caller on create or update."}),owner:r.String({description:"ID of the team that owns the dashboard folder. Set by the caller on create or update and used for folder access control."}),parentFolderId:r.Optional(r.String({description:"ID of the top-level parent folder when this folder is nested. Set by the caller on create or update. Returned only for child folders; omitted for top-level folders."})),tags:De,creator:r.Optional(pe),updater:r.Optional(pe),createdAt:A(),updatedAt:A()},{title:"DashboardFolder"}),wg=r.Object({...Di.properties,dashboardCount:r.Number({description:"Number of dashboards directly assigned to this folder that the caller can read. Returned only by folder list responses; callers without dashboard read access see 0."})}),Xu=r.Object({name:u({allowEmpty:!1,description:"Display name of the dashboard folder. Required and non-empty."}),owner:u({allowEmpty:!1,description:"ID of the team that owns the dashboard folder. Required and used for folder access control."}),parentFolderId:r.Optional(r.Union([r.Null(),u({allowEmpty:!1})],{description:"ID of the top-level folder to nest this folder under. Omit on create or pass null to create a top-level folder; omit on update to keep the current parent; pass null on update to move the folder to top level. Non-null values must name a readable top-level folder. Folders can be nested at most two levels deep."})),tags:Xe}),Ju=r.Partial(r.Object({owners:_e(u({allowEmpty:!1}),{description:"Restrict results to dashboard folders owned by any of these team IDs",maxItems:50}),searchQuery:r.Object({value:u({allowEmpty:!1,description:"Substring matched case-insensitively against dashboard folder names or folder IDs. Omit the whole `searchQuery` filter to skip text filtering."}),exclude:r.Optional(r.Boolean({description:"If true, exclude dashboard folders matching this value instead of including them"}))},{description:"Text filter for dashboard folder names or IDs. Optional; `exclude: true` returns folders whose name and ID do not match the substring."}),tags:_e(Bt.items,{description:"Restrict results to dashboard folders that have at least one of the listed key/value tags",maxItems:50}),parentFolderId:r.Union([r.Null(),u({allowEmpty:!1})],{description:"Parent folder filter for dashboard folder query results. Optional; pass a folder ID to return the child folders nested directly under it, or null to return only top-level folders. Omit to return all folders."})},{description:"Optional filters applied to narrow the returned dashboard folders"})),ki={IS_FAVORITE:"isFavorite",OWNER:"owner",TAGS:"tags",DASHBOARD_COUNT:"dashboardCount",UPDATED_AT:"updatedAt",NAME:"name"},vg=[ki.OWNER,ki.TAGS,ki.DASHBOARD_COUNT,ki.UPDATED_AT,ki.NAME],h4=r.Partial(r.Object({...ge,filters:Ju,sort:r.Object({by:r.Enum([...vg,ki.IS_FAVORITE],{description:"Field to sort the returned dashboard folders by"}),direction:r.Enum(["asc","desc"],{description:"Sort direction: ascending or descending"})},{description:"Optional sorting applied to the returned dashboard folders"})})),WWe=d({tags:["dashboard-folders"],url:`${Mi}/query`,method:"POST",paginated:!0,body:h4,response:r.Array(wg)}),ZWe=d({tags:["dashboard-folders"],url:`${Mi}/:id`,method:"GET",params:r.Object({id:u()}),response:Di}),XWe=d({tags:["dashboard-folders"],url:Mi,method:"POST",body:Xu,response:Di}),JWe=d({tags:["dashboard-folders"],url:`${Mi}/:id`,method:"PUT",params:r.Object({id:u()}),body:Xu,response:Di}),e7e=d({tags:["dashboard-folders"],url:`${Mi}/:id`,method:"DELETE",params:r.Object({id:u()}),response:N}),t7e=d({tags:["dashboard-folders"],url:`${Mi}/tags/query`,method:"POST",body:r.Object({filters:r.Optional(r.Omit(Ju,["tags"]))}),response:Ft});var Rs=`/${"v1"}/dashboard-folders`,el=r.Pick(Di,["id","name","owner","parentFolderId","tags"],{$id:"DashboardFolder",description:"Folder used to organize dashboards into a two-level hierarchy"}),Gw={id:"123-456-abc",name:"Platform",owner:"team-123-abc",tags:[{key:"team",value:"platform"}]};Object.assign(el,{examples:[Gw]});var $w=r.Pick(wg,["id","name","owner","parentFolderId","tags","dashboardCount"],{$id:"DashboardFolderWithDashboardCount",description:"Folder used to organize dashboards into a two-level hierarchy, including the number of readable dashboards it directly contains."}),y4={...Gw,dashboardCount:10};Object.assign($w,{examples:[y4]});var Ng=r.Pick(Xu,["name","owner","parentFolderId","tags"],{description:"Dashboard folder create or update request. Provide a name, owner team, optional parent folder, and optional tags."}),T4={name:"Platform",owner:"team-123-abc",parentFolderId:null,tags:[{key:"team",value:"platform"}]};Object.assign(Ng,{examples:[T4]});var E4=r.Object({by:r.Enum(vg,{description:"Field to sort the returned dashboard folders by: `owner` sorts by owning team name, `tags` sorts by tag key/value pairs, `dashboardCount` sorts by the number of readable dashboards directly in the folder, `updatedAt` sorts by last-updated timestamp, and `name` sorts alphabetically by folder name."}),direction:r.Enum(["asc","desc"],{description:"Sort direction: ascending or descending"})},{description:"Optional sorting applied to the returned dashboard folders"}),jw=r.Object({...Ze,filters:r.Optional(r.Pick(Ju,["owners","searchQuery","tags","parentFolderId"])),sort:r.Optional(E4)},{description:"Dashboard folder query request. Use filters, sorting, limit, and offset to page through visible dashboard folders."}),_4={filters:{owners:{values:["team-123-abc"]},searchQuery:{value:"Platform"},tags:{values:[{key:"team",value:"platform"}]}},sort:{by:"name",direction:"asc"},limit:10,offset:0};Object.assign(jw,{examples:[_4]});var qw=d({description:"Queries dashboard folders visible to the authenticated operation key. Returns all folders unless the `parentFolderId` filter is set: pass a folder ID to select the children of that folder, or null to return only top-level folders. Results are ordered by most recently updated folder first unless `sort` is set, and include the number of readable dashboards directly assigned to each folder. Use filters to narrow by owning team, name or ID substring, or tags.",operationId:"queryDashboardFolders",tags:["dashboard-folders"],url:`${Rs}/query`,method:"POST",paginated:!0,body:jw,response:r.Array($w)}),Fw=d({description:"Retrieves one dashboard folder by ID.",operationId:"getDashboardFolder",tags:["dashboard-folders"],url:`${Rs}/:id`,method:"GET",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the dashboard folder to retrieve. Use the `id` returned by folder list, get, create, or update responses."})}),response:el}),Bw=d({description:"Creates a dashboard folder owned by the specified team. To create a child folder, set `parentFolderId` to a readable top-level folder.",operationId:"createDashboardFolder",tags:["dashboard-folders"],url:Rs,method:"POST",body:Ng,response:el}),Hw=d({description:"Updates an existing dashboard folder by ID. Send the folder name, owner, tags, and parent relationship; omit `parentFolderId` to keep the current parent or send null to move the folder to top level.",operationId:"updateDashboardFolder",tags:["dashboard-folders"],url:`${Rs}/:id`,method:"PUT",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the dashboard folder to update. Use the `id` returned by folder list, get, create, or update responses."})}),body:Ng,response:el}),Kw=d({description:"Deletes an empty dashboard folder by ID. The request fails if the folder still contains dashboards or child folders; dashboards and child folders are not moved or deleted automatically.",operationId:"deleteDashboardFolder",tags:["dashboard-folders"],url:`${Rs}/:id`,method:"DELETE",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the dashboard folder to delete. Use the `id` returned by folder list, get, create, or update responses."})}),response:N});var Rr="/v0/dashboards",Yw=["white","gray.100","amber.200","lime.200","emerald.200","cyan.200","blue.200","violet.200","fuchsia.200","pink.200","red.200"],I4=["bar","distribution","gauge","heatmap","list","pie","query-value","table","timeseries","top-list"],I7e=[...I4,"note"];var b4=["ns","us","ms","s","m","h","days"];var S4=["B","KB","MB","GB","TB","PB"];var A4=20;var Vw=r.Object({type:r.Literal("cpu",{description:"Normalizes values as CPU usage"})},{$id:"DataNormalizerCpu",title:"CPU"}),Qw=r.Object({type:r.Literal("duration",{description:"Normalizes values as durations using standard time units"}),unit:r.Enum(b4,{description:"Time unit used to present the normalized values"})},{$id:"DataNormalizerDuration",title:"Duration"}),Ww=r.Object({type:r.Literal("data",{description:"Normalizes values as data sizes using byte units"}),unit:r.Enum(S4,{description:"Data size unit used to present the normalized values"})},{$id:"DataNormalizerData",title:"Data"}),Zw=r.Object({type:r.Literal("percent",{description:"Formats numeric values as percentages. Use it when the raw value is already on a 0-100 scale, for example `25` to display `25%`."})},{$id:"DataNormalizerPercent",title:"Percent"}),Xw=r.Object({type:r.Literal("percent-fraction",{description:"Formats numeric values as percentages. Use it when the raw value is a 0-1 fraction; Tsuga multiplies the value by 100 for display, for example `0.2` to display `20%`."})},{$id:"DataNormalizerPercentFraction",title:"Percent Fraction"}),Jw=r.Object({type:r.Literal("date",{description:"Formats values as calendar dates"})},{$id:"DataNormalizerDate",title:"Date"}),ev=r.Object({type:r.Literal("level",{description:"Displays values using their log level name"})},{$id:"DataNormalizerLevel",title:"Level"}),tv=r.Object({type:r.Literal("none",{description:"Displays raw values without a unit. Records an explicit removal of the unit, so it is not re-derived from metric metadata"})},{$id:"DataNormalizerNone",title:"None"}),O4=r.Object({type:r.Literal("custom",{description:"Normalizes values using a custom unit label"}),unit:r.String({description:"Text label describing the custom unit"})},{$id:"DataNormalizerCustom",title:"Custom"}),x4=r.Object({type:r.Literal("custom",{description:"Normalizes values using a custom unit label"}),unit:r.String({description:"Text label describing the custom unit. Must not be empty.",minLength:1,maxLength:A4})},{$id:"InputDataNormalizerCustom",title:"Custom"}),Rt=C("type",[Qw,Ww,Zw,Xw,Jw,ev,Vw,tv,O4],{title:"Normalizer",description:"Display-value formatter for widget values or list/table columns."}),Ct=C("type",[Qw,Ww,Zw,Xw,Jw,ev,Vw,tv,x4],{title:"Normalizer",description:"Display-value formatter for widget values or list/table columns."}),Lg=r.Object({attribute:r.String({description:"Attribute (log field or database row column) displayed as a column in the list"}),normalizer:r.Optional(Rt)},{title:"WidgetListColumn",description:"List column pairing a displayed attribute with the formatting applied to its values."}),kg=r.Object({attribute:r.String({description:"Attribute (log field or database row column) displayed as a column in the list"}),normalizer:r.Optional(Ct)},{title:"WidgetListColumn",description:"List column pairing a displayed attribute with the formatting applied to its values."}),Gi=["background","no-background"],R4=["table","legend-only","no-legend"];var C4=["greater_than","less_than","equal","not_equal","greater_than_or_equal","less_than_or_equal"],rv=["alert","warning","success"],Cr=r.Object({operator:r.Enum(C4,{description:"Comparator used to evaluate the metric value"}),value:r.Number({description:"Threshold value used when evaluating the operator"}),color:r.Enum(rv,{description:"Color applied when the condition is met"})},{title:"ConditionalFormatting",description:"Color rule evaluated against the displayed value. The first matching rule in the array is applied."}),P4=r.Object({value:r.Number({description:"Y-axis value where the threshold marker is placed"}),level:r.Enum(rv,{description:"Level applied to the threshold marker"})},{title:"ThresholdMarker",description:"Marker line drawn across the chart at a fixed value, colored by its level."}),U4=["sec","min","hour","day"],wn=r.Object({time:r.Number({description:"Numeric count of `metric` units in each bucket. Required when `timeBucket` is present."}),metric:r.Enum(U4,{description:"Unit used to measure the bucket width"})},{description:"Time bucket width for time-based chart widgets. Optional; when present, `time` and `metric` together define the bucket width."});var Un=r.Enum(["flex-start","center","flex-end"],{description:"Flex alignment keyword used for widget layout"}),$i=r.Object({formula:r.Optional(r.String({description:"Optional alias for formula (only used for display in the UI)"})),queries:r.Optional(r.Record(r.String(),r.String({description:'Display name for this query series in the legend, keyed by the zero-based query index as a string ("0" = first query, "1" = second, and so on). This differs from `formula`, which references queries as "q1", "q2". Omit to fall back to an auto-generated label like "Count on <filter>".'}),{description:"Display names for individual query series, keyed by the zero-based query index as a string."}))},{description:"Display names used for the formula series and the individual query series instead of auto-generated labels."}),ji=r.Object({formula:r.Optional(u({type:"short",description:"Optional alias for formula (only used for display in the UI)"})),queries:r.Optional(r.Record(r.String(),u({type:"short",description:'Display name for this query series in the legend, keyed by the zero-based query index as a string ("0" = first query, "1" = second, and so on). This differs from `formula`, which references queries as "q1", "q2". Omit to fall back to an auto-generated label like "Count on <filter>".'}),{description:"Display names for individual query series, keyed by the zero-based query index as a string."}))},{description:"Display names used for the formula series and the individual query series instead of auto-generated labels."}),rl={source:or,queries:Ix,formula:r.Optional(iu),aliases:r.Optional($i),visibleSeries:r.Optional(r.Array(r.Boolean(),{description:"Flags indicating whether each query or formula series is visible"}))},nl={source:or,queries:ns,formula:r.Optional(co),aliases:r.Optional(ji),visibleSeries:r.Optional(r.Array(r.Boolean(),{description:"Flags indicating whether each query or formula series is visible"}))},Pr=r.Optional(r.Enum(["relative","absolute"],{description:"Whether each group holds its own value or its percentage of the ungrouped total (defaults to absolute)"})),qi={...rl,groupBy:r.Optional(pi)},Fi={...nl,groupBy:r.Optional(qr)},Fe=r.Enum(R4,{description:"Controls whether and how the widget displays legend or series details (e.g. table, legend-only, or no legend)"}),ye=r.Optional(r.Union([r.Number(),r.Literal("max")],{description:"Display precision for numeric labels, tooltips, tables, and scalar values. Use a number of decimal places to round displayed values, or `max` to display the full submitted precision."})),Xt=r.Optional(r.Array(P4,{description:"Threshold markers displayed on the chart"})),w4=r.Object({name:r.String({description:"Display name of the table column"}),...rl,source:or,normalizer:r.Optional(Rt),precision:ye},{title:"TableColumn",description:"Table column backed by its own aggregation. `defaultSorting` and `columnSizes` reference it as `col-<index>`, using its zero-based position in `columns`."}),v4=r.Object({name:u({description:"Display name of the table column"}),...nl,source:or,normalizer:r.Optional(Ct),precision:ye},{title:"TableColumn",description:"Table column backed by its own aggregation. `defaultSorting` and `columnSizes` reference it as `col-<index>`, using its zero-based position in `columns`."}),N4=r.Array(r.Object({id:r.String({description:"ID of the column to sort by"}),desc:r.Boolean({description:"Whether the sort is descending"})},{title:"TableDefaultSorting"}),{description:"Default sorting applied to a table widget. Column IDs are `label` for the grouping column and `col-<index>` for each entry in `columns`. Users can still change sorting by selecting columns in the rendered table."}),L4=r.Array(r.Object({id:u({description:"ID of the column to sort by"}),desc:r.Boolean({description:"Whether the sort is descending"})},{title:"TableDefaultSorting"}),{description:"Default sorting applied to a table widget. Column IDs are `label` for the grouping column and `col-<index>` for each entry in `columns`. Users can still change sorting by selecting columns in the rendered table."}),Mg=r.Array(r.Object({id:r.String({description:"Column attribute used for the default list sort. It matches an attribute in `listColumns` or a built-in list column for the selected list source."}),desc:r.Boolean({description:"Sort direction for the default list sort. `true` sorts descending; `false` sorts ascending."})},{title:"ListDefaultSorting"}),{description:"Default sorting applied to a list widget. Applies to log, span, or connection list widgets. Users can still change sorting by selecting columns in the rendered list."}),Dg=r.Array(r.Object({id:u({description:"Column attribute used for the default list sort. Set this to an attribute in `listColumns` or a built-in list column for the selected list source."}),desc:r.Boolean({description:"Sort direction for the default list sort. Set `true` for descending order or `false` for ascending order."})},{title:"ListDefaultSorting"}),{description:"Default sorting applied to a list widget. Optional on create or update for log, span, or connection list widgets. Users can still change sorting by selecting columns in the rendered list."}),nv=["horizontal","vertical"],k4=r.Object({type:r.Literal("list",{description:"Displays matching logs in a tabular list"}),query:r.String({description:"Query that selects logs for the list"}),listColumns:r.Optional(r.Array(Lg,{description:"Custom columns to display for each log"})),listColumnsSize:r.Optional(r.Record(r.String(),r.Number({description:"List column width by column id"}),{description:"List column widths in pixels, keyed by the `attribute` of the matching `listColumns` entry. Columns without an entry keep their default width."})),isCellWrapped:r.Optional(r.Boolean({description:"Whether list widget cell text wraps instead of truncating. Applies to list widgets."})),defaultSorting:r.Optional(Mg)},{$id:"GraphVisualizationList",title:"List"}),M4=r.Object({type:r.Literal("list",{description:"Displays matching logs in a tabular list"}),query:u({type:"tsuga-query",description:"Query that selects logs for the list"}),listColumns:r.Optional(r.Array(kg,{description:"Custom columns to display for each log"})),listColumnsSize:r.Optional(r.Record(r.String(),r.Number({description:"List column width by column id"}),{description:"List column widths in pixels, keyed by the `attribute` of the matching `listColumns` entry. Columns without an entry keep their default width."})),isCellWrapped:r.Optional(r.Boolean({description:"Whether list widget cell text wraps instead of truncating. Applies to list widgets. Optional; omit or set false to use truncated cells."})),defaultSorting:r.Optional(Dg)},{$id:"InputGraphVisualizationList",title:"List"}),tl=C("type",[r.Object({type:r.Literal("auto",{description:"Automatically choose this axis bound"})}),r.Object({type:r.Literal("number",{description:"Use a fixed numeric axis bound"}),value:r.Number({description:"Fixed numeric axis bound value"})})],{description:"Axis bound mode: automatic or fixed numeric value"}),Bi=r.Object({min:tl,max:tl,scale:C("type",[r.Object({type:r.Literal("pow",{description:"Power scale"}),exponent:r.Number({description:"Exponent used by the power scale"})}),r.Object({type:r.Enum(["linear","log","sqrt"],{description:"Built-in axis scale"})})],{description:"Y-axis scale mode"}),alwaysIncludeZero:r.Boolean({description:"Whether the rendered Y axis should always include zero"})},{description:"Y-axis bounds and scale configuration for chart widgets."}),Hi=r.Object({min:tl,max:tl,scale:C("type",[r.Object({type:r.Literal("pow",{description:"Power scale"}),exponent:r.Number({minimum:0,description:"Exponent used by the power scale"})}),r.Object({type:r.Enum(["linear","log","sqrt"],{description:"Built-in axis scale"})})],{description:"Y-axis scale mode"}),alwaysIncludeZero:r.Boolean({description:"Whether the rendered Y axis should always include zero"})},{description:"Y-axis bounds and scale configuration for chart widgets. Optional on create or update."}),D4=r.Array(r.Integer({description:"Marker value expressed as a percentage between 0 and 100"}),{description:"Percentile markers displayed on top of the distribution chart"}),G4=r.Array(r.Integer({minimum:0,maximum:100,description:"Marker value expressed as a percentage between 0 and 100"}),{description:"Percentile markers displayed on top of the distribution chart"});var $4=r.Object({type:r.Literal("timeseries-connection",{description:"Displays the database rows-based aggregation as a time series chart"}),connectionId:r.String({description:"The ID of the connection to use to query the datastore."}),queries:r.Array(r.String({description:"The read-only SQL query to execute against the connection."})),legendMode:r.Optional(Fe),thresholds:Xt,yAxisSettings:r.Optional(Bi)},{$id:"GraphVisualizationTimeseriesConnection",title:"TimeseriesConnection"}),j4=r.Object({type:r.Literal("timeseries-connection",{description:"Displays the database rows-based aggregation as a time series chart"}),connectionId:u({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:r.Array(u({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:r.Optional(Fe),thresholds:Xt,yAxisSettings:r.Optional(Hi)},{$id:"InputGraphVisualizationTimeseriesConnection",title:"TimeseriesConnection"}),q4=r.Object({type:r.Literal("list-connection",{description:"Displays database rows as a tabular list"}),connectionId:r.String({description:"The ID of the connection to use to query the datastore."}),query:r.String({description:"The read-only SQL query to execute against the connection."}),listColumns:r.Optional(r.Array(Lg,{description:"Custom columns to display for each database row"})),listColumnsSize:r.Optional(r.Record(r.String(),r.Number({description:"List column width by column id"}),{description:"List column widths in pixels, keyed by the `attribute` of the matching `listColumns` entry. Columns without an entry keep their default width."})),isCellWrapped:r.Optional(r.Boolean({description:"Whether list widget cell text wraps instead of truncating. Applies to connection list widgets."})),defaultSorting:r.Optional(Mg)},{$id:"GraphVisualizationListConnection",title:"ListConnection"}),F4=r.Object({type:r.Literal("list-connection",{description:"Displays database rows as a tabular list"}),connectionId:u({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),query:u({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),listColumns:r.Optional(r.Array(kg,{description:"Custom columns to display for each database row"})),listColumnsSize:r.Optional(r.Record(r.String(),r.Number({description:"List column width by column id"}),{description:"List column widths in pixels, keyed by the `attribute` of the matching `listColumns` entry. Columns without an entry keep their default width."})),isCellWrapped:r.Optional(r.Boolean({description:"Whether list widget cell text wraps instead of truncating. Applies to connection list widgets. Optional; omit or set false to use truncated cells."})),defaultSorting:r.Optional(Dg)},{$id:"InputGraphVisualizationListConnection",title:"ListConnection"}),B4=r.Object({type:r.Literal("top-list-connection",{description:"Displays the database rows-based aggregation as a ranked top list"}),connectionId:r.String({description:"The ID of the connection to use to query the datastore."}),queries:r.Array(r.String({description:"The read-only SQL query to execute against the connection."}))},{$id:"GraphVisualizationTopListConnection",title:"TopListConnection"}),H4=r.Object({type:r.Literal("top-list-connection",{description:"Displays the database rows-based aggregation as a ranked top list"}),connectionId:u({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:r.Array(u({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1})},{$id:"InputGraphVisualizationTopListConnection",title:"TopListConnection"}),K4=r.Object({type:r.Literal("pie-connection",{description:"Displays the database rows-based aggregation as a pie chart"}),connectionId:r.String({description:"The ID of the connection to use to query the datastore."}),queries:r.Array(r.String({description:"The read-only SQL query to execute against the connection."})),legendMode:r.Optional(Fe)},{$id:"GraphVisualizationPieConnection",title:"PieConnection"}),z4=r.Object({type:r.Literal("pie-connection",{description:"Displays the database rows-based aggregation as a pie chart"}),connectionId:u({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:r.Array(u({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:r.Optional(Fe)},{$id:"InputGraphVisualizationPieConnection",title:"PieConnection"}),Y4=r.Object({type:r.Literal("bar-connection",{description:"Displays the database rows-based aggregation as a bar chart"}),connectionId:r.String({description:"The ID of the connection to use to query the datastore."}),queries:r.Array(r.String({description:"The read-only SQL query to execute against the connection."})),legendMode:r.Optional(Fe),thresholds:Xt,yAxisSettings:r.Optional(Bi)},{$id:"GraphVisualizationBarConnection",title:"BarConnection"}),V4=r.Object({type:r.Literal("bar-connection",{description:"Displays the database rows-based aggregation as a bar chart"}),connectionId:u({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:r.Array(u({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:r.Optional(Fe),thresholds:Xt,yAxisSettings:r.Optional(Hi)},{$id:"InputGraphVisualizationBarConnection",title:"BarConnection"}),Q4=r.Object({type:r.Literal("query-value-connection",{description:"Displays a single value computed by a SQL query against a database connection"}),connectionId:r.String({description:"The ID of the connection to use to query the datastore."}),queries:r.Array(r.String({description:"The read-only SQL query to execute against the connection."})),backgroundMode:r.Optional(r.Enum(Gi,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:r.Optional(r.Array(Cr,{description:"Conditional formatting rules applied to the displayed value"})),precision:ye,normalizer:r.Optional(Rt),legendMode:r.Optional(Fe)},{$id:"GraphVisualizationQueryValueConnection",title:"QueryValueConnection"}),W4=r.Object({type:r.Literal("query-value-connection",{description:"Displays a single value computed by a SQL query against a database connection"}),connectionId:u({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:r.Array(u({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),backgroundMode:r.Optional(r.Enum(Gi,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:r.Optional(r.Array(Cr,{description:"Conditional formatting rules applied to the displayed value"})),precision:ye,normalizer:r.Optional(Ct),legendMode:r.Optional(Fe)},{$id:"InputGraphVisualizationQueryValueConnection",title:"QueryValueConnection"}),Z4=r.Object({type:r.Literal("list-log-patterns",{description:"Displays log patterns clustered from logs matching the query"}),query:r.String({description:"Tsuga query that selects logs to cluster into patterns"}),layout:r.Optional(r.Enum(nv,{description:"Layout used to render log patterns"}))},{$id:"GraphVisualizationListLogPatterns",title:"ListLogPatterns"}),X4=r.Object({type:r.Literal("list-log-patterns",{description:"Displays log patterns clustered from logs matching the query"}),query:u({type:"tsuga-query",description:"Tsuga query that selects logs to cluster into patterns"}),layout:r.Optional(r.Enum(nv,{description:"Layout used to render log patterns"}))},{$id:"InputGraphVisualizationListLogPatterns",title:"ListLogPatterns"}),J4=r.Object({type:r.Literal("list-spans",{description:"Displays matching trace spans in a tabular list"}),query:r.String({description:"Query that selects trace spans for the list"}),listColumns:r.Optional(r.Array(Lg,{description:"Custom columns to display for each span"})),listColumnsSize:r.Optional(r.Record(r.String(),r.Number({description:"List column width by column id"}),{description:"List column widths in pixels, keyed by the `attribute` of the matching `listColumns` entry. Columns without an entry keep their default width."})),isCellWrapped:r.Optional(r.Boolean({description:"Whether list widget cell text wraps instead of truncating. Applies to span list widgets."})),defaultSorting:r.Optional(Mg)},{$id:"GraphVisualizationListSpans",title:"ListSpans"}),e3=r.Object({type:r.Literal("list-spans",{description:"Displays matching trace spans in a tabular list"}),query:u({type:"tsuga-query",description:"Query that selects trace spans for the list"}),listColumns:r.Optional(r.Array(kg,{description:"Custom columns to display for each span"})),listColumnsSize:r.Optional(r.Record(r.String(),r.Number({description:"List column width by column id"}),{description:"List column widths in pixels, keyed by the `attribute` of the matching `listColumns` entry. Columns without an entry keep their default width."})),isCellWrapped:r.Optional(r.Boolean({description:"Whether list widget cell text wraps instead of truncating. Applies to span list widgets. Optional; omit or set false to use truncated cells."})),defaultSorting:r.Optional(Dg)},{$id:"InputGraphVisualizationListSpans",title:"ListSpans"}),Cs=r.Array(r.String({description:"Raw PromQL expression for this widget, returned exactly as stored."}),{description:"PromQL expressions configured for this widget. PromQL-backed widgets require at least one query."}),Ps=r.Array(u({allowEmpty:!1,type:"long",description:"Raw PromQL expression for this widget."}),{minItems:1,description:"PromQL expressions configured for this widget."}),t3=r.Object({type:r.Literal("timeseries-promql",{description:"Displays PromQL metrics query-based aggregation as a time series chart"}),queries:Cs,aliases:r.Optional($i),timeBucket:r.Optional(wn),normalizer:r.Optional(Rt),precision:ye,legendMode:r.Optional(Fe),thresholds:Xt,yAxisSettings:r.Optional(Bi),smoothing:r.Optional(r.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"}))},{$id:"GraphVisualizationTimeseriesPromql",title:"TimeseriesPromql"}),r3=r.Object({type:r.Literal("timeseries-promql",{description:"Displays PromQL metrics query-based aggregation as a time series chart"}),queries:Ps,aliases:r.Optional(ji),timeBucket:r.Optional(wn),normalizer:r.Optional(Ct),precision:ye,legendMode:r.Optional(Fe),thresholds:Xt,yAxisSettings:r.Optional(Hi),smoothing:r.Optional(r.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"}))},{$id:"InputGraphVisualizationTimeseriesPromql",title:"TimeseriesPromql"}),n3=r.Object({type:r.Literal("query-value-promql",{description:"Configures a PromQL metrics query-based aggregation as a single value"}),queries:Cs,aliases:r.Optional($i),backgroundMode:r.Optional(r.Enum(Gi,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:r.Optional(r.Array(Cr,{description:"Conditional formatting rules applied to the displayed value"})),precision:ye,normalizer:r.Optional(Rt),legendMode:r.Optional(Fe)},{$id:"GraphVisualizationQueryValuePromql",title:"QueryValuePromql"}),o3=r.Object({type:r.Literal("query-value-promql",{description:"Configures a PromQL metrics query-based aggregation as a single value"}),queries:Ps,aliases:r.Optional(ji),backgroundMode:r.Optional(r.Enum(Gi,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:r.Optional(r.Array(Cr,{description:"Conditional formatting rules applied to the displayed value"})),precision:ye,normalizer:r.Optional(Ct),legendMode:r.Optional(Fe)},{$id:"InputGraphVisualizationQueryValuePromql",title:"QueryValuePromql"}),i3=r.Object({type:r.Literal("top-list-promql",{description:"Displays PromQL metrics query-based aggregation as a ranked top list"}),queries:Cs,aliases:r.Optional($i),normalizer:r.Optional(Rt),precision:ye,conditions:r.Optional(r.Array(Cr,{description:"Conditional formatting rules applied to the displayed value"}))},{$id:"GraphVisualizationTopListPromql",title:"TopListPromql"}),a3=r.Object({type:r.Literal("top-list-promql",{description:"Displays PromQL metrics query-based aggregation as a ranked top list"}),queries:Ps,aliases:r.Optional(ji),normalizer:r.Optional(Ct),precision:ye,conditions:r.Optional(r.Array(Cr,{description:"Conditional formatting rules applied to the displayed value"}))},{$id:"InputGraphVisualizationTopListPromql",title:"TopListPromql"}),s3=r.Object({type:r.Literal("pie-promql",{description:"Displays PromQL metrics query-based aggregation as a pie chart"}),queries:Cs,aliases:r.Optional($i),normalizer:r.Optional(Rt),precision:ye,legendMode:r.Optional(Fe)},{$id:"GraphVisualizationPiePromql",title:"PiePromql"}),c3=r.Object({type:r.Literal("pie-promql",{description:"Displays PromQL metrics query-based aggregation as a pie chart"}),queries:Ps,aliases:r.Optional(ji),normalizer:r.Optional(Ct),precision:ye,legendMode:r.Optional(Fe)},{$id:"InputGraphVisualizationPiePromql",title:"PiePromql"}),p3=r.Object({type:r.Literal("bar-promql",{description:"Displays PromQL metrics query-based aggregation as a bar chart"}),queries:Cs,aliases:r.Optional($i),timeBucket:r.Optional(wn),precision:ye,normalizer:r.Optional(Rt),thresholds:Xt,legendMode:r.Optional(Fe),yAxisSettings:r.Optional(Bi)},{$id:"GraphVisualizationBarPromql",title:"BarPromql"}),u3=r.Object({type:r.Literal("bar-promql",{description:"Displays PromQL metrics query-based aggregation as a bar chart"}),queries:Ps,aliases:r.Optional(ji),timeBucket:r.Optional(wn),precision:ye,normalizer:r.Optional(Ct),thresholds:Xt,legendMode:r.Optional(Fe),yAxisSettings:r.Optional(Hi)},{$id:"InputGraphVisualizationBarPromql",title:"BarPromql"}),l3=r.Object({type:r.Literal("timeseries",{description:"Displays the aggregation as a time series chart"}),...qi,groupByMode:Pr,timeBucket:r.Optional(wn),normalizer:r.Optional(Rt),precision:ye,legendMode:r.Optional(Fe),thresholds:Xt,yAxisSettings:r.Optional(Bi),smoothing:r.Optional(r.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"}))},{$id:"GraphVisualizationTimeseries",title:"Timeseries"}),m3=r.Object({type:r.Literal("timeseries",{description:"Displays the aggregation as a time series chart"}),...Fi,groupByMode:Pr,timeBucket:r.Optional(wn),normalizer:r.Optional(Ct),precision:ye,legendMode:r.Optional(Fe),thresholds:Xt,yAxisSettings:r.Optional(Hi),smoothing:r.Optional(r.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"}))},{$id:"InputGraphVisualizationTimeseries",title:"Timeseries"}),ov="Requests stacked rendering for a top-list widget. Tsuga renders stacked rows only for one count or sum query with exactly two grouped fields, no formula, non-negative values, and a single-cluster context; otherwise the widget renders as a normal top list.",d3=r.Object({type:r.Literal("top-list",{description:"Displays the aggregation as a ranked list of top results"}),...qi,groupByMode:Pr,normalizer:r.Optional(Rt),precision:ye,conditions:r.Optional(r.Array(Cr,{description:"Conditional formatting rules applied to the displayed value"})),isStacked:r.Optional(r.Boolean({description:ov}))},{$id:"GraphVisualizationTopList",title:"TopList"}),f3=r.Object({type:r.Literal("top-list",{description:"Displays the aggregation as a ranked list of top results"}),...Fi,groupByMode:Pr,normalizer:r.Optional(Ct),precision:ye,conditions:r.Optional(r.Array(Cr,{description:"Conditional formatting rules applied to the displayed value"})),isStacked:r.Optional(r.Boolean({description:ov}))},{$id:"InputGraphVisualizationTopList",title:"TopList"}),g3=r.Object({type:r.Literal("pie",{description:"Displays the aggregation as a pie chart"}),...qi,groupByMode:Pr,normalizer:r.Optional(Rt),precision:ye,legendMode:r.Optional(Fe)},{$id:"GraphVisualizationPie",title:"Pie"}),h3=r.Object({type:r.Literal("pie",{description:"Displays the aggregation as a pie chart"}),...Fi,groupByMode:Pr,normalizer:r.Optional(Ct),precision:ye,legendMode:r.Optional(Fe)},{$id:"InputGraphVisualizationPie",title:"Pie"}),y3=r.Object({type:r.Literal("query-value",{description:"Displays the aggregation as a single value"}),...rl,backgroundMode:r.Optional(r.Enum(Gi,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:r.Optional(r.Array(Cr,{description:"Conditional formatting rules applied to the displayed value"})),precision:ye,normalizer:r.Optional(Rt),legendMode:r.Optional(Fe)},{$id:"GraphVisualizationQueryValue",title:"QueryValue"}),T3=r.Object({type:r.Literal("query-value",{description:"Displays the aggregation as a single value"}),...nl,backgroundMode:r.Optional(r.Enum(Gi,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:r.Optional(r.Array(Cr,{description:"Conditional formatting rules applied to the displayed value"})),precision:ye,normalizer:r.Optional(Ct),legendMode:r.Optional(Fe)},{$id:"InputGraphVisualizationQueryValue",title:"QueryValue"}),E3=r.Object({type:r.Literal("bar",{description:"Displays the aggregation as a bar chart"}),...qi,groupByMode:Pr,timeBucket:r.Optional(wn),precision:ye,normalizer:r.Optional(Rt),thresholds:Xt,legendMode:r.Optional(Fe),yAxisSettings:r.Optional(Bi)},{$id:"GraphVisualizationBar",title:"Bar"}),_3=r.Object({type:r.Literal("bar",{description:"Displays the aggregation as a bar chart"}),...Fi,groupByMode:Pr,timeBucket:r.Optional(wn),precision:ye,normalizer:r.Optional(Ct),thresholds:Xt,legendMode:r.Optional(Fe),yAxisSettings:r.Optional(Hi)},{$id:"InputGraphVisualizationBar",title:"Bar"}),iv='Attribute that switches the count to "Groups" mode: records are grouped by this attribute, the aggregation produces one value per group, and the chart buckets those per-group values. When omitted, individual records are bucketed.',av=r.String({description:iv}),sv=u({description:iv}),I3=r.Object({type:r.Literal("distribution",{description:"Displays the aggregation as a distribution chart"}),...qi,group:r.Optional(av),precision:ye,normalizer:r.Optional(Rt),percentileMarkers:r.Optional(D4),boundsScale:r.Optional(ou)},{$id:"GraphVisualizationDistribution",title:"Distribution"}),b3=r.Object({type:r.Literal("distribution",{description:"Displays the aggregation as a distribution chart"}),...Fi,group:r.Optional(sv),precision:ye,normalizer:r.Optional(Ct),percentileMarkers:r.Optional(G4),boundsScale:r.Optional(ou)},{$id:"InputGraphVisualizationDistribution",title:"Distribution"}),cv=["red","pink","violet","blue","cyan","green","yellow","orange"],pv=r.Enum(cv,{description:"Color palette used to render the heatmap intensity gradient"}),S3=r.Object({type:r.Literal("heatmap",{description:"Displays the aggregation as a heatmap chart"}),...qi,group:r.Optional(av),precision:ye,normalizer:r.Optional(Rt),palette:r.Optional(pv)},{$id:"GraphVisualizationHeatmap",title:"Heatmap"}),A3=r.Object({type:r.Literal("heatmap",{description:"Displays the aggregation as a heatmap chart"}),...Fi,group:r.Optional(sv),precision:ye,normalizer:r.Optional(Ct),palette:r.Optional(pv)},{$id:"InputGraphVisualizationHeatmap",title:"Heatmap"}),uv=r.Object({from:r.Number({description:"Lower bound of the Gauge color threshold; runs up to the next threshold or the max"}),color:r.Enum(cv,{description:"Color applied to the band starting at this value"})},{title:"GaugeColorThreshold",description:"Color band of the gauge range. Bands are ordered by `from`, so entries may be listed in any order."}),O3=r.Object({type:r.Literal("gauge",{description:"Displays the aggregation as a gauge"}),...rl,max:r.Optional(r.Number({description:"Gauge maximum value"})),colorThresholds:r.Optional(r.Array(uv,{description:"Color thresholds inside the gauge range"})),precision:ye,normalizer:r.Optional(Rt)},{$id:"GraphVisualizationGauge",title:"Gauge"}),x3=r.Object({type:r.Literal("gauge",{description:"Displays the aggregation as a gauge"}),...nl,max:r.Optional(r.Number({description:"Gauge maximum value"})),colorThresholds:r.Optional(r.Array(uv,{description:"Color thresholds inside the gauge range"})),precision:ye,normalizer:r.Optional(Ct)},{$id:"InputGraphVisualizationGauge",title:"Gauge"}),R3=r.Object({type:r.Literal("table",{description:"Displays the aggregation as a table with multi-level grouping"}),columns:r.Array(w4,{description:"Each column defines an independent aggregation displayed as a table column"}),groupBy:r.Optional(pi),groupByMode:Pr,defaultSorting:r.Optional(N4),columnSizes:r.Optional(r.Record(r.String(),r.Number({description:"Column width by column id"}),{description:"Table column widths in pixels, keyed by column id: `label` for the grouping column and `col-<index>` for each entry in `columns`. Columns without an entry keep their default width."}))},{$id:"GraphVisualizationTable",title:"Table"}),C3=r.Object({type:r.Literal("table",{description:"Displays the aggregation as a table with multi-level grouping"}),columns:r.Array(v4,{minItems:1,description:"Each column defines an independent aggregation displayed as a table column"}),groupBy:r.Optional(qr),groupByMode:Pr,defaultSorting:r.Optional(L4),columnSizes:r.Optional(r.Record(r.String(),r.Number({description:"Column width by column id"}),{description:"Table column widths in pixels, keyed by column id: `label` for the grouping column and `col-<index>` for each entry in `columns`. Columns without an entry keep their default width."}))},{$id:"InputGraphVisualizationTable",title:"Table"}),P3=r.Object({type:r.Literal("note",{description:"Displays static text on the dashboard"}),note:r.Optional(r.String({description:"Markdown-compatible text shown in the note"})),noteColor:r.Optional(r.Enum(Yw,{description:"Background color used to render the note"})),noteAlign:r.Optional(Un),noteJustifyContent:r.Optional(Un)},{$id:"GraphVisualizationNote",title:"Note"}),U3=r.Object({type:r.Literal("note",{description:"Displays static text on the dashboard"}),note:r.Optional(u({type:"long",description:"Markdown-compatible text shown in the note"})),noteColor:r.Optional(r.Enum(Yw,{description:"Background color used to render the note"})),noteAlign:r.Optional(Un),noteJustifyContent:r.Optional(Un)},{$id:"InputGraphVisualizationNote",title:"Note"}),w3=C("type",[$4,q4,B4,K4,Y4,Q4,t3,n3,i3,s3,p3,l3,d3,g3,y3,O3,E3,I3,S3,R3,k4,P3,Z4,J4],{description:"Widget visualization configuration. The `type` discriminator selects the widget kind and its required fields."}),v3=C("type",[j4,F4,H4,z4,V4,W4,r3,o3,a3,c3,u3,m3,f3,h3,T3,x3,_3,b3,A3,C3,M4,U3,X4,e3],{description:"Widget visualization configuration. The `type` discriminator selects the widget kind and its required fields."}),ol=r.Object({id:r.String({description:"Unique identifier of the graph widget inside the dashboard. Set by the caller when the graph is created; use it to target the graph in later update requests."}),name:r.Optional(r.String({description:"Display name of the graph widget."})),description:r.Optional(r.String({description:"Optional text shown with the graph widget."})),descriptionAlign:r.Optional(Un),descriptionJustifyContent:r.Optional(Un),visualization:w3,layout:r.Optional(r.Object({x:r.Number({description:"Column position of the widget on the 12-column dashboard grid. 0 is the leftmost column; increasing values move right."}),y:r.Number({description:"Row position of the widget on the dashboard grid, in row units of 50 pixels each. 0 is the topmost row; increasing values move down."}),w:r.Number({description:"Width of the widget in grid columns, out of the 12-column grid. Dashboard validation uses this with `h` and the widget type to reject layouts below the widget minimum."}),h:r.Number({description:"Height of the widget in grid rows, where each row is 50 pixels tall. Dashboard validation uses this with `w` and the widget type to reject layouts below the widget minimum."})},{description:`Grid position and size of the widget. Optional; when provided, the size must be at least ${Id}\xD7${bd} (width\xD7height) grid units, except note widgets which can go down to 1\xD71.`}))},{title:"Graph",description:"Single dashboard widget, combining its identity, its visualization configuration, and its position on the dashboard grid."}),il=r.Object({id:u({description:"Unique identifier of the graph widget inside the dashboard. Assign it when the graph is created; use it to target the graph in later update requests."}),name:r.Optional(u({description:"Display name of the graph widget."})),description:r.Optional(r.String({minLength:1,maxLength:800,description:"Text shown with the graph widget."})),descriptionAlign:r.Optional(Un),descriptionJustifyContent:r.Optional(Un),visualization:v3,layout:r.Optional(r.Object({x:r.Number({description:"Column position of the widget on the 12-column dashboard grid. 0 is the leftmost column; increasing values move right."}),y:r.Number({description:"Row position of the widget on the dashboard grid, in row units of 50 pixels each. 0 is the topmost row; increasing values move down."}),w:r.Number({description:"Width of the widget in grid columns, out of the 12-column grid. Dashboard validation uses this with `h` and the widget type to reject layouts below the widget minimum."}),h:r.Number({description:"Height of the widget in grid rows, where each row is 50 pixels tall. Dashboard validation uses this with `w` and the widget type to reject layouts below the widget minimum."})},{description:`Grid position and size of the widget. Optional; when provided, the size must be at least ${Id}\xD7${bd} (width\xD7height) grid units, except note widgets which can go down to 1\xD71.`}))},{title:"Graph",description:"Single dashboard widget, combining its identity, its visualization configuration, and its position on the dashboard grid."}),zw=10,N3=r.Array(r.Object({key:r.String({description:"Dashboard-wide filter key, usually a telemetry attribute name."}),values:r.Array(r.String({description:"Filter value."}),{description:"Allowed values for this dashboard-wide filter."}),exclude:r.Optional(r.Boolean({description:"If true, widgets exclude telemetry whose value matches this filter instead of including it (is-not)."}))}),{description:"Dashboard-wide filters applied to every widget on the dashboard."}),L3=r.Array(r.Object({key:u({description:"Dashboard-wide filter key, usually a telemetry attribute name."}),values:r.Array(u({description:"Filter value."}),{description:"Allowed values for this dashboard-wide filter."}),exclude:r.Optional(r.Boolean({description:"If true, widgets exclude telemetry whose value matches this filter instead of including it (is-not)."}))}),{maxItems:zw,description:`Dashboard-wide filters applied to every widget on the dashboard. Up to ${zw} filters are allowed.`}),Ki=r.Object({id:r.String({description:"Tsuga-generated dashboard ID assigned when the dashboard is created."}),name:r.String({description:"Display name of the dashboard. Set by the caller on create or update."}),owner:r.String({description:"ID of the team that owns the dashboard. Set by the caller on create or update and used for dashboard access control."}),graphs:r.Array(ol,{description:"Ordered widgets that compose the dashboard"}),filters:r.Optional(N3),createdAt:A({description:"Timestamp when Tsuga created the dashboard."}),updatedAt:A({description:"Timestamp when Tsuga last updated the dashboard."}),creator:r.Optional(pe),updater:r.Optional(pe),tags:De,timePreset:r.Optional(r.Enum(Ul,{description:"Relative time preset used when opening the dashboard."})),folderId:r.Optional(r.String({description:"Folder that contains the dashboard. Set from the dashboard's saved folder relationship. Returned when the dashboard is in a folder; omitted when it is not."}))}),al=r.Object({name:u({description:"Display name of the dashboard."}),owner:u({allowEmpty:!1,description:"ID of the team that owns the dashboard. Required and used for dashboard access control."}),graphs:r.Array(il,{description:"Ordered widgets that compose the dashboard"}),filters:r.Optional(L3),tags:Xe,timePreset:r.Optional(r.Enum(Ul,{description:"Relative time preset used when opening the dashboard. Optional; create defaults to `past-30-minutes` when omitted, and update omission preserves the current value."})),folderId:r.Optional(r.Union([r.Null(),u({allowEmpty:!1})],{description:"Folder that should contain the dashboard. Optional; omit on update to keep the current folder, pass null to clear the folder, or pass a readable dashboard-folder ID to move it."}))}),sr={IS_FAVORITE:"isFavorite",OWNER:"owner",TAGS:"tags",WIDGET_COUNT:"widgetCount",UPDATED_AT:"updatedAt",NAME:"name"},lv=[sr.OWNER,sr.TAGS,sr.WIDGET_COUNT,sr.UPDATED_AT,sr.NAME],Us=r.Partial(r.Object({owners:_e(u({allowEmpty:!1}),{description:"Restrict results to dashboards owned by any of these team IDs",maxItems:50}),searchQuery:r.Object({value:u({allowEmpty:!1,description:"Substring matched case-insensitively against dashboard names or dashboard IDs. Omit the whole `searchQuery` filter to skip text filtering."}),exclude:r.Optional(r.Boolean({description:"If true, exclude dashboards matching this value instead of including them"}))},{description:"Text filter for dashboard names or IDs. Optional; `exclude: true` returns dashboards whose name and ID do not match the substring."}),tags:_e(Bt.items,{description:"Restrict results to dashboards that have at least one of the listed key/value tags",maxItems:50}),folderId:r.Union([r.Null(),u({allowEmpty:!1})],{description:"Folder filter for dashboard query results. Optional; pass a folder ID to return dashboards in that folder, or null to return only dashboards that are not in any folder."})},{description:"Optional filters applied to narrow the returned dashboards"})),k3=r.Partial(r.Object({...ge,filters:Us,sort:r.Object({by:r.Enum([sr.IS_FAVORITE,sr.OWNER,sr.TAGS,sr.WIDGET_COUNT,sr.UPDATED_AT,sr.NAME],{description:"Field to sort the returned dashboards by"}),direction:r.Enum(["asc","desc"],{description:"Sort direction: ascending or descending"})},{description:"Optional sorting applied to the returned dashboards"})})),b7e=d({tags:["dashboards"],url:`${Rr}/query`,method:"POST",paginated:!0,response:r.Array(Ki),body:k3}),S7e=d({tags:["dashboards"],url:`${Rr}/tags/query`,method:"POST",body:r.Object({filters:r.Optional(r.Omit(Us,["tags"]))}),response:Ft}),A7e=d({tags:["dashboards"],url:`${Rr}/counts/query`,method:"POST",body:r.Object({filters:r.Optional(r.Partial(Us))}),response:r.Object({all:r.Integer({description:"Total number of dashboards matching the filters that the user can read."})})}),O7e=d({tags:["dashboards"],url:`${Rr}/:id`,method:"GET",params:r.Object({id:u()}),response:Ki}),x7e=d({tags:["dashboards"],url:Rr,method:"POST",body:al,response:Ki}),R7e=d({tags:["dashboards"],url:`${Rr}/:id`,method:"PUT",params:r.Object({id:u()}),body:r.Partial(al),response:Ki}),C7e=d({tags:["dashboards"],url:`${Rr}/bulk-update`,method:"PUT",body:r.Object({dashboardIds:r.Array(u(),{description:"Dashboard IDs to update. At least one dashboard ID is required."}),owner:r.Optional(u({allowEmpty:!1,description:"Owning team ID to apply to every dashboard. Optional when folderId is provided; omit to keep the current owner."})),folderId:r.Optional(r.Union([r.Null(),u({allowEmpty:!1})],{description:"Folder that should contain every dashboard. Optional when owner is provided; omit to keep the current folder, pass null to clear the folder, or pass a dashboard-folder ID to move dashboards."}))}),response:r.Object({})}),P7e=d({tags:["dashboards"],url:`${Rr}/:id`,method:"DELETE",params:r.Object({id:u()}),response:N}),U7e=d({tags:["dashboards"],url:`${Rr}/:id/graphs/:graphId`,method:"PUT",params:r.Object({id:u({allowEmpty:!1}),graphId:u({allowEmpty:!1})}),body:r.Omit(il,["id"]),response:ol}),w7e=d({tags:["dashboards"],url:`${Rr}/bulk-delete`,method:"DELETE",body:r.Object({ids:r.Array(u())}),response:r.Object({})});var zi=`/${"v1"}/dashboards`,ws=r.Pick(Ki,["id","name","owner","graphs","filters","tags","timePreset","folderId"],{$id:"Dashboard",description:"Saved visualization made of dashboard-wide filters and ordered graphs. Use dashboards to preserve reusable views for a team or workflow. See [Dashboards](/documentation/visualize/dashboards/index)."}),M3={id:"123-456-abc",name:"API Performance Overview",owner:"team-123-abc",graphs:[{id:"789-abc-def",name:"Request Latency P99",visualization:{type:"timeseries",source:"metrics",queries:[{aggregate:{type:"percentile",field:"duration",percentile:99},filter:"service:api-gateway"}]},layout:{x:0,y:0,w:6,h:4}}],filters:[{key:"env",values:["production"]}],tags:[{key:"team",value:"platform"}],timePreset:"past-1-hour"};Object.assign(ws,{examples:[M3]});var D3=r.Object({by:r.Enum([...lv],{description:"Field to sort the returned dashboards by: `owner` sorts by owning team ID, `tags` sorts by tag key/value pairs, `widgetCount` sorts by the number of graphs on the dashboard, `updatedAt` sorts by last-updated timestamp, and `name` sorts alphabetically by dashboard name."}),direction:r.Enum(["asc","desc"],{description:"Sort direction: ascending or descending"})},{description:"Optional sorting applied to the returned dashboards"}),mv=r.Object({...Ze,filters:r.Optional(r.Pick(Us,["owners","searchQuery","tags","folderId"])),sort:r.Optional(D3)},{description:"Dashboard query request. Use filters, sorting, limit, and offset to page through visible dashboards."}),G3={filters:{owners:{values:["team-123-abc"]},searchQuery:{value:"API"},tags:{values:[{key:"service",value:"api-gateway"}]},folderId:"folder-123-abc"},sort:{by:"name",direction:"asc"},limit:10,offset:0};Object.assign(mv,{examples:[G3]});var dv=d({description:"Queries dashboards visible to the authenticated operation key. Use this endpoint to build dashboard inventories or synchronize dashboard metadata. Pagination fields limit the returned page; use the response metadata to request additional pages. See [Dashboards](/documentation/visualize/dashboards/index).",operationId:"queryDashboards",tags:["dashboards"],url:`${zi}/query`,method:"POST",paginated:!0,body:mv,response:r.Array(ws)}),fv=d({description:"Retrieves one dashboard by ID.",operationId:"getDashboard",tags:["dashboards"],url:`${zi}/:id`,method:"GET",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the saved dashboard to retrieve. Use the `id` returned by dashboard query, create, or update responses."})}),response:ws}),Gg=r.Pick(al,["name","owner","graphs","filters","tags","timePreset","folderId"],{description:"Dashboard create or update request. Provide the dashboard identity, owner team, widgets, filters, tags, and optional time preset."}),$3={name:"API Performance Overview",owner:"team-123-abc",graphs:[{id:"789-abc-def",name:"Request Latency P99",visualization:{type:"timeseries",source:"metrics",queries:[{aggregate:{type:"percentile",field:"duration",percentile:99},filter:"service:api-gateway"}]},layout:{x:0,y:0,w:6,h:4}}],filters:[{key:"env",values:["production"]}],tags:[{key:"team",value:"platform"}],timePreset:"past-1-hour",folderId:null};Object.assign(Gg,{examples:[$3]});var j3=r.Omit(il,["id"],{description:"Dashboard graph update request. The graph identifier is supplied in the `graphId` path parameter; provide the replacement graph definition without an `id` field."}),gv=d({description:"Creates a dashboard owned by the specified team. Use this to provision dashboards from automation or templates. The response returns the saved dashboard definition.",operationId:"createDashboard",tags:["dashboards"],url:zi,method:"POST",body:Gg,response:ws}),hv=d({description:"Updates an existing dashboard by ID. Fields are patched from the request body; omitted fields keep their current values.",operationId:"updateDashboard",tags:["dashboards"],url:`${zi}/:id`,method:"PUT",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the saved dashboard to update. Use the `id` returned by dashboard query, get, or create responses."})}),body:r.Partial(Gg),response:ws}),q3=r.Object({id:u({allowEmpty:!1,description:"Identifier of the saved dashboard to delete. Use the `id` returned by dashboard query, get, create, or update responses."})}),yv=d({description:"Deletes a dashboard by ID. Use only after confirming no users or automation still rely on the dashboard.",operationId:"deleteDashboard",tags:["dashboards"],url:`${zi}/:id`,method:"DELETE",params:q3,response:N}),$7e=d({description:"Updates one graph inside a dashboard without replacing the full dashboard. Use this for targeted widget edits when you already know the dashboard ID and graph ID.",operationId:"updateDashboardGraph",tags:["dashboards"],url:`${zi}/:id/graphs/:graphId`,method:"PUT",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the dashboard that contains the graph to update. Use the `id` returned by dashboard responses."}),graphId:u({allowEmpty:!1,description:"Identifier of the graph to update within the dashboard. Use graph IDs from the dashboard response."})}),body:j3,response:ol});var Tv=100,Ev=3,Yi=r.Object({id:r.String({description:"Tsuga-generated ingestion API key ID assigned when the key is created."}),name:r.String({description:"Human-readable key name. Names must be kebab-case when creating or updating keys."}),keyLastCharacters:r.String({description:"Last visible characters of the secret key. Use this to identify a key without exposing the full secret."}),owner:r.String({description:"Team ID that owns and manages the ingestion API key."}),tags:Ft,teamOverrideFields:r.Optional(r.Array(r.String(),{description:"Telemetry attribute names used to override ownership for data sent with this key."})),updatedAt:A({description:"Timestamp when Tsuga last updated the key metadata."}),createdAt:A({description:"Timestamp when Tsuga created the key."}),creator:r.Optional(pe),updater:r.Optional(pe),assetUpdatedAt:A({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})}),vs=r.Object({name:r.String({format:Jo,minLength:1,maxLength:Tv,description:`Kebab-case name for the ingestion API key. Maximum length is ${Tv} characters.`}),owner:u({allowEmpty:!1,description:"Team ID that will own and manage the ingestion API key."}),tags:Bt,teamOverrideFields:r.Union([r.Array(u({allowEmpty:!1}),{minItems:1,maxItems:Ev,description:`Array form. Up to ${Ev} fields are allowed.`}),r.Null({description:"Clear any existing team override fields."})],{description:"Telemetry attribute names used to override ownership for data sent with this key. Send null to clear existing override fields."})}),Vi="/v0/ingestion-api-keys",V7e=d({tags:["ingestion-api-keys"],url:Vi,method:"POST",body:vs,response:r.Intersect([Yi,r.Object({key:r.String({description:"Full secret value of the ingestion API key. Generated by Tsuga and returned only in this create response; subsequent get and list responses expose only `keyLastCharacters`. Store it immediately, since it cannot be retrieved again after this response."})})])}),Q7e=d({tags:["ingestion-api-keys"],url:Vi,method:"GET",paginated:!0,query:r.Object(ge),response:r.Array(Yi)}),W7e=d({tags:["ingestion-api-keys"],url:`${Vi}/:id`,method:"GET",params:r.Object({id:u({allowEmpty:!1})}),response:Yi}),Z7e=d({tags:["ingestion-api-keys"],url:`${Vi}/:id`,method:"PUT",params:r.Object({id:u({allowEmpty:!1})}),body:vs,response:Yi}),X7e=d({tags:["ingestion-api-keys"],url:`${Vi}/:id`,method:"DELETE",params:r.Object({id:u({allowEmpty:!1})}),response:N}),J7e=d({tags:["ingestion-api-keys"],url:`${Vi}/bulk-delete`,method:"DELETE",body:r.Object({ids:r.Array(u({allowEmpty:!1}))}),response:r.Object({})});var Ns=`/${"v1"}/ingestion-api-keys`,Ls=r.Pick(Yi,["id","name","owner","tags","teamOverrideFields","keyLastCharacters"],{$id:"IngestionApiKey",description:"API key used to send telemetry data to Tsuga. The full key secret is returned only when the key is created. See [API keys](/documentation/account-and-settings/api-keys)."}),_v={id:"123-456-abc",name:"production-logs-ingestion",keyLastCharacters:"x7Qm",owner:"team-123-abc",tags:[{key:"env",value:"production"}],teamOverrideFields:["service"]};Object.assign(Ls,{examples:[_v]});var Iv=r.Pick(vs,["name","owner","tags","teamOverrideFields"],{$id:"CreateIngestionApiKeyRequest",description:"Ingestion API key creation request. Provide a kebab-case name, owner team, required tags, and required team override fields as an array of fields or null."}),bv=r.Pick(vs,["name","owner","tags","teamOverrideFields"],{$id:"UpdateIngestionApiKeyRequest",description:"Ingestion API key update request. Provide the full metadata definition, including name, owner team, tags, and team override fields."}),Sv={name:"production-logs-ingestion",owner:"team-123-abc",tags:[{key:"env",value:"production"}],teamOverrideFields:["service"]};Object.assign(Iv,{examples:[Sv]});Object.assign(bv,{examples:[Sv]});var F3={..._v,key:"tsuga_in:v1:abc123xyx7Qm"},Av=d({description:"Lists ingestion API keys visible to the authenticated operation key. Use this to inventory telemetry intake keys, owners, tags, and team override fields. Pagination fields limit the returned page.",operationId:"listIngestionApiKeys",tags:["ingestion-api-keys"],url:Ns,method:"GET",paginated:!0,query:r.Object(Ze),response:r.Array(Ls)}),sZe=d({description:"Retrieves one ingestion API key by ID. The response never includes the full secret key value; only the last visible characters are returned.",operationId:"getIngestionApiKey",tags:["ingestion-api-keys"],url:`${Ns}/:id`,method:"GET",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the ingestion API key to retrieve. Use the `id` returned by ingestion API key list or create responses."})}),response:Ls}),B3=r.Intersect([r.Pick(Ls,["id","name","keyLastCharacters","owner","tags","teamOverrideFields"]),r.Object({key:r.String({description:"Full Tsuga-generated ingestion API key secret. Returned only in the create response; list, get, and update responses expose only `keyLastCharacters`."})})],{title:"IngestionApiKeyCreated",example:F3}),Ov=d({description:"Creates an ingestion API key for telemetry intake. Store the returned `key` immediately because Tsuga returns the full secret only in this response.",operationId:"createIngestionApiKey",tags:["ingestion-api-keys"],url:Ns,method:"POST",body:Iv,response:B3}),xv=d({description:"Updates ingestion API key metadata by ID, including name, owner, tags, and team override fields. The secret key value is not rotated by this operation.",operationId:"updateIngestionApiKey",tags:["ingestion-api-keys"],url:`${Ns}/:id`,method:"PUT",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the ingestion API key to update. Use the `id` returned by ingestion API key list, get, or create responses."})}),body:bv,response:Ls}),Rv=d({description:"Deletes an ingestion API key by ID. Telemetry clients using the deleted key can no longer send data with it.",operationId:"deleteIngestionApiKey",tags:["ingestion-api-keys"],url:`${Ns}/:id`,method:"DELETE",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the ingestion API key to delete. Use the `id` returned by ingestion API key list, create, or update responses."})}),response:N});var H3={application:{webService:["azure_web_app","gcp_app_engine_service"]},data:{bucket:["aws_s3_bucket","gcp_bucket","azure_blob_storage_container"],messagingService:["aws_kinesis_data_stream","aws_sqs_queue","aws_sns_topic","azure_service_bus_namespace","azure_service_bus_queue","gcp_pubsub_topic","azure_event_grid_topic","azure_event_hub_namespace","azure_event_hub"],fileSystem:["aws_efs","azure_file_share"],contentDeliveryNetwork:["aws_cloudfront_distribution","gcp_cloud_cdn_configuration"],database:["aws_dynamodb_table","aws_elasticache","aws_rds_instance","azure_database_for_mysql_server","azure_database_for_postgres_server","azure_sql_database_server","azure_sql_database","gcp_bigtable_instance","gcp_cloud_sql_instance","gcp_firestore_database","gcp_spanner_instance","azure_cosmos_db_account"],storageAccount:["azure_storage_account"],volume:["aws_ebs_volume","gcp_compute_disk","azure_disk"]},compute:{virtualMachine:["aws_ec2_instance","gcp_compute_instance","azure_compute_virtual_machine"],serverless:["aws_lambda_function","gcp_cloud_run_function","gcp_cloud_run_job","gcp_cloud_run_service","azure_function_app"]},container:{kubernetesCluster:["aws_eks_cluster","gcp_gke_cluster","azure_aks_cluster"],containerRepository:["aws_ecr_repository","gcp_artifact_registry_repository","azure_container_registry"],containerCluster:["aws_ecs_cluster"],containerServiceTask:["aws_ecs_task"],containerService:["aws_ecs_service","azure_container_instance_group"],containerImage:["aws_ecr_image","gcp_artifact_registry_docker_image","azure_container_registry_image"]},network:{virtualNetwork:["aws_vpc","gcp_vpc","azure_virtual_network"],loadBalancer:["aws_elastic_load_balancer","gcp_forwarding_rule","azure_load_balancer","azure_traffic_manager_profile"],targetGroup:["aws_target_group"],certificate:["aws_acm_certificate","gcp_certificate_manager_certificate","azure_app_service_certificate"]}},[lZe,sl,ks]=K3(H3),mZe=Object.fromEntries(sl.map(e=>[e,e]));function K3(e){let t=[],n=[],o=[],i=Object.keys(e);for(let a of i){t.push(a);let c=e[a];for(let l in c){n.push(l);let m=c[l];Array.isArray(m)&&o.push(...m)}}return[$g(t),$g(n),$g(o)]}function $g(e){if(e.length===0)throw new Error("Array must have at least one element.");return e}var jg=r.Enum(["HTTP","HTTPS","TCP","UDP","GENEVE","TLS","TLS_QUIC","TCP_UDP","TCP_QUIC","QUIC"]),z3=r.Object({versioningStatus:r.Optional(r.Enum(["Enabled","Disabled","Suspended","Not configured"]))}),Y3=r.Object({domainName:r.Optional(r.String()),origins:r.Optional(r.Array(r.String()))}),V3=r.Object({allocatedStorageGib:r.Optional(r.Number()),encryptedAtRest:r.Optional(r.Boolean()),engine:r.Optional(r.String()),dynamoDbItemCount:r.Optional(r.Number()),dynamoDbActualSizeGib:r.Optional(r.Number())}),Q3=r.Object({version:r.Optional(r.String()),virtualNetworkId:r.Optional(r.String()),subnets:r.Optional(r.Array(r.String()))}),W3=r.Object({artifactRegistryFormat:r.Optional(r.Enum(["FORMAT_UNSPECIFIED","DOCKER","MAVEN","NPM","APT","YUM","PYTHON","KFP","GO","GENERIC"])),uri:r.Optional(r.String()),tagMutability:r.Optional(r.Enum(["MUTABLE","IMMUTABLE"])),scanOnPush:r.Optional(r.Boolean()),encryptionType:r.Optional(r.String())}),Z3=r.Object({status:r.Optional(r.String()),activeServices:r.Optional(r.Number()),pendingTasks:r.Optional(r.Number()),runningTasks:r.Optional(r.Number()),registeredContainerInstances:r.Optional(r.Number()),capacityProviders:r.Optional(r.Array(r.String()))}),X3=r.Object({status:r.Optional(r.String()),desiredStatus:r.Optional(r.String()),healthStatus:r.Optional(r.String()),availabilityZone:r.Optional(r.String()),startedAt:r.Optional(A())}),J3=r.Object({isEncrypted:r.Optional(r.Boolean()),ownerId:r.Optional(r.String()),state:r.Optional(r.Enum(["creating","available","deleting","deleted","error","updating"]))}),eY=r.Object({type:r.Optional(r.String()),osType:r.Optional(r.String()),subnetIds:r.Optional(r.Array(r.String())),nbContainers:r.Optional(r.Number())}),tY=r.Object({digest:r.String(),imageTags:r.Array(r.String()),imageSizeBytes:r.Optional(r.Number()),imagePushedAt:r.Optional(A()),mediaType:r.Optional(r.String()),repositoryName:r.String(),repositoryId:r.Optional(r.String()),scanStatus:r.Optional(r.String())}),rY=r.Object({url:r.Optional(r.String()),maxMessageSizeBytes:r.Optional(r.Number()),messageRetentionHours:r.Optional(r.Number())}),nY=r.Object({runtime:r.Optional(r.String()),memoryAllocationMib:r.Optional(r.Number()),timeoutMs:r.Optional(r.Number()),codeSha256:r.Optional(r.String())}),oY=r.Object({kind:r.Optional(r.String())}),iY=r.Object({instanceId:r.String(),architecture:r.Optional(r.String()),instanceType:r.Optional(r.String()),operatingSystem:r.Optional(r.String()),memoryMib:r.Optional(r.Number()),vCpus:r.Optional(r.Number()),vpcId:r.Optional(r.String()),k8sClusterId:r.Optional(r.String())}),aY=r.Object({id:r.Optional(r.String()),ipCidrBlocks:r.Array(r.String())}),sY=r.Object({protocol:r.Optional(jg),port:r.Optional(r.Number()),instanceProtocol:r.Optional(jg),instancePort:r.Optional(r.Number())}),cY=r.Object({protocol:r.Optional(r.String()),ports:r.Optional(r.Array(r.String())),portRange:r.Optional(r.String()),allPorts:r.Optional(r.Boolean())}),pY=r.Object({name:r.String(),ip:r.Optional(r.String()),type:r.Enum(["public","private"])}),uY=r.Object({type:r.String(),name:r.String()}),lY=r.Object({frontendIp:r.Optional(pY),backendIpPools:r.Array(uY)}),mY=r.Object({targetId:r.String(),targetPort:r.Optional(r.Number()),targetType:r.Optional(r.Enum(["instance","ip","lambda","alb"])),healthState:r.Optional(r.String()),healthReason:r.Optional(r.String()),healthDescription:r.Optional(r.String()),availabilityZone:r.Optional(r.String())}),dY=r.Object({protocol:r.Optional(jg),port:r.Optional(r.Number()),type:r.Optional(r.Enum(["alb","lambda","instance","ip"])),name:r.Optional(r.String()),targetGroupArn:r.Optional(r.String()),virtualNetworkId:r.Optional(r.String()),healthCheckProtocol:r.Optional(r.String()),healthCheckPort:r.Optional(r.String()),healthCheckPath:r.Optional(r.String()),healthCheckIntervalSeconds:r.Optional(r.Number()),healthCheckTimeoutSeconds:r.Optional(r.Number()),healthyThresholdCount:r.Optional(r.Number()),unhealthyThresholdCount:r.Optional(r.Number()),targets:r.Optional(r.Array(mY)),targetCount:r.Optional(r.Number()),healthyTargetCount:r.Optional(r.Number()),loadBalancerArns:r.Optional(r.Array(r.String()))}),fY=r.Object({first:r.Optional(r.String()),last:r.Optional(r.String()),scope:r.Optional(r.Number())}),gY=r.Object({type:r.Optional(r.String()),name:r.Optional(r.String()),alwaysServe:r.Optional(r.Boolean()),subnets:r.Optional(r.Array(r.Union([r.Number(),fY]))),target:r.Optional(r.String()),weight:r.Optional(r.Number()),priority:r.Optional(r.Number()),status:r.Optional(r.String())}),hY=r.Object({instanceId:r.Optional(r.String()),state:r.Optional(r.String()),reasonCode:r.Optional(r.String()),description:r.Optional(r.String())}),yY=r.Object({loadBalancerType:r.Optional(r.String()),dnsName:r.Optional(r.String()),virtualNetworkId:r.Optional(r.String()),subnetIds:r.Array(r.String()),scheme:r.Optional(r.String()),listeners:r.Optional(r.Union([r.Array(sY),r.Array(cY)])),targets:r.Optional(r.Union([r.Array(r.String()),r.Array(hY),r.Array(gY)])),azureLoadBalancingRules:r.Optional(r.Array(lY))}),TY=r.Object({domainName:r.Optional(r.String()),expiresAt:r.Optional(A()),inUseBy:r.Optional(r.Array(r.String())),renewalEligibility:r.Optional(r.String()),revokedAt:r.Optional(A()),status:r.Optional(r.String()),type:r.Optional(r.String())}),EY=r.Object({state:r.Optional(r.Enum(["creating","available","deleting","deleted","error","in-use"])),volumeType:r.Optional(r.Enum(["gp2","gp3","io1","io2","st1","sc1","standard"]))}),_Y=r.Object({osType:r.Optional(r.Enum(["Windows","Linux"]))}),IY=r.Object({state:r.Optional(r.String()),volumeType:r.Optional(r.String())}),bY=r.Intersect([r.Object({isEncrypted:r.Optional(r.Boolean()),sizeGib:r.Optional(r.Number())}),r.Union([EY,IY,_Y])]),SY=r.Object({instanceCount:r.Optional(r.Number()),hostnames:r.Optional(r.Array(r.String())),runtime:r.Optional(r.String())}),cl=r.Union([r.Object({category:r.Literal("application"),resourceType:r.Literal("webService"),attributes:r.Optional(SY)}),r.Object({category:r.Literal("data"),resourceType:r.Literal("bucket"),attributes:r.Optional(z3)}),r.Object({category:r.Literal("data"),resourceType:r.Literal("messagingService"),attributes:r.Optional(rY)}),r.Object({category:r.Literal("data"),resourceType:r.Literal("fileSystem"),attributes:r.Optional(J3)}),r.Object({category:r.Literal("data"),resourceType:r.Literal("contentDeliveryNetwork"),attributes:r.Optional(Y3)}),r.Object({category:r.Literal("data"),resourceType:r.Literal("database"),attributes:r.Optional(V3)}),r.Object({category:r.Literal("data"),resourceType:r.Literal("storageAccount"),attributes:r.Optional(oY)}),r.Object({category:r.Literal("data"),resourceType:r.Literal("volume"),attributes:r.Optional(bY)}),r.Object({category:r.Literal("compute"),resourceType:r.Literal("virtualMachine"),attributes:r.Optional(iY)}),r.Object({category:r.Literal("compute"),resourceType:r.Literal("serverless"),attributes:r.Optional(nY)}),r.Object({category:r.Literal("container"),resourceType:r.Literal("kubernetesCluster"),attributes:r.Optional(Q3)}),r.Object({category:r.Literal("container"),resourceType:r.Literal("containerRepository"),attributes:r.Optional(W3)}),r.Object({category:r.Literal("container"),resourceType:r.Literal("containerCluster"),attributes:r.Optional(Z3)}),r.Object({category:r.Literal("container"),resourceType:r.Literal("containerServiceTask"),attributes:r.Optional(X3)}),r.Object({category:r.Literal("container"),resourceType:r.Literal("containerService"),attributes:r.Optional(eY)}),r.Object({category:r.Literal("container"),resourceType:r.Literal("containerImage"),attributes:r.Optional(tY)}),r.Object({category:r.Literal("network"),resourceType:r.Literal("virtualNetwork"),attributes:r.Optional(aY)}),r.Object({category:r.Literal("network"),resourceType:r.Literal("loadBalancer"),attributes:yY}),r.Object({category:r.Literal("network"),resourceType:r.Literal("targetGroup"),attributes:r.Optional(dY)}),r.Object({category:r.Literal("network"),resourceType:r.Literal("certificate"),attributes:r.Optional(TY)})],{description:"Normalized public inventory category, resource type, and category-specific attributes. Attribute shape depends on the category and resourceType combination."});var bo="/v0/inventory",Cv=["scan_in_progress","success","failure","partial"],Fg=r.Object({id:r.String({description:"Identifier of the inventory resource. Generated by Tsuga."}),cloudPlatform:r.Enum(_n,{description:"Cloud platform where Tsuga discovered this resource."}),cloudAccount:r.String({description:"Cloud-native account identifier where Tsuga discovered this resource, such as an AWS account ID, GCP project ID, or Azure subscription ID."}),cloudRegion:r.Optional(r.String({description:"Cloud region where Tsuga discovered this resource, when the resource is regional."})),fullyQualifiedResourceId:r.String({description:"Cloud-native unique identifier for this resource, such as an AWS ARN, GCP resource name, or Azure resource ID."}),displayName:r.String({description:"Human-readable resource name shown in Tsuga. Derived from cloud provider metadata when available."}),nativeResourceType:r.String({description:"Cloud-native resource type reported by the inventory integration, for example `aws_ec2_instance` or `gcp_bucket`."}),resourceCreatedAt:r.Optional(A({description:"Timestamp when the resource was created in the cloud, when known."})),resourceUpdatedAt:r.Optional(A({description:"Timestamp when the resource was last updated in the cloud, when known."})),resourceLastSeenAt:A({description:"Timestamp when Tsuga last observed this resource during an inventory scan."}),tags:De,nativeAttributes:r.Optional(r.Unsafe({type:"object",additionalProperties:!0})),covered:r.Optional(r.Boolean({description:"Whether the resource is covered by the configured infrastructure-as-code identifiers"}))}),Qi={DISPLAY_NAME:"displayName",CLOUD_ACCOUNT:"cloudAccount",NATIVE_RESOURCE_TYPE:"nativeResourceType",CLOUD_REGION:"cloudRegion",RESOURCE_TYPE:"resourceType",RESOURCE_CREATED_AT:"resourceCreatedAt"},Pv=r.Object({cloudPlatforms:_e(r.Enum(_n),{description:"Restrict results to resources discovered on any of these cloud platforms",maxItems:_n.length}),cloudAccounts:_e(u({allowEmpty:!1}),{description:"Restrict results to resources in any of these cloud accounts",maxItems:500}),cloudRegions:_e(u({allowEmpty:!1}),{description:"Restrict results to resources in any of these cloud regions",maxItems:500}),nativeResourceTypes:_e(r.Enum(ks),{description:"Restrict results to resources of any of these cloud-native resource types",maxItems:ks.length}),resourceTypes:_e(r.Enum(sl),{description:"Restrict results to resources of any of these normalized resource types",maxItems:sl.length}),tags:_e(Bt.items,{description:"Restrict results to resources that have at least one of the listed key/value tags",maxItems:50}),isIacManaged:r.Boolean({description:"Restrict results by infrastructure-as-code coverage. When true, only resources covered by the configured IaC identifiers are returned; when false, only uncovered resources are returned."}),searchQuery:r.Object({value:u({allowEmpty:!1,description:"Case-insensitive substring matched against resource ID, display name, fully-qualified resource ID, cloud account, region, and resource type. Use the `tags` filter to narrow by tag. Wildcard characters are treated literally."}),exclude:r.Optional(r.Boolean({description:"If true, exclude resources matching this value instead of including them"}))},{description:"Search query filter for resources."})},{description:"Optional filters applied to narrow the returned resources"}),Bg=r.Partial(r.Object({...ge,filters:r.Partial(Pv,{description:"Filters applied to narrow the returned resources."}),sort:r.Object({by:r.Enum([Qi.DISPLAY_NAME,Qi.CLOUD_ACCOUNT,Qi.NATIVE_RESOURCE_TYPE,Qi.CLOUD_REGION,Qi.RESOURCE_TYPE,Qi.RESOURCE_CREATED_AT],{description:"Field to sort the returned resources by"}),direction:r.Enum(["asc","desc"],{description:"Sort direction: ascending or descending"})},{description:"Optional sorting applied to the returned resources. Ties are broken by resource ID for stable pagination."})})),IZe=d({tags:["inventory"],method:"POST",url:`${bo}/resources/query`,paginated:!0,body:Bg,response:r.Array(r.Intersect([Fg,cl]))}),AY=["resourceType","cloudAccount","isIacManaged"],bZe=d({tags:["inventory"],method:"POST",url:`${bo}/resources/counts`,body:r.Object({filters:r.Optional(r.Partial(Pv)),groupBy:r.Enum(AY,{description:"Dimension to group the resource counts by."})}),response:r.Array(r.Object({value:r.String({description:'The group value the count belongs to: a resource type, a cloud account id, or "true"/"false" for IaC coverage.'}),count:r.Integer({description:"Number of resources in this group matching the requested filters."})}))}),SZe=d({tags:["inventory"],method:"GET",url:`${bo}/resources/filter-options`,response:r.Object({cloudRegions:r.Array(r.String(),{description:"Distinct cloud regions present across the tenant's resources."}),nativeResourceTypes:r.Array(r.String(),{description:"Distinct cloud-native resource types present across the tenant's resources."}),tags:Ft})}),AZe=C("type",[r.Object({type:r.Literal("aws",{description:"Discriminator identifying AWS connection settings."}),accountId:r.String({description:"AWS account ID that Tsuga scans."}),externalId:r.String({description:"External ID Tsuga passes when assuming the cross-account IAM role."}),roleArn:r.String({description:"ARN of the IAM role Tsuga assumes to read inventory in the account."})}),r.Object({type:r.Literal("gcp",{description:"Discriminator identifying GCP connection settings."}),projectId:r.String({description:"GCP project ID that Tsuga scans."}),serviceAccountId:r.String({description:"Service account Tsuga impersonates to read inventory."}),workloadIdentityProvider:r.String({description:"Workload identity provider resource name used for federated authentication."})}),r.Object({type:r.Literal("azure",{description:"Discriminator identifying Azure connection settings."}),clientId:r.String({description:"Client ID of the Azure application Tsuga authenticates as."}),subscriptionId:r.String({description:"Azure subscription ID that Tsuga scans."}),tenantId:r.String({description:"Azure tenant ID that owns the subscription."})})]),OY="^[0-9]{12}$",xY="^arn:aws[a-z-]*:iam::[0-9]{12}:role/.+$",RY="^[a-z][a-z0-9-]{4,28}[a-z0-9]$",CY="^[^@\\s]+@[^@\\s]+\\.iam\\.gserviceaccount\\.com$",PY="^//iam\\.googleapis\\.com/projects/[0-9]+/locations/global/workloadIdentityPools/[^/]+/providers/[^/]+$",qg="^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$",UY=r.Object({type:r.Literal("aws",{description:"Discriminator identifying AWS connection settings."}),accountId:r.String({pattern:OY,description:"AWS account ID that Tsuga scans.",errorMessage:{pattern:"Must be a 12-digit AWS account ID."}}),externalId:u({allowEmpty:!1,description:"External ID Tsuga passes when assuming the cross-account IAM role."}),roleArn:r.String({pattern:xY,minLength:1,maxLength:2048,description:"ARN of the IAM role Tsuga assumes to read inventory in the account.",errorMessage:{pattern:"Must be an IAM role ARN, e.g. arn:aws:iam::123456789012:role/MyRole."}})},{$id:"AwsConnectionSettings"}),wY=r.Object({type:r.Literal("gcp",{description:"Discriminator identifying GCP connection settings."}),projectId:r.String({pattern:RY,minLength:6,maxLength:30,description:"GCP project ID that Tsuga scans.",errorMessage:{pattern:"Must be a GCP project ID (6-30 chars: lowercase letters, digits, hyphens)."}}),serviceAccountId:r.String({pattern:CY,minLength:1,maxLength:128,description:"Service account Tsuga impersonates to read inventory.",errorMessage:{pattern:"Must be a service account email, e.g. name@project.iam.gserviceaccount.com."}}),workloadIdentityProvider:r.String({pattern:PY,minLength:1,maxLength:256,description:"Full resource name of the workload identity provider used for federated authentication, e.g. //iam.googleapis.com/projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider.",errorMessage:{pattern:"Must be the full provider resource name: //iam.googleapis.com/projects/<PROJECT_NUMBER>/locations/global/workloadIdentityPools/<POOL_ID>/providers/<PROVIDER_ID>."}})},{$id:"GcpConnectionSettings"}),vY=r.Object({type:r.Literal("azure",{description:"Discriminator identifying Azure connection settings."}),clientId:r.String({pattern:qg,minLength:1,description:"Client ID of the Azure application Tsuga authenticates as (GUID).",errorMessage:{pattern:"Must be a GUID."}}),subscriptionId:r.String({pattern:qg,minLength:1,description:"Azure subscription ID that Tsuga scans (GUID).",errorMessage:{pattern:"Must be a GUID."}}),tenantId:r.String({pattern:qg,minLength:1,description:"Azure tenant ID that owns the subscription (GUID).",errorMessage:{pattern:"Must be a GUID."}})},{$id:"AzureConnectionSettings"}),Uv=C("type",[UY,wY,vY],{description:"Credentials Tsuga uses to scan the account, in the provider-specific shape selected by `type`. Credentials are stored as provided and are not validated at creation time; failures surface through `lastScanStatus`."}),Wi=r.Object({id:r.String({description:"Identifier of the cloud account. Generated by Tsuga."}),cloudType:r.Enum(_n,{description:"Cloud provider of the account."}),cloudAccountId:r.String({description:"Cloud-native account identifier: an AWS account ID, GCP project ID, or Azure subscription ID."}),accountFriendlyName:r.Optional(r.String({description:"Human-readable name for the account shown in Tsuga."})),organizationId:r.Optional(r.String({description:"Cloud organization identifier, when known."})),createdBy:r.Optional(r.String({description:"Identifier of the user who created the account, when created by a user."})),createdAt:A({description:"Timestamp when the account was registered in Tsuga."}),lastScanStartedAt:r.Optional(A({description:"Timestamp when the most recent inventory scan started."})),lastScanFinishedAt:r.Optional(A({description:"Timestamp when the most recent inventory scan finished."})),lastScanStatus:r.Optional(r.Enum(Cv,{description:"Status of the most recent inventory scan."}))}),Hg=r.Object({cloudType:r.Enum(_n,{description:"Cloud provider of the account."}),cloudAccountId:u({allowEmpty:!1,description:"Cloud-native account identifier: an AWS account ID, GCP project ID, or Azure subscription ID."}),accountFriendlyName:r.Optional(u({description:"Human-readable name for the account shown in Tsuga."})),organizationId:r.Optional(u({description:"Cloud organization identifier, when known."})),connectionSettings:Uv,lastScanStatus:r.Optional(r.Enum(Cv,{description:"Status of the most recent inventory scan."}))}),So=`${bo}/cloud-accounts`,OZe=d({tags:["inventory"],url:So,method:"GET",response:r.Array(Wi)}),xZe=d({tags:["inventory"],url:`${So}/:id`,method:"GET",params:r.Object({id:u()}),response:Wi}),RZe=d({tags:["inventory"],url:So,method:"POST",body:Hg,response:Wi}),Kg=r.Object({accountFriendlyName:u({description:"Human-readable name for the account shown in Tsuga."})}),CZe=d({tags:["inventory"],url:`${So}/:id`,method:"PUT",params:r.Object({id:u()}),body:Kg,response:Wi}),PZe=d({tags:["inventory"],url:`${So}/:id`,method:"DELETE",params:r.Object({id:u()}),response:N}),UZe=d({tags:["inventory"],url:`${bo}/trigger-scan`,method:"POST",body:r.Object({}),response:r.Object({success:r.Literal(!0)})}),wZe=d({tags:["inventory"],url:`${So}/azure/onboarding`,method:"POST",body:r.Object({tenantId:u()}),response:r.Object({subjectId:r.String(),audience:r.String()})}),vZe=d({tags:["inventory"],method:"POST",url:`${So}/validate/:type`,params:r.Object({type:u()}),body:r.Object({data:Uv,id:r.Optional(u())}),response:r.Object({areAccountSettingsValid:r.Boolean(),message:r.Optional(r.String())})}),wv=`${bo}/settings`,NZe=d({tags:["inventory"],url:wv,method:"GET",response:r.Object({settings:r.Optional(r.Object({id:r.String(),infrastructureIdentifiers:r.Array(r.Object({name:r.String(),value:r.Optional(r.String())}))}))})}),NY=50,LZe=d({tags:["inventory"],url:wv,method:"POST",body:r.Object({infrastructureIdentifiers:r.Array(r.Object({name:u({allowEmpty:!1}),value:r.Optional(u({allowEmpty:!1}))}),{maxItems:NY})}),response:r.Object({})}),kZe=d({tags:["inventory"],url:`${bo}/iac-tags-proposal`,method:"GET",response:r.Array(r.Object({name:r.String(),value:r.Optional(r.String())}))});var vv=`/${"v1"}/inventory`,LY=r.Omit(Fg,["nativeAttributes","covered"],{$id:"InventoryResourceBase",description:"Base fields shared by cloud resources discovered during inventory scans. Public inventory resources omit raw provider-native attributes and infrastructure-as-code coverage fields. See [Cloud resources](/documentation/categorize/cloud-resources)."}),Nv=r.Intersect([LY,cl],{$id:"InventoryResource",description:"Cloud resource discovered by an inventory scan, together with normalized category, resource type, and public category-specific attributes. See [Cloud resources](/documentation/categorize/cloud-resources)."}),kY={id:"123-456-abc",cloudPlatform:"aws",cloudAccount:"123456789012",cloudRegion:"us-east-1",fullyQualifiedResourceId:"arn:aws:s3:::tsuga-example-bucket",displayName:"tsuga-example-bucket",nativeResourceType:"aws_s3_bucket",resourceCreatedAt:"2024-01-01T08:00:00.000Z",resourceLastSeenAt:"2024-01-15T12:34:56.000Z",tags:[{key:"team",value:"platform"}],category:"data",resourceType:"bucket",attributes:{versioningStatus:"Enabled"}};Object.assign(Nv,{examples:[kY]});var Lv=r.Object({...Bg.properties,...Ze},{description:"Inventory resource query request. Use filters, sorting, limit, and offset to page through discovered resources."}),MY={filters:{cloudPlatforms:{values:["aws"]},cloudAccounts:{values:["123456789012"]},cloudRegions:{values:["us-east-1"]},resourceTypes:{values:["bucket"]},nativeResourceTypes:{values:["aws_s3_bucket"]},tags:{values:[{key:"team",value:"platform"}]},isIacManaged:!0,searchQuery:{value:"tsuga-example"}},sort:{by:"displayName",direction:"asc"},limit:10,offset:0};Object.assign(Lv,{examples:[MY]});var kv=d({description:"Queries cloud resources discovered by inventory scans, with optional filters, sorting, and pagination. Use this endpoint to build infrastructure inventories across connected cloud accounts.",operationId:"queryInventoryResources",tags:["inventory"],url:`${vv}/resources/query`,method:"POST",paginated:!0,body:Lv,response:r.Array(Nv)}),Ms=`${vv}/cloud-accounts`,Ds=r.Pick(Wi,["id","cloudType","cloudAccountId","accountFriendlyName"],{$id:"CloudAccount"}),DY={id:"123-456-abc",cloudType:"aws",cloudAccountId:"123456789012",accountFriendlyName:"Production AWS"};Object.assign(Ds,{examples:[DY]});var Mv=r.Pick(Hg,["cloudType","cloudAccountId","accountFriendlyName","connectionSettings"]),GY={cloudType:"aws",cloudAccountId:"123456789012",accountFriendlyName:"Production AWS",connectionSettings:{type:"aws",accountId:"123456789012",externalId:"tsuga-external-id",roleArn:"arn:aws:iam::123456789012:role/tsuga-inventory"}};Object.assign(Mv,{examples:[GY]});var $Y=r.Pick(Kg,["accountFriendlyName"]),HZe=d({description:"Lists cloud accounts connected to Tsuga that the authenticated operation key can read.",operationId:"listCloudAccounts",tags:["inventory"],url:Ms,method:"GET",response:r.Array(Ds)}),KZe=d({description:"Retrieves one cloud account by ID.",operationId:"getCloudAccount",tags:["inventory"],url:`${Ms}/:id`,method:"GET",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the cloud account to retrieve. Use the `id` returned by the cloud account list or create operations."})}),response:Ds}),zZe=d({description:"Registers a cloud account for inventory scanning. Connection settings are stored as provided and are not validated at creation time; scan failures surface through `lastScanStatus`.",operationId:"createCloudAccount",tags:["inventory"],url:Ms,method:"POST",body:Mv,response:Ds}),YZe=d({description:"Updates the friendly name of a cloud account by ID.",operationId:"updateCloudAccount",tags:["inventory"],url:`${Ms}/:id`,method:"PUT",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the cloud account to update. Use the `id` returned by the cloud account list or create operations."})}),body:$Y,response:Ds}),VZe=d({description:"Deletes a cloud account by ID. Future inventory scans stop for the account, and the trust relationship on the cloud side can be safely removed afterward.",operationId:"deleteCloudAccount",tags:["inventory"],url:`${Ms}/:id`,method:"DELETE",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the cloud account to delete. Use the `id` returned by the cloud account list or create operations."})}),response:N});var Gs="/v0/investigations",jY=["dashboard","monitor","service","slo","log-route","adaptive-notification-rule"],qY=r.Object({type:r.String({description:'Kind of linked asset, e.g. "dashboard"'}),id:r.String({description:"Identifier of the linked asset"})}),FY=r.Object({type:r.Enum(jY,{description:"Kind of linked asset"}),id:u({allowEmpty:!1,description:"Identifier of the linked asset"})}),Xr=r.Object({id:r.String({description:"Identifier of the investigation"}),name:r.String({description:"Human readable name shown for the investigation"}),slug:r.Optional(r.String({description:'Immutable identifier supplied by the creating agent, e.g. "incident-2024-06-payments-5xx". Set once at creation and matched against the agent telemetry to link back to the run that created the investigation.'})),contentMd:r.Optional(r.String({description:"Markdown content capturing the investigation notes and findings"})),tags:De,owner:r.String({description:"Team ID owning the investigation"}),env:r.Optional(r.String({description:'Environment the investigation relates to, e.g. "prod"'})),linkedAssets:r.Array(qY,{description:"Assets (dashboards, monitors, \u2026) referenced by this investigation"}),creator:r.Optional(pe),updater:r.Optional(pe),createdAt:A({description:"Timestamp the investigation was created at."}),updatedAt:A({description:"Timestamp the investigation was last updated at."})},{title:"Investigation"}),pl=r.Object({name:u({allowEmpty:!1,description:"Human readable name shown for the investigation"}),slug:u({type:"kebab-case",allowEmpty:!1,description:'Immutable, unique identifier supplied by the creating agent, used to link the investigation back to the agent run, e.g. "incident-2024-06-payments-5xx". The agent should also emit this value in its telemetry.'}),contentMd:r.Optional(u({type:"long",description:"Markdown content capturing the investigation notes and findings"})),tags:Xe,owner:u({allowEmpty:!1,description:"Team ID owning the investigation"}),env:r.Optional(u({allowEmpty:!0,description:"Environment the investigation relates to"})),linkedAssets:r.Optional(r.Array(FY,{maxItems:100,description:"Assets (dashboards, monitors, \u2026) referenced by this investigation"}))}),zg=r.Object(r.Omit(pl,["slug"]).properties),rXe=d({tags:["investigations"],url:Gs,method:"GET",paginated:!0,query:r.Object(ge),response:r.Array(Xr)}),nXe=d({tags:["investigations"],url:`${Gs}/:id`,params:r.Object({id:u()}),method:"GET",response:Xr}),oXe=d({tags:["investigations"],url:Gs,method:"POST",body:pl,response:Xr}),iXe=d({tags:["investigations"],url:`${Gs}/:id`,method:"PUT",body:zg,params:r.Object({id:u()}),response:Xr}),aXe=d({tags:["investigations"],url:`${Gs}/:id`,method:"DELETE",params:r.Object({id:u()}),response:N});var $s=`/${"v1"}/investigations`,Dv=d({description:"Retrieve all investigations",tags:["private"],url:$s,method:"GET",paginated:!0,query:r.Object(Ze),response:r.Array(Xr)}),Gv=d({description:"Retrieve an investigation by its id",tags:["private"],url:`${$s}/:id`,method:"GET",params:r.Object({id:u({allowEmpty:!1})}),response:Xr}),$v=d({description:"Create a new investigation",tags:["private"],url:$s,method:"POST",body:pl,response:Xr}),jv=d({description:"Update an investigation by its id",tags:["private"],url:`${$s}/:id`,method:"PUT",body:zg,params:r.Object({id:u({allowEmpty:!1})}),response:Xr}),qv=d({description:"Delete an investigation by its id",tags:["private"],url:`${$s}/:id`,method:"DELETE",params:r.Object({id:u({allowEmpty:!1})}),response:N});var Fv=15,ul={id:r.String({description:"Unique identifier of the processor within the route. Used to preserve processor identity during updates."}),description:r.Optional(r.String({description:"Optional user-provided processor note."})),tags:De,updatedAt:r.Optional(A({description:"Timestamp when Tsuga last updated the processor."}))},ll={id:u({allowEmpty:!1,description:"Unique identifier of the processor within the route. Preserve it across updates for existing processors."}),description:r.Optional(u({type:"long",description:"Optional processor note."})),tags:Xe,updatedAt:r.Optional(A({description:"Backend-maintained timestamp for this processor. Omit this field on create and update requests; Tsuga sets or preserves it based on processor changes."}))},Bv={...ul,type:r.Literal("creator",{description:"Create processor. It writes a new attribute from a format string, formula, or category rule."})},Hv={...ll,type:r.Literal("creator",{description:"Create processor. It writes a new attribute from a format string, formula, or category rule."})},BY=C("subtype",[r.Object({targetAttribute:r.String({description:"Attribute that will receive the formatted value"}),formatString:r.String({description:"Template string used to build the target attribute value"}),overrideTarget:r.Optional(r.Boolean({description:"Whether to overwrite the target attribute when it already exists. If omitted, route processing treats this as true."})),subtype:r.Literal("format-string",{description:"Builds a string from literal text and existing attribute values."}),replaceMissingByEmpty:r.Optional(r.Boolean({description:"Whether missing referenced attributes render as empty strings. If omitted, route processing treats this as true."}))},{$id:"ProcessorParamsCreatorFormatString"}),r.Object({targetAttribute:r.String({description:"Attribute that will receive the computed value"}),formula:r.String({description:"Mathematical formula evaluated to populate the target attribute"}),overrideTarget:r.Optional(r.Boolean({description:"Whether to overwrite the target attribute when it already exists. If omitted, route processing treats this as true."})),subtype:r.Literal("math-formula",{description:"Evaluates a mathematical expression and writes the numeric result."}),replaceMissingBy0:r.Optional(r.Boolean({description:"Whether missing referenced attributes evaluate as zero. If omitted, route processing treats this as true."}))},{$id:"ProcessorParamsCreatorMathFormula"}),r.Object({targetAttribute:r.String({description:"Attribute that will receive the category value"}),clauses:r.Array(r.Object({query:r.String({description:"Query that selects logs for this category clause. Clauses are evaluated in order."}),value:r.String({description:"String category value assigned when this clause matches."})}),{description:"Conditions evaluated in order to determine the category value. The first matching clause wins."}),defaultValue:r.Optional(r.String({description:"String category value used when no clause matches. If omitted and no clause matches, no category value is written."})),subtype:r.Literal("category",{description:"Assigns the first matching category value from ordered query clauses, with an optional default."})},{$id:"ProcessorParamsCreatorCategory"})],{description:"Create processor configuration. The `subtype` discriminator selects how the value written to `targetAttribute` is built and which fields are required."}),HY=C("subtype",[r.Object({targetAttribute:u({allowEmpty:!1,description:"Attribute that will receive the formatted value"}),formatString:u({allowEmpty:!1,type:"long",description:"Template string used to build the target attribute value"}),overrideTarget:r.Optional(r.Boolean({description:"Set to true to overwrite an existing target attribute value (defaults to true)"})),subtype:r.Literal("format-string",{description:"Builds a string from literal text and existing attribute values."}),replaceMissingByEmpty:r.Optional(r.Boolean({description:"Set to true for missing referenced attributes to render as empty strings. Defaults to true."}))},{$id:"InputProcessorParamsCreatorFormatString"}),r.Object({targetAttribute:u({allowEmpty:!1,description:"Attribute that will receive the computed value"}),formula:u({allowEmpty:!1,type:"long",description:"Mathematical formula evaluated to populate the target attribute"}),overrideTarget:r.Optional(r.Boolean({description:"Set to true to overwrite an existing target attribute value (defaults to true)"})),subtype:r.Literal("math-formula",{description:"Evaluates a mathematical expression and writes the numeric result."}),replaceMissingBy0:r.Optional(r.Boolean({description:"Set to true for missing referenced attributes to evaluate as zero. Defaults to true."}))},{$id:"InputProcessorParamsCreatorMathFormula"}),r.Object({targetAttribute:u({allowEmpty:!1,description:"Attribute that will receive the category value"}),clauses:r.Array(r.Object({query:u({allowEmpty:!1,type:"tsuga-query",description:"Query that selects logs for this category clause. Clauses are evaluated in order."}),value:u({allowEmpty:!1,description:"String category value assigned when this clause matches."})}),{minItems:1,maxItems:Fv,description:"Conditions evaluated in order to determine the category value. The first matching clause wins."}),defaultValue:r.Optional(u({description:"String category value used when no clause matches. If omitted and no clause matches, no category value is written."})),subtype:r.Literal("category",{description:"Assigns the first matching category value from ordered query clauses, with an optional default."})},{$id:"InputProcessorParamsCreatorCategory"})],{description:"Create processor configuration. The `subtype` discriminator selects how the value written to `targetAttribute` is built and which fields are required."}),KY=r.Object({...Bv,params:BY}),zY=r.Object({...Hv,params:HY}),Kv={...ul,type:r.Literal("mapper",{description:"Map processor. It moves, copies, or normalizes existing log attributes."})},zv={...ll,type:r.Literal("mapper",{description:"Map processor. It moves, copies, or normalizes existing log attributes."})},YY=C("subtype",[r.Object({attributes:r.Array(r.Object({originAttribute:r.String({description:"Attribute name to map to the target attribute"}),keepOrigin:r.Optional(r.Boolean({description:"Whether the source attribute is preserved after mapping. If omitted, route processing treats this as false."})),overrideTarget:r.Optional(r.Boolean({description:"Whether to overwrite the target attribute when it already exists. If omitted, route processing treats this as true."})),targetAttribute:r.String({description:"Attribute name that will receive the mapped value"})}),{description:"Mappings that map individual attributes to new targets"}),subtype:r.Literal("map-attributes",{description:"Copies or moves one or more source attributes to target attributes."})},{$id:"ProcessorParamsMapperMapAttributes"}),r.Object({attributeName:r.String({description:"Attribute whose value will determine the log level"}),subtype:r.Literal("map-level",{description:"Normalizes a severity or status attribute into Tsuga log levels."})},{$id:"ProcessorParamsMapperMapLevel"}),r.Object({attributeName:r.String({description:"Attribute whose value will determine the log timestamp"}),subtype:r.Literal("map-timestamp",{description:"Uses an event-time attribute as the log timestamp."})},{$id:"ProcessorParamsMapperMapTimestamp"})],{description:"Map processor configuration. The `subtype` discriminator selects whether existing attributes are copied or moved to new names, or used to set the log level or timestamp."}),VY=C("subtype",[r.Object({attributes:r.Array(r.Object({originAttribute:u({allowEmpty:!1,description:"Attribute name to map to the target attribute"}),keepOrigin:r.Optional(r.Boolean({description:"Preserve the source attribute after mapping (defaults to false)"})),overrideTarget:r.Optional(r.Boolean({description:"Overwrite the target attribute when it already exists (defaults to true)"})),targetAttribute:u({allowEmpty:!1,description:"Attribute name that will receive the mapped value"})}),{minItems:1,maxItems:50,description:"Mappings that map individual attributes to new targets"}),subtype:r.Literal("map-attributes",{description:"Copies or moves one or more source attributes to target attributes."})},{$id:"InputProcessorParamsMapperMapAttributes"}),r.Object({attributeName:u({allowEmpty:!1,description:"Attribute whose value will determine the log level"}),subtype:r.Literal("map-level",{description:"Normalizes a severity or status attribute into Tsuga log levels."})},{$id:"InputProcessorParamsMapperMapLevel"}),r.Object({attributeName:u({allowEmpty:!1,description:"Attribute whose value will determine the log timestamp"}),subtype:r.Literal("map-timestamp",{description:"Uses an event-time attribute as the log timestamp."})},{$id:"InputProcessorParamsMapperMapTimestamp"})],{description:"Map processor configuration. The `subtype` discriminator selects whether existing attributes are copied or moved to new names, or used to set the log level or timestamp."}),QY=r.Object({...zv,params:VY}),WY=r.Object({...Kv,params:YY}),Yv={...ul,type:r.Literal("parse-attribute",{description:"Parse processor. It extracts structured fields from a text attribute."})},Vv={...ll,type:r.Literal("parse-attribute",{description:"Parse processor. It extracts structured fields from a text attribute."})},Qv=5,ZY=C("subtype",[r.Object({attributeName:r.String({description:"Attribute whose value will be parsed with Grok rules"}),rules:r.Array(r.String({description:"Grok rule applied to parse text. Route processing sends rules as engine patterns."}),{description:"Ordered Grok rules evaluated until one matches."}),samples:r.Optional(r.Array(r.String(),{description:"Example log lines for validating the Grok rules. Samples are not sent to the ingestion engine."})),subtype:r.Literal("grok",{description:"Extracts fields from unstructured text using ordered Grok rules."})}),r.Object({sourceAttribute:r.String({description:"Attribute containing the URL to parse"}),subtype:r.Literal("url",{description:"Parses a URL attribute and writes URL detail fields."})}),r.Object({sourceAttribute:r.String({description:"Attribute containing the user agent string to parse"}),subtype:r.Literal("user-agent",{description:"Parses a user-agent string and writes browser, operating system, and device details."})}),r.Object({sourceAttribute:r.String({description:"Attribute containing the key/value string segment to parse"}),targetAttribute:r.String({description:"Target map attribute where extracted key/value pairs will be written"}),keyValueSplitter:r.String({description:"Delimiter separating keys from values in the source string"}),pairsSplitter:r.String({description:"Delimiter separating each key/value pair in the source string."}),acceptStandaloneKey:r.Boolean({description:"Whether keys without explicit values are accepted by the parser."}),subtype:r.Literal("key-value",{description:"Parses delimited key/value text into attributes."})})],{description:"Parse processor configuration. The `subtype` discriminator selects which parser reads the source text attribute and which fields it extracts."}),XY=C("subtype",[r.Object({attributeName:u({allowEmpty:!1,description:"Attribute whose value will be parsed with Grok rules"}),rules:r.Array(u({allowEmpty:!1,type:"long",description:"Grok rule applied to parse text. Route processing sends rules as engine patterns."}),{minItems:1,maxItems:5,description:"Ordered Grok rules evaluated until one matches."}),samples:r.Optional(r.Array(u({type:"long"}),{maxItems:Qv,description:"Example log lines for validating the Grok rules. Samples are not sent to the ingestion engine."})),subtype:r.Literal("grok",{description:"Extracts fields from unstructured text using ordered Grok rules."})}),r.Object({sourceAttribute:u({allowEmpty:!1,description:"Attribute containing the URL to parse"}),subtype:r.Literal("url",{description:"Parses a URL attribute and writes URL detail fields."})}),r.Object({sourceAttribute:u({allowEmpty:!1,description:"Attribute containing the user agent string to parse"}),subtype:r.Literal("user-agent",{description:"Parses a user-agent string and writes browser, operating system, and device details."})}),r.Object({sourceAttribute:u({allowEmpty:!1,description:"Attribute containing the key/value string segment to parse"}),targetAttribute:u({description:"Target map attribute where extracted key/value pairs will be written"}),keyValueSplitter:u({allowEmpty:!1,description:"Delimiter separating keys from values in the source string"}),pairsSplitter:u({allowEmpty:!0,description:"Delimiter separating each key/value pair in the source string."}),acceptStandaloneKey:r.Boolean({description:"Set to true to accept keys without explicit values."}),subtype:r.Literal("key-value",{description:"Parses delimited key/value text into attributes."})})],{description:"Parse processor configuration. The `subtype` discriminator selects which parser reads the source text attribute and which fields it extracts."}),JY=r.Object({...Yv,params:ZY}),e9=r.Object({...Vv,params:XY}),t9=r.Object({...Hv,params:C("subtype",[r.Object({targetAttribute:u({allowEmpty:!1,description:"Attribute that will receive the formatted value"}),formatString:u({allowEmpty:!1,type:"long",description:"Template string used to build the target attribute value"}),overrideTarget:r.Optional(r.Boolean({description:"Set to true to overwrite an existing target attribute value (defaults to true)"})),subtype:r.Literal("format-string"),replaceMissingByEmpty:r.Optional(r.Boolean({description:"Set to true for missing referenced attributes to render as empty strings. Defaults to true."}))}),r.Object({targetAttribute:u({allowEmpty:!1,description:"Attribute that will receive the category value"}),clauses:r.Array(r.Object({query:u({allowEmpty:!1,type:"tsuga-query",description:"Query that selects logs for this category clause. Clauses are evaluated in order."}),value:u({allowEmpty:!1,description:"String category value assigned when this clause matches."})}),{minItems:1,maxItems:Fv,description:"Conditions evaluated in order to determine the category value. The first matching clause wins."}),defaultValue:r.Optional(u({description:"String category value used when no clause matches."})),subtype:r.Literal("category")})])}),r9=r.Object({...zv,params:r.Object({attributes:r.Array(r.Object({originAttribute:u({allowEmpty:!1,description:"Attribute name to map to the target attribute"}),keepOrigin:r.Optional(r.Boolean({description:"Preserve the source attribute after mapping (defaults to false)"})),overrideTarget:r.Optional(r.Boolean({description:"Overwrite the target attribute when it already exists (defaults to true)"})),targetAttribute:u({allowEmpty:!1,description:"Attribute name that will receive the mapped value"})}),{minItems:1,maxItems:50,description:"Mappings that map individual attributes to new targets"}),subtype:r.Literal("map-attributes")})}),n9=r.Object({...Vv,params:r.Object({attributeName:u({allowEmpty:!1,description:"Attribute whose value will be parsed with Grok rules"}),rules:r.Array(u({allowEmpty:!1,type:"long",description:"Grok rule applied to parse text. Route processing sends rules as engine patterns."}),{minItems:1,maxItems:5,description:"Ordered Grok rules evaluated until one matches."}),samples:r.Optional(r.Array(u({type:"long"}),{maxItems:Qv,description:"Example log lines for validating the Grok rules."})),subtype:r.Literal("grok")})}),EXe=C("type",[r9,n9,t9]),o9=r.Object({...Bv,params:C("subtype",[r.Object({targetAttribute:r.String({description:"Attribute that will receive the formatted value"}),formatString:r.String({description:"Template string used to build the target attribute value"}),overrideTarget:r.Optional(r.Boolean({description:"Whether to overwrite the target attribute when it already exists."})),subtype:r.Literal("format-string"),replaceMissingByEmpty:r.Optional(r.Boolean({description:"Whether missing referenced attributes render as empty strings."}))}),r.Object({targetAttribute:r.String({description:"Attribute that will receive the category value"}),clauses:r.Array(r.Object({query:r.String({description:"Query that selects logs for this category clause."}),value:r.String({description:"String category value assigned when this clause matches."})}),{description:"Conditions evaluated in order to determine the category value."}),defaultValue:r.Optional(r.String({description:"String category value used when no clause matches."})),subtype:r.Literal("category")})])}),i9=r.Object({...Kv,params:r.Object({attributes:r.Array(r.Object({originAttribute:r.String({description:"Attribute name to map to the target attribute"}),keepOrigin:r.Optional(r.Boolean({description:"Whether the source attribute is preserved after mapping."})),overrideTarget:r.Optional(r.Boolean({description:"Whether to overwrite the target attribute when it already exists."})),targetAttribute:r.String({description:"Attribute name that will receive the mapped value"})}),{description:"Mappings that map individual attributes to new targets"}),subtype:r.Literal("map-attributes")})}),a9=r.Object({...Yv,params:r.Object({attributeName:r.String({description:"Attribute whose value will be parsed with Grok rules"}),rules:r.Array(r.String({description:"Grok rule applied to parse text."}),{description:"Ordered Grok rules evaluated until one matches."}),samples:r.Optional(r.Array(r.String(),{description:"Example log lines for validating the Grok rules."})),subtype:r.Literal("grok")})}),_Xe=C("type",[i9,a9,o9]),s9=11,Wv=r.Cyclic({OutputProcessor:r.Union([WY,JY,KY,r.Object({...ul,params:r.Object({items:r.Array(r.Object({query:r.String({description:"Query that determines whether logs enter this branch"}),processors:r.Array(r.Ref("OutputProcessor"),{description:"Processors executed when the branch query matches"})}),{description:"Conditional branches evaluated in order before falling back to the default"})}),type:r.Literal("split",{description:"Split processor. It sends each log through the first matching conditional branch."})})])},"OutputProcessor",{description:"Processing step executed sequentially on route logs"}),Zv=r.Cyclic({InputProcessor:r.Union([QY,e9,zY,r.Object({...ll,params:r.Object({items:r.Array(r.Object({query:u({type:"tsuga-query",description:"Query that determines whether logs enter this branch"}),processors:r.Array(r.Ref("InputProcessor"),{maxItems:50,description:"Processors executed when the branch query matches"})}),{minItems:2,maxItems:s9,description:"Conditional branches evaluated in order before falling back to the default"})}),type:r.Literal("split",{description:"Split processor. It sends each log through the first matching conditional branch."})})])},"InputProcessor",{description:"Processing step executed sequentially on route logs"});var c9="/v0/logs",vn=`${c9}/routes`,Nn=r.Object({id:r.String({description:"Tsuga-generated log route ID assigned when the route is created."}),name:r.String({description:"Human-readable route name shown in Tsuga."}),description:r.Optional(r.String({description:"Optional free-text note about the route's purpose, set by the caller. This metadata is not evaluated when matching or processing logs."})),isEnabled:r.Boolean({description:"Whether this route is active for newly ingested logs. Disabled routes remain saved but do not process logs."}),query:r.String({description:"Tsuga query that selects which newly ingested logs enter the route processor chain."}),rank:r.Number({description:"Tsuga-assigned evaluation order, unique across all routes and dense (no gaps). Enabled routes are checked from lower rank to higher rank during ingestion, and every route whose query matches a log applies its processors to it \u2014 matching is not stopped after the first hit. New routes are appended with the highest rank; deleting a route shifts all higher ranks down by one to close the gap. Use `PUT /:id/modify-ranking` to move a route to a different rank, which shifts the routes between its old and new position accordingly."}),tags:De,owner:r.String({description:"ID of the team that owns the route. Determines which team members can view and manage it, and which tag policies apply to it. Only an org admin or an admin of this team may change the `query` field or delete the route."}),processors:r.Array(Wv,{description:"Processors applied in array order to logs that match the route, each transforming the output of the previous one. A `split` processor forks the chain into branches and cannot be followed by another processor at the same level."}),creator:r.Optional(pe),updater:r.Optional(pe),updatedAt:A({description:"Timestamp when Tsuga last updated the route."}),createdAt:A({description:"Timestamp when Tsuga created the route."}),assetUpdatedAt:A({description:"Timestamp when Tsuga last changed route behavior. This can differ from `updatedAt` when only metadata such as `description` or `tags` changed."})},{title:"LogRoute"}),js=r.Object({name:u({allowEmpty:!1,description:"Human-readable log route name shown in Tsuga."}),description:r.Optional(u({type:"long",description:"Optional free-text note about the log route's purpose. This metadata is not evaluated when matching or processing logs."})),isEnabled:r.Boolean({description:"Set to true for the log route to process newly ingested matching logs. Set to false to save it without running it."}),query:u({type:"tsuga-query",description:"Tsuga query that selects which newly ingested logs enter the log route processor chain."}),tags:Xe,owner:u({allowEmpty:!1,description:"ID of the team that will own the log route, determining which team members can view and manage it and which tag policies apply. Only an org admin or an admin of this team may change the `query` field or delete the log route."}),processors:r.Array(Zv,{maxItems:50,description:"Processors applied in array order to logs that match the log route, each transforming the output of the previous one. Up to 50 are accepted. A `split` processor forks the chain into branches and cannot be followed by another processor at the same level."})});var PXe=d({tags:["routes"],url:vn,method:"GET",paginated:!0,query:r.Object(ge),response:r.Array(Nn)}),UXe=d({tags:["routes"],url:`${vn}/:id`,params:r.Object({id:u()}),method:"GET",response:Nn}),wXe=d({tags:["routes"],url:vn,method:"POST",body:js,response:Nn}),vXe=d({tags:["routes"],url:`${vn}/:id`,method:"PUT",body:js,params:r.Object({id:u()}),response:Nn}),NXe=d({tags:["routes"],url:`${vn}/:id/clone`,method:"POST",params:r.Object({id:u()}),body:js,response:Nn}),LXe=d({tags:["routes"],url:`${vn}/:id`,method:"DELETE",params:r.Object({id:u()}),response:N}),kXe=d({description:"Moves a route to a new rank, shifting the ranks of the routes between its old and new position by one to keep ranks dense and unique. Affects the route's evaluation order for newly ingested logs; does not change any route's processors or other fields.",tags:["routes"],url:`${vn}/:id/modify-ranking`,method:"PUT",params:r.Object({id:u()}),body:r.Object({rank:r.Integer({minimum:1,description:"Target rank for the route, from 1 to the total number of routes. Requests outside that range are rejected."})}),response:r.Object({})}),MXe=d({description:"Sets a route's `isEnabled` state without changing any other field. Disabling a route stops it from processing newly ingested logs while keeping it saved and its rank unchanged.",tags:["routes"],url:`${vn}/:id/enable`,method:"PUT",params:r.Object({id:u()}),body:r.Object({enable:r.Boolean({description:"Set to true to enable the route, or false to disable it."})}),response:Nn});var qs=`/${"v1"}/routes`,Xv={name:"Enrich API Gateway Logs",description:"Adds service metadata and normalizes log format",isEnabled:!0,query:"service:api-gateway",tags:[{key:"category",value:"enrichment"}],owner:"team-123-abc",processors:[{id:"parse-gateway-message",type:"parse-attribute",tags:[],params:{subtype:"grok",attributeName:"message",rules:["%{TIMESTAMP_ISO8601:timestamp} %{LOGLEVEL:level} %{GREEDYDATA:msg}"]}}]},Jv={name:"Normalize Checkout Logs",description:"Maps service fields and extracts key/value details",isEnabled:!0,query:"context.service.name:checkout",tags:[{key:"category",value:"normalization"}],owner:"team-123-abc",processors:[{id:"map-service-name",type:"mapper",tags:[],params:{subtype:"map-attributes",attributes:[{originAttribute:"context.service.name",targetAttribute:"service",keepOrigin:!1,overrideTarget:!0}]}},{id:"parse-logfmt-message",type:"parse-attribute",tags:[],params:{subtype:"key-value",sourceAttribute:"message",targetAttribute:"logfmt",keyValueSplitter:"=",pairsSplitter:" ",acceptStandaloneKey:!1}}]},Fs=r.Pick(Nn,["id","name","description","isEnabled","query","tags","owner","processors"],{$id:"Route",description:"Team-owned log processing definition that selects newly ingested logs and applies ordered processors. See [Routes](/documentation/process/routes/index)."}),p9={id:"123-456-abc",...Xv},u9={id:"456-789-def",...Jv};Object.assign(Fs,{examples:[p9,u9]});var eN=d({description:"Lists log routes visible to the authenticated operation key. Returned routes are ordered by evaluation order, with earlier routes evaluated first. Use this to inventory ingest-time processing definitions and owners. Pagination fields limit the returned page.",operationId:"listRoutes",tags:["routes"],url:qs,method:"GET",paginated:!0,query:r.Object(Ze),response:r.Array(Fs)}),tN=d({description:"Retrieves one log route by ID.",operationId:"getRoute",tags:["routes"],url:`${qs}/:id`,method:"GET",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the log route to retrieve. Use the `id` returned by route list or create responses."})}),response:Fs}),Yg=r.Pick(js,["name","description","isEnabled","query","tags","owner","processors"],{description:"Log route create or update request. Provide the route metadata, source query, owner team, enabled state, tags, and ordered processors."});Object.assign(Yg,{examples:[Xv,Jv]});var rN=d({description:"Creates a log route at the end of the evaluation order. Routes affect only newly ingested logs after the cluster receives the updated configuration.",operationId:"createRoute",tags:["routes"],url:qs,method:"POST",body:Yg,response:Fs}),nN=d({description:"Updates an existing log route by ID without changing its evaluation order. Fields omitted from the request keep their existing values. Routes affect only newly ingested logs after the cluster receives the updated configuration.",operationId:"updateRoute",tags:["routes"],url:`${qs}/:id`,method:"PUT",body:Yg,params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the log route to update. Use the `id` returned by route list, get, or create responses."})}),response:Fs}),oN=d({description:"Deletes a log route by ID and compacts the evaluation order for remaining routes. The route stops processing future logs after the cluster receives the updated configuration.",operationId:"deleteRoute",tags:["routes"],url:`${qs}/:id`,method:"DELETE",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the log route to delete. Use the `id` returned by route list, create, or update responses."})}),response:N});var Bs=`/${"v1"}/monitors`,Hs=r.Pick(Fr,["id","name","message","tags","configuration","priority","owner","dashboardId","permissions","clusterIds"],{$id:"Monitor",description:"Saved alert definition that evaluates telemetry and creates alert transitions. Notification delivery is configured separately with notification rules. See [Monitors](/documentation/alert/monitors/index)."}),aN={name:"High Error Rate Alert",message:"Error rate exceeded threshold. Check the API gateway logs.",tags:[{key:"severity",value:"critical"}],configuration:{type:"log",timeframe:5,groupByFields:[],aggregationAlertLogic:"no_aggregation",queries:[{aggregate:{type:"count"},filter:"level:ERROR service:api-gateway"}],conditions:[{formula:"q1",operator:"greater_than",threshold:100}],noDataBehavior:"resolve"},priority:1,owner:"team-123-abc",dashboardId:"789-abc-def",permissions:"all",clusterIds:[]},sN={name:"High CPU Utilization By Service",message:"More than half of grouped services are above the CPU threshold.",tags:[{key:"severity",value:"warning"}],configuration:{type:"metric",timeframe:10,groupByFields:[{fields:["context.service.name"],limit:10}],aggregationAlertLogic:"proportion",proportionAlertThreshold:50,queries:[{aggregate:{type:"average",field:"system.cpu.utilization"},filter:"context.service.name:checkout"}],conditions:[{formula:"q1",operator:"greater_than",threshold:.8}],noDataBehavior:"keep_last_status"},priority:2,owner:"team-123-abc",dashboardId:"789-abc-def",permissions:"all",clusterIds:[]},cN={name:"Certificate Expiry Warning",message:"A certificate is approaching expiry.",tags:[{key:"environment",value:"production"}],configuration:{type:"certificate-expiry",warnBeforeInDays:30,cloudAccounts:["aws-prod"],aggregationAlertLogic:"each",noDataBehavior:"resolve"},priority:3,owner:"team-123-abc",dashboardId:"789-abc-def",permissions:"all",clusterIds:[]},pN={name:"New Error Pattern Detector",message:"A new error pattern was detected in the logs.",tags:[{key:"team",value:"platform"}],configuration:{type:"log-error-pattern",aggregationAlertLogic:"each",noDataBehavior:"keep_last_status",filter:{teamIds:["team-123-abc"],env:"production",service:"api-gateway"}},priority:2,owner:"team-123-abc",dashboardId:"789-abc-def",permissions:"all",clusterIds:[]},l9={id:"123-456-abc",...aN},m9={id:"234-567-bcd",...sN},d9={id:"345-678-cde",...cN},f9={id:"456-789-def",...pN};Object.assign(Hs,{examples:[l9,m9,d9,f9]});var iN=r.Pick(Nd,["filters","sort","limit","offset"]),uN=r.Object({...iN.properties,...Ze,filters:iN.properties.filters},{description:"Monitor query request. Use filters, sorting, limit, and offset to page through visible monitors."}),g9={filters:{owners:{values:["team-123-abc"]},searchQuery:{value:"service:api-gateway"},tags:{values:[{key:"paging",value:"true"}]},priorities:{values:[4,5],exclude:!0},types:{values:["threshold"]},activity:"active",clusterIds:{values:["cluster-123-abc"]}},sort:{by:"name",direction:"asc"},limit:10,offset:0};Object.assign(uN,{examples:[g9]});var lN=d({description:"Queries monitors visible to the authenticated operation key. Use this endpoint to inventory monitor definitions, filter by owner, tag, priority, type, activity, or cluster, and page through results. See [Monitors](/documentation/alert/monitors/index).",operationId:"queryMonitors",tags:["monitors"],url:`${Bs}/query`,method:"POST",paginated:!0,body:uN,response:r.Array(Hs)}),mN=d({description:"Retrieves one monitor definition by ID.",operationId:"getMonitor",tags:["monitors"],url:`${Bs}/:id`,method:"GET",params:r.Object({id:u({allowEmpty:!1,description:"Monitor ID returned by monitor query, create, or update operations."})}),response:Hs}),dN=["name","message","tags","configuration","priority","owner","dashboardId","permissions","clusterIds"],fN=r.Pick(os,dN,{$id:"CreateMonitorRequest",description:"Monitor creation request. Provide ownership, data access, alert configuration, priority, tags, and optional dashboard or cluster scope."}),gN=r.Pick(os,dN,{$id:"UpdateMonitorRequest",description:"Monitor update request. Required fields and the submitted configuration are overwritten; omitted `message`, `tags`, and `clusterIds` keep their existing values. Omitting `dashboardId` clears the dashboard link."}),hN=aN,yN=sN,TN=cN,EN=pN;Object.assign(fN,{examples:[hN,yN,TN,EN]});Object.assign(gN,{examples:[hN,yN,TN,EN]});var _N=d({description:"Creates a monitor owned by the specified team. The monitor can evaluate logs, metrics, traces, anomaly behavior, certificate expiry, or new error patterns depending on its configuration.",operationId:"createMonitor",tags:["monitors"],url:Bs,method:"POST",body:fN,response:Hs}),IN=d({description:"Updates an existing monitor definition by ID. Required fields and the submitted configuration are overwritten; omitted `message`, `tags`, and `clusterIds` keep their existing values. Omitting `dashboardId` clears the dashboard link, and public updates clear any existing snooze because `pauseUntil` is not part of the public schema.",operationId:"updateMonitor",tags:["monitors"],url:`${Bs}/:id`,method:"PUT",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the saved monitor to update. Use the `id` returned by monitor query or create responses."})}),body:gN,response:Hs}),h9=r.Object({id:u({allowEmpty:!1,description:"Identifier of the saved monitor to delete. Use the `id` returned by monitor query, create, or update responses."})}),bN=d({description:"Deletes a monitor by ID. Deleting a monitor stops future evaluations and alert transitions for that monitor.",operationId:"deleteMonitor",tags:["monitors"],url:`${Bs}/:id`,method:"DELETE",params:h9,response:N});var Ks=`/${"v1"}/notification-rules`,zs=r.Pick(hi,["id","name","queryString","teamsFilter","prioritiesFilter","transitionTypesFilter","clusterIdsFilter","owner","isActive","tags","targets"],{$id:"Rule",description:"Notification rule that matches alert transitions and routes notifications to one or more targets. See [Rules](/documentation/alert/notifications/rules)."}),SN={name:"Critical Alerts",queryString:"env:prod service:api",teamsFilter:{type:"all-public-teams"},prioritiesFilter:[1,2],transitionTypesFilter:["triggered","resolved"],clusterIdsFilter:[],owner:"team-123-abc",isActive:!0,tags:[{key:"channel",value:"alerts"}],targets:[{id:"789-abc-def",rateLimit:{maxMessages:10,minutes:5},config:{type:"email",addresses:["oncall@example.com"],renotifyConfig:{mode:"each",renotificationStates:["alert"],renotifyIntervalMinutes:30}}}]},y9={id:"123-456-abc",...SN};Object.assign(zs,{examples:[y9]});var AN=d({description:"Lists notification rules visible to the authenticated operation key. Use this endpoint to audit alert delivery routing. Pagination fields limit the returned page.",operationId:"listNotificationRules",tags:["notification-rules"],url:Ks,method:"GET",paginated:!0,query:r.Object(Ze),response:r.Array(zs)}),ON=d({description:"Retrieves one notification rule by ID.",operationId:"getNotificationRule",tags:["notification-rules"],url:`${Ks}/:id`,method:"GET",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the notification rule to retrieve. Use the `id` returned by notification rule list or create responses."})}),response:zs}),Vg=r.Pick(ss,["name","queryString","teamsFilter","prioritiesFilter","transitionTypesFilter","clusterIdsFilter","owner","tags","isActive","targets"],{description:"Notification rule create or update request. Provide matching filters, owner, tags, active state, and delivery targets."}),T9=SN;Object.assign(Vg,{examples:[T9]});var xN=d({description:"Creates a notification rule that matches alert transitions and sends notifications to configured targets. Monitors keep evaluating separately from notification rules.",operationId:"createNotificationRule",tags:["notification-rules"],url:Ks,method:"POST",body:Vg,response:zs}),RN=d({description:"Updates an existing notification rule by ID. Required fields and the submitted target list are overwritten; omitted optional fields keep their existing values.",operationId:"updateNotificationRule",tags:["notification-rules"],url:`${Ks}/:id`,method:"PUT",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the notification rule to update. Use the `id` returned by notification rule list, get, or create responses."})}),body:Vg,response:zs}),E9=r.Object({id:u({allowEmpty:!1,description:"Identifier of the notification rule to delete. Use the `id` returned by notification rule list, get, create, or update responses."})}),CN=d({description:"Deletes a notification rule by ID. Alerting monitors continue to evaluate, but this rule no longer sends notifications.",operationId:"deleteNotificationRule",tags:["notification-rules"],url:`${Ks}/:id`,method:"DELETE",params:E9,response:N});var Zi=`${fi}/silences`,PN=r.Union([r.Literal("monday"),r.Literal("tuesday"),r.Literal("wednesday"),r.Literal("thursday"),r.Literal("friday"),r.Literal("saturday"),r.Literal("sunday")]),_9=r.Partial(r.Record(PN,r.Array(r.Object({startTime:r.String({format:Gm,description:"Local start time for this recurring silence window on this day, using the schedule time zone."}),endTime:r.String({format:Gm,description:"Local end time for this recurring silence window on this day. It must be after `startTime`, and ranges on the same day cannot overlap."})},{title:"SilenceTimeRange"}),{minItems:1,description:"Silence windows for this day. Each window uses the schedule time zone, and windows on the same day cannot overlap."})),{description:"Recurring silence windows keyed by day of week, evaluated in the schedule `timeZone` or in UTC when it is omitted. At least one day must be listed, and a day with no entry is never silenced. Each window covers `startTime` up to but not including `endTime`."}),I9=r.Partial(r.Record(PN,r.Array(r.Object({startTime:r.String({description:"Local start time for this recurring silence window on this day, using the schedule time zone."}),endTime:r.String({description:"Local end time for this recurring silence window on this day. It must be after `startTime`, and ranges on the same day cannot overlap."})},{title:"SilenceTimeRange"}),{description:"Silence windows for this day. Each window uses the schedule time zone, and windows on the same day cannot overlap."})),{description:"Recurring silence windows keyed by day of week, evaluated in the schedule `timeZone` or in UTC when it is omitted. A day with no entry is never silenced. Each window covers `startTime` up to but not including `endTime`."}),ml='IANA timezone identifier (e.g. "America/New_York"). Defaults to UTC if omitted.',UN="One-time silence schedule with specific start and end times",wN="Recurring weekly silence schedule",b9=C("type",[r.Object({type:r.Literal("one-time",{description:"Silence active once between the configured start and end times."}),startTime:r.String({format:$m,description:"Local start date and time for the one-time silence, interpreted in `timeZone` when provided."}),endTime:r.String({format:$m,description:"Local end date and time for the one-time silence. It must be after `startTime` and in the future."}),timeZone:r.Optional(r.String({format:Dm,description:ml}))},{$id:"InputSilenceScheduleOneTime",description:UN}),r.Object({type:r.Literal("recurring",{description:"Silence active on a recurring weekly schedule."}),weeklySchedule:_9,timeZone:r.Optional(r.String({format:Dm,description:ml}))},{$id:"InputSilenceScheduleRecurring",description:wN})],{description:"Schedule defining when the silence is active. The `type` field discriminates between a `one-time` window and a `recurring` weekly window. Once a one-time schedule's `endTime` passes, or a recurring window closes, the silence stops suppressing notifications but is not deleted; delete it explicitly if it is no longer needed."}),S9=C("type",[r.Object({type:r.Literal("one-time",{description:"Silence active once between the configured start and end times."}),startTime:r.String({description:"Local start date and time for the one-time silence, interpreted in `timeZone` when provided."}),endTime:r.String({description:"Local end date and time for the one-time silence. It must be after `startTime` and in the future when created or updated."}),timeZone:r.Optional(r.String({description:ml}))},{$id:"OutputSilenceScheduleOneTime",description:UN}),r.Object({type:r.Literal("recurring",{description:"Silence active on a recurring weekly schedule."}),weeklySchedule:I9,timeZone:r.Optional(r.String({description:ml}))},{$id:"OutputSilenceScheduleRecurring",description:wN})],{description:"Schedule defining when the silence is active. The `type` field discriminates between a `one-time` window and a `recurring` weekly window. Once a one-time schedule's `endTime` passes, or a recurring window closes, the silence stops suppressing notifications but is not deleted; delete it explicitly if it is no longer needed."}),A9="monitor_id",vN=`Query on the alerting monitor tags and group-by dimensions, e.g. \`env:prod AND service:bridge\`. The monitor itself can be targeted with \`${A9}:<monitor id>\`.`,dl=r.Object({name:u({description:"Display name of the silence"}),reason:u({allowEmpty:!1,type:"long",description:"Free-text explanation of why notifications are being silenced, shown to other operators reviewing active silences."}),owner:u({allowEmpty:!1,description:"Team ID that owns and manages the silence"}),tags:Xe,isActive:r.Boolean({description:"Set to true for the silence to suppress matching notifications while its schedule is active. Set to false to keep the silence without suppressing anything."}),schedule:b9,notificationRuleIds:r.Optional(r.Array(u(),{description:"Notification rule IDs this silence applies to directly, matching any notification produced by one of these rules regardless of priority or transition type. Mutually exclusive with `prioritiesFilter`, `transitionTypesFilter`, and `queryString`: a request combining this field with any of those is rejected."})),queryString:r.Optional(u({type:"tags-query",description:vN})),teamsFilter:Bd,prioritiesFilter:r.Array(r.Enum(St),{maxItems:St.length,description:"Monitor priorities that must match for this silence to apply. An empty array matches every priority."}),transitionTypesFilter:r.Array(r.Enum(uo),{maxItems:uo.length,description:"Alert state transitions that must match for this silence to apply. An empty array matches every transition type."})}),Xi=r.Object({id:r.String({description:"Tsuga-generated notification silence ID assigned when the silence is created."}),name:r.String({description:"Display name of the silence"}),reason:r.String({description:"Free-text explanation of why notifications are being silenced, shown to other operators reviewing active silences."}),owner:r.String({description:"Team ID that owns and manages the silence"}),tags:De,isActive:r.Boolean({description:"Whether the silence suppresses matching notifications while its schedule is active. When false, the silence is kept but never suppresses anything."}),schedule:S9,notificationRuleIds:r.Optional(r.Array(r.String(),{description:"Notification rule IDs this silence applies to directly, matching any notification produced by one of these rules regardless of priority or transition type. Set only when `prioritiesFilter`, `transitionTypesFilter`, and `queryString` are not used to filter alerts."})),queryString:r.Optional(r.String({description:vN})),teamsFilter:Fd,prioritiesFilter:r.Array(r.Enum(St),{description:"Monitor priorities that must match for this silence to apply. An empty array matches every priority."}),transitionTypesFilter:r.Array(r.Enum(uo),{description:"Alert state transitions that must match for this silence to apply. An empty array matches every transition type."}),createdAt:A(),updatedAt:A(),creator:r.Optional(pe),updater:r.Optional(pe)}),fJe=d({tags:["notification-silences"],url:Zi,method:"GET",response:r.Array(Xi)}),gJe=d({tags:["notification-silences"],url:`${Zi}/:id`,params:r.Object({id:u()}),method:"GET",response:Xi}),hJe=d({tags:["notification-silences"],url:Zi,method:"POST",body:dl,response:Xi}),yJe=d({tags:["notification-silences"],url:`${Zi}/:id`,method:"PUT",params:r.Object({id:u()}),body:dl,response:Xi}),TJe=d({tags:["notification-silences"],url:`${Zi}/:id`,method:"DELETE",params:r.Object({id:u()}),response:N}),EJe=d({tags:["notification-silences"],url:`${Zi}/bulk-delete`,method:"DELETE",body:r.Object({ids:r.Array(u())}),response:r.Object({})});var Ys=`/${"v1"}/notification-silences`,Vs=r.Pick(Xi,["id","name","reason","owner","tags","isActive","schedule","notificationRuleIds","queryString","teamsFilter","prioritiesFilter","transitionTypesFilter"],{$id:"NotificationSilence",description:"Scheduled mute rule that suppresses matching notification delivery while monitors continue evaluating. See [Silences](/documentation/alert/notifications/silences)."}),O9={id:"sil-weekend-maintenance",name:"Weekend maintenance",reason:"Suppress expected alerts during the weekly maintenance window.",owner:"team-123-abc",tags:[{key:"environment",value:"production"}],isActive:!0,schedule:{type:"recurring",weeklySchedule:{saturday:[{startTime:"02:00",endTime:"06:00"}],sunday:[{startTime:"02:00",endTime:"06:00"}]},timeZone:"UTC"},teamsFilter:{type:"specific-teams",teams:["team-123-abc"]},prioritiesFilter:[1,2],transitionTypesFilter:["triggered","resolved"]},x9={id:"sil-critical-routing",name:"Critical routing maintenance",reason:"Temporarily suppress notifications from the critical routing rule.",owner:"team-123-abc",tags:[{key:"change",value:"chg-1234"}],isActive:!0,schedule:{type:"one-time",startTime:"2026-07-04T02:00:00",endTime:"2026-07-04T04:00:00",timeZone:"UTC"},notificationRuleIds:["rule-critical-routing"],teamsFilter:{type:"specific-teams",teams:["team-123-abc"]},prioritiesFilter:[],transitionTypesFilter:[]};Object.assign(Vs,{examples:[O9,x9]});var NN=d({description:"Lists notification silences visible to the authenticated operation key. Use this endpoint to audit maintenance windows and notification muting rules.",operationId:"listNotificationSilences",tags:["notification-silences"],url:Ys,method:"GET",response:r.Array(Vs)}),LN=d({description:"Retrieves one notification silence by ID.",operationId:"getNotificationSilence",tags:["notification-silences"],url:`${Ys}/:id`,method:"GET",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the notification silence to retrieve. Use the `id` returned by notification silence list or create responses."})}),response:Vs}),Qg=r.Pick(dl,["name","reason","owner","tags","isActive","schedule","notificationRuleIds","queryString","teamsFilter","prioritiesFilter","transitionTypesFilter"],{description:"Notification silence create or update request. Provide the mute reason, owner, schedule, filters, active state, and tags."}),R9={name:"Weekend maintenance",reason:"Suppress expected alerts during the weekly maintenance window.",owner:"team-123-abc",tags:[{key:"environment",value:"production"}],isActive:!0,schedule:{type:"recurring",weeklySchedule:{saturday:[{startTime:"02:00",endTime:"06:00"}],sunday:[{startTime:"02:00",endTime:"06:00"}]},timeZone:"UTC"},teamsFilter:{type:"specific-teams",teams:["team-123-abc"]},prioritiesFilter:[1,2],transitionTypesFilter:["triggered","resolved"]},C9={name:"Critical routing maintenance",reason:"Temporarily suppress notifications from the critical routing rule.",owner:"team-123-abc",tags:[{key:"change",value:"chg-1234"}],isActive:!0,schedule:{type:"one-time",startTime:"2026-07-04T02:00:00",endTime:"2026-07-04T04:00:00",timeZone:"UTC"},notificationRuleIds:["rule-critical-routing"],teamsFilter:{type:"specific-teams",teams:["team-123-abc"]},prioritiesFilter:[],transitionTypesFilter:[]};Object.assign(Qg,{examples:[R9,C9]});var kN=d({description:"Creates a notification silence. Matching notifications that have not yet been sent are suppressed as soon as the schedule becomes active, including ones already queued when the silence is created; monitor evaluation itself is not paused, so alerts still transition and are visible in the UI.",operationId:"createNotificationSilence",tags:["notification-silences"],url:Ys,method:"POST",body:Qg,response:Vs}),MN=d({description:"Updates an existing notification silence by ID. Required fields are overwritten; omitted optional fields keep their existing values.",operationId:"updateNotificationSilence",tags:["notification-silences"],url:`${Ys}/:id`,method:"PUT",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the notification silence to update. Use the `id` returned by notification silence list, get, or create responses."})}),body:Qg,response:Vs}),P9=r.Object({id:u({allowEmpty:!1,description:"Identifier of the notification silence to delete. Use the `id` returned by notification silence list, get, create, or update responses."})}),DN=d({description:"Deletes a notification silence. Any notification not yet sent is re-evaluated against the remaining silences and, if none match, is delivered normally; notifications already marked as silenced are not resent.",operationId:"deleteNotificationSilence",tags:["notification-silences"],url:`${Ys}/:id`,method:"DELETE",params:P9,response:N});var U9={critical:3,important:2,normal:1},se=e=>({label:e,weight:U9[e]}),w9={"unrouted-logs":{key:"unrouted-logs",title:"Logs with no matching route",summary:"Any log that reaches processing without a matched route is flagged.",rationale:"Close gaps by ensuring each event flows through a governed route.",objectType:"route",category:"observability-assets",impact:se("important"),recommendation:"Ensure each team maintains a route that captures all of its logs exactly once."},"no-over-routed-logs":{key:"no-over-routed-logs",title:"No logs matching 3+ routes",summary:"Detects logs that match 3 or more processing routes during the lookback window.",rationale:"A log usually only needs one or two routes. Matching many routes typically means the route queries overlap unintentionally, multiplying the processing and storage cost without adding observability value.",objectType:"route",category:"observability-assets",impact:se("important"),recommendation:"Review the route queries owned by this team for overlap. Tighten the filter on each route so a given log matches the minimum number of routes needed (usually one)."},"team-has-route":{key:"team-has-route",title:"\u22651 route per team",summary:"Each team owns at least one active route that filters on its team name.",rationale:"Provides clear governance boundaries for routing and enrichment.",objectType:"route",category:"observability-assets",impact:se("important"),recommendation:"Ensure every team manages a dedicated route scoped to its context.team value."},"no-team-override-mismatch":{key:"no-team-override-mismatch",title:`${fd} matches ${Qp}`,summary:`Detects logs and spans whose ${fd} resource attribute names a different team than the ${Qp} resolved at ingestion.`,rationale:`${Qp} is reserved and comes from the ingestion API key, so a \`team\` resource attribute never reassigns ownership. A disagreement means the sender expects an ownership Tsuga did not apply.`,objectType:"resource",category:"telemetry-hygiene",impact:se("important"),recommendation:"Drop the `team` resource attribute, or set the ingestion API key team override fields to read ownership from a differently named attribute."},"service-name-present":{key:"service-name-present",title:`${Wp} present`,summary:`Logs and spans must populate ${Wp} with a non-empty value.`,rationale:"Core identifier used to correlate telemetry across services.",objectType:"resource",category:"telemetry-hygiene",impact:se("critical"),recommendation:`Populate ${Wp} in all log and span payloads.`},"no-orphan-spans":{key:"no-orphan-spans",title:"No orphan spans",summary:"Every span with parent_span_id references an existing span in the same trace.",rationale:"Trace integrity depends on preserving parent-child hierarchies.",objectType:"span",category:"telemetry-hygiene",impact:se("normal"),recommendation:"Emit parent spans before their children so references always resolve."},"metric-unit-consistency":{key:"metric-unit-consistency",title:"Name\u2192unit consistency",summary:"All series for a metric name report the same UCUM-compliant unit across the lookback period.",rationale:"Avoid ambiguity when charting and alerting on metrics with shared names.",objectType:"metric",category:"telemetry-hygiene",impact:se("important"),recommendation:"Align exporters so each metric name emits a single consistent unit across services and environments."},"host-name-present":{key:"host-name-present",title:`${Ja} presence`,summary:`Logs and spans must populate ${Ja} with a non-empty value.`,rationale:"Core identifier used to correlate telemetry across services.",objectType:"resource",category:"telemetry-hygiene",impact:se("important"),recommendation:`Populate ${Ja} in all log and span payloads.`},"inconsistent-attribute-naming":{key:"inconsistent-attribute-naming",title:"Consistent attribute naming",summary:"Detects attributes with multiple naming variants (e.g., userId vs user_id).",rationale:"Consistent naming improves queryability.",objectType:"log",category:"telemetry-hygiene",impact:se("normal"),recommendation:"Standardize attribute naming conventions across all log sources."},"no-duplicate-attr-values":{key:"no-duplicate-attr-values",title:"No duplicate attribute values",summary:"Detects when different attributes consistently carry identical values across logs (e.g., err.type and error.type always having the same value).",rationale:"Redundant attributes waste storage and complicate querying. Consolidate to one.",objectType:"log",category:"telemetry-hygiene",impact:se("normal"),recommendation:"Consolidate duplicate attributes at the source to reduce storage costs."},"no-debug-logs-in-prod":{key:"no-debug-logs-in-prod",title:"No DEBUG logs in production",summary:"Detects DEBUG-level logs emitted in production environments.",rationale:"DEBUG logs in production increase costs and risk exposing sensitive data.",objectType:"log",category:"telemetry-hygiene",impact:se("important"),recommendation:"Remove DEBUG-level logging from production environment or adjust log level configuration."},"no-multiline-logs":{key:"no-multiline-logs",title:"No ungrouped multiline logs",summary:"Detects orphaned stack-trace and traceback continuation lines that should have been grouped into a single log entry by the collector.",rationale:"Ungrouped multiline logs fragment errors across many entries, making them harder to read, search, and alert on.",objectType:"log",category:"telemetry-hygiene",impact:se("important"),recommendation:"Configure multiline grouping on the log collector using a line_start_pattern (e.g. a timestamp regex) so stack traces are sent as a single entry."},"no-error-logs-as-info":{key:"no-error-logs-as-info",title:"No error logs mapped as info",summary:"Detects INFO-level logs that carry error fields such as error.*, err.*, exception.*, or a stack trace.",rationale:"A log with error or exception attributes but an INFO severity is never surfaced as an error, so teams miss real failures caused by a misconfigured level mapper or bad logging.",objectType:"log",category:"telemetry-hygiene",impact:se("important"),recommendation:"Map these logs to ERROR in the level mapper, or fix the source logging so errors and exceptions are emitted at the right severity."},"no-empty-dashboards":{key:"no-empty-dashboards",title:"No empty dashboards",summary:"Flags dashboards with 1 or fewer widgets.",rationale:"Empty or near-empty dashboards add clutter and make it harder to find useful dashboards.",objectType:"dashboard",category:"observability-assets",impact:se("normal"),recommendation:"Add meaningful widgets to dashboards or remove empty ones to reduce clutter."},"monitor-has-notification":{key:"monitor-has-notification",title:"No monitors without notification",summary:"Every monitor has at least one active notification destination configured.",rationale:"A monitor without notifications is effectively silent - it detects issues but nobody is alerted.",objectType:"monitor",category:"observability-assets",impact:se("important"),recommendation:"Add a notification destination to every monitor - a monitor without notifications is effectively silent."},"no-future-dated-logs":{key:"no-future-dated-logs",title:"No future-dated logs",summary:"Detects logs with timestamps more than 59 minutes ahead of their intake time.",rationale:"Future-dated logs break dashboards, alerting, and log ordering - they indicate clock skew or incorrect timestamp generation.",objectType:"log",category:"telemetry-hygiene",impact:se("important"),recommendation:"Fix clock synchronization or timestamp generation for services emitting future-dated logs - they break dashboards and alerting."},"metric-usage":{key:"metric-usage",title:"Metric usage",summary:"Percentage of ingested metrics that are referenced by a dashboard or monitor, or were queried in the last 30 days.",rationale:"Metrics that are never visualized, alerted on, or queried add ingestion cost and cardinality without providing value.",objectType:"metric",category:"telemetry-adoption",impact:se("important"),recommendation:"Stop emitting metrics that are never referenced or queried to reduce ingestion cost and cardinality.",scope:"global"},"no-stale-dashboards":{key:"no-stale-dashboards",title:"No stale dashboards",summary:"Flags dashboards that have not been edited in over 180 days.",rationale:"Stale dashboards may contain outdated queries or irrelevant data, making it harder for teams to find useful, up-to-date information.",objectType:"dashboard",category:"observability-assets",impact:se("normal"),recommendation:"Review and update dashboards that haven't been edited in 180+ days, or archive them if no longer relevant."},"no-unused-dashboards":{key:"no-unused-dashboards",title:"No unused dashboards",summary:"Flags dashboards with zero views in the last 60 days.",rationale:"Dashboards that nobody views add clutter and may confuse team members looking for relevant information.",objectType:"dashboard",category:"telemetry-adoption",impact:se("important"),recommendation:"Archive or delete dashboards that nobody has viewed in the last 60 days to reduce noise."},"no-orphan-monitors":{key:"no-orphan-monitors",title:"No monitors without dashboards",summary:"Every monitor should be linked to at least one dashboard.",rationale:"Monitors without a linked dashboard make it harder for teams to investigate alerts \u2014 responders need a dashboard to quickly understand the context and scope of an issue.",objectType:"monitor",category:"observability-assets",impact:se("important"),recommendation:"Link monitors to relevant dashboards so teams can quickly investigate when alerts fire."},"no-flapping-monitors":{key:"no-flapping-monitors",title:"No flappy monitors",summary:"P1/P2 monitors should not have any group (or the monitor itself) trigger 7+ alerts within 7 days.",rationale:"Monitors that constantly flip between alert and OK cause alert fatigue. Teams start ignoring notifications, increasing the risk of missing real incidents.",objectType:"monitor",category:"observability-assets",impact:se("important"),recommendation:"Tune thresholds, add hysteresis, or adjust evaluation windows to reduce flapping."},"no-noisy-group-monitors":{key:"no-noisy-group-monitors",title:"No noisy group-by monitors",summary:"P1/P2 group-by monitors should not have 5+ groups triggering alerts simultaneously on 2+ occasions within 7 days.",rationale:"When a group-by monitor triggers alerts for many groups at once repeatedly, the signal gets lost in noise. Responders cannot prioritize and the monitor effectively becomes useless.",objectType:"monitor",category:"observability-assets",impact:se("important"),recommendation:"Narrow the group-by scope, raise thresholds, or split into more targeted monitors."},"no-long-alert-monitors":{key:"no-long-alert-monitors",title:"No monitors stuck in alert",summary:"P1/P2 monitors should not remain in alert state for more than 15 days.",rationale:"A high-priority monitor stuck in alert for weeks signals an unresolved issue or a misconfigured threshold. Either way, the alert loses meaning and contributes to alert fatigue.",objectType:"monitor",category:"observability-assets",impact:se("important"),recommendation:"Investigate and resolve the underlying issue, adjust the threshold, or acknowledge and close the alert."},"no-redundant-monitors":{key:"no-redundant-monitors",title:"No redundant monitors",summary:"P1/P2 monitors should not always trigger at the same time as another monitor (3+ co-triggers within 7 days).",rationale:"A monitor that always fires alongside another monitor is redundant. It adds noise without providing additional signal, making it harder for responders to identify the root cause.",objectType:"monitor",category:"observability-assets",impact:se("important"),recommendation:"Investigate whether the redundant monitor can be removed or consolidated with the one it always co-triggers with."},"no-absent-log-fields":{key:"no-absent-log-fields",title:"No absent log fields",summary:"Dashboards and monitors should reference log fields that still appear in recent logs (last 24 hours).",rationale:"References to log fields that no longer exist silently break dashboards and monitors, eroding trust in observability.",objectType:"dashboard",category:"observability-assets",impact:se("important"),recommendation:"Remove, rename, or backfill log fields that are referenced by dashboards or monitors but have not been seen in the last 24 hours.",scope:"global"},"k8s-recommended-attributes":{key:"k8s-recommended-attributes",title:"Kubernetes recommended resource attributes",summary:"Kubernetes logs and spans should populate core identity attributes and at least one workload-ownership attribute.",rationale:"These attributes let Tsuga correlate telemetry with the Kubernetes objects that produced it, which is required for faulty-deployment detection and rollback suggestions.",objectType:"resource",category:"collection-coverage",impact:se("important"),recommendation:"Make sure every Kubernetes workload emits k8s.cluster.name, k8s.namespace.name, k8s.pod.name, k8s.pod.uid, k8s.container.name, k8s.node.name and one workload-ownership attribute (for example via the OpenTelemetry Collector k8s_attributes processor)."},"k8s-recommended-metrics":{key:"k8s-recommended-metrics",title:"Kubernetes recommended cluster metrics",summary:"All recommended Kubernetes cluster metrics are collected.",rationale:"These metrics are the primary signals for faulty-deployment detection; without k8s.container.status.reason and the usage/limit pairs, container crash loops and resource starvation cannot be diagnosed.",objectType:"metric",category:"collection-coverage",impact:se("important"),recommendation:"Enable the OpenTelemetry Collector k8s_cluster receiver (for example via the Tsuga Helm chart) so the required Kubernetes metrics are emitted.",scope:"global"},"k8s-recommended-change-events":{key:"k8s-recommended-change-events",title:"Kubernetes recommended change events",summary:"Change events are collected for the Kubernetes object kinds recommended for rollback suggestions.",rationale:"Faulty-deployment detection needs the history of ReplicaSet, Deployment, Pod and Node changes to identify failing revisions and propose rollbacks.",objectType:"log",category:"collection-coverage",impact:se("important"),recommendation:"Configure the Kubernetes change-event collector (for example the OpenTelemetry k8sobjects receiver) so change events for Pod, Deployment, ReplicaSet, StatefulSet, DaemonSet, Namespace and Node are ingested."},"otel-collector-self-metrics":{key:"otel-collector-self-metrics",title:"OpenTelemetry Collector self-metrics",summary:"A cluster collecting Kubernetes metrics through an OpenTelemetry Collector also emits the collector self-metrics (otelcol_*).",rationale:"The Kubernetes receivers feed the Kubernetes explorer. Without the collector self-metrics there is no way to tell a healthy pipeline from one that drops data or fails to export, so a stale or missing Kubernetes view cannot be explained.",objectType:"metric",category:"collection-coverage",impact:se("important"),recommendation:"Enable the collector's internal telemetry (service.telemetry.metrics) and export it to Tsuga so otelcol_* metrics are available.",scope:"global"},"use-standard-attributes":{key:"use-standard-attributes",title:"Standard attribute usage",summary:"Detects log attributes that should be remapped to Tsuga standard attributes.",rationale:"Standard attributes enable consistent querying, out-of-the-box dashboards, and cross-team correlation.",objectType:"log",category:"telemetry-hygiene",impact:se("important"),recommendation:"Use the attribute remapper in your routes to rename attributes to their standard equivalents."},"no-unused-operation-api-keys":{key:"no-unused-operation-api-keys",title:"No unused operation API keys",summary:"Flags operation API keys with no activity in the last 180 days.",rationale:"Long-idle operation credentials add risk if leaked and clutter the inventory. Tracking last-used activity makes it easy to rotate or delete the unused ones.",objectType:"api-key",category:"observability-assets",impact:se("important"),recommendation:"Rotate or delete operation API keys that have not been used in the last 180 days."},"no-unused-ingestion-api-keys":{key:"no-unused-ingestion-api-keys",title:"No unused ingestion API keys",summary:"Flags ingestion API keys with no telemetry in the last 30 days across any cluster.",rationale:"Dormant ingestion credentials add risk if leaked and clutter the inventory. Tracking key activity makes it easy to rotate or delete the unused ones.",objectType:"api-key",category:"observability-assets",impact:se("important"),recommendation:"Rotate or delete ingestion API keys that have sent no data in the last 30 days."},"db-logs-trace-correlation":{key:"db-logs-trace-correlation",title:"Database logs correlated with traces",summary:`Database logs should carry ${WO} so they can be tied back to the trace that issued the query.`,rationale:"Linking database server logs to client traces lets users jump from a slow request to the exact query log. Without a trace id, database logs cannot be joined to the request that produced them.",objectType:"log",category:"telemetry-hygiene",impact:se("normal"),recommendation:"Enable trace correlation on the database log pipeline (for example via SQLcommenter, which embeds the traceparent in each statement) so query logs carry a trace id.",scope:"team"}},GN={"postgresql-server-metrics-collected":{label:"PostgreSQL",systemValues:["postgresql"],metricPrefixes:["postgresql.","pg_"],receiver:"postgresqlreceiver"},"mysql-server-metrics-collected":{label:"MySQL",systemValues:["mysql","mariadb"],metricPrefixes:["mysql.","mysql_"],receiver:"mysqlreceiver"},"mongodb-server-metrics-collected":{label:"MongoDB",systemValues:["mongodb"],metricPrefixes:["mongodb.","mongodbatlas.","mongodb_"],receiver:"mongodbreceiver"},"redis-server-metrics-collected":{label:"Redis",systemValues:["redis"],metricPrefixes:["redis.","redis_"],receiver:"redisreceiver"},"memcached-server-metrics-collected":{label:"Memcached",systemValues:["memcached"],metricPrefixes:["memcached.","memcached_"],receiver:"memcachedreceiver"},"couchdb-server-metrics-collected":{label:"CouchDB",systemValues:["couchdb"],metricPrefixes:["couchdb.","couchdb_"],receiver:"couchdbreceiver"},"elasticsearch-server-metrics-collected":{label:"Elasticsearch",systemValues:["elasticsearch"],metricPrefixes:["elasticsearch.","elasticsearch_"],receiver:"elasticsearchreceiver"},"oracledb-server-metrics-collected":{label:"Oracle DB",systemValues:["oracle.db","oracle"],metricPrefixes:["oracledb.","oracledb_"],receiver:"oracledbreceiver"},"sqlserver-server-metrics-collected":{label:"Microsoft SQL Server",systemValues:["microsoft.sql_server","mssql"],metricPrefixes:["sqlserver.","mssql_"],receiver:"sqlserverreceiver"},"saphana-server-metrics-collected":{label:"SAP HANA",systemValues:["sap.hana","hanadb"],metricPrefixes:["saphana."],receiver:"saphanareceiver"},"cassandra-server-metrics-collected":{label:"Cassandra",systemValues:["cassandra"],metricPrefixes:["cassandra.","cassandra_"]},"clickhouse-server-metrics-collected":{label:"ClickHouse",systemValues:["clickhouse"],metricPrefixes:["ClickHouse"]},"couchbase-server-metrics-collected":{label:"Couchbase",systemValues:["couchbase"],metricPrefixes:["couchbase_"]},"neo4j-server-metrics-collected":{label:"Neo4j",systemValues:["neo4j"],metricPrefixes:["neo4j_"]},"opensearch-server-metrics-collected":{label:"OpenSearch",systemValues:["opensearch"],metricPrefixes:["opensearch_"]},"db2-server-metrics-collected":{label:"IBM Db2",systemValues:["ibm.db2","db2"],metricPrefixes:["ibm_db2_"]}},v9=Object.fromEntries(Object.keys(GN).map(e=>{let{label:t,receiver:n}=GN[e];return[e,{key:e,title:`${t} server metrics collected`,summary:`${t} seen in client spans should have its server metrics collected.`,rationale:"Server metrics (connections, throughput, replication, contention) are needed to investigate database slowness beyond what client spans show. A detected database with no server metrics has a gap in its monitoring setup.",objectType:"metric",category:"collection-coverage",impact:se("important"),recommendation:n?`Configure the ${n} OpenTelemetry receiver so ${t} server metrics are collected.`:`Collect ${t} server metrics, for example via its Prometheus exporter.`,scope:"global"}]})),N9=new Set(["azure_container_registry","azure_container_registry_image","azure_app_service_certificate","azure_virtual_network"]),L9=ks.filter(e=>e.startsWith("azure_")&&!N9.has(e)),$N={"aws-sqs-metrics-collected":{label:"Amazon SQS",source:"AWS/SQS",nativeResourceTypes:["aws_sqs_queue"],metricPrefixes:["aws_sqs_"]},"aws-sns-metrics-collected":{label:"Amazon SNS",source:"AWS/SNS",nativeResourceTypes:["aws_sns_topic"],metricPrefixes:["aws_sns_"]},"aws-kinesis-metrics-collected":{label:"Amazon Kinesis Data Streams",source:"AWS/Kinesis",nativeResourceTypes:["aws_kinesis_data_stream"],metricPrefixes:["aws_kinesis_"]},"aws-dynamodb-metrics-collected":{label:"Amazon DynamoDB",source:"AWS/DynamoDB",nativeResourceTypes:["aws_dynamodb_table"],metricPrefixes:["aws_dynamodb_"]},"aws-rds-metrics-collected":{label:"Amazon RDS",source:"AWS/RDS",nativeResourceTypes:["aws_rds_instance"],metricPrefixes:["aws_rds_"]},"aws-elasticache-metrics-collected":{label:"Amazon ElastiCache",source:"AWS/ElastiCache",nativeResourceTypes:["aws_elasticache"],metricPrefixes:["aws_elasticache_"]},"aws-s3-metrics-collected":{label:"Amazon S3",source:"AWS/S3",nativeResourceTypes:["aws_s3_bucket"],metricPrefixes:["aws_s3_"]},"aws-ebs-metrics-collected":{label:"Amazon EBS",source:"AWS/EBS",nativeResourceTypes:["aws_ebs_volume"],metricPrefixes:["aws_ebs_"]},"aws-efs-metrics-collected":{label:"Amazon EFS",source:"AWS/EFS",nativeResourceTypes:["aws_efs"],metricPrefixes:["aws_efs_"]},"aws-ec2-metrics-collected":{label:"Amazon EC2",source:"AWS/EC2",nativeResourceTypes:["aws_ec2_instance"],metricPrefixes:["aws_ec2_"]},"aws-lambda-metrics-collected":{label:"AWS Lambda",source:"AWS/Lambda",nativeResourceTypes:["aws_lambda_function"],metricPrefixes:["aws_lambda_"]},"aws-ecs-metrics-collected":{label:"Amazon ECS",source:"AWS/ECS",nativeResourceTypes:["aws_ecs_cluster","aws_ecs_service","aws_ecs_task"],metricPrefixes:["aws_ecs_"]},"aws-ecr-metrics-collected":{label:"Amazon ECR",source:"AWS/ECR",nativeResourceTypes:["aws_ecr_repository"],metricPrefixes:["aws_ecr_"]},"aws-elb-metrics-collected":{label:"Elastic Load Balancing",source:"AWS/ApplicationELB, AWS/NetworkELB",nativeResourceTypes:["aws_elastic_load_balancer"],metricPrefixes:["aws_applicationelb_","aws_networkelb_","aws_gatewayelb_","aws_elb_"]},"aws-cloudfront-metrics-collected":{label:"Amazon CloudFront",source:"AWS/CloudFront",nativeResourceTypes:["aws_cloudfront_distribution"],metricPrefixes:["aws_cloudfront_"]},"aws-acm-metrics-collected":{label:"AWS Certificate Manager",source:"AWS/CertificateManager",nativeResourceTypes:["aws_acm_certificate"],metricPrefixes:["aws_certificatemanager_"]},"gcp-pubsub-metrics-collected":{label:"Google Cloud Pub/Sub",source:"pubsub.googleapis.com",nativeResourceTypes:["gcp_pubsub_topic"],metricPrefixes:["pubsub.googleapis.com/"]},"gcp-storage-metrics-collected":{label:"Google Cloud Storage",source:"storage.googleapis.com",nativeResourceTypes:["gcp_bucket"],metricPrefixes:["storage.googleapis.com/"]},"gcp-compute-metrics-collected":{label:"Google Compute Engine",source:"compute.googleapis.com",nativeResourceTypes:["gcp_compute_instance","gcp_compute_disk"],metricPrefixes:["compute.googleapis.com/"]},"gcp-cloud-sql-metrics-collected":{label:"Google Cloud SQL",source:"cloudsql.googleapis.com",nativeResourceTypes:["gcp_cloud_sql_instance"],metricPrefixes:["cloudsql.googleapis.com/"]},"gcp-gke-metrics-collected":{label:"Google Kubernetes Engine",source:"kubernetes.io, container.googleapis.com",nativeResourceTypes:["gcp_gke_cluster"],metricPrefixes:["kubernetes.io/","container.googleapis.com/"]},"gcp-cloud-run-metrics-collected":{label:"Google Cloud Run",source:"run.googleapis.com",nativeResourceTypes:["gcp_cloud_run_service","gcp_cloud_run_job","gcp_cloud_run_function"],metricPrefixes:["run.googleapis.com/"]},"gcp-artifact-registry-metrics-collected":{label:"Google Artifact Registry",source:"artifactregistry.googleapis.com",nativeResourceTypes:["gcp_artifact_registry_repository"],metricPrefixes:["artifactregistry.googleapis.com/"]},"gcp-load-balancing-metrics-collected":{label:"Google Cloud Load Balancing",source:"loadbalancing.googleapis.com",nativeResourceTypes:["gcp_forwarding_rule"],metricPrefixes:["loadbalancing.googleapis.com/"]},"gcp-bigtable-metrics-collected":{label:"Google Cloud Bigtable",source:"bigtable.googleapis.com",nativeResourceTypes:["gcp_bigtable_instance"],metricPrefixes:["bigtable.googleapis.com/"]},"gcp-spanner-metrics-collected":{label:"Google Cloud Spanner",source:"spanner.googleapis.com",nativeResourceTypes:["gcp_spanner_instance"],metricPrefixes:["spanner.googleapis.com/"]},"gcp-firestore-metrics-collected":{label:"Google Cloud Firestore",source:"firestore.googleapis.com",nativeResourceTypes:["gcp_firestore_database"],metricPrefixes:["firestore.googleapis.com/"]},"gcp-app-engine-metrics-collected":{label:"Google App Engine",source:"appengine.googleapis.com",nativeResourceTypes:["gcp_app_engine_service"],metricPrefixes:["appengine.googleapis.com/"]},"azure-metrics-collected":{label:"Azure",source:"Azure Monitor",nativeResourceTypes:L9,metricPrefixes:["azure_"]}},k9=Object.fromEntries(Object.keys($N).map(e=>{let{label:t,source:n}=$N[e];return[e,{key:e,title:`${t} metrics collected`,summary:`${t} resources found in inventory should have their metrics collected.`,rationale:"A resource that appears in inventory but whose metrics are not collected leaves its dashboards and resource-explorer views empty and impossible to alert on.",objectType:"metric",category:"collection-coverage",impact:se("important"),recommendation:`Enable the ${n} metrics integration so ${t} metrics are ingested.`,scope:"global"}]})),M9={...w9,...v9,...k9},jN=Object.values(M9);var qN=["passed","failed","ignored"],D9=10,G9=r.Enum(qN,{description:"Evaluation outcome for this rule row. Allowed values are passed, failed, and ignored; ignored means the rule was not applicable to the available data."}),$9=["aws-sqs-metrics-collected","aws-sns-metrics-collected","aws-kinesis-metrics-collected","aws-dynamodb-metrics-collected","aws-rds-metrics-collected","aws-elasticache-metrics-collected","aws-s3-metrics-collected","aws-ebs-metrics-collected","aws-efs-metrics-collected","aws-ec2-metrics-collected","aws-lambda-metrics-collected","aws-ecs-metrics-collected","aws-ecr-metrics-collected","aws-elb-metrics-collected","aws-cloudfront-metrics-collected","aws-acm-metrics-collected","gcp-pubsub-metrics-collected","gcp-storage-metrics-collected","gcp-compute-metrics-collected","gcp-cloud-sql-metrics-collected","gcp-gke-metrics-collected","gcp-cloud-run-metrics-collected","gcp-artifact-registry-metrics-collected","gcp-load-balancing-metrics-collected","gcp-bigtable-metrics-collected","gcp-spanner-metrics-collected","gcp-firestore-metrics-collected","gcp-app-engine-metrics-collected","azure-metrics-collected"],j9=["postgresql-server-metrics-collected","mysql-server-metrics-collected","mongodb-server-metrics-collected","redis-server-metrics-collected","memcached-server-metrics-collected","couchdb-server-metrics-collected","elasticsearch-server-metrics-collected","oracledb-server-metrics-collected","sqlserver-server-metrics-collected","saphana-server-metrics-collected","cassandra-server-metrics-collected","clickhouse-server-metrics-collected","couchbase-server-metrics-collected","neo4j-server-metrics-collected","opensearch-server-metrics-collected","db2-server-metrics-collected"],Zg=["unrouted-logs","no-over-routed-logs","team-has-route","no-team-override-mismatch","service-name-present","no-orphan-spans","metric-unit-consistency","host-name-present","inconsistent-attribute-naming","no-duplicate-attr-values","no-debug-logs-in-prod","no-multiline-logs","no-error-logs-as-info","no-empty-dashboards","monitor-has-notification","no-future-dated-logs","metric-usage","no-stale-dashboards","no-unused-dashboards","no-orphan-monitors","no-flapping-monitors","no-noisy-group-monitors","no-long-alert-monitors","no-redundant-monitors","no-absent-log-fields","k8s-recommended-attributes","k8s-recommended-metrics","k8s-recommended-change-events","otel-collector-self-metrics","use-standard-attributes","no-unused-operation-api-keys","no-unused-ingestion-api-keys","db-logs-trace-correlation",...j9,...$9],q9=r.Enum(Zg),F9=["log","metric","resource","span","api-key","dashboard","monitor","route"],B9=["collection-coverage","telemetry-hygiene","observability-assets","telemetry-adoption"],H9=["critical","important","normal"],K9=["team","global"],Xg=r.Object({key:r.Enum(Zg),title:r.String(),summary:r.String(),rationale:r.String(),objectType:r.Enum(F9),category:r.Enum(B9),impact:r.Object({label:r.Enum(H9),weight:r.Number()}),recommendation:r.String(),scope:r.Optional(r.Enum(K9))}),Qs=r.Object({type:r.String({description:"Tsuga asset or telemetry kind referenced by this example. Set by the rule evaluator from the failing object, record, or lookup result; examples include `monitor`, `dashboard`, `metric`, `log`, and `api-key`."}),label:r.String({description:"Human-readable summary of the example. Set by the rule evaluator from the asset name, telemetry identifier, or lookup result so clients can display the example without following the link."}),link:r.Object({to:r.String({description:"In-app route that opens the example in Tsuga. Set by the rule evaluator when the example has a product surface for inspection."}),search:r.Optional(r.Unknown({description:"Route search payload for the in-app link. Set when the destination needs query-string state such as a search query, time range, or table filter."})),params:r.Optional(r.Unknown({description:"Route params for the in-app link. Set when the destination route needs path parameters such as an asset identifier."}))},{description:"In-app deep link for inspecting the example. Returned when Tsuga can route from the quality-report row to a relevant product page."})}),Wg=r.Intersect([Xg,r.Object({id:r.Optional(r.String()),status:G9,normalizedScore:r.Number(),details:r.Optional(r.Record(r.String(),r.Unknown())),recommendation:r.Optional(r.String()),examples:r.Optional(r.Array(Qs)),exampleCount:r.Optional(r.Integer())})]),z9=r.Object({generatedAt:r.String(),overallScore:r.Optional(r.Number()),rules:r.Array(Xg),teamResults:r.Array(r.Object({teamId:r.String(),teamName:r.String(),teamWeight:r.Number(),score:r.Number(),weightedScore:r.Number(),totalWeight:r.Number(),ruleResults:r.Array(Wg)})),globalResults:r.Optional(r.Object({score:r.Optional(r.Number()),ruleResults:r.Array(Wg)}))}),Jg=r.Object({id:r.String({description:"Identifier of this persisted quality-report row. Generated by Tsuga when report rows are stored. Returned on every row. Treat it as an opaque ID."}),reportId:r.String({description:"Identifier shared by rows from the same report generation for the same team or global cluster-wide scope. Generated by Tsuga when the report is stored. Returned on every row."}),ruleId:r.Enum(Zg,{description:"Stable key for the telemetry-quality rule evaluated by this row. Set by Tsuga from the quality-rule catalog. Returned on every row. The enum may grow as Tsuga adds rules; clients should display unknown future values as opaque rule keys if they do not have local labels."}),owner:r.Optional(r.String({description:"Team identifier this row applies to. Set to the owning team ID for team-scoped rules. Returned for team rows; omitted for global cluster-wide rows."})),status:r.Enum(qN,{description:"Evaluation outcome for this rule row. Set by the rule evaluator when the report is generated. Returned on every row. Allowed values are passed, failed, and ignored; ignored means the rule was not applicable to the available data."}),score:r.Number({description:"Normalized score for this rule row. Set by the rule evaluator when the report is generated. Returned on every row. Values are between 0 and 1."}),weight:r.Number({description:"Impact weight of this rule, captured at report-generation time. Set by Tsuga from the rule's impact label: 1 for normal, 2 for important, 3 for critical. Used with score to compute reportOverallScore."}),reportOverallScore:r.Number({description:"Aggregate score for this row's report group. Calculated by Tsuga from non-ignored rows in the same team or global cluster-wide report. Returned on every row in that group with the same value."}),reportTotalWeight:r.Number({description:"Sum of non-ignored rule weights for this row's report group. Calculated by Tsuga when the report is generated. Returned on every row in that group with the same value."}),recommendation:r.Optional(r.String({description:"Recommendation stored with this row. Set by the rule evaluator when the report is generated. Returned when a recommendation was persisted; omitted otherwise. The latest-report endpoint does not recompute or default it at read time."})),examples:r.Optional(r.Array(Qs,{description:`Assets, logs, metrics, or links supporting this rule result. Set by the rule evaluator when the report is generated. Returned when examples were persisted and visible to the caller; global row examples are returned only to admin users. Truncated to the first ${D9}; compare against exampleCount to detect truncation.`})),exampleCount:r.Optional(r.Integer({description:"Total number of examples persisted for this row, before the preview truncation applied to examples. Returned whenever examples are visible to the caller."})),createdAt:r.String({description:"ISO timestamp the row was generated at"})}),kJe=d({tags:["quality-reports"],url:"/v0/quality-reports",method:"POST",response:z9}),eh=r.Optional(u({allowEmpty:!1,description:"Identifier of the cluster whose latest quality-report rows are returned. Use the id from the clusters API. Required when the organization has multiple clusters; omit only in single-cluster organizations. Unknown cluster IDs return RESOURCE_NOT_FOUND."})),MJe=d({tags:["quality-reports"],url:"/v0/quality-reports/latest",method:"GET",query:r.Object({clusterId:eh,team:r.Optional(u({allowEmpty:!1}))}),response:r.Array(Jg,{description:"Latest persisted rule evaluation rows for the cluster"})}),DJe=d({tags:["quality-reports"],url:"/v0/quality-reports/:id/examples",method:"GET",params:r.Object({id:u({allowEmpty:!1})}),response:r.Object({examples:r.Array(Qs)})}),GJe=d({tags:["quality-reports"],url:"/v0/quality-reports/preview",method:"POST",body:r.Object({ruleKey:q9,teamId:r.Optional(u({allowEmpty:!1})),lookbackMinutes:r.Optional(r.Integer({minimum:1,maximum:60})),clusterId:r.Optional(u({allowEmpty:!1}))}),response:r.Object({rule:Xg,result:Wg,teamId:r.Optional(r.String()),teamName:r.Optional(r.String())})}),$Je=new Map(jN.map(e=>[e.key,e]));var FN=`/${"v1"}/quality-reports`,BN=r.Pick(Jg,["id","reportId","ruleId","owner","status","score","weight","reportOverallScore","reportTotalWeight","recommendation","examples","exampleCount","createdAt"],{$id:"QualityReportRow",description:"Persisted evaluation of one telemetry-quality rule for a team or cluster-wide scope. See [Quality reports](/documentation/account-and-settings/quality-reports)."}),Y9={id:"01j9x3z4vyabcdfghjkmnpqrst",reportId:"01j9x3z4vyabcdfghjkmnpqrsu",ruleId:"team-has-route",owner:"01j9x3z4vyabcdfghjkmnpqrr",status:"passed",score:1,weight:2,reportOverallScore:.85,reportTotalWeight:2,createdAt:"2026-02-26T12:00:00.000Z"};Object.assign(BN,{examples:[Y9]});var V9=r.Object({clusterId:eh,team:r.Optional(u({allowEmpty:!1,description:"Team name used to scope the report. Matched against Tsuga team names. Optional; when set, returns only rows for that team and omits global rows. Unknown team names return RESOURCE_NOT_FOUND; teams the caller cannot access return an empty result."}))},{description:"Latest quality report lookup query."}),HN=d({description:"Retrieves the latest persisted quality-report rows for a cluster, optionally scoped to one team. Use this to audit telemetry hygiene and routing recommendations.",operationId:"getLatestQualityReport",tags:["quality-reports"],url:`${FN}/latest`,method:"GET",query:V9,response:r.Array(BN)}),zJe=d({description:"Retrieves every example stored for one quality-report row. The latest-report endpoint returns only a preview of each row's examples, so use this to page past that preview when exampleCount exceeds the number of examples returned there.",operationId:"getQualityReportExamples",tags:["quality-reports"],url:`${FN}/:id/examples`,method:"GET",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the quality-report row whose examples are returned. Use the id from the latest-report endpoint. Unknown ids, rows the caller cannot access, and cluster-wide rows requested by a non-admin all return RESOURCE_NOT_FOUND."})}),response:r.Object({examples:r.Array(Qs,{description:"Every example stored for this row, untruncated. Empty when the rule evaluation produced none."})},{description:"All examples stored for one quality-report row."})});var Ws="/v0/admin-center";var Ur=`${Ws}/retention-policies`,KN=3650,Q9=r.Integer({description:"Number of days Tsuga retains matching telemetry."}),zN=r.Integer({minimum:1,maximum:KN,description:`Number of days Tsuga should retain matching telemetry. Valid values are 1 through ${KN}.`}),Jr=r.Object({id:r.String({description:"Unique identifier of the retention policy. Generated by Tsuga."}),env:r.Optional(r.String({description:"Environment tag value this policy applies to. Omitted policies apply across environments unless a more specific policy exists."})),teamId:r.Optional(r.String({description:"Team ID this policy applies to. Omitted policies apply globally unless a team-specific policy exists."})),dataSource:r.Enum(Ir,{description:"Telemetry signal retained by this policy: logs, metrics, traces or rum."}),durationDays:Q9,isEnabled:r.Boolean({description:"Whether this policy participates in retention resolution."}),createdAt:A({description:"Timestamp when Tsuga created the retention policy."}),updatedAt:A({description:"Timestamp when Tsuga last updated the retention policy."})}),fl=r.Object({env:r.Optional(u({description:"Environment tag value this policy applies to. Omit for a policy that is not environment-specific."})),teamId:r.Optional(u({description:"Team ID this policy applies to. Omit for a policy that is not team-specific."})),dataSource:r.Enum(Ir,{description:"Telemetry signal retained by this policy: logs, metrics, traces or rum."}),durationDays:zN,isEnabled:r.Boolean({description:"Set to true for the policy to participate in retention resolution."})}),YN=r.Array(r.Object({env:u(),dataSource:r.Enum(Ir),durationDays:r.Union([zN,r.Null()]),isEnabled:r.Boolean()})),VN=r.Object({inserted:r.Array(Jr),updated:r.Array(Jr),deleted:r.Array(Jr)}),tet=d({tags:["retention-policies"],url:Ur,method:"POST",body:fl,response:Jr}),ret=d({tags:["retention-policies"],url:Ur,method:"GET",response:r.Array(Jr)}),net=d({tags:["retention-policies"],url:`${Ur}/:id`,method:"GET",params:r.Object({id:u()}),response:Jr}),oet=d({tags:["retention-policies"],url:`${Ur}/:id`,method:"PUT",params:r.Object({id:u()}),body:fl,response:Jr}),iet=d({tags:["retention-policies"],url:`${Ur}/bulk-update`,method:"POST",body:YN,response:VN}),aet=d({tags:["retention-policies"],url:`${Ur}/bulk-update-for-team`,method:"POST",body:r.Object({teamId:u(),policies:YN}),response:VN}),set=d({tags:["retention-policies"],url:`${Ur}/:id`,method:"DELETE",params:r.Object({id:u()}),response:N}),Zs=["past-24-hours","past-7-days","past-30-days"],cet=d({tags:["retention-policies"],url:`${Ur}/requested-history-percentile/:teamId`,method:"POST",params:r.Object({teamId:u()}),body:r.Object({percentile:r.Number({minimum:0,maximum:1}),observationWindow:r.Enum(Zs),dataSource:r.Enum(Ir)}),response:r.Object({percentile:r.Number(),observationWindow:r.Enum(Zs),dataSource:r.Enum(Ir),teamId:r.String(),requestedHistoryDays:r.Number()})}),W9=["1-day","3-days","7-days","1-month","6-months","more-than-6-months"];var Z9=r.Array(r.Object({bucket:r.Enum(W9),count:r.Number()})),pet=d({tags:["retention-policies"],url:`${Ur}/requested-history-histogram/:teamId`,method:"POST",params:r.Object({teamId:u()}),body:r.Object({observationWindow:r.Enum(Zs),dataSource:r.Enum(Ir)}),response:r.Object({observationWindow:r.Enum(Zs),dataSource:r.Enum(Ir),teamId:r.String(),histogram:Z9})}),uet=d({tags:["retention-policies"],url:`${Ur}/top-teams-with-retention-surplus`,method:"POST",body:r.Object({dataSource:r.Enum(Ir),observationWindow:r.Enum(Zs),percentile:r.Number({minimum:0,maximum:1}),topN:r.Optional(r.Number({minimum:1,maximum:20}))}),response:r.Array(r.Object({teamId:r.String(),retentionSurplusDays:r.Number()}))});var Xs=`/${"v1"}/retention-policies`,Js=r.Pick(Jr,["id","env","teamId","dataSource","durationDays","isEnabled"],{$id:"RetentionPolicy",description:"Retention rule for logs, metrics, or traces. Policies can apply globally, to an environment, or to a team depending on which scope fields are present. See [Retention](/documentation/account-and-settings/retention)."}),X9={id:"123-456-abc",env:"production",teamId:"team-123-abc",dataSource:"logs",durationDays:30,isEnabled:!0};Object.assign(Js,{examples:[X9]});var QN=d({description:"Lists retention policy rows visible to the authenticated operation key. Use this to audit retention duration by signal, environment, and team.",operationId:"listRetentionPolicies",tags:["retention-policies"],url:Xs,method:"GET",response:r.Array(Js)}),WN=d({description:"Retrieves one retention policy by ID.",operationId:"getRetentionPolicy",tags:["retention-policies"],url:`${Xs}/:id`,method:"GET",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the retention policy to retrieve. Use the `id` returned by retention policy list or create responses."})}),response:Js}),th=r.Pick(fl,["env","teamId","dataSource","durationDays","isEnabled"],{description:"Retention policy create or update request. Provide the telemetry signal, retention duration, enabled state, and optional environment or team scope."}),J9={env:"production",teamId:"team-123-abc",dataSource:"logs",durationDays:30,isEnabled:!0};Object.assign(th,{examples:[J9]});var ZN=d({description:"Creates a retention policy row for a telemetry signal, optionally scoped to an environment or team. Only one policy may exist per combination of data source, environment, and team; creating a duplicate combination fails.",operationId:"createRetentionPolicy",tags:["retention-policies"],url:Xs,method:"POST",body:th,response:Js}),XN=d({description:"Replaces an existing retention policy by ID, including signal, scope fields, duration, and enabled state.",operationId:"updateRetentionPolicy",tags:["retention-policies"],url:`${Xs}/:id`,method:"PUT",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the retention policy to update. Use the `id` returned by retention policy list, get, or create responses."})}),body:th,response:Js}),JN=d({description:"Deletes a retention policy by ID. Retention resolution falls back to the next broader matching policy when one exists.",operationId:"deleteRetentionPolicy",tags:["retention-policies"],url:`${Xs}/:id`,method:"DELETE",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the retention policy to delete. Use the `id` returned by retention policy list, create, or update responses."})}),response:N});var ec=`/${"v1"}/slos`,eV=r.Pick(Dd,["id","sloId","priority","configuration"],{$id:"SloAlert",description:"Alert attached to an SLO, triggered on a burn-rate multiplier or an SLO target threshold"}),tc=r.Object({...r.Pick(di,["id","name","description","tags","configuration","target","timeframeDays","owner","permissions","clusterIds"]).properties,alerts:r.Array(eV,{description:"Alerts attached to this SLO"})},{$id:"Slo",description:"Service Level Objective definition: its SLI configuration, target percentage, rolling timeframe, cluster scope, and attached alerts"}),tV={id:"123-456-abc",name:"API availability 99.9%",description:"Overall API gateway availability over the last 30 days",tags:[{key:"team",value:"platform"}],configuration:{type:"event",dataSource:"logs",goodQuery:{queries:[{filter:"status:ok",aggregate:{type:"count"}}],formula:"q1"},totalQuery:{queries:[{filter:"*",aggregate:{type:"count"}}],formula:"q1"},noDataBehavior:"good"},target:99.9,timeframeDays:30,owner:"team-123-abc",permissions:"all",clusterIds:[],alerts:[{id:"alert-123-abc",sloId:"123-456-abc",priority:1,configuration:{type:"burn-rate",burnRate:14.4}}]};Object.assign(tc,{examples:[tV]});var eL=r.Pick(jd,["filters","sort","limit","offset"]),tL=r.Object({...eL.properties,...Ze,filters:eL.properties.filters},{description:"SLO query request. Use filters, sorting, limit, and offset to page through visible SLOs."}),rV={filters:{owners:{values:["team-123-abc"]},searchQuery:{value:"availability"},tags:{values:[{key:"team",value:"platform"}]},statuses:{values:["breached"]},clusterIds:{values:["cluster-123-abc"]}},sort:{by:"name",direction:"asc"},limit:10,offset:0};Object.assign(tL,{examples:[rV]});var rL=d({description:"Queries SLOs visible to the authenticated operation key. Use this endpoint to inventory SLO definitions, filter by owner, tag, status, or cluster, and page through results.",operationId:"querySlos",tags:["slos"],url:`${ec}/query`,method:"POST",paginated:!0,body:tL,response:r.Array(tc)}),nL=d({description:"Retrieves one SLO definition by ID.",operationId:"getSlo",tags:["slos"],url:`${ec}/:id`,method:"GET",params:r.Object({id:u({allowEmpty:!1,description:"SLO ID returned by SLO query, create, or update operations."})}),response:tc}),oL=["name","description","tags","configuration","target","timeframeDays","owner","permissions","clusterIds","alerts"],iL=r.Pick(mu,oL,{$id:"CreateSloRequest",description:"SLO creation request. Provide ownership, data access, SLI configuration, target, timeframe, optional cluster scope, and the alerts to create."}),aL=r.Pick(Gd,oL,{$id:"UpdateSloRequest",description:"SLO update request. Send all required SLO fields and the full alert list. Alerts are reconciled to exactly the provided list: alerts with a known id are updated, alerts without an id are created, and existing alerts absent from the list are deleted. Omit `clusterIds` to preserve the current cluster scope; send an empty array to run on all clusters."}),sL={name:"API availability 99.9%",description:"Overall API gateway availability over the last 30 days",tags:[{key:"team",value:"platform"}],configuration:{type:"event",dataSource:"logs",goodQuery:{queries:[{filter:"status:ok",aggregate:{type:"count"}}],formula:"q1"},totalQuery:{queries:[{filter:"*",aggregate:{type:"count"}}],formula:"q1"},noDataBehavior:"good"},target:99.9,timeframeDays:30,owner:"team-123-abc",permissions:"all",clusterIds:[],alerts:[{priority:1,configuration:{type:"burn-rate",burnRate:14.4}}]};Object.assign(iL,{examples:[sL]});Object.assign(aL,{examples:[sL]});var cL=d({description:"Creates an SLO owned by the specified team. The SLO can be event-based (good/total queries) or time-based (a thresholded query over evaluation slices) depending on its configuration.",operationId:"createSlo",tags:["slos"],url:ec,method:"POST",body:iL,response:tc}),pL=d({description:"Replaces an existing SLO definition by ID. Send the full SLO input shape, including configuration, ownership, permissions, cluster scope, and the reconciled alert list. Changing configuration, target, timeframe, permissions, or cluster scope resets evaluated SLO state, so returned status and error budget are based on data evaluated after the update.",operationId:"updateSlo",tags:["slos"],url:`${ec}/:id`,method:"PUT",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the SLO to update. Use the `id` returned by SLO query or create."})}),body:aL,response:tc}),uL=d({description:"Deletes an SLO by ID. Deleting an SLO stops future evaluations and removes its attached alerts.",operationId:"deleteSlo",tags:["slos"],url:`${ec}/:id`,method:"DELETE",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the SLO to delete. Use the `id` returned by SLO query or create."})}),response:N});var Ao=`${Ws}/tag-policies`;var nV=["logs","metrics","traces"],rh=r.Array(r.Enum(nV,{description:"Telemetry signal covered by a data tag policy."}),{description:"Telemetry signals covered by the policy. An empty array means logs, metrics, and traces."}),oV=r.Union([Mp,rh]),iV=r.Object({teamIds:r.Array(r.String(),{description:"Team IDs used by this policy scope."}),mode:r.Enum(["include","exclude"],{description:"`include` applies the policy only to listed teams. `exclude` applies it to all teams except the listed teams."})},{description:"Team scope that limits where this policy applies. Omitted means the policy applies to all teams."}),aV=C("type",[r.Object({type:r.Literal("telemetry",{description:"Policy applies to telemetry data points during ingestion or evaluation."}),assetTypes:rh,shouldInsertWarning:r.Boolean({description:"When true, Tsuga annotates non-compliant telemetry with tag policy warnings instead of only measuring violations."}),dropSample:r.Optional(r.Number({description:"Percentage of non-compliant telemetry datapoints to drop. Omitted means no sampling drop is configured."}))},{title:"TelemetryTagPolicy"}),r.Object({type:r.Literal("tsuga_asset",{description:"Policy applies to Tsuga-managed resources such as dashboards, routes, and keys."}),assetTypes:Mp},{title:"TsugaAssetTagPolicy"})]),sV=C("type",[r.Object({type:r.Literal("telemetry",{description:"Policy applies to telemetry data points during ingestion or evaluation."}),assetTypes:rh,shouldInsertWarning:r.Boolean({description:"When true, Tsuga annotates non-compliant telemetry with tag policy warnings instead of only measuring violations."}),dropSample:r.Optional(r.Number({minimum:0,maximum:100,description:"Percentage of non-compliant telemetry datapoints to drop. Valid values are 0 through 100."}))},{title:"TelemetryTagPolicy"}),r.Object({type:r.Literal("tsuga_asset",{description:"Policy applies to Tsuga-managed resources such as dashboards, routes, and keys."}),assetTypes:Mp},{title:"TsugaAssetTagPolicy"})]),lL="Policy surface and enforcement behavior. Use `telemetry` for telemetry data or `tsuga_asset` for Tsuga-managed resources.",cV=r.Unsafe({...aV,description:lL}),pV=r.Unsafe({...sV,description:lL}),Ji=r.Object({id:r.String({description:"Tsuga-generated tag policy ID assigned when the policy is created."}),name:r.String({description:"Human-readable tag policy name."}),description:r.Optional(r.String({description:"Optional user-provided policy description."})),isActive:r.Boolean({description:"Whether Tsuga currently evaluates this policy. Reserved policies (for example the built-in `env` policy on ingestion API keys) cannot be set to false."}),tagKey:r.String({description:"Tag key enforced by this policy."}),allowedTagValues:r.Array(r.String(),{description:"Allowed values for `tagKey`. An empty array means any value is accepted when the tag exists."}),isRequired:r.Boolean({description:"Whether the tag must be present. If false, `allowedTagValues` is still enforced when the tag exists. Reserved policies cannot be set to false."}),teamScope:r.Optional(iV),configuration:cV,creator:r.Optional(pe),updater:r.Optional(pe),owner:r.Optional(r.String({description:"Team ID that owns and manages the policy."})),createdAt:A({description:"Timestamp when Tsuga created the tag policy."}),updatedAt:A({description:"Timestamp when Tsuga last updated the tag policy."}),assetUpdatedAt:A({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})});var rc=r.Object({name:u({description:"Human-readable tag policy name."}),description:r.Optional(u({description:"Optional policy description."})),isActive:r.Boolean({description:"Set to true for Tsuga to evaluate this policy. Reserved policies (for example the built-in `env` policy on ingestion API keys) reject a false value."}),tagKey:u({allowEmpty:!1,description:"Tag key enforced by this policy. Tsuga trims surrounding whitespace before storing the policy."}),allowedTagValues:r.Array(u({allowEmpty:!1}),{maxItems:1e3,description:"Allowed values for `tagKey`. Leave empty to allow any value when the tag exists. Tsuga trims each submitted value before storing the policy."}),isRequired:r.Boolean({description:"Set to true to require the tag. If false, allowed values still apply when the tag exists. Reserved policies reject a false value."}),teamScope:r.Optional(r.Object({teamIds:r.Array(u(),{minItems:1,maxItems:100,description:"Team IDs used by this policy scope."}),mode:r.Enum(["include","exclude"],{description:"`include` applies the policy only to listed teams. `exclude` applies it to all teams except the listed teams."})},{description:"Team scope to store for this policy. Omit this field to apply the policy to all teams."})),configuration:pV,owner:u({allowEmpty:!1,description:"Team ID that will own and manage the policy."})}),ket=d({tags:["tag-policies"],url:Ao,method:"GET",query:r.Object({teamIds:r.Optional(r.Array(u(),{maxItems:100})),assetTypes:r.Optional(oV),searchQuery:r.Optional(u())}),response:r.Array(Ji)}),Met=d({tags:["tag-policies"],url:`${Ao}/:id`,method:"GET",params:r.Object({id:u()}),response:Ji}),Det=d({tags:["tag-policies"],url:Ao,method:"POST",body:rc,response:Ji}),Get=d({tags:["tag-policies"],url:`${Ao}/:id`,method:"PUT",params:r.Object({id:u()}),body:rc,response:Ji}),$et=d({tags:["tag-policies"],url:`${Ao}/:id`,method:"DELETE",params:r.Object({id:u()}),response:N}),jet=d({tags:["tag-policies"],url:`${Ws}/applicable-tag-rules`,method:"GET",query:r.Object({assetType:r.Enum(Ba),teamId:u()}),response:r.Array(r.Object({tagKey:r.String(),allowedTagValues:r.Array(r.String()),isRequired:r.Boolean(),tagPolicyId:r.String()}))}),mL=r.Object({total:r.Number(),totalNonCompliant:r.Number(),idsNonCompliant:r.Array(r.String())}),dL=r.Union([r.Literal("ingestion-api-key"),r.Literal("operation-api-key"),r.Literal("rum-public-token"),r.Literal("dashboard"),r.Literal("log-route"),r.Literal("metric-route"),r.Literal("monitor"),r.Literal("notification-rule"),r.Literal("notification-silence"),r.Literal("slo")]),uV=r.Object({total:r.Number(),totalNonCompliant:r.Number(),byAssetType:r.Record(dL,mL)}),lV=r.Omit(mL,["total"]),mV=r.Object({totalNonCompliant:r.Number(),byAssetType:r.Record(dL,lV)}),fL=r.Object({totals:uV,byTeam:r.Record(r.String(),mV)}),qet=d({tags:["tag-policies"],url:`${Ao}/:id/stats`,method:"GET",params:r.Object({id:u()}),response:fL}),Fet=d({tags:["tag-policies"],url:`${Ao}/new-policy-stats`,method:"POST",body:rc,response:fL});var nc=`/${"v1"}/tag-policies`,gL={name:"Required Environment Tag",description:"Requires dashboards and monitors to declare an environment.",isActive:!0,tagKey:"environment",allowedTagValues:["production","staging"],isRequired:!0,teamScope:{teamIds:["team-123-abc"],mode:"include"},configuration:{type:"tsuga_asset",assetTypes:["dashboard","monitor"]},owner:"team-123-abc"},hL={name:"Telemetry Environment Policy",description:"Warns when telemetry is missing a known deployment environment.",isActive:!0,tagKey:"deployment.environment.name",allowedTagValues:["production","staging","development"],isRequired:!0,configuration:{type:"telemetry",assetTypes:[],shouldInsertWarning:!0,dropSample:25},owner:"team-123-abc"},dV={id:"123-456-abc",...gL},fV={id:"456-789-def",...hL},oc=r.Pick(Ji,["id","name","description","isActive","tagKey","allowedTagValues","isRequired","teamScope","configuration","owner"],{$id:"TagPolicy",description:"Policy that enforces tag requirements on Tsuga-managed assets or telemetry data. See [Tag policies](/documentation/account-and-settings/tag-policies)."}),gV=dV,hV=fV;Object.assign(oc,{examples:[gV,hV]});var nh=r.Pick(rc,["name","description","isActive","tagKey","allowedTagValues","isRequired","teamScope","configuration","owner"],{description:"Tag policy create or update request. Provide policy identity, owner, enforced tag key, allowed values, team scope, active state, and asset or telemetry configuration."}),yV=gL,TV=hL;Object.assign(nh,{examples:[yV,TV]});var yL=d({description:"Lists tag policies visible to the authenticated operation key. Use this to audit required tags, allowed values, team scope, and whether each policy applies to assets or telemetry.",operationId:"listTagPolicies",tags:["tag-policies"],url:nc,method:"GET",response:r.Array(oc)}),TL=d({description:"Retrieves one tag policy by ID.",operationId:"getTagPolicy",tags:["tag-policies"],url:`${nc}/:id`,method:"GET",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the tag policy to retrieve. Use the `id` returned by tag policy list or create responses."})}),response:oc}),EL=d({description:"Creates a tag policy for Tsuga-managed assets or telemetry data. Use the configuration type to choose the policy surface.",operationId:"createTagPolicy",tags:["tag-policies"],url:nc,method:"POST",body:nh,response:oc}),_L=d({description:"Replaces an existing tag policy by ID, including scope, requiredness, allowed values, owner, active state, and configuration. Reserved policies (for example the built-in `env` policy on ingestion API keys) reject changes to `tagKey` and reject `isActive: false` or `isRequired: false`.",operationId:"updateTagPolicy",tags:["tag-policies"],url:`${nc}/:id`,method:"PUT",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the tag policy to update. Use the `id` returned by tag policy list, get, or create responses."})}),body:nh,response:oc}),IL=d({description:"Deletes a tag policy by ID. Tsuga stops evaluating the policy after deletion. Reserved policies (for example the built-in `env` policy on ingestion API keys) cannot be deleted.",operationId:"deleteTagPolicy",tags:["tag-policies"],url:`${nc}/:id`,method:"DELETE",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the tag policy to delete. Use the `id` returned by tag policy list, create, or update responses."})}),response:N});var ic=`/${"v1"}/teams`,ac=r.Pick(ui,["id","name","description","visibility","tags"],{$id:"Team",description:"Collection of users used to manage ownership, visibility, and access to team-owned Tsuga resources. See [Teams](/documentation/account-and-settings/teams)."}),EV={id:"team-123-abc",name:"platform-engineering",visibility:"public",tags:[{key:"department",value:"engineering"}]};Object.assign(ac,{examples:[EV]});var bL=d({description:"Lists teams visible to the authenticated operation key. Use this endpoint to inventory owners for resources, dashboards, monitors, routes, and policies. Pagination fields limit the returned page.",operationId:"listTeams",tags:["teams"],url:ic,method:"GET",paginated:!0,query:r.Object(Ze),response:r.Array(ac)}),SL=d({description:"Retrieves one team by ID.",operationId:"getTeam",tags:["teams"],url:`${ic}/:id`,method:"GET",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the team to retrieve. Use the `id` returned by team list or create responses."})}),response:ac}),oh=r.Pick(cu,["name","description","visibility","tags"],{description:"Team create or update request. Provide the team name, optional description, visibility, and tags."}),_V={name:"platform-engineering",visibility:"public",tags:[{key:"department",value:"engineering"}]};Object.assign(oh,{examples:[_V]});var AL=d({description:"Creates a team for ownership and access control. Use this before assigning resources to a new owner team. A new team sits outside every existing team, so the operation key must be scoped to all teams: a key scoped to its owning team cannot create teams, even with write access to teams.",operationId:"createTeam",tags:["teams"],url:ic,method:"POST",body:oh,response:ac}),OL=d({description:"Replaces a team definition by ID, including name, description, visibility, and tags.",operationId:"updateTeam",tags:["teams"],url:`${ic}/:id`,method:"PUT",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the team to update. Use the `id` returned by team list, get, or create responses."})}),body:oh,response:ac}),xL=d({description:"Deletes a team. Fails while the team still owns resources (dashboards, monitors, routes, API keys, etc.); reassign or delete those first. Team memberships are removed automatically as part of the deletion.",operationId:"deleteTeam",tags:["teams"],url:`${ic}/:id`,method:"DELETE",params:r.Object({id:u({allowEmpty:!1,description:"Identifier of the team to delete. Use the `id` returned by team list, create, or update responses."})}),response:N});function IV(e){return/^[aeiou]/i.test(e)||e==="SLO"?"an":"a"}function RL(e,t){let n=Number(t);if(Number.isNaN(n))throw new Error(`--${e} must be a number (got: ${t})`);return n}function CL(e){let t={};return e.limit!==void 0&&(t.limit=RL("limit",e.limit)),e.offset!==void 0&&(t.offset=RL("offset",e.offset)),t}function ih(e){let t=e.params;if(t?.properties){let n=Object.keys(t.properties);if(n.length===1&&n[0])return n[0]}return"id"}function PL(e,t,n){let o=e.command(t.commandName).description(t.description),i=t.singularOverride??xx(t.commandName).replace(/-/g," "),a=t.pluralOverride??t.commandName.replace(/-/g," "),c=IV(i),l=o.command("list").description(t.listDescription??`List all ${a}`);if(t.listOptions)for(let m of t.listOptions)l.option(m.flag,m.description);if(t.endpoints.list.paginated===!0&&l.option("--limit <n>",`Maximum number of items to return, up to ${ti} (default: ${kp})`).option("--offset <n>","Number of items to skip, to request a later page"),t.enableListBody?l.option("-d, --data <JSON>","Inline JSON body").option("--generate-skeleton","Print a JSON skeleton for the request body and exit").action(async m=>{if(m.generateSkeleton){ee(vi(t.endpoints.list));return}let f=m.data?Ei({data:m.data}):{},h=await n()(t.endpoints.list,{body:{...f,...CL(m)}});ee(h)}):l.action(async m=>{let f=CL(m);if(t.listOptions)for(let E of t.listOptions){let I=m[E.queryParam];I!==void 0&&(f[E.queryParam]=I)}let h=await n()(t.endpoints.list,Object.keys(f).length>0?{query:f}:void 0);ee(h)}),t.endpoints.get){let m=t.endpoints.get,f=ih(m);o.command("get <ID>").description(`Get ${c} ${i} by ID`).action(async h=>{let E=await n()(m,{params:{[f]:h}});ee(E)})}if(t.endpoints.create){let m=t.endpoints.create;o.command("create").description(`Create a new ${i}`).option("-f, --file <FILE_PATH>","Read body from file (use - for stdin)").option("-d, --data <JSON>","Inline JSON body").option("--generate-skeleton","Print a JSON skeleton for the request body and exit").action(async f=>{if(f.generateSkeleton){ee(vi(m));return}let h=Ei(f),E=await n()(m,{body:h});ee(E)})}if(t.endpoints.update){let m=t.endpoints.update,f=ih(m);o.command("update <ID>").description(`Update ${c} ${i} by ID`).option("-f, --file <FILE_PATH>","Read body from file (use - for stdin)").option("-d, --data <JSON>","Inline JSON body").option("--generate-skeleton","Print a JSON skeleton for the request body and exit").action(async(h,E)=>{if(E.generateSkeleton){ee(vi(m));return}let I=Ei(E),g=await n()(m,{params:{[f]:h},body:I});ee(g)})}if(t.endpoints.delete){let m=t.endpoints.delete,f=ih(m);o.command("delete <ID>").description(`Delete ${c} ${i} by ID`).action(async h=>{let E=await n()(m,{params:{[f]:h}});ee(E)})}}var bV=[{commandName:"cloud-resources",description:"List cloud resources discovered by inventory scans",endpoints:{list:kv},enableListBody:!0},{commandName:"dashboard-folders",description:"Manage dashboard folders",endpoints:{list:qw,get:Fw,create:Bw,update:Hw,delete:Kw},enableListBody:!0},{commandName:"dashboards",description:"Manage dashboards",endpoints:{list:dv,get:fv,create:gv,update:hv,delete:yv},enableListBody:!0},{commandName:"ingestion-api-keys",description:"Manage ingestion API keys",singularOverride:"ingestion API key",pluralOverride:"ingestion API keys",endpoints:{list:Av,create:Ov,update:xv,delete:Rv}},{commandName:"investigations",description:"Manage investigations (beta)",endpoints:{list:Dv,get:Gv,create:$v,update:jv,delete:qv}},{commandName:"monitors",description:"Manage monitors",endpoints:{list:lN,get:mN,create:_N,update:IN,delete:bN},enableListBody:!0},{commandName:"notification-rules",description:"Manage notification rules",endpoints:{list:AN,get:ON,create:xN,update:RN,delete:CN}},{commandName:"notification-silences",description:"Manage notification silences",endpoints:{list:NN,get:LN,create:kN,update:MN,delete:DN}},{commandName:"quality-reports",description:"Get the latest quality report rows for a cluster",listDescription:"Get the latest quality report rows for a cluster (pass --cluster <CLUSTER_ID> when the org has more than one cluster)",endpoints:{list:HN},listOptions:[{flag:"--team <TEAM_NAME>",description:"Only return rows for this team by name (omits cluster-wide global rows)",queryParam:"team"}]},{commandName:"retention-policies",description:"Manage retention policies",endpoints:{list:QN,get:WN,create:ZN,update:XN,delete:JN}},{commandName:"log-routes",description:"Manage log routes",endpoints:{list:eN,get:tN,create:rN,update:nN,delete:oN}},{commandName:"services",description:"List and inspect services (read-only; services are inferred from telemetry)",endpoints:{list:wR,get:vR}},{commandName:"slos",description:"Manage SLOs",singularOverride:"SLO",pluralOverride:"SLOs",endpoints:{list:rL,get:nL,create:cL,update:pL,delete:uL},enableListBody:!0},{commandName:"tag-policies",description:"Manage tag policies",endpoints:{list:yL,get:TL,create:EL,update:_L,delete:IL}},{commandName:"teams",description:"Manage teams",endpoints:{list:bL,get:SL,create:AL,update:OL,delete:xL}}];function UL(e,t){for(let n of bV)PL(e,n,t)}var wL=require("node:child_process");var gl="@tsuga/cli@latest";function SV(){V(`Updating ${gl}`),V(` $ npm install -g ${gl}`);try{(0,wL.execFileSync)("npm",["install","-g",gl],{stdio:["ignore","inherit","inherit"]})}catch(e){let t=e.status??1;throw new Error(`npm install -g ${gl} exited ${t}`,{cause:e})}V("Updated. Run `tsuga --version` to confirm the new version.")}function vL(e){e.command("self-update").description("Update the Tsuga CLI to the latest version via npm").action(()=>{SV()})}var mh=require("node:fs"),lh=require("node:os"),ta=require("node:path");var AV=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i,sc=class e extends Date{#t=!1;#r=!1;#e=null;constructor(t){let n=!0,o=!0,i="Z";if(typeof t=="string"){let a=t.match(AV);a?(a[1]||(n=!1,t=`0000-01-01T${t}`),o=!!a[2],o&&t[10]===" "&&(t=t.replace(" ","T")),a[2]&&+a[2]>23?t="":(i=a[3]||null,t=t.toUpperCase(),!i&&o&&(t+="Z"))):t=""}super(t),isNaN(this.getTime())||(this.#t=n,this.#r=o,this.#e=i)}isDateTime(){return this.#t&&this.#r}isLocal(){return!this.#t||!this.#r||!this.#e}isDate(){return this.#t&&!this.#r}isTime(){return this.#r&&!this.#t}isValid(){return this.#t||this.#r}toISOString(){let t=super.toISOString();if(this.isDate())return t.slice(0,10);if(this.isTime())return t.slice(11,23);if(this.#e===null)return t.slice(0,-1);if(this.#e==="Z")return t;let n=+this.#e.slice(1,3)*60+ +this.#e.slice(4,6);return n=this.#e[0]==="-"?n:-n,new Date(this.getTime()-n*6e4).toISOString().slice(0,-1)+this.#e}static wrapAsOffsetDateTime(t,n="Z"){let o=new e(t);return o.#e=n,o}static wrapAsLocalDateTime(t){let n=new e(t);return n.#e=null,n}static wrapAsLocalDate(t){let n=new e(t);return n.#r=!1,n.#e=null,n}static wrapAsLocalTime(t){let n=new e(t);return n.#t=!1,n.#e=null,n}};function OV(e,t){let n=e.slice(0,t).split(/\r\n|\n|\r/g);return[n.length,n.pop().length+1]}function xV(e,t,n){let o=e.split(/\r\n|\n|\r/g),i="",a=(Math.log10(t+1)|0)+1;for(let c=t-1;c<=t+1;c++){let l=o[c-1];l&&(i+=c.toString().padEnd(a," "),i+=": ",i+=l,i+=`
|
|
142
142
|
`,c===t&&(i+=" ".repeat(a+n+2),i+=`^
|
|
143
|
-
`))}return i}var X=class extends Error{line;column;codeblock;constructor(t,n){let[o,i]=
|
|
143
|
+
`))}return i}var X=class extends Error{line;column;codeblock;constructor(t,n){let[o,i]=OV(n.toml,n.ptr),a=xV(n.toml,o,i);super(`Invalid TOML document: ${t}
|
|
144
144
|
|
|
145
|
-
${a}`,n),this.line=o,this.column=i,this.codeblock=a}};var
|
|
145
|
+
${a}`,n),this.line=o,this.column=i,this.codeblock=a}};var RV=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,CV=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,PV=/^[+-]?0[0-9_]/;function hl(e,t){let n=e[t++],o=n,i=n==="'",a=n===e[t]&&n===e[t+1];a&&(e[t+=2]===`
|
|
146
146
|
`?t++:e[t]==="\r"&&e[t+1]===`
|
|
147
147
|
`&&(t+=2));let c="",l=t,m=0;for(let f=t;f<e.length;f++)if(n=e[f],a&&(n===`
|
|
148
148
|
`||n==="\r"&&e[f+1]===`
|
|
149
149
|
`))m=m&&3;else{if(n<" "&&n!==" "||n==="\x7F")throw new X("control characters are not allowed in strings",{toml:e,ptr:f});if((!m||m===3)&&n===o&&(!a||e[f+1]===o&&e[f+2]===o))return a&&(e[f+3]===o&&f++,e[f+3]===o&&f++),[m?c:c+e.slice(l,f),f+(a?3:1)];if(!m)!i&&n==="\\"&&(c+=e.slice(l,l=f),m=1);else if(m===1)if(n==="x"||n==="u"||n==="U"){let h=0,E=n==="x"?2:n==="u"?4:8;for(let I=0;I<E;I++,f++){let g=e.charCodeAt(f+1),T=g>=48&&g<=57?g-48:g>=65&&g<=70?g-65+10:g>=97&&g<=102?g-97+10:-1;if(T<0)throw new X("invalid non-hex character in unicode escape",{toml:e,ptr:f+1});h=h<<4|T}if(h<0||h>1114111||h>=55296&&h<=57343)throw new X("invalid unicode escape",{toml:e,ptr:f});c+=String.fromCodePoint(h),l=f+1,m=0}else if(n===" "||n===" ")m=2;else{if(n==="b")c+="\b";else if(n==="t")c+=" ";else if(n==="n")c+=`
|
|
150
|
-
`;else if(n==="f")c+="\f";else if(n==="r")c+="\r";else if(n==="e")c+="\x1B";else if(n==='"')c+='"';else if(n==="\\")c+="\\";else throw new X("unrecognized escape sequence",{toml:e,ptr:f});l=f+1,m=0}else if(n!==" "&&n!==" "){if(m===2)throw new X("invalid escape: only line-ending whitespace may be escaped",{toml:e,ptr:l});m=!i&&n==="\\"?1:0,l=f}}throw new X("unfinished string",{toml:e,ptr:t})}function NL(e,t,n,o){if(e==="true")return!0;if(e==="false")return!1;if(e==="-inf")return-1/0;if(e==="inf"||e==="+inf")return 1/0;if(e==="nan"||e==="+nan"||e==="-nan")return NaN;if(e==="-0")return o?0n:0;let i=
|
|
150
|
+
`;else if(n==="f")c+="\f";else if(n==="r")c+="\r";else if(n==="e")c+="\x1B";else if(n==='"')c+='"';else if(n==="\\")c+="\\";else throw new X("unrecognized escape sequence",{toml:e,ptr:f});l=f+1,m=0}else if(n!==" "&&n!==" "){if(m===2)throw new X("invalid escape: only line-ending whitespace may be escaped",{toml:e,ptr:l});m=!i&&n==="\\"?1:0,l=f}}throw new X("unfinished string",{toml:e,ptr:t})}function NL(e,t,n,o){if(e==="true")return!0;if(e==="false")return!1;if(e==="-inf")return-1/0;if(e==="inf"||e==="+inf")return 1/0;if(e==="nan"||e==="+nan"||e==="-nan")return NaN;if(e==="-0")return o?0n:0;let i=RV.test(e);if(i||CV.test(e)){if(PV.test(e))throw new X("leading zeroes are not allowed",{toml:t,ptr:n});e=e.replace(/_/g,"");let c=+e;if(isNaN(c))throw new X("invalid number",{toml:t,ptr:n});if(i){if((i=!Number.isSafeInteger(c))&&!o)throw new X("integer value cannot be represented losslessly",{toml:t,ptr:n});(i||o===!0)&&(c=BigInt(e))}return c}let a=new sc(e);if(!a.isValid())throw new X("invalid value",{toml:t,ptr:n});return a}function yl(e,t=0,n=e.length){let o=e.indexOf(`
|
|
151
151
|
`,t);return e[o-1]==="\r"&&o--,o<=n?o:-1}function ea(e,t){for(let n=t;n<e.length;n++){let o=e[n];if(o===`
|
|
152
152
|
`)return n;if(o==="\r"&&e[n+1]===`
|
|
153
153
|
`)return n+1;if(o<" "&&o!==" "||o==="\x7F")throw new X("control characters are not allowed in comments",{toml:e,ptr:t})}return e.length}function wr(e,t,n,o){let i;for(;;){for(;(i=e[t])===" "||i===" "||!n&&(i===`
|
|
154
154
|
`||i==="\r"&&e[t+1]===`
|
|
155
155
|
`);)t++;if(o||i!=="#")break;t=ea(e,t)}return t}function LL(e,t,n,o,i=!1){if(!o)return t=yl(e,t),t<0?e.length:t;for(let a=t;a<e.length;a++){let c=e[a];if(c==="#"){if(a=yl(e,a),a<0)break}else{if(c===n)return a+1;if(c===o||i&&(c===`
|
|
156
156
|
`||c==="\r"&&e[a+1]===`
|
|
157
|
-
`))return a}}throw new X("cannot find end of structure",{toml:e,ptr:t})}function
|
|
158
|
-
`&&e[f]!=="\r")throw new X("unexpected character encountered",{toml:e,ptr:f});e[f]===","&&f++}return[m,f]}let c=LL(e,t,",",n),l=
|
|
157
|
+
`))return a}}throw new X("cannot find end of structure",{toml:e,ptr:t})}function UV(e,t,n){let o=e.slice(t,n),i=o.indexOf("#");return i>-1&&(ea(e,i),o=o.slice(0,i)),[o.trimEnd(),i]}function cc(e,t,n,o,i){if(o===0)throw new X("document contains excessively nested structures. aborting.",{toml:e,ptr:t});let a=e[t];if(a==="["||a==="{"){let[m,f]=a==="["?ML(e,t,o,i):kL(e,t,o,i);if(n){if(f=wr(e,f),e[f]===",")f++;else if(e[f]!==n)throw new X("expected comma or end of structure",{toml:e,ptr:f})}return[m,f]}if(a==='"'||a==="'"){let[m,f]=hl(e,t);if(n){if(f=wr(e,f),e[f]&&e[f]!==","&&e[f]!==n&&e[f]!==`
|
|
158
|
+
`&&e[f]!=="\r")throw new X("unexpected character encountered",{toml:e,ptr:f});e[f]===","&&f++}return[m,f]}let c=LL(e,t,",",n),l=UV(e,t,c-(e[c-1]===","?1:0));if(!l[0])throw new X("incomplete key-value declaration: no value specified",{toml:e,ptr:t});return n&&l[1]>-1&&(c=wr(e,t+l[1]),e[c]===","&&c++),[NL(l[0],e,t,i),c]}var wV=/^[a-zA-Z0-9-_]+[ \t]*$/;function Tl(e,t,n="="){let o=t-1,i=[],a=e.indexOf(n,t);if(a<0)throw new X("incomplete key-value: cannot find end of key",{toml:e,ptr:t});do{let c=e[t=++o];if(c!==" "&&c!==" ")if(c==='"'||c==="'"){if(c===e[t+1]&&c===e[t+2])throw new X("multiline strings are not allowed in keys",{toml:e,ptr:t});let[l,m]=hl(e,t);o=e.indexOf(".",m);let f=e.slice(m,o<0||o>a?a:o),h=yl(f);if(h>-1)throw new X("newlines are not allowed in keys",{toml:e,ptr:t+o+h});if(f.trimStart())throw new X("found extra tokens after the string part",{toml:e,ptr:m});if(a<m&&(a=e.indexOf(n,m),a<0))throw new X("incomplete key-value: cannot find end of key",{toml:e,ptr:t});i.push(l)}else{o=e.indexOf(".",t);let l=e.slice(t,o<0||o>a?a:o);if(!wV.test(l))throw new X("only letter, numbers, dashes and underscores are allowed in keys",{toml:e,ptr:t});i.push(l.trimEnd())}}while(o+1&&o<a);return[i,wr(e,a+1,!0,!0)]}function kL(e,t,n,o){let i={},a=new Set,c;for(t++;(c=e[t++])!=="}"&&c;){if(c===",")throw new X("expected value, found comma",{toml:e,ptr:t-1});if(c==="#")t=ea(e,t);else if(c!==" "&&c!==" "&&c!==`
|
|
159
159
|
`&&c!=="\r"){let l,m=i,f=!1,[h,E]=Tl(e,t-1);for(let T=0;T<h.length;T++){if(T&&(m=f?m[l]:m[l]={}),l=h[T],(f=Object.hasOwn(m,l))&&(typeof m[l]!="object"||a.has(m[l])))throw new X("trying to redefine an already defined value",{toml:e,ptr:t});!f&&l==="__proto__"&&Object.defineProperty(m,l,{enumerable:!0,configurable:!0,writable:!0})}if(f)throw new X("trying to redefine an already defined value",{toml:e,ptr:t});let[I,g]=cc(e,E,"}",n-1,o);a.add(I),m[l]=I,t=g}}if(!c)throw new X("unfinished table encountered",{toml:e,ptr:t});return[i,t]}function ML(e,t,n,o){let i=[],a;for(t++;(a=e[t++])!=="]"&&a;){if(a===",")throw new X("expected value, found comma",{toml:e,ptr:t-1});if(a==="#")t=ea(e,t);else if(a!==" "&&a!==" "&&a!==`
|
|
160
160
|
`&&a!=="\r"){let c=cc(e,t-1,"]",n-1,o);i.push(c[0]),t=c[1]}}if(!a)throw new X("unfinished array encountered",{toml:e,ptr:t});return[i,t]}function DL(e,t,n,o){let i=t,a=n,c,l=!1,m;for(let f=0;f<e.length;f++){if(f){if(i=l?i[c]:i[c]={},a=(m=a[c]).c,o===0&&(m.t===1||m.t===2))return null;if(m.t===2){let h=i.length-1;i=i[h],a=a[h].c}}if(c=e[f],(l=Object.hasOwn(i,c))&&a[c]?.t===0&&a[c]?.d)return null;l||(c==="__proto__"&&(Object.defineProperty(i,c,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(a,c,{enumerable:!0,configurable:!0,writable:!0})),a[c]={t:f<e.length-1&&o===2?3:o,d:!1,i:0,c:{}})}if(m=a[c],m.t!==o&&!(o===1&&m.t===3)||(o===2&&(m.d||(m.d=!0,i[c]=[]),i[c].push(i={}),m.c[m.i++]=m={t:1,d:!1,i:0,c:{}}),m.d))return null;if(m.d=!0,o===1)i=l?i[c]:i[c]={};else if(o===0&&l)return null;return[c,i,m.c]}function ah(e,{maxDepth:t=1e3,integersAsBigInt:n}={}){let o={},i={},a=o,c=i;for(let l=wr(e,0);l<e.length;){if(e[l]==="["){let m=e[++l]==="[",f=Tl(e,l+=+m,"]");if(m){if(e[f[1]-1]!=="]")throw new X("expected end of table declaration",{toml:e,ptr:f[1]-1});f[1]++}let h=DL(f[0],o,i,m?2:1);if(!h)throw new X("trying to redefine an already defined table or value",{toml:e,ptr:l});c=h[2],a=h[1],l=f[1]}else{let m=Tl(e,l),f=DL(m[0],a,c,0);if(!f)throw new X("trying to redefine an already defined table or value",{toml:e,ptr:l});let h=cc(e,m[1],void 0,t,n);f[1][f[0]]=h[0],l=h[1]}if(l=wr(e,l,!0),e[l]&&e[l]!==`
|
|
161
|
-
`&&e[l]!=="\r")throw new X("each key-value declaration must be followed by an end-of-line",{toml:e,ptr:l});l=wr(e,l)}return o}var GL=/^[a-z0-9-_]+$/i;function pc(e){let t=typeof e;if(t==="object"){if(Array.isArray(e))return"array";if(e instanceof Date)return"date"}return t}function
|
|
161
|
+
`&&e[l]!=="\r")throw new X("each key-value declaration must be followed by an end-of-line",{toml:e,ptr:l});l=wr(e,l)}return o}var GL=/^[a-z0-9-_]+$/i;function pc(e){let t=typeof e;if(t==="object"){if(Array.isArray(e))return"array";if(e instanceof Date)return"date"}return t}function vV(e){for(let t=0;t<e.length;t++)if(pc(e[t])!=="object")return!1;return e.length!=0}function sh(e){return JSON.stringify(e).replace(/\x7f/g,"\\u007f")}function ch(e,t,n,o){if(n===0)throw new Error("Could not stringify the object: maximum object depth exceeded");if(t==="number")return isNaN(e)?"nan":e===1/0?"inf":e===-1/0?"-inf":Number.isInteger(e)&&(o||!Number.isSafeInteger(e))?e.toFixed(1):e.toString();if(t==="bigint"||t==="boolean")return e.toString();if(t==="string")return sh(e);if(t==="date"){if(isNaN(e.getTime()))throw new TypeError("cannot serialize invalid date");return e.toISOString()}if(t==="object")return NV(e,n,o);if(t==="array")return LV(e,n,o)}function NV(e,t,n){let o=Object.keys(e);if(o.length===0)return"{}";let i="{ ";for(let a=0;a<o.length;a++){let c=o[a];a&&(i+=", "),i+=GL.test(c)?c:sh(c),i+=" = ",i+=ch(e[c],pc(e[c]),t-1,n)}return i+" }"}function LV(e,t,n){if(e.length===0)return"[]";let o="[ ";for(let i=0;i<e.length;i++){if(i&&(o+=", "),e[i]===null||e[i]===void 0)throw new TypeError("arrays cannot contain null or undefined values");o+=ch(e[i],pc(e[i]),t-1,n)}return o+" ]"}function kV(e,t,n,o){if(n===0)throw new Error("Could not stringify the object: maximum object depth exceeded");let i="";for(let a=0;a<e.length;a++)i+=`${i&&`
|
|
162
162
|
`}[[${t}]]
|
|
163
|
-
`,i+=ph(0,e[a],t,n,o);return i}function ph(e,t,n,o,i){if(o===0)throw new Error("Could not stringify the object: maximum object depth exceeded");let a="",c="",l=Object.keys(t);for(let m=0;m<l.length;m++){let f=l[m];if(t[f]!==null&&t[f]!==void 0){let h=pc(t[f]);if(h==="symbol"||h==="function")throw new TypeError(`cannot serialize values of type '${h}'`);let E=GL.test(f)?f:sh(f);if(h==="array"&&
|
|
164
|
-
`)+
|
|
163
|
+
`,i+=ph(0,e[a],t,n,o);return i}function ph(e,t,n,o,i){if(o===0)throw new Error("Could not stringify the object: maximum object depth exceeded");let a="",c="",l=Object.keys(t);for(let m=0;m<l.length;m++){let f=l[m];if(t[f]!==null&&t[f]!==void 0){let h=pc(t[f]);if(h==="symbol"||h==="function")throw new TypeError(`cannot serialize values of type '${h}'`);let E=GL.test(f)?f:sh(f);if(h==="array"&&vV(t[f]))c+=(c&&`
|
|
164
|
+
`)+kV(t[f],n?`${n}.${E}`:E,o-1,i);else if(h==="object"){let I=n?`${n}.${E}`:E;c+=(c&&`
|
|
165
165
|
`)+ph(I,t[f],I,o-1,i)}else a+=E,a+=" = ",a+=ch(t[f],h,o,i),a+=`
|
|
166
166
|
`}}return e&&(a||!c)&&(a=a?`[${e}]
|
|
167
167
|
${a}`:`[${e}]`),a&&c?`${a}
|
|
168
168
|
${c}`:a||c}function uh(e,{maxDepth:t=1e3,numbersAsFloat:n=!1}={}){if(pc(e)!=="object")throw new TypeError("stringify can only be called with an object");let o=ph(0,e,"",t,n);return o[o.length-1]!==`
|
|
169
169
|
`?o+`
|
|
170
|
-
`:o}var
|
|
171
|
-
`),V(f===void 0?" created":` patched (backup: ${f})`)}function jV(e,t,n){return{environment:"dev",log_user_prompt:n,exporter:{"otlp-http":{endpoint:`${e}/v1/logs`,protocol:"binary",headers:{Authorization:`Bearer ${t}`}}},trace_exporter:{"otlp-http":{endpoint:`${e}/v1/traces`,protocol:"binary",headers:{Authorization:`Bearer ${t}`}}}}}function FV(e,t,n,o){let i=(0,ta.join)(e,".codex"),a=(0,ta.join)(i,"config.toml");V(`Codex \u2192 ${a}`),(0,mh.mkdirSync)(i,{recursive:!0});let c=Ss(a),l=c===void 0?{}:ah(c),m="otel"in l;delete l.otel,l.otel=jV(t,n,o);let f=As(a,c);bs(a,uh(l)),V(f===void 0?" created":m?` replaced existing [otel] tables (backup: ${f})`:` appended (backup: ${f})`)}function $L(){return new kr("--endpoint <OTLP_ENDPOINT>","OTLP base URL").env("TSUGA_OTLP_ENDPOINT").makeOptionMandatory()}function jL(){return new kr("--ingestion-api-key <INGESTION_API_KEY>","Tsuga ingestion API key").env("TSUGA_INGESTION_API_KEY").makeOptionMandatory()}var FL="Restart your claude / codex session to load the new config.";function qL(e){let t=e.command("setup").description("Configure local LLM CLIs to ship OTEL telemetry to Tsuga");t.command("claude-code").description("Patch ~/.claude/settings.json with Tsuga OTEL env").addOption($L()).addOption(jL()).option("--no-include-prompts","Strip user prompts + tool content from telemetry (default: include)").action(n=>{$V((0,lh.homedir)(),n.endpoint.replace(/\/+$/,""),n.ingestionApiKey,n.includePrompts),V(FL)}),t.command("codex").description("Patch ~/.codex/config.toml with Tsuga OTEL settings (replaces any existing [otel] table)").addOption($L()).addOption(jL()).option("--no-include-prompts","Strip user prompts from telemetry (default: include)").action(n=>{FV((0,lh.homedir)(),n.endpoint.replace(/\/+$/,""),n.ingestionApiKey,n.includePrompts),V(FL)})}var Oo="/v0/logs";var dh=["CRITICAL","ERROR","WARN","NOTICE","INFO","DEBUG","TRACE"];var uc=0,fh=r.Object({__tsuga_metadata__:r.Object({id:r.String(),source:r.Optional(r.String())},{additionalProperties:!0}),context:r.Optional(r.Object({team:r.Optional(r.String({description:"Team name associated with this log."})),tag_policy_warnings:r.Optional(r.Record(r.String(),r.String()))},{additionalProperties:!0,description:"Context attributes attached to the log after ingestion and route processing. `team` comes from telemetry or route-enriched context when present."})),message:r.Optional(r.Unknown({description:"Log message after ingestion and route processing. It can be any JSON value because processors may map arbitrary data into `message`."})),timestamp:r.Number({description:"Log timestamp as a Unix timestamp in milliseconds."}),level:r.Enum(dh,{description:"Log severity, normalized from the source severity into one of the fixed Tsuga levels (ordered `CRITICAL` to `TRACE`)."}),[WO]:r.Optional(r.String({description:"ID of the cluster this log was read from. Only set when the request spanned several clusters."}))},{additionalProperties:!0}),BL=100,qV="timestamp",BV=r.Union([r.Literal(qV)]),Ln=r.Partial(r.Object({...at.properties,query:u({type:"tsuga-query",description:"Tsuga query used to filter logs in the selected time range."}),maxResults:r.Integer({minimum:1,maximum:1e3,description:"Maximum number of logs to return. Valid values are 1 through 1000."}),shouldRecommendAttributes:r.Boolean({description:"Whether Tsuga should return suggested attributes to highlight in results."}),triggeredBy:r.Literal("refresh",{description:"Indicates the query was triggered by a refresh action."}),startOffset:r.Number({minimum:uc,description:"Result offset used when fetching additional log rows."}),startOffsets:r.Array(r.Number({minimum:uc}),{description:`Result offsets used when fetching additional log rows, one per entry of \`clusterIds\` and in the same order. Echo back each cluster's \`nextStartOffset\` from the previous response. Must have the same length as \`clusterIds\`. Defaults to ${uc} for every cluster.`}),clusterId:u({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}),clusterIds:Ja,sortBy:BV,sortDirection:r.Union([r.Literal("asc"),r.Literal("desc")],{description:"Timestamp sort direction for log results."})})),Trt=d({tags:["logs"],url:`${Oo}/count`,method:"GET",query:r.Pick(Ln,["from","to","query","clusterId","clusterIds"]),response:r.Object({count:r.Number(),clusterResponses:r.Optional(ai())})}),lc=r.Object({value:r.String(),priority:r.Number()}),Ert=d({tags:["logs"],url:`${Oo}/search`,method:"GET",query:Ln,response:r.Object({logs:r.Optional(r.Array(fh)),attributesToHighlight:r.Optional(r.Array(lc)),clusterResponses:r.Optional(ai(r.Object({nextStartOffset:r.Number({description:"Number of logs consumed on this cluster so far. Echo it back at this cluster's position in `startOffsets` to fetch the next page."})})))},{additionalProperties:!0})}),HV=r.Cyclic({TokenOutput:r.Union([r.Object({type:r.Literal("top"),values:r.Array(r.String())}),r.Object({type:r.Literal("ip"),value:r.String()}),r.Object({type:r.Literal("range"),min:r.Number(),max:r.Number()}),r.Object({type:r.Literal("variable"),value:r.String()}),r.Object({type:r.Literal("text"),value:r.String()}),r.Object({type:r.Literal("date"),value:r.String()}),r.Object({type:r.Literal("url"),value:r.String()}),r.Object({type:r.Literal("structure"),key:r.Array(r.String()),value:r.Array(r.Ref("TokenOutput"))})])},"TokenOutput",{description:"A token identified as part of the pattern"}),KV=r.Object({id:r.String(),pattern:r.Array(HV),size:r.Integer({description:"Number of logs that matched the pattern"}),examples:r.Array(r.Object({id:r.String(),timestampUnix:r.Number()})),timeDistribution:r.Array(r.Number()),staticFeatures:r.Array(r.Object({key:r.String(),value:r.String()},{description:"Fixed groups present in all logs matching the pattern"}))}),_rt=d({tags:["logs"],url:`${Oo}/patterns`,method:"GET",query:r.Object({...at.properties,query:u({type:"tsuga-query"}),clusteringThreshold:r.Optional(r.Number()),clusterId:r.Optional(u({allowEmpty:!1}))}),response:r.Object({patterns:r.Array(KV),sampleSize:r.Number()})}),Irt=d({tags:["logs"],url:`${Oo}/attributes`,method:"GET",query:r.Object({...at.properties,clusterId:r.Optional(u({allowEmpty:!1,description:"Cluster ID"})),clusterIds:r.Optional(Ja)}),response:r.Object({attributes:r.Array(r.String()),clusterResponses:r.Optional(ai())})});var zV=["pending","running","completed","incomplete","failed"],HL=r.Object({id:r.String({description:"ID of the export."}),status:r.Enum(zV,{description:"Lifecycle of the export. `pending` until the download is claimed, `running` while the CSV streams, then `completed`, `incomplete` when the file is usable but some matched logs could not be reached, or `failed` if the export was interrupted."}),rowsWritten:r.Number({description:"Logs written to the CSV so far. Updated periodically while the download streams, so it lags slightly behind the bytes on the wire."}),totalRows:r.Number({description:"Logs this export will write, already clamped to the export maximum. Use it as the denominator for progress."}),isTruncated:r.Boolean({description:"Whether the query matched more logs than the export maximum, so the CSV holds only the first logs in the requested sort order."}),errorMessage:r.Optional(r.String({description:"Why the export is incomplete or failed."}))}),brt=d({tags:["logs"],url:`${Oo}/exports`,method:"POST",body:r.Object({...r.Pick(Ln,["from","to","query","clusterId","clusterIds","sortBy","sortDirection"]).properties,columns:r.Array(u({allowEmpty:!1}),{minItems:1,description:"Log attributes to write as CSV columns, in order. Each becomes one column, resolved against the log with dotted-path lookup."})}),response:r.Object({...HL.properties,downloadUrl:r.String({description:"Relative URL to fetch the CSV from. It carries a single-use token that expires shortly after creation, so the caller must start the download immediately."})})}),Srt=d({tags:["logs"],url:`${Oo}/exports/:exportId`,method:"GET",params:r.Object({exportId:r.String()}),response:HL}),Art=d({tags:["logs"],url:`${Oo}/exports/:exportId/download`,method:"GET",params:r.Object({exportId:r.String()}),query:r.Object({token:u({allowEmpty:!1,description:"Single-use token minted when the export was created."})}),response:r.String({description:"CSV file, streamed as it is produced."})});var mc=`/${"v1"}/logs`,gh=r.Object({context:r.Optional(r.Object({team:r.Optional(r.String({description:"Team name associated with this log."}))},{additionalProperties:!0,$id:"LogContext",description:"Context attributes attached to the log after ingestion and route processing. `team` comes from telemetry or route-enriched context when present."})),...r.Pick(fh,["message","timestamp","level"]).properties},{additionalProperties:!0,$id:"LogEvent",description:"Log event including message, timestamp, severity level, and optional enriched context attributes."}),YV={context:{team:"platform"},message:"Request completed successfully",timestamp:17040672e5,level:"INFO"};Object.assign(gh,{examples:[YV]});var KL=r.Object({query:r.Optional(u({type:"tsuga-query",default:"*",description:"Tsuga query selecting logs to return. Omit to search all logs with `*`."})),maxResults:r.Optional(r.Integer({minimum:1,maximum:1e3,default:BL,description:"Maximum number of logs to return. Defaults to 100. Valid values are 1 through 1000."})),clusterId:r.Optional(u({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."})),...bt.properties},{description:"Log search query. Provide a time range, optional Tsuga query, and optional limit."}),VV={query:"level:ERROR",maxResults:100,from:1704067200,to:1704070800};Object.assign(KL,{examples:[VV]});var zL=d({description:"Searches logs in a required time range using Tsuga query syntax. Use this endpoint to retrieve raw log events for investigations or automation. See [Logs](/documentation/explore/logs) and [Query syntax](/documentation/explore/query-syntax).",operationId:"searchLogs",tags:["public","logs"],url:`${mc}/search`,method:"GET",query:KL,response:r.Object({logs:r.Array(gh,{description:"Log events matching the query and time range."})})}),QV=r.Object({pattern:r.String({description:"Clustered log pattern formatted as a readable string."}),size:r.Integer({description:"Number of logs that matched the pattern"}),groups:r.Array(r.Object({key:r.String({description:"Attribute dot-path shared by all logs in the pattern."}),value:r.String({description:"Value of the attribute identified by `key`, common to all logs in the pattern."})},{description:"Attribute key-value pair that is constant across every log matching this pattern, e.g. a shared `level` or `context.team`."}))}),YL=r.Object({patterns:r.Array(QV,{description:"Log patterns clustered from logs matching the query."}),sampleSize:r.Number({description:"Number of logs sampled while computing patterns."})},{}),WV={patterns:[{pattern:"Resolved segment SegmentId([0:1]) from cache",size:37004,groups:[{key:"level",value:"DEBUG"},{key:"context.team",value:"infra"}]}],sampleSize:100};Object.assign(YL,{examples:[WV]});var VL=d({description:"Clusters matching logs into readable patterns for the requested time range. Use this to summarize common log shapes before drilling into raw events. See [Logs](/documentation/explore/logs).",operationId:"getLogPatterns",tags:["public","logs"],url:`${mc}/patterns`,method:"GET",query:r.Object({...bt.properties,query:u({type:"tsuga-query",description:"Tsuga query selecting logs to cluster into patterns."}),clusterId:r.Optional(u({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))}),response:YL}),ZV=r.Object({exampleLog:r.Optional(gh),team:r.String({description:"Team associated with the new error pattern."}),env:r.String({description:"Environment associated with the new error pattern."}),service:r.String({description:"Service associated with the new error pattern."}),firstSeen:r.Number({description:"Unix timestamp in seconds when this pattern was first seen."}),lastSeen:r.Number({description:"Unix timestamp in seconds when this pattern was last seen."})}),QL=r.Object({newErrorPatterns:r.Array(ZV,{description:"Error patterns first seen in the requested time range."})},{}),XV={newErrorPatterns:[{team:"platform",env:"production",service:"api-gateway",firstSeen:1704067200,lastSeen:1704153600,exampleLog:{message:"ConnectionError: Failed to connect to database",timestamp:17041536e5,level:"ERROR"}}]};Object.assign(QL,{examples:[XV]});var WL=d({description:"Finds error patterns first seen in the requested time range, optionally filtered by team, environment, or service. Use this to detect newly appearing failures. See [Logs](/documentation/explore/logs).",operationId:"getNewErrorPatterns",tags:["public","logs"],url:`${mc}/patterns/new`,method:"GET",query:r.Object({...bt.properties,team:r.Optional(u({description:"Team name to restrict pattern detection to."})),env:r.Optional(u({description:"Environment to restrict pattern detection to."})),service:r.Optional(u({description:"Service name to restrict pattern detection to."})),clusterId:r.Optional(u({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))}),response:QL}),JV=r.Object({team:r.String({description:"Team associated with the error pattern."}),env:r.String({description:"Environment associated with the error pattern."}),pattern:r.String({description:"Error pattern formatted as a readable string."}),increaseTimestamps:r.Array(r.Number({description:"Unix timestamp in milliseconds of a detected spike in occurrence of this pattern. One entry per spike detected in the requested time range."}))}),ZL=r.Object({errorPatternIncreases:r.Array(JV,{description:"Error patterns with increased occurrence in the requested time range."})},{}),e6={errorPatternIncreases:[{team:"platform",env:"production",pattern:"Non-resolved segment SegmentId(*) from cache",increaseTimestamps:[17041536e5,17042392e5]}]};Object.assign(ZL,{examples:[e6]});var XL=d({description:"Finds error patterns whose occurrence increased for a team in the requested time range. Use this to identify growing failure modes. See [Logs](/documentation/explore/logs).",operationId:"getErrorPatternIncrease",tags:["public","logs"],url:`${mc}/patterns/increase`,method:"GET",query:r.Object({...bt.properties,team:u({description:"Team name to analyze for pattern increases."}),env:r.Optional(u({description:"Environment to restrict the analysis to."})),clusterId:r.Optional(u({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))}),response:ZL}),JL=r.Object({attributes:r.Array(r.String(),{description:"Log attribute dot-paths observed in the time range"})},{}),t6={attributes:["context.env","context.k8s.pod.name","context.service.name","context.team","level","message","timestamp"]};Object.assign(JL,{examples:[t6]});var r6=r.Object({...bt.properties,clusterId:r.Optional(u({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))},{description:"Log attribute discovery query. Provide a time range and optional cluster ID."}),ek=d({description:"Lists log attribute dot-paths observed in the requested time range. This endpoint requires a public API credential that can read all relevant teams because attribute discovery is not team-filtered. Use this to discover fields for Tsuga queries, filters, and grouping. See [Logs](/documentation/explore/logs).",operationId:"getLogAttributes",tags:["public","logs"],url:`${mc}/attributes`,method:"GET",query:r6,response:JL});var en="/v0/metrics",n6=r.Object({__tsuga_metadata__:r.Object({},{additionalProperties:!0}),context:r.Optional(r.Object({},{additionalProperties:!0})),message:r.Optional(r.String()),timestamp:r.Number(),level:r.Enum(dh)},{additionalProperties:!0}),Grt=d({tags:["metrics"],url:`${en}/count`,method:"GET",query:r.Pick(Ln,["from","to","query","clusterId"]),response:r.Object({count:r.Number()})}),$rt=d({tags:["metrics"],url:`${en}/search`,method:"GET",query:Ln,response:r.Object({logs:r.Optional(r.Array(n6)),totalHits:r.Optional(r.Number()),attributesToHighlight:r.Optional(r.Array(lc))},{additionalProperties:!0})}),El=r.Enum(["counter","gauge","histogram","summary","composite_histogram"],{description:"Metric instrument type, set by the reporting instrumentation. `counter` accumulates a monotonically increasing total (aggregate with `sum` or `increase`); `gauge` reports a point-in-time value that can go up or down (aggregate with `average`, `max`, `min`, or `last`); `histogram`, `composite_histogram`, and `summary` report a distribution of values, from which percentiles can be computed. Tsuga displays `composite_histogram` metrics as Histogram in the app."}),hh=r.Enum(["delta","cumulative","none"],{description:"Metric temporality. `delta` reports changes per collection interval, `cumulative` reports running totals, and `none` means temporality is not applicable or unknown."}),tk=r.Number({description:"Timestamp of the most recent data point recorded for this metric, in milliseconds since the Unix epoch. Omitted when Tsuga has no record of it. Computed from a periodically refreshed metadata snapshot, so it can lag ingestion by a few minutes and should not be used to detect sub-minute gaps."}),o6=r.Object({capabilities:r.Optional(r.Array(r.String(),{description:"Aggregate function types (such as `max`, `min`, `sum`) supported when querying or graphing this metric. If this field is omitted or empty, all aggregate types are supported."})),description:r.Optional(r.String({description:"Human-readable description of the metric"})),tags:r.Optional(r.Array(r.String(),{description:"Attribute names available as dimensions for filtering or grouping this metric. Exposed publicly as `attributes`."})),temporality:r.Optional(hh),type:r.Optional(El),unit:r.Optional(r.String({description:"Metric unit reported by instrumentation or inferred metadata."})),lastSeen:r.Optional(tk)}),jrt=d({url:`${en}/metadata`,method:"GET",query:r.Object({...at.properties,metricName:u({allowEmpty:!1}),clusterId:r.Optional(u({allowEmpty:!1,description:"Cluster ID"}))}),response:o6}),Frt=d({tags:["metrics"],url:en,method:"GET",query:r.Object({...at.properties,clusterId:r.Optional(u({allowEmpty:!1,description:"Cluster ID"}))}),response:r.Array(r.String())}),_l=r.Array(r.Object({name:r.String({description:"Metric name observed by Tsuga."}),type:El,lastSeen:r.Optional(tk)}),{description:"Metrics observed in the requested time range, with the instrument type each was reported as."}),i6=[{name:"http.server.request.duration",type:"histogram"},{name:"http.server.active_requests",type:"gauge"},{name:"http.server.request.count",type:"counter"}];Object.assign(_l,{examples:[i6]});var qrt=d({tags:["metrics"],url:`${en}/names-and-types`,method:"GET",query:r.Object({...at.properties,clusterId:r.Optional(u({allowEmpty:!1,description:"Cluster ID"}))}),response:_l}),dc=r.Array(r.String(),{description:"Attribute names available as dimensions for filtering or grouping the requested metric(s)."}),a6=["service","env","host","method","status_code"];Object.assign(dc,{examples:[a6]});var Brt=d({tags:["metrics"],url:`${en}/attributes`,method:"GET",query:r.Object({...at.properties,metricName:u({allowEmpty:!1}),clusterId:r.Optional(u({allowEmpty:!1,description:"Cluster ID"}))}),response:dc}),Hrt=d({tags:["metrics"],url:`${en}/attributes/batch`,method:"GET",query:r.Object({...at.properties,metricNames:r.Array(u({allowEmpty:!1}),{minItems:1,description:"Metric names to fetch attributes for"}),clusterId:r.Optional(u({allowEmpty:!1,description:"Cluster ID"}))}),response:dc}),yh=r.Object({assets:r.Array(r.Object({type:r.Enum(["dashboard","monitor"],{description:"Kind of asset referencing the metric."}),id:r.String({description:"Dashboard or monitor ID for the asset that queries this metric."}),name:r.String({description:"Display name of the referencing dashboard or monitor."}),owner:r.String({description:"Team ID that owns the referencing dashboard or monitor."})},{description:"A dashboard or monitor that queries this metric."}),{description:"Dashboards and monitors that currently query this metric."})}),Krt=d({tags:["metrics"],url:`${en}/assets-usage`,method:"GET",query:r.Object({metricName:u({allowEmpty:!1})}),response:yh}),zrt=d({url:`${en}/per-attribute`,method:"GET",query:r.Object({from:r.Optional(r.Number()),to:r.Optional(r.Number()),attribute:u(),clusterId:r.Optional(u({allowEmpty:!1}))}),response:r.Array(r.String())});var Th=`/${"v1"}/metrics`,s6=[{name:"http.server.request.duration",type:"histogram"},{name:"http.server.active_requests",type:"gauge"},{name:"http.server.request.count",type:"counter"}];Object.assign(_l,{examples:[s6]});var Eh=r.Object({name:r.String({description:"Metric name observed by Tsuga. Use this value in metric queries and aggregations."}),type:El,description:r.Optional(r.String({description:"Human-readable description of what the metric measures, set by the reporting instrumentation. Omitted when the instrumentation did not provide one."})),unit:r.Optional(r.String({description:"Metric unit reported by instrumentation or inferred metadata."})),temporality:r.Optional(hh),capabilities:r.Optional(r.Array(r.String(),{description:"Aggregate function types (such as `max`, `min`, `sum`) supported when querying or graphing this metric. An empty or omitted array means all aggregate types are supported."})),attributes:r.Optional(r.Array(r.String(),{description:"Metric attribute names available as dimensions for filtering or grouping."}))}),c6={name:"http.server.request.duration",type:"histogram",description:"Duration of HTTP server requests",unit:"ms",temporality:"delta",capabilities:["max","min","sum"],attributes:["context.team","context.environment","context.region"]};Object.assign(Eh,{examples:[c6]});var rk=r.Object({...bt.properties,clusterId:r.Optional(u({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))},{description:"Metric metadata query. Provide the time range to inspect and optionally a cluster ID."}),nk=d({description:"Lists metrics observed in the requested time range with metadata such as type, unit, temporality, capabilities, and attributes. Use this to discover metric names before querying or graphing them. See [Metrics](/documentation/explore/metrics/index).",operationId:"listMetrics",tags:["public","metrics"],url:Th,method:"GET",query:rk,response:r.Array(Eh)}),ok=d({description:"Retrieves metadata for one metric name in the requested time range. Use this to inspect available dimensions and supported query behavior for a metric. See [Metric details](/documentation/explore/metrics/metric-details).",operationId:"getMetric",tags:["public","metrics"],url:`${Th}/:name`,method:"GET",params:r.Object({name:u({allowEmpty:!1,description:"Metric name to retrieve, for example `http.server.request.duration`."})}),query:rk,response:Eh}),p6=["service","env","host","method","status_code"];Object.assign(dc,{examples:[p6]});var ik=r.Pick(yh,["assets"]),u6={assets:[{type:"dashboard",id:"dash-123-abc",name:"API Performance Overview",owner:"team-123-abc"},{type:"monitor",id:"mon-789-ghi",name:"High Latency Alert",owner:"team-123-abc"}]};Object.assign(ik,{examples:[u6]});var ak=d({description:"Retrieve dashboards and monitors that use a specific metric",operationId:"getMetricAssetsUsage",tags:["private"],url:`${Th}/assets-usage`,method:"GET",query:r.Object({metricName:u({allowEmpty:!1,description:"The name of the metric to find usage for"})}),response:ik});var ra="/v0/traces",ant=d({tags:["traces"],url:`${ra}/count`,method:"GET",query:r.Pick(Ln,["from","to","query","clusterId"]),response:r.Object({count:r.Number()})}),l6=["unset","ok","error"],m6=r.Enum(l6),d6=["unspecified","internal","server","client","producer","consumer"],f6=r.Enum(d6),ck=r.Object({__tsuga_metadata__:r.Optional(r.Object({},{additionalProperties:!0})),context:r.Optional(r.Object({telemetry:r.Optional(r.Object({sdk:r.Optional(r.Object({language:r.Optional(r.String())},{additionalProperties:!0}))},{additionalProperties:!0})),tag_policy_warnings:r.Optional(r.Record(r.String(),r.String())),service:r.Optional(r.Object({name:r.Optional(r.String()),version:r.Optional(r.String())},{additionalProperties:!0})),env:r.Optional(r.String())},{additionalProperties:!0})),parent_span_id:r.Optional(r.String()),resource_attributes:r.Object({},{additionalProperties:!0}),span_attributes:r.Object({},{additionalProperties:!0}),duration:r.Number({description:"In milliseconds."}),duration_ns:r.String({description:"In nanoseconds. Transmitted as a string to avoid losing precision, as BigInt is not JSON-compatible."}),start_time:r.String({description:"In nanoseconds. Transmitted as a string to avoid losing precision, as BigInt is not JSON-compatible."}),end_time:r.String({description:"In nanoseconds. Transmitted as a string to avoid losing precision, as BigInt is not JSON-compatible."}),error:r.Optional(r.Object({message:r.String()})),events:r.Optional(r.Array(r.Object({event_attributes:r.Object({},{additionalProperties:!0}),event_name:r.String(),event_timestamp_nanos:r.String({description:"In nanoseconds. Transmitted as a string to avoid losing precision, as BigInt is not JSON-compatible."})}))),links:r.Optional(r.Array(r.Object({},{additionalProperties:!0}))),span_id:r.String(),span:r.Object({kind:f6,name:r.String()}),status_code:r.Optional(m6),trace_id:r.String()}),pk=100,g6="start_time",h6="duration_ns",y6=r.Union([r.Literal(g6),r.Literal(h6)]),T6={...at.properties,query:r.Optional(u({type:"tsuga-query"})),maxResults:r.Optional(r.Integer({minimum:1,maximum:1e4})),shouldRecommendAttributes:r.Optional(r.Boolean()),startOffset:r.Optional(r.Number({minimum:uc})),clusterId:r.Optional(u({allowEmpty:!1,description:"Cluster ID"})),sortBy:r.Optional(y6),sortDirection:r.Optional(r.Union([r.Literal("asc"),r.Literal("desc")]))},snt=d({tags:["traces"],url:`${ra}/search`,method:"GET",query:r.Object(T6),response:r.Object({spans:r.Optional(r.Array(ck)),attributesToHighlight:r.Optional(r.Array(lc))})});var E6=r.Object({groupByAttributes:r.Array(u({allowEmpty:!1}),{description:'Glob patterns of span_attributes keys to use as additional grouping dimensions (e.g. "db.*"). Matches against flattened dotted keys of span_attributes only.'}),minLeafSpansToAggregate:r.Integer({minimum:2,description:"Minimum leaf-group size before aggregation occurs. Default 5."}),maxParentDepth:r.Integer({minimum:-1,description:"Max depth of recursive parent aggregation. 0 = leaves only, -1 = unlimited (default)."}),aggregationHistogramBucketsSeconds:r.Array(r.Number({minimum:0}),{description:"Upper bounds for the latency histogram in seconds. Empty array disables the histogram attributes."}),sortSpans:r.Boolean({description:"Whether to sort the returned spans by start_time (span_id tie-breaker). Set false when the caller reconstructs the trace tree and does not need ordering. Default true."})}),_6=r.Object({...at.properties,traceId:u({allowEmpty:!1,description:"Trace ID to summarize"}),clusterId:r.Optional(u({allowEmpty:!1,description:"Cluster ID"})),...r.Partial(E6).properties}),cnt=d({tags:["traces"],url:`${ra}/summarize`,method:"GET",query:_6,response:r.Object({spans:r.Array(ck)})}),pnt=d({tags:["traces"],url:`${ra}/attributes`,method:"GET",query:r.Object({...at.properties,clusterId:r.Optional(u({allowEmpty:!1,description:"Cluster ID"}))}),response:r.Object({attributes:r.Array(r.String())})}),I6=r.Object({key:r.String({description:"Opaque stable key identifying this contributing service within the response. Tsuga assigns it while building the summary; `ranges[].contributions[].serviceKey` and `serviceTotals[].serviceKey` reference this value."}),name:r.String({description:"Observed service name that contributed leaf-span time to the trace. Comes from trace service context and is returned for every contributing service."}),env:r.Optional(r.String({description:"Observed service environment for this contributing service. Comes from trace service context and is absent when the spans do not carry an environment."})),id:r.Optional(r.String({description:"Service catalog ID for this contributing service. Tsuga sets it when exactly one catalog entry matches the observed service and environment; absent when the service is not cataloged or matches ambiguously."})),namespace:r.Optional(r.String({description:"Service namespace from the matched service catalog entry. Returned only when Tsuga can resolve the contributing service to one catalog entry with a namespace."}))}),b6=r.Object({fromNs:r.String({description:"Range start time in nanoseconds since Unix epoch. Tsuga sets it from the trace timeline split where active leaf spans change. Transmitted as a string to avoid losing precision."}),toNs:r.String({description:"Range end time in nanoseconds since Unix epoch. Tsuga sets it from the trace timeline split where active leaf spans change. Transmitted as a string to avoid losing precision."}),durationNs:r.String({description:"Range duration in nanoseconds, computed as `toNs - fromNs`. Transmitted as a string to avoid losing precision."}),contributions:r.Array(r.Object({serviceKey:r.String({description:"Contributing service key for this range. References `services[].key` in the same response."}),weight:r.Number({description:"Share of this range attributed to the service, from `0` through `1`. Tsuga computes the weight from active leaf spans in the range; weights inside one range sum to `1`."}),durationNs:r.String({description:"Estimated duration attributed to this service in the range, computed as `weight` times the range's own `durationNs` and rounded to whole nanoseconds. Use `serviceTotals` as authoritative when rounded range values do not add up exactly."})}),{description:"Services contributing active leaf-span time to this range, with weighted shares for the range duration."}),spanIds:r.Array(r.String(),{description:"Leaf span IDs that produced this range. Tsuga returns IDs from the leaf-only attribution set, including merged sub-ranges after short-range collapsing."})}),S6=r.Object({serviceKey:r.String({description:"Contributing service key for this aggregate total. References `services[].key` in the same response."}),durationNs:r.String({description:"Total wall-clock contribution of this service across the trace, in nanoseconds. Sum of `weight * durationNs` over every range the service contributes to; authoritative when it disagrees with rounded per-range values. Transmitted as a string to avoid losing precision."}),share:r.Number({description:"Share of total trace duration attributed to this service, from `0` through `1`. Computed as `durationNs / totalDurationNs`; multiply by 100 for a percentage."})}),_h=r.Optional(r.Number({minimum:0,description:"Minimum range duration in milliseconds. Shorter ranges are collapsed (absorbed into a neighbor or blended with adjacent shorts) to keep the timeline readable. When omitted, the default depends on the trace: max(1ms, 1% of the total trace duration), so e.g. a 10s trace collapses ranges shorter than 100ms. Pass 0 to disable collapsing."})),Ih=r.Optional(r.Boolean({default:!0,description:"When false, omits the per-range timeline (returns `ranges: []`) and returns only `services` and `serviceTotals`. Cuts payload size for callers that only need the headline. Defaults to true."})),Il=r.Object({traceId:r.String({description:"Trace ID summarized by the response. Echoes the required `traceId` query parameter."}),startTimeNs:r.String({description:"Earliest `start_time` across fetched spans, in nanoseconds since Unix epoch. If the request window does not cover the full trace, this reflects the fetched subset, not necessarily the trace's true start. Transmitted as a string to avoid losing precision."}),endTimeNs:r.String({description:"Latest `end_time` across fetched spans, in nanoseconds since Unix epoch. If the request window does not cover the full trace, this reflects the fetched subset, not necessarily the trace's true end. Transmitted as a string to avoid losing precision."}),totalDurationNs:r.String({description:"Total fetched trace duration in nanoseconds, computed as `endTimeNs - startTimeNs`. Transmitted as a string to avoid losing precision."}),truncated:r.Boolean({description:"Whether the underlying span fetch hit its result cap. When true, the latency summary may be incomplete because not every span in the trace was available."}),services:r.Array(I6,{description:"Unique services that contributed leaf-span time to the trace, enriched with catalog IDs when Tsuga can resolve them. Referenced by `serviceKey` from `ranges` and `serviceTotals`."}),ranges:r.Array(b6,{description:"Sequential trace timeline split into ranges wherever the active leaf-span set changes. Empty when the request sets `includeRanges` to false."}),serviceTotals:r.Array(S6,{description:"Aggregated wall-clock contribution per service across the fetched trace. Use this for service-level latency ownership without processing the per-range timeline."})}),A6={traceId:"78c99c5bb1e4a30297fa134b9dbec64f",startTimeNs:"1704067200000000000",endTimeNs:"1704067202400000000",totalDurationNs:"2400000000",truncated:!1,services:[{key:"checkout|prod",name:"checkout",env:"prod",id:"123-456-abc",namespace:"default"},{key:"payments|prod",name:"payments",env:"prod",id:"456-789-def",namespace:"default"}],ranges:[{fromNs:"1704067200000000000",toNs:"1704067201200000000",durationNs:"1200000000",contributions:[{serviceKey:"checkout|prod",weight:1,durationNs:"1200000000"}],spanIds:["3df8cc3449378f66"]},{fromNs:"1704067201200000000",toNs:"1704067202400000000",durationNs:"1200000000",contributions:[{serviceKey:"checkout|prod",weight:.5,durationNs:"600000000"},{serviceKey:"payments|prod",weight:.5,durationNs:"600000000"}],spanIds:["187a47da1b2560f8","3df8cc3449378f66"]}],serviceTotals:[{serviceKey:"checkout|prod",durationNs:"1800000000",share:.75},{serviceKey:"payments|prod",durationNs:"600000000",share:.25}]};Object.assign(Il,{examples:[A6]});var unt=d({tags:["traces"],url:`${ra}/latency-summary`,method:"GET",query:r.Object({...at.properties,traceId:u({allowEmpty:!1,description:"Trace ID to summarize"}),clusterId:r.Optional(u({allowEmpty:!1,description:"Cluster ID"})),minRangeDurationMs:_h,includeRanges:Ih}),response:Il}),sk=r.Object({filter:u({type:"tsuga-query",description:"TQL filter defining the group"}),timeRange:si}),O6=r.Object({value:r.String(),supportA:r.Number(),supportB:r.Number()}),x6=r.Object({value:r.String(),supportA:r.Number(),supportB:r.Number(),lift:r.Union([r.Number(),r.Null()]),pValue:r.Number()}),R6=r.Object({attr:r.String(),values:r.Array(x6),otherValues:r.Array(O6)}),lnt=d({tags:["traces"],url:`${ra}/contrast-sets`,method:"POST",body:r.Object({groupA:sk,groupB:sk,candidateAttrs:r.Optional(r.Array(u({allowEmpty:!1}))),topK:r.Optional(r.Integer({minimum:1,maximum:100})),minLift:r.Optional(r.Number({minimum:1})),minSupport:r.Optional(r.Number({minimum:0,maximum:100})),clusterId:r.Optional(u({allowEmpty:!1,description:"Cluster ID"}))}),response:r.Object({contrastSets:r.Array(R6),groupACount:r.Number(),groupBCount:r.Number()})});var bh=`/${"v1"}/traces`,Sh=r.Object({context:r.Optional(r.Object({service:r.Optional(r.Object({name:r.Optional(r.String({description:"Service name associated with the span."})),version:r.Optional(r.String({description:"Service version associated with the span."}))},{additionalProperties:!0,description:"Service identity associated with the span, from OpenTelemetry service resource attributes."}))},{additionalProperties:!0,description:"OpenTelemetry resource context resolved for the span, holding the identity of the emitting service."})),parentSpanId:r.Optional(r.String({description:"`spanId` of this span's parent within the same trace. Absent for the root span."})),resourceAttributes:r.Object({},{additionalProperties:!0,description:"OpenTelemetry resource attributes describing the process/host that emitted the span (e.g. `host.name`, `k8s.pod.name`), as a flat key-value map set by the instrumented service or its SDK."}),spanAttributes:r.Object({},{additionalProperties:!0,description:"OpenTelemetry span attributes describing this operation (e.g. HTTP method, DB statement), as a flat key-value map set by the instrumented code or auto-instrumentation."}),duration:r.Number({description:"Span duration in milliseconds, derived from the nanosecond `startTime` and `endTime` values."}),startTime:r.String({description:"Span start time as a Unix epoch timestamp in nanoseconds, encoded as a string to preserve precision."}),endTime:r.String({description:"Span end time as a Unix epoch timestamp in nanoseconds, encoded as a string to preserve precision."}),error:r.Optional(r.Object({message:r.String({description:"Error message associated with the span."})},{description:"Error details associated with the span, separate from the OpenTelemetry `statusCode` field."})),events:r.Optional(r.Array(r.Object({event_attributes:r.Object({},{additionalProperties:!0,description:"Key-value attributes recorded with this event, set by the instrumented code when the event was added to the span (e.g. exception details)."}),event_name:r.String({description:"Name of the span event."}),event_timestamp_nanos:r.String({description:"Event timestamp in nanoseconds, transmitted as a string for precision."})},{description:"A single timestamped event recorded on the span, with its name and attributes."}),{description:"Events recorded on the span."})),spanId:r.String({description:"Unique span ID within the trace."}),span:r.Object({kind:r.String({description:"OpenTelemetry span kind describing the relationship to remote calls: `unspecified`, `internal`, `server`, `client`, `producer`, or `consumer`."}),name:r.String({description:"Operation name recorded on the span."})},{description:"Operation identity for the span, combining the recorded operation name and the OpenTelemetry span kind."}),statusCode:r.Optional(r.String({description:"OpenTelemetry span status set by the instrumented code: `unset` (default, no explicit status), `ok`, or `error`. Absent if the source span never set a status."})),traceId:r.String({description:"Trace ID shared by all spans in the trace."})},{additionalProperties:!0,$id:"SpanEvent",description:"Distributed tracing span including timing, identifiers, OpenTelemetry attributes, events, and status metadata."}),C6={context:{service:{name:"my-service",version:"1.0.0"}},parentSpanId:"187a47da1b2560f8",resourceAttributes:{},spanAttributes:{busyNs:374640,code:{file:{path:"src/queue/sqs.rs"},line:{number:162},module:{name:"queue::sqs"}},idleNs:23621445,maxMessages:"1",target:"queue::sqs",thread:{id:2,name:"tokio-runtime-worker"}},duration:23,startTime:"1770923469995353600",endTime:"1770923470019349500",spanId:"3df8cc3449378f66",span:{kind:"internal",name:"receive_messages"},statusCode:"ok",traceId:"78c99c5bb1e4a30297fa134b9dbec64f"};Object.assign(Sh,{examples:[C6]});var P6={from:1704067200,to:1704070800,query:"context.service.name:my-service",maxResults:100},uk=r.Object({...bt.properties,query:r.Optional(u({type:"tsuga-query",default:"*",description:"Tsuga query selecting spans to return. Omit to search all spans in the range with `*`."})),maxResults:r.Optional(r.Integer({minimum:1,maximum:1e4,default:pk,description:"Maximum number of spans to return. Defaults to 100. Valid values are 1 through 10000."})),clusterId:r.Optional(u({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))},{description:"Span search query. Provide a time range, optional Tsuga query, and optional limit."});Object.assign(uk,{examples:[P6]});var lk=d({description:"Searches spans in a required time range using Tsuga query syntax. Use this endpoint to retrieve trace spans for investigations or automation. See [Traces](/documentation/explore/traces) and [Query syntax](/documentation/explore/query-syntax).",operationId:"searchSpans",tags:["public","traces"],url:`${bh}/search`,method:"GET",query:uk,response:r.Object({spans:r.Array(Sh,{description:"Spans matching the query and time range."})})}),U6={from:1704067200,to:1704070800,traceId:"78c99c5bb1e4a30297fa134b9dbec64f"},mk=r.Object({...bt.properties,traceId:u({allowEmpty:!1,description:"Trace ID to summarize. Use the `traceId` returned by span search, the trace details page, or your tracing instrumentation. Required; the requested time range must include the trace."}),clusterId:r.Optional(u({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."})),groupByAttributes:r.Optional(r.Array(u({allowEmpty:!1}),{description:"Glob patterns of span attribute keys to use as additional grouping dimensions. Use this when spans should be summarized separately for matching attributes, such as `db.*`. Matches flattened dotted span attribute keys; omitted by default."})),minLeafSpansToAggregate:r.Optional(r.Integer({minimum:2,default:5,description:"Minimum number of similar leaf spans in a group before Tsuga replaces them with one synthetic summary span. Use higher values for less aggressive summarization. Optional; defaults to 5 and must be at least 2."})),maxParentDepth:r.Optional(r.Integer({minimum:-1,default:-1,description:"Maximum depth of recursive parent aggregation after leaf spans are summarized. Use this to limit parent-level aggregation. Use `0` to aggregate leaf spans only or `-1` for unlimited depth; defaults to `-1`."})),aggregationHistogramBucketsSeconds:r.Optional(r.Array(r.Number({minimum:0}),{description:"Upper-bound bucket values, in seconds, for the latency histogram recorded on synthetic summary spans. Provide custom buckets when the default latency buckets are not suitable. Pass an empty array to omit histogram attributes; omitted values use Tsuga defaults from 5 ms through 10 s."})),sortSpans:r.Optional(r.Boolean({default:!0,description:"Whether Tsuga sorts returned spans by start time, using span ID as the tie-breaker for identical start times. Defaults to `true`; set to `false` only when reconstructing the trace tree yourself, in which case summary spans are appended after surviving spans."}))},{description:"Trace summarization query. Provide a trace ID, a time range covering the trace, and optional aggregation tuning."});Object.assign(mk,{examples:[U6]});var dk=d({description:"Summarizes a trace by aggregating groups of similar spans into synthetic summary spans, producing a compact view of large traces. Summary spans are marked with `spanAttributes.aggregation.is_summary` and carry span counts, duration statistics, and an optional latency histogram. See [Traces](/documentation/explore/traces).",operationId:"summarizeTrace",tags:["public","traces"],url:`${bh}/summarize`,method:"GET",query:mk,response:r.Object({spans:r.Array(Sh,{description:"Summarized trace spans, sorted by start time unless `sortSpans` is false. Aggregated groups are replaced by synthetic summary spans marked with `spanAttributes.aggregation.is_summary`."})})}),w6={from:1704067200,to:1704070800,traceId:"78c99c5bb1e4a30297fa134b9dbec64f"},fk=r.Object({...bt.properties,traceId:u({allowEmpty:!1,description:"Trace ID to summarize. Use the `traceId` returned by span search, the trace details page, or your tracing instrumentation. Required; the requested time range must include the trace."}),clusterId:r.Optional(u({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."})),minRangeDurationMs:_h,includeRanges:Ih},{description:"Trace latency summary query. Provide a trace ID, a time range covering the trace, and optional timeline tuning."});Object.assign(fk,{examples:[w6]});var gk=d({description:"Summarizes where wall-clock time is spent in a trace, attributing each slice of the trace timeline to the services with active leaf spans. Returns per-service totals and an optional sequential range timeline. See [Traces](/documentation/explore/traces).",operationId:"getTraceLatencySummary",tags:["public","traces"],url:`${bh}/latency-summary`,method:"GET",query:fk,response:Il});var Tk=["timestamp","level","message"],Ek=["count","ratio","team","level","pattern"];function gt(e,t){let n=t??$r(e);if(!n)throw new Error(`--${e} is required`);return Ic(n)}function hk(e){let t={from:gt("from",e.from),to:gt("to",e.to)},n=e.query??$r("query");n!==void 0&&(t.query=n);let o=e.maxResults??$r("max-results");if(o!==void 0){let i=Number(o);if(Number.isNaN(i))throw new Error(`--max-results must be a number (got: ${o})`);t.maxResults=i}return t}function Ne(e){let t=$r(e);return t===void 0?"":` (default: ${t})`}function v6(e){let t=Qm(e.output),n=e.fields===void 0?void 0:Wm(e.fields);return t==="json"?{format:t,fields:n}:{format:t,fields:n??Tk}}function N6(e){let t=Qm(e.output),n=e.fields===void 0?void 0:Wm(e.fields);return t==="json"?{format:t,fields:n}:{format:t,fields:n??Ek}}function yk(e,t){let n={count:e.size,ratio:t>0?e.size/t:0,pattern:e.pattern};for(let{key:o,value:i}of e.groups)o==="context.team"?n.team=i:n[o]=i;return n}function L6(e,t){if(t.format==="json"){if(t.fields===void 0){ee(e);return}let{fields:i}=t;ee({patterns:e.patterns.map(a=>yk(a,e.sampleSize)).map(a=>Zm(a,i)),sampleSize:e.sampleSize});return}let n=e.patterns.map(i=>yk(i,e.sampleSize)),o=Xm(t.format,n,t.fields);o.length>0&&V(o)}function k6(e,t){if(t.format==="json"){if(t.fields===void 0){ee(e);return}let{fields:o}=t;ee({logs:e.logs.map(i=>Zm(i,o))});return}let n=Xm(t.format,e.logs,t.fields);n.length>0&&V(n)}function _k(e,t){let n=e.command("logs").description("Search and analyze logs");n.command("search").description("Search logs").option("--from <TIMESTAMP>",`Start of time range${Ge}${Ne("from")}`).option("--to <TIMESTAMP>",`End of time range${Ge}${Ne("to")}`).option("--query <TSUGA_QUERY>",`Tsuga query to filter logs${Ne("query")}`).option("--max-results <COUNT>",`Maximum number of results, 1-1000${Ne("max-results")}`).option("--fields <FIELDS>",`Comma-separated dot-paths to project from each log (default for --output=tsv|csv: ${Tk.join(",")})`).option("-o, --output <FORMAT>","Output format: json | tsv | csv","json").action(async c=>{let l=v6(c),m=await t()(zL,{query:hk(c)});k6(m,l)}),n.command("attributes").description("List log attribute dot-paths observed in the time range").option("--from <TIMESTAMP>",`Start of time range${Ge}${Ne("from")}`).option("--to <TIMESTAMP>",`End of time range${Ge}${Ne("to")}`).action(async c=>{let l=await t()(ek,{query:{from:gt("from",c.from),to:gt("to",c.to)}});ee(l)}),n.command("patterns").description("List log patterns").option("--from <TIMESTAMP>",`Start of time range${Ge}${Ne("from")}`).option("--to <TIMESTAMP>",`End of time range${Ge}${Ne("to")}`).option("--query <TSUGA_QUERY>",`Tsuga query to filter logs before clustering into patterns${Ne("query")}`).option("--fields <FIELDS>",`Comma-separated dot-paths to project from each pattern (default for --output=tsv|csv: ${Ek.join(",")})`).option("-o, --output <FORMAT>","Output format: json | tsv | csv","json").action(async c=>{let l=N6(c),m={from:gt("from",c.from),to:gt("to",c.to)},f=c.query??$r("query");f!==void 0&&(m.query=f);let h=await t()(VL,{query:m});L6(h,l)}),n.command("new-error-patterns").description("List error patterns first seen in this time range").option("--from <TIMESTAMP>",`Start of time range${Ge}${Ne("from")}`).option("--to <TIMESTAMP>",`End of time range${Ge}${Ne("to")}`).option("--team <TEAM_NAME>","Filter by team").option("--env <ENV_NAME>","Filter by environment").option("--service <SERVICE_NAME>","Filter by service").action(async c=>{let l={from:gt("from",c.from),to:gt("to",c.to)};c.team!==void 0&&(l.team=c.team),c.env!==void 0&&(l.env=c.env),c.service!==void 0&&(l.service=c.service);let m=await t()(WL,{query:l});ee(m)}),n.command("error-pattern-increases").description("List error pattern increases for a given team").option("--from <TIMESTAMP>",`Start of time range${Ge}${Ne("from")}`).option("--to <TIMESTAMP>",`End of time range${Ge}${Ne("to")}`).requiredOption("--team <TEAM_NAME>","Team to query").option("--env <ENV_NAME>","Filter by environment").action(async c=>{let l={from:gt("from",c.from),to:gt("to",c.to),team:c.team};c.env!==void 0&&(l.env=c.env);let m=await t()(XL,{query:l});ee(m)});let o=e.command("metrics").description("List and inspect metrics");o.command("list").description("List all metrics with their metadata").option("--from <TIMESTAMP>",`Start of time range${Ge}${Ne("from")}`).option("--to <TIMESTAMP>",`End of time range${Ge}${Ne("to")}`).action(async c=>{let l=await t()(nk,{query:{from:gt("from",c.from),to:gt("to",c.to)}});ee(l)}),o.command("get <METRIC_NAME>").description("Retrieve a metric by name with its metadata").option("--from <TIMESTAMP>",`Start of time range${Ge}${Ne("from")}`).option("--to <TIMESTAMP>",`End of time range${Ge}${Ne("to")}`).action(async(c,l)=>{let m=await t()(ok,{params:{name:c},query:{from:gt("from",l.from),to:gt("to",l.to)}});ee(m)}),o.command("assets-usage <METRIC_NAME>").description("List dashboards and monitors that use a specific metric").action(async c=>{let l=await t()(ak,{query:{metricName:c}});ee(l)});let i=e.command("traces").description("Search and summarize traces");i.command("search").description("Search spans").option("--from <TIMESTAMP>",`Start of time range${Ge}${Ne("from")}`).option("--to <TIMESTAMP>",`End of time range${Ge}${Ne("to")}`).option("--query <TSUGA_QUERY>",`Tsuga query to filter spans${Ne("query")}`).option("--max-results <COUNT>",`Maximum number of results, 1-10000${Ne("max-results")}`).action(async c=>{let l=await t()(lk,{query:hk(c)});ee(l)}),i.command("summarize").description("Summarize a trace by aggregating groups of similar spans into summary spans").requiredOption("--trace-id <TRACE_ID>","Trace ID to summarize").option("--from <TIMESTAMP>",`Start of time range${Ge}${Ne("from")}`).option("--to <TIMESTAMP>",`End of time range${Ge}${Ne("to")}`).action(async c=>{let l=await t()(dk,{query:{traceId:c.traceId,from:gt("from",c.from),to:gt("to",c.to)}});ee(l)}),i.command("latency-summary").description("Summarize where wall-clock time is spent in a trace, attributed per service").requiredOption("--trace-id <TRACE_ID>","Trace ID to summarize").option("--from <TIMESTAMP>",`Start of time range${Ge}${Ne("from")}`).option("--to <TIMESTAMP>",`End of time range${Ge}${Ne("to")}`).option("--min-range-duration-ms <MILLISECONDS>","Collapse timeline ranges shorter than this (default: max(1ms, 1% of trace duration); 0 disables collapsing)").option("--no-ranges","Omit the per-range timeline; return only services and serviceTotals").action(async c=>{let l={traceId:c.traceId,from:gt("from",c.from),to:gt("to",c.to)};if(c.minRangeDurationMs!==void 0){let f=Number(c.minRangeDurationMs);if(Number.isNaN(f))throw new Error(`--min-range-duration-ms must be a number (got: ${c.minRangeDurationMs})`);l.minRangeDurationMs=f}c.ranges||(l.includeRanges=!1);let m=await t()(gk,{query:l});ee(m)});let a=e.command("aggregation").description("Run aggregation queries");Wr(a,"scalar","Run aggregation queries and return scalar results",Nw,t),Wr(a,"timeseries","Run aggregation queries and return timeseries results",kw,t)}var M6="x-tsuga-session-id",Ah="x-tsuga-source",Oh="x-tsuga-source-version",xh="x-tsuga-source-commit",Rh="x-tsuga-source-date",Ch="x-tsuga-rationale",D6="x-tsuga-dashboard-id",G6="x-tsuga-widget-id",$6="x-request-id",Unt={[M6]:"Session identifier for request correlation",[Ah]:"SDK or client source identifier (e.g., web-frontend, terraform-provider)",[Oh]:"SDK version",[xh]:"SDK commit hash",[Rh]:"SDK commit date",[Ch]:"Optional caller-supplied rationale for this request, recorded for telemetry",[D6]:"ID of the dashboard a query is issued from, when the request originates from a dashboard widget",[G6]:"ID of the dashboard widget (graph) a query is issued from, when the request originates from a dashboard widget",[$6]:"Unique identifier for this API request, useful for debugging and support"};var kn=class e extends Error{constructor(n,o,i,a,c){super(n);this.statusCode=o;this.code=i;this.requestId=a;this.details=c;this.name="CliError"}static fromErrorResponse(n,o){return new e(n.message,n.statusCode,n.code,o,n.details)}};function Ik(e){if(e instanceof kn){let t=[`Error: ${e.message}`];return e.code&&t.push(`Code: ${e.code}`),e.statusCode&&t.push(`Status: ${e.statusCode}`),e.requestId&&t.push(`Request ID: ${e.requestId}`),e.details&&t.push(`Details: ${JSON.stringify(e.details,null,2)}`),t.join(`
|
|
172
|
-
`)}return e instanceof Error?`Error: ${e.message}`:String(e)}function
|
|
170
|
+
`:o}var MV={CLAUDE_CODE_ENABLE_TELEMETRY:"1",CLAUDE_CODE_ENHANCED_TELEMETRY_BETA:"1",OTEL_METRICS_EXPORTER:"otlp",OTEL_LOGS_EXPORTER:"otlp",OTEL_TRACES_EXPORTER:"otlp",OTEL_EXPORTER_OTLP_PROTOCOL:"http/json",OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:"delta"};function DV(e,t,n,o){let i=(0,ta.join)(e,".claude","settings.json");V(`Claude Code \u2192 ${i}`),(0,mh.mkdirSync)((0,ta.dirname)(i),{recursive:!0});let a=Ss(i),c;try{c=JSON.parse(a??"{}")}catch{throw new Error(`${i} is not valid JSON. Fix or remove it before re-running.`)}if(!Io(c))throw new Error(`${i} must contain a JSON object at the top level.`);let l=c.env??{};if(!Io(l))throw new Error(`${i} "env" must be a JSON object.`);let m=o?"1":"0";c.env={...l,...MV,OTEL_EXPORTER_OTLP_ENDPOINT:t,OTEL_LOG_USER_PROMPTS:m,OTEL_LOG_TOOL_DETAILS:m,OTEL_LOG_TOOL_CONTENT:m,OTEL_EXPORTER_OTLP_HEADERS:`Authorization=Bearer ${n}`};let f=As(i,a);bs(i,`${JSON.stringify(c,null,2)}
|
|
171
|
+
`),V(f===void 0?" created":` patched (backup: ${f})`)}function GV(e,t,n){return{environment:"dev",log_user_prompt:n,exporter:{"otlp-http":{endpoint:`${e}/v1/logs`,protocol:"binary",headers:{Authorization:`Bearer ${t}`}}},trace_exporter:{"otlp-http":{endpoint:`${e}/v1/traces`,protocol:"binary",headers:{Authorization:`Bearer ${t}`}}}}}function $V(e,t,n,o){let i=(0,ta.join)(e,".codex"),a=(0,ta.join)(i,"config.toml");V(`Codex \u2192 ${a}`),(0,mh.mkdirSync)(i,{recursive:!0});let c=Ss(a),l=c===void 0?{}:ah(c),m="otel"in l;delete l.otel,l.otel=GV(t,n,o);let f=As(a,c);bs(a,uh(l)),V(f===void 0?" created":m?` replaced existing [otel] tables (backup: ${f})`:` appended (backup: ${f})`)}function $L(){return new kr("--endpoint <OTLP_ENDPOINT>","OTLP base URL").env("TSUGA_OTLP_ENDPOINT").makeOptionMandatory()}function jL(){return new kr("--ingestion-api-key <INGESTION_API_KEY>","Tsuga ingestion API key").env("TSUGA_INGESTION_API_KEY").makeOptionMandatory()}var qL="Restart your claude / codex session to load the new config.";function FL(e){let t=e.command("setup").description("Configure local LLM CLIs to ship OTEL telemetry to Tsuga");t.command("claude-code").description("Patch ~/.claude/settings.json with Tsuga OTEL env").addOption($L()).addOption(jL()).option("--no-include-prompts","Strip user prompts + tool content from telemetry (default: include)").action(n=>{DV((0,lh.homedir)(),n.endpoint.replace(/\/+$/,""),n.ingestionApiKey,n.includePrompts),V(qL)}),t.command("codex").description("Patch ~/.codex/config.toml with Tsuga OTEL settings (replaces any existing [otel] table)").addOption($L()).addOption(jL()).option("--no-include-prompts","Strip user prompts from telemetry (default: include)").action(n=>{$V((0,lh.homedir)(),n.endpoint.replace(/\/+$/,""),n.ingestionApiKey,n.includePrompts),V(qL)})}var Oo="/v0/logs";var dh=["CRITICAL","ERROR","WARN","NOTICE","INFO","DEBUG","TRACE"];var uc=0,fh=r.Object({__tsuga_metadata__:r.Object({id:r.String(),source:r.Optional(r.String())},{additionalProperties:!0}),context:r.Optional(r.Object({team:r.Optional(r.String({description:"Team name associated with this log."})),tag_policy_warnings:r.Optional(r.Record(r.String(),r.String()))},{additionalProperties:!0,description:"Context attributes attached to the log after ingestion and route processing. `team` comes from telemetry or route-enriched context when present."})),message:r.Optional(r.Unknown({description:"Log message after ingestion and route processing. It can be any JSON value because processors may map arbitrary data into `message`."})),timestamp:r.Number({description:"Log timestamp as a Unix timestamp in milliseconds."}),level:r.Enum(dh,{description:"Log severity, normalized from the source severity into one of the fixed Tsuga levels (ordered `CRITICAL` to `TRACE`)."}),[XO]:r.Optional(r.String({description:"ID of the cluster this log was read from. Only set when the request spanned several clusters."}))},{additionalProperties:!0}),BL=100,jV="timestamp",qV=r.Union([r.Literal(jV)]),Ln=r.Partial(r.Object({...at.properties,query:u({type:"tsuga-query",description:"Tsuga query used to filter logs in the selected time range."}),maxResults:r.Integer({minimum:1,maximum:1e3,description:"Maximum number of logs to return. Valid values are 1 through 1000."}),shouldRecommendAttributes:r.Boolean({description:"Whether Tsuga should return suggested attributes to highlight in results."}),triggeredBy:r.Literal("refresh",{description:"Indicates the query was triggered by a refresh action."}),startOffset:r.Number({minimum:uc,description:"Result offset used when fetching additional log rows."}),startOffsets:r.Array(r.Number({minimum:uc}),{description:`Result offsets used when fetching additional log rows, one per entry of \`clusterIds\` and in the same order. Echo back each cluster's \`nextStartOffset\` from the previous response. Must have the same length as \`clusterIds\`. Defaults to ${uc} for every cluster.`}),clusterId:u({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}),clusterIds:es,sortBy:qV,sortDirection:r.Union([r.Literal("asc"),r.Literal("desc")],{description:"Timestamp sort direction for log results."})})),drt=d({tags:["logs"],url:`${Oo}/count`,method:"GET",query:r.Pick(Ln,["from","to","query","clusterId","clusterIds"]),response:r.Object({count:r.Number(),clusterResponses:r.Optional(si())})}),lc=r.Object({value:r.String(),priority:r.Number()}),frt=d({tags:["logs"],url:`${Oo}/search`,method:"GET",query:Ln,response:r.Object({logs:r.Optional(r.Array(fh)),attributesToHighlight:r.Optional(r.Array(lc)),clusterResponses:r.Optional(si(r.Object({nextStartOffset:r.Number({description:"Number of logs consumed on this cluster so far. Echo it back at this cluster's position in `startOffsets` to fetch the next page."})})))},{additionalProperties:!0})}),FV=r.Cyclic({TokenOutput:r.Union([r.Object({type:r.Literal("top"),values:r.Array(r.String())}),r.Object({type:r.Literal("ip"),value:r.String()}),r.Object({type:r.Literal("range"),min:r.Number(),max:r.Number()}),r.Object({type:r.Literal("variable"),value:r.String()}),r.Object({type:r.Literal("text"),value:r.String()}),r.Object({type:r.Literal("date"),value:r.String()}),r.Object({type:r.Literal("url"),value:r.String()}),r.Object({type:r.Literal("structure"),key:r.Array(r.String()),value:r.Array(r.Ref("TokenOutput"))})])},"TokenOutput",{description:"A token identified as part of the pattern"}),BV=r.Object({id:r.String(),pattern:r.Array(FV),size:r.Integer({description:"Number of logs that matched the pattern"}),examples:r.Array(r.Object({id:r.String(),timestampUnix:r.Number()})),timeDistribution:r.Array(r.Number()),staticFeatures:r.Array(r.Object({key:r.String(),value:r.String()},{description:"Fixed groups present in all logs matching the pattern"}))}),grt=d({tags:["logs"],url:`${Oo}/patterns`,method:"GET",query:r.Object({...at.properties,query:u({type:"tsuga-query"}),clusteringThreshold:r.Optional(r.Number()),clusterId:r.Optional(u({allowEmpty:!1}))}),response:r.Object({patterns:r.Array(BV),sampleSize:r.Number()})}),hrt=d({tags:["logs"],url:`${Oo}/attributes`,method:"GET",query:r.Object({...at.properties,clusterId:r.Optional(u({allowEmpty:!1,description:"Cluster ID"})),clusterIds:r.Optional(es)}),response:r.Object({attributes:r.Array(r.String()),clusterResponses:r.Optional(si())})});var HV=["pending","running","completed","incomplete","failed"],HL=r.Object({id:r.String({description:"ID of the export."}),status:r.Enum(HV,{description:"Lifecycle of the export. `pending` until the download is claimed, `running` while the CSV streams, then `completed`, `incomplete` when the file is usable but some matched logs could not be reached, or `failed` if the export was interrupted."}),rowsWritten:r.Number({description:"Logs written to the CSV so far. Updated periodically while the download streams, so it lags slightly behind the bytes on the wire."}),totalRows:r.Number({description:"Logs this export will write, already clamped to the export maximum. Use it as the denominator for progress."}),isTruncated:r.Boolean({description:"Whether the query matched more logs than the export maximum, so the CSV holds only the first logs in the requested sort order."}),errorMessage:r.Optional(r.String({description:"Why the export is incomplete or failed."}))}),yrt=d({tags:["logs"],url:`${Oo}/exports`,method:"POST",body:r.Object({...r.Pick(Ln,["from","to","query","clusterId","clusterIds","sortBy","sortDirection"]).properties,columns:r.Array(u({allowEmpty:!1}),{minItems:1,description:"Log attributes to write as CSV columns, in order. Each becomes one column, resolved against the log with dotted-path lookup."})}),response:r.Object({...HL.properties,downloadUrl:r.String({description:"Relative URL to fetch the CSV from. It carries a single-use token that expires shortly after creation, so the caller must start the download immediately."})})}),Trt=d({tags:["logs"],url:`${Oo}/exports/:exportId`,method:"GET",params:r.Object({exportId:r.String()}),response:HL}),Ert=d({tags:["logs"],url:`${Oo}/exports/:exportId/download`,method:"GET",params:r.Object({exportId:r.String()}),query:r.Object({token:u({allowEmpty:!1,description:"Single-use token minted when the export was created."})}),response:r.String({description:"CSV file, streamed as it is produced."})});var mc=`/${"v1"}/logs`,gh=r.Object({context:r.Optional(r.Object({team:r.Optional(r.String({description:"Team name associated with this log."}))},{additionalProperties:!0,$id:"LogContext",description:"Context attributes attached to the log after ingestion and route processing. `team` comes from telemetry or route-enriched context when present."})),...r.Pick(fh,["message","timestamp","level"]).properties},{additionalProperties:!0,$id:"LogEvent",description:"Log event including message, timestamp, severity level, and optional enriched context attributes."}),KV={context:{team:"platform"},message:"Request completed successfully",timestamp:17040672e5,level:"INFO"};Object.assign(gh,{examples:[KV]});var KL=r.Object({query:r.Optional(u({type:"tsuga-query",default:"*",description:"Tsuga query selecting logs to return. Omit to search all logs with `*`."})),maxResults:r.Optional(r.Integer({minimum:1,maximum:1e3,default:BL,description:"Maximum number of logs to return. Defaults to 100. Valid values are 1 through 1000."})),clusterId:r.Optional(u({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."})),...bt.properties},{description:"Log search query. Provide a time range, optional Tsuga query, and optional limit."}),zV={query:"level:ERROR",maxResults:100,from:1704067200,to:1704070800};Object.assign(KL,{examples:[zV]});var zL=d({description:"Searches logs in a required time range using Tsuga query syntax. Use this endpoint to retrieve raw log events for investigations or automation. See [Logs](/documentation/explore/logs) and [Query syntax](/documentation/explore/query-syntax).",operationId:"searchLogs",tags:["public","logs"],url:`${mc}/search`,method:"GET",query:KL,response:r.Object({logs:r.Array(gh,{description:"Log events matching the query and time range."})})}),YV=r.Object({pattern:r.String({description:"Clustered log pattern formatted as a readable string."}),size:r.Integer({description:"Number of logs that matched the pattern"}),groups:r.Array(r.Object({key:r.String({description:"Attribute dot-path shared by all logs in the pattern."}),value:r.String({description:"Value of the attribute identified by `key`, common to all logs in the pattern."})},{description:"Attribute key-value pair that is constant across every log matching this pattern, e.g. a shared `level` or `context.team`."}))}),YL=r.Object({patterns:r.Array(YV,{description:"Log patterns clustered from logs matching the query."}),sampleSize:r.Number({description:"Number of logs sampled while computing patterns."})},{}),VV={patterns:[{pattern:"Resolved segment SegmentId([0:1]) from cache",size:37004,groups:[{key:"level",value:"DEBUG"},{key:"context.team",value:"infra"}]}],sampleSize:100};Object.assign(YL,{examples:[VV]});var VL=d({description:"Clusters matching logs into readable patterns for the requested time range. Use this to summarize common log shapes before drilling into raw events. See [Logs](/documentation/explore/logs).",operationId:"getLogPatterns",tags:["public","logs"],url:`${mc}/patterns`,method:"GET",query:r.Object({...bt.properties,query:u({type:"tsuga-query",description:"Tsuga query selecting logs to cluster into patterns."}),clusterId:r.Optional(u({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))}),response:YL}),QV=r.Object({exampleLog:r.Optional(gh),team:r.String({description:"Team associated with the new error pattern."}),env:r.String({description:"Environment associated with the new error pattern."}),service:r.String({description:"Service associated with the new error pattern."}),firstSeen:r.Number({description:"Unix timestamp in seconds when this pattern was first seen."}),lastSeen:r.Number({description:"Unix timestamp in seconds when this pattern was last seen."})}),QL=r.Object({newErrorPatterns:r.Array(QV,{description:"Error patterns first seen in the requested time range."})},{}),WV={newErrorPatterns:[{team:"platform",env:"production",service:"api-gateway",firstSeen:1704067200,lastSeen:1704153600,exampleLog:{message:"ConnectionError: Failed to connect to database",timestamp:17041536e5,level:"ERROR"}}]};Object.assign(QL,{examples:[WV]});var WL=d({description:"Finds error patterns first seen in the requested time range, optionally filtered by team, environment, or service. Use this to detect newly appearing failures. See [Logs](/documentation/explore/logs).",operationId:"getNewErrorPatterns",tags:["public","logs"],url:`${mc}/patterns/new`,method:"GET",query:r.Object({...bt.properties,team:r.Optional(u({description:"Team name to restrict pattern detection to."})),env:r.Optional(u({description:"Environment to restrict pattern detection to."})),service:r.Optional(u({description:"Service name to restrict pattern detection to."})),clusterId:r.Optional(u({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))}),response:QL}),ZV=r.Object({team:r.String({description:"Team associated with the error pattern."}),env:r.String({description:"Environment associated with the error pattern."}),pattern:r.String({description:"Error pattern formatted as a readable string."}),increaseTimestamps:r.Array(r.Number({description:"Unix timestamp in milliseconds of a detected spike in occurrence of this pattern. One entry per spike detected in the requested time range."}))}),ZL=r.Object({errorPatternIncreases:r.Array(ZV,{description:"Error patterns with increased occurrence in the requested time range."})},{}),XV={errorPatternIncreases:[{team:"platform",env:"production",pattern:"Non-resolved segment SegmentId(*) from cache",increaseTimestamps:[17041536e5,17042392e5]}]};Object.assign(ZL,{examples:[XV]});var XL=d({description:"Finds error patterns whose occurrence increased for a team in the requested time range. Use this to identify growing failure modes. See [Logs](/documentation/explore/logs).",operationId:"getErrorPatternIncrease",tags:["public","logs"],url:`${mc}/patterns/increase`,method:"GET",query:r.Object({...bt.properties,team:u({description:"Team name to analyze for pattern increases."}),env:r.Optional(u({description:"Environment to restrict the analysis to."})),clusterId:r.Optional(u({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))}),response:ZL}),JL=r.Object({attributes:r.Array(r.String(),{description:"Log attribute dot-paths observed in the time range"})},{}),JV={attributes:["context.env","context.k8s.pod.name","context.service.name","context.team","level","message","timestamp"]};Object.assign(JL,{examples:[JV]});var e6=r.Object({...bt.properties,clusterId:r.Optional(u({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))},{description:"Log attribute discovery query. Provide a time range and optional cluster ID."}),ek=d({description:"Lists log attribute dot-paths observed in the requested time range. This endpoint requires a public API credential that can read all relevant teams because attribute discovery is not team-filtered. Use this to discover fields for Tsuga queries, filters, and grouping. See [Logs](/documentation/explore/logs).",operationId:"getLogAttributes",tags:["public","logs"],url:`${mc}/attributes`,method:"GET",query:e6,response:JL});var en="/v0/metrics",t6=r.Object({__tsuga_metadata__:r.Object({},{additionalProperties:!0}),context:r.Optional(r.Object({},{additionalProperties:!0})),message:r.Optional(r.String()),timestamp:r.Number(),level:r.Enum(dh)},{additionalProperties:!0}),Nrt=d({tags:["metrics"],url:`${en}/count`,method:"GET",query:r.Pick(Ln,["from","to","query","clusterId"]),response:r.Object({count:r.Number()})}),Lrt=d({tags:["metrics"],url:`${en}/search`,method:"GET",query:Ln,response:r.Object({logs:r.Optional(r.Array(t6)),totalHits:r.Optional(r.Number()),attributesToHighlight:r.Optional(r.Array(lc))},{additionalProperties:!0})}),El=r.Enum(["counter","gauge","histogram","summary","composite_histogram"],{description:"Metric instrument type, set by the reporting instrumentation. `counter` accumulates a monotonically increasing total (aggregate with `sum` or `increase`); `gauge` reports a point-in-time value that can go up or down (aggregate with `average`, `max`, `min`, or `last`); `histogram`, `composite_histogram`, and `summary` report a distribution of values, from which percentiles can be computed. Tsuga displays `composite_histogram` metrics as Histogram in the app."}),hh=r.Enum(["delta","cumulative","none"],{description:"Metric temporality. `delta` reports changes per collection interval, `cumulative` reports running totals, and `none` means temporality is not applicable or unknown."}),tk=r.Number({description:"Timestamp of the most recent data point recorded for this metric, in milliseconds since the Unix epoch. Omitted when Tsuga has no record of it. Computed from a periodically refreshed metadata snapshot, so it can lag ingestion by a few minutes and should not be used to detect sub-minute gaps."}),r6=r.Object({capabilities:r.Optional(r.Array(r.String(),{description:"Aggregate function types (such as `max`, `min`, `sum`) supported when querying or graphing this metric. If this field is omitted or empty, all aggregate types are supported."})),description:r.Optional(r.String({description:"Human-readable description of the metric"})),tags:r.Optional(r.Array(r.String(),{description:"Attribute names available as dimensions for filtering or grouping this metric. Exposed publicly as `attributes`."})),temporality:r.Optional(hh),type:r.Optional(El),unit:r.Optional(r.String({description:"Metric unit reported by instrumentation or inferred metadata."})),lastSeen:r.Optional(tk)}),krt=d({url:`${en}/metadata`,method:"GET",query:r.Object({...at.properties,metricName:u({allowEmpty:!1}),clusterId:r.Optional(u({allowEmpty:!1,description:"Cluster ID"}))}),response:r6}),Mrt=d({tags:["metrics"],url:en,method:"GET",query:r.Object({...at.properties,clusterId:r.Optional(u({allowEmpty:!1,description:"Cluster ID"}))}),response:r.Array(r.String())}),_l=r.Array(r.Object({name:r.String({description:"Metric name observed by Tsuga."}),type:El,lastSeen:r.Optional(tk)}),{description:"Metrics observed in the requested time range, with the instrument type each was reported as."}),n6=[{name:"http.server.request.duration",type:"histogram"},{name:"http.server.active_requests",type:"gauge"},{name:"http.server.request.count",type:"counter"}];Object.assign(_l,{examples:[n6]});var Drt=d({tags:["metrics"],url:`${en}/names-and-types`,method:"GET",query:r.Object({...at.properties,clusterId:r.Optional(u({allowEmpty:!1,description:"Cluster ID"}))}),response:_l}),dc=r.Array(r.String(),{description:"Attribute names available as dimensions for filtering or grouping the requested metric(s)."}),o6=["service","env","host","method","status_code"];Object.assign(dc,{examples:[o6]});var Grt=d({tags:["metrics"],url:`${en}/attributes`,method:"GET",query:r.Object({...at.properties,metricName:u({allowEmpty:!1}),clusterId:r.Optional(u({allowEmpty:!1,description:"Cluster ID"}))}),response:dc}),$rt=d({tags:["metrics"],url:`${en}/attributes/batch`,method:"GET",query:r.Object({...at.properties,metricNames:r.Array(u({allowEmpty:!1}),{minItems:1,description:"Metric names to fetch attributes for"}),clusterId:r.Optional(u({allowEmpty:!1,description:"Cluster ID"}))}),response:dc}),yh=r.Object({assets:r.Array(r.Object({type:r.Enum(["dashboard","monitor"],{description:"Kind of asset referencing the metric."}),id:r.String({description:"Dashboard or monitor ID for the asset that queries this metric."}),name:r.String({description:"Display name of the referencing dashboard or monitor."}),owner:r.String({description:"Team ID that owns the referencing dashboard or monitor."})},{description:"A dashboard or monitor that queries this metric."}),{description:"Dashboards and monitors that currently query this metric."})}),jrt=d({tags:["metrics"],url:`${en}/assets-usage`,method:"GET",query:r.Object({metricName:u({allowEmpty:!1})}),response:yh}),qrt=d({url:`${en}/per-attribute`,method:"GET",query:r.Object({from:r.Optional(r.Number()),to:r.Optional(r.Number()),attribute:u(),clusterId:r.Optional(u({allowEmpty:!1}))}),response:r.Array(r.String())});var Th=`/${"v1"}/metrics`,i6=[{name:"http.server.request.duration",type:"histogram"},{name:"http.server.active_requests",type:"gauge"},{name:"http.server.request.count",type:"counter"}];Object.assign(_l,{examples:[i6]});var Eh=r.Object({name:r.String({description:"Metric name observed by Tsuga. Use this value in metric queries and aggregations."}),type:El,description:r.Optional(r.String({description:"Human-readable description of what the metric measures, set by the reporting instrumentation. Omitted when the instrumentation did not provide one."})),unit:r.Optional(r.String({description:"Metric unit reported by instrumentation or inferred metadata."})),temporality:r.Optional(hh),capabilities:r.Optional(r.Array(r.String(),{description:"Aggregate function types (such as `max`, `min`, `sum`) supported when querying or graphing this metric. An empty or omitted array means all aggregate types are supported."})),attributes:r.Optional(r.Array(r.String(),{description:"Metric attribute names available as dimensions for filtering or grouping."}))}),a6={name:"http.server.request.duration",type:"histogram",description:"Duration of HTTP server requests",unit:"ms",temporality:"delta",capabilities:["max","min","sum"],attributes:["context.team","context.environment","context.region"]};Object.assign(Eh,{examples:[a6]});var rk=r.Object({...bt.properties,clusterId:r.Optional(u({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))},{description:"Metric metadata query. Provide the time range to inspect and optionally a cluster ID."}),nk=d({description:"Lists metrics observed in the requested time range with metadata such as type, unit, temporality, capabilities, and attributes. Use this to discover metric names before querying or graphing them. See [Metrics](/documentation/explore/metrics/index).",operationId:"listMetrics",tags:["public","metrics"],url:Th,method:"GET",query:rk,response:r.Array(Eh)}),ok=d({description:"Retrieves metadata for one metric name in the requested time range. Use this to inspect available dimensions and supported query behavior for a metric. See [Metric details](/documentation/explore/metrics/metric-details).",operationId:"getMetric",tags:["public","metrics"],url:`${Th}/:name`,method:"GET",params:r.Object({name:u({allowEmpty:!1,description:"Metric name to retrieve, for example `http.server.request.duration`."})}),query:rk,response:Eh}),s6=["service","env","host","method","status_code"];Object.assign(dc,{examples:[s6]});var ik=r.Pick(yh,["assets"]),c6={assets:[{type:"dashboard",id:"dash-123-abc",name:"API Performance Overview",owner:"team-123-abc"},{type:"monitor",id:"mon-789-ghi",name:"High Latency Alert",owner:"team-123-abc"}]};Object.assign(ik,{examples:[c6]});var ak=d({description:"Retrieve dashboards and monitors that use a specific metric",operationId:"getMetricAssetsUsage",tags:["private"],url:`${Th}/assets-usage`,method:"GET",query:r.Object({metricName:u({allowEmpty:!1,description:"The name of the metric to find usage for"})}),response:ik});var ra="/v0/traces",tnt=d({tags:["traces"],url:`${ra}/count`,method:"GET",query:r.Pick(Ln,["from","to","query","clusterId"]),response:r.Object({count:r.Number()})}),p6=["unset","ok","error"],u6=r.Enum(p6),l6=["unspecified","internal","server","client","producer","consumer"],m6=r.Enum(l6),ck=r.Object({__tsuga_metadata__:r.Optional(r.Object({},{additionalProperties:!0})),context:r.Optional(r.Object({telemetry:r.Optional(r.Object({sdk:r.Optional(r.Object({language:r.Optional(r.String())},{additionalProperties:!0}))},{additionalProperties:!0})),tag_policy_warnings:r.Optional(r.Record(r.String(),r.String())),service:r.Optional(r.Object({name:r.Optional(r.String()),version:r.Optional(r.String())},{additionalProperties:!0})),env:r.Optional(r.String())},{additionalProperties:!0})),parent_span_id:r.Optional(r.String()),resource_attributes:r.Object({},{additionalProperties:!0}),span_attributes:r.Object({},{additionalProperties:!0}),duration:r.Number({description:"In milliseconds."}),duration_ns:r.String({description:"In nanoseconds. Transmitted as a string to avoid losing precision, as BigInt is not JSON-compatible."}),start_time:r.String({description:"In nanoseconds. Transmitted as a string to avoid losing precision, as BigInt is not JSON-compatible."}),end_time:r.String({description:"In nanoseconds. Transmitted as a string to avoid losing precision, as BigInt is not JSON-compatible."}),error:r.Optional(r.Object({message:r.String()})),events:r.Optional(r.Array(r.Object({event_attributes:r.Object({},{additionalProperties:!0}),event_name:r.String(),event_timestamp_nanos:r.String({description:"In nanoseconds. Transmitted as a string to avoid losing precision, as BigInt is not JSON-compatible."})}))),links:r.Optional(r.Array(r.Object({},{additionalProperties:!0}))),span_id:r.String(),span:r.Object({kind:m6,name:r.String()}),status_code:r.Optional(u6),trace_id:r.String()}),pk=100,d6="start_time",f6="duration_ns",g6=r.Union([r.Literal(d6),r.Literal(f6)]),h6={...at.properties,query:r.Optional(u({type:"tsuga-query"})),maxResults:r.Optional(r.Integer({minimum:1,maximum:1e4})),shouldRecommendAttributes:r.Optional(r.Boolean()),startOffset:r.Optional(r.Number({minimum:uc})),clusterId:r.Optional(u({allowEmpty:!1,description:"Cluster ID"})),sortBy:r.Optional(g6),sortDirection:r.Optional(r.Union([r.Literal("asc"),r.Literal("desc")]))},rnt=d({tags:["traces"],url:`${ra}/search`,method:"GET",query:r.Object(h6),response:r.Object({spans:r.Optional(r.Array(ck)),attributesToHighlight:r.Optional(r.Array(lc))})});var y6=r.Object({groupByAttributes:r.Array(u({allowEmpty:!1}),{description:'Glob patterns of span_attributes keys to use as additional grouping dimensions (e.g. "db.*"). Matches against flattened dotted keys of span_attributes only.'}),minLeafSpansToAggregate:r.Integer({minimum:2,description:"Minimum leaf-group size before aggregation occurs. Default 5."}),maxParentDepth:r.Integer({minimum:-1,description:"Max depth of recursive parent aggregation. 0 = leaves only, -1 = unlimited (default)."}),aggregationHistogramBucketsSeconds:r.Array(r.Number({minimum:0}),{description:"Upper bounds for the latency histogram in seconds. Empty array disables the histogram attributes."}),sortSpans:r.Boolean({description:"Whether to sort the returned spans by start_time (span_id tie-breaker). Set false when the caller reconstructs the trace tree and does not need ordering. Default true."})}),T6=r.Object({...at.properties,traceId:u({allowEmpty:!1,description:"Trace ID to summarize"}),clusterId:r.Optional(u({allowEmpty:!1,description:"Cluster ID"})),...r.Partial(y6).properties}),nnt=d({tags:["traces"],url:`${ra}/summarize`,method:"GET",query:T6,response:r.Object({spans:r.Array(ck)})}),ont=d({tags:["traces"],url:`${ra}/attributes`,method:"GET",query:r.Object({...at.properties,clusterId:r.Optional(u({allowEmpty:!1,description:"Cluster ID"}))}),response:r.Object({attributes:r.Array(r.String())})}),E6=r.Object({key:r.String({description:"Opaque stable key identifying this contributing service within the response. Tsuga assigns it while building the summary; `ranges[].contributions[].serviceKey` and `serviceTotals[].serviceKey` reference this value."}),name:r.String({description:"Observed service name that contributed leaf-span time to the trace. Comes from trace service context and is returned for every contributing service."}),env:r.Optional(r.String({description:"Observed service environment for this contributing service. Comes from trace service context and is absent when the spans do not carry an environment."})),id:r.Optional(r.String({description:"Service catalog ID for this contributing service. Tsuga sets it when exactly one catalog entry matches the observed service and environment; absent when the service is not cataloged or matches ambiguously."})),namespace:r.Optional(r.String({description:"Service namespace from the matched service catalog entry. Returned only when Tsuga can resolve the contributing service to one catalog entry with a namespace."}))}),_6=r.Object({fromNs:r.String({description:"Range start time in nanoseconds since Unix epoch. Tsuga sets it from the trace timeline split where active leaf spans change. Transmitted as a string to avoid losing precision."}),toNs:r.String({description:"Range end time in nanoseconds since Unix epoch. Tsuga sets it from the trace timeline split where active leaf spans change. Transmitted as a string to avoid losing precision."}),durationNs:r.String({description:"Range duration in nanoseconds, computed as `toNs - fromNs`. Transmitted as a string to avoid losing precision."}),contributions:r.Array(r.Object({serviceKey:r.String({description:"Contributing service key for this range. References `services[].key` in the same response."}),weight:r.Number({description:"Share of this range attributed to the service, from `0` through `1`. Tsuga computes the weight from active leaf spans in the range; weights inside one range sum to `1`."}),durationNs:r.String({description:"Estimated duration attributed to this service in the range, computed as `weight` times the range's own `durationNs` and rounded to whole nanoseconds. Use `serviceTotals` as authoritative when rounded range values do not add up exactly."})}),{description:"Services contributing active leaf-span time to this range, with weighted shares for the range duration."}),spanIds:r.Array(r.String(),{description:"Leaf span IDs that produced this range. Tsuga returns IDs from the leaf-only attribution set, including merged sub-ranges after short-range collapsing."})}),I6=r.Object({serviceKey:r.String({description:"Contributing service key for this aggregate total. References `services[].key` in the same response."}),durationNs:r.String({description:"Total wall-clock contribution of this service across the trace, in nanoseconds. Sum of `weight * durationNs` over every range the service contributes to; authoritative when it disagrees with rounded per-range values. Transmitted as a string to avoid losing precision."}),share:r.Number({description:"Share of total trace duration attributed to this service, from `0` through `1`. Computed as `durationNs / totalDurationNs`; multiply by 100 for a percentage."})}),_h=r.Optional(r.Number({minimum:0,description:"Minimum range duration in milliseconds. Shorter ranges are collapsed (absorbed into a neighbor or blended with adjacent shorts) to keep the timeline readable. When omitted, the default depends on the trace: max(1ms, 1% of the total trace duration), so e.g. a 10s trace collapses ranges shorter than 100ms. Pass 0 to disable collapsing."})),Ih=r.Optional(r.Boolean({default:!0,description:"When false, omits the per-range timeline (returns `ranges: []`) and returns only `services` and `serviceTotals`. Cuts payload size for callers that only need the headline. Defaults to true."})),Il=r.Object({traceId:r.String({description:"Trace ID summarized by the response. Echoes the required `traceId` query parameter."}),startTimeNs:r.String({description:"Earliest `start_time` across fetched spans, in nanoseconds since Unix epoch. If the request window does not cover the full trace, this reflects the fetched subset, not necessarily the trace's true start. Transmitted as a string to avoid losing precision."}),endTimeNs:r.String({description:"Latest `end_time` across fetched spans, in nanoseconds since Unix epoch. If the request window does not cover the full trace, this reflects the fetched subset, not necessarily the trace's true end. Transmitted as a string to avoid losing precision."}),totalDurationNs:r.String({description:"Total fetched trace duration in nanoseconds, computed as `endTimeNs - startTimeNs`. Transmitted as a string to avoid losing precision."}),truncated:r.Boolean({description:"Whether the underlying span fetch hit its result cap. When true, the latency summary may be incomplete because not every span in the trace was available."}),services:r.Array(E6,{description:"Unique services that contributed leaf-span time to the trace, enriched with catalog IDs when Tsuga can resolve them. Referenced by `serviceKey` from `ranges` and `serviceTotals`."}),ranges:r.Array(_6,{description:"Sequential trace timeline split into ranges wherever the active leaf-span set changes. Empty when the request sets `includeRanges` to false."}),serviceTotals:r.Array(I6,{description:"Aggregated wall-clock contribution per service across the fetched trace. Use this for service-level latency ownership without processing the per-range timeline."})}),b6={traceId:"78c99c5bb1e4a30297fa134b9dbec64f",startTimeNs:"1704067200000000000",endTimeNs:"1704067202400000000",totalDurationNs:"2400000000",truncated:!1,services:[{key:"checkout|prod",name:"checkout",env:"prod",id:"123-456-abc",namespace:"default"},{key:"payments|prod",name:"payments",env:"prod",id:"456-789-def",namespace:"default"}],ranges:[{fromNs:"1704067200000000000",toNs:"1704067201200000000",durationNs:"1200000000",contributions:[{serviceKey:"checkout|prod",weight:1,durationNs:"1200000000"}],spanIds:["3df8cc3449378f66"]},{fromNs:"1704067201200000000",toNs:"1704067202400000000",durationNs:"1200000000",contributions:[{serviceKey:"checkout|prod",weight:.5,durationNs:"600000000"},{serviceKey:"payments|prod",weight:.5,durationNs:"600000000"}],spanIds:["187a47da1b2560f8","3df8cc3449378f66"]}],serviceTotals:[{serviceKey:"checkout|prod",durationNs:"1800000000",share:.75},{serviceKey:"payments|prod",durationNs:"600000000",share:.25}]};Object.assign(Il,{examples:[b6]});var int=d({tags:["traces"],url:`${ra}/latency-summary`,method:"GET",query:r.Object({...at.properties,traceId:u({allowEmpty:!1,description:"Trace ID to summarize"}),clusterId:r.Optional(u({allowEmpty:!1,description:"Cluster ID"})),minRangeDurationMs:_h,includeRanges:Ih}),response:Il}),sk=r.Object({filter:u({type:"tsuga-query",description:"TQL filter defining the group"}),timeRange:ci}),S6=r.Object({value:r.String(),supportA:r.Number(),supportB:r.Number()}),A6=r.Object({value:r.String(),supportA:r.Number(),supportB:r.Number(),lift:r.Union([r.Number(),r.Null()]),pValue:r.Number()}),O6=r.Object({attr:r.String(),values:r.Array(A6),otherValues:r.Array(S6)}),ant=d({tags:["traces"],url:`${ra}/contrast-sets`,method:"POST",body:r.Object({groupA:sk,groupB:sk,candidateAttrs:r.Optional(r.Array(u({allowEmpty:!1}))),topK:r.Optional(r.Integer({minimum:1,maximum:100})),minLift:r.Optional(r.Number({minimum:1})),minSupport:r.Optional(r.Number({minimum:0,maximum:100})),clusterId:r.Optional(u({allowEmpty:!1,description:"Cluster ID"}))}),response:r.Object({contrastSets:r.Array(O6),groupACount:r.Number(),groupBCount:r.Number()})});var bh=`/${"v1"}/traces`,Sh=r.Object({context:r.Optional(r.Object({service:r.Optional(r.Object({name:r.Optional(r.String({description:"Service name associated with the span."})),version:r.Optional(r.String({description:"Service version associated with the span."}))},{additionalProperties:!0,description:"Service identity associated with the span, from OpenTelemetry service resource attributes."}))},{additionalProperties:!0,description:"OpenTelemetry resource context resolved for the span, holding the identity of the emitting service."})),parentSpanId:r.Optional(r.String({description:"`spanId` of this span's parent within the same trace. Absent for the root span."})),resourceAttributes:r.Object({},{additionalProperties:!0,description:"OpenTelemetry resource attributes describing the process/host that emitted the span (e.g. `host.name`, `k8s.pod.name`), as a flat key-value map set by the instrumented service or its SDK."}),spanAttributes:r.Object({},{additionalProperties:!0,description:"OpenTelemetry span attributes describing this operation (e.g. HTTP method, DB statement), as a flat key-value map set by the instrumented code or auto-instrumentation."}),duration:r.Number({description:"Span duration in milliseconds, derived from the nanosecond `startTime` and `endTime` values."}),startTime:r.String({description:"Span start time as a Unix epoch timestamp in nanoseconds, encoded as a string to preserve precision."}),endTime:r.String({description:"Span end time as a Unix epoch timestamp in nanoseconds, encoded as a string to preserve precision."}),error:r.Optional(r.Object({message:r.String({description:"Error message associated with the span."})},{description:"Error details associated with the span, separate from the OpenTelemetry `statusCode` field."})),events:r.Optional(r.Array(r.Object({event_attributes:r.Object({},{additionalProperties:!0,description:"Key-value attributes recorded with this event, set by the instrumented code when the event was added to the span (e.g. exception details)."}),event_name:r.String({description:"Name of the span event."}),event_timestamp_nanos:r.String({description:"Event timestamp in nanoseconds, transmitted as a string for precision."})},{description:"A single timestamped event recorded on the span, with its name and attributes."}),{description:"Events recorded on the span."})),spanId:r.String({description:"Unique span ID within the trace."}),span:r.Object({kind:r.String({description:"OpenTelemetry span kind describing the relationship to remote calls: `unspecified`, `internal`, `server`, `client`, `producer`, or `consumer`."}),name:r.String({description:"Operation name recorded on the span."})},{description:"Operation identity for the span, combining the recorded operation name and the OpenTelemetry span kind."}),statusCode:r.Optional(r.String({description:"OpenTelemetry span status set by the instrumented code: `unset` (default, no explicit status), `ok`, or `error`. Absent if the source span never set a status."})),traceId:r.String({description:"Trace ID shared by all spans in the trace."})},{additionalProperties:!0,$id:"SpanEvent",description:"Distributed tracing span including timing, identifiers, OpenTelemetry attributes, events, and status metadata."}),x6={context:{service:{name:"my-service",version:"1.0.0"}},parentSpanId:"187a47da1b2560f8",resourceAttributes:{},spanAttributes:{busyNs:374640,code:{file:{path:"src/queue/sqs.rs"},line:{number:162},module:{name:"queue::sqs"}},idleNs:23621445,maxMessages:"1",target:"queue::sqs",thread:{id:2,name:"tokio-runtime-worker"}},duration:23,startTime:"1770923469995353600",endTime:"1770923470019349500",spanId:"3df8cc3449378f66",span:{kind:"internal",name:"receive_messages"},statusCode:"ok",traceId:"78c99c5bb1e4a30297fa134b9dbec64f"};Object.assign(Sh,{examples:[x6]});var R6={from:1704067200,to:1704070800,query:"context.service.name:my-service",maxResults:100},uk=r.Object({...bt.properties,query:r.Optional(u({type:"tsuga-query",default:"*",description:"Tsuga query selecting spans to return. Omit to search all spans in the range with `*`."})),maxResults:r.Optional(r.Integer({minimum:1,maximum:1e4,default:pk,description:"Maximum number of spans to return. Defaults to 100. Valid values are 1 through 10000."})),clusterId:r.Optional(u({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))},{description:"Span search query. Provide a time range, optional Tsuga query, and optional limit."});Object.assign(uk,{examples:[R6]});var lk=d({description:"Searches spans in a required time range using Tsuga query syntax. Use this endpoint to retrieve trace spans for investigations or automation. See [Traces](/documentation/explore/traces) and [Query syntax](/documentation/explore/query-syntax).",operationId:"searchSpans",tags:["public","traces"],url:`${bh}/search`,method:"GET",query:uk,response:r.Object({spans:r.Array(Sh,{description:"Spans matching the query and time range."})})}),C6={from:1704067200,to:1704070800,traceId:"78c99c5bb1e4a30297fa134b9dbec64f"},mk=r.Object({...bt.properties,traceId:u({allowEmpty:!1,description:"Trace ID to summarize. Use the `traceId` returned by span search, the trace details page, or your tracing instrumentation. Required; the requested time range must include the trace."}),clusterId:r.Optional(u({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."})),groupByAttributes:r.Optional(r.Array(u({allowEmpty:!1}),{description:"Glob patterns of span attribute keys to use as additional grouping dimensions. Use this when spans should be summarized separately for matching attributes, such as `db.*`. Matches flattened dotted span attribute keys; omitted by default."})),minLeafSpansToAggregate:r.Optional(r.Integer({minimum:2,default:5,description:"Minimum number of similar leaf spans in a group before Tsuga replaces them with one synthetic summary span. Use higher values for less aggressive summarization. Optional; defaults to 5 and must be at least 2."})),maxParentDepth:r.Optional(r.Integer({minimum:-1,default:-1,description:"Maximum depth of recursive parent aggregation after leaf spans are summarized. Use this to limit parent-level aggregation. Use `0` to aggregate leaf spans only or `-1` for unlimited depth; defaults to `-1`."})),aggregationHistogramBucketsSeconds:r.Optional(r.Array(r.Number({minimum:0}),{description:"Upper-bound bucket values, in seconds, for the latency histogram recorded on synthetic summary spans. Provide custom buckets when the default latency buckets are not suitable. Pass an empty array to omit histogram attributes; omitted values use Tsuga defaults from 5 ms through 10 s."})),sortSpans:r.Optional(r.Boolean({default:!0,description:"Whether Tsuga sorts returned spans by start time, using span ID as the tie-breaker for identical start times. Defaults to `true`; set to `false` only when reconstructing the trace tree yourself, in which case summary spans are appended after surviving spans."}))},{description:"Trace summarization query. Provide a trace ID, a time range covering the trace, and optional aggregation tuning."});Object.assign(mk,{examples:[C6]});var dk=d({description:"Summarizes a trace by aggregating groups of similar spans into synthetic summary spans, producing a compact view of large traces. Summary spans are marked with `spanAttributes.aggregation.is_summary` and carry span counts, duration statistics, and an optional latency histogram. See [Traces](/documentation/explore/traces).",operationId:"summarizeTrace",tags:["public","traces"],url:`${bh}/summarize`,method:"GET",query:mk,response:r.Object({spans:r.Array(Sh,{description:"Summarized trace spans, sorted by start time unless `sortSpans` is false. Aggregated groups are replaced by synthetic summary spans marked with `spanAttributes.aggregation.is_summary`."})})}),P6={from:1704067200,to:1704070800,traceId:"78c99c5bb1e4a30297fa134b9dbec64f"},fk=r.Object({...bt.properties,traceId:u({allowEmpty:!1,description:"Trace ID to summarize. Use the `traceId` returned by span search, the trace details page, or your tracing instrumentation. Required; the requested time range must include the trace."}),clusterId:r.Optional(u({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."})),minRangeDurationMs:_h,includeRanges:Ih},{description:"Trace latency summary query. Provide a trace ID, a time range covering the trace, and optional timeline tuning."});Object.assign(fk,{examples:[P6]});var gk=d({description:"Summarizes where wall-clock time is spent in a trace, attributing each slice of the trace timeline to the services with active leaf spans. Returns per-service totals and an optional sequential range timeline. See [Traces](/documentation/explore/traces).",operationId:"getTraceLatencySummary",tags:["public","traces"],url:`${bh}/latency-summary`,method:"GET",query:fk,response:Il});var Tk=["timestamp","level","message"],Ek=["count","ratio","team","level","pattern"];function gt(e,t){let n=t??$r(e);if(!n)throw new Error(`--${e} is required`);return Ic(n)}function hk(e){let t={from:gt("from",e.from),to:gt("to",e.to)},n=e.query??$r("query");n!==void 0&&(t.query=n);let o=e.maxResults??$r("max-results");if(o!==void 0){let i=Number(o);if(Number.isNaN(i))throw new Error(`--max-results must be a number (got: ${o})`);t.maxResults=i}return t}function Ne(e){let t=$r(e);return t===void 0?"":` (default: ${t})`}function U6(e){let t=Qm(e.output),n=e.fields===void 0?void 0:Wm(e.fields);return t==="json"?{format:t,fields:n}:{format:t,fields:n??Tk}}function w6(e){let t=Qm(e.output),n=e.fields===void 0?void 0:Wm(e.fields);return t==="json"?{format:t,fields:n}:{format:t,fields:n??Ek}}function yk(e,t){let n={count:e.size,ratio:t>0?e.size/t:0,pattern:e.pattern};for(let{key:o,value:i}of e.groups)o==="context.team"?n.team=i:n[o]=i;return n}function v6(e,t){if(t.format==="json"){if(t.fields===void 0){ee(e);return}let{fields:i}=t;ee({patterns:e.patterns.map(a=>yk(a,e.sampleSize)).map(a=>Zm(a,i)),sampleSize:e.sampleSize});return}let n=e.patterns.map(i=>yk(i,e.sampleSize)),o=Xm(t.format,n,t.fields);o.length>0&&V(o)}function N6(e,t){if(t.format==="json"){if(t.fields===void 0){ee(e);return}let{fields:o}=t;ee({logs:e.logs.map(i=>Zm(i,o))});return}let n=Xm(t.format,e.logs,t.fields);n.length>0&&V(n)}function _k(e,t){let n=e.command("logs").description("Search and analyze logs");n.command("search").description("Search logs").option("--from <TIMESTAMP>",`Start of time range${Ge}${Ne("from")}`).option("--to <TIMESTAMP>",`End of time range${Ge}${Ne("to")}`).option("--query <TSUGA_QUERY>",`Tsuga query to filter logs${Ne("query")}`).option("--max-results <COUNT>",`Maximum number of results, 1-1000${Ne("max-results")}`).option("--fields <FIELDS>",`Comma-separated dot-paths to project from each log (default for --output=tsv|csv: ${Tk.join(",")})`).option("-o, --output <FORMAT>","Output format: json | tsv | csv","json").action(async c=>{let l=U6(c),m=await t()(zL,{query:hk(c)});N6(m,l)}),n.command("attributes").description("List log attribute dot-paths observed in the time range").option("--from <TIMESTAMP>",`Start of time range${Ge}${Ne("from")}`).option("--to <TIMESTAMP>",`End of time range${Ge}${Ne("to")}`).action(async c=>{let l=await t()(ek,{query:{from:gt("from",c.from),to:gt("to",c.to)}});ee(l)}),n.command("patterns").description("List log patterns").option("--from <TIMESTAMP>",`Start of time range${Ge}${Ne("from")}`).option("--to <TIMESTAMP>",`End of time range${Ge}${Ne("to")}`).option("--query <TSUGA_QUERY>",`Tsuga query to filter logs before clustering into patterns${Ne("query")}`).option("--fields <FIELDS>",`Comma-separated dot-paths to project from each pattern (default for --output=tsv|csv: ${Ek.join(",")})`).option("-o, --output <FORMAT>","Output format: json | tsv | csv","json").action(async c=>{let l=w6(c),m={from:gt("from",c.from),to:gt("to",c.to)},f=c.query??$r("query");f!==void 0&&(m.query=f);let h=await t()(VL,{query:m});v6(h,l)}),n.command("new-error-patterns").description("List error patterns first seen in this time range").option("--from <TIMESTAMP>",`Start of time range${Ge}${Ne("from")}`).option("--to <TIMESTAMP>",`End of time range${Ge}${Ne("to")}`).option("--team <TEAM_NAME>","Filter by team").option("--env <ENV_NAME>","Filter by environment").option("--service <SERVICE_NAME>","Filter by service").action(async c=>{let l={from:gt("from",c.from),to:gt("to",c.to)};c.team!==void 0&&(l.team=c.team),c.env!==void 0&&(l.env=c.env),c.service!==void 0&&(l.service=c.service);let m=await t()(WL,{query:l});ee(m)}),n.command("error-pattern-increases").description("List error pattern increases for a given team").option("--from <TIMESTAMP>",`Start of time range${Ge}${Ne("from")}`).option("--to <TIMESTAMP>",`End of time range${Ge}${Ne("to")}`).requiredOption("--team <TEAM_NAME>","Team to query").option("--env <ENV_NAME>","Filter by environment").action(async c=>{let l={from:gt("from",c.from),to:gt("to",c.to),team:c.team};c.env!==void 0&&(l.env=c.env);let m=await t()(XL,{query:l});ee(m)});let o=e.command("metrics").description("List and inspect metrics");o.command("list").description("List all metrics with their metadata").option("--from <TIMESTAMP>",`Start of time range${Ge}${Ne("from")}`).option("--to <TIMESTAMP>",`End of time range${Ge}${Ne("to")}`).action(async c=>{let l=await t()(nk,{query:{from:gt("from",c.from),to:gt("to",c.to)}});ee(l)}),o.command("get <METRIC_NAME>").description("Retrieve a metric by name with its metadata").option("--from <TIMESTAMP>",`Start of time range${Ge}${Ne("from")}`).option("--to <TIMESTAMP>",`End of time range${Ge}${Ne("to")}`).action(async(c,l)=>{let m=await t()(ok,{params:{name:c},query:{from:gt("from",l.from),to:gt("to",l.to)}});ee(m)}),o.command("assets-usage <METRIC_NAME>").description("List dashboards and monitors that use a specific metric").action(async c=>{let l=await t()(ak,{query:{metricName:c}});ee(l)});let i=e.command("traces").description("Search and summarize traces");i.command("search").description("Search spans").option("--from <TIMESTAMP>",`Start of time range${Ge}${Ne("from")}`).option("--to <TIMESTAMP>",`End of time range${Ge}${Ne("to")}`).option("--query <TSUGA_QUERY>",`Tsuga query to filter spans${Ne("query")}`).option("--max-results <COUNT>",`Maximum number of results, 1-10000${Ne("max-results")}`).action(async c=>{let l=await t()(lk,{query:hk(c)});ee(l)}),i.command("summarize").description("Summarize a trace by aggregating groups of similar spans into summary spans").requiredOption("--trace-id <TRACE_ID>","Trace ID to summarize").option("--from <TIMESTAMP>",`Start of time range${Ge}${Ne("from")}`).option("--to <TIMESTAMP>",`End of time range${Ge}${Ne("to")}`).action(async c=>{let l=await t()(dk,{query:{traceId:c.traceId,from:gt("from",c.from),to:gt("to",c.to)}});ee(l)}),i.command("latency-summary").description("Summarize where wall-clock time is spent in a trace, attributed per service").requiredOption("--trace-id <TRACE_ID>","Trace ID to summarize").option("--from <TIMESTAMP>",`Start of time range${Ge}${Ne("from")}`).option("--to <TIMESTAMP>",`End of time range${Ge}${Ne("to")}`).option("--min-range-duration-ms <MILLISECONDS>","Collapse timeline ranges shorter than this (default: max(1ms, 1% of trace duration); 0 disables collapsing)").option("--no-ranges","Omit the per-range timeline; return only services and serviceTotals").action(async c=>{let l={traceId:c.traceId,from:gt("from",c.from),to:gt("to",c.to)};if(c.minRangeDurationMs!==void 0){let f=Number(c.minRangeDurationMs);if(Number.isNaN(f))throw new Error(`--min-range-duration-ms must be a number (got: ${c.minRangeDurationMs})`);l.minRangeDurationMs=f}c.ranges||(l.includeRanges=!1);let m=await t()(gk,{query:l});ee(m)});let a=e.command("aggregation").description("Run aggregation queries");Wr(a,"scalar","Run aggregation queries and return scalar results",Nw,t),Wr(a,"timeseries","Run aggregation queries and return timeseries results",kw,t)}var L6="x-tsuga-session-id",Ah="x-tsuga-source",Oh="x-tsuga-source-version",xh="x-tsuga-source-commit",Rh="x-tsuga-source-date",Ch="x-tsuga-rationale",k6="x-tsuga-dashboard-id",M6="x-tsuga-widget-id",D6="x-request-id",Ont={[L6]:"Session identifier for request correlation",[Ah]:"SDK or client source identifier (e.g., web-frontend, terraform-provider)",[Oh]:"SDK version",[xh]:"SDK commit hash",[Rh]:"SDK commit date",[Ch]:"Optional caller-supplied rationale for this request, recorded for telemetry",[k6]:"ID of the dashboard a query is issued from, when the request originates from a dashboard widget",[M6]:"ID of the dashboard widget (graph) a query is issued from, when the request originates from a dashboard widget",[D6]:"Unique identifier for this API request, useful for debugging and support"};var kn=class e extends Error{constructor(n,o,i,a,c){super(n);this.statusCode=o;this.code=i;this.requestId=a;this.details=c;this.name="CliError"}static fromErrorResponse(n,o){return new e(n.message,n.statusCode,n.code,o,n.details)}};function Ik(e){if(e instanceof kn){let t=[`Error: ${e.message}`];return e.code&&t.push(`Code: ${e.code}`),e.statusCode&&t.push(`Status: ${e.statusCode}`),e.requestId&&t.push(`Request ID: ${e.requestId}`),e.details&&t.push(`Details: ${JSON.stringify(e.details,null,2)}`),t.join(`
|
|
172
|
+
`)}return e instanceof Error?`Error: ${e.message}`:String(e)}function G6(e){return e.replace(/\s+/g," ").replace(/[^\x20-\x7e\x80-\xff]/g,"").trim()}function bk(e,t,n,o){return async function(a,c={}){let{body:l,params:m,query:f}=c,h;if(a.url!==void 0)h=a.url;else if(a.buildUrl){if(!m)throw new kn("Internal error: params required for this endpoint");h=a.buildUrl(m)}else throw new kn("Internal error: endpoint has neither url nor buildUrl");let E=n===void 0?f:{clusterId:n,...f},I=eO(`${e}${h}`,E),g={Accept:"application/json",Authorization:`Bearer ${t}`,[Ah]:"cli",[Oh]:"1.22.0",[xh]:"9da52e442",[Rh]:"2026-08-28T08:18:26.199Z"};l&&(g["Content-Type"]="application/json");let T=o?.(),S=T?G6(T):"";S&&(g[Ch]=S);let b=await fetch(I,{method:a.method,headers:g,body:l?JSON.stringify(l):null}),x;try{x=await b.json()}catch{throw new kn(b.status===504?"The server timed out (504). Try a smaller time range.":`Server returned a non-JSON response (HTTP ${b.status}).`,b.status)}if(x.error)throw kn.fromErrorResponse(x.error,x.requestId);return j6(x,$6(c)),x.data}}function $6({body:e,query:t}){let n=t?.offset??e?.offset;return typeof n=="number"?n:0}function j6(e,t){let n=e.metadata?.pagination;if(n===void 0||!Array.isArray(e.data))return;let o=t+e.data.length;o>=n.totalCount||mO(`Showing ${e.data.length} of ${n.totalCount} (offset ${t}). Use --limit (max ${ti}) and --offset ${o} for the next page.`)}function Ph(e,t=n=>{process.exit(n)}){e.on("error",n=>{if(n.code==="EPIPE"){t(process.exitCode);return}throw n})}var q6=3e3,F6="https://registry.npmjs.org/@tsuga/cli/latest";function B6(e,t){let n=e.split(".").map(Number),o=t.split(".").map(Number);for(let i=0;i<Math.max(n.length,o.length);i++){let a=n[i]??0,c=o[i]??0;if(a>c)return!0;if(a<c)return!1}return!1}async function Sk(e){try{let t=$O();if(t&&Date.now()-new Date(t).getTime()<_c)return;let n=await fetch(F6,{signal:AbortSignal.timeout(q6)});if(!n.ok)return;let i=(await n.json()).version;B6(i,e)&&(process.stderr.write(`
|
|
173
173
|
Update available: ${e} \u2192 ${i}
|
|
174
|
-
`),process.stderr.write("Run `tsuga self-update` to update\n")),jO(new Date().toISOString())}catch{}}Ph(process.stdout);Ph(process.stderr);var Re=new xo().name("tsuga").description("Manage Tsuga resources, telemetry, and configuration from the command line").version("1.
|
|
175
|
-
`).configureHelp({sortSubcommands:!0}).helpOption("-h, --help","Display help for command").helpCommand("help [command]","Display help for command").option("--operation-api-key <OPERATION_API_KEY>","Operation API key (overrides config and TSUGA_OPERATION_API_KEY)").option("--cluster <CLUSTER_ID>","Target cluster (overrides config and TSUGA_CLUSTER_ID)"),na,Ak;function vr(){if(na)return na;let e=Re.opts(),t=oi({operationApiKey:e.operationApiKey,clusterId:e.cluster}),n=UO(t);n||(console.error("Error: no credentials. Authenticate with one of:"),console.error(" tsuga auth login # log in as a user (OAuth)"),console.error(" tsuga auth operation-key <OPERATION_API_KEY> # save an operation API key"),console.error(" export TSUGA_OPERATION_API_KEY=<OPERATION_API_KEY>"),console.error(" tsuga --operation-api-key <OPERATION_API_KEY> <COMMAND>"),process.exit(1));let o=l=>bk(t.apiUrl,l,t.clusterId,()=>Ak),{credential:i}=t;if(i?.kind!=="user-session")return na=o(n),na;let a=i.userAuth,c=o(a.accessToken);return na=async(l,m)=>{let f=await jp({userAuth:a,now:new Date,reload:Xa,refresh:h=>$p(t.apiUrl,h),persist:Kp});return f!==a&&(a=f,c=o(a.accessToken)),c(l,m)},na}var Ok="Setup & config:",xk="Documentation, help & feedback:";Re.commandsGroup(Ok);
|
|
174
|
+
`),process.stderr.write("Run `tsuga self-update` to update\n")),jO(new Date().toISOString())}catch{}}Ph(process.stdout);Ph(process.stderr);var Re=new xo().name("tsuga").description("Manage Tsuga resources, telemetry, and configuration from the command line").version("1.22.0").addHelpText("before",()=>`${pO()}
|
|
175
|
+
`).configureHelp({sortSubcommands:!0}).helpOption("-h, --help","Display help for command").helpCommand("help [command]","Display help for command").option("--operation-api-key <OPERATION_API_KEY>","Operation API key (overrides config and TSUGA_OPERATION_API_KEY)").option("--cluster <CLUSTER_ID>","Target cluster (overrides config and TSUGA_CLUSTER_ID)"),na,Ak;function vr(){if(na)return na;let e=Re.opts(),t=oi({operationApiKey:e.operationApiKey,clusterId:e.cluster}),n=UO(t);n||(console.error("Error: no credentials. Authenticate with one of:"),console.error(" tsuga auth login # log in as a user (OAuth)"),console.error(" tsuga auth operation-key <OPERATION_API_KEY> # save an operation API key"),console.error(" export TSUGA_OPERATION_API_KEY=<OPERATION_API_KEY>"),console.error(" tsuga --operation-api-key <OPERATION_API_KEY> <COMMAND>"),process.exit(1));let o=l=>bk(t.apiUrl,l,t.clusterId,()=>Ak),{credential:i}=t;if(i?.kind!=="user-session")return na=o(n),na;let a=i.userAuth,c=o(a.accessToken);return na=async(l,m)=>{let f=await jp({userAuth:a,now:new Date,reload:Xa,refresh:h=>$p(t.apiUrl,h),persist:Kp});return f!==a&&(a=f,c=o(a.accessToken)),c(l,m)},na}var Ok="Setup & config:",xk="Documentation, help & feedback:";Re.commandsGroup(Ok);FO(Re);Mx(Re);var H6=new Set(Re.commands);Re.commandsGroup("Resources:");UL(Re,vr);Re.commandsGroup("Query & explore:");_k(Re,vr);kR(Re,vr);FU(Re,vr);VU(Re,vr);xw(Re,vr);Dw(Re,vr);Re.commandsGroup(xk);Fx(Re,vr);zx(Re,vr);Re.commandsGroup(Ok);vx(Re,vr);FL(Re);zU(Re);vL(Re);kx(Re);Re.commandsGroup(xk).helpCommand("help [command]");function Rk(e){if(e.commands.length===0){e.option("--rationale <RATIONALE>",'Why you are making this call, e.g. "confirming the deploy caused the error spike". Recorded to explain intent; does not affect the result.');return}for(let t of e.commands)Rk(t)}var K6=new Set(["completion","self-update","install","setup","feedback"]);for(let e of Re.commands)!H6.has(e)&&!K6.has(e.name())&&Rk(e);Re.hook("preAction",(e,t)=>{let{rationale:n}=t.opts();Ak=n});Re.parseAsync().then(()=>Sk("1.22.0")).catch(e=>{console.error(Ik(e)),process.exitCode=1});
|
|
176
176
|
/**
|
|
177
177
|
* The following is a list of HTTP status codes and their meanings.
|
|
178
178
|
*
|