@tsuga/cli 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +35 -2
  2. package/dist/cli.js +144 -58
  3. package/package.json +3 -3
package/dist/cli.js CHANGED
@@ -1,81 +1,167 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var UC=Object.create;var vc=Object.defineProperty;var NC=Object.getOwnPropertyDescriptor;var kC=Object.getOwnPropertyNames;var wC=Object.getPrototypeOf,LC=Object.prototype.hasOwnProperty;var Jr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Pt=(e,t)=>{for(var r in t)vc(e,r,{get:t[r],enumerable:!0})},MC=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of kC(t))!LC.call(e,i)&&i!==r&&vc(e,i,{get:()=>t[i],enumerable:!(o=NC(t,i))||o.enumerable});return e};var Gl=(e,t,r)=>(r=e!=null?UC(wC(e)):{},MC(t||!e||!e.__esModule?vc(r,"default",{value:e,enumerable:!0}):r,e));var Vo=Jr($c=>{var Ga=class extends Error{constructor(t,r,o){super(o),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=t,this.nestedError=void 0}},Dc=class extends Ga{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};$c.CommanderError=Ga;$c.InvalidArgumentError=Dc});var ja=Jr(jc=>{var{InvalidArgumentError:vC}=Vo(),Gc=class{constructor(t,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,t[0]){case"<":this.required=!0,this._name=t.slice(1,-1);break;case"[":this.required=!1,this._name=t.slice(1,-1);break;default:this.required=!0,this._name=t;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:r.concat(t)}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}argParser(t){return this.parseArg=t,this}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,o)=>{if(!this.argChoices.includes(r))throw new vC(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,o):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function DC(e){let t=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+t+">":"["+t+"]"}jc.Argument=Gc;jc.humanReadableArgName=DC});var qc=Jr(Bc=>{var{humanReadableArgName:$C}=ja(),Fc=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(t){this.helpWidth=this.helpWidth??t.helpWidth??80}visibleCommands(t){let r=t.commands.filter(i=>!i._hidden),o=t._getHelpCommand();return o&&!o._hidden&&r.push(o),this.sortSubcommands&&r.sort((i,a)=>i.name().localeCompare(a.name())),r}compareOptions(t,r){let o=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return o(t).localeCompare(o(r))}visibleOptions(t){let r=t.options.filter(i=>!i.hidden),o=t._getHelpOption();if(o&&!o.hidden){let i=o.short&&t._findOption(o.short),a=o.long&&t._findOption(o.long);!i&&!a?r.push(o):o.long&&!a?r.push(t.createOption(o.long,o.description)):o.short&&!i&&r.push(t.createOption(o.short,o.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(t){if(!this.showGlobalOptions)return[];let r=[];for(let o=t.parent;o;o=o.parent){let i=o.options.filter(a=>!a.hidden);r.push(...i)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(t){return t._argsDescription&&t.registeredArguments.forEach(r=>{r.description=r.description||t._argsDescription[r.name()]||""}),t.registeredArguments.find(r=>r.description)?t.registeredArguments:[]}subcommandTerm(t){let r=t.registeredArguments.map(o=>$C(o)).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,r){return r.visibleCommands(t).reduce((o,i)=>Math.max(o,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(i)))),0)}longestOptionTermLength(t,r){return r.visibleOptions(t).reduce((o,i)=>Math.max(o,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestGlobalOptionTermLength(t,r){return r.visibleGlobalOptions(t).reduce((o,i)=>Math.max(o,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestArgumentTermLength(t,r){return r.visibleArguments(t).reduce((o,i)=>Math.max(o,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(i)))),0)}commandUsage(t){let r=t._name;t._aliases[0]&&(r=r+"|"+t._aliases[0]);let o="";for(let i=t.parent;i;i=i.parent)o=i.name()+" "+o;return o+r+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.summary()||t.description()}optionDescription(t){let r=[];return t.argChoices&&r.push(`choices: ${t.argChoices.map(o=>JSON.stringify(o)).join(", ")}`),t.defaultValue!==void 0&&(t.required||t.optional||t.isBoolean()&&typeof t.defaultValue=="boolean")&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),t.presetArg!==void 0&&t.optional&&r.push(`preset: ${JSON.stringify(t.presetArg)}`),t.envVar!==void 0&&r.push(`env: ${t.envVar}`),r.length>0?`${t.description} (${r.join(", ")})`:t.description}argumentDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(o=>JSON.stringify(o)).join(", ")}`),t.defaultValue!==void 0&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),r.length>0){let o=`(${r.join(", ")})`;return t.description?`${t.description} ${o}`:o}return t.description}formatHelp(t,r){let o=r.padWidth(t,r),i=r.helpWidth??80;function a(E,S){return r.formatItem(E,o,S,r)}let c=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(t))}`,""],u=r.commandDescription(t);u.length>0&&(c=c.concat([r.boxWrap(r.styleCommandDescription(u),i),""]));let l=r.visibleArguments(t).map(E=>a(r.styleArgumentTerm(r.argumentTerm(E)),r.styleArgumentDescription(r.argumentDescription(E))));l.length>0&&(c=c.concat([r.styleTitle("Arguments:"),...l,""]));let f=r.visibleOptions(t).map(E=>a(r.styleOptionTerm(r.optionTerm(E)),r.styleOptionDescription(r.optionDescription(E))));if(f.length>0&&(c=c.concat([r.styleTitle("Options:"),...f,""])),r.showGlobalOptions){let E=r.visibleGlobalOptions(t).map(S=>a(r.styleOptionTerm(r.optionTerm(S)),r.styleOptionDescription(r.optionDescription(S))));E.length>0&&(c=c.concat([r.styleTitle("Global Options:"),...E,""]))}let y=r.visibleCommands(t).map(E=>a(r.styleSubcommandTerm(r.subcommandTerm(E)),r.styleSubcommandDescription(r.subcommandDescription(E))));return y.length>0&&(c=c.concat([r.styleTitle("Commands:"),...y,""])),c.join(`
3
- `)}displayWidth(t){return jl(t).length}styleTitle(t){return t}styleUsage(t){return t.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r==="[command]"?this.styleSubcommandText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleCommandText(r)).join(" ")}styleCommandDescription(t){return this.styleDescriptionText(t)}styleOptionDescription(t){return this.styleDescriptionText(t)}styleSubcommandDescription(t){return this.styleDescriptionText(t)}styleArgumentDescription(t){return this.styleDescriptionText(t)}styleDescriptionText(t){return t}styleOptionTerm(t){return this.styleOptionText(t)}styleSubcommandTerm(t){return t.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleSubcommandText(r)).join(" ")}styleArgumentTerm(t){return this.styleArgumentText(t)}styleOptionText(t){return t}styleArgumentText(t){return t}styleSubcommandText(t){return t}styleCommandText(t){return t}padWidth(t,r){return Math.max(r.longestOptionTermLength(t,r),r.longestGlobalOptionTermLength(t,r),r.longestSubcommandTermLength(t,r),r.longestArgumentTermLength(t,r))}preformatted(t){return/\n[^\S\r\n]/.test(t)}formatItem(t,r,o,i){let c=" ".repeat(2);if(!o)return c+t;let u=t.padEnd(r+t.length-i.displayWidth(t)),l=2,y=(this.helpWidth??80)-r-l-2,E;return y<this.minWidthToWrap||i.preformatted(o)?E=o:E=i.boxWrap(o,y).replace(/\n/g,`
4
- `+" ".repeat(r+l)),c+u+" ".repeat(l)+E.replace(/\n/g,`
5
- ${c}`)}boxWrap(t,r){if(r<this.minWidthToWrap)return t;let o=t.split(/\r\n|\n/),i=/[\s]*[^\s]+/g,a=[];return o.forEach(c=>{let u=c.match(i);if(u===null){a.push("");return}let l=[u.shift()],f=this.displayWidth(l[0]);u.forEach(y=>{let E=this.displayWidth(y);if(f+E<=r){l.push(y),f+=E;return}a.push(l.join(""));let S=y.trimStart();l=[S],f=this.displayWidth(S)}),a.push(l.join(""))}),a.join(`
6
- `)}};function jl(e){let t=/\x1b\[\d*(;\d*)*m/g;return e.replace(t,"")}Bc.Help=Fc;Bc.stripColor=jl});var Vc=Jr(zc=>{var{InvalidArgumentError:GC}=Vo(),Hc=class{constructor(t,r){this.flags=t,this.description=r||"",this.required=t.includes("<"),this.optional=t.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(t),this.mandatory=!1;let o=jC(t);this.short=o.shortFlag,this.long=o.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}preset(t){return this.presetArg=t,this}conflicts(t){return this.conflictsWith=this.conflictsWith.concat(t),this}implies(t){let r=t;return typeof t=="string"&&(r={[t]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(t){return this.envVar=t,this}argParser(t){return this.parseArg=t,this}makeOptionMandatory(t=!0){return this.mandatory=!!t,this}hideHelp(t=!0){return this.hidden=!!t,this}_concatValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:r.concat(t)}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,o)=>{if(!this.argChoices.includes(r))throw new GC(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,o):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?Fl(this.name().replace(/^no-/,"")):Fl(this.name())}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}},Kc=class{constructor(t){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,t.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,o)=>{this.positiveOptions.has(o)&&this.dualOptions.add(o)})}valueFromOption(t,r){let o=r.attributeName();if(!this.dualOptions.has(o))return!0;let i=this.negativeOptions.get(o).presetArg,a=i!==void 0?i:!1;return r.negate===(a===t)}};function Fl(e){return e.split("-").reduce((t,r)=>t+r[0].toUpperCase()+r.slice(1))}function jC(e){let t,r,o=/^-[^-]$/,i=/^--[^-]/,a=e.split(/[ |,]+/).concat("guard");if(o.test(a[0])&&(t=a.shift()),i.test(a[0])&&(r=a.shift()),!t&&o.test(a[0])&&(t=a.shift()),!t&&i.test(a[0])&&(t=r,r=a.shift()),a[0].startsWith("-")){let c=a[0],u=`option creation failed due to '${c}' in option flags '${e}'`;throw/^-[^-][^-]/.test(c)?new Error(`${u}
2
+ "use strict";var EU=Object.create;var gp=Object.defineProperty;var IU=Object.getOwnPropertyDescriptor;var _U=Object.getOwnPropertyNames;var bU=Object.getPrototypeOf,SU=Object.prototype.hasOwnProperty;var dn=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Lt=(e,t)=>{for(var n in t)gp(e,n,{get:t[n],enumerable:!0})},OU=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of _U(t))!SU.call(e,i)&&i!==n&&gp(e,i,{get:()=>t[i],enumerable:!(o=IU(t,i))||o.enumerable});return e};var Nd=(e,t,n)=>(n=e!=null?EU(bU(e)):{},OU(t||!e||!e.__esModule?gp(n,"default",{value:e,enumerable:!0}):n,e));var mi=dn(hp=>{var gs=class extends Error{constructor(t,n,o){super(o),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=n,this.exitCode=t,this.nestedError=void 0}},yp=class extends gs{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};hp.CommanderError=gs;hp.InvalidArgumentError=yp});var ys=dn(Ep=>{var{InvalidArgumentError:AU}=mi(),Tp=class{constructor(t,n){switch(this.description=n||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,t[0]){case"<":this.required=!0,this._name=t.slice(1,-1);break;case"[":this.required=!1,this._name=t.slice(1,-1);break;default:this.required=!0,this._name=t;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(t,n){return n===this.defaultValue||!Array.isArray(n)?[t]:n.concat(t)}default(t,n){return this.defaultValue=t,this.defaultValueDescription=n,this}argParser(t){return this.parseArg=t,this}choices(t){return this.argChoices=t.slice(),this.parseArg=(n,o)=>{if(!this.argChoices.includes(n))throw new AU(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(n,o):n},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function xU(e){let t=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+t+">":"["+t+"]"}Ep.Argument=Tp;Ep.humanReadableArgName=xU});var bp=dn(_p=>{var{humanReadableArgName:RU}=ys(),Ip=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(t){this.helpWidth=this.helpWidth??t.helpWidth??80}visibleCommands(t){let n=t.commands.filter(i=>!i._hidden),o=t._getHelpCommand();return o&&!o._hidden&&n.push(o),this.sortSubcommands&&n.sort((i,a)=>i.name().localeCompare(a.name())),n}compareOptions(t,n){let o=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return o(t).localeCompare(o(n))}visibleOptions(t){let n=t.options.filter(i=>!i.hidden),o=t._getHelpOption();if(o&&!o.hidden){let i=o.short&&t._findOption(o.short),a=o.long&&t._findOption(o.long);!i&&!a?n.push(o):o.long&&!a?n.push(t.createOption(o.long,o.description)):o.short&&!i&&n.push(t.createOption(o.short,o.description))}return this.sortOptions&&n.sort(this.compareOptions),n}visibleGlobalOptions(t){if(!this.showGlobalOptions)return[];let n=[];for(let o=t.parent;o;o=o.parent){let i=o.options.filter(a=>!a.hidden);n.push(...i)}return this.sortOptions&&n.sort(this.compareOptions),n}visibleArguments(t){return t._argsDescription&&t.registeredArguments.forEach(n=>{n.description=n.description||t._argsDescription[n.name()]||""}),t.registeredArguments.find(n=>n.description)?t.registeredArguments:[]}subcommandTerm(t){let n=t.registeredArguments.map(o=>RU(o)).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(n?" "+n:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,n){return n.visibleCommands(t).reduce((o,i)=>Math.max(o,this.displayWidth(n.styleSubcommandTerm(n.subcommandTerm(i)))),0)}longestOptionTermLength(t,n){return n.visibleOptions(t).reduce((o,i)=>Math.max(o,this.displayWidth(n.styleOptionTerm(n.optionTerm(i)))),0)}longestGlobalOptionTermLength(t,n){return n.visibleGlobalOptions(t).reduce((o,i)=>Math.max(o,this.displayWidth(n.styleOptionTerm(n.optionTerm(i)))),0)}longestArgumentTermLength(t,n){return n.visibleArguments(t).reduce((o,i)=>Math.max(o,this.displayWidth(n.styleArgumentTerm(n.argumentTerm(i)))),0)}commandUsage(t){let n=t._name;t._aliases[0]&&(n=n+"|"+t._aliases[0]);let o="";for(let i=t.parent;i;i=i.parent)o=i.name()+" "+o;return o+n+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.summary()||t.description()}optionDescription(t){let n=[];return t.argChoices&&n.push(`choices: ${t.argChoices.map(o=>JSON.stringify(o)).join(", ")}`),t.defaultValue!==void 0&&(t.required||t.optional||t.isBoolean()&&typeof t.defaultValue=="boolean")&&n.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),t.presetArg!==void 0&&t.optional&&n.push(`preset: ${JSON.stringify(t.presetArg)}`),t.envVar!==void 0&&n.push(`env: ${t.envVar}`),n.length>0?`${t.description} (${n.join(", ")})`:t.description}argumentDescription(t){let n=[];if(t.argChoices&&n.push(`choices: ${t.argChoices.map(o=>JSON.stringify(o)).join(", ")}`),t.defaultValue!==void 0&&n.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),n.length>0){let o=`(${n.join(", ")})`;return t.description?`${t.description} ${o}`:o}return t.description}formatHelp(t,n){let o=n.padWidth(t,n),i=n.helpWidth??80;function a(T,A){return n.formatItem(T,o,A,n)}let c=[`${n.styleTitle("Usage:")} ${n.styleUsage(n.commandUsage(t))}`,""],m=n.commandDescription(t);m.length>0&&(c=c.concat([n.boxWrap(n.styleCommandDescription(m),i),""]));let l=n.visibleArguments(t).map(T=>a(n.styleArgumentTerm(n.argumentTerm(T)),n.styleArgumentDescription(n.argumentDescription(T))));l.length>0&&(c=c.concat([n.styleTitle("Arguments:"),...l,""]));let f=n.visibleOptions(t).map(T=>a(n.styleOptionTerm(n.optionTerm(T)),n.styleOptionDescription(n.optionDescription(T))));if(f.length>0&&(c=c.concat([n.styleTitle("Options:"),...f,""])),n.showGlobalOptions){let T=n.visibleGlobalOptions(t).map(A=>a(n.styleOptionTerm(n.optionTerm(A)),n.styleOptionDescription(n.optionDescription(A))));T.length>0&&(c=c.concat([n.styleTitle("Global Options:"),...T,""]))}let y=n.visibleCommands(t).map(T=>a(n.styleSubcommandTerm(n.subcommandTerm(T)),n.styleSubcommandDescription(n.subcommandDescription(T))));return y.length>0&&(c=c.concat([n.styleTitle("Commands:"),...y,""])),c.join(`
3
+ `)}displayWidth(t){return Ld(t).length}styleTitle(t){return t}styleUsage(t){return t.split(" ").map(n=>n==="[options]"?this.styleOptionText(n):n==="[command]"?this.styleSubcommandText(n):n[0]==="["||n[0]==="<"?this.styleArgumentText(n):this.styleCommandText(n)).join(" ")}styleCommandDescription(t){return this.styleDescriptionText(t)}styleOptionDescription(t){return this.styleDescriptionText(t)}styleSubcommandDescription(t){return this.styleDescriptionText(t)}styleArgumentDescription(t){return this.styleDescriptionText(t)}styleDescriptionText(t){return t}styleOptionTerm(t){return this.styleOptionText(t)}styleSubcommandTerm(t){return t.split(" ").map(n=>n==="[options]"?this.styleOptionText(n):n[0]==="["||n[0]==="<"?this.styleArgumentText(n):this.styleSubcommandText(n)).join(" ")}styleArgumentTerm(t){return this.styleArgumentText(t)}styleOptionText(t){return t}styleArgumentText(t){return t}styleSubcommandText(t){return t}styleCommandText(t){return t}padWidth(t,n){return Math.max(n.longestOptionTermLength(t,n),n.longestGlobalOptionTermLength(t,n),n.longestSubcommandTermLength(t,n),n.longestArgumentTermLength(t,n))}preformatted(t){return/\n[^\S\r\n]/.test(t)}formatItem(t,n,o,i){let c=" ".repeat(2);if(!o)return c+t;let m=t.padEnd(n+t.length-i.displayWidth(t)),l=2,y=(this.helpWidth??80)-n-l-2,T;return y<this.minWidthToWrap||i.preformatted(o)?T=o:T=i.boxWrap(o,y).replace(/\n/g,`
4
+ `+" ".repeat(n+l)),c+m+" ".repeat(l)+T.replace(/\n/g,`
5
+ ${c}`)}boxWrap(t,n){if(n<this.minWidthToWrap)return t;let o=t.split(/\r\n|\n/),i=/[\s]*[^\s]+/g,a=[];return o.forEach(c=>{let m=c.match(i);if(m===null){a.push("");return}let l=[m.shift()],f=this.displayWidth(l[0]);m.forEach(y=>{let T=this.displayWidth(y);if(f+T<=n){l.push(y),f+=T;return}a.push(l.join(""));let A=y.trimStart();l=[A],f=this.displayWidth(A)}),a.push(l.join(""))}),a.join(`
6
+ `)}};function Ld(e){let t=/\x1b\[\d*(;\d*)*m/g;return e.replace(t,"")}_p.Help=Ip;_p.stripColor=Ld});var xp=dn(Ap=>{var{InvalidArgumentError:CU}=mi(),Sp=class{constructor(t,n){this.flags=t,this.description=n||"",this.required=t.includes("<"),this.optional=t.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(t),this.mandatory=!1;let o=PU(t);this.short=o.shortFlag,this.long=o.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(t,n){return this.defaultValue=t,this.defaultValueDescription=n,this}preset(t){return this.presetArg=t,this}conflicts(t){return this.conflictsWith=this.conflictsWith.concat(t),this}implies(t){let n=t;return typeof t=="string"&&(n={[t]:!0}),this.implied=Object.assign(this.implied||{},n),this}env(t){return this.envVar=t,this}argParser(t){return this.parseArg=t,this}makeOptionMandatory(t=!0){return this.mandatory=!!t,this}hideHelp(t=!0){return this.hidden=!!t,this}_concatValue(t,n){return n===this.defaultValue||!Array.isArray(n)?[t]:n.concat(t)}choices(t){return this.argChoices=t.slice(),this.parseArg=(n,o)=>{if(!this.argChoices.includes(n))throw new CU(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(n,o):n},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?kd(this.name().replace(/^no-/,"")):kd(this.name())}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}},Op=class{constructor(t){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,t.forEach(n=>{n.negate?this.negativeOptions.set(n.attributeName(),n):this.positiveOptions.set(n.attributeName(),n)}),this.negativeOptions.forEach((n,o)=>{this.positiveOptions.has(o)&&this.dualOptions.add(o)})}valueFromOption(t,n){let o=n.attributeName();if(!this.dualOptions.has(o))return!0;let i=this.negativeOptions.get(o).presetArg,a=i!==void 0?i:!1;return n.negate===(a===t)}};function kd(e){return e.split("-").reduce((t,n)=>t+n[0].toUpperCase()+n.slice(1))}function PU(e){let t,n,o=/^-[^-]$/,i=/^--[^-]/,a=e.split(/[ |,]+/).concat("guard");if(o.test(a[0])&&(t=a.shift()),i.test(a[0])&&(n=a.shift()),!t&&o.test(a[0])&&(t=a.shift()),!t&&i.test(a[0])&&(t=n,n=a.shift()),a[0].startsWith("-")){let c=a[0],m=`option creation failed due to '${c}' in option flags '${e}'`;throw/^-[^-][^-]/.test(c)?new Error(`${m}
7
7
  - a short flag is a single dash and a single character
8
8
  - either use a single dash and a single character (for a short flag)
9
- - or use a double dash for a long option (and can have two, like '--ws, --workspace')`):o.test(c)?new Error(`${u}
10
- - too many short flags`):i.test(c)?new Error(`${u}
11
- - too many long flags`):new Error(`${u}
12
- - unrecognised flag format`)}if(t===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:r}}zc.Option=Hc;zc.DualOptions=Kc});var ql=Jr(Bl=>{function FC(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let r=[];for(let o=0;o<=e.length;o++)r[o]=[o];for(let o=0;o<=t.length;o++)r[0][o]=o;for(let o=1;o<=t.length;o++)for(let i=1;i<=e.length;i++){let a=1;e[i-1]===t[o-1]?a=0:a=1,r[i][o]=Math.min(r[i-1][o]+1,r[i][o-1]+1,r[i-1][o-1]+a),i>1&&o>1&&e[i-1]===t[o-2]&&e[i-2]===t[o-1]&&(r[i][o]=Math.min(r[i][o],r[i-2][o-2]+1))}return r[e.length][t.length]}function BC(e,t){if(!t||t.length===0)return"";t=Array.from(new Set(t));let r=e.startsWith("--");r&&(e=e.slice(2),t=t.map(c=>c.slice(2)));let o=[],i=3,a=.4;return t.forEach(c=>{if(c.length<=1)return;let u=FC(e,c),l=Math.max(e.length,c.length);(l-u)/l>a&&(u<i?(i=u,o=[c]):u===i&&o.push(c))}),o.sort((c,u)=>c.localeCompare(u)),r&&(o=o.map(c=>`--${c}`)),o.length>1?`
9
+ - or use a double dash for a long option (and can have two, like '--ws, --workspace')`):o.test(c)?new Error(`${m}
10
+ - too many short flags`):i.test(c)?new Error(`${m}
11
+ - too many long flags`):new Error(`${m}
12
+ - unrecognised flag format`)}if(t===void 0&&n===void 0)throw new Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:n}}Ap.Option=Sp;Ap.DualOptions=Op});var Md=dn(vd=>{function UU(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let n=[];for(let o=0;o<=e.length;o++)n[o]=[o];for(let o=0;o<=t.length;o++)n[0][o]=o;for(let o=1;o<=t.length;o++)for(let i=1;i<=e.length;i++){let a=1;e[i-1]===t[o-1]?a=0:a=1,n[i][o]=Math.min(n[i-1][o]+1,n[i][o-1]+1,n[i-1][o-1]+a),i>1&&o>1&&e[i-1]===t[o-2]&&e[i-2]===t[o-1]&&(n[i][o]=Math.min(n[i][o],n[i-2][o-2]+1))}return n[e.length][t.length]}function wU(e,t){if(!t||t.length===0)return"";t=Array.from(new Set(t));let n=e.startsWith("--");n&&(e=e.slice(2),t=t.map(c=>c.slice(2)));let o=[],i=3,a=.4;return t.forEach(c=>{if(c.length<=1)return;let m=UU(e,c),l=Math.max(e.length,c.length);(l-m)/l>a&&(m<i?(i=m,o=[c]):m===i&&o.push(c))}),o.sort((c,m)=>c.localeCompare(m)),n&&(o=o.map(c=>`--${c}`)),o.length>1?`
13
13
  (Did you mean one of ${o.join(", ")}?)`:o.length===1?`
14
- (Did you mean ${o[0]}?)`:""}Bl.suggestSimilar=BC});var Vl=Jr(Xc=>{var qC=require("node:events").EventEmitter,Yc=require("node:child_process"),nr=require("node:path"),Fa=require("node:fs"),se=require("node:process"),{Argument:HC,humanReadableArgName:KC}=ja(),{CommanderError:Qc}=Vo(),{Help:zC,stripColor:VC}=qc(),{Option:Hl,DualOptions:YC}=Vc(),{suggestSimilar:Kl}=ql(),Wc=class e extends qC{constructor(t){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=t||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:r=>se.stdout.write(r),writeErr:r=>se.stderr.write(r),outputError:(r,o)=>o(r),getOutHelpWidth:()=>se.stdout.isTTY?se.stdout.columns:void 0,getErrHelpWidth:()=>se.stderr.isTTY?se.stderr.columns:void 0,getOutHasColors:()=>Zc()??(se.stdout.isTTY&&se.stdout.hasColors?.()),getErrHasColors:()=>Zc()??(se.stderr.isTTY&&se.stderr.hasColors?.()),stripColor:r=>VC(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(t){return this._outputConfiguration=t._outputConfiguration,this._helpOption=t._helpOption,this._helpCommand=t._helpCommand,this._helpConfiguration=t._helpConfiguration,this._exitCallback=t._exitCallback,this._storeOptionsAsProperties=t._storeOptionsAsProperties,this._combineFlagAndOptionalValue=t._combineFlagAndOptionalValue,this._allowExcessArguments=t._allowExcessArguments,this._enablePositionalOptions=t._enablePositionalOptions,this._showHelpAfterError=t._showHelpAfterError,this._showSuggestionAfterError=t._showSuggestionAfterError,this}_getCommandAndAncestors(){let t=[];for(let r=this;r;r=r.parent)t.push(r);return t}command(t,r,o){let i=r,a=o;typeof i=="object"&&i!==null&&(a=i,i=null),a=a||{};let[,c,u]=t.match(/([^ ]+) *(.*)/),l=this.createCommand(c);return i&&(l.description(i),l._executableHandler=!0),a.isDefault&&(this._defaultCommandName=l._name),l._hidden=!!(a.noHelp||a.hidden),l._executableFile=a.executableFile||null,u&&l.arguments(u),this._registerCommand(l),l.parent=this,l.copyInheritedSettings(this),i?this:l}createCommand(t){return new e(t)}createHelp(){return Object.assign(new zC,this.configureHelp())}configureHelp(t){return t===void 0?this._helpConfiguration:(this._helpConfiguration=t,this)}configureOutput(t){return t===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,t),this)}showHelpAfterError(t=!0){return typeof t!="string"&&(t=!!t),this._showHelpAfterError=t,this}showSuggestionAfterError(t=!0){return this._showSuggestionAfterError=!!t,this}addCommand(t,r){if(!t._name)throw new Error(`Command passed to .addCommand() must have a name
15
- - specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=t._name),(r.noHelp||r.hidden)&&(t._hidden=!0),this._registerCommand(t),t.parent=this,t._checkForBrokenPassThrough(),this}createArgument(t,r){return new HC(t,r)}argument(t,r,o,i){let a=this.createArgument(t,r);return typeof o=="function"?a.default(i).argParser(o):a.default(o),this.addArgument(a),this}arguments(t){return t.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(t){let r=this.registeredArguments.slice(-1)[0];if(r&&r.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(t.required&&t.defaultValue!==void 0&&t.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${t.name()}'`);return this.registeredArguments.push(t),this}helpCommand(t,r){if(typeof t=="boolean")return this._addImplicitHelpCommand=t,this;t=t??"help [command]";let[,o,i]=t.match(/([^ ]+) *(.*)/),a=r??"display help for command",c=this.createCommand(o);return c.helpOption(!1),i&&c.arguments(i),a&&c.description(a),this._addImplicitHelpCommand=!0,this._helpCommand=c,this}addHelpCommand(t,r){return typeof t!="object"?(this.helpCommand(t,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=t,this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(t,r){let o=["preSubcommand","preAction","postAction"];if(!o.includes(t))throw new Error(`Unexpected value for event passed to hook : '${t}'.
16
- Expecting one of '${o.join("', '")}'`);return this._lifeCycleHooks[t]?this._lifeCycleHooks[t].push(r):this._lifeCycleHooks[t]=[r],this}exitOverride(t){return t?this._exitCallback=t:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(t,r,o){this._exitCallback&&this._exitCallback(new Qc(t,r,o)),se.exit(t)}action(t){let r=o=>{let i=this.registeredArguments.length,a=o.slice(0,i);return this._storeOptionsAsProperties?a[i]=this:a[i]=this.opts(),a.push(this),t.apply(this,a)};return this._actionHandler=r,this}createOption(t,r){return new Hl(t,r)}_callParseArg(t,r,o,i){try{return t.parseArg(r,o)}catch(a){if(a.code==="commander.invalidArgument"){let c=`${i} ${a.message}`;this.error(c,{exitCode:a.exitCode,code:a.code})}throw a}}_registerOption(t){let r=t.short&&this._findOption(t.short)||t.long&&this._findOption(t.long);if(r){let o=t.long&&this._findOption(t.long)?t.long:t.short;throw new Error(`Cannot add option '${t.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${o}'
17
- - already used by option '${r.flags}'`)}this.options.push(t)}_registerCommand(t){let r=i=>[i.name()].concat(i.aliases()),o=r(t).find(i=>this._findCommand(i));if(o){let i=r(this._findCommand(o)).join("|"),a=r(t).join("|");throw new Error(`cannot add command '${a}' as already have command '${i}'`)}this.commands.push(t)}addOption(t){this._registerOption(t);let r=t.name(),o=t.attributeName();if(t.negate){let a=t.long.replace(/^--no-/,"--");this._findOption(a)||this.setOptionValueWithSource(o,t.defaultValue===void 0?!0:t.defaultValue,"default")}else t.defaultValue!==void 0&&this.setOptionValueWithSource(o,t.defaultValue,"default");let i=(a,c,u)=>{a==null&&t.presetArg!==void 0&&(a=t.presetArg);let l=this.getOptionValue(o);a!==null&&t.parseArg?a=this._callParseArg(t,a,l,c):a!==null&&t.variadic&&(a=t._concatValue(a,l)),a==null&&(t.negate?a=!1:t.isBoolean()||t.optional?a=!0:a=""),this.setOptionValueWithSource(o,a,u)};return this.on("option:"+r,a=>{let c=`error: option '${t.flags}' argument '${a}' is invalid.`;i(a,c,"cli")}),t.envVar&&this.on("optionEnv:"+r,a=>{let c=`error: option '${t.flags}' value '${a}' from env '${t.envVar}' is invalid.`;i(a,c,"env")}),this}_optionEx(t,r,o,i,a){if(typeof r=="object"&&r instanceof Hl)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let c=this.createOption(r,o);if(c.makeOptionMandatory(!!t.mandatory),typeof i=="function")c.default(a).argParser(i);else if(i instanceof RegExp){let u=i;i=(l,f)=>{let y=u.exec(l);return y?y[0]:f},c.default(a).argParser(i)}else c.default(i);return this.addOption(c)}option(t,r,o,i){return this._optionEx({},t,r,o,i)}requiredOption(t,r,o,i){return this._optionEx({mandatory:!0},t,r,o,i)}combineFlagAndOptionalValue(t=!0){return this._combineFlagAndOptionalValue=!!t,this}allowUnknownOption(t=!0){return this._allowUnknownOption=!!t,this}allowExcessArguments(t=!0){return this._allowExcessArguments=!!t,this}enablePositionalOptions(t=!0){return this._enablePositionalOptions=!!t,this}passThroughOptions(t=!0){return this._passThroughOptions=!!t,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(t=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!t,this}getOptionValue(t){return this._storeOptionsAsProperties?this[t]:this._optionValues[t]}setOptionValue(t,r){return this.setOptionValueWithSource(t,r,void 0)}setOptionValueWithSource(t,r,o){return this._storeOptionsAsProperties?this[t]=r:this._optionValues[t]=r,this._optionValueSources[t]=o,this}getOptionValueSource(t){return this._optionValueSources[t]}getOptionValueSourceWithGlobals(t){let r;return this._getCommandAndAncestors().forEach(o=>{o.getOptionValueSource(t)!==void 0&&(r=o.getOptionValueSource(t))}),r}_prepareUserArgs(t,r){if(t!==void 0&&!Array.isArray(t))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},t===void 0&&r.from===void 0){se.versions?.electron&&(r.from="electron");let i=se.execArgv??[];(i.includes("-e")||i.includes("--eval")||i.includes("-p")||i.includes("--print"))&&(r.from="eval")}t===void 0&&(t=se.argv),this.rawArgs=t.slice();let o;switch(r.from){case void 0:case"node":this._scriptPath=t[1],o=t.slice(2);break;case"electron":se.defaultApp?(this._scriptPath=t[1],o=t.slice(2)):o=t.slice(1);break;case"user":o=t.slice(0);break;case"eval":o=t.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",o}parse(t,r){this._prepareForParse();let o=this._prepareUserArgs(t,r);return this._parseCommand([],o),this}async parseAsync(t,r){this._prepareForParse();let o=this._prepareUserArgs(t,r);return await this._parseCommand([],o),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
18
- - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(t,r,o){if(Fa.existsSync(t))return;let i=r?`searched for local subcommand relative to directory '${r}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",a=`'${t}' does not exist
14
+ (Did you mean ${o[0]}?)`:""}vd.suggestSimilar=wU});var jd=dn(wp=>{var NU=require("node:events").EventEmitter,Rp=require("node:child_process"),pr=require("node:path"),hs=require("node:fs"),ce=require("node:process"),{Argument:LU,humanReadableArgName:kU}=ys(),{CommanderError:Cp}=mi(),{Help:vU,stripColor:MU}=bp(),{Option:Dd,DualOptions:DU}=xp(),{suggestSimilar:Gd}=Md(),Pp=class e extends NU{constructor(t){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=t||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:n=>ce.stdout.write(n),writeErr:n=>ce.stderr.write(n),outputError:(n,o)=>o(n),getOutHelpWidth:()=>ce.stdout.isTTY?ce.stdout.columns:void 0,getErrHelpWidth:()=>ce.stderr.isTTY?ce.stderr.columns:void 0,getOutHasColors:()=>Up()??(ce.stdout.isTTY&&ce.stdout.hasColors?.()),getErrHasColors:()=>Up()??(ce.stderr.isTTY&&ce.stderr.hasColors?.()),stripColor:n=>MU(n)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(t){return this._outputConfiguration=t._outputConfiguration,this._helpOption=t._helpOption,this._helpCommand=t._helpCommand,this._helpConfiguration=t._helpConfiguration,this._exitCallback=t._exitCallback,this._storeOptionsAsProperties=t._storeOptionsAsProperties,this._combineFlagAndOptionalValue=t._combineFlagAndOptionalValue,this._allowExcessArguments=t._allowExcessArguments,this._enablePositionalOptions=t._enablePositionalOptions,this._showHelpAfterError=t._showHelpAfterError,this._showSuggestionAfterError=t._showSuggestionAfterError,this}_getCommandAndAncestors(){let t=[];for(let n=this;n;n=n.parent)t.push(n);return t}command(t,n,o){let i=n,a=o;typeof i=="object"&&i!==null&&(a=i,i=null),a=a||{};let[,c,m]=t.match(/([^ ]+) *(.*)/),l=this.createCommand(c);return i&&(l.description(i),l._executableHandler=!0),a.isDefault&&(this._defaultCommandName=l._name),l._hidden=!!(a.noHelp||a.hidden),l._executableFile=a.executableFile||null,m&&l.arguments(m),this._registerCommand(l),l.parent=this,l.copyInheritedSettings(this),i?this:l}createCommand(t){return new e(t)}createHelp(){return Object.assign(new vU,this.configureHelp())}configureHelp(t){return t===void 0?this._helpConfiguration:(this._helpConfiguration=t,this)}configureOutput(t){return t===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,t),this)}showHelpAfterError(t=!0){return typeof t!="string"&&(t=!!t),this._showHelpAfterError=t,this}showSuggestionAfterError(t=!0){return this._showSuggestionAfterError=!!t,this}addCommand(t,n){if(!t._name)throw new Error(`Command passed to .addCommand() must have a name
15
+ - specify the name in Command constructor or using .name()`);return n=n||{},n.isDefault&&(this._defaultCommandName=t._name),(n.noHelp||n.hidden)&&(t._hidden=!0),this._registerCommand(t),t.parent=this,t._checkForBrokenPassThrough(),this}createArgument(t,n){return new LU(t,n)}argument(t,n,o,i){let a=this.createArgument(t,n);return typeof o=="function"?a.default(i).argParser(o):a.default(o),this.addArgument(a),this}arguments(t){return t.trim().split(/ +/).forEach(n=>{this.argument(n)}),this}addArgument(t){let n=this.registeredArguments.slice(-1)[0];if(n&&n.variadic)throw new Error(`only the last argument can be variadic '${n.name()}'`);if(t.required&&t.defaultValue!==void 0&&t.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${t.name()}'`);return this.registeredArguments.push(t),this}helpCommand(t,n){if(typeof t=="boolean")return this._addImplicitHelpCommand=t,this;t=t??"help [command]";let[,o,i]=t.match(/([^ ]+) *(.*)/),a=n??"display help for command",c=this.createCommand(o);return c.helpOption(!1),i&&c.arguments(i),a&&c.description(a),this._addImplicitHelpCommand=!0,this._helpCommand=c,this}addHelpCommand(t,n){return typeof t!="object"?(this.helpCommand(t,n),this):(this._addImplicitHelpCommand=!0,this._helpCommand=t,this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(t,n){let o=["preSubcommand","preAction","postAction"];if(!o.includes(t))throw new Error(`Unexpected value for event passed to hook : '${t}'.
16
+ Expecting one of '${o.join("', '")}'`);return this._lifeCycleHooks[t]?this._lifeCycleHooks[t].push(n):this._lifeCycleHooks[t]=[n],this}exitOverride(t){return t?this._exitCallback=t:this._exitCallback=n=>{if(n.code!=="commander.executeSubCommandAsync")throw n},this}_exit(t,n,o){this._exitCallback&&this._exitCallback(new Cp(t,n,o)),ce.exit(t)}action(t){let n=o=>{let i=this.registeredArguments.length,a=o.slice(0,i);return this._storeOptionsAsProperties?a[i]=this:a[i]=this.opts(),a.push(this),t.apply(this,a)};return this._actionHandler=n,this}createOption(t,n){return new Dd(t,n)}_callParseArg(t,n,o,i){try{return t.parseArg(n,o)}catch(a){if(a.code==="commander.invalidArgument"){let c=`${i} ${a.message}`;this.error(c,{exitCode:a.exitCode,code:a.code})}throw a}}_registerOption(t){let n=t.short&&this._findOption(t.short)||t.long&&this._findOption(t.long);if(n){let o=t.long&&this._findOption(t.long)?t.long:t.short;throw new Error(`Cannot add option '${t.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${o}'
17
+ - already used by option '${n.flags}'`)}this.options.push(t)}_registerCommand(t){let n=i=>[i.name()].concat(i.aliases()),o=n(t).find(i=>this._findCommand(i));if(o){let i=n(this._findCommand(o)).join("|"),a=n(t).join("|");throw new Error(`cannot add command '${a}' as already have command '${i}'`)}this.commands.push(t)}addOption(t){this._registerOption(t);let n=t.name(),o=t.attributeName();if(t.negate){let a=t.long.replace(/^--no-/,"--");this._findOption(a)||this.setOptionValueWithSource(o,t.defaultValue===void 0?!0:t.defaultValue,"default")}else t.defaultValue!==void 0&&this.setOptionValueWithSource(o,t.defaultValue,"default");let i=(a,c,m)=>{a==null&&t.presetArg!==void 0&&(a=t.presetArg);let l=this.getOptionValue(o);a!==null&&t.parseArg?a=this._callParseArg(t,a,l,c):a!==null&&t.variadic&&(a=t._concatValue(a,l)),a==null&&(t.negate?a=!1:t.isBoolean()||t.optional?a=!0:a=""),this.setOptionValueWithSource(o,a,m)};return this.on("option:"+n,a=>{let c=`error: option '${t.flags}' argument '${a}' is invalid.`;i(a,c,"cli")}),t.envVar&&this.on("optionEnv:"+n,a=>{let c=`error: option '${t.flags}' value '${a}' from env '${t.envVar}' is invalid.`;i(a,c,"env")}),this}_optionEx(t,n,o,i,a){if(typeof n=="object"&&n instanceof Dd)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let c=this.createOption(n,o);if(c.makeOptionMandatory(!!t.mandatory),typeof i=="function")c.default(a).argParser(i);else if(i instanceof RegExp){let m=i;i=(l,f)=>{let y=m.exec(l);return y?y[0]:f},c.default(a).argParser(i)}else c.default(i);return this.addOption(c)}option(t,n,o,i){return this._optionEx({},t,n,o,i)}requiredOption(t,n,o,i){return this._optionEx({mandatory:!0},t,n,o,i)}combineFlagAndOptionalValue(t=!0){return this._combineFlagAndOptionalValue=!!t,this}allowUnknownOption(t=!0){return this._allowUnknownOption=!!t,this}allowExcessArguments(t=!0){return this._allowExcessArguments=!!t,this}enablePositionalOptions(t=!0){return this._enablePositionalOptions=!!t,this}passThroughOptions(t=!0){return this._passThroughOptions=!!t,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(t=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!t,this}getOptionValue(t){return this._storeOptionsAsProperties?this[t]:this._optionValues[t]}setOptionValue(t,n){return this.setOptionValueWithSource(t,n,void 0)}setOptionValueWithSource(t,n,o){return this._storeOptionsAsProperties?this[t]=n:this._optionValues[t]=n,this._optionValueSources[t]=o,this}getOptionValueSource(t){return this._optionValueSources[t]}getOptionValueSourceWithGlobals(t){let n;return this._getCommandAndAncestors().forEach(o=>{o.getOptionValueSource(t)!==void 0&&(n=o.getOptionValueSource(t))}),n}_prepareUserArgs(t,n){if(t!==void 0&&!Array.isArray(t))throw new Error("first parameter to parse must be array or undefined");if(n=n||{},t===void 0&&n.from===void 0){ce.versions?.electron&&(n.from="electron");let i=ce.execArgv??[];(i.includes("-e")||i.includes("--eval")||i.includes("-p")||i.includes("--print"))&&(n.from="eval")}t===void 0&&(t=ce.argv),this.rawArgs=t.slice();let o;switch(n.from){case void 0:case"node":this._scriptPath=t[1],o=t.slice(2);break;case"electron":ce.defaultApp?(this._scriptPath=t[1],o=t.slice(2)):o=t.slice(1);break;case"user":o=t.slice(0);break;case"eval":o=t.slice(1);break;default:throw new Error(`unexpected parse option { from: '${n.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",o}parse(t,n){this._prepareForParse();let o=this._prepareUserArgs(t,n);return this._parseCommand([],o),this}async parseAsync(t,n){this._prepareForParse();let o=this._prepareUserArgs(t,n);return await this._parseCommand([],o),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
18
+ - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(t,n,o){if(hs.existsSync(t))return;let i=n?`searched for local subcommand relative to directory '${n}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",a=`'${t}' does not exist
19
19
  - if '${o}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
20
20
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
21
- - ${i}`;throw new Error(a)}_executeSubCommand(t,r){r=r.slice();let o=!1,i=[".js",".ts",".tsx",".mjs",".cjs"];function a(y,E){let S=nr.resolve(y,E);if(Fa.existsSync(S))return S;if(i.includes(nr.extname(E)))return;let fe=i.find(Re=>Fa.existsSync(`${S}${Re}`));if(fe)return`${S}${fe}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let c=t._executableFile||`${this._name}-${t._name}`,u=this._executableDir||"";if(this._scriptPath){let y;try{y=Fa.realpathSync(this._scriptPath)}catch{y=this._scriptPath}u=nr.resolve(nr.dirname(y),u)}if(u){let y=a(u,c);if(!y&&!t._executableFile&&this._scriptPath){let E=nr.basename(this._scriptPath,nr.extname(this._scriptPath));E!==this._name&&(y=a(u,`${E}-${t._name}`))}c=y||c}o=i.includes(nr.extname(c));let l;se.platform!=="win32"?o?(r.unshift(c),r=zl(se.execArgv).concat(r),l=Yc.spawn(se.argv[0],r,{stdio:"inherit"})):l=Yc.spawn(c,r,{stdio:"inherit"}):(this._checkForMissingExecutable(c,u,t._name),r.unshift(c),r=zl(se.execArgv).concat(r),l=Yc.spawn(se.execPath,r,{stdio:"inherit"})),l.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(E=>{se.on(E,()=>{l.killed===!1&&l.exitCode===null&&l.kill(E)})});let f=this._exitCallback;l.on("close",y=>{y=y??1,f?f(new Qc(y,"commander.executeSubCommandAsync","(close)")):se.exit(y)}),l.on("error",y=>{if(y.code==="ENOENT")this._checkForMissingExecutable(c,u,t._name);else if(y.code==="EACCES")throw new Error(`'${c}' not executable`);if(!f)se.exit(1);else{let E=new Qc(1,"commander.executeSubCommandAsync","(error)");E.nestedError=y,f(E)}}),this.runningCommand=l}_dispatchSubcommand(t,r,o){let i=this._findCommand(t);i||this.help({error:!0}),i._prepareForParse();let a;return a=this._chainOrCallSubCommandHook(a,i,"preSubcommand"),a=this._chainOrCall(a,()=>{if(i._executableHandler)this._executeSubCommand(i,r.concat(o));else return i._parseCommand(r,o)}),a}_dispatchHelpCommand(t){t||this.help();let r=this._findCommand(t);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(t,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((t,r)=>{t.required&&this.args[r]==null&&this.missingArgument(t.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let t=(o,i,a)=>{let c=i;if(i!==null&&o.parseArg){let u=`error: command-argument value '${i}' is invalid for argument '${o.name()}'.`;c=this._callParseArg(o,i,a,u)}return c};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((o,i)=>{let a=o.defaultValue;o.variadic?i<this.args.length?(a=this.args.slice(i),o.parseArg&&(a=a.reduce((c,u)=>t(o,u,c),o.defaultValue))):a===void 0&&(a=[]):i<this.args.length&&(a=this.args[i],o.parseArg&&(a=t(o,a,o.defaultValue))),r[i]=a}),this.processedArgs=r}_chainOrCall(t,r){return t&&t.then&&typeof t.then=="function"?t.then(()=>r()):r()}_chainOrCallHooks(t,r){let o=t,i=[];return this._getCommandAndAncestors().reverse().filter(a=>a._lifeCycleHooks[r]!==void 0).forEach(a=>{a._lifeCycleHooks[r].forEach(c=>{i.push({hookedCommand:a,callback:c})})}),r==="postAction"&&i.reverse(),i.forEach(a=>{o=this._chainOrCall(o,()=>a.callback(a.hookedCommand,this))}),o}_chainOrCallSubCommandHook(t,r,o){let i=t;return this._lifeCycleHooks[o]!==void 0&&this._lifeCycleHooks[o].forEach(a=>{i=this._chainOrCall(i,()=>a(this,r))}),i}_parseCommand(t,r){let o=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),t=t.concat(o.operands),r=o.unknown,this.args=t.concat(r),t&&this._findCommand(t[0]))return this._dispatchSubcommand(t[0],t.slice(1),r);if(this._getHelpCommand()&&t[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(t[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,t,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(o.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=()=>{o.unknown.length>0&&this.unknownOption(o.unknown[0])},a=`command:${this.name()}`;if(this._actionHandler){i(),this._processArguments();let c;return c=this._chainOrCallHooks(c,"preAction"),c=this._chainOrCall(c,()=>this._actionHandler(this.processedArgs)),this.parent&&(c=this._chainOrCall(c,()=>{this.parent.emit(a,t,r)})),c=this._chainOrCallHooks(c,"postAction"),c}if(this.parent&&this.parent.listenerCount(a))i(),this._processArguments(),this.parent.emit(a,t,r);else if(t.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",t,r);this.listenerCount("command:*")?this.emit("command:*",t,r):this.commands.length?this.unknownCommand():(i(),this._processArguments())}else this.commands.length?(i(),this.help({error:!0})):(i(),this._processArguments())}_findCommand(t){if(t)return this.commands.find(r=>r._name===t||r._aliases.includes(t))}_findOption(t){return this.options.find(r=>r.is(t))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(t=>{t.options.forEach(r=>{r.mandatory&&t.getOptionValue(r.attributeName())===void 0&&t.missingMandatoryOptionValue(r)})})}_checkForConflictingLocalOptions(){let t=this.options.filter(o=>{let i=o.attributeName();return this.getOptionValue(i)===void 0?!1:this.getOptionValueSource(i)!=="default"});t.filter(o=>o.conflictsWith.length>0).forEach(o=>{let i=t.find(a=>o.conflictsWith.includes(a.attributeName()));i&&this._conflictingOption(o,i)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(t=>{t._checkForConflictingLocalOptions()})}parseOptions(t){let r=[],o=[],i=r,a=t.slice();function c(l){return l.length>1&&l[0]==="-"}let u=null;for(;a.length;){let l=a.shift();if(l==="--"){i===o&&i.push(l),i.push(...a);break}if(u&&!c(l)){this.emit(`option:${u.name()}`,l);continue}if(u=null,c(l)){let f=this._findOption(l);if(f){if(f.required){let y=a.shift();y===void 0&&this.optionMissingArgument(f),this.emit(`option:${f.name()}`,y)}else if(f.optional){let y=null;a.length>0&&!c(a[0])&&(y=a.shift()),this.emit(`option:${f.name()}`,y)}else this.emit(`option:${f.name()}`);u=f.variadic?f:null;continue}}if(l.length>2&&l[0]==="-"&&l[1]!=="-"){let f=this._findOption(`-${l[1]}`);if(f){f.required||f.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${f.name()}`,l.slice(2)):(this.emit(`option:${f.name()}`),a.unshift(`-${l.slice(2)}`));continue}}if(/^--[^=]+=/.test(l)){let f=l.indexOf("="),y=this._findOption(l.slice(0,f));if(y&&(y.required||y.optional)){this.emit(`option:${y.name()}`,l.slice(f+1));continue}}if(c(l)&&(i=o),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&o.length===0){if(this._findCommand(l)){r.push(l),a.length>0&&o.push(...a);break}else if(this._getHelpCommand()&&l===this._getHelpCommand().name()){r.push(l),a.length>0&&r.push(...a);break}else if(this._defaultCommandName){o.push(l),a.length>0&&o.push(...a);break}}if(this._passThroughOptions){i.push(l),a.length>0&&i.push(...a);break}i.push(l)}return{operands:r,unknown:o}}opts(){if(this._storeOptionsAsProperties){let t={},r=this.options.length;for(let o=0;o<r;o++){let i=this.options[o].attributeName();t[i]=i===this._versionOptionName?this._version:this[i]}return t}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((t,r)=>Object.assign(t,r.opts()),{})}error(t,r){this._outputConfiguration.outputError(`${t}
21
+ - ${i}`;throw new Error(a)}_executeSubCommand(t,n){n=n.slice();let o=!1,i=[".js",".ts",".tsx",".mjs",".cjs"];function a(y,T){let A=pr.resolve(y,T);if(hs.existsSync(A))return A;if(i.includes(pr.extname(T)))return;let ye=i.find(Ue=>hs.existsSync(`${A}${Ue}`));if(ye)return`${A}${ye}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let c=t._executableFile||`${this._name}-${t._name}`,m=this._executableDir||"";if(this._scriptPath){let y;try{y=hs.realpathSync(this._scriptPath)}catch{y=this._scriptPath}m=pr.resolve(pr.dirname(y),m)}if(m){let y=a(m,c);if(!y&&!t._executableFile&&this._scriptPath){let T=pr.basename(this._scriptPath,pr.extname(this._scriptPath));T!==this._name&&(y=a(m,`${T}-${t._name}`))}c=y||c}o=i.includes(pr.extname(c));let l;ce.platform!=="win32"?o?(n.unshift(c),n=$d(ce.execArgv).concat(n),l=Rp.spawn(ce.argv[0],n,{stdio:"inherit"})):l=Rp.spawn(c,n,{stdio:"inherit"}):(this._checkForMissingExecutable(c,m,t._name),n.unshift(c),n=$d(ce.execArgv).concat(n),l=Rp.spawn(ce.execPath,n,{stdio:"inherit"})),l.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(T=>{ce.on(T,()=>{l.killed===!1&&l.exitCode===null&&l.kill(T)})});let f=this._exitCallback;l.on("close",y=>{y=y??1,f?f(new Cp(y,"commander.executeSubCommandAsync","(close)")):ce.exit(y)}),l.on("error",y=>{if(y.code==="ENOENT")this._checkForMissingExecutable(c,m,t._name);else if(y.code==="EACCES")throw new Error(`'${c}' not executable`);if(!f)ce.exit(1);else{let T=new Cp(1,"commander.executeSubCommandAsync","(error)");T.nestedError=y,f(T)}}),this.runningCommand=l}_dispatchSubcommand(t,n,o){let i=this._findCommand(t);i||this.help({error:!0}),i._prepareForParse();let a;return a=this._chainOrCallSubCommandHook(a,i,"preSubcommand"),a=this._chainOrCall(a,()=>{if(i._executableHandler)this._executeSubCommand(i,n.concat(o));else return i._parseCommand(n,o)}),a}_dispatchHelpCommand(t){t||this.help();let n=this._findCommand(t);return n&&!n._executableHandler&&n.help(),this._dispatchSubcommand(t,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((t,n)=>{t.required&&this.args[n]==null&&this.missingArgument(t.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let t=(o,i,a)=>{let c=i;if(i!==null&&o.parseArg){let m=`error: command-argument value '${i}' is invalid for argument '${o.name()}'.`;c=this._callParseArg(o,i,a,m)}return c};this._checkNumberOfArguments();let n=[];this.registeredArguments.forEach((o,i)=>{let a=o.defaultValue;o.variadic?i<this.args.length?(a=this.args.slice(i),o.parseArg&&(a=a.reduce((c,m)=>t(o,m,c),o.defaultValue))):a===void 0&&(a=[]):i<this.args.length&&(a=this.args[i],o.parseArg&&(a=t(o,a,o.defaultValue))),n[i]=a}),this.processedArgs=n}_chainOrCall(t,n){return t&&t.then&&typeof t.then=="function"?t.then(()=>n()):n()}_chainOrCallHooks(t,n){let o=t,i=[];return this._getCommandAndAncestors().reverse().filter(a=>a._lifeCycleHooks[n]!==void 0).forEach(a=>{a._lifeCycleHooks[n].forEach(c=>{i.push({hookedCommand:a,callback:c})})}),n==="postAction"&&i.reverse(),i.forEach(a=>{o=this._chainOrCall(o,()=>a.callback(a.hookedCommand,this))}),o}_chainOrCallSubCommandHook(t,n,o){let i=t;return this._lifeCycleHooks[o]!==void 0&&this._lifeCycleHooks[o].forEach(a=>{i=this._chainOrCall(i,()=>a(this,n))}),i}_parseCommand(t,n){let o=this.parseOptions(n);if(this._parseOptionsEnv(),this._parseOptionsImplied(),t=t.concat(o.operands),n=o.unknown,this.args=t.concat(n),t&&this._findCommand(t[0]))return this._dispatchSubcommand(t[0],t.slice(1),n);if(this._getHelpCommand()&&t[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(t[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(n),this._dispatchSubcommand(this._defaultCommandName,t,n);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(o.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=()=>{o.unknown.length>0&&this.unknownOption(o.unknown[0])},a=`command:${this.name()}`;if(this._actionHandler){i(),this._processArguments();let c;return c=this._chainOrCallHooks(c,"preAction"),c=this._chainOrCall(c,()=>this._actionHandler(this.processedArgs)),this.parent&&(c=this._chainOrCall(c,()=>{this.parent.emit(a,t,n)})),c=this._chainOrCallHooks(c,"postAction"),c}if(this.parent&&this.parent.listenerCount(a))i(),this._processArguments(),this.parent.emit(a,t,n);else if(t.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",t,n);this.listenerCount("command:*")?this.emit("command:*",t,n):this.commands.length?this.unknownCommand():(i(),this._processArguments())}else this.commands.length?(i(),this.help({error:!0})):(i(),this._processArguments())}_findCommand(t){if(t)return this.commands.find(n=>n._name===t||n._aliases.includes(t))}_findOption(t){return this.options.find(n=>n.is(t))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(t=>{t.options.forEach(n=>{n.mandatory&&t.getOptionValue(n.attributeName())===void 0&&t.missingMandatoryOptionValue(n)})})}_checkForConflictingLocalOptions(){let t=this.options.filter(o=>{let i=o.attributeName();return this.getOptionValue(i)===void 0?!1:this.getOptionValueSource(i)!=="default"});t.filter(o=>o.conflictsWith.length>0).forEach(o=>{let i=t.find(a=>o.conflictsWith.includes(a.attributeName()));i&&this._conflictingOption(o,i)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(t=>{t._checkForConflictingLocalOptions()})}parseOptions(t){let n=[],o=[],i=n,a=t.slice();function c(l){return l.length>1&&l[0]==="-"}let m=null;for(;a.length;){let l=a.shift();if(l==="--"){i===o&&i.push(l),i.push(...a);break}if(m&&!c(l)){this.emit(`option:${m.name()}`,l);continue}if(m=null,c(l)){let f=this._findOption(l);if(f){if(f.required){let y=a.shift();y===void 0&&this.optionMissingArgument(f),this.emit(`option:${f.name()}`,y)}else if(f.optional){let y=null;a.length>0&&!c(a[0])&&(y=a.shift()),this.emit(`option:${f.name()}`,y)}else this.emit(`option:${f.name()}`);m=f.variadic?f:null;continue}}if(l.length>2&&l[0]==="-"&&l[1]!=="-"){let f=this._findOption(`-${l[1]}`);if(f){f.required||f.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${f.name()}`,l.slice(2)):(this.emit(`option:${f.name()}`),a.unshift(`-${l.slice(2)}`));continue}}if(/^--[^=]+=/.test(l)){let f=l.indexOf("="),y=this._findOption(l.slice(0,f));if(y&&(y.required||y.optional)){this.emit(`option:${y.name()}`,l.slice(f+1));continue}}if(c(l)&&(i=o),(this._enablePositionalOptions||this._passThroughOptions)&&n.length===0&&o.length===0){if(this._findCommand(l)){n.push(l),a.length>0&&o.push(...a);break}else if(this._getHelpCommand()&&l===this._getHelpCommand().name()){n.push(l),a.length>0&&n.push(...a);break}else if(this._defaultCommandName){o.push(l),a.length>0&&o.push(...a);break}}if(this._passThroughOptions){i.push(l),a.length>0&&i.push(...a);break}i.push(l)}return{operands:n,unknown:o}}opts(){if(this._storeOptionsAsProperties){let t={},n=this.options.length;for(let o=0;o<n;o++){let i=this.options[o].attributeName();t[i]=i===this._versionOptionName?this._version:this[i]}return t}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((t,n)=>Object.assign(t,n.opts()),{})}error(t,n){this._outputConfiguration.outputError(`${t}
22
22
  `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
23
23
  `):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
24
- `),this.outputHelp({error:!0}));let o=r||{},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 se.env){let r=t.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(t.required||t.optional?this.emit(`optionEnv:${t.name()}`,se.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new YC(this.options),r=o=>this.getOptionValue(o)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(o));this.options.filter(o=>o.implied!==void 0&&r(o.attributeName())&&t.valueFromOption(this.getOptionValue(o.attributeName()),o)).forEach(o=>{Object.keys(o.implied).filter(i=>!r(i)).forEach(i=>{this.setOptionValueWithSource(i,o.implied[i],"implied")})})}missingArgument(t){let r=`error: missing required argument '${t}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(t){let r=`error: option '${t.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){let r=`error: required option '${t.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,r){let o=c=>{let u=c.attributeName(),l=this.getOptionValue(u),f=this.options.find(E=>E.negate&&u===E.attributeName()),y=this.options.find(E=>!E.negate&&u===E.attributeName());return f&&(f.presetArg===void 0&&l===!1||f.presetArg!==void 0&&l===f.presetArg)?f:y||c},i=c=>{let u=o(c),l=u.attributeName();return this.getOptionValueSource(l)==="env"?`environment variable '${u.envVar}'`:`option '${u.flags}'`},a=`error: ${i(t)} cannot be used with ${i(r)}`;this.error(a,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let r="";if(t.startsWith("--")&&this._showSuggestionAfterError){let i=[],a=this;do{let c=a.createHelp().visibleOptions(a).filter(u=>u.long).map(u=>u.long);i=i.concat(c),a=a.parent}while(a&&!a._enablePositionalOptions);r=Kl(t,i)}let o=`error: unknown option '${t}'${r}`;this.error(o,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,o=r===1?"":"s",a=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${o} but got ${t.length}.`;this.error(a,{code:"commander.excessArguments"})}unknownCommand(){let t=this.args[0],r="";if(this._showSuggestionAfterError){let i=[];this.createHelp().visibleCommands(this).forEach(a=>{i.push(a.name()),a.alias()&&i.push(a.alias())}),r=Kl(t,i)}let o=`error: unknown command '${t}'${r}`;this.error(o,{code:"commander.unknownCommand"})}version(t,r,o){if(t===void 0)return this._version;this._version=t,r=r||"-V, --version",o=o||"output the version number";let i=this.createOption(r,o);return this._versionOptionName=i.attributeName(),this._registerOption(i),this.on("option:"+i.name(),()=>{this._outputConfiguration.writeOut(`${t}
25
- `),this._exit(0,"commander.version",t)}),this}description(t,r){return t===void 0&&r===void 0?this._description:(this._description=t,r&&(this._argsDescription=r),this)}summary(t){return t===void 0?this._summary:(this._summary=t,this)}alias(t){if(t===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),t===r._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 r._aliases.push(t),this}aliases(t){return t===void 0?this._aliases:(t.forEach(r=>this.alias(r)),this)}usage(t){if(t===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(o=>KC(o));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=t,this}name(t){return t===void 0?this._name:(this._name=t,this)}nameFromFilename(t){return this._name=nr.basename(t,nr.extname(t)),this}executableDir(t){return t===void 0?this._executableDir:(this._executableDir=t,this)}helpInformation(t){let r=this.createHelp(),o=this._getOutputContext(t);r.prepareContext({error:o.error,helpWidth:o.helpWidth,outputHasColors:o.hasColors});let i=r.formatHelp(this,r);return o.hasColors?i:this._outputConfiguration.stripColor(i)}_getOutputContext(t){t=t||{};let r=!!t.error,o,i,a;return r?(o=u=>this._outputConfiguration.writeErr(u),i=this._outputConfiguration.getErrHasColors(),a=this._outputConfiguration.getErrHelpWidth()):(o=u=>this._outputConfiguration.writeOut(u),i=this._outputConfiguration.getOutHasColors(),a=this._outputConfiguration.getOutHelpWidth()),{error:r,write:u=>(i||(u=this._outputConfiguration.stripColor(u)),o(u)),hasColors:i,helpWidth:a}}outputHelp(t){let r;typeof t=="function"&&(r=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(r&&(a=r(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,r){return typeof t=="boolean"?(t?this._helpOption=this._helpOption??void 0:this._helpOption=null,this):(t=t??"-h, --help",r=r??"display help for command",this._helpOption=this.createOption(t,r),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(t){return this._helpOption=t,this}help(t){this.outputHelp(t);let r=Number(se.exitCode??0);r===0&&t&&typeof t!="function"&&t.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(t,r){let o=["beforeAll","before","after","afterAll"];if(!o.includes(t))throw new Error(`Unexpected value for position to addHelpText.
26
- Expecting one of '${o.join("', '")}'`);let i=`${t}Help`;return this.on(i,a=>{let c;typeof r=="function"?c=r({error:a.error,command:a.command}):c=r,c&&a.write(`${c}
27
- `)}),this}_outputHelpIfRequested(t){let r=this._getHelpOption();r&&t.find(i=>r.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function zl(e){return e.map(t=>{if(!t.startsWith("--inspect"))return t;let r,o="127.0.0.1",i="9229",a;return(a=t.match(/^(--inspect(-brk)?)$/))!==null?r=a[1]:(a=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=a[1],/^\d+$/.test(a[3])?i=a[3]:o=a[3]):(a=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=a[1],o=a[3],i=a[4]),r&&i!=="0"?`${r}=${o}:${parseInt(i)+1}`:t})}function Zc(){if(se.env.NO_COLOR||se.env.FORCE_COLOR==="0"||se.env.FORCE_COLOR==="false")return!1;if(se.env.FORCE_COLOR||se.env.CLICOLOR_FORCE!==void 0)return!0}Xc.Command=Wc;Xc.useColor=Zc});var Zl=Jr(Ut=>{var{Argument:Yl}=ja(),{Command:Jc}=Vl(),{CommanderError:QC,InvalidArgumentError:Ql}=Vo(),{Help:WC}=qc(),{Option:Wl}=Vc();Ut.program=new Jc;Ut.createCommand=e=>new Jc(e);Ut.createOption=(e,t)=>new Wl(e,t);Ut.createArgument=(e,t)=>new Yl(e,t);Ut.Command=Jc;Ut.Option=Wl;Ut.Argument=Yl;Ut.Help=WC;Ut.CommanderError=QC;Ut.InvalidArgumentError=Ql;Ut.InvalidOptionArgumentError=Ql});var Xl=Gl(Zl(),1),{program:Cq,createCommand:Pq,createArgument:Uq,createOption:Nq,CommanderError:kq,InvalidArgumentError:wq,InvalidOptionArgumentError:Lq,Command:Jl,Argument:Mq,Option:ep,Help:vq}=Xl.default;function We(e){throw new Error(`assertUnreachable: ${JSON.stringify(e,null,2)}`)}function Yo(e){return`\u2022\u2022\u2022\u2022${e.slice(-4)}`}function ed(e){return{accessToken:e.accessToken,accessExpiresAt:e.expiresAt.toISOString()}}function td(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 rd(e){if(e)switch(e.kind){case"operation-api-key":return e.token;case"user-session":return e.userAuth.accessToken;default:We(e)}}function Ba(e,t){return e?.kind==="user-session"&&new Date(e.userAuth.accessExpiresAt)<=t}var YI=require("node:crypto");var Qo=require("node:crypto");function ZC(e){return(0,Qo.createHash)("sha256").update(e).digest("base64url")}function nd(){let e=(0,Qo.randomBytes)(32).toString("base64url");return{verifier:e,challenge:ZC(e)}}var ud=require("node:child_process"),ld=require("node:http"),dd=require("node:os");var Hq=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 eH=60*1e3;var vH=1/1e6,rp=1e3,np=60*rp,nP=60*np,Ha=24*nP,DH=7*Ha,$H=30*Ha;var op=["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 oP={s:1,m:60,h:3600,d:86400};function id(e){for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r<48||r>57)return!1}return!0}function ad(){return Math.floor(Date.now()/1e3)}function Ka(e){if(typeof e=="number")return e;if(e==="now")return ad();if(e.startsWith("-")&&e.length>=3){let r=e.at(-1),o=r?oP[r]:void 0;if(o){let i=e.slice(1,-1);if(i.length>0&&id(i))return ad()-parseInt(i,10)*o}}if(id(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.`)}function Q(e){process.stdout.write(`${e}
28
- `)}function oe(e){Q(JSON.stringify(e,null,2))}var sd=["json","tsv","csv"];function ip(e){let t=sd.find(r=>r===e);if(t!==void 0)return t;throw new Error(`--output must be one of: ${sd.join(", ")} (got: ${e})`)}function ap(e){let t=e.split(",").map(r=>r.trim()).filter(r=>r.length>0);if(t.length===0)throw new Error("--fields must contain at least one field name");return t}function cd(e,t){let r=e;for(let o of t.split(".")){if(r===null||typeof r!="object"||!Object.hasOwn(r,o))return;r=r[o]}return r}function sp(e,t){let r=Object.create(null);for(let o of t){let i=cd(e,o);if(i===void 0)continue;let a=o.split("."),c=a.pop();if(c===void 0)continue;let u=r;for(let l of a)(typeof u[l]!="object"||u[l]===null)&&(u[l]=Object.create(null)),u=u[l];u[c]=i}return r}function pd(e){return e==null?null:typeof e=="string"?e:JSON.stringify(e)}var iP={"\\":"\\\\"," ":"\\t","\r":"\\r","\n":"\\n"};function aP(e){let t=pd(e);return t===null?"":t.replace(/[\\\t\r\n]/g,r=>iP[r]??r)}function sP(e){let t=pd(e);return t===null?"":/[,"\n\r]/.test(t)?`"${t.replaceAll('"','""')}"`:t}function cp(e,t,r){if(t.length===0)return"";let o=e==="csv"?",":" ",i=e==="csv"?sP:aP,a=r.map(u=>i(u)).join(o),c=t.map(u=>r.map(l=>i(cd(u,l))).join(o));return[a,...c].join(`
29
- `)}var fd="/oauth/callback",pP=5*np,mP="<!doctype html><html><body><h1>Login complete</h1><p>You can close this tab and return to the terminal.</p></body></html>",za="<!doctype html><html><body><h1>Login failed</h1><p>Return to the terminal for details.</p></body></html>";function uP(e){if((0,dd.platform)()!=="darwin")return!1;try{let t=(0,ud.spawn)("open",[e],{stdio:"ignore",detached:!0});return t.on("error",()=>{}),t.unref(),!0}catch{}return!1}async function lP(e,t,r){return new Promise((o,i)=>{let a=setTimeout(()=>{i(new Error("Timed out waiting for the browser to complete login (5 minutes)."))},pP),c=(u,l,f,y)=>{u.writeHead(l,{"Content-Type":"text/html"}),u.end(f),clearTimeout(a),y()};e.on("request",(u,l)=>{let f=new URL(u.url??"/",r);if(f.pathname!==fd){l.writeHead(404,{"Content-Type":"text/html"}),l.end(za);return}let y=f.searchParams.get("error");if(y){let S=f.searchParams.get("error_description")??"";c(l,400,za,()=>i(new Error(`Authorization failed: ${y}${S?` (${S})`:""}`)));return}if(f.searchParams.get("state")!==t){c(l,400,za,()=>i(new Error("State mismatch on OAuth callback; aborting for safety.")));return}let E=f.searchParams.get("code");if(!E){c(l,400,za,()=>i(new Error("OAuth callback did not include an authorization code.")));return}c(l,200,mP,()=>o(E))})})}async function gd(e){let t=(0,ld.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:r}=t.address(),o=`http://127.0.0.1:${r}`,i=`${o}${fd}`;try{let a=e.buildAuthorizeUrl(i),c=uP(a);return Q(c?"Opening your browser to complete login. If it does not open, visit:":"Visit this URL in your browser to complete login:"),Q(` ${a}`),{code:await lP(t,e.state,o),redirectUri:i}}finally{t.close()}}var g={};Pt(g,{Assign:()=>dP,Clone:()=>Zo,Create:()=>gU,Discard:()=>yU,Metrics:()=>Lt,Update:()=>hU});var Lt={assign:0,create:0,clone:0,discard:0,update:0};function dP(e,t){return Lt.assign+=1,{...e,...t}}var s={};Pt(s,{Entries:()=>vP,EntriesRegExp:()=>MP,Every:()=>kP,EveryAll:()=>wP,GraphemeCount:()=>PP,HasPropertyKey:()=>LP,IsArray:()=>en,IsAsyncIterator:()=>TP,IsBigInt:()=>Wo,IsBoolean:()=>bd,IsClassInstance:()=>RP,IsConstructor:()=>IP,IsDeepEqual:()=>lp,IsEqual:()=>J,IsFunction:()=>Ad,IsGreaterEqualThan:()=>Sd,IsGreaterThan:()=>OP,IsInteger:()=>mp,IsIterator:()=>_P,IsLessEqualThan:()=>Od,IsLessThan:()=>SP,IsMaxLength:()=>UP,IsMinLength:()=>NP,IsMultipleOf:()=>xP,IsNull:()=>Wa,IsNumber:()=>Za,IsObject:()=>tn,IsObjectNotArray:()=>bP,IsString:()=>Or,IsSymbol:()=>AP,IsUndefined:()=>up,IsValueLike:()=>CP,Keys:()=>Qa,Symbols:()=>DP,Values:()=>$P});function Ar(e,t,r){return e>=t&&e<=r}function yd(e){return Ar(e,127462,127487)}function fP(e){return Ar(e,65024,65039)}function gP(e){return Ar(e,768,879)||Ar(e,6832,6911)||Ar(e,7616,7679)||Ar(e,65056,65071)}function Ya(e){return e>65535?2:1}function hd(e,t){for(;t<e.length;){let r=e.codePointAt(t);if(gP(r)||fP(r))t+=Ya(r);else break}return t}function pp(e,t){let r=e.codePointAt(t),o=t+Ya(r);for(o=hd(e,o);o<e.length-1&&e[o]==="\u200D";){let i=e.codePointAt(o+1);o+=1+Ya(i),o=hd(e,o)}return yd(r)&&o<e.length&&yd(e.codePointAt(o))&&(o+=Ya(e.codePointAt(o))),o}function Ed(e){return Ar(e,55296,56319)||Ar(e,768,879)||e===8205}function Td(e){let t=0,r=0;for(;r<e.length;)r=pp(e,r),t++;return t}function yP(e,t){let r=0,o=0;for(;o<e.length;)if(o=pp(e,o),r++,r>=t)return!0;return!1}function hP(e,t){let r=0,o=0;for(;o<e.length;)if(o=pp(e,o),r++,r>t)return!1;return!0}function Id(e,t){let r=0;for(;r<e.length;){if(Ed(e.charCodeAt(r)))return yP(e,t);if(r++,r>=t)return!0}return!1}function _d(e,t){let r=0;for(;r<e.length;){if(Ed(e.charCodeAt(r)))return hP(e,t);if(r++,r>t)return!1}return!0}function en(e){return Array.isArray(e)}function TP(e){return tn(e)&&Symbol.asyncIterator in e}function Wo(e){return J(typeof e,"bigint")}function bd(e){return J(typeof e,"boolean")}function IP(e){if(up(e)||!Ad(e))return!1;let t=Function.prototype.toString.call(e);return!!(/^class\s/.test(t)||/\[native code\]/.test(t))}function Ad(e){return J(typeof e,"function")}function mp(e){return Number.isInteger(e)}function _P(e){return tn(e)&&Symbol.iterator in e}function Wa(e){return J(e,null)}function Za(e){return Number.isFinite(e)}function bP(e){return tn(e)&&!en(e)}function tn(e){return J(typeof e,"object")&&!Wa(e)}function Or(e){return J(typeof e,"string")}function AP(e){return J(typeof e,"symbol")}function up(e){return J(e,void 0)}function J(e,t){return e===t}function OP(e,t){return e>t}function SP(e,t){return e<t}function Od(e,t){return e<=t}function Sd(e,t){return e>=t}function xP(e,t){if(Wo(e)||Wo(t))return BigInt(e)%BigInt(t)===0n;let r=1e-10;if(!Za(e)||mp(e)&&1/t%1===0)return!0;let o=e%t;return Math.min(Math.abs(o),Math.abs(o-t))<r}function RP(e){if(!tn(e))return!1;let t=globalThis.Object.getPrototypeOf(e);return Wa(t)?!1:J(typeof t.constructor,"function")&&!(J(t.constructor,globalThis.Object)||J(t.constructor.name,"Object"))}function CP(e){return Wo(e)||bd(e)||Wa(e)||Za(e)||Or(e)||up(e)}function PP(e){return Td(e)}function UP(e,t){return _d(e,t)}function NP(e,t){return Id(e,t)}function kP(e,t,r){for(let o=t;o<e.length;o++)if(!r(e[o],o))return!1;return!0}function wP(e,t,r){let o=!0;for(let i=t;i<e.length;i++)r(e[i],i)||(o=!1);return o}function LP(e,t){return J(t,"__proto__")||J(t,"constructor")?Object.prototype.hasOwnProperty.call(e,t):t in e}function MP(e){return Qa(e).map(t=>[new RegExp(`^${t}$`),e[t]])}function vP(e){return Object.entries(e)}function Qa(e){return Object.getOwnPropertyNames(e)}function DP(e){return Object.getOwnPropertySymbols(e)}function $P(e){return Object.values(e)}function GP(e,t){if(!tn(t))return!1;let r=Qa(e);return J(r.length,Qa(t).length)&&r.every(o=>lp(e[o],t[o]))}function jP(e,t){return en(t)&&J(e.length,t.length)&&e.every((r,o)=>lp(e[o],t[o]))}function lp(e,t){return en(e)?jP(e,t):tn(e)?GP(e,t):J(e,t)}var rt={};Pt(rt,{IsBigInt64Array:()=>eU,IsBigUint64Array:()=>tU,IsBoolean:()=>FP,IsDate:()=>nU,IsFloat32Array:()=>XP,IsFloat64Array:()=>JP,IsInt16Array:()=>YP,IsInt32Array:()=>WP,IsInt8Array:()=>KP,IsMap:()=>iU,IsNumber:()=>BP,IsRegExp:()=>rU,IsSet:()=>oU,IsString:()=>qP,IsTypeArray:()=>HP,IsUint16Array:()=>QP,IsUint32Array:()=>ZP,IsUint8Array:()=>zP,IsUint8ClampedArray:()=>VP});function FP(e){return e instanceof Boolean}function BP(e){return e instanceof Number}function qP(e){return e instanceof String}function HP(e){return globalThis.ArrayBuffer.isView(e)}function KP(e){return e instanceof globalThis.Int8Array}function zP(e){return e instanceof globalThis.Uint8Array}function VP(e){return e instanceof globalThis.Uint8ClampedArray}function YP(e){return e instanceof globalThis.Int16Array}function QP(e){return e instanceof globalThis.Uint16Array}function WP(e){return e instanceof globalThis.Int32Array}function ZP(e){return e instanceof globalThis.Uint32Array}function XP(e){return e instanceof globalThis.Float32Array}function JP(e){return e instanceof globalThis.Float64Array}function eU(e){return e instanceof globalThis.BigInt64Array}function tU(e){return e instanceof globalThis.BigUint64Array}function rU(e){return e instanceof globalThis.RegExp}function nU(e){return e instanceof globalThis.Date}function oU(e){return e instanceof globalThis.Set}function iU(e){return e instanceof globalThis.Map}function sU(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~guard")}function cU(e){return e.map(t=>dp(t))}function pU(e){let t={},r=Object.getOwnPropertyDescriptors(e);for(let o of Object.keys(r)){let i=r[o];s.HasPropertyKey(i,"value")&&Object.defineProperty(t,o,{...i,value:dp(i.value)})}return t}function mU(e){return new RegExp(e.source,e.flags)}function dp(e){return e instanceof RegExp?mU(e):sU(e)?e:s.IsArray(e)?cU(e):s.IsObject(e)?pU(e):e}function Zo(e){return Lt.clone+=1,dp(e)}var At={};Pt(At,{Get:()=>dU,Reset:()=>uU,Set:()=>lU});var rn={immutableTypes:!1,maxErrors:8,useEval:!0,exactOptionalPropertyTypes:!1,enumerableKind:!1};function uU(){rn.immutableTypes=!1,rn.maxErrors=8,rn.useEval=!0,rn.exactOptionalPropertyTypes=!1,rn.enumerableKind=!1}function lU(e){for(let t of s.Keys(e)){let r=e[t];r!==void 0&&Object.defineProperty(rn,t,{value:r})}}function dU(){return rn}function fU(e,t,r={}){for(let o of Object.keys(t))Object.defineProperty(e,o,{configurable:!0,writable:!0,enumerable:!1,value:t[o]});return e}function xd(e,t){return{...e,...t}}function gU(e,t,r={}){Lt.create+=1;let o=At.Get(),i=xd(t,r),a=o.enumerableKind?xd(i,e):fU(i,e);return o.immutableTypes?Object.freeze(a):a}function yU(e,t){Lt.discard+=1;let r={},o=Object.getOwnPropertyDescriptors(Zo(e)),i=new Set(t);for(let a of Object.keys(o))i.has(a)||Object.defineProperty(r,a,o[a]);return r}function hU(e,t,r){Lt.update+=1;let o=At.Get(),i=Zo(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(r))Object.defineProperty(i,a,{configurable:!0,enumerable:!0,writable:!0,value:r[a]});return i}function _(e,t){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.IsEqual(e["~kind"],t)}function A(e){return s.IsObject(e)}function Rd(e){return g.Create({"~kind":"OptionalAddAction"},{type:e},{})}function Cd(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"type")&&s.IsEqual(e["~kind"],"OptionalAddAction")&&A(e.type)}function Pd(e){return g.Create({"~kind":"OptionalRemoveAction"},{type:e},{})}function Ud(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"type")&&s.IsEqual(e["~kind"],"OptionalRemoveAction")&&A(e.type)}function Nd(e){return g.Create({"~kind":"ReadonlyAddAction"},{type:e},{})}function kd(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"type")&&s.IsEqual(e["~kind"],"ReadonlyAddAction")&&A(e.type)}function wd(e){return g.Create({"~kind":"ReadonlyRemoveAction"},{type:e},{})}function Ld(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"type")&&s.IsEqual(e["~kind"],"ReadonlyRemoveAction")&&A(e.type)}function C(e,t,r){return g.Create({"~kind":"Deferred"},{action:e,parameters:t,options:r},{})}function Md(e){return _(e,"Deferred")}function fp(e){return g.Update(e,{"~immutable":!0},{})}function Sr(e){return fp(e)}function nn(e){return A(e)&&s.HasPropertyKey(e,"~immutable")}function Hn(e){return g.Discard(e,["~optional"])}function pt(e){return g.Update(e,{"~optional":!0},{})}function Xa(e){return pt(e)}function Ne(e){return A(e)&&s.HasPropertyKey(e,"~optional")}function Ja(e){return g.Discard(e,["~readonly"])}function mt(e){return g.Update(e,{"~readonly":!0},{})}function es(e){return mt(e)}function on(e){return A(e)&&s.HasPropertyKey(e,"~readonly")}function Mt(e,t){return g.Create({"~kind":"Array"},{type:"array",items:e},t)}function ee(e){return _(e,"Array")}function ts(e){return g.Discard(e,["~kind","type","items"])}function Bt(e,t){return g.Create({"~kind":"AsyncIterator"},{type:"asyncIterator",iteratorItems:e},t)}function Xe(e){return _(e,"AsyncIterator")}function vd(e){return g.Discard(e,["~kind","type","iteratorItems"])}function Dd(e){return{enumerable:At.Get().enumerableKind,writable:!1,configurable:!1,value:e}}var rs=class{constructor(){globalThis.Object.defineProperty(this,"~kind",Dd("Base")),globalThis.Object.defineProperty(this,"~guard",Dd({check:t=>this.Check(t),errors:t=>this.Errors(t)}))}Check(t){return!0}Errors(t){return[]}Convert(t){return t}Clean(t){return t}Default(t){return t}Create(){throw new Error("Create not implemented")}Clone(){throw Error("Clone not implemented")}};function Ot(e){return _(e,"Base")}function xr(e,t,r={}){return g.Create({"~kind":"Constructor"},{type:"constructor",parameters:e,instanceType:t},r)}function ke(e){return _(e,"Constructor")}function $d(e){return g.Discard(e,["~kind","type","parameters","instanceType"])}function Rr(e,t,r={}){return g.Create({"~kind":"Function"},{type:"function",parameters:e,returnType:t},r)}function we(e){return _(e,"Function")}function Gd(e){return g.Discard(e,["~kind","type","parameters","returnType"])}function Ce(e,t){return g.Create({"~kind":"Ref"},{$ref:e},t)}function ce(e){return _(e,"Ref")}function Cr(e,t){return g.Create({"~kind":"Generic"},{type:"generic",parameters:e,expression:t})}function Kn(e){return _(e,"Generic")}var jd="(?!)";function W(e){return g.Create({"~kind":"Never"},{not:{}},e)}function or(e){return _(e,"Never")}function EU(){return["(not-resolvable)",W()]}function TU(){return["(not-generic)",W()]}function IU(e,t,r){return[e,Cr(t,r)]}function _U(e,t,r){return t in e?Fd(e,t,e[t],r):EU()}function Fd(e,t,r,o){return Kn(r)?IU(t,r.parameters,r.expression):ce(r)?_U(e,r.$ref,o):TU()}function Bd(e,t,r){return Fd(e,"(anonymous)",t,r)}function qt(e,t,r){let o=s.Keys(e).reduce((i,a)=>({...i,[a]:g.Update(e[a],{},{$id:a})}),{});return g.Create({"~kind":"Cyclic"},{$defs:o,$ref:t},r)}function pe(e){return _(e,"Cyclic")}var ie={};Pt(ie,{Match:()=>bU});function bU(e,t){return t[e.length]?.(...e)??(()=>{throw Error("Invalid Arguments")})()}function He(e){return g.Create({"~kind":"Unknown"},{},e)}function ut(e){return _(e,"Unknown")}function Xo(...e){let[t,r]=ie.Match(e,{2:(o,i)=>[o,i,i],1:o=>[o,He(),He()]});return g.Create({"~kind":"Infer"},{type:"infer",name:t,extends:r},{})}function Ae(e){return _(e,"Infer")}function zn(e){return g.Create({"~kind":"Any"},{},e)}function nt(e){return _(e,"Any")}function qd(e){return s.IsObjectNotArray(e)}function Hd(e){return s.Keys(e).filter(r=>isNaN(r)).reduce((r,o)=>[...r,e[o]],[])}function Kd(e,t){let r=qd(e)?Hd(e):e;return g.Create({"~kind":"Enum"},{enum:r},t)}function Oe(e){return _(e,"Enum")}function St(e,t={}){return g.Create({"~kind":"Intersect"},{allOf:e},t)}function U(e){return _(e,"Intersect")}function zd(e){return g.Discard(e,["~kind","allOf"])}function B(){throw new Error("Unreachable")}var Ur={};Pt(Ur,{Hash:()=>jU,HashCode:()=>Jd});function AU(e){let t=new Set,r=e;for(;r&&r!==Object.prototype;){for(let o of Reflect.ownKeys(r))o!=="constructor"&&typeof o!="symbol"&&t.add(o);r=Object.getPrototypeOf(r)}return[...t]}function OU(e){return typeof e=="number"}var ot;(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"})(ot||(ot={}));var Vn=BigInt("14695981039346656037"),[SU,xU]=[BigInt("1099511628211"),BigInt("18446744073709551616")],RU=Array.from({length:256}).map((e,t)=>BigInt(t)),Wd=new Float64Array(1),Zd=new DataView(Wd.buffer),Xd=new Uint8Array(Wd.buffer);function Ke(e){Vn=Vn^RU[e],Vn=Vn*SU%xU}function CU(e){Ke(ot.Array);for(let t of e)Pr(t)}function PU(e){Ke(ot.BigInt),Zd.setBigInt64(0,e);for(let t of Xd)Ke(t)}function Yd(e){Ke(ot.Boolean),Ke(e?1:0)}function UU(e){Ke(ot.Constructor),Pr(e.toString())}function NU(e){Ke(ot.Date),Pr(e.getTime())}function kU(e){Ke(ot.Function),Pr(e.toString())}function wU(e){Ke(ot.Null)}function Qd(e){Ke(ot.Number),Zd.setFloat64(0,e,!0);for(let t of Xd)Ke(t)}function LU(e){Ke(ot.Object);for(let t of AU(e).sort())Pr(t),Pr(e[t])}function MU(e){Ke(ot.RegExp),gp(e.toString())}var vU=new TextEncoder;function gp(e){Ke(ot.String);for(let t of vU.encode(e))Ke(t)}function DU(e){Ke(ot.Symbol),Pr(e.toString())}function $U(e){Ke(ot.TypeArray);let t=new Uint8Array(e.buffer);for(let r=0;r<t.length;r++)Ke(t[r])}function GU(e){return Ke(ot.Undefined)}function Pr(e){return rt.IsTypeArray(e)?$U(e):rt.IsDate(e)?NU(e):rt.IsRegExp(e)?MU(e):rt.IsBoolean(e)?Yd(e.valueOf()):rt.IsString(e)?gp(e.valueOf()):rt.IsNumber(e)?Qd(e.valueOf()):OU(e)?Qd(e):s.IsArray(e)?CU(e):s.IsBoolean(e)?Yd(e):s.IsBigInt(e)?PU(e):s.IsConstructor(e)?UU(e):s.IsNull(e)?wU(e):s.IsObject(e)?LU(e):s.IsString(e)?gp(e):s.IsSymbol(e)?DU(e):s.IsUndefined(e)?GU(e):s.IsFunction(e)?kU(e):B()}function Jd(e){return Vn=BigInt("14695981039346656037"),Pr(e),Vn}function jU(e){return Jd(e).toString(16).padStart(16,"0")}function ef(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"~guard":return"must match check function";case"~refine":return e.params.message;default:return"an unknown validation error occurred"}}var FU=ef;function tf(){return FU}var Jo=class{constructor(t,r){this.type=t,this.decode=r}Encode(t){let r=this.type,o=an(r)?c=>this.decode(r["~codec"].decode(c)):this.decode,i=an(r)?c=>r["~codec"].encode(t(c)):t,a={decode:o,encode:i};return g.Update(this.type,{"~codec":a},{})}},ei=class{constructor(t){this.type=t}Decode(t){return new Jo(this.type,t)}};function ns(e){return new ei(e)}function nf(e,t){return ns(e).Decode(t).Encode(()=>{throw Error("Encode not implemented")})}function of(e,t){return ns(e).Decode(()=>{throw Error("Decode not implemented")}).Encode(t)}function an(e){return A(e)&&s.HasPropertyKey(e,"~codec")&&s.IsObject(e["~codec"])&&s.HasPropertyKey(e["~codec"],"encode")&&s.HasPropertyKey(e["~codec"],"decode")}function qU(e,t){let r=os(e)?[...e["~refine"],t]:[t];return g.Update(e,{"~refine":r},{})}function af(e,t,r="error"){return qU(e,{refine:t,message:r})}function os(e){return A(e)&&s.HasPropertyKey(e,"~refine")}var sf="-?(?:0|[1-9][0-9]*)n";function ti(e){return g.Create({"~kind":"BigInt"},{type:"bigint"},e)}function gt(e){return _(e,"BigInt")}function is(e){return g.Create({"~kind":"Boolean"},{type:"boolean"},e)}function it(e){return _(e,"Boolean")}function ri(e){return g.Create({"~kind":"Identifier"},{name:e})}function cf(e){return _(e,"Identifier")}var as="-?(?:0|[1-9][0-9]*)";function sn(e){return g.Create({"~kind":"Integer"},{type:"integer"},e)}function De(e){return _(e,"Integer")}function Ht(e,t){return g.Create({"~kind":"Iterator"},{type:"iterator",iteratorItems:e},t)}function Je(e){return _(e,"Iterator")}function pf(e){return g.Discard(e,["~kind","type","iteratorItems"])}var yp=class extends Error{constructor(t){super("Invalid Literal value"),Object.defineProperty(this,"cause",{value:{value:t},writable:!1,configurable:!1,enumerable:!1})}};function HU(e){return s.IsBigInt(e)?"bigint":s.IsBoolean(e)?"boolean":s.IsNumber(e)?"number":s.IsString(e)?"string":(()=>{throw new yp(e)})()}function z(e,t){return g.Create({"~kind":"Literal"},{type:HU(e),const:e},t)}function ss(e){return s.IsBigInt(e)||s.IsBoolean(e)||s.IsNumber(e)||s.IsString(e)}function mf(e){return Z(e)&&s.IsBigInt(e.const)}function uf(e){return Z(e)&&s.IsBoolean(e.const)}function Yn(e){return Z(e)&&s.IsNumber(e.const)}function Qn(e){return Z(e)&&s.IsString(e.const)}function Z(e){return _(e,"Literal")}function Nr(e){return g.Create({"~kind":"Null"},{type:"null"},e)}function Kt(e){return _(e,"Null")}var cs="-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?";function xt(e){return g.Create({"~kind":"Number"},{type:"number"},e)}function Ee(e){return _(e,"Number")}function Wn(e){return g.Create({"~kind":"Symbol"},{type:"symbol"},e)}function zt(e){return _(e,"Symbol")}function lf(e){return s.Keys(e).filter(t=>!Ne(e[t]))}function df(e){return s.Keys(e)}function ps(e){return s.Values(e)}function KU(e,t={}){let r=lf(e),o=r.length>0?{required:r}:{};return g.Create({"~kind":"Object"},{type:"object",...o,properties:e},t)}var N=KU;function M(e){return _(e,"Object")}function ff(e){return g.Discard(e,["~kind","type","properties","required"])}function cn(...e){let[t,r,o]=ie.Match(e,{3:(i,a,c)=>[i,a,c],2:(i,a)=>[i,a,a],1:i=>[i,He(),He()]});return g.Create({"~kind":"Parameter"},{name:t,extends:r,equals:o},{})}function gf(e){return _(e,"Parameter")}function Vt(e,t){return g.Create({"~kind":"Promise"},{type:"promise",item:e},t)}function ze(e){return _(e,"Promise")}function yf(e){return g.Discard(e,["~kind","type","item"])}var ms=".*";function lt(e){return g.Create({"~kind":"String"},{type:"string"},e)}function Pe(e){return _(e,"String")}function dt(e,t){let r="object",o={[e]:t};return g.Create({"~kind":"Record"},{type:r,patternProperties:o})}var Zn=`^${as}$`,Xn=`^${cs}$`,Yt=`^${ms}$`;function ni(e,t,r={}){return C("Record",[e,t],r)}function zU(e,t,r={}){return R({},ni(e,t,r))}function us(e,t,r={}){return zU(e,t,r)}function hf(e,t){return dt(e,t)}function yt(e){return s.Keys(e.patternProperties)[0]}function Jn(e){let t=yt(e);return s.IsEqual(t,Zn)?sn():s.IsEqual(t,Xn)?xt():lt()}function Ve(e){return e.patternProperties[yt(e)]}function Te(e){return _(e,"Record")}function pn(e){return g.Create({"~kind":"Rest"},{type:"rest",items:e},{})}function kr(e){return _(e,"Rest")}function ls(e){return g.Create({"~kind":"This"},{$ref:"#"},e)}function Ef(e){return _(e,"This")}function $e(e,t={}){let[r,o,i]=[e,e.length,!1];return g.Create({"~kind":"Tuple"},{type:"array",additionalItems:i,items:r,minItems:o},t)}function V(e){return _(e,"Tuple")}function Tf(e){return g.Discard(e,["~kind","type","items","minItems","additionalItems"])}function eo(e){return g.Create({"~kind":"Undefined"},{type:"undefined"},e)}function Qt(e){return _(e,"Undefined")}function G(e,t={}){return g.Create({"~kind":"Union"},{anyOf:e},t)}function b(e){return _(e,"Union")}function If(e){return g.Discard(e,["~kind","anyOf"])}function _f(e){return g.Create({"~kind":"Unsafe"},{},e)}function bf(e){return _(e,"Unsafe")}function ds(e){return g.Create({"~kind":"Void"},{type:"void"},e)}function ht(e){return _(e,"Void")}function YU(e,t){return s.IsEqual(e,"Array")?Mt(t[0]):s.IsEqual(e,"AsyncIterator")?Bt(t[0]):s.IsEqual(e,"Iterator")?Ht(t[0]):s.IsEqual(e,"Promise")?Vt(t[0]):s.IsEqual(e,"Awaited")?bi(t[0]):s.IsEqual(e,"Capitalize")?ii(t[0]):s.IsEqual(e,"ConstructorParameters")?mi(t[0]):s.IsEqual(e,"Evaluate")?Ep(t[0]):s.IsEqual(e,"Exclude")?ui(t[0],t[1]):s.IsEqual(e,"Extract")?li(t[0],t[1]):s.IsEqual(e,"Index")?no(t[0],t[1]):s.IsEqual(e,"InstanceType")?di(t[0]):s.IsEqual(e,"Lowercase")?ai(t[0]):s.IsEqual(e,"NonNullable")?fi(t[0]):s.IsEqual(e,"Omit")?gi(t[0],t[1]):s.IsEqual(e,"Options")?io(t[0],t[1]):s.IsEqual(e,"Parameters")?yi(t[0]):s.IsEqual(e,"Partial")?hi(t[0]):s.IsEqual(e,"Pick")?Ei(t[0],t[1]):s.IsEqual(e,"Readonly")?Ti(t[0]):s.IsEqual(e,"KeyOf")?oo(t[0]):s.IsEqual(e,"Record")?ni(t[0],t[1]):s.IsEqual(e,"Required")?Ii(t[0]):s.IsEqual(e,"ReturnType")?_i(t[0]):s.IsEqual(e,"Uncapitalize")?si(t[0]):s.IsEqual(e,"Uppercase")?ci(t[0]):fs(Ce(e),t)}function mn(){throw Error("Unreachable")}var QU=(e,t=[])=>e.reduce((r,o)=>s.IsArray(o)&&s.IsEqual(o.length,2)?[...r,o[0]]:[...r,o],[]),ir=e=>{let[t,r]=e;return QU([...t,...r])};function Rf(e){return cn(e[0],e[2],e[4])}function Cf(e){return cn(e[0],e[2],e[2])}function Pf(e){return cn(e[0],He(),e[2])}function Uf(e){return cn(e,He(),He())}function Nf(e){return ir(e)}function kf(e){return e[1]}function wf(e){return ir(e)}function Lf(e){return e[1]}function Mf(e){return YU(e[0],e[1])}function vf(e){return null}function Df(e){return lt()}function $f(e){return xt()}function Gf(e){return is()}function jf(e){return eo()}function Ff(e){return Nr()}function Bf(e){return sn()}function qf(e){return ti()}function Hf(e){return He()}function Kf(e){return zn()}function zf(e){return N({})}function Vf(e){return W()}function Yf(e){return Wn()}function Qf(e){return ds()}function Wf(e){return ls()}function Zf(e){return e[1]}function Xf(e){return z(e)}function Jf(e){return s.IsEqual(e.length,3)?[e[0],e[1],...e[2]]:[e[0]]}function eg(e){return e[1]}function tg(e){return oi(e)}function rg(e){return z(BigInt(e))}function ng(e){return z(s.IsEqual(e,"true"))}function og(e){return z(parseFloat(e))}function ig(e){return z(e)}function ag(e){return e.length>0}function sg(e){return e.reduce((t,r)=>s.IsEqual(r.length,3)?[...t,[r[1]]]:[...t,[]],[])}function cg(e){return s.IsEqual(e.length,6)?[e[1],e[3],e[5]]:[]}function pg(e){return s.IsArray(e)&&s.IsEqual(e.length,3)?e[1]:e}var Af=(e,t)=>t.reduceRight((r,o)=>{let i=o;return s.IsEqual(i.length,1)?no(r,i[0]):s.IsEqual(i.length,0)?Mt(r):mn()},e),Of=(e,t)=>s.IsEqual(t.length,3)?pi(e,t[0],t[1],t[2]):e;function mg(e){let[t,r,o,i]=e;return Of(t?oo(Af(r,o)):Af(r,o),i)}function hp(e,t){return s.IsEqual(t.length,3)?(()=>{let[r,o,i]=t,a=hp(o,i);if(s.IsEqual(r,"&"))return U(a)?St([e,...a.allOf]):St([e,a]);if(s.IsEqual(r,"|"))return b(a)?G([e,...a.anyOf]):G([e,a]);mn()})():e}function ug(e){let[t,r]=e;return hp(t,r)}function lg(e){let[t,r]=e;return hp(t,r)}function dg(e){return fp(e[1])}function fg(e){return e[1]}function gg(e){return Cr(e[0],e[2])}function yg(e){return s.IsEqual(e.length,4)?Xo(e[1],e[3]):s.IsEqual(e.length,2)?Xo(e[1],He()):mn()}function hg(e){return`${e}`}function Eg(e){return De(e[3])?Zn:Ee(e[3])?Xn:zt(e[3])?Yt:Pe(e[3])?Yt:mn()}function Tg(e){return e.length>0}function Ig(e){return e.length>0}function _g(e){let[t,r,o,i,a]=e;return{[r]:t&&o?mt(pt(a)):t&&!o?mt(a):!t&&o?pt(a):a}}function bg(e){return ir(e)}function Ag(e){return e.reduce((t,r)=>s.HasPropertyKey(r,Zn)||s.HasPropertyKey(r,Xn)||s.HasPropertyKey(r,Yt)?[t[0],g.Assign(t[1],r)]:[g.Assign(t[0],r),t[1]],[{},{}])}function Og(e){return Ag(e[1])}function Sg(e){let[t,r]=e,o=s.IsEqual(s.Keys(r).length,0)?{}:{patternProperties:r};return N(t,o)}function xg(e){return s.IsEqual(e.length,5)?mt(pt(e[4])):s.IsEqual(e.length,3)?e[2]:s.IsEqual(e.length,4)?s.IsEqual(e[2],"readonly")?mt(e[3]):pt(e[3]):mn()}function Rg(e){return mt(pt(e[1]))}function Cg(e){return mt(e[1])}function Pg(e){return pt(e[0])}function Ug(e){return s.IsEqual(e.length,2)?pn(e[1]):s.IsEqual(e.length,1)?e[0]:mn()}function Ng(e){return ir(e)}function kg(e){return $e(e[1])}function wg(e){return mt(pt(e[4]))}function Lg(e){return mt(e[3])}function Mg(e){return pt(e[3])}function vg(e){return e[2]}function Dg(e){return s.IsEqual(e.length,2)?pn(e[1]):s.IsEqual(e.length,1)?e[0]:mn()}function $g(e){return ir(e)}function Gg(e){return Rr(e[1],e[4])}function jg(e){return xr(e[2],e[5])}function Sf(e,t){return s.IsEqual(e,"remove")?wd(t):s.IsEqual(e,"add")?Nd(t):t}function Fg(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 xf(e,t){return s.IsEqual(e,"remove")?Pd(t):s.IsEqual(e,"add")?Rd(t):t}function Bg(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 qg(e){return s.IsEqual(e.length,2)?[e[1]]:[]}function Hg(e){return s.IsArray(e[6])&&s.IsEqual(e[6].length,1)?to(ri(e[3]),e[5],e[6][0],Sf(e[1],xf(e[8],e[10]))):to(ri(e[3]),e[5],Ce(e[3]),Sf(e[1],xf(e[8],e[10])))}function Kg(e){return Ce(e)}function zg(e){return io(e[2],e[4])}function Vg(e){return parseFloat(e)}function Yg(e){return s.IsEqual(e,"true")}function Qg(e){return null}function Wg(e){return{[e[0]]:e[2]}}function Zg(e){return ir(e)}function WU(e){return e.reduce((t,r)=>g.Assign(t,r),{})}function Xg(e){return WU(e[1])}function Jg(e){return ir(e)}function ey(e){return e[1]}function ty(e){return ti()}function ry(e){return lt()}function ny(e){return xt()}function oy(e){return sn()}function iy(e){return W()}function ay(e){return z(e)}function sy(e){return G(e[1])}function cy(e){return e.length===3?[...e[0],...e[2]]:e.length===1?[...e[0]]:[]}function py(e){return[e[0],...e[1]]}function my(e){return e[1]}function uy(e){return ir(e)}function ly(e){return s.IsEqual(e.length,2)?e[1]:[]}function dy(e){let t=e[2],r=e[3],[o,i]=e[4],a=s.IsEqual(s.Keys(i).length,0)?{}:{patternProperties:i};return{[e[1]]:Cr(t,ro(r,o,a))}}function fy(e){let t=e[2],[r,o]=e[3],i=s.IsEqual(s.Keys(o).length,0)?{}:{patternProperties:o};return{[e[1]]:ro(t,r,i)}}function gy(e){return{[e[1]]:Cr(e[2],e[4])}}function yy(e){return{[e[1]]:e[3]}}function hy(e){return null}function Ey(e){return Ag(ir(e))}function Ty(e){return e[1]}function Iy(e){let t=e[0],r=e[1];return Tp(g.Assign(t,r[0]))}function ae(e){return en(e)&&J(e.length,2)}function JU(e,t){return J(t.indexOf(e),0)?[e,t.slice(e.length)]:[]}function Le(e,t){let[r,...o]=e;return Or(r)?(()=>{let i=JU(r,t);return J(i.length,2)?i:Le(o,t)})():[]}function Ip(e,t){return Array.from({length:t-e+1},(r,o)=>String.fromCharCode(e+o))}var _y=[...Ip(97,122),...Ip(65,90)],_p="0",bp=Ip(49,57),ao=[_p,...bp],by=" ",so=`
30
- `;var wr="_",gs=".",Ay="$",ys="-";var Oy="//",Sy="/*",tN="*/";function xy(e){let t=e.indexOf(tN);return J(t,-1)?"":e.slice(t+2)}function Ry(e){let t=e.indexOf(so);return J(t,-1)?"":e.slice(t)}function rN(e){return e.replace(/^[ \t\r\f\v]+/,"")}function hs(e){let t=rN(e);return t.startsWith(Sy)?hs(xy(t.slice(2))):t.startsWith(Oy)?hs(Ry(t.slice(2))):t}function ft(e){let t=e.trimStart();return t.startsWith(Sy)?ft(xy(t.slice(2))):t.startsWith(Oy)?ft(Ry(t.slice(2))):t}function nN(e,t){return e.includes(t)}function co(e,t,r,o=""){let i=Le(e,r);return ae(i)?nN(t,i[0])?co(e,t,i[1],o):co(e,t,i[1],`${o}${i[0]}`):[o,r]}function Es(e,t){let r=Le([e],t);return ae(r)?r:["",t]}function oN(e){return Es(ys,e)}function iN(e){return Le(bp,e)}var aN=[...ao,wr];function sN(e){return co(aN,[wr],e)}function cN(e){let t=oN(e);return ae(t)?(()=>{let r=Le([_p],t[1]);return ae(r)?[`${t[0]}${r[0]}`,r[1]]:(()=>{let o=iN(t[1]);return ae(o)?(()=>{let i=sN(o[1]);return ae(i)?[`${t[0]}${o[0]}${i[0]}`,i[1]]:[]})():[]})()})():[]}function Ts(e){return cN(ft(e))}function pN(e){let t=Ts(e);return ae(t)?(()=>{let r=Le(["n"],t[1]);return ae(r)?[`${t[0]}`,r[1]]:[]})():[]}function Cy(e){return pN(e)}function Ap(e,t){return Le([e],t)}function h(e,t){return J(e,"")?["",t]:e.startsWith(so)?Ap(e,hs(t)):e.startsWith(by)?Ap(e,t):Ap(e,ft(t))}var Py=[..._y,wr,Ay];function mN(e){return Le(Py,e)}var uN=[...Py,...ao];function Uy(e,t=""){let r=Le(uN,e);return ae(r)?Uy(r[1],`${t}${r[0]}`):[t,e]}function lN(e){let t=mN(e);return ae(t)?(()=>{let r=Uy(t[1]);return ae(r)?[`${t[0]}${r[0]}`,r[1]]:[]})():[]}function Ie(e){return lN(ft(e))}var dN=[...ao,wr];function fN(e){return Es(ys,e)}function gN(e){return ae(Le([gs],e))}function Ny(e){let t=co(dN,[wr],e);return ae(t)?J(t[0],"")?[]:[t[0],t[1]]:[]}function yN(e,t){let r=Le([gs],t);return ae(r)?(()=>{let o=Ny(r[1]);return ae(o)?[`${e}0${r[0]}${o[0]}`,o[1]]:[]})():[]}function hN(e,t){let r=Ts(t);return ae(r)?(()=>{let o=Le([gs],r[1]);return ae(o)?(()=>{let i=Ny(o[1]);return ae(i)?[`${e}${r[0]}${o[0]}${i[0]}`,i[1]]:[`${e}${r[0]}`,o[1]]})():[`${e}${r[0]}`,r[1]]})():[]}function EN(e){let t=fN(e);return ae(t)?gN(t[1])?yN(t[0],t[1]):hN(t[0],t[1]):[]}function Is(e){return EN(ft(e))}function ky(e,t){let[r,...o]=e;return Or(r)?t.startsWith(r)?!0:ky(o,t):!1}function Lr(e,t,r=""){return J(t,"")?[]:ky(e,t)?[r,t]:(()=>{let[o,i]=[t.slice(0,1),t.slice(1)];return Lr(e,i,`${r}${o}`)})()}function TN(e,t,r){return r.startsWith(e)?(()=>{let o=Lr([t],r.slice(e.length));return ae(o)?o[1].startsWith(t)?[`${o[0]}`,o[1].slice(t.length)]:[]:[]})():[]}function IN(e,t,r){return r.startsWith(e)?(()=>{let o=Lr([so,t],r.slice(e.length));return ae(o)?o[1].startsWith(t)?[`${o[0]}`,o[1].slice(t.length)]:[]:[]})():[]}function wy(e,t,r,o){return r?TN(e,t,ft(o)):IN(e,t,ft(o))}function _N(e,t){return Le(e,t)}function bN(e,t){return wy(e,e,!1,t)}function AN(e,t){let r=_N(e,t);return ae(r)?bN(r[0],`${r[0]}${r[1]}`):[]}function _s(e,t){return AN(e,ft(t))}function Ly(e,t){let r=Lr(e,t);return ae(r)?J(r[0],"")?[]:r:[]}var p=(e,t,r=()=>[])=>e.length===2?t(e):r(),SN=e=>p(p(Ie(e),([t,r])=>p(h("extends",r),([o,i])=>p(X(i),([a,c])=>p(h("=",c),([u,l])=>p(X(l),([f,y])=>[[t,o,a,u,f],y]))))),([t,r])=>[Rf(t),r]),xN=e=>p(p(Ie(e),([t,r])=>p(h("extends",r),([o,i])=>p(X(i),([a,c])=>[[t,o,a],c]))),([t,r])=>[Cf(t),r]),RN=e=>p(p(Ie(e),([t,r])=>p(h("=",r),([o,i])=>p(X(i),([a,c])=>[[t,o,a],c]))),([t,r])=>[Pf(t),r]),CN=e=>p(Ie(e),([t,r])=>[Uf(t),r]),Dy=e=>p(p(SN(e),([t,r])=>[t,r],()=>p(xN(e),([t,r])=>[t,r],()=>p(RN(e),([t,r])=>[t,r],()=>p(CN(e),([t,r])=>[t,r],()=>[])))),([t,r])=>[t,r]),$y=(e,t=[])=>p(p(Dy(e),([r,o])=>p(h(",",o),([i,a])=>[[r,i],a])),([r,o])=>$y(o,[...t,r]),()=>[t,e]),PN=e=>p(p($y(e),([t,r])=>p(p(p(Dy(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>p([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[Nf(t),r]),xp=e=>p(p(h("<",e),([t,r])=>p(PN(r),([o,i])=>p(h(">",i),([a,c])=>[[t,o,a],c]))),([t,r])=>[kf(t),r]),Gy=(e,t=[])=>p(p(X(e),([r,o])=>p(h(",",o),([i,a])=>[[r,i],a])),([r,o])=>Gy(o,[...t,r]),()=>[t,e]),UN=e=>p(p(Gy(e),([t,r])=>p(p(p(X(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>p([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[wf(t),r]),NN=e=>p(p(h("<",e),([t,r])=>p(UN(r),([o,i])=>p(h(">",i),([a,c])=>[[t,o,a],c]))),([t,r])=>[Lf(t),r]),kN=e=>p(p(Ie(e),([t,r])=>p(NN(r),([o,i])=>[[t,o],i])),([t,r])=>[Mf(t),r]),jy=e=>p(p(p(h(";",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>p([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[vf(t),r]),Fy=e=>p(h("string",e),([t,r])=>[Df(t),r]),By=e=>p(h("number",e),([t,r])=>[$f(t),r]),wN=e=>p(h("boolean",e),([t,r])=>[Gf(t),r]),LN=e=>p(h("undefined",e),([t,r])=>[jf(t),r]),MN=e=>p(h("null",e),([t,r])=>[Ff(t),r]),qy=e=>p(h("integer",e),([t,r])=>[Bf(t),r]),vN=e=>p(h("bigint",e),([t,r])=>[qf(t),r]),DN=e=>p(h("unknown",e),([t,r])=>[Hf(t),r]),$N=e=>p(h("any",e),([t,r])=>[Kf(t),r]),GN=e=>p(h("object",e),([t,r])=>[zf(t),r]),jN=e=>p(h("never",e),([t,r])=>[Vf(t),r]),Hy=e=>p(h("symbol",e),([t,r])=>[Yf(t),r]),FN=e=>p(h("void",e),([t,r])=>[Qf(t),r]),BN=e=>p(h("this",e),([t,r])=>[Wf(t),r]),qN=e=>p(p(Fy(e),([t,r])=>[t,r],()=>p(By(e),([t,r])=>[t,r],()=>p(wN(e),([t,r])=>[t,r],()=>p(LN(e),([t,r])=>[t,r],()=>p(MN(e),([t,r])=>[t,r],()=>p(qy(e),([t,r])=>[t,r],()=>p(vN(e),([t,r])=>[t,r],()=>p(DN(e),([t,r])=>[t,r],()=>p($N(e),([t,r])=>[t,r],()=>p(GN(e),([t,r])=>[t,r],()=>p(jN(e),([t,r])=>[t,r],()=>p(Hy(e),([t,r])=>[t,r],()=>p(FN(e),([t,r])=>[t,r],()=>p(BN(e),([t,r])=>[t,r],()=>[])))))))))))))),([t,r])=>[t,r]),HN=e=>p(p(h("${",e),([t,r])=>p(X(r),([o,i])=>p(h("}",i),([a,c])=>[[t,o,a],c]))),([t,r])=>[Zf(t),r]),Op=e=>p(Lr(["${","`"],e),([t,r])=>[Xf(t),r]),Ky=e=>p(p(p(Op(e),([t,r])=>p(HN(r),([o,i])=>p(Ky(i),([a,c])=>[[t,o,a],c]))),([t,r])=>[t,r],()=>p(p(Op(e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>p(p(Op(e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>[]))),([t,r])=>[Jf(t),r]),Rp=e=>p(p(h("`",e),([t,r])=>p(Ky(r),([o,i])=>p(h("`",i),([a,c])=>[[t,o,a],c]))),([t,r])=>[eg(t),r]),KN=e=>p(Rp(e),([t,r])=>[tg(t),r]),zN=e=>p(Cy(e),([t,r])=>[rg(t),r]),VN=e=>p(p(h("true",e),([t,r])=>[t,r],()=>p(h("false",e),([t,r])=>[t,r],()=>[])),([t,r])=>[ng(t),r]),YN=e=>p(Is(e),([t,r])=>[og(t),r]),QN=e=>p(_s(["'",'"'],e),([t,r])=>[ig(t),r]),WN=e=>p(p(zN(e),([t,r])=>[t,r],()=>p(VN(e),([t,r])=>[t,r],()=>p(YN(e),([t,r])=>[t,r],()=>p(QN(e),([t,r])=>[t,r],()=>[])))),([t,r])=>[t,r]),ZN=e=>p(p(p(h("keyof",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>p([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[ag(t),r]),zy=(e,t=[])=>p(p(p(h("[",e),([r,o])=>p(X(o),([i,a])=>p(h("]",a),([c,u])=>[[r,i,c],u]))),([r,o])=>[r,o],()=>p(p(h("[",e),([r,o])=>p(h("]",o),([i,a])=>[[r,i],a])),([r,o])=>[r,o],()=>[])),([r,o])=>zy(o,[...t,r]),()=>[t,e]),XN=e=>p(zy(e),([t,r])=>[sg(t),r]),JN=e=>p(p(p(h("extends",e),([t,r])=>p(X(r),([o,i])=>p(h("?",i),([a,c])=>p(X(c),([u,l])=>p(h(":",l),([f,y])=>p(X(y),([E,S])=>[[t,o,a,u,f,E],S])))))),([t,r])=>[t,r],()=>p([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[cg(t),r]),ek=e=>p(p(p(h("(",e),([t,r])=>p(X(r),([o,i])=>p(h(")",i),([a,c])=>[[t,o,a],c]))),([t,r])=>[t,r],()=>p(qN(e),([t,r])=>[t,r],()=>p(lk(e),([t,r])=>[t,r],()=>p(Ek(e),([t,r])=>[t,r],()=>p(KN(e),([t,r])=>[t,r],()=>p(WN(e),([t,r])=>[t,r],()=>p(Ok(e),([t,r])=>[t,r],()=>p(Ak(e),([t,r])=>[t,r],()=>p(Ck(e),([t,r])=>[t,r],()=>p(Uk(e),([t,r])=>[t,r],()=>p(kN(e),([t,r])=>[t,r],()=>p(Pk(e),([t,r])=>[t,r],()=>[])))))))))))),([t,r])=>[pg(t),r]),Vy=e=>p(p(ZN(e),([t,r])=>p(ek(r),([o,i])=>p(XN(i),([a,c])=>p(JN(c),([u,l])=>[[t,o,a,u],l])))),([t,r])=>[mg(t),r]),Yy=e=>p(p(p(h("&",e),([t,r])=>p(Vy(r),([o,i])=>p(Yy(i),([a,c])=>[[t,o,a],c]))),([t,r])=>[t,r],()=>p([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[t,r]),Qy=e=>p(p(Vy(e),([t,r])=>p(Yy(r),([o,i])=>[[t,o],i])),([t,r])=>[ug(t),r]),Wy=e=>p(p(p(h("|",e),([t,r])=>p(Qy(r),([o,i])=>p(Wy(i),([a,c])=>[[t,o,a],c]))),([t,r])=>[t,r],()=>p([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[t,r]),bs=e=>p(p(Qy(e),([t,r])=>p(Wy(r),([o,i])=>[[t,o],i])),([t,r])=>[lg(t),r]),tk=e=>p(p(h("readonly",e),([t,r])=>p(bs(r),([o,i])=>[[t,o],i])),([t,r])=>[dg(t),r]),rk=e=>p(p(h("|",e),([t,r])=>p(bs(r),([o,i])=>[[t,o],i])),([t,r])=>[fg(t),r]),nk=e=>p(p(xp(e),([t,r])=>p(h("=",r),([o,i])=>p(X(i),([a,c])=>[[t,o,a],c]))),([t,r])=>[gg(t),r]),ok=e=>p(p(p(h("infer",e),([t,r])=>p(Ie(r),([o,i])=>p(h("extends",i),([a,c])=>p(bs(c),([u,l])=>[[t,o,a,u],l])))),([t,r])=>[t,r],()=>p(p(h("infer",e),([t,r])=>p(Ie(r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>[])),([t,r])=>[yg(t),r]),X=e=>p(p(ok(e),([t,r])=>[t,r],()=>p(rk(e),([t,r])=>[t,r],()=>p(tk(e),([t,r])=>[t,r],()=>p(bs(e),([t,r])=>[t,r],()=>[])))),([t,r])=>[t,r]),ik=e=>p(Is(e),([t,r])=>[hg(t),r]),ak=e=>p(Ie(e),([t,r])=>[t,r]),sk=e=>p(_s(["'",'"'],e),([t,r])=>[t,r]),ck=e=>p(p(h("[",e),([t,r])=>p(Ie(r),([o,i])=>p(h(":",i),([a,c])=>p(p(qy(c),([u,l])=>[u,l],()=>p(By(c),([u,l])=>[u,l],()=>p(Fy(c),([u,l])=>[u,l],()=>p(Hy(c),([u,l])=>[u,l],()=>[])))),([u,l])=>p(h("]",l),([f,y])=>[[t,o,a,u,f],y]))))),([t,r])=>[Eg(t),r]),Zy=e=>p(p(ik(e),([t,r])=>[t,r],()=>p(ak(e),([t,r])=>[t,r],()=>p(sk(e),([t,r])=>[t,r],()=>p(ck(e),([t,r])=>[t,r],()=>[])))),([t,r])=>[t,r]),pk=e=>p(p(p(h("readonly",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>p([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[Tg(t),r]),mk=e=>p(p(p(h("?",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>p([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[Ig(t),r]),Xy=e=>p(p(pk(e),([t,r])=>p(Zy(r),([o,i])=>p(mk(i),([a,c])=>p(h(":",c),([u,l])=>p(X(l),([f,y])=>[[t,o,a,u,f],y]))))),([t,r])=>[_g(t),r]),Jy=e=>p(p(p(h(",",e),([t,r])=>p(h(`
31
- `,r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>p(p(h(";",e),([t,r])=>p(h(`
32
- `,r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>p(p(h(",",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>p(p(h(";",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>p(p(h(`
33
- `,e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>[]))))),([t,r])=>[t,r]),eh=(e,t=[])=>p(p(Xy(e),([r,o])=>p(Jy(o),([i,a])=>[[r,i],a])),([r,o])=>eh(o,[...t,r]),()=>[t,e]),uk=e=>p(p(eh(e),([t,r])=>p(p(p(Xy(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>p([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[bg(t),r]),Cp=e=>p(p(h("{",e),([t,r])=>p(uk(r),([o,i])=>p(h("}",i),([a,c])=>[[t,o,a],c]))),([t,r])=>[Og(t),r]),lk=e=>p(Cp(e),([t,r])=>[Sg(t),r]),dk=e=>p(p(p(Ie(e),([t,r])=>p(h("?",r),([o,i])=>p(h(":",i),([a,c])=>p(h("readonly",c),([u,l])=>p(X(l),([f,y])=>[[t,o,a,u,f],y]))))),([t,r])=>[t,r],()=>p(p(Ie(e),([t,r])=>p(h(":",r),([o,i])=>p(h("readonly",i),([a,c])=>p(X(c),([u,l])=>[[t,o,a,u],l])))),([t,r])=>[t,r],()=>p(p(Ie(e),([t,r])=>p(h("?",r),([o,i])=>p(h(":",i),([a,c])=>p(X(c),([u,l])=>[[t,o,a,u],l])))),([t,r])=>[t,r],()=>p(p(Ie(e),([t,r])=>p(h(":",r),([o,i])=>p(X(i),([a,c])=>[[t,o,a],c]))),([t,r])=>[t,r],()=>[])))),([t,r])=>[xg(t),r]),fk=e=>p(p(h("readonly",e),([t,r])=>p(X(r),([o,i])=>p(h("?",i),([a,c])=>[[t,o,a],c]))),([t,r])=>[Rg(t),r]),gk=e=>p(p(h("readonly",e),([t,r])=>p(X(r),([o,i])=>[[t,o],i])),([t,r])=>[Cg(t),r]),yk=e=>p(p(X(e),([t,r])=>p(h("?",r),([o,i])=>[[t,o],i])),([t,r])=>[Pg(t),r]),My=e=>p(p(dk(e),([t,r])=>[t,r],()=>p(fk(e),([t,r])=>[t,r],()=>p(gk(e),([t,r])=>[t,r],()=>p(yk(e),([t,r])=>[t,r],()=>p(X(e),([t,r])=>[t,r],()=>[]))))),([t,r])=>[t,r]),th=e=>p(p(p(h("...",e),([t,r])=>p(My(r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>p(p(My(e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>[])),([t,r])=>[Ug(t),r]),rh=(e,t=[])=>p(p(th(e),([r,o])=>p(h(",",o),([i,a])=>[[r,i],a])),([r,o])=>rh(o,[...t,r]),()=>[t,e]),hk=e=>p(p(rh(e),([t,r])=>p(p(p(th(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>p([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[Ng(t),r]),Ek=e=>p(p(h("[",e),([t,r])=>p(hk(r),([o,i])=>p(h("]",i),([a,c])=>[[t,o,a],c]))),([t,r])=>[kg(t),r]),Tk=e=>p(p(Ie(e),([t,r])=>p(h("?",r),([o,i])=>p(h(":",i),([a,c])=>p(h("readonly",c),([u,l])=>p(X(l),([f,y])=>[[t,o,a,u,f],y]))))),([t,r])=>[wg(t),r]),Ik=e=>p(p(Ie(e),([t,r])=>p(h(":",r),([o,i])=>p(h("readonly",i),([a,c])=>p(X(c),([u,l])=>[[t,o,a,u],l])))),([t,r])=>[Lg(t),r]),_k=e=>p(p(Ie(e),([t,r])=>p(h("?",r),([o,i])=>p(h(":",i),([a,c])=>p(X(c),([u,l])=>[[t,o,a,u],l])))),([t,r])=>[Mg(t),r]),bk=e=>p(p(Ie(e),([t,r])=>p(h(":",r),([o,i])=>p(X(i),([a,c])=>[[t,o,a],c]))),([t,r])=>[vg(t),r]),vy=e=>p(p(Tk(e),([t,r])=>[t,r],()=>p(Ik(e),([t,r])=>[t,r],()=>p(_k(e),([t,r])=>[t,r],()=>p(bk(e),([t,r])=>[t,r],()=>[])))),([t,r])=>[t,r]),nh=e=>p(p(p(h("...",e),([t,r])=>p(vy(r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>p(p(vy(e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>[])),([t,r])=>[Dg(t),r]),oh=(e,t=[])=>p(p(nh(e),([r,o])=>p(h(",",o),([i,a])=>[[r,i],a])),([r,o])=>oh(o,[...t,r]),()=>[t,e]),ih=e=>p(p(oh(e),([t,r])=>p(p(p(nh(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>p([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[$g(t),r]),Ak=e=>p(p(h("(",e),([t,r])=>p(ih(r),([o,i])=>p(h(")",i),([a,c])=>p(h("=>",c),([u,l])=>p(X(l),([f,y])=>[[t,o,a,u,f],y]))))),([t,r])=>[Gg(t),r]),Ok=e=>p(p(h("new",e),([t,r])=>p(h("(",r),([o,i])=>p(ih(i),([a,c])=>p(h(")",c),([u,l])=>p(h("=>",l),([f,y])=>p(X(y),([E,S])=>[[t,o,a,u,f,E],S])))))),([t,r])=>[jg(t),r]),Sk=e=>p(p(p(h("+",e),([t,r])=>p(h("readonly",r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>p(p(h("-",e),([t,r])=>p(h("readonly",r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>p(p(h("readonly",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>p([[],e],([t,r])=>[t,r],()=>[])))),([t,r])=>[Fg(t),r]),xk=e=>p(p(p(h("+",e),([t,r])=>p(h("?",r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>p(p(h("-",e),([t,r])=>p(h("?",r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>p(p(h("?",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>p([[],e],([t,r])=>[t,r],()=>[])))),([t,r])=>[Bg(t),r]),Rk=e=>p(p(p(h("as",e),([t,r])=>p(X(r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>p([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[qg(t),r]),Ck=e=>p(p(h("{",e),([t,r])=>p(Sk(r),([o,i])=>p(h("[",i),([a,c])=>p(Ie(c),([u,l])=>p(h("in",l),([f,y])=>p(X(y),([E,S])=>p(Rk(S),([fe,Re])=>p(h("]",Re),([br,$l])=>p(xk($l),([qn,_C])=>p(h(":",_C),([bC,AC])=>p(X(AC),([OC,SC])=>p(jy(SC),([xC,RC])=>p(h("}",RC),([CC,PC])=>[[t,o,a,u,f,E,fe,br,qn,bC,OC,xC,CC],PC]))))))))))))),([t,r])=>[Hg(t),r]),Pk=e=>p(Ie(e),([t,r])=>[Kg(t),r]),Uk=e=>p(p(h("Options",e),([t,r])=>p(h("<",r),([o,i])=>p(X(i),([a,c])=>p(h(",",c),([u,l])=>p(ch(l),([f,y])=>p(h(">",y),([E,S])=>[[t,o,a,u,f,E],S])))))),([t,r])=>[zg(t),r]),Nk=e=>p(Is(e),([t,r])=>[Vg(t),r]),kk=e=>p(p(h("true",e),([t,r])=>[t,r],()=>p(h("false",e),([t,r])=>[t,r],()=>[])),([t,r])=>[Yg(t),r]),wk=e=>p(_s(['"',"'"],e),([t,r])=>[t,r]),Lk=e=>p(h("null",e),([t,r])=>[Qg(t),r]),ah=e=>p(p(Zy(e),([t,r])=>p(h(":",r),([o,i])=>p(Pp(i),([a,c])=>[[t,o,a],c]))),([t,r])=>[Wg(t),r]),sh=(e,t=[])=>p(p(ah(e),([r,o])=>p(Jy(o),([i,a])=>[[r,i],a])),([r,o])=>sh(o,[...t,r]),()=>[t,e]),Mk=e=>p(p(sh(e),([t,r])=>p(p(p(ah(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>p([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[Zg(t),r]),ch=e=>p(p(h("{",e),([t,r])=>p(Mk(r),([o,i])=>p(h("}",i),([a,c])=>[[t,o,a],c]))),([t,r])=>[Xg(t),r]),ph=(e,t=[])=>p(p(Pp(e),([r,o])=>p(h(",",o),([i,a])=>[[r,i],a])),([r,o])=>ph(o,[...t,r]),()=>[t,e]),vk=e=>p(p(ph(e),([t,r])=>p(p(p(Pp(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>p([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[Jg(t),r]),Dk=e=>p(p(h("[",e),([t,r])=>p(vk(r),([o,i])=>p(h("]",i),([a,c])=>[[t,o,a],c]))),([t,r])=>[ey(t),r]),Pp=e=>p(p(Nk(e),([t,r])=>[t,r],()=>p(kk(e),([t,r])=>[t,r],()=>p(wk(e),([t,r])=>[t,r],()=>p(Lk(e),([t,r])=>[t,r],()=>p(ch(e),([t,r])=>[t,r],()=>p(Dk(e),([t,r])=>[t,r],()=>[])))))),([t,r])=>[t,r]),$k=e=>p(h("-?(?:0|[1-9][0-9]*)n",e),([t,r])=>[ty(t),r]),Gk=e=>p(h(".*",e),([t,r])=>[ry(t),r]),jk=e=>p(h("-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?",e),([t,r])=>[ny(t),r]),Fk=e=>p(h("-?(?:0|[1-9][0-9]*)",e),([t,r])=>[oy(t),r]),Bk=e=>p(h("(?!)",e),([t,r])=>[iy(t),r]),qk=e=>p(Ly(["-?(?:0|[1-9][0-9]*)n",".*","-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?","-?(?:0|[1-9][0-9]*)","(?!)","(",")","$","|"],e),([t,r])=>[ay(t),r]),Hk=e=>p(p($k(e),([t,r])=>[t,r],()=>p(Gk(e),([t,r])=>[t,r],()=>p(jk(e),([t,r])=>[t,r],()=>p(Fk(e),([t,r])=>[t,r],()=>p(Bk(e),([t,r])=>[t,r],()=>p(Kk(e),([t,r])=>[t,r],()=>p(qk(e),([t,r])=>[t,r],()=>[]))))))),([t,r])=>[t,r]),Kk=e=>p(p(h("(",e),([t,r])=>p(Up(r),([o,i])=>p(h(")",i),([a,c])=>[[t,o,a],c]))),([t,r])=>[sy(t),r]),mh=e=>p(p(p(Sp(e),([t,r])=>p(h("|",r),([o,i])=>p(mh(i),([a,c])=>[[t,o,a],c]))),([t,r])=>[t,r],()=>p(p(Sp(e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>p([[],e],([t,r])=>[t,r],()=>[]))),([t,r])=>[cy(t),r]),Sp=e=>p(p(Hk(e),([t,r])=>p(Up(r),([o,i])=>[[t,o],i])),([t,r])=>[py(t),r]),Up=e=>p(p(mh(e),([t,r])=>[t,r],()=>p(Sp(e),([t,r])=>[t,r],()=>[])),([t,r])=>[t,r]),uh=e=>p(p(h("^",e),([t,r])=>p(Up(r),([o,i])=>p(h("$",i),([a,c])=>[[t,o,a],c]))),([t,r])=>[my(t),r]),lh=(e,t=[])=>p(p(X(e),([r,o])=>p(h(",",o),([i,a])=>[[r,i],a])),([r,o])=>lh(o,[...t,r]),()=>[t,e]),zk=e=>p(p(lh(e),([t,r])=>p(p(p(X(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>p([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[uy(t),r]),dh=e=>p(p(p(h("extends",e),([t,r])=>p(zk(r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>p([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[ly(t),r]),Vk=e=>p(p(h("interface",e),([t,r])=>p(Ie(r),([o,i])=>p(xp(i),([a,c])=>p(dh(c),([u,l])=>p(Cp(l),([f,y])=>[[t,o,a,u,f],y]))))),([t,r])=>[dy(t),r]),Yk=e=>p(p(h("interface",e),([t,r])=>p(Ie(r),([o,i])=>p(dh(i),([a,c])=>p(Cp(c),([u,l])=>[[t,o,a,u],l])))),([t,r])=>[fy(t),r]),Qk=e=>p(p(h("type",e),([t,r])=>p(Ie(r),([o,i])=>p(xp(i),([a,c])=>p(h("=",c),([u,l])=>p(X(l),([f,y])=>[[t,o,a,u,f],y]))))),([t,r])=>[gy(t),r]),Wk=e=>p(p(h("type",e),([t,r])=>p(Ie(r),([o,i])=>p(h("=",i),([a,c])=>p(X(c),([u,l])=>[[t,o,a,u],l])))),([t,r])=>[yy(t),r]),Zk=e=>p(p(p(h("export",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>p([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[hy(t),r]),Xk=e=>p(p(p(h(";",e),([t,r])=>p(h(`
34
- `,r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>p(p(h(";",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>p(p(h(`
35
- `,e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>[]))),([t,r])=>[t,r]),fh=(e,t=[])=>p(p(Np(e),([r,o])=>p(Xk(o),([i,a])=>[[r,i],a])),([r,o])=>fh(o,[...t,r]),()=>[t,e]),Jk=e=>p(p(fh(e),([t,r])=>p(p(p(Np(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>p([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[Ey(t),r]),Np=e=>p(p(Zk(e),([t,r])=>p(p(Vk(r),([o,i])=>[o,i],()=>p(Yk(r),([o,i])=>[o,i],()=>p(Qk(r),([o,i])=>[o,i],()=>p(Wk(r),([o,i])=>[o,i],()=>[])))),([o,i])=>p(jy(i),([a,c])=>[[t,o,a],c]))),([t,r])=>[Ty(t),r]),ew=e=>p(p(Np(e),([t,r])=>p(Jk(r),([o,i])=>[[t,o],i])),([t,r])=>[Iy(t),r]),gh=e=>p(p(ew(e),([t,r])=>[t,r],()=>p(nk(e),([t,r])=>[t,r],()=>p(X(e),([t,r])=>[t,r],()=>[]))),([t,r])=>[t,r]);function yh(e){let t=Rp(`\`${e}\``);return s.IsEqual(t.length,2)?t[0]:B()}function oi(e,t={}){return C("TemplateLiteral",[e],t)}function hh(e){return R({},oi(e,{}))}function rw(e){let t=yh(e);return hh(t)}function Eh(e,t={}){let r=s.IsString(e)?rw(e):hh(e);return g.Update(r,{},t)}function Se(e){return _(e,"TemplateLiteral")}var k={};Pt(k,{ExtendsFalse:()=>F,ExtendsTrue:()=>x,ExtendsUnion:()=>kp,IsExtendsFalse:()=>nw,IsExtendsTrue:()=>Ih,IsExtendsTrueLike:()=>_e,IsExtendsUnion:()=>Th});function kp(e){return g.Create({"~kind":"ExtendsUnion"},{inferred:e})}function Th(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"inferred")&&s.IsEqual(e["~kind"],"ExtendsUnion")&&s.IsObject(e.inferred)}function x(e){return g.Create({"~kind":"ExtendsTrue"},{inferred:e})}function Ih(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"inferred")&&s.IsEqual(e["~kind"],"ExtendsTrue")&&s.IsObject(e.inferred)}function F(){return g.Create({"~kind":"ExtendsFalse"},{})}function nw(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.IsEqual(e["~kind"],"ExtendsFalse")}function _e(e){return Th(e)||Ih(e)}function As(e){let t=uh(e);return s.IsEqual(t.length,2)?t[0]:B()}function ow(e){return!0}function _h(e){let[t,...r]=e;return A(t)?iw(t)?_h(r):!1:!0}function bh(e){return s.IsEqual(e.length,0)?!1:_h(e)}function iw(e){return b(e)?bh(e.anyOf):Z(e)?ow(e.const):!1}function Os(e){return bh(e)}function Ah(e,t,r=[]){let[o,...i]=e;return s.IsString(o)?Ah(i,t,[...r,`${o}${t}`]):r}function aw(e,t){return s.IsEqual(e.length,0)?[`${t}`]:Ah(e,t)}function Oh(e,t,r=[]){let[o,...i]=t;return A(o)?Oh(e,i,[...r,...Sh(e,o)]):r}function Sh(e,t){return b(t)?Oh(e,t.anyOf):Z(t)?aw(e,t.const):B()}function xh(e,t){let[r,...o]=t;return A(r)?xh(Sh(e,r),o):e}function sw(e){return e.map(t=>z(t))}function cw(e){let t=xh([],e),r=sw(t);return G(r)}function pw(e){return s.IsEqual(e.length,0)?B():s.IsEqual(e.length,1)&&Z(e[0])?e[0]:cw(e)}function Ye(e){let t=As(e);return Os(t)?pw(t):lt()}function mw(e){return s.IsString(e)||s.IsNumber(e)?z(e):s.IsNull(e)?Nr():W()}function vt(e){return e.map(r=>mw(r))}function Ai(e){let t=vt(e);return G(t)}function un(e){return Ai(e.enum)}function uw(e,t,r,o){let i=re(e,r,o);return _e(i)?x(g.Assign(g.Assign(e,i.inferred),{[t]:r})):F()}function lw(e,t){return x(e)}function dw(e,t,r){let o=Ai(r);return re(e,t,o)}function Rh(e,t,r){let[o,...i]=r;return A(o)?(()=>{let a=re(e,t,o);return _e(a)?Rh(a.inferred,t,i):F()})():x(e)}function fw(e,t,r){let o=Ye(r);return re(e,t,o)}function Ch(e,t,r){let[o,...i]=r;return A(o)?(()=>{let a=re(e,t,o);return _e(a)?x(a.inferred):Ch(e,t,i)})():F()}function q(e,t,r){return nt(r)?lw(e,t):Oe(r)?dw(e,t,r.enum):Ae(r)?uw(e,r.name,t,r.extends):U(r)?Rh(e,t,r.allOf):Se(r)?fw(e,t,r.pattern):b(r)?Ch(e,t,r.anyOf):ut(r)?x(e):F()}function Ph(e,t,r){return Ae(r)?q(e,t,r):nt(r)?x(e):ut(r)?x(e):kp(e)}function gw(e,t){let r=nn(e),o=nn(t);return r&&o||!r&&o?!0:!(r&&!o)}function Uh(e,t,r,o){return ee(o)?gw(t,o)?re(e,r,o.items):F():q(e,t,o)}function Nh(e,t,r){return Xe(r)?re(e,t,r.iteratorItems):q(e,Bt(t),r)}function kh(e,t,r){return gt(r)?x(e):q(e,t,r)}function wh(e,t,r){return it(r)?x(e):q(e,t,r)}function yw(e,t,r,o,i){let a=Ae(o)?t:o,c=Ae(o)?o:t,u=Ne(t),l=Ne(o),f=re(e,a,c);return!u&&l?F():_e(f)?Oi(f.inferred,r,i):F()}function hw(e,t,r,o){let[i,...a]=o;return A(i)?yw(e,t,r,i,a):Ne(t)?x(e):F()}function Ew(e,t,r){let[o,...i]=t;return A(o)?hw(e,o,i,r):x(e)}function Oi(e,t,r){return Ew(e,t,r)}function Ss(e,t,r){return ht(r)?x(e):re(e,t,r)}function Lh(e,t,r,o){return ke(o)?(()=>{let i=Oi(e,t,o.parameters);return _e(i)?Ss(i.inferred,r,o.instanceType):F()})():F()}function Mh(e,t,r){return re(e,un(t),r)}function vh(e,t,r,o){return we(o)?(()=>{let i=Oi(e,t,o.parameters);return _e(i)?Ss(i.inferred,r,o.returnType):F()})():F()}function Dh(e,t,r){return De(r)?x(e):Ee(r)?x(e):q(e,t,r)}var Si="equal",Tw="disjoint",xi="left-inside",Ri="right-inside";function Ci(e,t){let r=[ut(e)?k.ExtendsFalse():Ze({},e,t),ut(e)?k.ExtendsTrue({}):Ze({},t,e)];return k.IsExtendsTrueLike(r[0])&&k.IsExtendsTrueLike(r[1])?Si:k.IsExtendsTrueLike(r[0])&&k.IsExtendsFalse(r[1])?xi:k.IsExtendsFalse(r[0])&&k.IsExtendsTrueLike(r[1])?Ri:Tw}function Iw(e){return b(e)?Wt(e.anyOf):[e]}function Wt(e){return e.reduce((t,r)=>[...t,...Iw(r)],[])}function wp(e){return e.reduceRight((r,o,i)=>({[i]:o,...r}),{})}function $h(e){let t=wp(e.items);return N(t)}function _w(e,t){return on(e)?!!on(t):!1}function bw(e,t){return Ne(e)?!!Ne(t):!1}function Aw(e,t){let r=_w(e,t),o=bw(e,t),i=xe([e,t]),a=Ja(Hn(i));return r&&o?mt(pt(a)):r&&!o?mt(a):!r&&o?pt(a):a}function Ow(e,t,r){return r in e?r in t?Aw(e[r],t[r]):e[r]:r in t?t[r]:W()}function Sw(e,t){return[...new Set([...s.Keys(t),...s.Keys(e)])].reduce((o,i)=>({...o,[i]:Ow(e,t,i)}),{})}function Gh(e){return M(e)?e.properties:V(e)?wp(e.items):B()}function jh(e,t){let r=Gh(e),o=Gh(t),i=Sw(r,o);return N(i)}function Fh(e,t){let r=Ci(e,t);return s.IsEqual(r,xi)?e:s.IsEqual(r,Ri)||s.IsEqual(r,Si)?t:W()}function Bh(e){return M(e)||V(e)}function qh(e){return U(e)?xe(e.allOf):e}function xw(e,t){let r=qh(e),o=qh(t),i=Bh(r),a=Bh(o);return i&&a?jh(Mr(r),o):i&&!a?Mr(r):!i&&a?o:Fh(Mr(r),o)}function Hh(e,t,r=[]){let[o,...i]=t;return s.IsUndefined(o)?r.length===0?[e]:r:Hh(e,i,[...r,xw(e,o)])}function Kh(e,t,r=[]){let[o,...i]=e;return A(o)?Kh(i,t,[...r,...Pi([o],t)]):r}function Pi(e,t=[]){let[r,...o]=e;return A(r)?b(r)?Pi(o,Kh(r.anyOf,t)):Pi(o,Hh(r,t)):t}function xe(e){let t=Pi(e);return Lp(t)}function ar(e){return Lp(e)}function Mr(e){return U(e)?xe(e.allOf):b(e)?ar(e.anyOf):e}function ln(e){return s.IsEqual(e.length,1)?e[0]:s.IsEqual(e.length,0)?W():G(e)}function Rw(e,t){return t.filter(r=>Ci(e,r)!==Ri)}function Cw(e,t){let r=t.some(o=>{let i=Ci(e,o);return s.IsEqual(i,xi)||s.IsEqual(i,Si)});return s.IsEqual(r,!1)}function Pw(e,t){let r=Mr(e);return nt(r)?[r]:Cw(r,t)?[...Rw(r,t),r]:t}function Mp(e,t=[]){let[r,...o]=e;return A(r)?M(r)?Mp(o,[...t,r]):Mp(o,Pw(r,t)):t}function Lp(e){let t=Mp(e),r=Wt(t);return r.length===0?W():r.length===1?r[0]:G(r)}function Uw(e,t,r,o){let i=I(e,t,r);return g.Update(Mr(i),{},o)}function zh(e,t,r,o){return Uw(e,t,r,o)}function Vh(e,t,r){let o=xe(t);return re(e,o,r)}function Yh(e,t,r){return Je(r)?re(e,t,r.iteratorItems):q(e,Ht(t),r)}function xs(e,t,r){return t===r?x(e):F()}function Nw(e,t,r){return Z(r)?xs(e,t,r.const):gt(r)?x(e):q(e,z(t),r)}function kw(e,t,r){return Z(r)?xs(e,t,r.const):it(r)?x(e):q(e,z(t),r)}function ww(e,t,r){return Z(r)?xs(e,t,r.const):Ee(r)?x(e):q(e,z(t),r)}function Lw(e,t,r){return Z(r)?xs(e,t,r.const):Pe(r)?x(e):q(e,z(t),r)}function Qh(e,t,r){return s.IsBigInt(t.const)?Nw(e,t.const,r):s.IsBoolean(t.const)?kw(e,t.const,r):s.IsNumber(t.const)?ww(e,t.const,r):s.IsString(t.const)?Lw(e,t.const,r):B()}function Wh(e,t,r){return Ae(r)?q(e,t,r):x(e)}function Zh(e,t,r){return Kt(r)?x(e):q(e,t,r)}function Xh(e,t,r){return Ee(r)?x(e):q(e,t,r)}function Mw(e,t,r){return Ne(t)?Ne(r)?x(e):F():x(e)}function vw(e,t,r){return Ae(r)&&or(r.extends)?F():(()=>{let o=re(e,t,r);return _e(o)?Mw(o.inferred,t,r):F()})()}function Dw(e,t){return e.reduce((r,o)=>o in t?_e(t[o])?{...r,...t[o].inferred}:B():B(),{})}function $w(e,t,r){let o={};for(let c of s.Keys(r))o[c]=c in t?vw({},t[c],r[c]):Ne(r[c])?Ae(r[c])?x(g.Assign(e,{[r[c].name]:r[c].extends})):x(e):F();let i=s.Values(o).every(c=>_e(c)),a=i?Dw(s.Keys(o),o):{};return i?x(a):F()}function Gw(e,t,r){let o=$w(e,t,r);return _e(o)?x(g.Assign(e,o.inferred)):F()}function jw(e,t,r){return Gw(e,t,r)}function Jh(e,t,r){return M(r)?jw(e,t,r.properties):q(e,N(t),r)}function eE(e,t,r){return ze(r)?re(e,t,r.item):q(e,Vt(t),r)}function tE(e,t,r){return Pe(r)?x(e):q(e,t,r)}function rE(e,t,r){return zt(r)?x(e):q(e,t,r)}function nE(e,t,r){let o=Ye(t);return re(e,o,r)}function vp(e,t){return g.Create({"~kind":"Inferrable"},{name:e,type:t},{})}function Ui(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 Dp(e){return kr(e)?Ae(e.items)?ee(e.items.extends)?vp(e.items.name,e.items.extends.items):ut(e.items.extends)?vp(e.items.name,e.items.extends):void 0:B():void 0}function Rs(e){return Ae(e)?vp(e.name,e.extends):void 0}function $p(e,t,r=[]){let[o,...i]=e;return A(o)?(()=>{let a=re({},o,t);return _e(a)?$p(i,t,[...r,o]):void 0})():r}function oE(e,t,r,o){let i=$p(r,o);return s.IsArray(i)?x(g.Assign(e,{[t]:$e(i)})):F()}function Cs(e,t,r,o){let i=$p(r,o);return s.IsArray(i)?x(g.Assign(e,{[t]:G(i)})):F()}function Fw(e){return[...e].reverse()}function Gp(e,t){return t?Fw(e):e}function Bw(e){let t=e.length>0?e[0]:void 0,r=A(t)?Dp(t):void 0;return A(r)}function qw(e,t,r,o,i,a){let c=re(e,r,i);return _e(c)?iE(c.inferred,t,o,a):F()}function Hw(e,t,r,o,i){let a=Dp(o);return Ui(a)?oE(e,a.name,Gp(r,t),a.type):(()=>{let[c,...u]=r;return A(c)?qw(e,t,c,u,o,i):F()})()}function Kw(e,t,r,o){let[i,...a]=o;return A(i)?Hw(e,t,r,i,a):s.IsEqual(r.length,0)?x(e):F()}function iE(e,t,r,o){return Kw(e,t,r,o)}function zw(e,t,r){let o=Ps(e,{callstack:[]},r),i=Bw(o);return iE(e,i,Gp(t,i),Gp(o,i))}function aE(e,t,r){let o=Rs(r);return Ui(o)?Cs(e,o.name,t,o.type):(()=>{let[i,...a]=t;return A(i)?(()=>{let c=re(e,i,r);return _e(c)?aE(c.inferred,a,r):F()})():x(e)})()}function sE(e,t,r){let o=Ps(e,{callstack:[]},t);return V(r)?zw(e,o,r.items):ee(r)?aE(e,o,r.items):q(e,$e(o),r)}function cE(e,t,r){return ht(r)?x(e):Qt(r)?x(e):q(e,t,r)}function pE(e,t,r){let[o,...i]=r;return A(o)?(()=>{let a=re(e,t,o);return _e(a)?x(a.inferred):pE(e,t,i)})():F()}function jp(e,t,r){let[o,...i]=t;return A(o)?(()=>{let a=pE(e,o,r);return _e(a)?jp(a.inferred,i,r):F()})():x(e)}function mE(e,t,r){let o=Rs(r);return Ui(o)?Cs(e,o.name,t,o.type):b(r)?jp(e,t,r.anyOf):jp(e,t,[r])}function uE(e,t,r){return Ae(r)?q(e,t,r):nt(r)?x(e):ut(r)?x(e):F()}function lE(e,t,r){return ht(r)?x(e):q(e,t,r)}function re(e,t,r){return nt(t)?Ph(e,t,r):ee(t)?Uh(e,t,t.items,r):Xe(t)?Nh(e,t.iteratorItems,r):gt(t)?kh(e,t,r):it(t)?wh(e,t,r):ke(t)?Lh(e,t.parameters,t.instanceType,r):Oe(t)?Mh(e,t,r):we(t)?vh(e,t.parameters,t.returnType,r):De(t)?Dh(e,t,r):U(t)?Vh(e,t.allOf,r):Je(t)?Yh(e,t.iteratorItems,r):Z(t)?Qh(e,t,r):or(t)?Wh(e,t,r):Kt(t)?Zh(e,t,r):Ee(t)?Xh(e,t,r):M(t)?Jh(e,t.properties,r):ze(t)?eE(e,t.item,r):Pe(t)?tE(e,t,r):zt(t)?rE(e,t,r):Se(t)?nE(e,t.pattern,r):V(t)?sE(e,t.items,r):Qt(t)?cE(e,t,r):b(t)?mE(e,t.anyOf,r):ut(t)?uE(e,t,r):ht(t)?lE(e,t,r):F()}function ro(e,t,r={}){return C("Interface",[e,t],r)}function po(e){return A(e)&&s.HasPropertyKey(e,"action")&&s.IsEqual(e.action,"Interface")}function dE(e,t,r={}){return R({},ro(e,t,r))}function Vw(e,t,r){return e.includes(r)?!0:vr([...e,r],t,t[r])}function fE(e,t,r){let o=ps(r);return dn(e,t,o)}function dn(e,t,r){let[o,...i]=r;return A(o)?vr(e,t,o)?!0:dn(e,t,i):!1}function vr(e,t,r){return ce(r)?Vw(e,t,r.$ref):ee(r)?vr(e,t,r.items):Xe(r)?vr(e,t,r.iteratorItems):ke(r)?dn(e,t,[...r.parameters,r.instanceType]):we(r)?dn(e,t,[...r.parameters,r.returnType]):po(r)?fE(e,t,r.parameters[1]):U(r)?dn(e,t,r.allOf):Je(r)?vr(e,t,r.iteratorItems):M(r)?fE(e,t,r.properties):ze(r)?vr(e,t,r.item):b(r)?dn(e,t,r.anyOf):V(r)?dn(e,t,r.items):Te(r)?vr(e,t,Ve(r)):!1}function Us(e,t,r){return vr(e,t,r)}function Yw(e,t){return t.reduce((r,o)=>o in e?Us([o],e,e[o])?[...r,o]:r:B(),[])}function gE(e){let t=df(e);return Yw(e,t)}function Qw(e,t,r){return r.includes(t)?r:t in e?Dr(e,e[t],[...r,t]):B()}function yE(e,t,r){let o=ps(t);return mo(e,o,r)}function mo(e,t,r){return t.reduce((o,i)=>Dr(e,i,o),r)}function Dr(e,t,r){return ce(t)?Qw(e,t.$ref,r):ee(t)?Dr(e,t.items,r):Xe(t)?Dr(e,t.iteratorItems,r):ke(t)?mo(e,[...t.parameters,t.instanceType],r):we(t)?mo(e,[...t.parameters,t.returnType],r):po(t)?yE(e,t.parameters[1],r):U(t)?mo(e,t.allOf,r):Je(t)?Dr(e,t.iteratorItems,r):M(t)?yE(e,t.properties,r):ze(t)?Dr(e,t.item,r):b(t)?mo(e,t.anyOf,r):V(t)?mo(e,t.items,r):Te(t)?Dr(e,Ve(t),r):r}function hE(e,t,r){return Dr(e,r,[t])}function Ww(e){return zn()}function Zw(e){return s.Keys(e).reduce((t,r)=>({...t,[r]:Zt(e[r])}),{})}function Ni(e){return e.reduce((t,r)=>[...t,Zt(r)],[])}function Zt(e){return ce(e)?Ww(e.$ref):ee(e)?Mt(Zt(e.items),ts(e)):Xe(e)?Bt(Zt(e.iteratorItems)):ke(e)?xr(Ni(e.parameters),Zt(e.instanceType)):we(e)?Rr(Ni(e.parameters),Zt(e.returnType)):U(e)?St(Ni(e.allOf)):Je(e)?Ht(Zt(e.iteratorItems)):M(e)?N(Zw(e.properties)):ze(e)?Vt(Zt(e.item)):Te(e)?us(Jn(e),Zt(Ve(e))):b(e)?G(Ni(e.anyOf)):V(e)?$e(Ni(e.items)):e}function Xw(e,t){return t in e?Zt(e[t]):He()}function EE(e){return Xw(e.$defs,e.$ref)}function Jw(e,t,r){let o=Et(e,{callstack:[]},t),i=ki({},{callstack:[]},r);return xe([...o,N(i)])}function eL(e,t){return s.Keys(e).filter(o=>t.includes(o)).reduce((o,i)=>{let a=e[i],c=po(a)?Jw(e,a.parameters[0],a.parameters[1]):a;return{...o,[i]:c}},{})}function TE(e,t,r){let o=hE(e,t,r),i=eL(e,o);return qt(i,t)}function IE(e,t){return t in e?ce(e[t])?IE(e,e[t].$ref):e[t]:W()}function Xt(e,t){return IE(e,t)}function _E(e){return pe(e)?EE(e):e}function Ze(e,t,r){let o=_E(t),i=_E(r);return re(e,o,i)}function tL(e,t,r){if(Ae(t)||uo(t)||k.IsExtendsTrueLike(Ze({},t,r)))return;let o={parameter:e,extends:r,received:t};throw new Error("Generic argument does not satify constraint",{cause:o})}function bE(e,t,r,o,i){let a=I(e,t,i);return tL(r,a,o),g.Assign(e,{[r]:a})}function rL(e,t,r,o,i){let a=I(e,t,r.extends),c=I(e,t,r.equals),[u,...l]=i;return A(u)?Fp(bE(e,t,r.name,a,u),t,o,l):Fp(bE(e,t,r.name,a,c),t,o,[])}function Fp(e,t,r,o){let[i,...a]=r;return A(i)?rL(e,t,i,a,o):e}function AE(e,t,r,o){return Fp(e,t,r,o)}function nL(e){return s.IsGreaterThan(e.length,0)?e[0]:""}function OE(e,t,r,o){let i=Et(e,t,o);return fs(r,i)}function oL(e,t,r,o){return OE(e,t,Ce(r),o)}function iL(e,t,r,o,i,a){let c=Et(e,t,a),u=AE(e,t,o,c),l=I(u,{callstack:[...t.callstack,r]},i);return I(e,t,l)}function Ns(e,t,r,o){let[i,a]=Bd(e,r,o);return Kn(a)?s.IsEqual(nL(t.callstack),i)?oL(e,t,i,o):iL(e,t,i,a.parameters,a.expression,o):OE(e,t,r,o)}function fs(e,t){return g.Create({"~kind":"Call"},{target:e,arguments:t},{})}function SE(e,t){return Ns({},{callstack:[]},e,t)}function uo(e){return _(e,"Call")}function xE(e){return ze(e)?xE(e.item):e}function aL(e,t,r,o){let i=I(e,t,r);return g.Update(xE(i),{},o)}function RE(e,t,r,o){return w(e,[r])?aL(e,t,r,o):bi(r,o)}function CE(e,t){return e(t)}function PE(e,t){return s.IsString(t)?z(CE(e,t)):z(t)}function UE(e,t){let r=Ye(t);return sr(e,r)}function NE(e,t){let r=t.map(o=>sr(e,o));return G(r)}function sr(e,t){return Z(t)?PE(e,t.const):Se(t)?UE(e,t.pattern):b(t)?NE(e,t.anyOf):t}function ii(e,t={}){return C("Capitalize",[e],t)}function kE(e,t={}){return R({},ii(e,t))}function ai(e,t={}){return C("Lowercase",[e],t)}function wE(e,t={}){return R({},ai(e,t))}function si(e,t={}){return C("Uncapitalize",[e],t)}function LE(e,t={}){return R({},si(e,t))}function ci(e,t={}){return C("Uppercase",[e],t)}function ME(e,t={}){return R({},ci(e,t))}var sL=e=>e[0].toUpperCase()+e.slice(1),cL=e=>e.toLowerCase(),pL=e=>e[0].toLowerCase()+e.slice(1),mL=e=>e.toUpperCase();function uL(e,t,r,o){let i=I(e,t,r);return g.Update(sr(sL,i),{},o)}function vE(e,t,r,o){return w(e,[r])?uL(e,t,r,o):ii(r,o)}function lL(e,t,r,o){let i=I(e,t,r);return g.Update(sr(cL,i),{},o)}function DE(e,t,r,o){return w(e,[r])?lL(e,t,r,o):ai(r,o)}function dL(e,t,r,o){let i=I(e,t,r);return g.Update(sr(pL,i),{},o)}function $E(e,t,r,o){return w(e,[r])?dL(e,t,r,o):si(r,o)}function fL(e,t,r,o){let i=I(e,t,r);return g.Update(sr(mL,i),{},o)}function GE(e,t,r,o){return w(e,[r])?fL(e,t,r,o):ci(r,o)}function pi(e,t,r,o,i={}){return C("Conditional",[e,t,r,o],i)}function jE(e,t,r,o,i={}){return R({},pi(e,t,r,o,i))}function gL(e,t,r,o,i,a,c){let u=I(e,t,r),l=I(e,t,o),f=Ze(e,u,l);return g.Update(k.IsExtendsUnion(f)?G([I(f.inferred,t,i),I(e,t,a)]):k.IsExtendsTrue(f)?I(f.inferred,t,i):I(e,t,a),{},c)}function FE(e,t,r,o,i,a,c){return w(e,[r,o])?gL(e,t,r,o,i,a,c):pi(r,o,i,a,c)}function mi(e,t={}){return C("ConstructorParameters",[e],t)}function BE(e,t={}){return R({},mi(e,t))}function yL(e){return ke(e)?I({},{callstack:[]},$e(e.parameters)):W()}function hL(e,t,r,o){let i=I(e,t,r);return g.Update(yL(i),{},o)}function qE(e,t,r,o){return w(e,[r])?hL(e,t,r,o):mi(r,o)}function ui(e,t,r={}){return C("Exclude",[e,t],r)}function HE(e,t,r={}){return R({},ui(e,t,r))}function KE(e,t){return e.reduce((r,o)=>[...r,...zE(o,t)],[])}function zE(e,t){let r=Ze({},e,t);return k.IsExtendsTrueLike(r)?[]:[e]}function EL(e,t){let r=Oe(e)?KE(vt(e.enum),t):b(e)?KE(Wt(e.anyOf),t):zE(e,t);return ar(r)}function TL(e,t,r,o,i){let a=I(e,t,r),c=I(e,t,o);return g.Update(EL(a,c),{},i)}function ks(e,t,r,o,i){return w(e,[r,o])?TL(e,t,r,o,i):ui(r,o,i)}function li(e,t,r={}){return C("Extract",[e,t],r)}function VE(e,t,r={}){return R({},li(e,t,r))}function YE(e,t){return e.reduce((r,o)=>[...r,...QE(o,t)],[])}function QE(e,t){let r=Ze({},e,t);return k.IsExtendsTrueLike(r)?[e]:[]}function IL(e,t){let r=Oe(e)?YE(vt(e.enum),t):b(e)?YE(Wt(e.anyOf),t):QE(e,t);return ar(r)}function _L(e,t,r,o,i){let a=I(e,t,r),c=I(e,t,o);return g.Update(IL(a,c),{},i)}function WE(e,t,r,o,i){return w(e,[r,o])?_L(e,t,r,o,i):li(r,o,i)}var bL=new RegExp("^(?:0|[1-9][0-9]*)$");function lo(e){let t=`${e}`;return bL.test(t)?parseInt(t):e}function AL(e){return z(lo(e))}function ZE(e){return e.map(t=>XE(t))}function XE(e){return U(e)?St(ZE(e.allOf)):b(e)?G(ZE(e.anyOf)):Z(e)?AL(e.const):e}function JE(e,t){let r=XE(t),o=Ze({},r,xt());return k.IsExtendsTrueLike(o)?e:W()}function eT(e,t){let r=Xt(e,t);return Jt(r)}function ws(e){return e.reduce((t,r)=>[...t,...Jt(r)],[])}function tT(e){let t=vt(e);return ws(t)}function rT(e){let t=xe(e);return Jt(t)}function nT(e){return[`${e}`]}function oT(e){let t=Ye(e);return Jt(t)}function Jt(e){return pe(e)?eT(e.$defs,e.$ref):Oe(e)?tT(e.enum):U(e)?rT(e.allOf):Z(e)?nT(e.const):Se(e)?oT(e.pattern):b(e)?ws(e.anyOf):[]}function fo(e){return Jt(e)}function OL(e,t){return t in e?[e[t]]:[]}function SL(e,t){return t.reduce((r,o)=>[...r,...OL(e,o)],[])}function iT(e,t){let r=fo(t),o=SL(e,r);return ar(o)}function xL(e){return z(lo(e))}function aT(e){return e.map(t=>Bp(t))}function Bp(e){return U(e)?St(aT(e.allOf)):b(e)?G(aT(e.anyOf)):Z(e)?xL(e.const):e}function RL(e,t){return e.reduceRight((r,o,i)=>{let a=Ze({},z(i),t);return k.IsExtendsTrueLike(a)?[o,...r]:r},[])}function CL(e,t){let r=Bp(t),o=RL(e,r);return ln(o)}function PL(e){return ln(e)}function sT(e,t){return Ee(t)||De(t)?PL(e):CL(e,t)}function UL(e){return e.reduce((t,r)=>ss(r)?[...t,z(r)]:t,[])}function go(e){let t=UL(e);return G(t)}function no(e,t,r={}){return C("Index",[e,t],r)}function cT(e,t,r={}){let o=s.IsArray(t)?go(t):t;return R({},no(e,o,r))}function pT(e,t){let r=Xt(e,t);return Dt(r)}function NL(e,t){let r=s.Keys(e).filter(y=>!s.HasPropertyKey(t,y)),o=s.Keys(t).filter(y=>!s.HasPropertyKey(e,y)),i=s.Keys(e).filter(y=>s.HasPropertyKey(t,y)),a=r.reduce((y,E)=>({...y,[E]:e[E]}),{}),c=o.reduce((y,E)=>({...y,[E]:t[E]}),{}),u=i.reduce((y,E)=>({...y,[E]:xe([e[E],t[E]])}),{}),l=g.Assign(a,c);return g.Assign(l,u)}function mT(e){return e.reduce((t,r)=>NL(t,Dt(r)),{})}function uT(e){let t=$h($e(e));return Dt(t)}function kL(e,t){return s.Keys(e).filter(i=>i in t).reduce((i,a)=>({...i,[a]:ar([e[a],t[a]])}),{})}function lT(e,t){let[r,...o]=e;return A(r)?lT(o,kL(t,Dt(r))):t}function dT(e){let[t,...r]=e;return A(t)?lT(r,Dt(t)):B()}function Dt(e){return pe(e)?pT(e.$defs,e.$ref):U(e)?mT(e.allOf):b(e)?dT(e.anyOf):V(e)?uT(e.items):M(e)?e.properties:{}}function yo(e){let t=Dt(e);return N(t)}function wL(e){return pe(e)||U(e)||b(e)?yo(e):e}function LL(e,t){let r=wL(e);return ee(r)?JE(r.items,t):M(r)?iT(r.properties,t):V(r)?sT(r.items,t):W()}function ML(e,t,r,o,i){let a=I(e,t,r),c=I(e,t,o);return g.Update(LL(a,c),{},i)}function fT(e,t,r,o,i){return w(e,[r,o])?ML(e,t,r,o,i):no(r,o,i)}function di(e,t={}){return C("InstanceType",[e],t)}function gT(e,t={}){return R({},di(e,t))}function vL(e){return ke(e)?e.instanceType:W()}function DL(e,t,r,o){let i=I(e,t,r);return g.Update(vL(i),{},o)}function yT(e,t,r,o={}){return w(e,[r])?DL(e,t,r,o):di(r,o)}function $L(e,t,r,o,i){let a=Et(e,{callstack:[]},r),c=ki(e,{callstack:[]},o),u=xe([...a,N(c)]);return g.Update(u,{},i)}function hT(e,t,r,o,i){return w(e,r)?$L(e,t,r,o,i):ro(r,o,i)}function oo(e,t={}){return C("KeyOf",[e],t)}function ET(e,t={}){return R({},oo(e,t))}function TT(){return G([xt(),lt(),Wn()])}function IT(e){return xt()}function GL(e){return e.reduce((r,o)=>ss(o)?[...r,z(lo(o))]:B(),[])}function _T(e){let t=s.Keys(e),r=GL(t);return ln(r)}function bT(e){return Jn(e)}function AT(e){let t=e.map((r,o)=>z(o));return ln(t)}function jL(e){return pe(e)||U(e)||b(e)?yo(e):e}function FL(e){let t=jL(e);return nt(t)?TT():ee(t)?IT(t.items):M(t)?_T(t.properties):Te(t)?bT(t):V(t)?AT(t.items):W()}function BL(e,t,r,o){let i=I(e,t,r);return g.Update(FL(i),{},o)}function OT(e,t,r,o){return w(e,[r])?BL(e,t,r,o):oo(r,o)}function qL(e){let t=Ye(e);return qp(t)}function ST(e){return e.reduce((t,r)=>[...t,...qp(r)],[])}function qp(e){return Oe(e)?ST(vt(e.enum)):Qn(e)||Yn(e)?[e]:Se(e)?qL(e.pattern):b(e)?ST(e.anyOf):[]}function xT(e){return qp(e)}function to(e,t,r,o,i={}){return C("Mapped",[e,t,r,o],i)}function RT(e,t,r,o,i={}){return R({},to(e,t,r,o,i))}function HL(e,t,r,o,i){let a=g.Assign(e,{[r.name]:o}),c=I(a,t,i);return Se(c)?Ye(c.pattern):c}function KL(e,t,r,o,i){let a=g.Assign(e,{[r.name]:o});return I(a,t,i)}function zL(e,t,r,o,i,a){let c=KL(e,t,r,o,a),u=HL(e,t,r,o,i);return Qn(u)||Yn(u)?{[u.const]:c}:{}}function VL(e,t,r,o,i,a){return o.reduce((c,u)=>({...c,...zL(e,t,r,u,i,a)}),{})}function YL(e,t,r,o,i,a){let c=xT(o),u=VL(e,t,r,c,i,a);return N(u)}function QL(e,t,r,o,i,a,c){let u=I(e,t,o);return g.Update(YL(e,t,r,u,i,a),{},c)}function CT(e,t,r,o,i,a,c){return w(e,[o])?QL(e,t,r,o,i,a,c):to(r,o,i,a,c)}function WL(e,t){return s.Keys(e).filter(o=>t.includes(o)).reduce((o,i)=>({...o,[i]:TE(e,i,e[i])}),{})}function ZL(e,t){return s.Keys(e).filter(o=>!t.includes(o)).reduce((o,i)=>({...o,[i]:I(e,{callstack:[]},e[i])}),{})}function XL(e,t){let r=gE(e),o=WL(e,r),i=ZL(e,r),a={...o,...i};return g.Update(a,{},t)}function PT(e,t,r,o){let i=g.Assign(e,r);return XL(i,o)}function fi(e,t={}){return C("NonNullable",[e],t)}function UT(e,t={}){return R({},fi(e,t))}function JL(e){let t=G([Nr(),eo()]);return ks({},{callstack:[]},e,t,{})}function eM(e,t,r,o){let i=I(e,t,r);return g.Update(JL(i),{},o)}function NT(e,t,r,o){return w(e,[r])?eM(e,t,r,o):fi(r,o)}function Ls(e){let t=yo(e);return M(t)?t.properties:B()}function gi(e,t,r={}){return C("Omit",[e,t],r)}function kT(e,t,r={}){let o=s.IsArray(t)?go(t):t;return R({},gi(e,o,r))}function tM(e,t){return s.Keys(e).reduce((o,i)=>t.includes(i)?o:{...o,[i]:e[i]},{})}function rM(e,t){let r=Ls(e),o=fo(t),i=tM(r,o);return N(i)}function nM(e,t,r,o,i){let a=I(e,t,r),c=I(e,t,o);return g.Update(rM(a,c),{},i)}function wT(e,t,r,o,i){return w(e,[r,o])?nM(e,t,r,o,i):gi(r,o,i)}function io(e,t){return C("Options",[e,t],{})}function Ms(e,t){return R({},io(e,t))}function oM(e,t,r,o){let i=I(e,t,r);return g.Update(i,{},o)}function LT(e,t,r,o){return w(e,[r])?oM(e,t,r,o):io(r,o)}function yi(e,t={}){return C("Parameters",[e],t)}function MT(e,t={}){return R({},yi(e,t))}function iM(e){return we(e)?I({},{callstack:[]},$e(e.parameters)):W()}function aM(e,t,r,o){let i=I(e,t,r);return g.Update(iM(i),{},o)}function vT(e,t,r,o){return w(e,[r])?aM(e,t,r,o):yi(r,o)}function hi(e,t={}){return C("Partial",[e],t)}function DT(e,t={}){return R({},hi(e,t))}function $T(e,t){let r=Xt(e,t),o=$r(r);return qt(g.Assign(e,{[t]:o}),t)}function GT(e){let t=e.map(r=>$r(r));return xe(t)}function jT(e){let t=e.map(r=>$r(r));return G(t)}function FT(e){let t=s.Keys(e).reduce((o,i)=>({...o,[i]:Xa(e[i])}),{});return N(t)}function $r(e){return pe(e)?$T(e.$defs,e.$ref):U(e)?GT(e.allOf):b(e)?jT(e.anyOf):M(e)?FT(e.properties):N({})}function sM(e,t,r,o){let i=I(e,t,r);return g.Update($r(i),{},o)}function BT(e,t,r,o){return w(e,[r])?sM(e,t,r,o):hi(r,o)}function Ei(e,t,r={}){return C("Pick",[e,t],r)}function qT(e,t,r={}){let o=s.IsArray(t)?go(t):t;return R({},Ei(e,o,r))}function cM(e,t){return s.Keys(e).reduce((o,i)=>t.includes(i)?g.Assign(o,{[i]:e[i]}):o,{})}function pM(e,t){let r=Ls(e),o=fo(t),i=cM(r,o);return N(i)}function mM(e,t,r,o,i){let a=I(e,t,r),c=I(e,t,o);return g.Update(pM(a,c),{},i)}function HT(e,t,r,o,i){return w(e,[r,o])?mM(e,t,r,o,i):Ei(r,o,i)}function Ti(e,t={}){return C("ReadonlyType",[e],t)}function KT(e,t={}){return R({},Ti(e,t))}function zT(e){return Sr(Mt(e))}function VT(e,t){let r=Xt(e,t),o=Gr(r);return qt(g.Assign(e,{[t]:o}),t)}function YT(e){let t=e.map(r=>Gr(r));return xe(t)}function QT(e){let t=s.Keys(e).reduce((o,i)=>({...o,[i]:es(e[i])}),{});return N(t)}function WT(e){return Sr($e(e))}function ZT(e){let t=e.map(r=>Gr(r));return G(t)}function Gr(e){return ee(e)?zT(e.items):pe(e)?VT(e.$defs,e.$ref):U(e)?YT(e.allOf):M(e)?QT(e.properties):V(e)?WT(e.items):b(e)?ZT(e.anyOf):e}function uM(e,t,r,o){let i=I(e,t,r);return g.Update(Gr(i),{},o)}function XT(e,t,r,o){return w(e,[r])?uM(e,t,r,o):Ti(r,o)}function JT(e){return dt(Yt,e)}function eI(e){return N({true:e,false:e})}function tI(e,t){let r=Ai(e);return jr(r,t)}function rI(e,t){return dt(Zn,t)}function nI(e,t){let r=xe(e);return jr(r,t)}function oI(e,t){return s.IsString(e)||s.IsNumber(e)?N({[e]:t}):s.IsEqual(e,!1)?N({false:t}):s.IsEqual(e,!0)?N({true:t}):N({})}function iI(e,t){return dt(Xn,t)}function aI(e,t){return s.HasPropertyKey(e,"pattern")&&(s.IsString(e.pattern)||e.pattern instanceof RegExp)?dt(e.pattern.toString(),t):dt(Yt,t)}function sI(e,t){let r=As(e);return Os(r)?jr(Ye(e),t):dt(e,t)}function lM(e){return e.some(t=>Pe(t)||Ee(t)||De(t))}function dM(e,t){return s.IsEqual(lM(e),!0)?dt(Yt,t):void 0}function fM(e,t){return e.reduce((r,o)=>Z(o)&&(s.IsString(o.const)||s.IsNumber(o.const))?{...r,[o.const]:t}:r,{})}function gM(e,t){let r=fM(e,t);return N(r)}function cI(e,t){let r=Wt(e),o=dM(r,t);return A(o)?o:gM(r,t)}function jr(e,t){return nt(e)?JT(t):it(e)?eI(t):Oe(e)?tI(e.enum,t):De(e)?rI(e,t):U(e)?nI(e.allOf,t):Z(e)?oI(e.const,t):Ee(e)?iI(e,t):b(e)?cI(e.anyOf,t):Pe(e)?aI(e,t):Se(e)?sI(e.pattern,t):N({})}function yM(e,t,r,o,i){let a=I(e,t,r),c=I(e,t,o);return g.Update(jr(a,c),{},i)}function pI(e,t,r,o,i){return w(e,[r])?yM(e,t,r,o,i):ni(r,o,i)}function mI(e,t,r){return r in e?Us([r],e,e[r])?Ce(r):I(e,t,e[r]):Ce(r)}function uI(e,t){let r=Xt(e,t),o=Fr(r);return qt(g.Assign(e,{[t]:o}),t)}function lI(e){let t=e.map(r=>Fr(r));return xe(t)}function dI(e){let t=e.map(r=>Fr(r));return G(t)}function fI(e){let t=s.Keys(e).reduce((o,i)=>({...o,[i]:Hn(e[i])}),{});return N(t)}function Fr(e){return pe(e)?uI(e.$defs,e.$ref):U(e)?lI(e.allOf):b(e)?dI(e.anyOf):M(e)?fI(e.properties):N({})}function Ii(e,t={}){return C("Required",[e],t)}function gI(e,t={}){return R({},Ii(e,t))}function hM(e,t,r,o){let i=I(e,t,r);return g.Update(Fr(i),{},o)}function yI(e,t,r,o){return w(e,[r])?hM(e,t,r,o):Ii(r,o)}function _i(e,t={}){return C("ReturnType",[e],t)}function hI(e,t={}){return R({},_i(e,t))}function EM(e){return we(e)?e.returnType:W()}function TM(e,t,r,o){let i=I(e,t,r);return g.Update(EM(i),{},o)}function EI(e,t,r,o){return w(e,[r])?TM(e,t,r,o):_i(r,o)}function TI(e){return g.Create({"~kind":"TemplateLiteral"},{type:"string",pattern:e},{})}function IM(e){return e.join("|")}function _M(e){return e.slice(1,e.length-1)}function bM(e,t,r){return Br(t,`${r}${e}`)}function AM(e,t){return Br(e,`${t}${sf}`)}function OM(e,t){return Br(e,`${t}${as}`)}function SM(e,t){return Br(e,`${t}${cs}`)}function xM(e,t){return Kp(G([z("false"),z("true")]),e,t)}function RM(e,t){return Br(e,`${t}${ms}`)}function CM(e,t,r){return Br(t,`${r}${_M(e)}`)}function PM(e,t,r,o=[]){let i=vt(e);return Hp(i,t,r)}function Hp(e,t,r,o=[]){let[i,...a]=e;return A(i)?Hp(a,t,r,[...o,Kp(i,[],"")]):Br(t,`${r}(${IM(o)})`)}function Kp(e,t,r){return Oe(e)?PM(e.enum,t,r):De(e)?OM(t,r):Z(e)?bM(e.const,t,r):gt(e)?AM(t,r):it(e)?xM(t,r):Ee(e)?SM(t,r):Pe(e)?RM(t,r):Se(e)?CM(e.pattern,t,r):b(e)?Hp(e.anyOf,t,r):jd}function Br(e,t){let[r,...o]=e;return A(r)?Kp(r,o,t):t}function UM(e){return`^${Br(e,"")}$`}function II(e){let t=UM(e);return TI(t)}function NM(e,t,r,o){let i=Et(e,t,r);return g.Update(II(i),{},o)}function _I(e,t,r,o){return w(e,r)?NM(e,t,r,o):oi(r,o)}function kM(e){return kr(e)?V(e.items)?zp(e.items.items):Ae(e.items)?[e]:ce(e.items)?[e]:[W()]:[e]}function zp(e){return e.reduce((r,o)=>[...r,...kM(o)],[])}function wM(e,t){return t in e}function LM(e,t){return U(t)?w(e,t.allOf):b(t)?w(e,t.anyOf):ce(t)?wM(e,t.$ref):!0}function w(e,t){let[r,...o]=t;return A(r)?LM(e,r)?w(e,o):!1:!0}function wi(e,t,r){return Ld(e)?wi(e.type,"remove",r):Ud(e)?wi(e.type,t,"remove"):kd(e)?wi(e.type,"add",r):Cd(e)?wi(e.type,t,"add"):[e,t,r]}function MM(e,t){return s.IsEqual(e,"remove")?Ja(t):s.IsEqual(e,"add")?mt(t):t}function vM(e,t){return s.IsEqual(e,"remove")?Hn(t):s.IsEqual(e,"add")?pt(t):t}function ki(e,t,r){return s.Keys(r).reduce((o,i)=>({...o,[i]:I(e,t,r[i])}),{})}function Ps(e,t,r){let o=Et(e,t,r);return zp(o)}function Et(e,t,r){return r.map(o=>I(e,t,o))}function DM(e,t,r,o,i){return s.IsEqual(r,"Awaited")?RE(e,t,o[0],i):s.IsEqual(r,"Capitalize")?vE(e,t,o[0],i):s.IsEqual(r,"Conditional")?FE(e,t,o[0],o[1],o[2],o[3],i):s.IsEqual(r,"ConstructorParameters")?qE(e,t,o[0],i):s.IsEqual(r,"Evaluate")?zh(e,t,o[0],i):s.IsEqual(r,"Exclude")?ks(e,t,o[0],o[1],i):s.IsEqual(r,"Extract")?WE(e,t,o[0],o[1],i):s.IsEqual(r,"Index")?fT(e,t,o[0],o[1],i):s.IsEqual(r,"InstanceType")?yT(e,t,o[0],i):s.IsEqual(r,"Interface")?hT(e,t,o[0],o[1],i):s.IsEqual(r,"KeyOf")?OT(e,t,o[0],i):s.IsEqual(r,"Lowercase")?DE(e,t,o[0],i):s.IsEqual(r,"Mapped")?CT(e,t,o[0],o[1],o[2],o[3],i):s.IsEqual(r,"Module")?PT(e,t,o[0],i):s.IsEqual(r,"NonNullable")?NT(e,t,o[0],i):s.IsEqual(r,"Pick")?HT(e,t,o[0],o[1],i):s.IsEqual(r,"Options")?LT(e,t,o[0],o[1]):s.IsEqual(r,"Parameters")?vT(e,t,o[0],i):s.IsEqual(r,"Partial")?BT(e,t,o[0],i):s.IsEqual(r,"Omit")?wT(e,t,o[0],o[1],i):s.IsEqual(r,"ReadonlyType")?XT(e,t,o[0],i):s.IsEqual(r,"Record")?pI(e,t,o[0],o[1],i):s.IsEqual(r,"Required")?yI(e,t,o[0],i):s.IsEqual(r,"ReturnType")?EI(e,t,o[0],i):s.IsEqual(r,"TemplateLiteral")?_I(e,t,o[0],i):s.IsEqual(r,"Uncapitalize")?$E(e,t,o[0],i):s.IsEqual(r,"Uppercase")?GE(e,t,o[0],i):C(r,o,i)}function I(e,t,r){let o=nn(r),i=wi(r,on(r)?"add":"none",Ne(r)?"add":"none"),a=Ot(i[0])?i[0].Clone():i[0],c=ce(a)?mI(e,t,a.$ref):ee(a)?Mt(I(e,t,a.items),ts(a)):Xe(a)?Bt(I(e,t,a.iteratorItems),vd(a)):uo(a)?Ns(e,t,a.target,a.arguments):ke(a)?xr(Et(e,t,a.parameters),I(e,t,a.instanceType),$d(a)):Md(a)?DM(e,t,a.action,a.parameters,a.options):we(a)?Rr(Et(e,t,a.parameters),I(e,t,a.returnType),Gd(a)):U(a)?St(Et(e,t,a.allOf),zd(a)):Je(a)?Ht(I(e,t,a.iteratorItems),pf(a)):M(a)?N(ki(e,t,a.properties),ff(a)):ze(a)?Vt(I(e,t,a.item),yf(a)):Te(a)?hf(yt(a),I(e,t,Ve(a))):kr(a)?pn(I(e,t,a.items)):V(a)?$e(Ps(e,t,a.items),Tf(a)):b(a)?G(Et(e,t,a.anyOf),If(a)):a,u=o?Sr(c):c;return MM(i[1],vM(i[2],u))}function R(e,t){return I(e,{callstack:[]},t)}function bi(e,t={}){return C("Awaited",[e],t)}function bI(e,t={}){return R({},bi(e,t))}function Ep(e,t={}){return C("Evaluate",[e],t)}function $t(e,t={}){return R({},Ep(e,t))}function Tp(e,t={}){return C("Module",[e],t)}function AI(e,t={}){return R({},Tp(e,t))}function OI(...e){let[t,r,o]=ie.Match(e,{2:(c,u)=>s.IsString(c)?[{},c,u]:[c,u,{}],3:(c,u,l)=>[c,u,l],1:c=>[{},c,{}]}),i=gh(r),a=s.IsArray(i)&&s.IsEqual(i.length,2)?I(t,{callstack:[]},i[0]):W();return g.Update(a,{},o)}var n={};Pt(n,{Any:()=>zn,Array:()=>Mt,AsyncIterator:()=>Bt,Awaited:()=>bI,Base:()=>rs,BigInt:()=>ti,Boolean:()=>is,Call:()=>SE,Capitalize:()=>kE,Codec:()=>ns,Conditional:()=>jE,Constructor:()=>xr,ConstructorParameters:()=>BE,Cyclic:()=>qt,Decode:()=>nf,DecodeBuilder:()=>ei,Encode:()=>of,EncodeBuilder:()=>Jo,Enum:()=>Kd,Evaluate:()=>$t,Exclude:()=>HE,Extends:()=>Ze,ExtendsResult:()=>k,Extract:()=>VE,Function:()=>Rr,Generic:()=>Cr,Identifier:()=>ri,Immutable:()=>Sr,Index:()=>cT,Infer:()=>Xo,InstanceType:()=>gT,Instantiate:()=>R,Integer:()=>sn,Interface:()=>dE,Intersect:()=>St,IsAny:()=>nt,IsArray:()=>ee,IsAsyncIterator:()=>Xe,IsBase:()=>Ot,IsBigInt:()=>gt,IsBoolean:()=>it,IsCall:()=>uo,IsCodec:()=>an,IsConstructor:()=>ke,IsCyclic:()=>pe,IsEnum:()=>Oe,IsFunction:()=>we,IsGeneric:()=>Kn,IsIdentifier:()=>cf,IsImmutable:()=>nn,IsInfer:()=>Ae,IsInteger:()=>De,IsIntersect:()=>U,IsIterator:()=>Je,IsKind:()=>_,IsLiteral:()=>Z,IsNever:()=>or,IsNull:()=>Kt,IsNumber:()=>Ee,IsObject:()=>M,IsOptional:()=>Ne,IsParameter:()=>gf,IsPromise:()=>ze,IsReadonly:()=>on,IsRecord:()=>Te,IsRef:()=>ce,IsRefine:()=>os,IsRest:()=>kr,IsSchema:()=>A,IsString:()=>Pe,IsSymbol:()=>zt,IsTemplateLiteral:()=>Se,IsThis:()=>Ef,IsTuple:()=>V,IsUndefined:()=>Qt,IsUnion:()=>b,IsUnknown:()=>ut,IsUnsafe:()=>bf,IsVoid:()=>ht,Iterator:()=>Ht,KeyOf:()=>ET,Literal:()=>z,Lowercase:()=>wE,Mapped:()=>RT,Module:()=>AI,Never:()=>W,NonNullable:()=>UT,Null:()=>Nr,Number:()=>xt,Object:()=>N,Omit:()=>kT,Optional:()=>Xa,Options:()=>Ms,Parameter:()=>cn,Parameters:()=>MT,Partial:()=>DT,Pick:()=>qT,Promise:()=>Vt,Readonly:()=>es,ReadonlyType:()=>KT,Record:()=>us,RecordKey:()=>Jn,RecordKeyAsPattern:()=>yt,RecordValue:()=>Ve,Ref:()=>Ce,Refine:()=>af,Required:()=>gI,Rest:()=>pn,ReturnType:()=>hI,Script:()=>OI,String:()=>lt,Symbol:()=>Wn,TemplateLiteral:()=>Eh,This:()=>ls,Tuple:()=>$e,Uncapitalize:()=>LE,Undefined:()=>eo,Union:()=>G,Unknown:()=>He,Unsafe:()=>_f,Uppercase:()=>ME,Void:()=>ds});var Vp=["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"],Mde=n.Enum(Vp),$M=["CLUSTER_AGGREGATION_STRUCTURE"],vde=n.Object({code:n.Enum(Vp),message:n.String()}),SI=[...Vp,...$M,"ABORT_ERROR","BAD_REQUEST","DUPLICATE_KEY_VIOLATION","FOREIGN_KEY_VIOLATION","FST_ERR_VALIDATION","INVALID_INPUT","FORBIDDEN","MISSING_PERMISSION","PRIVILEGE_ESCALATION","ORG_NOT_FOUND_AUTHENTICATION_ERROR","RATE_LIMITED","RESERVED_TAG_POLICY_ERROR","RESOURCE_NOT_FOUND","INVALID_INVITATION","TAG_POLICY_ALREADY_EXISTS_ERROR","TAG_POLICY_VALIDATION_ERROR","UNAUTHORIZED","URL_NOT_FOUND"],xI=["INTERNAL_ERROR","INVALID_QUERY_TO_CLUSTER"];var GM=["NETWORK_ERROR","RESPONSE_PARSE_ERROR"],jM=[...SI,...xI,...GM],Dde=n.Object({code:n.Optional(n.Enum(jM,{description:"Machine readable error code describing what went wrong"})),message:n.String({description:"Human readable explanation of the error"}),statusCode:n.Number({description:"HTTP status code that was returned"})},{$id:"ErrorResponse",description:"Standard envelope for API errors"}),$de=n.Object({code:n.Optional(n.Enum(SI,{description:"Machine readable error code describing what went wrong"})),message:n.String({description:"Human readable explanation of the error"}),statusCode:n.Number({description:"HTTP status code that was returned"})},{$id:"ClientErrorResponse",description:"Standard envelope for client (4XX) API errors"}),Gde=n.Object({code:n.Optional(n.Enum(xI,{description:"Machine readable error code describing what went wrong"})),message:n.String({description:"Human readable explanation of the error"}),statusCode:n.Number({description:"HTTP status code that was returned"})},{$id:"ServerErrorResponse",description:"Standard envelope for server (5XX) API errors"}),jde=n.Object({requestId:n.String({description:"Identifier used to trace the lifecycle of this API request"}),error:n.Ref("ClientErrorResponse")},{$id:"ClientErrorEnvelope",description:"Standard envelope wrapping all client (4XX) error responses"}),Fde=n.Object({requestId:n.String({description:"Identifier used to trace the lifecycle of this API request"}),error:n.Ref("ServerErrorResponse")},{$id:"ServerErrorEnvelope",description:"Standard envelope wrapping all server (5XX) error responses"});var RI="lowercase-email",Yp="iana-timezone",Qp="simple-time",Wp="simple-date-time";var FM=(e,t)=>RegExp(`^${e.source}(${t.source}${e.source})*$`),BM=/[a-zA-Z0-9-_]+/,qM=/\./,qde=FM(BM,qM);var CI="lowercase-domain";var vs="kebab-case";var PI="camel-case";var HM=new Set;function O(e,t,r={}){let o=t.map(i=>{let a=i;return a.$id?(HM.add(i),n.Ref(a.$id)):i});return n.Unsafe({...r,type:"object",discriminator:{propertyName:e},required:[e],oneOf:o})}function cr(e,t){return n.Object({values:n.Array(e,{maxItems:t.maxItems}),exclude:n.Optional(n.Boolean({description:"If true, exclude rows matching these values instead of including them"}))},{description:t.description})}var te={limit:n.Optional(n.Integer({minimum:1,maximum:1e3,description:"Maximum number of items to return in this page. Valid values are 1 through 1000."})),offset:n.Optional(n.Integer({minimum:0,description:"Zero-based index of the first matching item to return. Increase it with `limit` to request later pages."}))},KM=n.Object({totalCount:n.Integer({description:"Total number of items matching the query before `limit` and `offset` are applied."}),pageCount:n.Integer({description:"Total number of pages available for the requested `limit`."})}),Yde=n.Object({pagination:KM},{$id:"ResponseMetadata"});function T(e={}){return n.Unsafe({...e,type:"string"})}function m({allowEmpty:e=!0,type:t="short",description:r}={}){let o=e?0:1,i=r===void 0?{}:{description:r};switch(t){case"camel-case":return n.String({format:PI,minLength:o,maxLength:250,...i});case"kebab-case":return n.String({format:vs,minLength:o,maxLength:250,...i});case"email":return n.String({format:RI,minLength:o,maxLength:254,errorMessage:{format:"Must be a valid lowercase email address."},...i});case"lowercase-domain":return n.String({format:CI,minLength:o,maxLength:250,...i});case"tsuga-query":return n.String({format:"tsuga-query",minLength:o,maxLength:1e4,...i});case"tags-query":return n.String({format:"tags-query",minLength:o,maxLength:1e4,errorMessage:{format:"Must be a valid tags query: only tag:value searches (no wildcards), boolean operators, and parentheses are supported. The query you provided is invalid: ${0}"},...i});case"date-time":return n.String({format:"date-time",...i});case"uri":return n.String({format:"uri",...i});case"user-password":return n.String({format:"user-password",minLength:12,maxLength:250,...i});case"long":return n.String({minLength:o,maxLength:5e4,...i});case"short":return n.String({minLength:o,maxLength:250,...i});case"tsuga-formula":return n.String({format:"tsuga-formula",minLength:o,maxLength:250,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}"},...i});case"time":return n.String({format:"time",...i});case"readonly-sql-query":return n.String({format:"readonly-sql-query",minLength:o,maxLength:5e4,errorMessage:{format:"Must be a readonly SQL query - only SELECT statements are allowed."},...i});default:We(t)}}function d({body:e,description:t,method:r,operationId:o,params:i,tags:a,query:c,paginated:u,response:l,url:f}){return i?{buildUrl:E=>f.replace(/:[a-zA-Z_]+/g,S=>E[S.slice(1)]),method:r,params:i,response:l,templateUrl:f,...e===void 0?{}:{body:e},...t===void 0?{}:{description:t},...o===void 0?{}:{operationId:o},...c===void 0?{}:{query:c},...u===void 0?{}:{paginated:u},...a===void 0?{}:{tags:a}}:{method:r,response:l,url:f,templateUrl:f,...e===void 0?{}:{body:e},...t===void 0?{}:{description:t},...o===void 0?{}:{operationId:o},...c===void 0?{}:{query:c},...u===void 0?{}:{paginated:u},...a===void 0?{}:{tags:a}}}function UI(e,t){if(!t||typeof t!="object")return e;let r=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")&&r.append(o,String(a))}):(typeof i=="boolean"||typeof i=="string"||typeof i=="number")&&r.append(o,String(i))}),`${e}?${r.toString()}`}var L=n.Object({success:n.Literal(!0,{description:"Always `true` when the delete request completed and the resource was removed."})},{$id:"DeleteResponse",example:{success:!0}});var Zp="tsuga-cli",fn="/v0/oauth",NI=d({description:"OAuth 2.1 authorization endpoint: validates the client and redirect URI, then redirects to the consent page",url:`${fn}/authorize`,method:"GET",query:n.Partial(n.Object({response_type:n.String({description:"Must be `code`"}),client_id:n.String({description:"First-party client id or CIMD document URL"}),redirect_uri:n.String({description:"Client redirect URI"}),code_challenge:n.String({description:"PKCE code challenge"}),code_challenge_method:n.String({description:"Must be `S256`"}),state:n.String({description:"Opaque client state, echoed back"}),resource:n.String({description:"RFC 8707 resource indicator"})})),response:n.Object({},{description:"Never returned: this endpoint redirects (302) or renders an HTML error (400)"})}),kI=d({description:"OAuth 2.1 token endpoint: exchanges an authorization code (PKCE) or refresh token for a token pair",url:`${fn}/token`,method:"POST",body:n.Partial(n.Object({grant_type:n.String({description:"`authorization_code` or `refresh_token`"}),code:n.String({description:"Authorization code being exchanged"}),code_verifier:n.String({description:"PKCE code verifier"}),redirect_uri:n.String({description:"Must match the redirect URI used on /authorize"}),client_id:n.String({description:"Client id, when sent by the client"}),refresh_token:n.String({description:"Refresh token, for `grant_type=refresh_token`"})})),response:n.Object({access_token:n.String(),token_type:n.Literal("Bearer"),expires_in:n.Number({description:"Access token lifetime in seconds"}),refresh_token:n.String()})}),mfe=d({description:"Resolve a signed authorization request handle for the consent page",url:`${fn}/authorization-request`,method:"GET",query:n.Object({handle:n.String()}),response:n.Object({clientId:n.String(),clientName:n.String(),redirectUri:n.String()})}),ufe=d({description:"Approve or deny an OAuth authorization request from the consent page",url:`${fn}/approve`,method:"POST",body:n.Object({handle:n.String({description:"The signed authorization request handle"}),approve:n.Boolean()}),response:n.Object({redirectTo:n.String({description:"The client's redirect URI carrying either the code or the denial"})})}),lfe=d({description:"Validate an OAuth access token (internal, for the MCP resource server)",url:`${fn}/introspect`,method:"POST",body:n.Object({token:n.String()}),response:n.Object({active:n.Boolean(),userId:n.Optional(n.String()),orgId:n.Optional(n.String())})}),zM=["pending","active","revoked"],VM=n.Object({id:n.String(),createdAt:T(),clientId:n.String({description:"Client ID Metadata Document URL or first-party client id"}),clientName:n.String({description:"Display name derived from the client identity"}),userId:n.String(),status:n.Enum(zM),lastUsedAt:n.Optional(T())}),dfe=d({tags:["oauth"],description:"List OAuth grants: your own, or all users for admins",url:`${fn}/grants`,method:"GET",query:n.Object({allUsers:n.Optional(n.Boolean({description:"Admins only: list grants of every user in the org"}))}),response:n.Array(VM)}),ffe=d({tags:["oauth"],description:"Delete an OAuth grant (own grant, or any grant for admins)",url:`${fn}/grants/:id`,method:"DELETE",params:n.Object({id:n.String()}),response:L});function wI(e,t){let r=new URL(NI.url,e);return r.search=new URLSearchParams({response_type:"code",client_id:Zp,redirect_uri:t.redirectUri,code_challenge:t.challenge,code_challenge_method:"S256",state:t.state}).toString(),r.href}function YM(e){if(!e)return{};try{let t=JSON.parse(e);return typeof t=="object"&&t!==null?t:{}}catch{return{}}}async function QM(e,t){let r=await fetch(new URL(kI.url,e).href,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams(t).toString()}),o=await r.text(),i=YM(o);if(r.status!==200){let a=i.error??`HTTP ${r.status}`;throw new Error(`OAuth token request failed (${a}${i.error_description?`: ${i.error_description}`:""})`)}if(!i.access_token||typeof i.expires_in!="number")throw new Error("OAuth token response was missing required fields");return{accessToken:i.access_token,expiresAt:new Date(Date.now()+i.expires_in*rp)}}async function LI(e,t){return QM(e,{grant_type:"authorization_code",client_id:Zp,code:t.code,code_verifier:t.verifier,redirect_uri:t.redirectUri})}var qr=require("node:fs"),MI=require("node:os"),Xp=require("node:path");var vI=(0,Xp.join)((0,MI.homedir)(),".config","tsuga"),Li=(0,Xp.join)(vI,"config.json"),WM="https://api.tsuga.com";function DI(e){return rd(e.credential)}function Mi(){if(!(0,qr.existsSync)(Li))return{};try{return JSON.parse((0,qr.readFileSync)(Li,"utf-8"))}catch{throw new Error(`Config file corrupted: ${Li}
36
- Re-authenticate with \`tsuga auth login\` or \`tsuga auth operation-key <token>\`.`)}}function ho(){try{return Mi()}catch{return{}}}function Eo(e){(0,qr.mkdirSync)(vI,{recursive:!0,mode:448}),(0,qr.writeFileSync)(Li,`${JSON.stringify(e,null,2)}
37
- `,{mode:384})}function Jp(e){return e?.trim()||process.env.TSUGA_API_URL?.trim()||WM}function To(e){let t=Mi(),r=Jp(e.apiUrl),o=td({overrideKey:e.operationApiKey??process.env.TSUGA_OPERATION_API_KEY,operationApiKey:t.operationApiKey,userAuth:t.userAuth}),i=t.defaults??{},a=e.clusterId?.trim()||process.env.TSUGA_CLUSTER_ID?.trim()||i.cluster?.trim()||void 0;return{apiUrl:r,credential:o,clusterId:a,defaults:i}}function ZM(e){Eo({...ho(),...e})}function $I(){return Mi().userAuth}function GI(e){let{operationApiKey:t,...r}=ho();Eo({...r,userAuth:e})}function jI(e){let{userAuth:t,...r}=ho();Eo({...r,operationApiKey:e})}function FI(){let{userAuth:e,...t}=ho();Eo(t)}function vi(){return Li}var BI={from:"-30m",to:"now",query:"*","max-results":"100"};function pr(e){return(Mi().defaults??{})[e]??BI[e]}function qI(e,t){let r=ho();Eo({...r,defaults:{...r.defaults??{},[e]:t}})}function HI(){let{defaults:e,...t}=ho();Eo(t)}function KI(e,t){let r=[`API URL: ${e.apiUrl}`],{credential:o}=e;if(o){let a=o.kind;switch(a){case"operation-api-key":r.push(`Operation API key: ${o.token.slice(0,12)}...${o.token.slice(-4)}`);break;case"user-session":r.push(`User session: ${Yo(o.userAuth.accessToken)} (expires ${o.userAuth.accessExpiresAt})`);break;default:We(a)}}else r.push("Not authenticated. Run `tsuga auth login` or `tsuga auth operation-key <operation-api-key>`.");r.push(`Config: ${t}`),r.push(""),r.push("Defaults (custom overrides marked with *):");let i={...BI,...e.defaults};for(let[a,c]of Object.entries(i)){let u=a in e.defaults?" *":"";r.push(` ${a}: ${c}${u}`)}return`${r.join(`
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 ce.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()}`,ce.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new DU(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 m=c.attributeName(),l=this.getOptionValue(m),f=this.options.find(T=>T.negate&&m===T.attributeName()),y=this.options.find(T=>!T.negate&&m===T.attributeName());return f&&(f.presetArg===void 0&&l===!1||f.presetArg!==void 0&&l===f.presetArg)?f:y||c},i=c=>{let m=o(c),l=m.attributeName();return this.getOptionValueSource(l)==="env"?`environment variable '${m.envVar}'`:`option '${m.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(m=>m.long).map(m=>m.long);i=i.concat(c),a=a.parent}while(a&&!a._enablePositionalOptions);n=Gd(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",a=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${n} argument${o} but got ${t.length}.`;this.error(a,{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=Gd(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
+ `),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=>kU(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)}nameFromFilename(t){return this._name=pr.basename(t,pr.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=m=>this._outputConfiguration.writeErr(m),i=this._outputConfiguration.getErrHasColors(),a=this._outputConfiguration.getErrHelpWidth()):(o=m=>this._outputConfiguration.writeOut(m),i=this._outputConfiguration.getOutHasColors(),a=this._outputConfiguration.getOutHelpWidth()),{error:n,write:m=>(i||(m=this._outputConfiguration.stripColor(m)),o(m)),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=this._helpOption??void 0:this._helpOption=null,this):(t=t??"-h, --help",n=n??"display help for command",this._helpOption=this.createOption(t,n),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(t){return this._helpOption=t,this}help(t){this.outputHelp(t);let n=Number(ce.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
+ 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 $d(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 Up(){if(ce.env.NO_COLOR||ce.env.FORCE_COLOR==="0"||ce.env.FORCE_COLOR==="false")return!1;if(ce.env.FORCE_COLOR||ce.env.CLICOLOR_FORCE!==void 0)return!0}wp.Command=Pp;wp.useColor=Up});var Hd=dn(kt=>{var{Argument:qd}=ys(),{Command:Np}=jd(),{CommanderError:GU,InvalidArgumentError:Fd}=mi(),{Help:$U}=bp(),{Option:Bd}=xp();kt.program=new Np;kt.createCommand=e=>new Np(e);kt.createOption=(e,t)=>new Bd(e,t);kt.createArgument=(e,t)=>new qd(e,t);kt.Command=Np;kt.Option=Bd;kt.Argument=qd;kt.Help=$U;kt.CommanderError=GU;kt.InvalidArgumentError=Fd;kt.InvalidOptionArgumentError=Fd});var Kd=Nd(Hd(),1),{program:tz,createCommand:rz,createArgument:nz,createOption:oz,CommanderError:iz,InvalidArgumentError:az,InvalidOptionArgumentError:sz,Command:zd,Argument:cz,Option:Lp,Help:pz}=Kd.default;function Ye(e){throw new Error(`assertUnreachable: ${JSON.stringify(e,null,2)}`)}function li(e){return`\u2022\u2022\u2022\u2022${e.slice(-4)}`}function Vd(e){return{accessToken:e.accessToken,accessExpiresAt:e.expiresAt.toISOString()}}function Yd(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 Qd(e){if(e)switch(e.kind){case"operation-api-key":return e.token;case"user-session":return e.userAuth.accessToken;default:Ye(e)}}function Ts(e,t){return e?.kind==="user-session"&&new Date(e.userAuth.accessExpiresAt)<=t}var q_=require("node:crypto");var di=require("node:crypto");function jU(e){return(0,di.createHash)("sha256").update(e).digest("base64url")}function Wd(){let e=(0,di.randomBytes)(32).toString("base64url");return{verifier:e,challenge:jU(e)}}var of=require("node:child_process"),af=require("node:http"),Fp=require("node:os");var hz=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 Rz=60*1e3;var p9=1/1e6,vp=1e3,Mp=60*vp,zU=60*Mp,Is=24*zU,u9=7*Is,m9=30*Is;var Dp=["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 VU={s:1,m:60,h:3600,d:86400};function Xd(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<48||n>57)return!1}return!0}function Jd(){return Math.floor(Date.now()/1e3)}function _s(e){if(typeof e=="number")return e;if(e==="now")return Jd();if(e.startsWith("-")&&e.length>=3){let n=e.at(-1),o=n?VU[n]:void 0;if(o){let i=e.slice(1,-1);if(i.length>0&&Xd(i))return Jd()-parseInt(i,10)*o}}if(Xd(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.`)}function q(e){process.stdout.write(`${e}
28
+ `)}function re(e){q(JSON.stringify(e,null,2))}var ef=["json","tsv","csv"];function Gp(e){let t=ef.find(n=>n===e);if(t!==void 0)return t;throw new Error(`--output must be one of: ${ef.join(", ")} (got: ${e})`)}function $p(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 tf(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 jp(e,t){let n=Object.create(null);for(let o of t){let i=tf(e,o);if(i===void 0)continue;let a=o.split("."),c=a.pop();if(c===void 0)continue;let m=n;for(let l of a)(typeof m[l]!="object"||m[l]===null)&&(m[l]=Object.create(null)),m=m[l];m[c]=i}return n}function rf(e){return e==null?null:typeof e=="string"?e:JSON.stringify(e)}var YU={"\\":"\\\\"," ":"\\t","\r":"\\r","\n":"\\n"};function QU(e){let t=rf(e);return t===null?"":t.replace(/[\\\t\r\n]/g,n=>YU[n]??n)}function WU(e){let t=rf(e);return t===null?"":/[,"\n\r]/.test(t)?`"${t.replaceAll('"','""')}"`:t}function qp(e,t,n){if(t.length===0)return"";let o=e==="csv"?",":" ",i=e==="csv"?WU:QU,a=n.map(m=>i(m)).join(o),c=t.map(m=>n.map(l=>i(tf(m,l))).join(o));return[a,...c].join(`
29
+ `)}var sf="/oauth/callback",XU=5*Mp,JU="<!doctype html><html><body><h1>Login complete</h1><p>You can close this tab and return to the terminal.</p></body></html>",bs="<!doctype html><html><body><h1>Login failed</h1><p>Return to the terminal for details.</p></body></html>";function ew(e){return(0,Fp.platform)()==="darwin"?["open",[e]]:(0,Fp.platform)()==="win32"?["rundll32",["url.dll,FileProtocolHandler",e]]:["xdg-open",[e]]}function tw(e){let[t,n]=ew(e),o=(0,of.spawnSync)(t,n,{stdio:"ignore"});return o.error===void 0&&o.status===0}async function rw(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)."))},XU),c=(m,l,f,y)=>{m.writeHead(l,{"Content-Type":"text/html"}),m.end(f),clearTimeout(a),y()};e.on("request",(m,l)=>{let f=new URL(m.url??"/",n);if(f.pathname!==sf){l.writeHead(404,{"Content-Type":"text/html"}),l.end(bs);return}let y=f.searchParams.get("error");if(y){let A=f.searchParams.get("error_description")??"";c(l,400,bs,()=>i(new Error(`Authorization failed: ${y}${A?` (${A})`:""}`)));return}if(f.searchParams.get("state")!==t){c(l,400,bs,()=>i(new Error("State mismatch on OAuth callback; aborting for safety.")));return}let T=f.searchParams.get("code");if(!T){c(l,400,bs,()=>i(new Error("OAuth callback did not include an authorization code.")));return}c(l,200,JU,()=>o(T))})})}async function cf(e){let t=(0,af.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}${sf}`;try{let a=e.buildAuthorizeUrl(i);return tw(a)?q("Opening your browser to complete login..."):(q("Visit this URL in your browser to complete login:"),q(` ${a}`)),{code:await rw(t,e.state,o),redirectUri:i}}finally{t.close()}}var g={};Lt(g,{Assign:()=>nw,Clone:()=>gi,Create:()=>iN,Discard:()=>aN,Metrics:()=>Gt,Update:()=>sN});var Gt={assign:0,create:0,clone:0,discard:0,update:0};function nw(e,t){return Gt.assign+=1,{...e,...t}}var s={};Lt(s,{Entries:()=>xw,EntriesRegExp:()=>Aw,Every:()=>bw,EveryAll:()=>Sw,GraphemeCount:()=>Ew,HasPropertyKey:()=>Ow,IsArray:()=>fn,IsAsyncIterator:()=>pw,IsBigInt:()=>fi,IsBoolean:()=>gf,IsClassInstance:()=>hw,IsConstructor:()=>uw,IsDeepEqual:()=>zp,IsEqual:()=>ee,IsFunction:()=>yf,IsGreaterEqualThan:()=>Tf,IsGreaterThan:()=>fw,IsInteger:()=>Hp,IsIterator:()=>mw,IsLessEqualThan:()=>hf,IsLessThan:()=>gw,IsMaxLength:()=>Iw,IsMinLength:()=>_w,IsMultipleOf:()=>yw,IsNull:()=>xs,IsNumber:()=>Rs,IsObject:()=>gn,IsObjectNotArray:()=>lw,IsString:()=>wr,IsSymbol:()=>dw,IsUndefined:()=>Kp,IsValueLike:()=>Tw,Keys:()=>As,Symbols:()=>Rw,Values:()=>Cw});function Ur(e,t,n){return e>=t&&e<=n}function pf(e){return Ur(e,127462,127487)}function ow(e){return Ur(e,65024,65039)}function iw(e){return Ur(e,768,879)||Ur(e,6832,6911)||Ur(e,7616,7679)||Ur(e,65056,65071)}function Os(e){return e>65535?2:1}function uf(e,t){for(;t<e.length;){let n=e.codePointAt(t);if(iw(n)||ow(n))t+=Os(n);else break}return t}function Bp(e,t){let n=e.codePointAt(t),o=t+Os(n);for(o=uf(e,o);o<e.length-1&&e[o]==="\u200D";){let i=e.codePointAt(o+1);o+=1+Os(i),o=uf(e,o)}return pf(n)&&o<e.length&&pf(e.codePointAt(o))&&(o+=Os(e.codePointAt(o))),o}function mf(e){return Ur(e,55296,56319)||Ur(e,768,879)||e===8205}function lf(e){let t=0,n=0;for(;n<e.length;)n=Bp(e,n),t++;return t}function aw(e,t){let n=0,o=0;for(;o<e.length;)if(o=Bp(e,o),n++,n>=t)return!0;return!1}function sw(e,t){let n=0,o=0;for(;o<e.length;)if(o=Bp(e,o),n++,n>t)return!1;return!0}function df(e,t){let n=0;for(;n<e.length;){if(mf(e.charCodeAt(n)))return aw(e,t);if(n++,n>=t)return!0}return!1}function ff(e,t){let n=0;for(;n<e.length;){if(mf(e.charCodeAt(n)))return sw(e,t);if(n++,n>t)return!1}return!0}function fn(e){return Array.isArray(e)}function pw(e){return gn(e)&&Symbol.asyncIterator in e}function fi(e){return ee(typeof e,"bigint")}function gf(e){return ee(typeof e,"boolean")}function uw(e){if(Kp(e)||!yf(e))return!1;let t=Function.prototype.toString.call(e);return!!(/^class\s/.test(t)||/\[native code\]/.test(t))}function yf(e){return ee(typeof e,"function")}function Hp(e){return Number.isInteger(e)}function mw(e){return gn(e)&&Symbol.iterator in e}function xs(e){return ee(e,null)}function Rs(e){return Number.isFinite(e)}function lw(e){return gn(e)&&!fn(e)}function gn(e){return ee(typeof e,"object")&&!xs(e)}function wr(e){return ee(typeof e,"string")}function dw(e){return ee(typeof e,"symbol")}function Kp(e){return ee(e,void 0)}function ee(e,t){return e===t}function fw(e,t){return e>t}function gw(e,t){return e<t}function hf(e,t){return e<=t}function Tf(e,t){return e>=t}function yw(e,t){if(fi(e)||fi(t))return BigInt(e)%BigInt(t)===0n;let n=1e-10;if(!Rs(e)||Hp(e)&&1/t%1===0)return!0;let o=e%t;return Math.min(Math.abs(o),Math.abs(o-t))<n}function hw(e){if(!gn(e))return!1;let t=globalThis.Object.getPrototypeOf(e);return xs(t)?!1:ee(typeof t.constructor,"function")&&!(ee(t.constructor,globalThis.Object)||ee(t.constructor.name,"Object"))}function Tw(e){return fi(e)||gf(e)||xs(e)||Rs(e)||wr(e)||Kp(e)}function Ew(e){return lf(e)}function Iw(e,t){return ff(e,t)}function _w(e,t){return df(e,t)}function bw(e,t,n){for(let o=t;o<e.length;o++)if(!n(e[o],o))return!1;return!0}function Sw(e,t,n){let o=!0;for(let i=t;i<e.length;i++)n(e[i],i)||(o=!1);return o}function Ow(e,t){return ee(t,"__proto__")||ee(t,"constructor")?Object.prototype.hasOwnProperty.call(e,t):t in e}function Aw(e){return As(e).map(t=>[new RegExp(`^${t}$`),e[t]])}function xw(e){return Object.entries(e)}function As(e){return Object.getOwnPropertyNames(e)}function Rw(e){return Object.getOwnPropertySymbols(e)}function Cw(e){return Object.values(e)}function Pw(e,t){if(!gn(t))return!1;let n=As(e);return ee(n.length,As(t).length)&&n.every(o=>zp(e[o],t[o]))}function Uw(e,t){return fn(t)&&ee(e.length,t.length)&&e.every((n,o)=>zp(e[o],t[o]))}function zp(e,t){return fn(e)?Uw(e,t):gn(e)?Pw(e,t):ee(e,t)}var it={};Lt(it,{IsBigInt64Array:()=>Hw,IsBigUint64Array:()=>Kw,IsBoolean:()=>ww,IsDate:()=>Vw,IsFloat32Array:()=>Fw,IsFloat64Array:()=>Bw,IsInt16Array:()=>Gw,IsInt32Array:()=>jw,IsInt8Array:()=>vw,IsMap:()=>Qw,IsNumber:()=>Nw,IsRegExp:()=>zw,IsSet:()=>Yw,IsString:()=>Lw,IsTypeArray:()=>kw,IsUint16Array:()=>$w,IsUint32Array:()=>qw,IsUint8Array:()=>Mw,IsUint8ClampedArray:()=>Dw});function ww(e){return e instanceof Boolean}function Nw(e){return e instanceof Number}function Lw(e){return e instanceof String}function kw(e){return globalThis.ArrayBuffer.isView(e)}function vw(e){return e instanceof globalThis.Int8Array}function Mw(e){return e instanceof globalThis.Uint8Array}function Dw(e){return e instanceof globalThis.Uint8ClampedArray}function Gw(e){return e instanceof globalThis.Int16Array}function $w(e){return e instanceof globalThis.Uint16Array}function jw(e){return e instanceof globalThis.Int32Array}function qw(e){return e instanceof globalThis.Uint32Array}function Fw(e){return e instanceof globalThis.Float32Array}function Bw(e){return e instanceof globalThis.Float64Array}function Hw(e){return e instanceof globalThis.BigInt64Array}function Kw(e){return e instanceof globalThis.BigUint64Array}function zw(e){return e instanceof globalThis.RegExp}function Vw(e){return e instanceof globalThis.Date}function Yw(e){return e instanceof globalThis.Set}function Qw(e){return e instanceof globalThis.Map}function Zw(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~guard")}function Xw(e){return e.map(t=>Vp(t))}function Jw(e){let t={},n=Object.getOwnPropertyDescriptors(e);for(let o of Object.keys(n)){let i=n[o];s.HasPropertyKey(i,"value")&&Object.defineProperty(t,o,{...i,value:Vp(i.value)})}return t}function eN(e){return new RegExp(e.source,e.flags)}function Vp(e){return e instanceof RegExp?eN(e):Zw(e)?e:s.IsArray(e)?Xw(e):s.IsObject(e)?Jw(e):e}function gi(e){return Gt.clone+=1,Vp(e)}var Rt={};Lt(Rt,{Get:()=>nN,Reset:()=>tN,Set:()=>rN});var yn={immutableTypes:!1,maxErrors:8,useEval:!0,exactOptionalPropertyTypes:!1,enumerableKind:!1};function tN(){yn.immutableTypes=!1,yn.maxErrors=8,yn.useEval=!0,yn.exactOptionalPropertyTypes=!1,yn.enumerableKind=!1}function rN(e){for(let t of s.Keys(e)){let n=e[t];n!==void 0&&Object.defineProperty(yn,t,{value:n})}}function nN(){return yn}function oN(e,t,n={}){for(let o of Object.keys(t))Object.defineProperty(e,o,{configurable:!0,writable:!0,enumerable:!1,value:t[o]});return e}function Ef(e,t){return{...e,...t}}function iN(e,t,n={}){Gt.create+=1;let o=Rt.Get(),i=Ef(t,n),a=o.enumerableKind?Ef(i,e):oN(i,e);return o.immutableTypes?Object.freeze(a):a}function aN(e,t){Gt.discard+=1;let n={},o=Object.getOwnPropertyDescriptors(gi(e)),i=new Set(t);for(let a of Object.keys(o))i.has(a)||Object.defineProperty(n,a,o[a]);return n}function sN(e,t,n){Gt.update+=1;let o=Rt.Get(),i=gi(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 _(e,t){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.IsEqual(e["~kind"],t)}function O(e){return s.IsObject(e)}function If(e){return g.Create({"~kind":"OptionalAddAction"},{type:e},{})}function _f(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"type")&&s.IsEqual(e["~kind"],"OptionalAddAction")&&O(e.type)}function bf(e){return g.Create({"~kind":"OptionalRemoveAction"},{type:e},{})}function Sf(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"type")&&s.IsEqual(e["~kind"],"OptionalRemoveAction")&&O(e.type)}function Of(e){return g.Create({"~kind":"ReadonlyAddAction"},{type:e},{})}function Af(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"type")&&s.IsEqual(e["~kind"],"ReadonlyAddAction")&&O(e.type)}function xf(e){return g.Create({"~kind":"ReadonlyRemoveAction"},{type:e},{})}function Rf(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"type")&&s.IsEqual(e["~kind"],"ReadonlyRemoveAction")&&O(e.type)}function P(e,t,n){return g.Create({"~kind":"Deferred"},{action:e,parameters:t,options:n},{})}function Cf(e){return _(e,"Deferred")}function Yp(e){return g.Update(e,{"~immutable":!0},{})}function Nr(e){return Yp(e)}function hn(e){return O(e)&&s.HasPropertyKey(e,"~immutable")}function eo(e){return g.Discard(e,["~optional"])}function gt(e){return g.Update(e,{"~optional":!0},{})}function Cs(e){return gt(e)}function ve(e){return O(e)&&s.HasPropertyKey(e,"~optional")}function Ps(e){return g.Discard(e,["~readonly"])}function yt(e){return g.Update(e,{"~readonly":!0},{})}function Us(e){return yt(e)}function Tn(e){return O(e)&&s.HasPropertyKey(e,"~readonly")}function $t(e,t){return g.Create({"~kind":"Array"},{type:"array",items:e},t)}function te(e){return _(e,"Array")}function ws(e){return g.Discard(e,["~kind","type","items"])}function Vt(e,t){return g.Create({"~kind":"AsyncIterator"},{type:"asyncIterator",iteratorItems:e},t)}function nt(e){return _(e,"AsyncIterator")}function Pf(e){return g.Discard(e,["~kind","type","iteratorItems"])}function Uf(e){return{enumerable:Rt.Get().enumerableKind,writable:!1,configurable:!1,value:e}}var Ns=class{constructor(){globalThis.Object.defineProperty(this,"~kind",Uf("Base")),globalThis.Object.defineProperty(this,"~guard",Uf({check:t=>this.Check(t),errors:t=>this.Errors(t)}))}Check(t){return!0}Errors(t){return[]}Convert(t){return t}Clean(t){return t}Default(t){return t}Create(){throw new Error("Create not implemented")}Clone(){throw Error("Clone not implemented")}};function Ct(e){return _(e,"Base")}function Lr(e,t,n={}){return g.Create({"~kind":"Constructor"},{type:"constructor",parameters:e,instanceType:t},n)}function Me(e){return _(e,"Constructor")}function wf(e){return g.Discard(e,["~kind","type","parameters","instanceType"])}function kr(e,t,n={}){return g.Create({"~kind":"Function"},{type:"function",parameters:e,returnType:t},n)}function De(e){return _(e,"Function")}function Nf(e){return g.Discard(e,["~kind","type","parameters","returnType"])}function we(e,t){return g.Create({"~kind":"Ref"},{$ref:e},t)}function pe(e){return _(e,"Ref")}function vr(e,t){return g.Create({"~kind":"Generic"},{type:"generic",parameters:e,expression:t})}function to(e){return _(e,"Generic")}var Lf="(?!)";function Z(e){return g.Create({"~kind":"Never"},{not:{}},e)}function ur(e){return _(e,"Never")}function cN(){return["(not-resolvable)",Z()]}function pN(){return["(not-generic)",Z()]}function uN(e,t,n){return[e,vr(t,n)]}function mN(e,t,n){return t in e?kf(e,t,e[t],n):cN()}function kf(e,t,n,o){return to(n)?uN(t,n.parameters,n.expression):pe(n)?mN(e,n.$ref,o):pN()}function vf(e,t,n){return kf(e,"(anonymous)",t,n)}function Yt(e,t,n){let o=s.Keys(e).reduce((i,a)=>({...i,[a]:g.Update(e[a],{},{$id:a})}),{});return g.Create({"~kind":"Cyclic"},{$defs:o,$ref:t},n)}function le(e){return _(e,"Cyclic")}var ae={};Lt(ae,{Match:()=>lN});function lN(e,t){return t[e.length]?.(...e)??(()=>{throw Error("Invalid Arguments")})()}function Qe(e){return g.Create({"~kind":"Unknown"},{},e)}function ht(e){return _(e,"Unknown")}function yi(...e){let[t,n]=ae.Match(e,{2:(o,i)=>[o,i,i],1:o=>[o,Qe(),Qe()]});return g.Create({"~kind":"Infer"},{type:"infer",name:t,extends:n},{})}function Ae(e){return _(e,"Infer")}function ro(e){return g.Create({"~kind":"Any"},{},e)}function at(e){return _(e,"Any")}function Mf(e){return s.IsObjectNotArray(e)}function Df(e){return s.Keys(e).filter(n=>isNaN(n)).reduce((n,o)=>[...n,e[o]],[])}function Gf(e,t){let n=Mf(e)?Df(e):e;return g.Create({"~kind":"Enum"},{enum:n},t)}function xe(e){return _(e,"Enum")}function Pt(e,t={}){return g.Create({"~kind":"Intersect"},{allOf:e},t)}function w(e){return _(e,"Intersect")}function $f(e){return g.Discard(e,["~kind","allOf"])}function H(){throw new Error("Unreachable")}var Dr={};Lt(Dr,{Hash:()=>UN,HashCode:()=>zf});function dN(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 fN(e){return typeof e=="number"}var st;(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"})(st||(st={}));var no=BigInt("14695981039346656037"),[gN,yN]=[BigInt("1099511628211"),BigInt("18446744073709551616")],hN=Array.from({length:256}).map((e,t)=>BigInt(t)),Bf=new Float64Array(1),Hf=new DataView(Bf.buffer),Kf=new Uint8Array(Bf.buffer);function We(e){no=no^hN[e],no=no*gN%yN}function TN(e){We(st.Array);for(let t of e)Mr(t)}function EN(e){We(st.BigInt),Hf.setBigInt64(0,e);for(let t of Kf)We(t)}function qf(e){We(st.Boolean),We(e?1:0)}function IN(e){We(st.Constructor),Mr(e.toString())}function _N(e){We(st.Date),Mr(e.getTime())}function bN(e){We(st.Function),Mr(e.toString())}function SN(e){We(st.Null)}function Ff(e){We(st.Number),Hf.setFloat64(0,e,!0);for(let t of Kf)We(t)}function ON(e){We(st.Object);for(let t of dN(e).sort())Mr(t),Mr(e[t])}function AN(e){We(st.RegExp),Qp(e.toString())}var xN=new TextEncoder;function Qp(e){We(st.String);for(let t of xN.encode(e))We(t)}function RN(e){We(st.Symbol),Mr(e.toString())}function CN(e){We(st.TypeArray);let t=new Uint8Array(e.buffer);for(let n=0;n<t.length;n++)We(t[n])}function PN(e){return We(st.Undefined)}function Mr(e){return it.IsTypeArray(e)?CN(e):it.IsDate(e)?_N(e):it.IsRegExp(e)?AN(e):it.IsBoolean(e)?qf(e.valueOf()):it.IsString(e)?Qp(e.valueOf()):it.IsNumber(e)?Ff(e.valueOf()):fN(e)?Ff(e):s.IsArray(e)?TN(e):s.IsBoolean(e)?qf(e):s.IsBigInt(e)?EN(e):s.IsConstructor(e)?IN(e):s.IsNull(e)?SN(e):s.IsObject(e)?ON(e):s.IsString(e)?Qp(e):s.IsSymbol(e)?RN(e):s.IsUndefined(e)?PN(e):s.IsFunction(e)?bN(e):H()}function zf(e){return no=BigInt("14695981039346656037"),Mr(e),no}function UN(e){return zf(e).toString(16).padStart(16,"0")}function Vf(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"~guard":return"must match check function";case"~refine":return e.params.message;default:return"an unknown validation error occurred"}}var wN=Vf;function Yf(){return wN}var hi=class{constructor(t,n){this.type=t,this.decode=n}Encode(t){let n=this.type,o=En(n)?c=>this.decode(n["~codec"].decode(c)):this.decode,i=En(n)?c=>n["~codec"].encode(t(c)):t,a={decode:o,encode:i};return g.Update(this.type,{"~codec":a},{})}},Ti=class{constructor(t){this.type=t}Decode(t){return new hi(this.type,t)}};function Ls(e){return new Ti(e)}function Wf(e,t){return Ls(e).Decode(t).Encode(()=>{throw Error("Encode not implemented")})}function Zf(e,t){return Ls(e).Decode(()=>{throw Error("Decode not implemented")}).Encode(t)}function En(e){return O(e)&&s.HasPropertyKey(e,"~codec")&&s.IsObject(e["~codec"])&&s.HasPropertyKey(e["~codec"],"encode")&&s.HasPropertyKey(e["~codec"],"decode")}function LN(e,t){let n=ks(e)?[...e["~refine"],t]:[t];return g.Update(e,{"~refine":n},{})}function Xf(e,t,n="error"){return LN(e,{refine:t,message:n})}function ks(e){return O(e)&&s.HasPropertyKey(e,"~refine")}var Jf="-?(?:0|[1-9][0-9]*)n";function Ei(e){return g.Create({"~kind":"BigInt"},{type:"bigint"},e)}function bt(e){return _(e,"BigInt")}function vs(e){return g.Create({"~kind":"Boolean"},{type:"boolean"},e)}function ct(e){return _(e,"Boolean")}function Ii(e){return g.Create({"~kind":"Identifier"},{name:e})}function eg(e){return _(e,"Identifier")}var Ms="-?(?:0|[1-9][0-9]*)";function In(e){return g.Create({"~kind":"Integer"},{type:"integer"},e)}function qe(e){return _(e,"Integer")}function Qt(e,t){return g.Create({"~kind":"Iterator"},{type:"iterator",iteratorItems:e},t)}function ot(e){return _(e,"Iterator")}function tg(e){return g.Discard(e,["~kind","type","iteratorItems"])}var Wp=class extends Error{constructor(t){super("Invalid Literal value"),Object.defineProperty(this,"cause",{value:{value:t},writable:!1,configurable:!1,enumerable:!1})}};function kN(e){return s.IsBigInt(e)?"bigint":s.IsBoolean(e)?"boolean":s.IsNumber(e)?"number":s.IsString(e)?"string":(()=>{throw new Wp(e)})()}function V(e,t){return g.Create({"~kind":"Literal"},{type:kN(e),const:e},t)}function Ds(e){return s.IsBigInt(e)||s.IsBoolean(e)||s.IsNumber(e)||s.IsString(e)}function rg(e){return X(e)&&s.IsBigInt(e.const)}function ng(e){return X(e)&&s.IsBoolean(e.const)}function oo(e){return X(e)&&s.IsNumber(e.const)}function io(e){return X(e)&&s.IsString(e.const)}function X(e){return _(e,"Literal")}function Gr(e){return g.Create({"~kind":"Null"},{type:"null"},e)}function Wt(e){return _(e,"Null")}var Gs="-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?";function Ut(e){return g.Create({"~kind":"Number"},{type:"number"},e)}function Ee(e){return _(e,"Number")}function ao(e){return g.Create({"~kind":"Symbol"},{type:"symbol"},e)}function Zt(e){return _(e,"Symbol")}function og(e){return s.Keys(e).filter(t=>!ve(e[t]))}function ig(e){return s.Keys(e)}function $s(e){return s.Values(e)}function vN(e,t={}){let n=og(e),o=n.length>0?{required:n}:{};return g.Create({"~kind":"Object"},{type:"object",...o,properties:e},t)}var N=vN;function v(e){return _(e,"Object")}function ag(e){return g.Discard(e,["~kind","type","properties","required"])}function _n(...e){let[t,n,o]=ae.Match(e,{3:(i,a,c)=>[i,a,c],2:(i,a)=>[i,a,a],1:i=>[i,Qe(),Qe()]});return g.Create({"~kind":"Parameter"},{name:t,extends:n,equals:o},{})}function sg(e){return _(e,"Parameter")}function Xt(e,t){return g.Create({"~kind":"Promise"},{type:"promise",item:e},t)}function Ze(e){return _(e,"Promise")}function cg(e){return g.Discard(e,["~kind","type","item"])}var js=".*";function Tt(e){return g.Create({"~kind":"String"},{type:"string"},e)}function Ne(e){return _(e,"String")}function Et(e,t){let n="object",o={[e]:t};return g.Create({"~kind":"Record"},{type:n,patternProperties:o})}var so=`^${Ms}$`,co=`^${Gs}$`,Jt=`^${js}$`;function _i(e,t,n={}){return P("Record",[e,t],n)}function MN(e,t,n={}){return R({},_i(e,t,n))}function qs(e,t,n={}){return MN(e,t,n)}function pg(e,t){return Et(e,t)}function St(e){return s.Keys(e.patternProperties)[0]}function po(e){let t=St(e);return s.IsEqual(t,so)?In():s.IsEqual(t,co)?Ut():Tt()}function Xe(e){return e.patternProperties[St(e)]}function Ie(e){return _(e,"Record")}function bn(e){return g.Create({"~kind":"Rest"},{type:"rest",items:e},{})}function $r(e){return _(e,"Rest")}function Fs(e){return g.Create({"~kind":"This"},{$ref:"#"},e)}function ug(e){return _(e,"This")}function Fe(e,t={}){let[n,o,i]=[e,e.length,!1];return g.Create({"~kind":"Tuple"},{type:"array",additionalItems:i,items:n,minItems:o},t)}function Y(e){return _(e,"Tuple")}function mg(e){return g.Discard(e,["~kind","type","items","minItems","additionalItems"])}function uo(e){return g.Create({"~kind":"Undefined"},{type:"undefined"},e)}function er(e){return _(e,"Undefined")}function $(e,t={}){return g.Create({"~kind":"Union"},{anyOf:e},t)}function S(e){return _(e,"Union")}function lg(e){return g.Discard(e,["~kind","anyOf"])}function dg(e){return g.Create({"~kind":"Unsafe"},{},e)}function fg(e){return _(e,"Unsafe")}function Bs(e){return g.Create({"~kind":"Void"},{type:"void"},e)}function Ot(e){return _(e,"Void")}function GN(e,t){return s.IsEqual(e,"Array")?$t(t[0]):s.IsEqual(e,"AsyncIterator")?Vt(t[0]):s.IsEqual(e,"Iterator")?Qt(t[0]):s.IsEqual(e,"Promise")?Xt(t[0]):s.IsEqual(e,"Awaited")?ji(t[0]):s.IsEqual(e,"Capitalize")?Si(t[0]):s.IsEqual(e,"ConstructorParameters")?Ci(t[0]):s.IsEqual(e,"Evaluate")?Xp(t[0]):s.IsEqual(e,"Exclude")?Pi(t[0],t[1]):s.IsEqual(e,"Extract")?Ui(t[0],t[1]):s.IsEqual(e,"Index")?fo(t[0],t[1]):s.IsEqual(e,"InstanceType")?wi(t[0]):s.IsEqual(e,"Lowercase")?Oi(t[0]):s.IsEqual(e,"NonNullable")?Ni(t[0]):s.IsEqual(e,"Omit")?Li(t[0],t[1]):s.IsEqual(e,"Options")?yo(t[0],t[1]):s.IsEqual(e,"Parameters")?ki(t[0]):s.IsEqual(e,"Partial")?vi(t[0]):s.IsEqual(e,"Pick")?Mi(t[0],t[1]):s.IsEqual(e,"Readonly")?Di(t[0]):s.IsEqual(e,"KeyOf")?go(t[0]):s.IsEqual(e,"Record")?_i(t[0],t[1]):s.IsEqual(e,"Required")?Gi(t[0]):s.IsEqual(e,"ReturnType")?$i(t[0]):s.IsEqual(e,"Uncapitalize")?Ai(t[0]):s.IsEqual(e,"Uppercase")?xi(t[0]):Hs(we(e),t)}function Sn(){throw Error("Unreachable")}var $N=(e,t=[])=>e.reduce((n,o)=>s.IsArray(o)&&s.IsEqual(o.length,2)?[...n,o[0]]:[...n,o],[]),mr=e=>{let[t,n]=e;return $N([...t,...n])};function Eg(e){return _n(e[0],e[2],e[4])}function Ig(e){return _n(e[0],e[2],e[2])}function _g(e){return _n(e[0],Qe(),e[2])}function bg(e){return _n(e,Qe(),Qe())}function Sg(e){return mr(e)}function Og(e){return e[1]}function Ag(e){return mr(e)}function xg(e){return e[1]}function Rg(e){return GN(e[0],e[1])}function Cg(e){return null}function Pg(e){return Tt()}function Ug(e){return Ut()}function wg(e){return vs()}function Ng(e){return uo()}function Lg(e){return Gr()}function kg(e){return In()}function vg(e){return Ei()}function Mg(e){return Qe()}function Dg(e){return ro()}function Gg(e){return N({})}function $g(e){return Z()}function jg(e){return ao()}function qg(e){return Bs()}function Fg(e){return Fs()}function Bg(e){return e[1]}function Hg(e){return V(e)}function Kg(e){return s.IsEqual(e.length,3)?[e[0],e[1],...e[2]]:[e[0]]}function zg(e){return e[1]}function Vg(e){return bi(e)}function Yg(e){return V(BigInt(e))}function Qg(e){return V(s.IsEqual(e,"true"))}function Wg(e){return V(parseFloat(e))}function Zg(e){return V(e)}function Xg(e){return e.length>0}function Jg(e){return e.reduce((t,n)=>s.IsEqual(n.length,3)?[...t,[n[1]]]:[...t,[]],[])}function ey(e){return s.IsEqual(e.length,6)?[e[1],e[3],e[5]]:[]}function ty(e){return s.IsArray(e)&&s.IsEqual(e.length,3)?e[1]:e}var gg=(e,t)=>t.reduceRight((n,o)=>{let i=o;return s.IsEqual(i.length,1)?fo(n,i[0]):s.IsEqual(i.length,0)?$t(n):Sn()},e),yg=(e,t)=>s.IsEqual(t.length,3)?Ri(e,t[0],t[1],t[2]):e;function ry(e){let[t,n,o,i]=e;return yg(t?go(gg(n,o)):gg(n,o),i)}function Zp(e,t){return s.IsEqual(t.length,3)?(()=>{let[n,o,i]=t,a=Zp(o,i);if(s.IsEqual(n,"&"))return w(a)?Pt([e,...a.allOf]):Pt([e,a]);if(s.IsEqual(n,"|"))return S(a)?$([e,...a.anyOf]):$([e,a]);Sn()})():e}function ny(e){let[t,n]=e;return Zp(t,n)}function oy(e){let[t,n]=e;return Zp(t,n)}function iy(e){return Yp(e[1])}function ay(e){return e[1]}function sy(e){return vr(e[0],e[2])}function cy(e){return s.IsEqual(e.length,4)?yi(e[1],e[3]):s.IsEqual(e.length,2)?yi(e[1],Qe()):Sn()}function py(e){return`${e}`}function uy(e){return qe(e[3])?so:Ee(e[3])?co:Zt(e[3])?Jt:Ne(e[3])?Jt:Sn()}function my(e){return e.length>0}function ly(e){return e.length>0}function dy(e){let[t,n,o,i,a]=e;return{[n]:t&&o?yt(gt(a)):t&&!o?yt(a):!t&&o?gt(a):a}}function fy(e){return mr(e)}function gy(e){return e.reduce((t,n)=>s.HasPropertyKey(n,so)||s.HasPropertyKey(n,co)||s.HasPropertyKey(n,Jt)?[t[0],g.Assign(t[1],n)]:[g.Assign(t[0],n),t[1]],[{},{}])}function yy(e){return gy(e[1])}function hy(e){let[t,n]=e,o=s.IsEqual(s.Keys(n).length,0)?{}:{patternProperties:n};return N(t,o)}function Ty(e){return s.IsEqual(e.length,5)?yt(gt(e[4])):s.IsEqual(e.length,3)?e[2]:s.IsEqual(e.length,4)?s.IsEqual(e[2],"readonly")?yt(e[3]):gt(e[3]):Sn()}function Ey(e){return yt(gt(e[1]))}function Iy(e){return yt(e[1])}function _y(e){return gt(e[0])}function by(e){return s.IsEqual(e.length,2)?bn(e[1]):s.IsEqual(e.length,1)?e[0]:Sn()}function Sy(e){return mr(e)}function Oy(e){return Fe(e[1])}function Ay(e){return yt(gt(e[4]))}function xy(e){return yt(e[3])}function Ry(e){return gt(e[3])}function Cy(e){return e[2]}function Py(e){return s.IsEqual(e.length,2)?bn(e[1]):s.IsEqual(e.length,1)?e[0]:Sn()}function Uy(e){return mr(e)}function wy(e){return kr(e[1],e[4])}function Ny(e){return Lr(e[2],e[5])}function hg(e,t){return s.IsEqual(e,"remove")?xf(t):s.IsEqual(e,"add")?Of(t):t}function Ly(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 Tg(e,t){return s.IsEqual(e,"remove")?bf(t):s.IsEqual(e,"add")?If(t):t}function ky(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 vy(e){return s.IsEqual(e.length,2)?[e[1]]:[]}function My(e){return s.IsArray(e[6])&&s.IsEqual(e[6].length,1)?mo(Ii(e[3]),e[5],e[6][0],hg(e[1],Tg(e[8],e[10]))):mo(Ii(e[3]),e[5],we(e[3]),hg(e[1],Tg(e[8],e[10])))}function Dy(e){return we(e)}function Gy(e){return yo(e[2],e[4])}function $y(e){return parseFloat(e)}function jy(e){return s.IsEqual(e,"true")}function qy(e){return null}function Fy(e){return{[e[0]]:e[2]}}function By(e){return mr(e)}function jN(e){return e.reduce((t,n)=>g.Assign(t,n),{})}function Hy(e){return jN(e[1])}function Ky(e){return mr(e)}function zy(e){return e[1]}function Vy(e){return Ei()}function Yy(e){return Tt()}function Qy(e){return Ut()}function Wy(e){return In()}function Zy(e){return Z()}function Xy(e){return V(e)}function Jy(e){return $(e[1])}function eh(e){return e.length===3?[...e[0],...e[2]]:e.length===1?[...e[0]]:[]}function th(e){return[e[0],...e[1]]}function rh(e){return e[1]}function nh(e){return mr(e)}function oh(e){return s.IsEqual(e.length,2)?e[1]:[]}function ih(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]]:vr(t,lo(n,o,a))}}function ah(e){let t=e[2],[n,o]=e[3],i=s.IsEqual(s.Keys(o).length,0)?{}:{patternProperties:o};return{[e[1]]:lo(t,n,i)}}function sh(e){return{[e[1]]:vr(e[2],e[4])}}function ch(e){return{[e[1]]:e[3]}}function ph(e){return null}function uh(e){return gy(mr(e))}function mh(e){return e[1]}function lh(e){let t=e[0],n=e[1];return Jp(g.Assign(t,n[0]))}function se(e){return fn(e)&&ee(e.length,2)}function BN(e,t){return ee(t.indexOf(e),0)?[e,t.slice(e.length)]:[]}function Ge(e,t){let[n,...o]=e;return wr(n)?(()=>{let i=BN(n,t);return ee(i.length,2)?i:Ge(o,t)})():[]}function eu(e,t){return Array.from({length:t-e+1},(n,o)=>String.fromCharCode(e+o))}var dh=[...eu(97,122),...eu(65,90)],tu="0",ru=eu(49,57),ho=[tu,...ru],fh=" ",To=`
30
+ `;var jr="_",Ks=".",gh="$",zs="-";var yh="//",hh="/*",KN="*/";function Th(e){let t=e.indexOf(KN);return ee(t,-1)?"":e.slice(t+2)}function Eh(e){let t=e.indexOf(To);return ee(t,-1)?"":e.slice(t)}function zN(e){return e.replace(/^[ \t\r\f\v]+/,"")}function Vs(e){let t=zN(e);return t.startsWith(hh)?Vs(Th(t.slice(2))):t.startsWith(yh)?Vs(Eh(t.slice(2))):t}function It(e){let t=e.trimStart();return t.startsWith(hh)?It(Th(t.slice(2))):t.startsWith(yh)?It(Eh(t.slice(2))):t}function VN(e,t){return e.includes(t)}function Eo(e,t,n,o=""){let i=Ge(e,n);return se(i)?VN(t,i[0])?Eo(e,t,i[1],o):Eo(e,t,i[1],`${o}${i[0]}`):[o,n]}function Ys(e,t){let n=Ge([e],t);return se(n)?n:["",t]}function YN(e){return Ys(zs,e)}function QN(e){return Ge(ru,e)}var WN=[...ho,jr];function ZN(e){return Eo(WN,[jr],e)}function XN(e){let t=YN(e);return se(t)?(()=>{let n=Ge([tu],t[1]);return se(n)?[`${t[0]}${n[0]}`,n[1]]:(()=>{let o=QN(t[1]);return se(o)?(()=>{let i=ZN(o[1]);return se(i)?[`${t[0]}${o[0]}${i[0]}`,i[1]]:[]})():[]})()})():[]}function Qs(e){return XN(It(e))}function JN(e){let t=Qs(e);return se(t)?(()=>{let n=Ge(["n"],t[1]);return se(n)?[`${t[0]}`,n[1]]:[]})():[]}function Ih(e){return JN(e)}function nu(e,t){return Ge([e],t)}function h(e,t){return ee(e,"")?["",t]:e.startsWith(To)?nu(e,Vs(t)):e.startsWith(fh)?nu(e,t):nu(e,It(t))}var _h=[...dh,jr,gh];function eL(e){return Ge(_h,e)}var tL=[..._h,...ho];function bh(e,t=""){let n=Ge(tL,e);return se(n)?bh(n[1],`${t}${n[0]}`):[t,e]}function rL(e){let t=eL(e);return se(t)?(()=>{let n=bh(t[1]);return se(n)?[`${t[0]}${n[0]}`,n[1]]:[]})():[]}function _e(e){return rL(It(e))}var nL=[...ho,jr];function oL(e){return Ys(zs,e)}function iL(e){return se(Ge([Ks],e))}function Sh(e){let t=Eo(nL,[jr],e);return se(t)?ee(t[0],"")?[]:[t[0],t[1]]:[]}function aL(e,t){let n=Ge([Ks],t);return se(n)?(()=>{let o=Sh(n[1]);return se(o)?[`${e}0${n[0]}${o[0]}`,o[1]]:[]})():[]}function sL(e,t){let n=Qs(t);return se(n)?(()=>{let o=Ge([Ks],n[1]);return se(o)?(()=>{let i=Sh(o[1]);return se(i)?[`${e}${n[0]}${o[0]}${i[0]}`,i[1]]:[`${e}${n[0]}`,o[1]]})():[`${e}${n[0]}`,n[1]]})():[]}function cL(e){let t=oL(e);return se(t)?iL(t[1])?aL(t[0],t[1]):sL(t[0],t[1]):[]}function Ws(e){return cL(It(e))}function Oh(e,t){let[n,...o]=e;return wr(n)?t.startsWith(n)?!0:Oh(o,t):!1}function qr(e,t,n=""){return ee(t,"")?[]:Oh(e,t)?[n,t]:(()=>{let[o,i]=[t.slice(0,1),t.slice(1)];return qr(e,i,`${n}${o}`)})()}function pL(e,t,n){return n.startsWith(e)?(()=>{let o=qr([t],n.slice(e.length));return se(o)?o[1].startsWith(t)?[`${o[0]}`,o[1].slice(t.length)]:[]:[]})():[]}function uL(e,t,n){return n.startsWith(e)?(()=>{let o=qr([To,t],n.slice(e.length));return se(o)?o[1].startsWith(t)?[`${o[0]}`,o[1].slice(t.length)]:[]:[]})():[]}function Ah(e,t,n,o){return n?pL(e,t,It(o)):uL(e,t,It(o))}function mL(e,t){return Ge(e,t)}function lL(e,t){return Ah(e,e,!1,t)}function dL(e,t){let n=mL(e,t);return se(n)?lL(n[0],`${n[0]}${n[1]}`):[]}function Zs(e,t){return dL(e,It(t))}function xh(e,t){let n=qr(e,t);return se(n)?ee(n[0],"")?[]:n:[]}var p=(e,t,n=()=>[])=>e.length===2?t(e):n(),gL=e=>p(p(_e(e),([t,n])=>p(h("extends",n),([o,i])=>p(J(i),([a,c])=>p(h("=",c),([m,l])=>p(J(l),([f,y])=>[[t,o,a,m,f],y]))))),([t,n])=>[Eg(t),n]),yL=e=>p(p(_e(e),([t,n])=>p(h("extends",n),([o,i])=>p(J(i),([a,c])=>[[t,o,a],c]))),([t,n])=>[Ig(t),n]),hL=e=>p(p(_e(e),([t,n])=>p(h("=",n),([o,i])=>p(J(i),([a,c])=>[[t,o,a],c]))),([t,n])=>[_g(t),n]),TL=e=>p(_e(e),([t,n])=>[bg(t),n]),Ph=e=>p(p(gL(e),([t,n])=>[t,n],()=>p(yL(e),([t,n])=>[t,n],()=>p(hL(e),([t,n])=>[t,n],()=>p(TL(e),([t,n])=>[t,n],()=>[])))),([t,n])=>[t,n]),Uh=(e,t=[])=>p(p(Ph(e),([n,o])=>p(h(",",o),([i,a])=>[[n,i],a])),([n,o])=>Uh(o,[...t,n]),()=>[t,e]),EL=e=>p(p(Uh(e),([t,n])=>p(p(p(Ph(n),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>p([[],n],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,n])=>[Sg(t),n]),au=e=>p(p(h("<",e),([t,n])=>p(EL(n),([o,i])=>p(h(">",i),([a,c])=>[[t,o,a],c]))),([t,n])=>[Og(t),n]),wh=(e,t=[])=>p(p(J(e),([n,o])=>p(h(",",o),([i,a])=>[[n,i],a])),([n,o])=>wh(o,[...t,n]),()=>[t,e]),IL=e=>p(p(wh(e),([t,n])=>p(p(p(J(n),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>p([[],n],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,n])=>[Ag(t),n]),_L=e=>p(p(h("<",e),([t,n])=>p(IL(n),([o,i])=>p(h(">",i),([a,c])=>[[t,o,a],c]))),([t,n])=>[xg(t),n]),bL=e=>p(p(_e(e),([t,n])=>p(_L(n),([o,i])=>[[t,o],i])),([t,n])=>[Rg(t),n]),Nh=e=>p(p(p(h(";",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>p([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[Cg(t),n]),Lh=e=>p(h("string",e),([t,n])=>[Pg(t),n]),kh=e=>p(h("number",e),([t,n])=>[Ug(t),n]),SL=e=>p(h("boolean",e),([t,n])=>[wg(t),n]),OL=e=>p(h("undefined",e),([t,n])=>[Ng(t),n]),AL=e=>p(h("null",e),([t,n])=>[Lg(t),n]),vh=e=>p(h("integer",e),([t,n])=>[kg(t),n]),xL=e=>p(h("bigint",e),([t,n])=>[vg(t),n]),RL=e=>p(h("unknown",e),([t,n])=>[Mg(t),n]),CL=e=>p(h("any",e),([t,n])=>[Dg(t),n]),PL=e=>p(h("object",e),([t,n])=>[Gg(t),n]),UL=e=>p(h("never",e),([t,n])=>[$g(t),n]),Mh=e=>p(h("symbol",e),([t,n])=>[jg(t),n]),wL=e=>p(h("void",e),([t,n])=>[qg(t),n]),NL=e=>p(h("this",e),([t,n])=>[Fg(t),n]),LL=e=>p(p(Lh(e),([t,n])=>[t,n],()=>p(kh(e),([t,n])=>[t,n],()=>p(SL(e),([t,n])=>[t,n],()=>p(OL(e),([t,n])=>[t,n],()=>p(AL(e),([t,n])=>[t,n],()=>p(vh(e),([t,n])=>[t,n],()=>p(xL(e),([t,n])=>[t,n],()=>p(RL(e),([t,n])=>[t,n],()=>p(CL(e),([t,n])=>[t,n],()=>p(PL(e),([t,n])=>[t,n],()=>p(UL(e),([t,n])=>[t,n],()=>p(Mh(e),([t,n])=>[t,n],()=>p(wL(e),([t,n])=>[t,n],()=>p(NL(e),([t,n])=>[t,n],()=>[])))))))))))))),([t,n])=>[t,n]),kL=e=>p(p(h("${",e),([t,n])=>p(J(n),([o,i])=>p(h("}",i),([a,c])=>[[t,o,a],c]))),([t,n])=>[Bg(t),n]),ou=e=>p(qr(["${","`"],e),([t,n])=>[Hg(t),n]),Dh=e=>p(p(p(ou(e),([t,n])=>p(kL(n),([o,i])=>p(Dh(i),([a,c])=>[[t,o,a],c]))),([t,n])=>[t,n],()=>p(p(ou(e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>p(p(ou(e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>[]))),([t,n])=>[Kg(t),n]),su=e=>p(p(h("`",e),([t,n])=>p(Dh(n),([o,i])=>p(h("`",i),([a,c])=>[[t,o,a],c]))),([t,n])=>[zg(t),n]),vL=e=>p(su(e),([t,n])=>[Vg(t),n]),ML=e=>p(Ih(e),([t,n])=>[Yg(t),n]),DL=e=>p(p(h("true",e),([t,n])=>[t,n],()=>p(h("false",e),([t,n])=>[t,n],()=>[])),([t,n])=>[Qg(t),n]),GL=e=>p(Ws(e),([t,n])=>[Wg(t),n]),$L=e=>p(Zs(["'",'"'],e),([t,n])=>[Zg(t),n]),jL=e=>p(p(ML(e),([t,n])=>[t,n],()=>p(DL(e),([t,n])=>[t,n],()=>p(GL(e),([t,n])=>[t,n],()=>p($L(e),([t,n])=>[t,n],()=>[])))),([t,n])=>[t,n]),qL=e=>p(p(p(h("keyof",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>p([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[Xg(t),n]),Gh=(e,t=[])=>p(p(p(h("[",e),([n,o])=>p(J(o),([i,a])=>p(h("]",a),([c,m])=>[[n,i,c],m]))),([n,o])=>[n,o],()=>p(p(h("[",e),([n,o])=>p(h("]",o),([i,a])=>[[n,i],a])),([n,o])=>[n,o],()=>[])),([n,o])=>Gh(o,[...t,n]),()=>[t,e]),FL=e=>p(Gh(e),([t,n])=>[Jg(t),n]),BL=e=>p(p(p(h("extends",e),([t,n])=>p(J(n),([o,i])=>p(h("?",i),([a,c])=>p(J(c),([m,l])=>p(h(":",l),([f,y])=>p(J(y),([T,A])=>[[t,o,a,m,f,T],A])))))),([t,n])=>[t,n],()=>p([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[ey(t),n]),HL=e=>p(p(p(h("(",e),([t,n])=>p(J(n),([o,i])=>p(h(")",i),([a,c])=>[[t,o,a],c]))),([t,n])=>[t,n],()=>p(LL(e),([t,n])=>[t,n],()=>p(rk(e),([t,n])=>[t,n],()=>p(ck(e),([t,n])=>[t,n],()=>p(vL(e),([t,n])=>[t,n],()=>p(jL(e),([t,n])=>[t,n],()=>p(fk(e),([t,n])=>[t,n],()=>p(dk(e),([t,n])=>[t,n],()=>p(Tk(e),([t,n])=>[t,n],()=>p(Ik(e),([t,n])=>[t,n],()=>p(bL(e),([t,n])=>[t,n],()=>p(Ek(e),([t,n])=>[t,n],()=>[])))))))))))),([t,n])=>[ty(t),n]),$h=e=>p(p(qL(e),([t,n])=>p(HL(n),([o,i])=>p(FL(i),([a,c])=>p(BL(c),([m,l])=>[[t,o,a,m],l])))),([t,n])=>[ry(t),n]),jh=e=>p(p(p(h("&",e),([t,n])=>p($h(n),([o,i])=>p(jh(i),([a,c])=>[[t,o,a],c]))),([t,n])=>[t,n],()=>p([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[t,n]),qh=e=>p(p($h(e),([t,n])=>p(jh(n),([o,i])=>[[t,o],i])),([t,n])=>[ny(t),n]),Fh=e=>p(p(p(h("|",e),([t,n])=>p(qh(n),([o,i])=>p(Fh(i),([a,c])=>[[t,o,a],c]))),([t,n])=>[t,n],()=>p([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[t,n]),Xs=e=>p(p(qh(e),([t,n])=>p(Fh(n),([o,i])=>[[t,o],i])),([t,n])=>[oy(t),n]),KL=e=>p(p(h("readonly",e),([t,n])=>p(Xs(n),([o,i])=>[[t,o],i])),([t,n])=>[iy(t),n]),zL=e=>p(p(h("|",e),([t,n])=>p(Xs(n),([o,i])=>[[t,o],i])),([t,n])=>[ay(t),n]),VL=e=>p(p(au(e),([t,n])=>p(h("=",n),([o,i])=>p(J(i),([a,c])=>[[t,o,a],c]))),([t,n])=>[sy(t),n]),YL=e=>p(p(p(h("infer",e),([t,n])=>p(_e(n),([o,i])=>p(h("extends",i),([a,c])=>p(Xs(c),([m,l])=>[[t,o,a,m],l])))),([t,n])=>[t,n],()=>p(p(h("infer",e),([t,n])=>p(_e(n),([o,i])=>[[t,o],i])),([t,n])=>[t,n],()=>[])),([t,n])=>[cy(t),n]),J=e=>p(p(YL(e),([t,n])=>[t,n],()=>p(zL(e),([t,n])=>[t,n],()=>p(KL(e),([t,n])=>[t,n],()=>p(Xs(e),([t,n])=>[t,n],()=>[])))),([t,n])=>[t,n]),QL=e=>p(Ws(e),([t,n])=>[py(t),n]),WL=e=>p(_e(e),([t,n])=>[t,n]),ZL=e=>p(Zs(["'",'"'],e),([t,n])=>[t,n]),XL=e=>p(p(h("[",e),([t,n])=>p(_e(n),([o,i])=>p(h(":",i),([a,c])=>p(p(vh(c),([m,l])=>[m,l],()=>p(kh(c),([m,l])=>[m,l],()=>p(Lh(c),([m,l])=>[m,l],()=>p(Mh(c),([m,l])=>[m,l],()=>[])))),([m,l])=>p(h("]",l),([f,y])=>[[t,o,a,m,f],y]))))),([t,n])=>[uy(t),n]),Bh=e=>p(p(QL(e),([t,n])=>[t,n],()=>p(WL(e),([t,n])=>[t,n],()=>p(ZL(e),([t,n])=>[t,n],()=>p(XL(e),([t,n])=>[t,n],()=>[])))),([t,n])=>[t,n]),JL=e=>p(p(p(h("readonly",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>p([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[my(t),n]),ek=e=>p(p(p(h("?",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>p([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[ly(t),n]),Hh=e=>p(p(JL(e),([t,n])=>p(Bh(n),([o,i])=>p(ek(i),([a,c])=>p(h(":",c),([m,l])=>p(J(l),([f,y])=>[[t,o,a,m,f],y]))))),([t,n])=>[dy(t),n]),Kh=e=>p(p(p(h(",",e),([t,n])=>p(h(`
31
+ `,n),([o,i])=>[[t,o],i])),([t,n])=>[t,n],()=>p(p(h(";",e),([t,n])=>p(h(`
32
+ `,n),([o,i])=>[[t,o],i])),([t,n])=>[t,n],()=>p(p(h(",",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>p(p(h(";",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>p(p(h(`
33
+ `,e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>[]))))),([t,n])=>[t,n]),zh=(e,t=[])=>p(p(Hh(e),([n,o])=>p(Kh(o),([i,a])=>[[n,i],a])),([n,o])=>zh(o,[...t,n]),()=>[t,e]),tk=e=>p(p(zh(e),([t,n])=>p(p(p(Hh(n),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>p([[],n],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,n])=>[fy(t),n]),cu=e=>p(p(h("{",e),([t,n])=>p(tk(n),([o,i])=>p(h("}",i),([a,c])=>[[t,o,a],c]))),([t,n])=>[yy(t),n]),rk=e=>p(cu(e),([t,n])=>[hy(t),n]),nk=e=>p(p(p(_e(e),([t,n])=>p(h("?",n),([o,i])=>p(h(":",i),([a,c])=>p(h("readonly",c),([m,l])=>p(J(l),([f,y])=>[[t,o,a,m,f],y]))))),([t,n])=>[t,n],()=>p(p(_e(e),([t,n])=>p(h(":",n),([o,i])=>p(h("readonly",i),([a,c])=>p(J(c),([m,l])=>[[t,o,a,m],l])))),([t,n])=>[t,n],()=>p(p(_e(e),([t,n])=>p(h("?",n),([o,i])=>p(h(":",i),([a,c])=>p(J(c),([m,l])=>[[t,o,a,m],l])))),([t,n])=>[t,n],()=>p(p(_e(e),([t,n])=>p(h(":",n),([o,i])=>p(J(i),([a,c])=>[[t,o,a],c]))),([t,n])=>[t,n],()=>[])))),([t,n])=>[Ty(t),n]),ok=e=>p(p(h("readonly",e),([t,n])=>p(J(n),([o,i])=>p(h("?",i),([a,c])=>[[t,o,a],c]))),([t,n])=>[Ey(t),n]),ik=e=>p(p(h("readonly",e),([t,n])=>p(J(n),([o,i])=>[[t,o],i])),([t,n])=>[Iy(t),n]),ak=e=>p(p(J(e),([t,n])=>p(h("?",n),([o,i])=>[[t,o],i])),([t,n])=>[_y(t),n]),Rh=e=>p(p(nk(e),([t,n])=>[t,n],()=>p(ok(e),([t,n])=>[t,n],()=>p(ik(e),([t,n])=>[t,n],()=>p(ak(e),([t,n])=>[t,n],()=>p(J(e),([t,n])=>[t,n],()=>[]))))),([t,n])=>[t,n]),Vh=e=>p(p(p(h("...",e),([t,n])=>p(Rh(n),([o,i])=>[[t,o],i])),([t,n])=>[t,n],()=>p(p(Rh(e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>[])),([t,n])=>[by(t),n]),Yh=(e,t=[])=>p(p(Vh(e),([n,o])=>p(h(",",o),([i,a])=>[[n,i],a])),([n,o])=>Yh(o,[...t,n]),()=>[t,e]),sk=e=>p(p(Yh(e),([t,n])=>p(p(p(Vh(n),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>p([[],n],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,n])=>[Sy(t),n]),ck=e=>p(p(h("[",e),([t,n])=>p(sk(n),([o,i])=>p(h("]",i),([a,c])=>[[t,o,a],c]))),([t,n])=>[Oy(t),n]),pk=e=>p(p(_e(e),([t,n])=>p(h("?",n),([o,i])=>p(h(":",i),([a,c])=>p(h("readonly",c),([m,l])=>p(J(l),([f,y])=>[[t,o,a,m,f],y]))))),([t,n])=>[Ay(t),n]),uk=e=>p(p(_e(e),([t,n])=>p(h(":",n),([o,i])=>p(h("readonly",i),([a,c])=>p(J(c),([m,l])=>[[t,o,a,m],l])))),([t,n])=>[xy(t),n]),mk=e=>p(p(_e(e),([t,n])=>p(h("?",n),([o,i])=>p(h(":",i),([a,c])=>p(J(c),([m,l])=>[[t,o,a,m],l])))),([t,n])=>[Ry(t),n]),lk=e=>p(p(_e(e),([t,n])=>p(h(":",n),([o,i])=>p(J(i),([a,c])=>[[t,o,a],c]))),([t,n])=>[Cy(t),n]),Ch=e=>p(p(pk(e),([t,n])=>[t,n],()=>p(uk(e),([t,n])=>[t,n],()=>p(mk(e),([t,n])=>[t,n],()=>p(lk(e),([t,n])=>[t,n],()=>[])))),([t,n])=>[t,n]),Qh=e=>p(p(p(h("...",e),([t,n])=>p(Ch(n),([o,i])=>[[t,o],i])),([t,n])=>[t,n],()=>p(p(Ch(e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>[])),([t,n])=>[Py(t),n]),Wh=(e,t=[])=>p(p(Qh(e),([n,o])=>p(h(",",o),([i,a])=>[[n,i],a])),([n,o])=>Wh(o,[...t,n]),()=>[t,e]),Zh=e=>p(p(Wh(e),([t,n])=>p(p(p(Qh(n),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>p([[],n],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,n])=>[Uy(t),n]),dk=e=>p(p(h("(",e),([t,n])=>p(Zh(n),([o,i])=>p(h(")",i),([a,c])=>p(h("=>",c),([m,l])=>p(J(l),([f,y])=>[[t,o,a,m,f],y]))))),([t,n])=>[wy(t),n]),fk=e=>p(p(h("new",e),([t,n])=>p(h("(",n),([o,i])=>p(Zh(i),([a,c])=>p(h(")",c),([m,l])=>p(h("=>",l),([f,y])=>p(J(y),([T,A])=>[[t,o,a,m,f,T],A])))))),([t,n])=>[Ny(t),n]),gk=e=>p(p(p(h("+",e),([t,n])=>p(h("readonly",n),([o,i])=>[[t,o],i])),([t,n])=>[t,n],()=>p(p(h("-",e),([t,n])=>p(h("readonly",n),([o,i])=>[[t,o],i])),([t,n])=>[t,n],()=>p(p(h("readonly",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>p([[],e],([t,n])=>[t,n],()=>[])))),([t,n])=>[Ly(t),n]),yk=e=>p(p(p(h("+",e),([t,n])=>p(h("?",n),([o,i])=>[[t,o],i])),([t,n])=>[t,n],()=>p(p(h("-",e),([t,n])=>p(h("?",n),([o,i])=>[[t,o],i])),([t,n])=>[t,n],()=>p(p(h("?",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>p([[],e],([t,n])=>[t,n],()=>[])))),([t,n])=>[ky(t),n]),hk=e=>p(p(p(h("as",e),([t,n])=>p(J(n),([o,i])=>[[t,o],i])),([t,n])=>[t,n],()=>p([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[vy(t),n]),Tk=e=>p(p(h("{",e),([t,n])=>p(gk(n),([o,i])=>p(h("[",i),([a,c])=>p(_e(c),([m,l])=>p(h("in",l),([f,y])=>p(J(y),([T,A])=>p(hk(A),([ye,Ue])=>p(h("]",Ue),([Pr,Jn])=>p(yk(Jn),([ln,uU])=>p(h(":",uU),([mU,lU])=>p(J(lU),([dU,fU])=>p(Nh(fU),([gU,yU])=>p(h("}",yU),([hU,TU])=>[[t,o,a,m,f,T,ye,Pr,ln,mU,dU,gU,hU],TU]))))))))))))),([t,n])=>[My(t),n]),Ek=e=>p(_e(e),([t,n])=>[Dy(t),n]),Ik=e=>p(p(h("Options",e),([t,n])=>p(h("<",n),([o,i])=>p(J(i),([a,c])=>p(h(",",c),([m,l])=>p(eT(l),([f,y])=>p(h(">",y),([T,A])=>[[t,o,a,m,f,T],A])))))),([t,n])=>[Gy(t),n]),_k=e=>p(Ws(e),([t,n])=>[$y(t),n]),bk=e=>p(p(h("true",e),([t,n])=>[t,n],()=>p(h("false",e),([t,n])=>[t,n],()=>[])),([t,n])=>[jy(t),n]),Sk=e=>p(Zs(['"',"'"],e),([t,n])=>[t,n]),Ok=e=>p(h("null",e),([t,n])=>[qy(t),n]),Xh=e=>p(p(Bh(e),([t,n])=>p(h(":",n),([o,i])=>p(pu(i),([a,c])=>[[t,o,a],c]))),([t,n])=>[Fy(t),n]),Jh=(e,t=[])=>p(p(Xh(e),([n,o])=>p(Kh(o),([i,a])=>[[n,i],a])),([n,o])=>Jh(o,[...t,n]),()=>[t,e]),Ak=e=>p(p(Jh(e),([t,n])=>p(p(p(Xh(n),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>p([[],n],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,n])=>[By(t),n]),eT=e=>p(p(h("{",e),([t,n])=>p(Ak(n),([o,i])=>p(h("}",i),([a,c])=>[[t,o,a],c]))),([t,n])=>[Hy(t),n]),tT=(e,t=[])=>p(p(pu(e),([n,o])=>p(h(",",o),([i,a])=>[[n,i],a])),([n,o])=>tT(o,[...t,n]),()=>[t,e]),xk=e=>p(p(tT(e),([t,n])=>p(p(p(pu(n),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>p([[],n],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,n])=>[Ky(t),n]),Rk=e=>p(p(h("[",e),([t,n])=>p(xk(n),([o,i])=>p(h("]",i),([a,c])=>[[t,o,a],c]))),([t,n])=>[zy(t),n]),pu=e=>p(p(_k(e),([t,n])=>[t,n],()=>p(bk(e),([t,n])=>[t,n],()=>p(Sk(e),([t,n])=>[t,n],()=>p(Ok(e),([t,n])=>[t,n],()=>p(eT(e),([t,n])=>[t,n],()=>p(Rk(e),([t,n])=>[t,n],()=>[])))))),([t,n])=>[t,n]),Ck=e=>p(h("-?(?:0|[1-9][0-9]*)n",e),([t,n])=>[Vy(t),n]),Pk=e=>p(h(".*",e),([t,n])=>[Yy(t),n]),Uk=e=>p(h("-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?",e),([t,n])=>[Qy(t),n]),wk=e=>p(h("-?(?:0|[1-9][0-9]*)",e),([t,n])=>[Wy(t),n]),Nk=e=>p(h("(?!)",e),([t,n])=>[Zy(t),n]),Lk=e=>p(xh(["-?(?:0|[1-9][0-9]*)n",".*","-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?","-?(?:0|[1-9][0-9]*)","(?!)","(",")","$","|"],e),([t,n])=>[Xy(t),n]),kk=e=>p(p(Ck(e),([t,n])=>[t,n],()=>p(Pk(e),([t,n])=>[t,n],()=>p(Uk(e),([t,n])=>[t,n],()=>p(wk(e),([t,n])=>[t,n],()=>p(Nk(e),([t,n])=>[t,n],()=>p(vk(e),([t,n])=>[t,n],()=>p(Lk(e),([t,n])=>[t,n],()=>[]))))))),([t,n])=>[t,n]),vk=e=>p(p(h("(",e),([t,n])=>p(uu(n),([o,i])=>p(h(")",i),([a,c])=>[[t,o,a],c]))),([t,n])=>[Jy(t),n]),rT=e=>p(p(p(iu(e),([t,n])=>p(h("|",n),([o,i])=>p(rT(i),([a,c])=>[[t,o,a],c]))),([t,n])=>[t,n],()=>p(p(iu(e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>p([[],e],([t,n])=>[t,n],()=>[]))),([t,n])=>[eh(t),n]),iu=e=>p(p(kk(e),([t,n])=>p(uu(n),([o,i])=>[[t,o],i])),([t,n])=>[th(t),n]),uu=e=>p(p(rT(e),([t,n])=>[t,n],()=>p(iu(e),([t,n])=>[t,n],()=>[])),([t,n])=>[t,n]),nT=e=>p(p(h("^",e),([t,n])=>p(uu(n),([o,i])=>p(h("$",i),([a,c])=>[[t,o,a],c]))),([t,n])=>[rh(t),n]),oT=(e,t=[])=>p(p(J(e),([n,o])=>p(h(",",o),([i,a])=>[[n,i],a])),([n,o])=>oT(o,[...t,n]),()=>[t,e]),Mk=e=>p(p(oT(e),([t,n])=>p(p(p(J(n),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>p([[],n],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,n])=>[nh(t),n]),iT=e=>p(p(p(h("extends",e),([t,n])=>p(Mk(n),([o,i])=>[[t,o],i])),([t,n])=>[t,n],()=>p([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[oh(t),n]),Dk=e=>p(p(h("interface",e),([t,n])=>p(_e(n),([o,i])=>p(au(i),([a,c])=>p(iT(c),([m,l])=>p(cu(l),([f,y])=>[[t,o,a,m,f],y]))))),([t,n])=>[ih(t),n]),Gk=e=>p(p(h("interface",e),([t,n])=>p(_e(n),([o,i])=>p(iT(i),([a,c])=>p(cu(c),([m,l])=>[[t,o,a,m],l])))),([t,n])=>[ah(t),n]),$k=e=>p(p(h("type",e),([t,n])=>p(_e(n),([o,i])=>p(au(i),([a,c])=>p(h("=",c),([m,l])=>p(J(l),([f,y])=>[[t,o,a,m,f],y]))))),([t,n])=>[sh(t),n]),jk=e=>p(p(h("type",e),([t,n])=>p(_e(n),([o,i])=>p(h("=",i),([a,c])=>p(J(c),([m,l])=>[[t,o,a,m],l])))),([t,n])=>[ch(t),n]),qk=e=>p(p(p(h("export",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>p([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[ph(t),n]),Fk=e=>p(p(p(h(";",e),([t,n])=>p(h(`
34
+ `,n),([o,i])=>[[t,o],i])),([t,n])=>[t,n],()=>p(p(h(";",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>p(p(h(`
35
+ `,e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>[]))),([t,n])=>[t,n]),aT=(e,t=[])=>p(p(mu(e),([n,o])=>p(Fk(o),([i,a])=>[[n,i],a])),([n,o])=>aT(o,[...t,n]),()=>[t,e]),Bk=e=>p(p(aT(e),([t,n])=>p(p(p(mu(n),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>p([[],n],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,n])=>[uh(t),n]),mu=e=>p(p(qk(e),([t,n])=>p(p(Dk(n),([o,i])=>[o,i],()=>p(Gk(n),([o,i])=>[o,i],()=>p($k(n),([o,i])=>[o,i],()=>p(jk(n),([o,i])=>[o,i],()=>[])))),([o,i])=>p(Nh(i),([a,c])=>[[t,o,a],c]))),([t,n])=>[mh(t),n]),Hk=e=>p(p(mu(e),([t,n])=>p(Bk(n),([o,i])=>[[t,o],i])),([t,n])=>[lh(t),n]),sT=e=>p(p(Hk(e),([t,n])=>[t,n],()=>p(VL(e),([t,n])=>[t,n],()=>p(J(e),([t,n])=>[t,n],()=>[]))),([t,n])=>[t,n]);function cT(e){let t=su(`\`${e}\``);return s.IsEqual(t.length,2)?t[0]:H()}function bi(e,t={}){return P("TemplateLiteral",[e],t)}function pT(e){return R({},bi(e,{}))}function zk(e){let t=cT(e);return pT(t)}function uT(e,t={}){let n=s.IsString(e)?zk(e):pT(e);return g.Update(n,{},t)}function Re(e){return _(e,"TemplateLiteral")}var L={};Lt(L,{ExtendsFalse:()=>B,ExtendsTrue:()=>x,ExtendsUnion:()=>lu,IsExtendsFalse:()=>Vk,IsExtendsTrue:()=>lT,IsExtendsTrueLike:()=>be,IsExtendsUnion:()=>mT});function lu(e){return g.Create({"~kind":"ExtendsUnion"},{inferred:e})}function mT(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"inferred")&&s.IsEqual(e["~kind"],"ExtendsUnion")&&s.IsObject(e.inferred)}function x(e){return g.Create({"~kind":"ExtendsTrue"},{inferred:e})}function lT(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 g.Create({"~kind":"ExtendsFalse"},{})}function Vk(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.IsEqual(e["~kind"],"ExtendsFalse")}function be(e){return mT(e)||lT(e)}function Js(e){let t=nT(e);return s.IsEqual(t.length,2)?t[0]:H()}function Yk(e){return!0}function dT(e){let[t,...n]=e;return O(t)?Qk(t)?dT(n):!1:!0}function fT(e){return s.IsEqual(e.length,0)?!1:dT(e)}function Qk(e){return S(e)?fT(e.anyOf):X(e)?Yk(e.const):!1}function ec(e){return fT(e)}function gT(e,t,n=[]){let[o,...i]=e;return s.IsString(o)?gT(i,t,[...n,`${o}${t}`]):n}function Wk(e,t){return s.IsEqual(e.length,0)?[`${t}`]:gT(e,t)}function yT(e,t,n=[]){let[o,...i]=t;return O(o)?yT(e,i,[...n,...hT(e,o)]):n}function hT(e,t){return S(t)?yT(e,t.anyOf):X(t)?Wk(e,t.const):H()}function TT(e,t){let[n,...o]=t;return O(n)?TT(hT(e,n),o):e}function Zk(e){return e.map(t=>V(t))}function Xk(e){let t=TT([],e),n=Zk(t);return $(n)}function Jk(e){return s.IsEqual(e.length,0)?H():s.IsEqual(e.length,1)&&X(e[0])?e[0]:Xk(e)}function Je(e){let t=Js(e);return ec(t)?Jk(t):Tt()}function ev(e){return s.IsString(e)||s.IsNumber(e)?V(e):s.IsNull(e)?Gr():Z()}function jt(e){return e.map(n=>ev(n))}function qi(e){let t=jt(e);return $(t)}function On(e){return qi(e.enum)}function tv(e,t,n,o){let i=ne(e,n,o);return be(i)?x(g.Assign(g.Assign(e,i.inferred),{[t]:n})):B()}function rv(e,t){return x(e)}function nv(e,t,n){let o=qi(n);return ne(e,t,o)}function ET(e,t,n){let[o,...i]=n;return O(o)?(()=>{let a=ne(e,t,o);return be(a)?ET(a.inferred,t,i):B()})():x(e)}function ov(e,t,n){let o=Je(n);return ne(e,t,o)}function IT(e,t,n){let[o,...i]=n;return O(o)?(()=>{let a=ne(e,t,o);return be(a)?x(a.inferred):IT(e,t,i)})():B()}function K(e,t,n){return at(n)?rv(e,t):xe(n)?nv(e,t,n.enum):Ae(n)?tv(e,n.name,t,n.extends):w(n)?ET(e,t,n.allOf):Re(n)?ov(e,t,n.pattern):S(n)?IT(e,t,n.anyOf):ht(n)?x(e):B()}function _T(e,t,n){return Ae(n)?K(e,t,n):at(n)?x(e):ht(n)?x(e):lu(e)}function iv(e,t){let n=hn(e),o=hn(t);return n&&o||!n&&o?!0:!(n&&!o)}function bT(e,t,n,o){return te(o)?iv(t,o)?ne(e,n,o.items):B():K(e,t,o)}function ST(e,t,n){return nt(n)?ne(e,t,n.iteratorItems):K(e,Vt(t),n)}function OT(e,t,n){return bt(n)?x(e):K(e,t,n)}function AT(e,t,n){return ct(n)?x(e):K(e,t,n)}function av(e,t,n,o,i){let a=Ae(o)?t:o,c=Ae(o)?o:t,m=ve(t),l=ve(o),f=ne(e,a,c);return!m&&l?B():be(f)?Fi(f.inferred,n,i):B()}function sv(e,t,n,o){let[i,...a]=o;return O(i)?av(e,t,n,i,a):ve(t)?x(e):B()}function cv(e,t,n){let[o,...i]=t;return O(o)?sv(e,o,i,n):x(e)}function Fi(e,t,n){return cv(e,t,n)}function tc(e,t,n){return Ot(n)?x(e):ne(e,t,n)}function xT(e,t,n,o){return Me(o)?(()=>{let i=Fi(e,t,o.parameters);return be(i)?tc(i.inferred,n,o.instanceType):B()})():B()}function RT(e,t,n){return ne(e,On(t),n)}function CT(e,t,n,o){return De(o)?(()=>{let i=Fi(e,t,o.parameters);return be(i)?tc(i.inferred,n,o.returnType):B()})():B()}function PT(e,t,n){return qe(n)?x(e):Ee(n)?x(e):K(e,t,n)}var Bi="equal",pv="disjoint",Hi="left-inside",Ki="right-inside";function zi(e,t){let n=[ht(e)?L.ExtendsFalse():tt({},e,t),ht(e)?L.ExtendsTrue({}):tt({},t,e)];return L.IsExtendsTrueLike(n[0])&&L.IsExtendsTrueLike(n[1])?Bi:L.IsExtendsTrueLike(n[0])&&L.IsExtendsFalse(n[1])?Hi:L.IsExtendsFalse(n[0])&&L.IsExtendsTrueLike(n[1])?Ki:pv}function uv(e){return S(e)?tr(e.anyOf):[e]}function tr(e){return e.reduce((t,n)=>[...t,...uv(n)],[])}function du(e){return e.reduceRight((n,o,i)=>({[i]:o,...n}),{})}function UT(e){let t=du(e.items);return N(t)}function mv(e,t){return Tn(e)?!!Tn(t):!1}function lv(e,t){return ve(e)?!!ve(t):!1}function dv(e,t){let n=mv(e,t),o=lv(e,t),i=Ce([e,t]),a=Ps(eo(i));return n&&o?yt(gt(a)):n&&!o?yt(a):!n&&o?gt(a):a}function fv(e,t,n){return n in e?n in t?dv(e[n],t[n]):e[n]:n in t?t[n]:Z()}function gv(e,t){return[...new Set([...s.Keys(t),...s.Keys(e)])].reduce((o,i)=>({...o,[i]:fv(e,t,i)}),{})}function wT(e){return v(e)?e.properties:Y(e)?du(e.items):H()}function NT(e,t){let n=wT(e),o=wT(t),i=gv(n,o);return N(i)}function LT(e,t){let n=zi(e,t);return s.IsEqual(n,Hi)?e:s.IsEqual(n,Ki)||s.IsEqual(n,Bi)?t:Z()}function kT(e){return v(e)||Y(e)}function vT(e){return w(e)?Ce(e.allOf):e}function yv(e,t){let n=vT(e),o=vT(t),i=kT(n),a=kT(o);return i&&a?NT(Fr(n),o):i&&!a?Fr(n):!i&&a?o:LT(Fr(n),o)}function MT(e,t,n=[]){let[o,...i]=t;return s.IsUndefined(o)?n.length===0?[e]:n:MT(e,i,[...n,yv(e,o)])}function DT(e,t,n=[]){let[o,...i]=e;return O(o)?DT(i,t,[...n,...Vi([o],t)]):n}function Vi(e,t=[]){let[n,...o]=e;return O(n)?S(n)?Vi(o,DT(n.anyOf,t)):Vi(o,MT(n,t)):t}function Ce(e){let t=Vi(e);return fu(t)}function lr(e){return fu(e)}function Fr(e){return w(e)?Ce(e.allOf):S(e)?lr(e.anyOf):e}function An(e){return s.IsEqual(e.length,1)?e[0]:s.IsEqual(e.length,0)?Z():$(e)}function hv(e,t){return t.filter(n=>zi(e,n)!==Ki)}function Tv(e,t){let n=t.some(o=>{let i=zi(e,o);return s.IsEqual(i,Hi)||s.IsEqual(i,Bi)});return s.IsEqual(n,!1)}function Ev(e,t){let n=Fr(e);return at(n)?[n]:Tv(n,t)?[...hv(n,t),n]:t}function gu(e,t=[]){let[n,...o]=e;return O(n)?v(n)?gu(o,[...t,n]):gu(o,Ev(n,t)):t}function fu(e){let t=gu(e),n=tr(t);return n.length===0?Z():n.length===1?n[0]:$(n)}function Iv(e,t,n,o){let i=I(e,t,n);return g.Update(Fr(i),{},o)}function GT(e,t,n,o){return Iv(e,t,n,o)}function $T(e,t,n){let o=Ce(t);return ne(e,o,n)}function jT(e,t,n){return ot(n)?ne(e,t,n.iteratorItems):K(e,Qt(t),n)}function rc(e,t,n){return t===n?x(e):B()}function _v(e,t,n){return X(n)?rc(e,t,n.const):bt(n)?x(e):K(e,V(t),n)}function bv(e,t,n){return X(n)?rc(e,t,n.const):ct(n)?x(e):K(e,V(t),n)}function Sv(e,t,n){return X(n)?rc(e,t,n.const):Ee(n)?x(e):K(e,V(t),n)}function Ov(e,t,n){return X(n)?rc(e,t,n.const):Ne(n)?x(e):K(e,V(t),n)}function qT(e,t,n){return s.IsBigInt(t.const)?_v(e,t.const,n):s.IsBoolean(t.const)?bv(e,t.const,n):s.IsNumber(t.const)?Sv(e,t.const,n):s.IsString(t.const)?Ov(e,t.const,n):H()}function FT(e,t,n){return Ae(n)?K(e,t,n):x(e)}function BT(e,t,n){return Wt(n)?x(e):K(e,t,n)}function HT(e,t,n){return Ee(n)?x(e):K(e,t,n)}function Av(e,t,n){return ve(t)?ve(n)?x(e):B():x(e)}function xv(e,t,n){return Ae(n)&&ur(n.extends)?B():(()=>{let o=ne(e,t,n);return be(o)?Av(o.inferred,t,n):B()})()}function Rv(e,t){return e.reduce((n,o)=>o in t?be(t[o])?{...n,...t[o].inferred}:H():H(),{})}function Cv(e,t,n){let o={};for(let c of s.Keys(n))o[c]=c in t?xv({},t[c],n[c]):ve(n[c])?Ae(n[c])?x(g.Assign(e,{[n[c].name]:n[c].extends})):x(e):B();let i=s.Values(o).every(c=>be(c)),a=i?Rv(s.Keys(o),o):{};return i?x(a):B()}function Pv(e,t,n){let o=Cv(e,t,n);return be(o)?x(g.Assign(e,o.inferred)):B()}function Uv(e,t,n){return Pv(e,t,n)}function KT(e,t,n){return v(n)?Uv(e,t,n.properties):K(e,N(t),n)}function zT(e,t,n){return Ze(n)?ne(e,t,n.item):K(e,Xt(t),n)}function VT(e,t,n){return Ne(n)?x(e):K(e,t,n)}function YT(e,t,n){return Zt(n)?x(e):K(e,t,n)}function QT(e,t,n){let o=Je(t);return ne(e,o,n)}function yu(e,t){return g.Create({"~kind":"Inferrable"},{name:e,type:t},{})}function Yi(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 hu(e){return $r(e)?Ae(e.items)?te(e.items.extends)?yu(e.items.name,e.items.extends.items):ht(e.items.extends)?yu(e.items.name,e.items.extends):void 0:H():void 0}function nc(e){return Ae(e)?yu(e.name,e.extends):void 0}function Tu(e,t,n=[]){let[o,...i]=e;return O(o)?(()=>{let a=ne({},o,t);return be(a)?Tu(i,t,[...n,o]):void 0})():n}function WT(e,t,n,o){let i=Tu(n,o);return s.IsArray(i)?x(g.Assign(e,{[t]:Fe(i)})):B()}function oc(e,t,n,o){let i=Tu(n,o);return s.IsArray(i)?x(g.Assign(e,{[t]:$(i)})):B()}function wv(e){return[...e].reverse()}function Eu(e,t){return t?wv(e):e}function Nv(e){let t=e.length>0?e[0]:void 0,n=O(t)?hu(t):void 0;return O(n)}function Lv(e,t,n,o,i,a){let c=ne(e,n,i);return be(c)?ZT(c.inferred,t,o,a):B()}function kv(e,t,n,o,i){let a=hu(o);return Yi(a)?WT(e,a.name,Eu(n,t),a.type):(()=>{let[c,...m]=n;return O(c)?Lv(e,t,c,m,o,i):B()})()}function vv(e,t,n,o){let[i,...a]=o;return O(i)?kv(e,t,n,i,a):s.IsEqual(n.length,0)?x(e):B()}function ZT(e,t,n,o){return vv(e,t,n,o)}function Mv(e,t,n){let o=ic(e,{callstack:[]},n),i=Nv(o);return ZT(e,i,Eu(t,i),Eu(o,i))}function XT(e,t,n){let o=nc(n);return Yi(o)?oc(e,o.name,t,o.type):(()=>{let[i,...a]=t;return O(i)?(()=>{let c=ne(e,i,n);return be(c)?XT(c.inferred,a,n):B()})():x(e)})()}function JT(e,t,n){let o=ic(e,{callstack:[]},t);return Y(n)?Mv(e,o,n.items):te(n)?XT(e,o,n.items):K(e,Fe(o),n)}function eE(e,t,n){return Ot(n)?x(e):er(n)?x(e):K(e,t,n)}function tE(e,t,n){let[o,...i]=n;return O(o)?(()=>{let a=ne(e,t,o);return be(a)?x(a.inferred):tE(e,t,i)})():B()}function Iu(e,t,n){let[o,...i]=t;return O(o)?(()=>{let a=tE(e,o,n);return be(a)?Iu(a.inferred,i,n):B()})():x(e)}function rE(e,t,n){let o=nc(n);return Yi(o)?oc(e,o.name,t,o.type):S(n)?Iu(e,t,n.anyOf):Iu(e,t,[n])}function nE(e,t,n){return Ae(n)?K(e,t,n):at(n)?x(e):ht(n)?x(e):B()}function oE(e,t,n){return Ot(n)?x(e):K(e,t,n)}function ne(e,t,n){return at(t)?_T(e,t,n):te(t)?bT(e,t,t.items,n):nt(t)?ST(e,t.iteratorItems,n):bt(t)?OT(e,t,n):ct(t)?AT(e,t,n):Me(t)?xT(e,t.parameters,t.instanceType,n):xe(t)?RT(e,t,n):De(t)?CT(e,t.parameters,t.returnType,n):qe(t)?PT(e,t,n):w(t)?$T(e,t.allOf,n):ot(t)?jT(e,t.iteratorItems,n):X(t)?qT(e,t,n):ur(t)?FT(e,t,n):Wt(t)?BT(e,t,n):Ee(t)?HT(e,t,n):v(t)?KT(e,t.properties,n):Ze(t)?zT(e,t.item,n):Ne(t)?VT(e,t,n):Zt(t)?YT(e,t,n):Re(t)?QT(e,t.pattern,n):Y(t)?JT(e,t.items,n):er(t)?eE(e,t,n):S(t)?rE(e,t.anyOf,n):ht(t)?nE(e,t,n):Ot(t)?oE(e,t,n):B()}function lo(e,t,n={}){return P("Interface",[e,t],n)}function Io(e){return O(e)&&s.HasPropertyKey(e,"action")&&s.IsEqual(e.action,"Interface")}function iE(e,t,n={}){return R({},lo(e,t,n))}function Dv(e,t,n){return e.includes(n)?!0:Br([...e,n],t,t[n])}function aE(e,t,n){let o=$s(n);return xn(e,t,o)}function xn(e,t,n){let[o,...i]=n;return O(o)?Br(e,t,o)?!0:xn(e,t,i):!1}function Br(e,t,n){return pe(n)?Dv(e,t,n.$ref):te(n)?Br(e,t,n.items):nt(n)?Br(e,t,n.iteratorItems):Me(n)?xn(e,t,[...n.parameters,n.instanceType]):De(n)?xn(e,t,[...n.parameters,n.returnType]):Io(n)?aE(e,t,n.parameters[1]):w(n)?xn(e,t,n.allOf):ot(n)?Br(e,t,n.iteratorItems):v(n)?aE(e,t,n.properties):Ze(n)?Br(e,t,n.item):S(n)?xn(e,t,n.anyOf):Y(n)?xn(e,t,n.items):Ie(n)?Br(e,t,Xe(n)):!1}function ac(e,t,n){return Br(e,t,n)}function Gv(e,t){return t.reduce((n,o)=>o in e?ac([o],e,e[o])?[...n,o]:n:H(),[])}function sE(e){let t=ig(e);return Gv(e,t)}function $v(e,t,n){return n.includes(t)?n:t in e?Hr(e,e[t],[...n,t]):H()}function cE(e,t,n){let o=$s(t);return _o(e,o,n)}function _o(e,t,n){return t.reduce((o,i)=>Hr(e,i,o),n)}function Hr(e,t,n){return pe(t)?$v(e,t.$ref,n):te(t)?Hr(e,t.items,n):nt(t)?Hr(e,t.iteratorItems,n):Me(t)?_o(e,[...t.parameters,t.instanceType],n):De(t)?_o(e,[...t.parameters,t.returnType],n):Io(t)?cE(e,t.parameters[1],n):w(t)?_o(e,t.allOf,n):ot(t)?Hr(e,t.iteratorItems,n):v(t)?cE(e,t.properties,n):Ze(t)?Hr(e,t.item,n):S(t)?_o(e,t.anyOf,n):Y(t)?_o(e,t.items,n):Ie(t)?Hr(e,Xe(t),n):n}function pE(e,t,n){return Hr(e,n,[t])}function jv(e){return ro()}function qv(e){return s.Keys(e).reduce((t,n)=>({...t,[n]:rr(e[n])}),{})}function Qi(e){return e.reduce((t,n)=>[...t,rr(n)],[])}function rr(e){return pe(e)?jv(e.$ref):te(e)?$t(rr(e.items),ws(e)):nt(e)?Vt(rr(e.iteratorItems)):Me(e)?Lr(Qi(e.parameters),rr(e.instanceType)):De(e)?kr(Qi(e.parameters),rr(e.returnType)):w(e)?Pt(Qi(e.allOf)):ot(e)?Qt(rr(e.iteratorItems)):v(e)?N(qv(e.properties)):Ze(e)?Xt(rr(e.item)):Ie(e)?qs(po(e),rr(Xe(e))):S(e)?$(Qi(e.anyOf)):Y(e)?Fe(Qi(e.items)):e}function Fv(e,t){return t in e?rr(e[t]):Qe()}function uE(e){return Fv(e.$defs,e.$ref)}function Bv(e,t,n){let o=At(e,{callstack:[]},t),i=Wi({},{callstack:[]},n);return Ce([...o,N(i)])}function Hv(e,t){return s.Keys(e).filter(o=>t.includes(o)).reduce((o,i)=>{let a=e[i],c=Io(a)?Bv(e,a.parameters[0],a.parameters[1]):a;return{...o,[i]:c}},{})}function mE(e,t,n){let o=pE(e,t,n),i=Hv(e,o);return Yt(i,t)}function lE(e,t){return t in e?pe(e[t])?lE(e,e[t].$ref):e[t]:Z()}function nr(e,t){return lE(e,t)}function dE(e){return le(e)?uE(e):e}function tt(e,t,n){let o=dE(t),i=dE(n);return ne(e,o,i)}function Kv(e,t,n){if(Ae(t)||bo(t)||L.IsExtendsTrueLike(tt({},t,n)))return;let o={parameter:e,extends:n,received:t};throw new Error("Generic argument does not satify constraint",{cause:o})}function fE(e,t,n,o,i){let a=I(e,t,i);return Kv(n,a,o),g.Assign(e,{[n]:a})}function zv(e,t,n,o,i){let a=I(e,t,n.extends),c=I(e,t,n.equals),[m,...l]=i;return O(m)?_u(fE(e,t,n.name,a,m),t,o,l):_u(fE(e,t,n.name,a,c),t,o,[])}function _u(e,t,n,o){let[i,...a]=n;return O(i)?zv(e,t,i,a,o):e}function gE(e,t,n,o){return _u(e,t,n,o)}function Vv(e){return s.IsGreaterThan(e.length,0)?e[0]:""}function yE(e,t,n,o){let i=At(e,t,o);return Hs(n,i)}function Yv(e,t,n,o){return yE(e,t,we(n),o)}function Qv(e,t,n,o,i,a){let c=At(e,t,a),m=gE(e,t,o,c),l=I(m,{callstack:[...t.callstack,n]},i);return I(e,t,l)}function sc(e,t,n,o){let[i,a]=vf(e,n,o);return to(a)?s.IsEqual(Vv(t.callstack),i)?Yv(e,t,i,o):Qv(e,t,i,a.parameters,a.expression,o):yE(e,t,n,o)}function Hs(e,t){return g.Create({"~kind":"Call"},{target:e,arguments:t},{})}function hE(e,t){return sc({},{callstack:[]},e,t)}function bo(e){return _(e,"Call")}function TE(e){return Ze(e)?TE(e.item):e}function Wv(e,t,n,o){let i=I(e,t,n);return g.Update(TE(i),{},o)}function EE(e,t,n,o){return k(e,[n])?Wv(e,t,n,o):ji(n,o)}function IE(e,t){return e(t)}function _E(e,t){return s.IsString(t)?V(IE(e,t)):V(t)}function bE(e,t){let n=Je(t);return dr(e,n)}function SE(e,t){let n=t.map(o=>dr(e,o));return $(n)}function dr(e,t){return X(t)?_E(e,t.const):Re(t)?bE(e,t.pattern):S(t)?SE(e,t.anyOf):t}function Si(e,t={}){return P("Capitalize",[e],t)}function OE(e,t={}){return R({},Si(e,t))}function Oi(e,t={}){return P("Lowercase",[e],t)}function AE(e,t={}){return R({},Oi(e,t))}function Ai(e,t={}){return P("Uncapitalize",[e],t)}function xE(e,t={}){return R({},Ai(e,t))}function xi(e,t={}){return P("Uppercase",[e],t)}function RE(e,t={}){return R({},xi(e,t))}var Zv=e=>e[0].toUpperCase()+e.slice(1),Xv=e=>e.toLowerCase(),Jv=e=>e[0].toLowerCase()+e.slice(1),eM=e=>e.toUpperCase();function tM(e,t,n,o){let i=I(e,t,n);return g.Update(dr(Zv,i),{},o)}function CE(e,t,n,o){return k(e,[n])?tM(e,t,n,o):Si(n,o)}function rM(e,t,n,o){let i=I(e,t,n);return g.Update(dr(Xv,i),{},o)}function PE(e,t,n,o){return k(e,[n])?rM(e,t,n,o):Oi(n,o)}function nM(e,t,n,o){let i=I(e,t,n);return g.Update(dr(Jv,i),{},o)}function UE(e,t,n,o){return k(e,[n])?nM(e,t,n,o):Ai(n,o)}function oM(e,t,n,o){let i=I(e,t,n);return g.Update(dr(eM,i),{},o)}function wE(e,t,n,o){return k(e,[n])?oM(e,t,n,o):xi(n,o)}function Ri(e,t,n,o,i={}){return P("Conditional",[e,t,n,o],i)}function NE(e,t,n,o,i={}){return R({},Ri(e,t,n,o,i))}function iM(e,t,n,o,i,a,c){let m=I(e,t,n),l=I(e,t,o),f=tt(e,m,l);return g.Update(L.IsExtendsUnion(f)?$([I(f.inferred,t,i),I(e,t,a)]):L.IsExtendsTrue(f)?I(f.inferred,t,i):I(e,t,a),{},c)}function LE(e,t,n,o,i,a,c){return k(e,[n,o])?iM(e,t,n,o,i,a,c):Ri(n,o,i,a,c)}function Ci(e,t={}){return P("ConstructorParameters",[e],t)}function kE(e,t={}){return R({},Ci(e,t))}function aM(e){return Me(e)?I({},{callstack:[]},Fe(e.parameters)):Z()}function sM(e,t,n,o){let i=I(e,t,n);return g.Update(aM(i),{},o)}function vE(e,t,n,o){return k(e,[n])?sM(e,t,n,o):Ci(n,o)}function Pi(e,t,n={}){return P("Exclude",[e,t],n)}function ME(e,t,n={}){return R({},Pi(e,t,n))}function DE(e,t){return e.reduce((n,o)=>[...n,...GE(o,t)],[])}function GE(e,t){let n=tt({},e,t);return L.IsExtendsTrueLike(n)?[]:[e]}function cM(e,t){let n=xe(e)?DE(jt(e.enum),t):S(e)?DE(tr(e.anyOf),t):GE(e,t);return lr(n)}function pM(e,t,n,o,i){let a=I(e,t,n),c=I(e,t,o);return g.Update(cM(a,c),{},i)}function cc(e,t,n,o,i){return k(e,[n,o])?pM(e,t,n,o,i):Pi(n,o,i)}function Ui(e,t,n={}){return P("Extract",[e,t],n)}function $E(e,t,n={}){return R({},Ui(e,t,n))}function jE(e,t){return e.reduce((n,o)=>[...n,...qE(o,t)],[])}function qE(e,t){let n=tt({},e,t);return L.IsExtendsTrueLike(n)?[e]:[]}function uM(e,t){let n=xe(e)?jE(jt(e.enum),t):S(e)?jE(tr(e.anyOf),t):qE(e,t);return lr(n)}function mM(e,t,n,o,i){let a=I(e,t,n),c=I(e,t,o);return g.Update(uM(a,c),{},i)}function FE(e,t,n,o,i){return k(e,[n,o])?mM(e,t,n,o,i):Ui(n,o,i)}var lM=new RegExp("^(?:0|[1-9][0-9]*)$");function So(e){let t=`${e}`;return lM.test(t)?parseInt(t):e}function dM(e){return V(So(e))}function BE(e){return e.map(t=>HE(t))}function HE(e){return w(e)?Pt(BE(e.allOf)):S(e)?$(BE(e.anyOf)):X(e)?dM(e.const):e}function KE(e,t){let n=HE(t),o=tt({},n,Ut());return L.IsExtendsTrueLike(o)?e:Z()}function zE(e,t){let n=nr(e,t);return or(n)}function pc(e){return e.reduce((t,n)=>[...t,...or(n)],[])}function VE(e){let t=jt(e);return pc(t)}function YE(e){let t=Ce(e);return or(t)}function QE(e){return[`${e}`]}function WE(e){let t=Je(e);return or(t)}function or(e){return le(e)?zE(e.$defs,e.$ref):xe(e)?VE(e.enum):w(e)?YE(e.allOf):X(e)?QE(e.const):Re(e)?WE(e.pattern):S(e)?pc(e.anyOf):[]}function Oo(e){return or(e)}function fM(e,t){return t in e?[e[t]]:[]}function gM(e,t){return t.reduce((n,o)=>[...n,...fM(e,o)],[])}function ZE(e,t){let n=Oo(t),o=gM(e,n);return lr(o)}function yM(e){return V(So(e))}function XE(e){return e.map(t=>bu(t))}function bu(e){return w(e)?Pt(XE(e.allOf)):S(e)?$(XE(e.anyOf)):X(e)?yM(e.const):e}function hM(e,t){return e.reduceRight((n,o,i)=>{let a=tt({},V(i),t);return L.IsExtendsTrueLike(a)?[o,...n]:n},[])}function TM(e,t){let n=bu(t),o=hM(e,n);return An(o)}function EM(e){return An(e)}function JE(e,t){return Ee(t)||qe(t)?EM(e):TM(e,t)}function IM(e){return e.reduce((t,n)=>Ds(n)?[...t,V(n)]:t,[])}function Ao(e){let t=IM(e);return $(t)}function fo(e,t,n={}){return P("Index",[e,t],n)}function eI(e,t,n={}){let o=s.IsArray(t)?Ao(t):t;return R({},fo(e,o,n))}function tI(e,t){let n=nr(e,t);return qt(n)}function _M(e,t){let n=s.Keys(e).filter(y=>!s.HasPropertyKey(t,y)),o=s.Keys(t).filter(y=>!s.HasPropertyKey(e,y)),i=s.Keys(e).filter(y=>s.HasPropertyKey(t,y)),a=n.reduce((y,T)=>({...y,[T]:e[T]}),{}),c=o.reduce((y,T)=>({...y,[T]:t[T]}),{}),m=i.reduce((y,T)=>({...y,[T]:Ce([e[T],t[T]])}),{}),l=g.Assign(a,c);return g.Assign(l,m)}function rI(e){return e.reduce((t,n)=>_M(t,qt(n)),{})}function nI(e){let t=UT(Fe(e));return qt(t)}function bM(e,t){return s.Keys(e).filter(i=>i in t).reduce((i,a)=>({...i,[a]:lr([e[a],t[a]])}),{})}function oI(e,t){let[n,...o]=e;return O(n)?oI(o,bM(t,qt(n))):t}function iI(e){let[t,...n]=e;return O(t)?oI(n,qt(t)):H()}function qt(e){return le(e)?tI(e.$defs,e.$ref):w(e)?rI(e.allOf):S(e)?iI(e.anyOf):Y(e)?nI(e.items):v(e)?e.properties:{}}function xo(e){let t=qt(e);return N(t)}function SM(e){return le(e)||w(e)||S(e)?xo(e):e}function OM(e,t){let n=SM(e);return te(n)?KE(n.items,t):v(n)?ZE(n.properties,t):Y(n)?JE(n.items,t):Z()}function AM(e,t,n,o,i){let a=I(e,t,n),c=I(e,t,o);return g.Update(OM(a,c),{},i)}function aI(e,t,n,o,i){return k(e,[n,o])?AM(e,t,n,o,i):fo(n,o,i)}function wi(e,t={}){return P("InstanceType",[e],t)}function sI(e,t={}){return R({},wi(e,t))}function xM(e){return Me(e)?e.instanceType:Z()}function RM(e,t,n,o){let i=I(e,t,n);return g.Update(xM(i),{},o)}function cI(e,t,n,o={}){return k(e,[n])?RM(e,t,n,o):wi(n,o)}function CM(e,t,n,o,i){let a=At(e,{callstack:[]},n),c=Wi(e,{callstack:[]},o),m=Ce([...a,N(c)]);return g.Update(m,{},i)}function pI(e,t,n,o,i){return k(e,n)?CM(e,t,n,o,i):lo(n,o,i)}function go(e,t={}){return P("KeyOf",[e],t)}function uI(e,t={}){return R({},go(e,t))}function mI(){return $([Ut(),Tt(),ao()])}function lI(e){return Ut()}function PM(e){return e.reduce((n,o)=>Ds(o)?[...n,V(So(o))]:H(),[])}function dI(e){let t=s.Keys(e),n=PM(t);return An(n)}function fI(e){return po(e)}function gI(e){let t=e.map((n,o)=>V(o));return An(t)}function UM(e){return le(e)||w(e)||S(e)?xo(e):e}function wM(e){let t=UM(e);return at(t)?mI():te(t)?lI(t.items):v(t)?dI(t.properties):Ie(t)?fI(t):Y(t)?gI(t.items):Z()}function NM(e,t,n,o){let i=I(e,t,n);return g.Update(wM(i),{},o)}function yI(e,t,n,o){return k(e,[n])?NM(e,t,n,o):go(n,o)}function LM(e){let t=Je(e);return Su(t)}function hI(e){return e.reduce((t,n)=>[...t,...Su(n)],[])}function Su(e){return xe(e)?hI(jt(e.enum)):io(e)||oo(e)?[e]:Re(e)?LM(e.pattern):S(e)?hI(e.anyOf):[]}function TI(e){return Su(e)}function mo(e,t,n,o,i={}){return P("Mapped",[e,t,n,o],i)}function EI(e,t,n,o,i={}){return R({},mo(e,t,n,o,i))}function kM(e,t,n,o,i){let a=g.Assign(e,{[n.name]:o}),c=I(a,t,i);return Re(c)?Je(c.pattern):c}function vM(e,t,n,o,i){let a=g.Assign(e,{[n.name]:o});return I(a,t,i)}function MM(e,t,n,o,i,a){let c=vM(e,t,n,o,a),m=kM(e,t,n,o,i);return io(m)||oo(m)?{[m.const]:c}:{}}function DM(e,t,n,o,i,a){return o.reduce((c,m)=>({...c,...MM(e,t,n,m,i,a)}),{})}function GM(e,t,n,o,i,a){let c=TI(o),m=DM(e,t,n,c,i,a);return N(m)}function $M(e,t,n,o,i,a,c){let m=I(e,t,o);return g.Update(GM(e,t,n,m,i,a),{},c)}function II(e,t,n,o,i,a,c){return k(e,[o])?$M(e,t,n,o,i,a,c):mo(n,o,i,a,c)}function jM(e,t){return s.Keys(e).filter(o=>t.includes(o)).reduce((o,i)=>({...o,[i]:mE(e,i,e[i])}),{})}function qM(e,t){return s.Keys(e).filter(o=>!t.includes(o)).reduce((o,i)=>({...o,[i]:I(e,{callstack:[]},e[i])}),{})}function FM(e,t){let n=sE(e),o=jM(e,n),i=qM(e,n),a={...o,...i};return g.Update(a,{},t)}function _I(e,t,n,o){let i=g.Assign(e,n);return FM(i,o)}function Ni(e,t={}){return P("NonNullable",[e],t)}function bI(e,t={}){return R({},Ni(e,t))}function BM(e){let t=$([Gr(),uo()]);return cc({},{callstack:[]},e,t,{})}function HM(e,t,n,o){let i=I(e,t,n);return g.Update(BM(i),{},o)}function SI(e,t,n,o){return k(e,[n])?HM(e,t,n,o):Ni(n,o)}function uc(e){let t=xo(e);return v(t)?t.properties:H()}function Li(e,t,n={}){return P("Omit",[e,t],n)}function OI(e,t,n={}){let o=s.IsArray(t)?Ao(t):t;return R({},Li(e,o,n))}function KM(e,t){return s.Keys(e).reduce((o,i)=>t.includes(i)?o:{...o,[i]:e[i]},{})}function zM(e,t){let n=uc(e),o=Oo(t),i=KM(n,o);return N(i)}function VM(e,t,n,o,i){let a=I(e,t,n),c=I(e,t,o);return g.Update(zM(a,c),{},i)}function AI(e,t,n,o,i){return k(e,[n,o])?VM(e,t,n,o,i):Li(n,o,i)}function yo(e,t){return P("Options",[e,t],{})}function mc(e,t){return R({},yo(e,t))}function YM(e,t,n,o){let i=I(e,t,n);return g.Update(i,{},o)}function xI(e,t,n,o){return k(e,[n])?YM(e,t,n,o):yo(n,o)}function ki(e,t={}){return P("Parameters",[e],t)}function RI(e,t={}){return R({},ki(e,t))}function QM(e){return De(e)?I({},{callstack:[]},Fe(e.parameters)):Z()}function WM(e,t,n,o){let i=I(e,t,n);return g.Update(QM(i),{},o)}function CI(e,t,n,o){return k(e,[n])?WM(e,t,n,o):ki(n,o)}function vi(e,t={}){return P("Partial",[e],t)}function PI(e,t={}){return R({},vi(e,t))}function UI(e,t){let n=nr(e,t),o=Kr(n);return Yt(g.Assign(e,{[t]:o}),t)}function wI(e){let t=e.map(n=>Kr(n));return Ce(t)}function NI(e){let t=e.map(n=>Kr(n));return $(t)}function LI(e){let t=s.Keys(e).reduce((o,i)=>({...o,[i]:Cs(e[i])}),{});return N(t)}function Kr(e){return le(e)?UI(e.$defs,e.$ref):w(e)?wI(e.allOf):S(e)?NI(e.anyOf):v(e)?LI(e.properties):N({})}function ZM(e,t,n,o){let i=I(e,t,n);return g.Update(Kr(i),{},o)}function kI(e,t,n,o){return k(e,[n])?ZM(e,t,n,o):vi(n,o)}function Mi(e,t,n={}){return P("Pick",[e,t],n)}function vI(e,t,n={}){let o=s.IsArray(t)?Ao(t):t;return R({},Mi(e,o,n))}function XM(e,t){return s.Keys(e).reduce((o,i)=>t.includes(i)?g.Assign(o,{[i]:e[i]}):o,{})}function JM(e,t){let n=uc(e),o=Oo(t),i=XM(n,o);return N(i)}function e0(e,t,n,o,i){let a=I(e,t,n),c=I(e,t,o);return g.Update(JM(a,c),{},i)}function MI(e,t,n,o,i){return k(e,[n,o])?e0(e,t,n,o,i):Mi(n,o,i)}function Di(e,t={}){return P("ReadonlyType",[e],t)}function DI(e,t={}){return R({},Di(e,t))}function GI(e){return Nr($t(e))}function $I(e,t){let n=nr(e,t),o=zr(n);return Yt(g.Assign(e,{[t]:o}),t)}function jI(e){let t=e.map(n=>zr(n));return Ce(t)}function qI(e){let t=s.Keys(e).reduce((o,i)=>({...o,[i]:Us(e[i])}),{});return N(t)}function FI(e){return Nr(Fe(e))}function BI(e){let t=e.map(n=>zr(n));return $(t)}function zr(e){return te(e)?GI(e.items):le(e)?$I(e.$defs,e.$ref):w(e)?jI(e.allOf):v(e)?qI(e.properties):Y(e)?FI(e.items):S(e)?BI(e.anyOf):e}function t0(e,t,n,o){let i=I(e,t,n);return g.Update(zr(i),{},o)}function HI(e,t,n,o){return k(e,[n])?t0(e,t,n,o):Di(n,o)}function KI(e){return Et(Jt,e)}function zI(e){return N({true:e,false:e})}function VI(e,t){let n=qi(e);return Vr(n,t)}function YI(e,t){return Et(so,t)}function QI(e,t){let n=Ce(e);return Vr(n,t)}function WI(e,t){return s.IsString(e)||s.IsNumber(e)?N({[e]:t}):s.IsEqual(e,!1)?N({false:t}):s.IsEqual(e,!0)?N({true:t}):N({})}function ZI(e,t){return Et(co,t)}function XI(e,t){return s.HasPropertyKey(e,"pattern")&&(s.IsString(e.pattern)||e.pattern instanceof RegExp)?Et(e.pattern.toString(),t):Et(Jt,t)}function JI(e,t){let n=Js(e);return ec(n)?Vr(Je(e),t):Et(e,t)}function r0(e){return e.some(t=>Ne(t)||Ee(t)||qe(t))}function n0(e,t){return s.IsEqual(r0(e),!0)?Et(Jt,t):void 0}function o0(e,t){return e.reduce((n,o)=>X(o)&&(s.IsString(o.const)||s.IsNumber(o.const))?{...n,[o.const]:t}:n,{})}function i0(e,t){let n=o0(e,t);return N(n)}function e_(e,t){let n=tr(e),o=n0(n,t);return O(o)?o:i0(n,t)}function Vr(e,t){return at(e)?KI(t):ct(e)?zI(t):xe(e)?VI(e.enum,t):qe(e)?YI(e,t):w(e)?QI(e.allOf,t):X(e)?WI(e.const,t):Ee(e)?ZI(e,t):S(e)?e_(e.anyOf,t):Ne(e)?XI(e,t):Re(e)?JI(e.pattern,t):N({})}function a0(e,t,n,o,i){let a=I(e,t,n),c=I(e,t,o);return g.Update(Vr(a,c),{},i)}function t_(e,t,n,o,i){return k(e,[n])?a0(e,t,n,o,i):_i(n,o,i)}function r_(e,t,n){return n in e?ac([n],e,e[n])?we(n):I(e,t,e[n]):we(n)}function n_(e,t){let n=nr(e,t),o=Yr(n);return Yt(g.Assign(e,{[t]:o}),t)}function o_(e){let t=e.map(n=>Yr(n));return Ce(t)}function i_(e){let t=e.map(n=>Yr(n));return $(t)}function a_(e){let t=s.Keys(e).reduce((o,i)=>({...o,[i]:eo(e[i])}),{});return N(t)}function Yr(e){return le(e)?n_(e.$defs,e.$ref):w(e)?o_(e.allOf):S(e)?i_(e.anyOf):v(e)?a_(e.properties):N({})}function Gi(e,t={}){return P("Required",[e],t)}function s_(e,t={}){return R({},Gi(e,t))}function s0(e,t,n,o){let i=I(e,t,n);return g.Update(Yr(i),{},o)}function c_(e,t,n,o){return k(e,[n])?s0(e,t,n,o):Gi(n,o)}function $i(e,t={}){return P("ReturnType",[e],t)}function p_(e,t={}){return R({},$i(e,t))}function c0(e){return De(e)?e.returnType:Z()}function p0(e,t,n,o){let i=I(e,t,n);return g.Update(c0(i),{},o)}function u_(e,t,n,o){return k(e,[n])?p0(e,t,n,o):$i(n,o)}function m_(e){return g.Create({"~kind":"TemplateLiteral"},{type:"string",pattern:e},{})}function u0(e){return e.join("|")}function m0(e){return e.slice(1,e.length-1)}function l0(e,t,n){return Qr(t,`${n}${e}`)}function d0(e,t){return Qr(e,`${t}${Jf}`)}function f0(e,t){return Qr(e,`${t}${Ms}`)}function g0(e,t){return Qr(e,`${t}${Gs}`)}function y0(e,t){return Au($([V("false"),V("true")]),e,t)}function h0(e,t){return Qr(e,`${t}${js}`)}function T0(e,t,n){return Qr(t,`${n}${m0(e)}`)}function E0(e,t,n,o=[]){let i=jt(e);return Ou(i,t,n)}function Ou(e,t,n,o=[]){let[i,...a]=e;return O(i)?Ou(a,t,n,[...o,Au(i,[],"")]):Qr(t,`${n}(${u0(o)})`)}function Au(e,t,n){return xe(e)?E0(e.enum,t,n):qe(e)?f0(t,n):X(e)?l0(e.const,t,n):bt(e)?d0(t,n):ct(e)?y0(t,n):Ee(e)?g0(t,n):Ne(e)?h0(t,n):Re(e)?T0(e.pattern,t,n):S(e)?Ou(e.anyOf,t,n):Lf}function Qr(e,t){let[n,...o]=e;return O(n)?Au(n,o,t):t}function I0(e){return`^${Qr(e,"")}$`}function l_(e){let t=I0(e);return m_(t)}function _0(e,t,n,o){let i=At(e,t,n);return g.Update(l_(i),{},o)}function d_(e,t,n,o){return k(e,n)?_0(e,t,n,o):bi(n,o)}function b0(e){return $r(e)?Y(e.items)?xu(e.items.items):Ae(e.items)?[e]:pe(e.items)?[e]:[Z()]:[e]}function xu(e){return e.reduce((n,o)=>[...n,...b0(o)],[])}function S0(e,t){return t in e}function O0(e,t){return w(t)?k(e,t.allOf):S(t)?k(e,t.anyOf):pe(t)?S0(e,t.$ref):!0}function k(e,t){let[n,...o]=t;return O(n)?O0(e,n)?k(e,o):!1:!0}function Zi(e,t,n){return Rf(e)?Zi(e.type,"remove",n):Sf(e)?Zi(e.type,t,"remove"):Af(e)?Zi(e.type,"add",n):_f(e)?Zi(e.type,t,"add"):[e,t,n]}function A0(e,t){return s.IsEqual(e,"remove")?Ps(t):s.IsEqual(e,"add")?yt(t):t}function x0(e,t){return s.IsEqual(e,"remove")?eo(t):s.IsEqual(e,"add")?gt(t):t}function Wi(e,t,n){return s.Keys(n).reduce((o,i)=>({...o,[i]:I(e,t,n[i])}),{})}function ic(e,t,n){let o=At(e,t,n);return xu(o)}function At(e,t,n){return n.map(o=>I(e,t,o))}function R0(e,t,n,o,i){return s.IsEqual(n,"Awaited")?EE(e,t,o[0],i):s.IsEqual(n,"Capitalize")?CE(e,t,o[0],i):s.IsEqual(n,"Conditional")?LE(e,t,o[0],o[1],o[2],o[3],i):s.IsEqual(n,"ConstructorParameters")?vE(e,t,o[0],i):s.IsEqual(n,"Evaluate")?GT(e,t,o[0],i):s.IsEqual(n,"Exclude")?cc(e,t,o[0],o[1],i):s.IsEqual(n,"Extract")?FE(e,t,o[0],o[1],i):s.IsEqual(n,"Index")?aI(e,t,o[0],o[1],i):s.IsEqual(n,"InstanceType")?cI(e,t,o[0],i):s.IsEqual(n,"Interface")?pI(e,t,o[0],o[1],i):s.IsEqual(n,"KeyOf")?yI(e,t,o[0],i):s.IsEqual(n,"Lowercase")?PE(e,t,o[0],i):s.IsEqual(n,"Mapped")?II(e,t,o[0],o[1],o[2],o[3],i):s.IsEqual(n,"Module")?_I(e,t,o[0],i):s.IsEqual(n,"NonNullable")?SI(e,t,o[0],i):s.IsEqual(n,"Pick")?MI(e,t,o[0],o[1],i):s.IsEqual(n,"Options")?xI(e,t,o[0],o[1]):s.IsEqual(n,"Parameters")?CI(e,t,o[0],i):s.IsEqual(n,"Partial")?kI(e,t,o[0],i):s.IsEqual(n,"Omit")?AI(e,t,o[0],o[1],i):s.IsEqual(n,"ReadonlyType")?HI(e,t,o[0],i):s.IsEqual(n,"Record")?t_(e,t,o[0],o[1],i):s.IsEqual(n,"Required")?c_(e,t,o[0],i):s.IsEqual(n,"ReturnType")?u_(e,t,o[0],i):s.IsEqual(n,"TemplateLiteral")?d_(e,t,o[0],i):s.IsEqual(n,"Uncapitalize")?UE(e,t,o[0],i):s.IsEqual(n,"Uppercase")?wE(e,t,o[0],i):P(n,o,i)}function I(e,t,n){let o=hn(n),i=Zi(n,Tn(n)?"add":"none",ve(n)?"add":"none"),a=Ct(i[0])?i[0].Clone():i[0],c=pe(a)?r_(e,t,a.$ref):te(a)?$t(I(e,t,a.items),ws(a)):nt(a)?Vt(I(e,t,a.iteratorItems),Pf(a)):bo(a)?sc(e,t,a.target,a.arguments):Me(a)?Lr(At(e,t,a.parameters),I(e,t,a.instanceType),wf(a)):Cf(a)?R0(e,t,a.action,a.parameters,a.options):De(a)?kr(At(e,t,a.parameters),I(e,t,a.returnType),Nf(a)):w(a)?Pt(At(e,t,a.allOf),$f(a)):ot(a)?Qt(I(e,t,a.iteratorItems),tg(a)):v(a)?N(Wi(e,t,a.properties),ag(a)):Ze(a)?Xt(I(e,t,a.item),cg(a)):Ie(a)?pg(St(a),I(e,t,Xe(a))):$r(a)?bn(I(e,t,a.items)):Y(a)?Fe(ic(e,t,a.items),mg(a)):S(a)?$(At(e,t,a.anyOf),lg(a)):a,m=o?Nr(c):c;return A0(i[1],x0(i[2],m))}function R(e,t){return I(e,{callstack:[]},t)}function ji(e,t={}){return P("Awaited",[e],t)}function f_(e,t={}){return R({},ji(e,t))}function Xp(e,t={}){return P("Evaluate",[e],t)}function Ft(e,t={}){return R({},Xp(e,t))}function Jp(e,t={}){return P("Module",[e],t)}function g_(e,t={}){return R({},Jp(e,t))}function y_(...e){let[t,n,o]=ae.Match(e,{2:(c,m)=>s.IsString(c)?[{},c,m]:[c,m,{}],3:(c,m,l)=>[c,m,l],1:c=>[{},c,{}]}),i=sT(n),a=s.IsArray(i)&&s.IsEqual(i.length,2)?I(t,{callstack:[]},i[0]):Z();return g.Update(a,{},o)}var r={};Lt(r,{Any:()=>ro,Array:()=>$t,AsyncIterator:()=>Vt,Awaited:()=>f_,Base:()=>Ns,BigInt:()=>Ei,Boolean:()=>vs,Call:()=>hE,Capitalize:()=>OE,Codec:()=>Ls,Conditional:()=>NE,Constructor:()=>Lr,ConstructorParameters:()=>kE,Cyclic:()=>Yt,Decode:()=>Wf,DecodeBuilder:()=>Ti,Encode:()=>Zf,EncodeBuilder:()=>hi,Enum:()=>Gf,Evaluate:()=>Ft,Exclude:()=>ME,Extends:()=>tt,ExtendsResult:()=>L,Extract:()=>$E,Function:()=>kr,Generic:()=>vr,Identifier:()=>Ii,Immutable:()=>Nr,Index:()=>eI,Infer:()=>yi,InstanceType:()=>sI,Instantiate:()=>R,Integer:()=>In,Interface:()=>iE,Intersect:()=>Pt,IsAny:()=>at,IsArray:()=>te,IsAsyncIterator:()=>nt,IsBase:()=>Ct,IsBigInt:()=>bt,IsBoolean:()=>ct,IsCall:()=>bo,IsCodec:()=>En,IsConstructor:()=>Me,IsCyclic:()=>le,IsEnum:()=>xe,IsFunction:()=>De,IsGeneric:()=>to,IsIdentifier:()=>eg,IsImmutable:()=>hn,IsInfer:()=>Ae,IsInteger:()=>qe,IsIntersect:()=>w,IsIterator:()=>ot,IsKind:()=>_,IsLiteral:()=>X,IsNever:()=>ur,IsNull:()=>Wt,IsNumber:()=>Ee,IsObject:()=>v,IsOptional:()=>ve,IsParameter:()=>sg,IsPromise:()=>Ze,IsReadonly:()=>Tn,IsRecord:()=>Ie,IsRef:()=>pe,IsRefine:()=>ks,IsRest:()=>$r,IsSchema:()=>O,IsString:()=>Ne,IsSymbol:()=>Zt,IsTemplateLiteral:()=>Re,IsThis:()=>ug,IsTuple:()=>Y,IsUndefined:()=>er,IsUnion:()=>S,IsUnknown:()=>ht,IsUnsafe:()=>fg,IsVoid:()=>Ot,Iterator:()=>Qt,KeyOf:()=>uI,Literal:()=>V,Lowercase:()=>AE,Mapped:()=>EI,Module:()=>g_,Never:()=>Z,NonNullable:()=>bI,Null:()=>Gr,Number:()=>Ut,Object:()=>N,Omit:()=>OI,Optional:()=>Cs,Options:()=>mc,Parameter:()=>_n,Parameters:()=>RI,Partial:()=>PI,Pick:()=>vI,Promise:()=>Xt,Readonly:()=>Us,ReadonlyType:()=>DI,Record:()=>qs,RecordKey:()=>po,RecordKeyAsPattern:()=>St,RecordValue:()=>Xe,Ref:()=>we,Refine:()=>Xf,Required:()=>s_,Rest:()=>bn,ReturnType:()=>p_,Script:()=>y_,String:()=>Tt,Symbol:()=>ao,TemplateLiteral:()=>uT,This:()=>Fs,Tuple:()=>Fe,Uncapitalize:()=>xE,Undefined:()=>uo,Union:()=>$,Unknown:()=>Qe,Unsafe:()=>dg,Uppercase:()=>RE,Void:()=>Bs});var h_="lowercase-email",Ru="iana-timezone",Cu="simple-time",Pu="simple-date-time";var C0=(e,t)=>RegExp(`^${e.source}(${t.source}${e.source})*$`),P0=/[a-zA-Z0-9-_]+/,U0=/\./,rhe=C0(P0,U0);var T_="lowercase-domain";var Ro="kebab-case";var E_="camel-case";var w0=new Set;function b(e,t,n={}){let o=t.map(i=>{let a=i;return a.$id?(w0.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})}var Q={limit:r.Optional(r.Integer({minimum:1,maximum:1e3,description:"Maximum number of items to return in this page. Valid values are 1 through 1000."})),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."}))};var N0=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`."})}),she=r.Object({pagination:N0},{$id:"ResponseMetadata"});function E(e={}){return r.Unsafe({...e,type:"string"})}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:E_,minLength:i,maxLength:250,...a});case"kebab-case":return r.String({format:Ro,minLength:i,maxLength:250,...a});case"email":return r.String({format:h_,minLength:i,maxLength:254,errorMessage:{format:"Must be a valid lowercase email address."},...a});case"lowercase-domain":return r.String({format:T_,minLength:i,maxLength:250,...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:"Must be a valid tags query: only tag:value searches (no wildcards), boolean operators, and parentheses are supported. 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:250,...a});case"long":return r.String({minLength:i,maxLength:5e4,...a});case"short":return r.String({minLength:i,maxLength:250,...a});case"tsuga-formula":return r.String({format:"tsuga-formula",minLength:i,maxLength:250,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:Ye(t)}}var Xi=["ingestion-api-key","operation-api-key","rum-public-token","dashboard","log-route","monitor","notification-rule","notification-silence","slo"],lc=r.Array(r.Enum(Xi,{description:"Tsuga-managed asset type."}),{description:"Tsuga-managed asset types covered by the policy. An empty array means all supported asset types."});var Uu=["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"],Ehe=r.Enum(Uu),L0=["CLUSTER_AGGREGATION_STRUCTURE"],Ihe=r.Object({code:r.Enum(Uu),message:r.String()}),I_=[...Uu,...L0,"ABORT_ERROR","BAD_REQUEST","DUPLICATE_KEY_VIOLATION","FOREIGN_KEY_VIOLATION","FST_ERR_VALIDATION","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"],__=["INTERNAL_ERROR","INVALID_QUERY_TO_CLUSTER"];var k0=["NETWORK_ERROR","RESPONSE_PARSE_ERROR"],v0=[...I_,...__,...k0],M0=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(Xi,{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\u2019s tag-policy validator. Returned for every violation."})}),b_=b("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(M0,{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"})],{description:"Structured details for a client error. Set by Tsuga only for error types with machine-readable remediation data. Returned on tag-policy validation errors; omitted for other client errors."}),_he=r.Object({code:r.Optional(r.Enum(v0,{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(b_)},{$id:"ErrorResponse",description:"Standard envelope for API errors"}),bhe=r.Object({code:r.Optional(r.Enum(I_,{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(b_)},{$id:"ClientErrorResponse",description:"Standard envelope for client (4XX) API errors"}),She=r.Object({code:r.Optional(r.Enum(__,{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"}),Ohe=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"}),Ahe=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:m,response:l,url:f}){return i?{buildUrl:T=>f.replace(/:[a-zA-Z_]+/g,A=>T[A.slice(1)]),method:n,params:i,response:l,templateUrl:f,...e===void 0?{}:{body:e},...t===void 0?{}:{description:t},...o===void 0?{}:{operationId:o},...c===void 0?{}:{query:c},...m===void 0?{}:{paginated:m},...a===void 0?{}:{tags:a}}:{method:n,response:l,url:f,templateUrl:f,...e===void 0?{}:{body:e},...t===void 0?{}:{description:t},...o===void 0?{}:{operationId:o},...c===void 0?{}:{query:c},...m===void 0?{}:{paginated:m},...a===void 0?{}:{tags:a}}}function S_(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 C=r.Object({success:r.Literal(!0,{description:"Always `true` when the delete request completed and the resource was removed."})},{$id:"DeleteResponse",example:{success:!0}});var wu="tsuga-cli",Rn="/v0/oauth",O_=d({description:"OAuth 2.1 authorization endpoint: validates the client and redirect URI, then redirects to the consent page",url:`${Rn}/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)"})}),A_=d({description:"OAuth 2.1 token endpoint: exchanges an authorization code (PKCE) or refresh token for a token pair",url:`${Rn}/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()})}),qhe=d({description:"Resolve a signed authorization request handle for the consent page",url:`${Rn}/authorization-request`,method:"GET",query:r.Object({handle:r.String()}),response:r.Object({clientId:r.String(),clientName:r.String(),redirectUri:r.String()})}),Fhe=d({description:"Approve or deny an OAuth authorization request from the consent page",url:`${Rn}/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"})})}),Bhe=d({description:"Validate an OAuth access token (internal, for the MCP resource server)",url:`${Rn}/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())})}),D0=["pending","active","revoked"],G0=r.Object({id:r.String(),createdAt:E(),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(D0),lastUsedAt:r.Optional(E())}),Hhe=d({tags:["oauth"],description:"List OAuth grants: your own, or all users for admins",url:`${Rn}/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(G0)}),Khe=d({tags:["oauth"],description:"Delete an OAuth grant (own grant, or any grant for admins)",url:`${Rn}/grants/:id`,method:"DELETE",params:r.Object({id:r.String()}),response:C});function x_(e,t){let n=new URL(O_.url,e);return n.search=new URLSearchParams({response_type:"code",client_id:wu,redirect_uri:t.redirectUri,code_challenge:t.challenge,code_challenge_method:"S256",state:t.state}).toString(),n.href}function $0(e){if(!e)return{};try{let t=JSON.parse(e);return typeof t=="object"&&t!==null?t:{}}catch{return{}}}async function j0(e,t){let n=await fetch(new URL(A_.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=$0(o);if(n.status!==200){let a=i.error??`HTTP ${n.status}`;throw new Error(`OAuth token request failed (${a}${i.error_description?`: ${i.error_description}`:""})`)}if(!i.access_token||typeof i.expires_in!="number")throw new Error("OAuth token response was missing required fields");return{accessToken:i.access_token,expiresAt:new Date(Date.now()+i.expires_in*vp)}}async function R_(e,t){return j0(e,{grant_type:"authorization_code",client_id:wu,code:t.code,code_verifier:t.verifier,redirect_uri:t.redirectUri})}var Wr=require("node:fs"),C_=require("node:os"),Nu=require("node:path");var P_=(0,Nu.join)((0,C_.homedir)(),".config","tsuga"),Ji=(0,Nu.join)(P_,"config.json"),q0="https://api.tsuga.com";function U_(e){return Qd(e.credential)}function ea(){if(!(0,Wr.existsSync)(Ji))return{};try{return JSON.parse((0,Wr.readFileSync)(Ji,"utf-8"))}catch{throw new Error(`Config file corrupted: ${Ji}
36
+ Re-authenticate with \`tsuga auth login\` or \`tsuga auth operation-key <token>\`.`)}}function Co(){try{return ea()}catch{return{}}}function Po(e){(0,Wr.mkdirSync)(P_,{recursive:!0,mode:448}),(0,Wr.writeFileSync)(Ji,`${JSON.stringify(e,null,2)}
37
+ `,{mode:384})}function Lu(e){return e?.trim()||process.env.TSUGA_API_URL?.trim()||q0}function Uo(e){let t=ea(),n=Lu(e.apiUrl),o=Yd({overrideKey:e.operationApiKey??process.env.TSUGA_OPERATION_API_KEY,operationApiKey:t.operationApiKey,userAuth:t.userAuth}),i=t.defaults??{},a=e.clusterId?.trim()||process.env.TSUGA_CLUSTER_ID?.trim()||i.cluster?.trim()||void 0;return{apiUrl:n,credential:o,clusterId:a,defaults:i}}function F0(e){Po({...Co(),...e})}function w_(){return ea().userAuth}function N_(e){let{operationApiKey:t,...n}=Co();Po({...n,userAuth:e})}function L_(e){let{userAuth:t,...n}=Co();Po({...n,operationApiKey:e})}function k_(){let{userAuth:e,...t}=Co();Po(t)}function ta(){return Ji}var v_={from:"-30m",to:"now",query:"*","max-results":"100"};function fr(e){return(ea().defaults??{})[e]??v_[e]}function M_(e,t){let n=Co();Po({...n,defaults:{...n.defaults??{},[e]:t}})}function D_(){let{defaults:e,...t}=Co();Po(t)}function G_(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: ${li(o.userAuth.accessToken)} (expires ${o.userAuth.accessExpiresAt})`);break;default:Ye(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={...v_,...e.defaults};for(let[a,c]of Object.entries(i)){let m=a in e.defaults?" *":"";n.push(` ${a}: ${c}${m}`)}return`${n.join(`
38
38
  `)}
39
- `}function zI(){return Mi().lastUpdateCheck}function VI(e){ZM({lastUpdateCheck:e})}async function XM(){let e=Jp(),{verifier:t,challenge:r}=nd(),o=(0,YI.randomBytes)(16).toString("base64url"),{code:i,redirectUri:a}=await gd({state:o,buildAuthorizeUrl:u=>wI(e,{redirectUri:u,challenge:r,state:o})}),c=await LI(e,{code:i,verifier:t,redirectUri:a});GI(ed(c)),Q(`Logged in. Session token ${Yo(c.accessToken)} saved to ${vi()}`)}function JM(){let e=$I();if(!e){process.stderr.write("No user session. Run `tsuga auth login`.\n"),process.exitCode=1;return}if(Ba({kind:"user-session",userAuth:e},new Date)){process.stderr.write("Your session expired. Run `tsuga auth login` to sign in again.\n"),process.exitCode=1;return}Q(e.accessToken)}function e0(){let{credential:e}=To({});if(!e){Q("Not authenticated. Run `tsuga auth login` or `tsuga auth operation-key <key>`.");return}switch(e.kind){case"user-session":Q(`Logged in as a user (token ${Yo(e.userAuth.accessToken)}, expires ${e.userAuth.accessExpiresAt}).`);return;case"operation-api-key":Q("Authenticated with an operation API key.");return;default:We(e)}}function t0(){FI(),Q("Local user session cleared.")}function QI(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").action(XM),t.command("logout").description("Clear the saved user session").action(t0),t.command("token").description("Print the saved user access token to stdout").action(JM),t.command("operation-key <operation-api-key>").description("Save an operation API key to the config file").action(r=>{jI(r),Q(`Operation API key saved to ${vi()}`)}),t.command("status").description("Show the current authentication method").action(e0)}var r0=["asset-change","cluster-integration-config","explorer-saved-view","crawler-integration-config","inventory","saml-config","sensitive-data-scanner-rule","service","host","database","team-remap-config","user-self","oauth-grant","monitor-alert","monitor-debugging","retention-policy","org","allowed-domains","custom-usage-tag"],n0=["investigation","ingestion-api-key","operation-api-key","rum-public-token","audit-log","dashboard","dashboard-report","inventory-settings","log-route","monitor","notification-integration","notification-rule","notification-silence","quality-report","slo","tag-policy","team","team-members","user-data","user-invitation","user-permissions"],o0=["log","metric","trace","rum"],i0=[...n0,...o0],Lfe=[...r0,...i0];var $s=["admin","public_editor","public_viewer","teams_only"],Io=["admin","editor","viewer"];var gn="/v0/team-membership",em=n.Object({id:n.String({description:"Unique identifier of this team membership. Generated by Tsuga."}),userId:n.String({description:"User ID that belongs to the team."}),teamId:n.String({description:"Team ID that contains the user."}),roleKey:n.Enum(Io,{description:"Role granted to the user inside this team."})}),WI=n.Object({userId:m({allowEmpty:!1,description:"User ID to add to or update in the team."}),teamId:m({allowEmpty:!1,description:"Team ID receiving the membership change."}),roleKey:n.Enum(Io,{description:"Team role to assign to the user."})}),a0=n.Object({userId:m({allowEmpty:!1,description:"User ID to remove from the team."}),teamId:m({allowEmpty:!1,description:"Team ID to remove the user from."})}),s0=n.Optional(n.Object({userId:n.Optional(m({allowEmpty:!1,description:"Restrict results to memberships for this user ID."})),teamId:n.Optional(m({allowEmpty:!1,description:"Restrict results to memberships for this team ID."}))})),Mfe=d({tags:["access-control"],url:gn,method:"GET",query:s0,response:n.Array(em)}),vfe=d({tags:["access-control"],url:gn,method:"POST",body:WI,response:em}),Dfe=d({tags:["access-control"],url:gn,method:"PUT",body:WI,response:em}),$fe=d({tags:["access-control"],url:gn,method:"DELETE",body:a0,response:L}),Ds=500,c0=n.Object({teamId:m({allowEmpty:!1,description:"Team ID receiving all requested memberships."}),members:n.Array(n.Object({userId:n.Optional(m({allowEmpty:!1,description:"Existing user ID to add to the team."})),userEmail:n.Optional(m({allowEmpty:!1,type:"email",description:"Existing user email to resolve and add to the team."})),roleKey:n.Enum(Io,{description:"Team role to assign when the user is added."})},{oneOf:[{required:["userId"]},{required:["userEmail"]}]}),{minItems:1,maxItems:Ds})}),p0=n.Object({results:n.Array(n.Object({userId:n.String({description:"User ID resolved for this bulk add result."}),status:n.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."})}))}),Gfe=d({tags:["access-control"],url:`${gn}/bulk-add`,method:"POST",body:c0,response:p0}),jfe=d({tags:["access-control"],url:`${gn}/bulk-update-user-roles`,method:"PUT",body:n.Object({userIds:n.Array(m({allowEmpty:!1}),{minItems:1,maxItems:Ds}),teamId:m({allowEmpty:!1}),role:n.Enum(Io)}),response:n.Object({})}),m0=n.Object({teamId:m({allowEmpty:!1,description:"Team ID to remove the requested users from."}),userIds:n.Optional(n.Array(m({allowEmpty:!1}),{minItems:1,maxItems:Ds,description:"User IDs to remove from the team."})),userEmails:n.Optional(n.Array(m({allowEmpty:!1,type:"email"}),{minItems:1,maxItems:Ds,description:"User emails to resolve and remove from the team."}))},{oneOf:[{required:["userIds"]},{required:["userEmails"]}]}),u0=n.Object({results:n.Array(n.Object({userId:n.String({description:"User ID resolved for this bulk remove result."}),status:n.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."})}))}),Ffe=d({tags:["access-control"],url:`${gn}/bulk-remove`,method:"DELETE",body:m0,response:u0});var Gs="/v0/admin",Ge=`${Gs}/clusters`,XI=n.Object({helmParameters:n.Record(n.String(),n.Unsafe({type:["number","boolean","null","string"]})),helmVersion:n.String()}),ZI=n.Record(n.String(),XI),nm=["eu-central-1","eu-central-2","eu-north-1","eu-south-1","eu-south-2","eu-west-1","eu-west-2","eu-west-3","us-east-1","us-east-2","us-west-1","us-west-2","af-south-1","ap-east-1","ap-northeast-1","ap-northeast-2","ap-northeast-3","ap-south-1","ap-south-2","ap-southeast-1","ap-southeast-2","ap-southeast-3","ap-southeast-4","ap-southeast-5","ap-southeast-7","ca-central-1","ca-west-1","il-central-1","me-central-1","me-south-1","mx-central-1","sa-east-1"],om=["europe-west1","europe-west2","europe-west3","europe-west4","europe-west6","europe-west9","europe-central2","europe-north1","us-central1","us-east1","us-east4","us-west1","us-west2","us-west3","us-west4","northamerica-northeast1","southamerica-east1","asia-east1","asia-east2","asia-northeast1","asia-northeast2","asia-northeast3","asia-south1","asia-south2","asia-southeast1","asia-southeast2","australia-southeast1","australia-southeast2"],im=["australiacentral","australiacentral2","australiaeast","australiasoutheast","austriaeast","belgiumcentral","brazilsouth","brazilsoutheast","canadacentral","canadaeast","centralindia","centralus","chilecentral","eastasia","eastus","eastus2","francecentral","francesouth","germanynorth","germanywestcentral","indonesiacentral","israelcentral","italynorth","japaneast","japanwest","jioindiacentral","jioindiawest","koreacentral","koreasouth","malaysiawest","mexicocentral","newzealandnorth","northcentralus","northeurope","norwayeast","norwaywest","polandcentral","qatarcentral","southafricanorth","southafricawest","southcentralus","southeastasia","southindia","spaincentral","swedencentral","switzerlandnorth","switzerlandwest","uaecentral","uaenorth","uksouth","ukwest","westcentralus","westeurope","westindia","westus","westus2","westus3"],JI=["aws","gcp","azure"],Di=["xs","s","m","l"],am=["1.0"],l0={id:n.String(),name:n.String(),createdAt:T(),clusterCertificateExpiresAt:T(),bridgeEndpoint:n.String(),deployerEndpoint:n.String(),targetConfiguration:ZI,appliedConfiguration:n.Optional(ZI),automaticallyDeployLatestVersion:n.Boolean(),automatedDeploymentDisabledBy:n.Optional(n.String()),automatedDeploymentDisabledReason:n.Optional(n.String()),automatedDeploymentDisabledAt:n.Optional(T()),soakTimeMin:n.Optional(n.Number()),clusterSize:n.Optional(n.Enum(Di))},tm={...l0,orgId:n.String(),orgName:n.String()},Yfe=d({tags:["admin"],method:"GET",url:Ge,query:n.Object({orgId:n.Optional(m())}),response:n.Array(O("clusterType",[n.Object({...tm,clusterType:n.Literal("aws"),clusterAccountId:n.String(),clusterBuilderRoleVersion:n.Optional(n.Enum(am)),clusterRegion:n.Enum(nm)}),n.Object({...tm,clusterType:n.Literal("gcp"),clusterAccountId:n.String(),clusterRegion:n.Enum(om)}),n.Object({...tm,clusterType:n.Literal("azure"),clusterTenantId:n.String(),clusterSubscriptionId:n.String(),clusterRegion:n.Enum(im)})]))}),Qfe=d({tags:["admin"],method:"PUT",url:`${Ge}/create`,body:O("clusterType",[n.Object({clusterType:n.Literal("aws"),orgId:m(),name:m(),clusterSize:n.Enum(Di),clusterAccountId:n.String({minLength:12,maxLength:12}),clusterBuilderRoleVersion:n.Enum(am),clusterRegion:n.Enum(nm)}),n.Object({clusterType:n.Literal("gcp"),orgId:m(),name:m(),clusterSize:n.Enum(Di),clusterAccountId:m(),clusterRegion:n.Enum(om)}),n.Object({clusterType:n.Literal("azure"),orgId:m(),name:m(),clusterSize:n.Enum(Di),clusterTenantId:m(),clusterSubscriptionId:m(),clusterRegion:n.Enum(im)})]),response:n.Object({id:n.String(),bridgeEndpoint:n.String(),deployerEndpoint:n.String()})}),Wfe=d({tags:["admin"],method:"DELETE",url:`${Ge}/:id`,params:n.Object({id:m()}),body:n.Object({orgId:m()}),response:L}),Zfe=d({tags:["admin"],method:"PUT",url:`${Ge}/add-inbounder-key`,body:n.Object({orgId:m(),clusterId:m()}),response:n.Object({orgId:m(),clusterId:m(),inbounderAuthenticationKey:n.String()})}),Xfe=d({tags:["admin"],method:"PUT",url:`${Ge}/replace-all-inbounder-keys`,body:n.Object({orgId:m(),clusterId:m()}),response:n.Object({orgId:m(),clusterId:m(),inbounderAuthenticationKey:n.String()})}),Jfe=d({tags:["admin"],method:"PUT",url:`${Ge}/replace-inbounder-key`,body:n.Object({orgId:m(),clusterId:m(),inbounderAuthenticationKeyToReplace:m()}),response:n.Object({orgId:m(),clusterId:m(),inbounderAuthenticationKey:n.String()})}),ege=d({tags:["admin"],method:"PUT",url:`${Ge}/delete-inbounder-key`,body:n.Object({orgId:m(),clusterId:m(),inbounderAuthenticationKeyToDelete:m()}),response:n.Object({orgId:m(),clusterId:m(),isKeyDeleted:n.Boolean()})}),tge=d({tags:["admin"],method:"PUT",url:`${Ge}/rotate-deployer-key`,body:n.Object({orgId:m(),clusterId:m(),newKey:m()}),response:n.Object({orgId:m(),clusterId:m(),isKeyUpdated:n.Boolean()})}),rge=d({tags:["admin"],method:"PUT",url:`${Ge}/rotate-bridge-key`,body:n.Object({orgId:m(),clusterId:m(),newKey:m()}),response:n.Object({orgId:m(),clusterId:m(),isKeyUpdated:n.Boolean()})}),rm={central:n.String(),ngrokBridgeDomain:n.String(),ngrokDeployerDomain:n.String(),clusterCertificateExpiresAt:T(),clusterName:n.String(),clusterSize:n.Optional(n.Enum(Di)),secretBridgeAuthenticationKey:n.String(),secretDeployerAuthenticationKey:n.String(),secretOutbounderAuthenticationKey:n.String(),slackChannelEmail:n.String(),customerTier:n.String()},nge=d({tags:["admin"],method:"POST",url:`${Ge}/:id`,body:n.Object({orgId:m()}),params:n.Object({id:m()}),response:O("clusterType",[n.Object({...rm,clusterType:n.Literal("aws"),clusterAccountId:n.String(),clusterBuilderRoleVersion:n.Optional(n.Enum(am)),clusterRegion:n.Enum(nm)}),n.Object({...rm,clusterType:n.Literal("gcp"),clusterAccountId:n.String(),clusterRegion:n.Enum(om)}),n.Object({...rm,clusterType:n.Literal("azure"),clusterTenantId:n.String(),clusterSubscriptionId:n.String(),clusterRegion:n.Enum(im)})])}),oge=d({tags:["admin"],method:"POST",url:`${Ge}/configuration`,body:n.Object({id:m(),orgId:m(),installationName:m(),targetConfiguration:XI}),response:n.Object({status:n.String()})}),ige=d({tags:["admin"],method:"POST",url:`${Ge}/automation`,body:n.Object({id:m(),orgId:m(),enableAutomatedDeployment:n.Boolean(),disabledReason:n.Optional(m())}),response:n.Object({status:n.String()})}),age=d({tags:["admin"],method:"POST",url:`${Ge}/soak-time`,body:n.Object({id:m(),orgId:m(),soakTimeMin:n.Optional(n.Number())}),response:n.Object({status:n.String()})}),sge=d({tags:["admin"],method:"POST",url:`${Ge}/deploy`,body:n.Object({orgId:m(),clusterId:m(),chartName:m(),toVersion:m()}),response:n.Object({id:n.String()})}),d0=O("type",[n.Object({type:n.Literal("pending")}),n.Object({type:n.Literal("running")}),n.Object({type:n.Literal("cancelled")}),n.Object({type:n.Literal("timed_out")}),n.Object({type:n.Literal("success"),stateValue:n.Object({message:n.String()})}),n.Object({type:n.Literal("failure"),stateValue:n.Object({message:n.String()})})]),cge=d({tags:["admin"],method:"GET",url:`${Ge}/deploy`,query:n.Object({orgId:n.Optional(m()),clusterId:n.Optional(m())}),response:n.Array(n.Object({id:n.String(),orgId:n.String(),orgName:n.String(),clusterId:n.String(),clusterName:n.String(),fromVersion:n.Optional(n.String()),toVersion:n.String(),state:d0,updatedAt:T(),createdAt:T(),installationName:n.String(),chartName:n.String(),isAutomated:n.Boolean(),createdBy:n.Optional(n.String()),createdByName:n.Optional(n.String()),createdByEmail:n.Optional(n.String())}))}),f0=n.Object({installations:n.Array(n.Object({installationName:n.String(),parameters:n.Record(n.String(),n.Union([n.Number(),n.Boolean(),n.Null(),n.String()])),version:n.Union([n.String(),n.Null()]),resources:n.Array(n.Object({id:n.Object({kind:n.String(),name:n.String()}),status:n.String(),health:n.String(),rawDetails:n.Optional(n.Any()),liveManifest:n.Optional(n.String()),targetManifest:n.Optional(n.String())})),deployedAt:n.Optional(n.String()),syncStatus:n.Optional(n.String()),healthStatus:n.Optional(n.String())}))}),pge=d({tags:["admin"],method:"POST",url:`${Ge}/status`,body:n.Object({orgId:n.Optional(m()),clusterId:n.Optional(m())}),response:n.Array(n.Object({orgId:n.String(),clusterId:n.String(),status:f0}))}),mge=d({tags:["admin"],method:"POST",url:`${Ge}/argocd-cert-info`,body:n.Object({orgId:m(),clusterId:m()}),response:n.Object({certificateExpiresAt:n.String()})}),g0=n.Object({kind:n.String(),name:n.String()}),y0=n.Object({id:g0,liveManifest:n.Optional(n.String()),targetManifest:n.Optional(n.String())}),uge=d({tags:["admin"],method:"POST",url:`${Ge}/resource-details`,body:n.Object({orgId:m(),clusterId:m(),installationName:m()}),response:n.Object({resources:n.Array(y0)})}),lge=d({tags:["admin"],method:"GET",url:`${Ge}/versions`,query:n.Object({chartName:n.Optional(m())}),response:n.Array(n.Object({id:n.String(),chartName:n.String(),locator:n.String(),version:n.String(),repositoryArn:n.String(),type:n.Optional(n.String()),commitHash:n.Optional(n.String()),lastPulledAt:n.Optional(T()),pushedAt:n.Optional(T())}))});var h0=n.Object({id:n.Object({name:n.String(),kind:n.String()}),previewManifest:n.Optional(n.String())}),dge=d({tags:["admin"],method:"POST",url:`${Ge}/versions/render`,body:n.Object({chartName:m(),version:m(),values:m({type:"long"}),installationName:m(),namespace:m()}),response:n.Array(h0)}),mr=`${Gs}/orgs`,fge=d({tags:["admin"],url:mr,method:"GET",query:n.Object({onlyDeleted:n.Optional(n.Boolean())}),response:n.Array(n.Object({id:n.String(),name:n.String(),allowedDomains:n.Array(n.String()),createdAt:T(),updatedAt:T()}))}),gge=d({tags:["admin"],url:mr,method:"POST",body:n.Object({emailDomains:n.Array(m({type:"lowercase-domain"}),{maxItems:20}),name:m()}),response:n.Object({id:n.String(),name:n.String()})}),yge=d({tags:["admin"],url:`${mr}/:id`,method:"PUT",params:n.Object({id:m()}),body:n.Object({allowedDomains:n.Optional(n.Array(m({type:"lowercase-domain"}),{maxItems:20}))}),response:n.Object({id:n.String(),name:n.String(),allowedDomains:n.Array(n.String())})}),hge=d({tags:["admin"],url:`${mr}/:id`,method:"DELETE",params:n.Object({id:m()}),response:L}),Ege=d({tags:["admin"],url:`${mr}/:id/restore`,method:"POST",params:n.Object({id:m()}),response:n.Object({success:n.Boolean()})}),Tge=d({tags:["admin"],url:`${mr}/:id/permanent-delete`,method:"DELETE",params:n.Object({id:m()}),response:n.Object({success:n.Boolean(),hasDeletedSecret:n.Boolean(),hasDeletedTenantDb:n.Boolean(),hasDeletedOrgRow:n.Boolean()})}),Ige=d({tags:["admin"],url:`${mr}/synchronize-sds-rules`,method:"POST",response:n.Object({errorOrgs:n.Optional(n.Array(n.Object({id:n.String(),name:n.String()}))),synchronizedOrgsCount:n.Number()})}),E0=["custom_usage_tag","ingestion_api_key","inventory_resource","monitor","retention_policy","route","sensitive_data_scanner_rule","tag_policy","team"],T0=n.Enum(E0),_ge=d({tags:["admin"],url:`${mr}/refresh-assets`,method:"POST",body:n.Object({assetTypes:n.Array(T0,{minItems:1}),orgId:n.Optional(m({allowEmpty:!1}))}),response:n.Array(n.Object({orgId:n.String(),orgName:n.String(),results:n.Record(n.String(),n.Object({success:n.Boolean()}))}))}),bge=d({tags:["admin"],url:`${mr}/sudo`,method:"POST",body:n.Object({orgId:m()}),response:n.Object({sudoToken:n.String()})}),I0=`${Gs}/users`,Age=d({tags:["admin"],url:`${I0}/invite`,method:"POST",body:n.Object({email:m({type:"email"}),orgId:m(),userRole:n.Enum($s)}),response:n.Array(n.Object({inviteId:n.String(),email:n.String(),result:n.Union([n.Literal("success"),n.Literal("email-failed")])}))});var Oge=d({tags:["admin"],url:`${Gs}/billing-data`,method:"GET",query:n.Object({orgId:m(),maxDaysFetched:n.Optional(n.Number({minimum:1,maximum:365}))}),response:n.Object({dataPoints:n.Array(n.Object({date:n.String(),telemetryKind:n.Union([n.Literal("logs"),n.Literal("metrics"),n.Literal("rum"),n.Literal("traces")]),totalBytes:n.Number(),clusterId:n.String(),apiKeyId:n.String(),apiKeyName:n.String(),teamName:n.String()})),availableFilters:n.Object({clusters:n.Array(n.Object({id:n.String(),name:n.String()})),apiKeys:n.Array(n.Object({id:n.String(),name:n.String()})),teamNames:n.Array(n.String())})})});var e_=n.Object({id:n.String({description:"Unique identifier of the Tsuga cluster containing your observability data"}),name:n.String({description:"Internal name of the Tsuga cluster"}),friendlyName:n.Optional(n.String({description:"Human-readable display name set by an operator"})),clusterType:n.Enum(JI,{description:"Cloud provider hosting the Tsuga cluster"}),clusterRegion:n.String({description:"Region where the Tsuga cluster is deployed"})},{$id:"Cluster",description:"A Tsuga cluster containing your observability data"}),_0={id:"abc-123-def",name:"production",friendlyName:"Production (US)",clusterType:"aws",clusterRegion:"us-east-1"};Object.assign(e_,{examples:[_0]});var t_=d({description:"Lists Tsuga clusters available to the organization. Use cluster IDs to scope telemetry, service, inventory, and quality-report queries in multi-cluster organizations.",operationId:"listClusters",tags:["clusters"],url:`/${"v1"}/clusters`,method:"GET",response:n.Array(e_)});function r_(e,t){e.command("cluster").description("Manage Tsuga cluster selection. A Tsuga cluster contains your observability data.").command("list").description("List all Tsuga clusters available to the operation API key").action(async()=>{let o=await t()(t_);oe(o)})}function n_(e){let t=e.command("config").description("Show or manage configuration");t.action(()=>{let r=e.opts(),o=To({operationApiKey:r.operationApiKey,clusterId:r.cluster});Q(KI(o,vi()).trimEnd())}),t.command("set").description("Set a configuration value").command("default <key> <value>").description("Set a custom default value for a command flag").allowUnknownOption(!0).action((r,o)=>{qI(r,o),Q(`Default set: ${r} = ${o}`)}),t.command("reset").description("Reset configuration values").command("defaults").description("Clear all custom defaults").action(()=>{HI(),Q("Custom defaults cleared")})}var o_=`/${"v1"}/docs`,i_=n.Object({path:n.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:n.String({description:'Title of the page (e.g. "Send your first logs" or "POST /v1/aggregation/multi-query/scalar")'}),content:n.String({description:"Raw markdown content of the page"})},{$id:"DocPage",description:"A documentation or API-reference page with its raw markdown content"}),b0={path:"getting-started/send-your-first-logs",title:"Send your first logs",content:`# Send your first logs
40
- ...`};Object.assign(i_,{examples:[b0]});var a_=n.Object({kind:n.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:n.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:n.String({description:'Title of the result (e.g. "How to Add Resource Attributes" or "POST /v1/aggregation/multi-query/scalar")'}),subsection:n.Optional(n.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:n.Optional(n.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:n.Optional(n.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:n.Number({description:"Relevance score between 0 and 1 (higher is more relevant)"}),excerpt:n.String({description:"Short snippet of matching content"}),link:n.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"}),A0={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(a_,{examples:[A0]});var s_=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:o_,method:"GET",query:n.Object({path:m({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:i_}),c_=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.",operationId:"searchDocs",tags:["public","docs"],url:`${o_}/search`,method:"GET",query:n.Object({query:m({allowEmpty:!1,description:"Search text to match against documentation and API-reference content."})},{description:"Documentation search query."}),response:n.Array(a_)});function p_(e,t){let r=e.command("docs").description("Browse and search documentation");r.command("get <path>").description("Get a documentation page by path (e.g. 'getting-started/send-your-first-logs')").action(async o=>{let i=await t()(s_,{query:{path:o}});oe(i)}),r.command("search <query>").description("Search documentation pages").action(async o=>{let i=await t()(c_,{query:{query:o}});oe(i)})}var u_=1456444800,l_=4927737600,O0=u_*1e3,S0=l_*1e3,js=1704067200,sm=js*1e3,d_={title:"TimeRange",description:"Inclusive time range for telemetry queries. Use Unix timestamps in seconds unless the field description says milliseconds.",examples:[{from:js,to:js}]},f_={title:"TimeRange",description:"Inclusive time range for telemetry queries using Unix timestamps in milliseconds.",examples:[{from:sm,to:sm}]},Fs=e=>n.Integer({description:e,examples:[js],minimum:u_,maximum:l_,format:"int64"}),m_=e=>n.Integer({description:e,examples:[sm],minimum:O0,maximum:S0,format:"int64"}),Tt=n.Object({from:n.Optional(Fs("Start of the query window as a Unix timestamp in seconds")),to:n.Optional(Fs("End of the query window as a Unix timestamp in seconds"))},d_),It=n.Object({from:Fs("Start of the query window as a Unix timestamp in seconds"),to:Fs("End of the query window as a Unix timestamp in seconds")},d_),Vge=n.Object({from:n.Integer({description:"Start of the query window as a Unix timestamp in milliseconds"}),to:n.Integer({description:"End of the query window as a Unix timestamp in milliseconds"})},f_),g_=n.Object({from:m_("Start of the query window as a Unix timestamp in milliseconds"),to:m_("End of the query window as a Unix timestamp in milliseconds")},f_);var y_=n.Object({type:n.Literal("number"),number:n.String()}),x0=n.Object({type:n.Literal("string"),string:n.String()}),R0=n.Object({type:n.Literal("timestamp"),timestamp:n.String()}),cm=O("type",[y_,x0,R0]),C0=n.Object({by:n.Record(n.String(),cm),computed:n.Record(n.String(),y_)}),P0=n.Object({type:n.Literal("buckets"),buckets:n.Array(C0)}),U0=n.Object({type:n.Literal("distribution"),bounds:n.Array(n.Number()),buckets:n.Array(n.Object({timestamp:n.Number(),counts:n.Array(n.Number())})),percentiles:n.Optional(n.Array(n.Number()))}),h_=O("type",[P0,U0]);var N0="/v0/aggregation",k0=n.Union([n.Literal("a"),n.Literal("d"),n.Literal("q"),n.Literal("w"),n.Literal("t")]),w0=n.Object({parallelism:n.Number(),engine:k0,recordBatchCache:n.Optional(n.Boolean()),includeNullGroups:n.Optional(n.Boolean()),restartAwareGaugeSum:n.Optional(n.Boolean())}),Nt=["logs","metrics","traces"],L0={logs:"Logs",metrics:"Metrics",traces:"Traces"},M0=[...Nt,"connections","log-patterns"],cye={...L0,connections:"Connections","log-patterns":"Log Patterns"},pye=n.Enum(M0,{description:"Data source being queried"}),En=n.Enum(Nt,{description:"Telemetry source queried by this aggregation: `logs`, `metrics`, or `traces`."}),yn=n.String({description:"Attribute containing the values to aggregate"}),hn=m({description:"Attribute containing the values to aggregate"}),v0=O("type",[n.Object({type:n.Literal("count",{description:"Counts the total number of records"}),field:n.Optional(yn)},{$id:"AggregateCount",title:"Count"}),n.Object({type:n.Literal("unique-count",{description:"Counts the distinct values of the field"}),field:yn},{$id:"AggregateUniqueCount",title:"UniqueCount"}),n.Object({type:n.Literal("average",{description:"Calculates the average value of the selected field"}),field:yn},{$id:"AggregateAverage",title:"Average"}),n.Object({type:n.Literal("max",{description:"Finds the largest value of the field"}),field:yn},{$id:"AggregateMax",title:"Max"}),n.Object({type:n.Literal("min",{description:"Finds the smallest value of the field"}),field:yn},{$id:"AggregateMin",title:"Min"}),n.Object({type:n.Literal("sum",{description:"Sums the values of the selected field"}),field:yn},{$id:"AggregateSum",title:"Sum"}),n.Object({type:n.Literal("percentile",{description:"Calculates a percentile of the selected field"}),field:yn,percentile:n.Number({description:"Percentile to compute for the selected field, from 0 through 100."})},{$id:"AggregatePercentile",title:"Percentile"})],{title:"Aggregate"}),D0=O("type",[n.Object({type:n.Literal("count",{description:"Counts the total number of records"}),field:n.Optional(hn)},{$id:"InputAggregateCount",title:"Count"}),n.Object({type:n.Literal("unique-count",{description:"Counts the distinct values of the field"}),field:hn},{$id:"InputAggregateUniqueCount",title:"UniqueCount"}),n.Object({type:n.Literal("average",{description:"Calculates the average value of the selected field"}),field:hn},{$id:"InputAggregateAverage",title:"Average"}),n.Object({type:n.Literal("max",{description:"Finds the largest value of the field"}),field:hn},{$id:"InputAggregateMax",title:"Max"}),n.Object({type:n.Literal("min",{description:"Finds the smallest value of the field"}),field:hn},{$id:"InputAggregateMin",title:"Min"}),n.Object({type:n.Literal("sum",{description:"Sums the values of the selected field"}),field:hn},{$id:"InputAggregateSum",title:"Sum"}),n.Object({type:n.Literal("percentile",{description:"Calculates a percentile of the selected field"}),field:hn,percentile:n.Number({description:"Percentile to compute for the selected field, from 0 through 100."})},{$id:"InputAggregatePercentile",title:"Percentile"})],{title:"InputAggregate"}),I_=n.Object({type:n.Literal("per-second",{description:"Normalizes the metric to events per second"})},{$id:"FunctionPerSecond",title:"PerSecond"}),__=n.Object({type:n.Literal("per-minute",{description:"Normalizes the metric to events per minute"})},{$id:"FunctionPerMinute",title:"PerMinute"}),b_=n.Object({type:n.Literal("per-hour",{description:"Normalizes the metric to events per hour"})},{$id:"FunctionPerHour",title:"PerHour"}),A_=n.Object({type:n.Literal("rate",{description:"Calculates the rate of change"})},{$id:"FunctionRate",title:"Rate"}),O_=n.Object({type:n.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"}),S_=n.Object({type:n.Literal("power",{description:"Raises values to a specified power"}),exponent:n.Integer({description:"The exponent to raise values to"})},{$id:"FunctionPower",title:"Power"}),x_=n.Object({type:n.Literal("sqrt",{description:"Applies a square root transformation to the values"})},{$id:"FunctionSqrt",title:"Sqrt"}),R_=n.Object({type:n.Literal("last",{description:"Takes the last value of the metric for the selected time frame"})},{$id:"FunctionLast",title:"Last"}),$0=n.Object({type:n.Literal("rolling",{description:"Computes a rolling window aggregate"}),window:n.String({description:"Duration of the rolling window"})},{$id:"FunctionRolling",title:"Rolling"}),G0=n.Object({type:n.Literal("rolling",{description:"Computes a rolling window aggregate"}),window:m({allowEmpty:!1,description:"Duration of the rolling window"})},{$id:"InputFunctionRolling",title:"Rolling"}),j0=n.Object({type:n.Literal("log",{description:"Applies a logarithm transformation to the values"}),base:n.Integer({description:"The base of the logarithm"})},{$id:"FunctionLog",title:"Log"}),F0=n.Object({type:n.Literal("log",{description:"Applies a logarithm transformation to the values"}),base:n.Integer({description:"The base of the logarithm",minimum:2})},{$id:"InputFunctionLog",title:"Log"}),B0=n.Object({type:n.Literal("time-offset",{description:"Shifts a query's data backward by a specified duration for easy comparison over different periods of time."}),seconds:n.Integer({description:"Number of seconds to offset"})},{$id:"FunctionTimeOffset",title:"TimeOffset"}),q0=n.Object({type:n.Literal("time-offset",{description:"Shifts a query's data backward by a specified duration for easy comparison over different periods of time."}),seconds:n.Integer({description:"Number of seconds to offset",minimum:1})},{$id:"InputFunctionTimeOffset",title:"TimeOffset"}),H0=O("type",[I_,__,b_,A_,O_,$0,j0,S_,x_,R_,B0],{title:"Function"}),K0=O("type",[I_,__,b_,A_,O_,G0,F0,S_,x_,R_,q0],{title:"InputFunction"});var E_=n.Object({min:n.Number({description:"Lower bound of the distribution range."}),max:n.Number({description:"Upper bound of the distribution range."})}),z0=["linear","log"],Bs=n.Enum(z0),T_=n.Integer({minimum:1}),V0=O("type",[n.Object({type:n.Literal("scalar")},{title:"Scalar",description:"Returns a single value"}),n.Object({type:n.Literal("timeseries"),aggregationWindow:m({description:'Time bucket size for aggregation (e.g. "10s", "60s", "1m")'})},{title:"Timeseries",description:"Returns a time series"}),n.Object({type:n.Literal("histogram"),by:n.Optional(m()),bucketCount:n.Optional(T_),bounds:n.Optional(E_),boundsScale:n.Optional(Bs),percentiles:n.Optional(n.Array(n.Number({minimum:0,maximum:100,multipleOf:1}),{minItems:1}))},{title:"Histogram",description:"Returns a single distribution over the entire time range"}),n.Object({type:n.Literal("heatmap"),aggregationWindow:m({description:'Time bucket size for the heatmap (e.g. "10s", "60s", "1m")'}),by:n.Optional(m()),bucketCount:n.Optional(T_),bounds:n.Optional(E_)},{title:"Heatmap",description:"Returns a distribution per time window"})]),pm=15,Y0=["zero","null"],Q0=n.Enum(Y0,{description:"`zero` fills missing points with zero. `null` keeps missing points null."}),C_=n.Object({mode:n.Object({type:Q0},{description:"How missing aggregation points should be filled."})}),P_={aggregate:v0,functions:n.Optional(n.Array(H0,{description:"Post-processing functions applied to aggregation results"})),fill:n.Optional(C_)},U_={aggregate:D0,functions:n.Optional(n.Array(K0,{maxItems:10,description:"Post-processing functions applied to aggregation results"})),fill:n.Optional(C_)},W0={description:"Aggregations that may be combined together in the same query"},N_={maxItems:pm,description:"Aggregations that may be combined together in the same query"},k_=n.Array(n.Object({...P_,filter:n.Optional(n.String({description:"Filter to apply to the aggregation"}))},{title:"AggregationQuery"}),W0),$i=n.Array(n.Object({...U_,filter:n.Optional(m({type:"tsuga-query",description:"Filter to apply to the aggregation"}))},{title:"AggregationQuery"}),N_),_o=n.Array(n.Object({...P_,filter:n.String({description:"Filter to apply to the aggregation"})},{title:"MonitorAggregationQuery"})),bo=n.Array(n.Object({...U_,filter:m({type:"tsuga-query"})},{title:"MonitorAggregationQuery"}),N_);var w_=n.String({description:"Formula referencing query outputs (e.g. q1+q2) to compute derived series"}),Gi=m({type:"tsuga-formula",description:"Formula referencing query outputs (e.g. q1+q2) to compute derived series"}),Z0=n.Object({fields:n.Array(n.String(),{description:"Telemetry attribute names used to group aggregation results."}),limit:n.Number({description:"Maximum number of groups returned for this grouping level."})},{title:"AggregationGroupBy"}),X0=n.Object({fields:n.Array(m(),{maxItems:1,description:"Telemetry attribute name used to group aggregation results."}),limit:n.Number({description:"Maximum number of groups returned for this grouping level."})},{title:"AggregationGroupBy"}),L_=7;var mm=n.Array(Z0,{description:"Fields used to group the results"}),Ao=n.Array(X0,{maxItems:L_,description:"Fields used to group the results"}),J0=n.Enum([...Nt,"rum"],{description:"Data source being queried for this aggregation"}),mye=d({tags:["aggregation"],url:`${N0}/multi-query`,method:"POST",body:n.Object({timeRange:g_,queries:$i,groupBy:n.Optional(Ao),returnType:V0,dataSource:J0,formula:Gi,executionOptions:w0,triggeredBy:n.Optional(n.Literal("refresh")),shouldStreamResults:n.Optional(n.Boolean()),clusterId:n.Optional(m({allowEmpty:!1}))}),response:h_});var M_=`/${"v1"}/aggregation`,v_=n.Object({id:n.String({description:"Result identifier. Query results use `q1`, `q2`, and so on; formula results use `formula`."}),group:n.Record(n.String(),n.Union([n.String(),n.Number()]),{description:"Group-by field values for this result. Empty when no group-by is requested."})}),ev={results:[{id:"q1",group:{host:"server-1"},value:123.45}]},D_=n.Object({results:n.Array(n.Object({...v_.properties,value:n.Number({description:"Aggregated value"})},{title:"ScalarResult"}),{description:"Aggregated results per query and group"})},{$id:"ScalarAggregationResponse",title:"ScalarAggregationResponse",description:"Scalar aggregation response with one value per query or formula and group."});Object.assign(D_,{examples:[ev]});var tv={series:[{id:"q1",group:{host:"server-1"},points:[{timestamp:16094592e5,value:123.45},{timestamp:160945926e4,value:456.78}]}]},qs=n.Object({series:n.Array(n.Object({...v_.properties,points:n.Array(n.Object({timestamp:n.Integer({description:"Timestamp in milliseconds"}),value:n.Number({description:"Aggregated value at this timestamp"})}),{description:"Ordered data points for this query or formula and group."})},{title:"Series"}),{description:"Time series data per query or formula and group"})},{$id:"TimeseriesAggregationResponse",title:"TimeseriesAggregationResponse",description:"Timeseries aggregation response with timestamped points over time."});Object.assign(qs,{examples:[tv]});var $_={timeRange:It,queries:n.Array(n.Omit($i.items,["fill"],{title:"AggregationQuery"}),{maxItems:pm,description:'Aggregations that may be combined together in the same query. 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:n.Optional(Ao),dataSource:En,formula:n.Optional(Gi)},G_=n.Object({clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit for single-cluster organizations."}))}),rv=n.Object($_,{description:"Scalar aggregation request. Provide a time range, one or more queries, a telemetry data source, and optional grouping or formula."}),j_=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:`${M_}/multi-query/scalar`,method:"POST",body:rv,query:G_,response:D_}),nv=n.Object({...$_,aggregationWindow:m({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."}),F_=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:`${M_}/multi-query/timeseries`,method:"POST",body:nv,query:G_,response:qs});var ov=`/${"v1"}/promql`,iv=n.Object({query:m({allowEmpty:!1,description:"PromQL query string to evaluate against Tsuga metric data."}),timeRange:It,step:m({allowEmpty:!1,description:"Query resolution step, such as `15s` or `1m`."})},{description:"Experimental PromQL query request."}),av=n.Object({clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit for single-cluster organizations."}))}),B_=d({description:"Runs an experimental PromQL query over metric data and returns timeseries results. Use this only when you need PromQL-compatible metric queries; response shape and behavior may change.",operationId:"queryPromql",tags:["public","promql"],url:ov,method:"POST",body:iv,query:av,response:qs});var q_=Gl(require("node:fs"));function Oo(e){if(e.file){let t=q_.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> or -d <json>. Use --generate-skeleton to get a template.")}function sv(e){return s.IsObject(e)&&s.HasPropertyKey(e,"check")&&s.HasPropertyKey(e,"errors")&&s.IsFunction(e.check)&&s.IsFunction(e.errors)}function um(e){return s.HasPropertyKey(e,"~guard")&&sv(e["~guard"])}function lm(e){return s.HasPropertyKey(e,"~refine")&&s.IsArray(e["~refine"])&&s.Every(e["~refine"],0,t=>s.IsObject(t)&&s.HasPropertyKey(t,"refine")&&s.HasPropertyKey(t,"message")&&s.IsFunction(t.refine)&&s.IsString(t.message))}function ur(e){return s.IsObject(e)&&!s.IsArray(e)}function Hs(e){return s.IsBoolean(e)}function $(e){return ur(e)||Hs(e)}function dm(e){return s.HasPropertyKey(e,"additionalItems")&&$(e.additionalItems)}function lr(e){return s.HasPropertyKey(e,"additionalProperties")&&$(e.additionalProperties)}function fm(e){return s.HasPropertyKey(e,"allOf")&&s.IsArray(e.allOf)&&e.allOf.every(t=>$(t))}function ji(e){return s.HasPropertyKey(e,"$anchor")&&s.IsString(e.$anchor)}function gm(e){return s.HasPropertyKey(e,"anyOf")&&s.IsArray(e.anyOf)&&e.anyOf.every(t=>$(t))}function ym(e){return s.HasPropertyKey(e,"const")}function Tn(e){return s.HasPropertyKey(e,"contains")&&$(e.contains)}function Rt(e){return s.HasPropertyKey(e,"default")}function hm(e){return s.HasPropertyKey(e,"dependencies")&&s.IsObject(e.dependencies)&&Object.values(e.dependencies).every(t=>$(t)||s.IsArray(t)&&t.every(r=>s.IsString(r)))}function Em(e){return s.HasPropertyKey(e,"dependentRequired")&&s.IsObject(e.dependentRequired)&&Object.values(e.dependentRequired).every(t=>s.IsArray(t)&&t.every(r=>s.IsString(r)))}function Tm(e){return s.HasPropertyKey(e,"dependentSchemas")&&s.IsObject(e.dependentSchemas)&&Object.values(e.dependentSchemas).every(t=>$(t))}function Im(e){return s.HasPropertyKey(e,"$dynamicAnchor")&&s.IsString(e.$dynamicAnchor)}function _m(e){return s.HasPropertyKey(e,"else")&&$(e.else)}function bm(e){return s.HasPropertyKey(e,"enum")&&s.IsArray(e.enum)}function Am(e){return s.HasPropertyKey(e,"exclusiveMaximum")&&(s.IsNumber(e.exclusiveMaximum)||s.IsBigInt(e.exclusiveMaximum))}function dr(e){return s.HasPropertyKey(e,"exclusiveMinimum")&&(s.IsNumber(e.exclusiveMinimum)||s.IsBigInt(e.exclusiveMinimum))}function Fi(e){return s.HasPropertyKey(e,"format")&&s.IsString(e.format)}function In(e){return s.HasPropertyKey(e,"$id")&&s.IsString(e.$id)}function Om(e){return s.HasPropertyKey(e,"if")&&$(e.if)}function So(e){return s.HasPropertyKey(e,"items")&&($(e.items)||s.IsArray(e.items)&&e.items.every(t=>$(t)))}function Sm(e){return So(e)&&s.IsArray(e.items)}function xm(e){return s.HasPropertyKey(e,"maximum")&&(s.IsNumber(e.maximum)||s.IsBigInt(e.maximum))}function Rm(e){return s.HasPropertyKey(e,"maxContains")&&s.IsNumber(e.maxContains)}function Ks(e){return s.HasPropertyKey(e,"maxItems")&&s.IsNumber(e.maxItems)}function Cm(e){return s.HasPropertyKey(e,"maxLength")&&s.IsNumber(e.maxLength)}function Pm(e){return s.HasPropertyKey(e,"maxProperties")&&s.IsNumber(e.maxProperties)}function fr(e){return s.HasPropertyKey(e,"minimum")&&(s.IsNumber(e.minimum)||s.IsBigInt(e.minimum))}function _n(e){return s.HasPropertyKey(e,"minContains")&&s.IsNumber(e.minContains)}function xo(e){return s.HasPropertyKey(e,"minItems")&&s.IsNumber(e.minItems)}function Bi(e){return s.HasPropertyKey(e,"minLength")&&s.IsNumber(e.minLength)}function qi(e){return s.HasPropertyKey(e,"minProperties")&&s.IsNumber(e.minProperties)}function Um(e){return s.HasPropertyKey(e,"multipleOf")&&(s.IsNumber(e.multipleOf)||s.IsBigInt(e.multipleOf))}function Nm(e){return s.HasPropertyKey(e,"not")&&$(e.not)}function km(e){return s.HasPropertyKey(e,"oneOf")&&s.IsArray(e.oneOf)&&e.oneOf.every(t=>$(t))}function Hi(e){return s.HasPropertyKey(e,"pattern")&&(s.IsString(e.pattern)||e.pattern instanceof RegExp)}function Ki(e){return s.HasPropertyKey(e,"patternProperties")&&s.IsObject(e.patternProperties)&&Object.values(e.patternProperties).every(t=>$(t))}function Ro(e){return s.HasPropertyKey(e,"prefixItems")&&s.IsArray(e.prefixItems)&&e.prefixItems.every(t=>$(t))}function zi(e){return s.HasPropertyKey(e,"properties")&&s.IsObject(e.properties)&&Object.values(e.properties).every(t=>$(t))}function wm(e){return s.HasPropertyKey(e,"propertyNames")&&(s.IsObject(e.propertyNames)||$(e.propertyNames))}function cv(e){return s.HasPropertyKey(e,"$recursiveAnchor")&&s.IsBoolean(e.$recursiveAnchor)}function zs(e){return cv(e)&&s.IsEqual(e.$recursiveAnchor,!0)}function Lm(e){return s.HasPropertyKey(e,"$recursiveRef")&&s.IsString(e.$recursiveRef)}function Mm(e){return s.HasPropertyKey(e,"$ref")&&s.IsString(e.$ref)}function bn(e){return s.HasPropertyKey(e,"required")&&s.IsArray(e.required)&&e.required.every(t=>s.IsString(t))}function vm(e){return s.HasPropertyKey(e,"then")&&$(e.then)}function Dm(e){return s.HasPropertyKey(e,"type")&&(s.IsString(e.type)||s.IsArray(e.type)&&e.type.every(t=>s.IsString(t)))}function Co(e){return s.HasPropertyKey(e,"uniqueItems")&&s.IsBoolean(e.uniqueItems)}function Vs(e){return s.HasPropertyKey(e,"unevaluatedItems")&&$(e.unevaluatedItems)}function Ys(e){return s.HasPropertyKey(e,"unevaluatedProperties")&&$(e.unevaluatedProperties)}var st=class{constructor(){this.indices=new Set,this.keys=new Set}AddIndex(t){return this.indices.add(t),!0}AddKey(t){return this.keys.add(t),!0}GetIndices(){return this.indices}GetKeys(){return this.keys}Merge(t){for(let r of t)r.indices.forEach(o=>this.indices.add(o)),r.keys.forEach(o=>this.keys.add(o));return!0}},Vi=class extends st{constructor(t){super(),this.callback=t}AddError(t){return this.callback(t),!1}},je=class extends Vi{constructor(){super(t=>this.errors.push(t)),this.errors=[]}AddError(t){return this.errors.push(t),!1}GetErrors(){return this.errors}};var pv="external_",mv=0,WTe={identifier:`${pv}${mv}`,variables:[]};function H_(e,t,r,o){return r["~guard"].check(o)}function K_(e,t,r,o,i,a){return i["~guard"].check(a)||t.AddError({keyword:"~guard",schemaPath:r,instancePath:o,params:{errors:i["~guard"].errors(a)}})}function z_(e,t,r,o){return s.Every(r["~refine"],0,(i,a)=>i.refine(o))}function V_(e,t,r,o,i,a){return s.EveryAll(i["~refine"],0,(c,u)=>c.refine(a)||t.AddError({keyword:"~refine",schemaPath:r,instancePath:o,params:{index:u,message:c.message}}))}function Y_(e){return So(e)&&s.IsArray(e.items)}function Q_(e,t,r,o){return Y_(r)?o.every((a,c)=>s.IsLessThan(c,r.items.length)||D(e,t,r.additionalItems,a)&&t.AddIndex(c)):!0}function W_(e,t,r,o,i,a){return Y_(i)?a.every((u,l)=>{let f=`${r}/additionalItems`,y=`${o}/${l}`;return s.IsLessThan(l,i.items.length)||Y(e,t,f,y,i.additionalItems,u)&&t.AddIndex(l)}):!0}function uv(e){return`^${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}$`}function Z_(e){let t=[];return Ki(e)&&t.push(...s.Keys(e.patternProperties)),zi(e)&&t.push(...s.Keys(e.properties).map(uv)),s.IsEqual(t.length,0)?"(?!)":`(${t.join("|")})`}function X_(e,t,r,o){let i=new RegExp(Z_(r));return s.Every(s.Keys(o),0,(c,u)=>i.test(c)||D(e,t,r.additionalProperties,o[c])&&t.AddKey(c))}function J_(e,t,r,o,i,a){let c=new RegExp(Z_(i)),u=[];return s.EveryAll(s.Keys(a),0,(f,y)=>{let E=`${r}/additionalProperties`,S=`${o}/${f}`,fe=new je,Re=c.test(f)||Y(e,fe,E,S,i.additionalProperties,a[f])&&t.AddKey(f);return Re||u.push(f),Re})||t.AddError({keyword:"additionalProperties",schemaPath:r,instancePath:o,params:{additionalProperties:u}})}function eb(e,t,r,o){let i=r.allOf.reduce((a,c)=>{let u=new st;return D(e,u,c,o)?[...a,u]:a},[]);return s.IsEqual(i.length,r.allOf.length)&&t.Merge(i)}function tb(e,t,r,o,i,a){let c=[],u=i.allOf.reduce((f,y,E)=>{let S=`${r}/allOf/${E}`,fe=new je,Re=Y(e,fe,S,o,y,a);return Re||c.push(fe),Re?[...f,fe]:f},[]),l=s.IsEqual(u.length,i.allOf.length)&&t.Merge(u);return l||c.forEach(f=>f.GetErrors().forEach(y=>t.AddError(y))),l}function rb(e,t,r,o){let i=r.anyOf.reduce((a,c,u)=>{let l=new st;return D(e,l,c,o)?[...a,l]:a},[]);return s.IsGreaterThan(i.length,0)&&t.Merge(i)}function nb(e,t,r,o,i,a){let c=[],u=i.anyOf.reduce((f,y,E)=>{let S=new je,fe=`${r}/anyOf/${E}`,Re=Y(e,S,fe,o,y,a);return Re||c.push(S),Re?[...f,S]:f},[]),l=s.IsGreaterThan(u.length,0)&&t.Merge(u);return l||c.forEach(f=>f.GetErrors().forEach(y=>t.AddError(y))),l||t.AddError({keyword:"anyOf",schemaPath:r,instancePath:o,params:{}})}function Gm(e,t,r,o){return r}function ob(e,t,r,o,i,a){return Gm(e,t,i,a)||t.AddError({keyword:"boolean",schemaPath:r,instancePath:o,params:{}})}function jm(e,t,r,o){return s.IsValueLike(r.const)?s.IsEqual(o,r.const):s.IsDeepEqual(o,r.const)}function ib(e,t,r,o,i,a){return jm(e,t,i,a)||t.AddError({keyword:"const",schemaPath:r,instancePath:o,params:{allowedValue:i.const}})}function lv(e){return!(_n(e)&&s.IsEqual(e.minContains,0))}function Fm(e,t,r,o){return lv(r)?!s.IsEqual(o.length,0)&&o.some(i=>D(e,t,r.contains,i)):!0}function ab(e,t,r,o,i,a){return Fm(e,t,i,a)||t.AddError({keyword:"contains",schemaPath:r,instancePath:o,params:{minContains:1}})}function sb(e,t,r,o){let i=s.IsEqual(s.Keys(o).length,0),a=s.Every(s.Entries(r.dependencies),0,([c,u])=>!s.HasPropertyKey(o,c)||(s.IsArray(u)?u.every(l=>s.HasPropertyKey(o,l)):D(e,t,u,o)));return i||a}function cb(e,t,r,o,i,a){let c=s.IsEqual(s.Keys(a).length,0),u=s.EveryAll(s.Entries(i.dependencies),0,([l,f])=>{let y=`${r}/dependencies/${l}`;return!s.HasPropertyKey(a,l)||(s.IsArray(f)?f.every(E=>s.HasPropertyKey(a,E)||t.AddError({keyword:"dependencies",schemaPath:r,instancePath:o,params:{property:l,dependencies:f}})):Y(e,t,y,o,f,a))});return c||u}function pb(e,t,r,o){let i=s.IsEqual(s.Keys(o).length,0),a=s.Every(s.Entries(r.dependentRequired),0,([c,u])=>!s.HasPropertyKey(o,c)||u.every(l=>s.HasPropertyKey(o,l)));return i||a}function mb(e,t,r,o,i,a){let c=s.IsEqual(s.Keys(a).length,0),u=s.EveryAll(s.Entries(i.dependentRequired),0,([l,f])=>!s.HasPropertyKey(a,l)||s.EveryAll(f,0,y=>s.HasPropertyKey(a,y)||t.AddError({keyword:"dependentRequired",schemaPath:r,instancePath:o,params:{property:l,dependencies:f}})));return c||u}function ub(e,t,r,o){let i=s.IsEqual(s.Keys(o).length,0),a=s.Every(s.Entries(r.dependentSchemas),0,([c,u])=>!s.HasPropertyKey(o,c)||D(e,t,u,o));return i||a}function lb(e,t,r,o,i,a){let c=s.IsEqual(s.Keys(a).length,0),u=s.EveryAll(s.Entries(i.dependentSchemas),0,([l,f])=>{let y=`${r}/dependentSchemas/${l}`;return!s.HasPropertyKey(a,l)||Y(e,t,y,o,f,a)});return c||u}function Bm(e,t,r,o){return r.enum.some(i=>s.IsValueLike(i)?s.IsEqual(o,i):s.IsDeepEqual(o,i))}function db(e,t,r,o,i,a){return Bm(e,t,i,a)||t.AddError({keyword:"enum",schemaPath:r,instancePath:o,params:{allowedValues:i.enum}})}function qm(e,t,r,o){return s.IsLessThan(o,r.exclusiveMaximum)}function fb(e,t,r,o,i,a){return qm(e,t,i,a)||t.AddError({keyword:"exclusiveMaximum",schemaPath:r,instancePath:o,params:{comparison:"<",limit:i.exclusiveMaximum}})}function Hm(e,t,r,o){return s.IsGreaterThan(o,r.exclusiveMinimum)}function gb(e,t,r,o,i,a){return Hm(e,t,i,a)||t.AddError({keyword:"exclusiveMinimum",schemaPath:r,instancePath:o,params:{comparison:">",limit:i.exclusiveMinimum}})}var Uo={};Pt(Uo,{Clear:()=>hb,Entries:()=>Nv,Get:()=>Lv,Has:()=>wv,IsDate:()=>Yi,IsDateTime:()=>Km,IsDuration:()=>zm,IsEmail:()=>Vm,IsHostname:()=>Ym,IsIPv4:()=>Xm,IsIPv6:()=>Jm,IsIdnEmail:()=>Qm,IsIdnHostname:()=>Zm,IsIri:()=>tu,IsIriReference:()=>eu,IsJsonPointer:()=>nu,IsJsonPointerUriFragment:()=>ru,IsRegex:()=>ou,IsRelativeJsonPointer:()=>iu,IsTime:()=>Qi,IsUri:()=>cu,IsUriReference:()=>au,IsUriTemplate:()=>su,IsUrl:()=>pu,IsUuid:()=>mu,Reset:()=>Eb,Set:()=>kv,Test:()=>Mv});var dv=[0,31,28,31,30,31,30,31,31,30,31,30,31],fv=/^(\d\d\d\d)-(\d\d)-(\d\d)$/;function gv(e){return e%4===0&&(e%100!==0||e%400===0)}function Yi(e){let t=fv.exec(e);if(!t)return!1;let r=+t[1],o=+t[2],i=+t[3];return o>=1&&o<=12&&i>=1&&i<=(o===2&&gv(r)?29:dv[o])}var yv=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(?:Z|([+-])(\d\d):(\d\d))?$/i;function Qi(e,t=!0){let r=yv.exec(e);if(!r)return!1;let o=+r[1],i=+r[2],a=+r[3],c=r[4]==="-"?-1:1,u=+(r[5]||0),l=+(r[6]||0);if(u>23||l>59||t&&!r[4]&&e.toLowerCase().indexOf("z")===-1)return!1;if(o<=23&&i<=59&&a<60)return!0;let f=i-l*c,y=o-u*c-(f<0?1:0);return(y===23||y===-1)&&(f===59||f===-1)&&a<61}function Km(e,t=!0){let r=e.split(/T/i);return r.length===2&&Yi(r[0])&&Qi(r[1],t)}var hv=/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/;function zm(e){return hv.test(e)}var Ev=/^(?!.*\.\.)[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 Vm(e){return Ev.test(e)}var Tv=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i;function Ym(e){return Tv.test(e)}var Iv=/^(?!.*\.\.)[\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 Qm(e){return Iv.test(e)}function Wm(e){let t=e.codePointAt(0);return t===void 0?!1:t>=12352&&t<=12447||t>=12448&&t<=12543&&t!==12539||t>=19968&&t<=40959}function Zm(e){if(e.length===0||e.includes(" "))return!1;let t=/[\u002E\u3002\uFF0E\uFF61]/g,r=e.normalize("NFC").replace(t,".");if(r.length>253)return!1;let o=r.split(".");if(o.some(i=>i.length===0))return!1;for(let i of o){if(i.length>63||i.startsWith("-")||i.endsWith("-"))return!1;if(/^xn--/i.test(i)){let l=i.slice(4);if(l.length<2||l.includes("---"))return!1;continue}if(/[\u302E\u302F\u3031\u3032\u3033\u3034\u3035\u303B\u0640\u07FA]/.test(i))return!1;let a=i.charAt(0);if(/[\u0903\u0300\u0488]/.test(a))return!1;for(let l=0;l<i.length;l++){let f=i.charAt(l);if(f==="\xB7"){if(l===0||l===i.length-1)return!1;let y=i.charAt(l-1),E=i.charAt(l+1);if(!/^[lL]$/.test(y)||!/^[lL]$/.test(E))return!1}if(f==="\u30FB"){if(i.length===1)return!1;if(l===0){let y=i.charAt(l+1);if(!Wm(y))return!1}else{let y=i.charAt(l-1),E=i.charAt(l+1);if(!Wm(y)||!Wm(E))return!1}}if(f==="\u0375"){if(l===i.length-1)return!1;let y=i.charAt(l+1);if(!/[\u0370-\u03FF]/.test(y))return!1}if(f==="\u05F3"||f==="\u05F4"){if(l===0)return!1;let y=i.charAt(l-1);if(!/[\u05D0-\u05EA]/.test(y))return!1}if(f==="\u200D"&&(l===0||i.charAt(l-1)!=="\u094D"))return!1}let c=!1,u=!1;for(let l=0;l<i.length;l++){let f=i.charAt(l);/[\u0660-\u0669]/.test(f)&&(c=!0),/[\u06F0-\u06F9]/.test(f)&&(u=!0)}if(c&&u)return!1}return!0}var _v=/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/;function Xm(e){return _v.test(e)}var bv=/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i;function Jm(e){return bv.test(e)}function yb(e){try{return new URL(e,"http://example.com"),!0}catch{return!1}}function eu(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))?yb(e):e.match(/^([a-zA-Z][a-zA-Z0-9+\-.]*)(\/\/)/)&&t===-1?!1:yb(e)}function tu(e){try{return new URL(e),!0}catch{return!1}}var Av=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;function ru(e){return Av.test(e)}var Ov=/^(?:\/(?:[^~/]|~0|~1)*)*$/;function nu(e){return Ov.test(e)}function ou(e){if(e.length===0)return!1;try{return new RegExp(e),!0}catch{return!1}}var Sv=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function iu(e){return Sv.test(e)}var xv=/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i;function au(e){return xv.test(e)}var Rv=/^(?:(?:[^\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 su(e){return Rv.test(e)}var Cv=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i;function cu(e){return Cv.test(e)}var Pv=/^(?: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 pu(e){return Pv.test(e)}var Uv=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;function mu(e){return Uv.test(e)}var de=new Map;function hb(){de.clear()}function Nv(){return[...de.entries()]}function kv(e,t){de.set(e,t)}function wv(e){return de.has(e)}function Lv(e){return de.get(e)}function Mv(e,t){return de.get(e)?.(t)??!0}function Eb(){hb(),de.set("date-time",Km),de.set("date",Yi),de.set("duration",zm),de.set("email",Vm),de.set("hostname",Ym),de.set("idn-email",Qm),de.set("idn-hostname",Zm),de.set("ipv4",Xm),de.set("ipv6",Jm),de.set("iri-reference",eu),de.set("iri",tu),de.set("json-pointer-uri-fragment",ru),de.set("json-pointer",nu),de.set("regex",ou),de.set("relative-json-pointer",iu),de.set("time",Qi),de.set("uri-reference",au),de.set("uri-template",su),de.set("uri",cu),de.set("url",pu),de.set("uuid",mu)}Eb();function uu(e,t,r,o){return Uo.Test(r.format,o)}function Tb(e,t,r,o,i,a){return uu(e,t,i,a)||t.AddError({keyword:"format",schemaPath:r,instancePath:o,params:{format:i.format}})}function Ib(e,t,r,o){let i=vm(r)?r.then:!0,a=_m(r)?r.else:!0;return D(e,t,r.if,o)?D(e,t,i,o):D(e,t,a,o)}function _b(e,t,r,o,i,a){let c=vm(i)?i.then:!0,u=_m(i)?i.else:!0,l=new je,f=Y(e,l,`${r}/if`,o,i.if,a)?Y(e,l,`${r}/then`,o,c,a)||t.AddError({keyword:"if",schemaPath:r,instancePath:o,params:{failingKeyword:"then"}}):Y(e,t,`${r}/else`,o,u,a)||t.AddError({keyword:"if",schemaPath:r,instancePath:o,params:{failingKeyword:"else"}});return f&&t.Merge([l]),f}function vv(e,t,r,o){return s.Every(r.items,0,(i,a)=>s.IsLessEqualThan(o.length,a)||D(e,t,i,o[a])&&t.AddIndex(a))}function Dv(e,t,r,o,i,a){return s.EveryAll(i.items,0,(c,u)=>{let l=`${r}/items/${u}`,f=`${o}/${u}`;return s.IsLessEqualThan(a.length,u)||Y(e,t,l,f,c,a[u])&&t.AddIndex(u)})}function $v(e,t,r,o){let i=Ro(r)?r.prefixItems.length:0;return s.Every(o,i,(a,c)=>D(e,t,r.items,a)&&t.AddIndex(c))}function Gv(e,t,r,o,i,a){let c=Ro(i)?i.prefixItems.length:0;return s.EveryAll(a,c,(u,l)=>{let f=`${r}/items`,y=`${o}/${l}`;return Y(e,t,f,y,i.items,u)&&t.AddIndex(l)})}function bb(e,t,r,o){return Sm(r)?vv(e,t,r,o):$v(e,t,r,o)}function Ab(e,t,r,o,i,a){return Sm(i)?Dv(e,t,r,o,i,a):Gv(e,t,r,o,i,a)}function jv(e){return Tn(e)}function lu(e,t,r,o){if(!jv(r))return!0;let i=o.reduce((a,c)=>D(e,t,r.contains,c)?++a:a,0);return s.IsLessEqualThan(i,r.maxContains)}function Ob(e,t,r,o,i,a){let c=_n(i)?i.minContains:1;return lu(e,t,i,a)||t.AddError({keyword:"contains",schemaPath:r,instancePath:o,params:{minContains:c,maxContains:i.maxContains}})}function du(e,t,r,o){return s.IsLessEqualThan(o,r.maximum)}function Sb(e,t,r,o,i,a){return du(e,t,i,a)||t.AddError({keyword:"maximum",schemaPath:r,instancePath:o,params:{comparison:"<=",limit:i.maximum}})}function fu(e,t,r,o){return s.IsLessEqualThan(o.length,r.maxItems)}function xb(e,t,r,o,i,a){return fu(e,t,i,a)||t.AddError({keyword:"maxItems",schemaPath:r,instancePath:o,params:{limit:i.maxItems}})}function gu(e,t,r,o){return s.IsMaxLength(o,r.maxLength)}function Rb(e,t,r,o,i,a){return gu(e,t,i,a)||t.AddError({keyword:"maxLength",schemaPath:r,instancePath:o,params:{limit:i.maxLength}})}function yu(e,t,r,o){return s.IsLessEqualThan(s.Keys(o).length,r.maxProperties)}function Cb(e,t,r,o,i,a){return yu(e,t,i,a)||t.AddError({keyword:"maxProperties",schemaPath:r,instancePath:o,params:{limit:i.maxProperties}})}function Fv(e){return Tn(e)}function hu(e,t,r,o){if(!Fv(r))return!0;let i=o.reduce((a,c)=>D(e,t,r.contains,c)?++a:a,0);return s.IsGreaterEqualThan(i,r.minContains)}function Pb(e,t,r,o,i,a){return hu(e,t,i,a)||t.AddError({keyword:"contains",schemaPath:r,instancePath:o,params:{minContains:i.minContains}})}function Eu(e,t,r,o){return s.IsGreaterEqualThan(o,r.minimum)}function Ub(e,t,r,o,i,a){return Eu(e,t,i,a)||t.AddError({keyword:"minimum",schemaPath:r,instancePath:o,params:{comparison:">=",limit:i.minimum}})}function Tu(e,t,r,o){return s.IsGreaterEqualThan(o.length,r.minItems)}function Nb(e,t,r,o,i,a){return Tu(e,t,i,a)||t.AddError({keyword:"minItems",schemaPath:r,instancePath:o,params:{limit:i.minItems}})}function Iu(e,t,r,o){return s.IsMinLength(o,r.minLength)}function kb(e,t,r,o,i,a){return Iu(e,t,i,a)||t.AddError({keyword:"minLength",schemaPath:r,instancePath:o,params:{limit:i.minLength}})}function _u(e,t,r,o){return s.IsGreaterEqualThan(s.Keys(o).length,r.minProperties)}function wb(e,t,r,o,i,a){return _u(e,t,i,a)||t.AddError({keyword:"minProperties",schemaPath:r,instancePath:o,params:{limit:i.minProperties}})}function bu(e,t,r,o){return s.IsMultipleOf(o,r.multipleOf)}function Lb(e,t,r,o,i,a){return bu(e,t,i,a)||t.AddError({keyword:"multipleOf",schemaPath:r,instancePath:o,params:{multipleOf:i.multipleOf}})}function Au(e,t,r,o){let i=new st;return!D(e,i,r.not,o)&&t.Merge([i])}function Mb(e,t,r,o,i,a){return Au(e,t,i,a)||t.AddError({keyword:"not",schemaPath:r,instancePath:o,params:{}})}function vb(e,t,r,o){let i=r.oneOf.reduce((a,c)=>{let u=new st;return D(e,u,c,o)?[...a,u]:a},[]);return s.IsEqual(i.length,1)&&t.Merge(i)}function Db(e,t,r,o,i,a){let c=[],u=[],l=i.oneOf.reduce((y,E,S)=>{let fe=new je,Re=`${r}/oneOf/${S}`,br=Y(e,fe,Re,o,E,a);return br&&u.push(S),br||c.push(fe),br?[...y,fe]:y},[]),f=s.IsEqual(l.length,1)&&t.Merge(l);return!f&&s.IsEqual(u.length,0)&&c.forEach(y=>y.GetErrors().forEach(E=>t.AddError(E))),f||t.AddError({keyword:"oneOf",schemaPath:r,instancePath:o,params:{passingSchemas:u}})}function Ou(e,t,r,o){return(s.IsString(r.pattern)?new RegExp(r.pattern):r.pattern).test(o)}function $b(e,t,r,o,i,a){return Ou(e,t,i,a)||t.AddError({keyword:"pattern",schemaPath:r,instancePath:o,params:{pattern:i.pattern}})}function Gb(e,t,r,o){return s.Every(s.Entries(r.patternProperties),0,([i,a])=>{let c=new RegExp(i);return s.Every(s.Entries(o),0,([u,l])=>!c.test(u)||D(e,t,a,l)&&t.AddKey(u))})}function jb(e,t,r,o,i,a){return s.EveryAll(s.Entries(i.patternProperties),0,([c,u])=>{let l=`${r}/patternProperties/${c}`,f=new RegExp(c);return s.EveryAll(s.Entries(a),0,([y,E])=>{let S=`${o}/${y}`;return!f.test(y)||Y(e,t,l,S,u,E)&&t.AddKey(y)})})}function Fb(e,t,r,o){return s.IsEqual(o.length,0)||s.Every(r.prefixItems,0,(i,a)=>s.IsLessEqualThan(o.length,a)||D(e,t,i,o[a])&&t.AddIndex(a))}function Bb(e,t,r,o,i,a){return s.IsEqual(a.length,0)||s.EveryAll(i.prefixItems,0,(c,u)=>{let l=`${r}/prefixItems/${u}`,f=`${o}/${u}`;return s.IsLessEqualThan(a.length,u)||Y(e,t,l,f,c,a[u])&&t.AddIndex(u)})}function Su(e,t){return e.includes(t)||At.Get().exactOptionalPropertyTypes}function xu(e,t){return s.IsUndefined(e[t])}function qb(e,t,r,o){let i=bn(r)?r.required:[];return s.Every(s.Entries(r.properties),0,([c,u])=>{let l=!s.HasPropertyKey(o,c)||D(e,t,u,o[c])&&t.AddKey(c);return Su(i,c)?l:xu(o,c)||l})}function Hb(e,t,r,o,i,a){let c=bn(i)?i.required:[];return s.EveryAll(s.Entries(i.properties),0,([l,f])=>{let y=`${r}/properties/${l}`,E=`${o}/${l}`,S=()=>!s.HasPropertyKey(a,l)||Y(e,t,y,E,f,a[l])&&t.AddKey(l);return Su(c,l)?S():xu(a,l)||S()})}function Kb(e,t,r,o){return s.Every(s.Keys(o),0,(i,a)=>D(e,t,r.propertyNames,i))}function zb(e,t,r,o,i,a){let c=[];return s.EveryAll(s.Keys(a),0,(l,f)=>{let y=`${o}/${l}`,E=`${r}/propertyNames`,S=new je,fe=Y(e,S,E,y,i.propertyNames,l);return fe||c.push(l),fe})||t.AddError({keyword:"propertyNames",schemaPath:r,instancePath:o,params:{propertyNames:c}})}function Vb(e,t,r,o){let i=e.RecursiveRef(r.$recursiveRef)??!1;return $(i)&&D(e,t,i,o)}function Yb(e,t,r,o,i,a){let c=e.RecursiveRef(i.$recursiveRef)??!1;return $(c)&&Y(e,t,"#",o,c,a)}function Zb(e,t,r,o){let i=e.Ref(r.$ref)??!1,a=new st,c=$(i)&&D(e,a,i,o);return c&&t.Merge([a]),c}function Xb(e,t,r,o,i,a){let c=e.Ref(i.$ref)??!1,u=new je,l=$(c)&&Y(e,u,"#",o,c,a);return l&&t.Merge([u]),l||u.GetErrors().forEach(f=>t.AddError(f)),l}function Jb(e,t,r,o){return s.Every(r.required,0,i=>s.HasPropertyKey(o,i))}function eA(e,t,r,o,i,a){let c=[];return s.EveryAll(i.required,0,l=>{let f=s.HasPropertyKey(a,l);return f||c.push(l),f})||t.AddError({keyword:"required",schemaPath:r,instancePath:o,params:{requiredProperties:c}})}function Ru(e,t,r,o,i){return s.IsEqual(r,"object")?s.IsObjectNotArray(i):s.IsEqual(r,"array")?s.IsArray(i):s.IsEqual(r,"boolean")?s.IsBoolean(i):s.IsEqual(r,"integer")?s.IsInteger(i):s.IsEqual(r,"number")?s.IsNumber(i):s.IsEqual(r,"null")?s.IsNull(i):s.IsEqual(r,"string")?s.IsString(i):s.IsEqual(r,"asyncIterator")?s.IsAsyncIterator(i):s.IsEqual(r,"bigint")?s.IsBigInt(i):s.IsEqual(r,"constructor")?s.IsConstructor(i):s.IsEqual(r,"function")?s.IsFunction(i):s.IsEqual(r,"iterator")?s.IsIterator(i):s.IsEqual(r,"symbol")?s.IsSymbol(i):s.IsEqual(r,"undefined")?s.IsUndefined(i):s.IsEqual(r,"void")?s.IsUndefined(i):!0}function tA(e,t,r,o,i){return r.some(a=>Ru(e,t,a,o,i))}function rA(e,t,r,o){return s.IsArray(r.type)?tA(e,t,r.type,r,o):Ru(e,t,r.type,r,o)}function nA(e,t,r,o,i,a){return(s.IsArray(i.type)?tA(e,t,i.type,i,a):Ru(e,t,i.type,i,a))||t.AddError({keyword:"type",schemaPath:r,instancePath:o,params:{type:i.type}})}function oA(e,t,r,o){let i=t.GetIndices();return s.Every(o,0,(a,c)=>(i.has(c)||D(e,t,r.unevaluatedItems,a))&&t.AddIndex(c))}function iA(e,t,r,o,i,a){let c=t.GetIndices(),u=[];return s.EveryAll(a,0,(f,y)=>{let E=new je,S=(c.has(y)||Y(e,E,r,o,i.unevaluatedItems,f))&&t.AddIndex(y);return S||u.push(y),S})||t.AddError({keyword:"unevaluatedItems",schemaPath:r,instancePath:o,params:{unevaluatedItems:u}})}function aA(e,t,r,o){let i=t.GetKeys();return s.Every(s.Entries(o),0,([a,c])=>i.has(a)||D(e,t,r.unevaluatedProperties,c)&&t.AddKey(a))}function sA(e,t,r,o,i,a){let c=t.GetKeys(),u=[];return s.EveryAll(s.Entries(a),0,([f,y])=>{let E=new je,S=c.has(f)||Y(e,E,r,o,i.unevaluatedProperties,y)&&t.AddKey(f);return S||u.push(f),S})||t.AddError({keyword:"unevaluatedProperties",schemaPath:r,instancePath:o,params:{unevaluatedProperties:u}})}function cA(e){return!s.IsEqual(e.uniqueItems,!1)}function pA(e,t,r,o){if(!cA(r))return!0;let i=new Set(o.map(Ur.Hash)).size,a=o.length;return s.IsEqual(i,a)}function mA(e,t,r,o,i,a){if(!cA(i))return!0;let c=new Set,u=a.reduce((f,y,E)=>{let S=Ur.Hash(y);return c.has(S)?[...f,E]:(c.add(S),f)},[]);return s.IsEqual(u.length,0)||t.AddError({keyword:"uniqueItems",schemaPath:r,instancePath:o,params:{duplicateItems:u}})}function D(e,t,r,o){e.Push(r);let i=Hs(r)?Gm(e,t,r,o):(!Dm(r)||rA(e,t,r,o))&&(!(s.IsObject(o)&&!s.IsArray(o))||(!bn(r)||Jb(e,t,r,o))&&(!lr(r)||X_(e,t,r,o))&&(!hm(r)||sb(e,t,r,o))&&(!Em(r)||pb(e,t,r,o))&&(!Tm(r)||ub(e,t,r,o))&&(!Ki(r)||Gb(e,t,r,o))&&(!zi(r)||qb(e,t,r,o))&&(!wm(r)||Kb(e,t,r,o))&&(!qi(r)||_u(e,t,r,o))&&(!Pm(r)||yu(e,t,r,o)))&&(!s.IsArray(o)||(!dm(r)||Q_(e,t,r,o))&&(!Tn(r)||Fm(e,t,r,o))&&(!So(r)||bb(e,t,r,o))&&(!Rm(r)||lu(e,t,r,o))&&(!Ks(r)||fu(e,t,r,o))&&(!_n(r)||hu(e,t,r,o))&&(!xo(r)||Tu(e,t,r,o))&&(!Ro(r)||Fb(e,t,r,o))&&(!Co(r)||pA(e,t,r,o)))&&(!s.IsString(o)||(!Fi(r)||uu(e,t,r,o))&&(!Cm(r)||gu(e,t,r,o))&&(!Bi(r)||Iu(e,t,r,o))&&(!Hi(r)||Ou(e,t,r,o)))&&(!(s.IsNumber(o)||s.IsBigInt(o))||(!Am(r)||qm(e,t,r,o))&&(!dr(r)||Hm(e,t,r,o))&&(!xm(r)||du(e,t,r,o))&&(!fr(r)||Eu(e,t,r,o))&&(!Um(r)||bu(e,t,r,o)))&&(!Lm(r)||Vb(e,t,r,o))&&(!Mm(r)||Zb(e,t,r,o))&&(!um(r)||H_(e,t,r,o))&&(!ym(r)||jm(e,t,r,o))&&(!bm(r)||Bm(e,t,r,o))&&(!Om(r)||Ib(e,t,r,o))&&(!Nm(r)||Au(e,t,r,o))&&(!fm(r)||eb(e,t,r,o))&&(!gm(r)||rb(e,t,r,o))&&(!km(r)||vb(e,t,r,o))&&(!Vs(r)||!s.IsArray(o)||oA(e,t,r,o))&&(!Ys(r)||!s.IsObject(o)||aA(e,t,r,o))&&(!lm(r)||z_(e,t,r,o));return e.Pop(r),i}function Y(e,t,r,o,i,a){e.Push(i);let c=Hs(i)?ob(e,t,r,o,i,a):!!(+(!Dm(i)||nA(e,t,r,o,i,a))&+(!(s.IsObject(a)&&!s.IsArray(a))||!!(+(!bn(i)||eA(e,t,r,o,i,a))&+(!lr(i)||J_(e,t,r,o,i,a))&+(!hm(i)||cb(e,t,r,o,i,a))&+(!Em(i)||mb(e,t,r,o,i,a))&+(!Tm(i)||lb(e,t,r,o,i,a))&+(!Ki(i)||jb(e,t,r,o,i,a))&+(!zi(i)||Hb(e,t,r,o,i,a))&+(!wm(i)||zb(e,t,r,o,i,a))&+(!qi(i)||wb(e,t,r,o,i,a))&+(!Pm(i)||Cb(e,t,r,o,i,a))))&+(!s.IsArray(a)||!!(+(!dm(i)||W_(e,t,r,o,i,a))&+(!Tn(i)||ab(e,t,r,o,i,a))&+(!So(i)||Ab(e,t,r,o,i,a))&+(!Rm(i)||Ob(e,t,r,o,i,a))&+(!Ks(i)||xb(e,t,r,o,i,a))&+(!_n(i)||Pb(e,t,r,o,i,a))&+(!xo(i)||Nb(e,t,r,o,i,a))&+(!Ro(i)||Bb(e,t,r,o,i,a))&+(!Co(i)||mA(e,t,r,o,i,a))))&+(!s.IsString(a)||!!(+(!Fi(i)||Tb(e,t,r,o,i,a))&+(!Cm(i)||Rb(e,t,r,o,i,a))&+(!Bi(i)||kb(e,t,r,o,i,a))&+(!Hi(i)||$b(e,t,r,o,i,a))))&+(!(s.IsNumber(a)||s.IsBigInt(a))||!!(+(!Am(i)||fb(e,t,r,o,i,a))&+(!dr(i)||gb(e,t,r,o,i,a))&+(!xm(i)||Sb(e,t,r,o,i,a))&+(!fr(i)||Ub(e,t,r,o,i,a))&+(!Um(i)||Lb(e,t,r,o,i,a))))&+(!Lm(i)||Yb(e,t,r,o,i,a))&+(!Mm(i)||Xb(e,t,r,o,i,a))&+(!um(i)||K_(e,t,r,o,i,a))&+(!ym(i)||ib(e,t,r,o,i,a))&+(!bm(i)||db(e,t,r,o,i,a))&+(!Om(i)||_b(e,t,r,o,i,a))&+(!Nm(i)||Mb(e,t,r,o,i,a))&+(!fm(i)||tb(e,t,r,o,i,a))&+(!gm(i)||nb(e,t,r,o,i,a))&+(!km(i)||Db(e,t,r,o,i,a))&+(!Vs(i)||!s.IsArray(a)||iA(e,t,r,o,i,a))&+(!Ys(i)||!s.IsObject(a)||sA(e,t,r,o,i,a)))&&(!lm(i)||V_(e,t,r,o,i,a));return e.Pop(i),c}var On={};Pt(On,{Ref:()=>eD});var gr={};Pt(gr,{Delete:()=>Yv,Get:()=>zv,Has:()=>Kv,Indices:()=>Wi,Set:()=>Vv});function uA(e){if(e.length===0)throw Error("Cannot set root")}function lA(e){if(!s.IsObject(e))throw Error("Cannot set value")}function Bv(e){return/^(0|[1-9]\d*)$/.test(e)}function dA(e){return[e.slice(0,e.length-1),e.slice(e.length-1)[0]]}function qv(e,t){return s.IsObject(t)&&s.HasPropertyKey(t,e)}function Hv(e,t){return s.IsObject(t)?t[e]:void 0}function Cu(e,t){return e.reduce((r,o)=>Hv(o,r),t)}function Wi(e){if(s.IsEqual(e.length,0))return[];let t=e.split("/").map(r=>r.replace(/~1/g,"/").replace(/~0/g,"~"));return t.length>0&&t[0]===""?t.slice(1):t}function Kv(e,t){let r=e;return Wi(t).every(o=>qv(o,r)?(r=r[o],!0):!1)}function zv(e,t){let r=Wi(t);return Cu(r,e)}function Vv(e,t,r){let o=Wi(t);uA(o);let[i,a]=dA(o),c=Cu(i,e);return lA(c),c[a]=r,e}function Yv(e,t){let r=Wi(t);uA(r);let[o,i]=dA(r),a=Cu(o,e);return lA(a),s.IsArray(a)&&Bv(i)?a.splice(+i,1):delete a[i],e}function Qv(e,t,r){if(e.$id===r.hash)return e;let o=new URL(e.$id,t.href),i=new URL(r.href,t.href);if(s.IsEqual(o.pathname,i.pathname))return r.hash.startsWith("#")?fA(e,t,r):e}function Wv(e,t,r){let o=new URL(`#${e.$anchor}`,t.href),i=new URL(r.href,t.href);if(s.IsEqual(o.href,i.href))return e}function fA(e,t,r){return r.href.endsWith("#")?e:r.hash.startsWith("#")?gr.Get(e,decodeURIComponent(r.hash.slice(1))):void 0}function Zv(e,t,r){if(In(e)){let o=Qv(e,t,r);if(!s.IsUndefined(o))return o}if(ji(e)){let o=Wv(e,t,r);if(!s.IsUndefined(o))return o}return fA(e,t,r)}function Xv(e,t,r){return e.reduce((o,i)=>{let a=Pu(i,t,r);return s.IsUndefined(a)?o:a},void 0)}function Jv(e,t,r){return s.Keys(e).reduce((o,i)=>{let a=Pu(e[i],t,r);return s.IsUndefined(a)?o:a},void 0)}function Pu(e,t,r){if(t=ur(e)&&In(e)?new URL(e.$id,t.href):t,ur(e)){let o=Zv(e,t,r);if(!s.IsUndefined(o))return o}if(s.IsArray(e))return Xv(e,t,r);if(s.IsObject(e))return Jv(e,t,r)}function eD(e,t){let r=new URL("http://unknown"),o=In(e)?new URL(e.$id,r.href):r,i=new URL(t,o.href);return Pu(e,o,i)}var Sn=class{constructor(t,r){this.context=t,this.schema=r,this.ids=[],this.anchors=[],this.recursiveAnchors=[],this.dynamicAnchors=[]}BaseURL(){return this.ids.reduce((t,r)=>new URL(r.$id,t),new URL("http://unknown"))}Base(){return this.ids[this.ids.length-1]??this.schema}Push(t){ur(t)&&(In(t)&&this.ids.push(t),ji(t)&&this.anchors.push(t),zs(t)&&this.recursiveAnchors.push(t),Im(t)&&this.dynamicAnchors.push(t))}Pop(t){ur(t)&&(In(t)&&this.ids.pop(),ji(t)&&this.anchors.pop(),zs(t)&&this.recursiveAnchors.pop(),Im(t)&&this.dynamicAnchors.pop())}FromContext(t){return s.HasPropertyKey(this.context,t)?this.context[t]:void 0}FromRef(t){return t.startsWith("#")?On.Ref(this.Base(),t):On.Ref(this.schema,t)}Ref(t){return this.FromContext(t)??this.FromRef(t)}RecursiveRef(t){return zs(this.Base())?On.Ref(this.recursiveAnchors[0],t):On.Ref(this.Base(),t)}};function gA(...e){let[t,r,o]=ie.Match(e,{3:(c,u,l)=>[c,u,l],2:(c,u)=>[{},c,u]}),i=new Sn(t,r),a=new st;return D(i,a,r,o)}function yA(...e){let[t,r,o]=ie.Match(e,{3:(y,E,S)=>[y,E,S],2:(y,E)=>[{},y,E]}),i=At.Get(),a=tf(),c=[],u=new Sn(t,r),l=new Vi(y=>{if(!s.IsGreaterEqualThan(c.length,i.maxErrors))return c.push({...y,message:a(y)})});return[Y(u,l,"#","",r,o),c]}function me(...e){let[t,r,o]=ie.Match(e,{3:(i,a,c)=>[i,a,c],2:(i,a)=>[{},i,a]});return gA(t,r,o)}function Kr(...e){let[t,r,o]=ie.Match(e,{3:(c,u,l)=>[c,u,l],2:(c,u)=>[{},c,u]}),[i,a]=yA(t,r,o);return a}var zr=class extends Error{constructor(t,r,o){super(t),Object.defineProperty(this,"cause",{value:{source:t,errors:o,value:r},writable:!1,configurable:!1,enumerable:!1})}};function hA(e,t,r){return s.IsArray(r)?r.map(o=>Be(e,t.items,o)):r}function EA(e,t,r){return t.Clean(r)}function TA(e,t,r){return Be({...e,...t.$defs},Ce(t.$ref),r)}function rD(e){let t=s.HasPropertyKey(e,"unevaluatedProperties")?{additionalProperties:e.unevaluatedProperties}:{},r=$t(e);return M(r)?Ms(r,t):r}function IA(e,t,r){let o=rD(t);return Be(e,o,r)}function Qs(e){return s.HasPropertyKey(e,"additionalProperties")?e.additionalProperties:void 0}function _A(e,t,r){if(!s.IsObject(r)||s.IsArray(r))return r;let o=Qs(t);for(let i of s.Keys(r)){if(s.HasPropertyKey(t.properties,i)){r[i]=Be(e,t.properties[i],r[i]);continue}if(s.IsBoolean(o)&&s.IsEqual(o,!0)||A(o)&&me(e,o,r[i])){r[i]=Be(e,o,r[i]);continue}delete r[i]}return r}function bA(e,t,r){if(!s.IsObject(r))return r;let o=Qs(t),[i,a]=[new RegExp(yt(t)),Ve(t)];for(let c of s.Keys(r)){if(i.test(c)){r[c]=Be(e,a,r[c]);continue}if(s.IsBoolean(o)&&s.IsEqual(o,!0)||A(o)&&me(e,o,r[c])){r[c]=Be(e,o,r[c]);continue}delete r[c]}return r}function AA(e,t,r){return s.HasPropertyKey(e,t.$ref)?Be(e,e[t.$ref],r):r}function OA(e,t,r){if(!s.IsArray(r))return r;let o=Math.min(r.length,t.items.length);for(let i=0;i<o;i++)r[i]=Be(e,t.items[i],r[i]);return s.IsGreaterThan(r.length,o)?r.slice(0,o):r}function nD(e){let t={};for(let r of Object.getOwnPropertyNames(e))t[r]=le(e[r]);for(let r of Object.getOwnPropertySymbols(e))t[r]=le(e[r]);return t}function oD(e){return s.IsClassInstance(e)?e:nD(e)}function iD(e){return e.map(t=>le(t))}function aD(e){return e.slice()}function sD(e){return new Map(le([...e.entries()]))}function cD(e){return new Set(le([...e.values()]))}function le(e){return rt.IsTypeArray(e)?aD(e):rt.IsMap(e)?sD(e):rt.IsSet(e)?cD(e):s.IsArray(e)?iD(e):s.IsObject(e)?oD(e):e}function SA(e,t,r){for(let o of t.anyOf){let i=Be(e,o,le(r));if(me(e,o,i))return i}return r}function Be(e,t,r){return ee(t)?hA(e,t,r):Ot(t)?EA(e,t,r):pe(t)?TA(e,t,r):U(t)?IA(e,t,r):M(t)?_A(e,t,r):Te(t)?bA(e,t,r):ce(t)?AA(e,t,r):V(t)?OA(e,t,r):b(t)?SA(e,t,r):r}function Rn(...e){let[t,r,o]=ie.Match(e,{3:(i,a,c)=>[i,a,c],2:(i,a)=>[{},i,a]});return Be(t,r,o)}function xA(e,t,r){return s.IsArray(r)?r.map(o=>Ue(e,t.items,o)):r}function RA(e,t,r){return t.Convert(r)}var ne={};Pt(ne,{Fail:()=>Cn,IsOk:()=>Nu,Ok:()=>P,TryBigInt:()=>ku,TryBoolean:()=>RD,TryNull:()=>LD,TryNumber:()=>qD,TryString:()=>WD,TryUndefined:()=>n$});function Nu(e){return s.IsObject(e)&&s.HasPropertyKey(e,"value")}function P(e){return{value:e}}function Cn(){}function pD(e){return P(e)}function mD(e){return s.IsEqual(e,!0)?P(BigInt(1)):P(BigInt(0))}function uD(e){return P(BigInt(Math.trunc(e)))}function lD(e){return P(BigInt(0))}var dD=/^-?(0|[1-9]\d*)n$/,fD=/^-?(0|[1-9]\d*)\.\d+$/,gD=/^-?(0|[1-9]\d*)$/;function yD(e){return dD.test(e)}function hD(e){return fD.test(e)}function ED(e){return gD.test(e)}function TD(e){let t=e.toLowerCase();return yD(e)?P(BigInt(e.slice(0,e.length-1))):hD(e)?P(BigInt(e.split(".")[0])):ED(e)?P(BigInt(e)):s.IsEqual(t,"false")?P(BigInt(0)):s.IsEqual(t,"true")?P(BigInt(1)):void 0}function ID(e){return P(BigInt(0))}function ku(e){return s.IsBigInt(e)?pD(e):s.IsBoolean(e)?mD(e):s.IsNumber(e)?uD(e):s.IsNull(e)?lD(e):s.IsString(e)?TD(e):s.IsUndefined(e)?ID(e):void 0}function _D(e){return s.IsEqual(e,BigInt(0))?P(!1):s.IsEqual(e,BigInt(1))?P(!0):void 0}function bD(e){return P(e)}function AD(e){return s.IsEqual(e,0)?P(!1):s.IsEqual(e,1)?P(!0):void 0}function OD(e){return P(!1)}function SD(e){return s.IsEqual(e.toLowerCase(),"false")?P(!1):s.IsEqual(e.toLowerCase(),"true")?P(!0):s.IsEqual(e,"0")?P(!1):s.IsEqual(e,"1")?P(!0):void 0}function xD(e){return P(!1)}function RD(e){return s.IsBigInt(e)?_D(e):s.IsBoolean(e)?bD(e):s.IsNumber(e)?AD(e):s.IsNull(e)?OD(e):s.IsString(e)?SD(e):s.IsUndefined(e)?xD(e):void 0}function CD(e){return s.IsEqual(e,BigInt(0))?P(null):void 0}function PD(e){return s.IsEqual(e,!1)?P(null):void 0}function UD(e){return s.IsEqual(e,0)?P(null):void 0}function ND(e){return P(null)}function kD(e){let t=e.toLowerCase();return s.IsEqual(t,"undefined")||s.IsEqual(t,"null")||s.IsEqual(e,"")||s.IsEqual(e,"0")?P(null):void 0}function wD(e){return P(null)}function LD(e){return s.IsBigInt(e)?CD(e):s.IsBoolean(e)?PD(e):s.IsNumber(e)?UD(e):s.IsNull(e)?ND(e):s.IsString(e)?kD(e):s.IsUndefined(e)?wD(e):void 0}var MD=BigInt(Number.MAX_SAFE_INTEGER),vD=BigInt(Number.MIN_SAFE_INTEGER);function DD(e){return e<=MD&&e>=vD}function CA(e){return DD(e)?P(Number(e)):void 0}function $D(e){return e?P(1):P(0)}function GD(e){return P(e)}function jD(e){return P(0)}function FD(e){let t=+e;if(s.IsNumber(t))return P(t);let r=e.toLowerCase();if(s.IsEqual(r,"false"))return P(0);if(s.IsEqual(r,"true"))return P(1);let o=ku(e);return Nu(o)?CA(o.value):void 0}function BD(e){return P(0)}function qD(e){return s.IsBigInt(e)?CA(e):s.IsBoolean(e)?$D(e):s.IsNumber(e)?GD(e):s.IsNull(e)?jD(e):s.IsString(e)?FD(e):s.IsUndefined(e)?BD(e):void 0}function HD(e){return P(e.toString())}function KD(e){return P(e.toString())}function zD(e){return P(e.toString())}function VD(e){return P("null")}function YD(e){return P(e)}function QD(e){return P("")}function WD(e){return s.IsBigInt(e)?HD(e):s.IsBoolean(e)?KD(e):s.IsNumber(e)?zD(e):s.IsNull(e)?VD(e):s.IsString(e)?YD(e):s.IsUndefined(e)?QD(e):void 0}function ZD(e){return s.IsEqual(e,BigInt(0))?P(void 0):void 0}function XD(e){return s.IsEqual(e,!1)?P(void 0):void 0}function JD(e){return s.IsEqual(e,0)?P(void 0):void 0}function e$(e){return P(void 0)}function t$(e){let t=e.toLowerCase();return s.IsEqual(t,"undefined")||s.IsEqual(t,"null")||s.IsEqual(e,"")||s.IsEqual(e,"0")?P(void 0):void 0}function r$(e){return P(void 0)}function n$(e){return s.IsBigInt(e)?ZD(e):s.IsBoolean(e)?XD(e):s.IsNumber(e)?JD(e):s.IsNull(e)?e$(e):s.IsString(e)?t$(e):s.IsUndefined(e)?r$(e):void 0}function PA(e,t,r){if(s.IsBigInt(r))return r;let o=ne.TryBigInt(r);return ne.IsOk(o)?o.value:r}function UA(e,t,r){if(s.IsBoolean(r))return r;let o=ne.TryBoolean(r);return ne.IsOk(o)?o.value:r}function NA(e,t,r){return Ue({...e,...t.$defs},Ce(t.$ref),r)}function Ws(e,t,r){if(t.anyOf.some(c=>me(e,c,r)))return r;let a=t.anyOf.map(c=>Ue(e,c,le(r))).find(c=>me(e,t,c));return s.IsUndefined(a)?r:a}function kA(e,t,r){let o=un(t);return Ws(e,o,r)}function wA(e,t,r){if(s.IsInteger(r))return r;let o=ne.TryNumber(r);return ne.IsOk(o)?Math.trunc(o.value):r}function LA(e,t,r){let o=$t(t);return Ue(e,o,r)}function o$(e,t,r){let o=ne.TryBigInt(r);return ne.IsOk(o)&&s.IsEqual(t.const,o.value)?o.value:r}function i$(e,t,r){let o=ne.TryBoolean(r);return ne.IsOk(o)&&s.IsEqual(t.const,o.value)?o.value:r}function a$(e,t,r){let o=ne.TryNumber(r);return ne.IsOk(o)&&s.IsEqual(t.const,o.value)?o.value:r}function s$(e,t,r){let o=ne.TryString(r);return ne.IsOk(o)&&s.IsEqual(t.const,o.value)?o.value:r}function MA(e,t,r){return s.IsEqual(t.const,r)?r:mf(t)?o$(e,t,r):uf(t)?i$(e,t,r):Yn(t)?a$(e,t,r):Qn(t)?s$(e,t,r):B()}function vA(e,t,r){if(s.IsNull(r))return r;let o=ne.TryNull(r);return ne.IsOk(o)?o.value:r}function DA(e,t,r){if(s.IsNumber(r))return r;let o=ne.TryNumber(r);return ne.IsOk(o)?o.value:r}function Zs(e,t,r,o){let i=s.Keys(o);for(let[a,c]of t)for(let u of i)a.test(u)||(o[u]=Ue(e,r,o[u]));return o}function Zi(e,t,r){return Ne(e)&&s.IsUndefined(r[t])}function c$(e,t,r){let o=s.EntriesRegExp(t.properties),i=s.Keys(r);for(let[a,c]of o)for(let u of i)!a.test(u)||Zi(c,u,r)||(r[u]=Ue(e,c,r[u]));return s.HasPropertyKey(t,"additionalProperties")&&s.IsObject(t.additionalProperties)?Zs(e,o,t.additionalProperties,r):r}function $A(e,t,r){return s.IsObjectNotArray(r)?c$(e,t,r):r}function p$(e,t,r){let o=s.EntriesRegExp(t.patternProperties),i=s.Keys(r);for(let[a,c]of o)for(let u of i)a.test(u)&&(r[u]=Ue(e,c,r[u]));return s.HasPropertyKey(t,"additionalProperties")&&s.IsObject(t.additionalProperties)?Zs(e,o,t.additionalProperties,r):r}function GA(e,t,r){return s.IsObjectNotArray(r)?p$(e,t,r):r}function jA(e,t,r){return s.HasPropertyKey(e,t.$ref)?Ue(e,e[t.$ref],r):r}function FA(e,t,r){if(s.IsString(r))return r;let o=ne.TryString(r);return ne.IsOk(o)?o.value:r}function BA(e,t,r){let o=Ye(t.pattern);return Ue(e,o,r)}function qA(e,t,r){if(!s.IsArray(r))return r;for(let o=0;o<Math.min(t.items.length,r.length);o++)r[o]=Ue(e,t.items[o],r[o]);return r}function HA(e,t,r){if(s.IsUndefined(r))return r;let o=ne.TryUndefined(r);return ne.IsOk(o)?o.value:r}function KA(e,t,r){if(s.IsUndefined(r))return r;let o=ne.TryUndefined(r);return ne.IsOk(o)?void 0:r}function Ue(e,t,r){return ee(t)?xA(e,t,r):Ot(t)?RA(e,t,r):gt(t)?PA(e,t,r):it(t)?UA(e,t,r):pe(t)?NA(e,t,r):Oe(t)?kA(e,t,r):De(t)?wA(e,t,r):U(t)?LA(e,t,r):Z(t)?MA(e,t,r):Kt(t)?vA(e,t,r):Ee(t)?DA(e,t,r):M(t)?$A(e,t,r):Te(t)?GA(e,t,r):ce(t)?jA(e,t,r):Pe(t)?FA(e,t,r):Se(t)?BA(e,t,r):V(t)?qA(e,t,r):Qt(t)?HA(e,t,r):b(t)?Ws(e,t,r):ht(t)?KA(e,t,r):r}function Vr(...e){let[t,r,o]=ie.Match(e,{3:(i,a,c)=>[i,a,c],2:(i,a)=>[{},i,a]});return Ue(t,r,o)}function zA(e,t,r){if(!s.IsArray(r))return r;for(let o=0;o<r.length;o++)r[o]=Me(e,t.items,r[o]);return r}function VA(e,t,r){return t.Default(r)}function YA(e,t,r){return Me({...e,...t.$defs},Ce(t.$ref),r)}function QA(e,t){return s.IsUndefined(t)?s.IsFunction(e.default)?e.default():le(e.default):t}function WA(e,t,r){let o=$t(t);return Me(e,o,r)}function ZA(e,t,r){if(!s.IsObject(r))return r;let o=s.Keys(t.properties);for(let i of o){let a=Me(e,t.properties[i],r[i]);s.IsUndefined(a)&&(Ne(t.properties[i])||!s.HasPropertyKey(t.properties[i],"default"))||(r[i]=Me(e,t.properties[i],r[i]))}if(!lr(t)||s.IsBoolean(t.additionalProperties))return r;for(let i of s.Keys(r))o.includes(i)||(r[i]=Me(e,t.additionalProperties,r[i]));return r}function XA(e,t,r){if(!s.IsObject(r))return r;let[o,i]=[new RegExp(yt(t)),Ve(t)];for(let a of s.Keys(r))o.test(a)&&Rt(i)&&(r[a]=Me(e,i,r[a]));if(!lr(t))return r;for(let a of s.Keys(r))o.test(a)||(r[a]=Me(e,t.additionalProperties,r[a]));return r}function JA(e,t,r){return s.HasPropertyKey(e,t.$ref)?Me(e,e[t.$ref],r):r}function eO(e,t,r){if(!s.IsArray(r))return r;let[o,i]=[t.items,Math.max(t.items.length,r.length)];for(let a=0;a<i;a++)a<o.length&&(r[a]=Me(e,o[a],r[a]));return r}function tO(e,t,r){for(let o of t.anyOf){let i=Me(e,o,le(r));if(me(e,o,i))return i}return r}function Me(e,t,r){let o=Rt(t)?QA(t,r):r;return ee(t)?zA(e,t,o):Ot(t)?VA(e,t,o):pe(t)?YA(e,t,o):U(t)?WA(e,t,o):M(t)?ZA(e,t,o):Te(t)?XA(e,t,o):ce(t)?JA(e,t,o):V(t)?eO(e,t,o):b(t)?tO(e,t,o):o}function Pn(...e){let[t,r,o]=ie.Match(e,{3:(i,a,c)=>[i,a,c],2:(i,a)=>[{},i,a]});return Me(t,r,o)}function No(e){return(...t)=>{let[r,o,i]=ie.Match(t,{3:(a,c,u)=>[a,c,u],2:(a,c)=>[{},a,c]});return e.reduce((a,c)=>c(r,o,a),i)}}function m$(e,t,r){return t["~codec"].decode(r)}function u$(e,t,r){return t["~codec"].encode(r)}function be(e,t,r,o){return an(r)?s.IsEqual(e,"Decode")?m$(t,r,o):u$(t,r,o):o}function l$(e,t,r,o){if(!s.IsArray(o))return B();for(let i=0;i<o.length;i++)o[i]=ge(e,t,r.items,o[i]);return be(e,t,r,o)}function d$(e,t,r,o){let i=be(e,t,r,o);if(!s.IsArray(i))return i;for(let a=0;a<i.length;a++)i[a]=ge(e,t,r.items,i[a]);return i}function rO(e,t,r,o){return s.IsEqual(e,"Decode")?l$(e,t,r,o):d$(e,t,r,o)}function nO(e,t,r,o){return o=ge(e,{...t,...r.$defs},Ce(r.$ref),o),be(e,t,r,o)}function f$(e,t,r,o){for(let i of r.allOf)o=ge(e,t,i,o);return be(e,t,r,o)}function g$(e,t,r,o){let i=be(e,t,r,o);for(let a of r.allOf)i=ge(e,t,a,i);return i}function oO(e,t,r,o){return s.IsEqual(e,"Decode")?f$(e,t,r,o):g$(e,t,r,o)}function y$(e,t,r,o){if(!s.IsObjectNotArray(o))return B();for(let i of s.Keys(r.properties))!s.HasPropertyKey(o,i)||Zi(r.properties[i],i,o)||(o[i]=ge(e,t,r.properties[i],o[i]));return be(e,t,r,o)}function h$(e,t,r,o){let i=be(e,t,r,o);if(!s.IsObjectNotArray(i))return i;for(let a of s.Keys(r.properties))!s.HasPropertyKey(i,a)||Zi(r.properties[a],a,i)||(i[a]=ge(e,t,r.properties[a],i[a]));return i}function iO(e,t,r,o){return s.IsEqual(e,"Decode")?y$(e,t,r,o):h$(e,t,r,o)}function E$(e,t,r,o){if(!s.IsObjectNotArray(o))return B();let i=new RegExp(yt(r));for(let a of s.Keys(o))i.test(a)||B(),o[a]=ge(e,t,Ve(r),o[a]);return be(e,t,r,o)}function T$(e,t,r,o){let i=be(e,t,r,o);if(!s.IsObjectNotArray(i))return i;let a=new RegExp(yt(r));for(let c of s.Keys(i))a.test(c)&&(i[c]=ge(e,t,Ve(r),i[c]));return i}function aO(e,t,r,o){return s.IsEqual(e,"Decode")?E$(e,t,r,o):T$(e,t,r,o)}function sO(e,t,r,o){return o=s.HasPropertyKey(t,r.$ref)?ge(e,t,t[r.$ref],o):o,be(e,t,r,o)}function I$(e,t,r,o){if(!s.IsArray(o))return B();for(let i=0;i<Math.min(r.items.length,o.length);i++)o[i]=ge(e,t,r.items[i],o[i]);return be(e,t,r,o)}function _$(e,t,r,o){let i=be(e,t,r,o);if(!s.IsArray(i))return o;for(let a=0;a<Math.min(r.items.length,i.length);a++)i[a]=ge(e,t,r.items[a],i[a]);return i}function cO(e,t,r,o){return s.IsEqual(e,"Decode")?I$(e,t,r,o):_$(e,t,r,o)}function b$(e,t,r,o){for(let i of r.anyOf){if(!me(t,i,o))continue;let a=ge(e,t,i,o);return be(e,t,r,a)}return B()}function A$(e,t,r,o){let i=be(e,t,r,o);for(let a of r.anyOf){let c=ge(e,t,a,le(i));if(me(t,a,c))return c}return i}function pO(e,t,r,o){return s.IsEqual(e,"Decode")?b$(e,t,r,o):A$(e,t,r,o)}function ge(e,t,r,o){return ee(r)?rO(e,t,r,o):pe(r)?nO(e,t,r,o):U(r)?oO(e,t,r,o):M(r)?iO(e,t,r,o):Te(r)?aO(e,t,r,o):ce(r)?sO(e,t,r,o):V(r)?cO(e,t,r,o):b(r)?pO(e,t,r,o):be(e,t,r,o)}var wu=class extends zr{constructor(t,r){super("Decode",t,r)}};function O$(e,t,r){if(!me(e,t,r))throw new wu(r,Kr(e,t,r));return r}function S$(e,t,r){return ge("Decode",e,t,r)}var iwe=No([(e,t,r)=>le(r),(e,t,r)=>Pn(e,t,r),(e,t,r)=>Vr(e,t,r),(e,t,r)=>Rn(e,t,r),(e,t,r)=>O$(e,t,r),(e,t,r)=>S$(e,t,r)]);var Lu=class extends zr{constructor(t,r){super("Encode",t,r)}};function x$(e,t,r){if(!me(e,t,r))throw new Lu(r,Kr(e,t,r));return r}function R$(e,t,r){return ge("Encode",e,t,r)}var hwe=No([(e,t,r)=>le(r),(e,t,r)=>R$(e,t,r),(e,t,r)=>Pn(e,t,r),(e,t,r)=>Vr(e,t,r),(e,t,r)=>Rn(e,t,r),(e,t,r)=>x$(e,t,r)]);var kt=class extends Error{constructor(t,r){super(r),this.type=t}};function mO(e,t){return s.IsFunction(t.default)?t.default(t):s.IsObject(t.default)?le(t.default):t.default}function uO(e,t){if(Co(t)&&!Rt(t))throw new kt(t,"Arrays with uniqueItems constraints must specify a default annotation");let r=xo(t)?t.minItems:0;return Array.from({length:r},()=>ye(e,t.items))}async function*C$(){}function lO(e,t){return C$()}function dO(e,t){return t.Create()}function fO(e,t){return dr(t)?BigInt(t.exclusiveMinimum)+BigInt(1):fr(t)?BigInt(t.minimum):BigInt(0)}function gO(e,t){return!1}function yO(e,t){let r=ye(e,t.instanceType);return class{constructor(){Object.assign(this,r)}}}function hO(e,t){return ye({...e,...t.$defs},Ce(t.$ref))}function EO(e,t){return ye(e,un(t))}function TO(e,t){let r=ye(e,t.returnType);return()=>r}function IO(e,t){return dr(t)&&s.IsNumber(t.exclusiveMinimum)?t.exclusiveMinimum+1:fr(t)?t.minimum:0}function _O(e,t){return ye(e,$t(t))}function*P$(){}function bO(e,t){return P$()}function AO(e,t){return t.const}function OO(e,t){throw new kt(t,"Cannot create TNever types")}function SO(e,t){return null}function xO(e,t){return dr(t)&&s.IsNumber(t.exclusiveMinimum)?t.exclusiveMinimum+1:fr(t)?t.minimum:0}function RO(e,t){return(s.IsUndefined(t.required)?[]:t.required).reduce((o,i)=>({...o,[i]:ye(e,t.properties[i])}),{})}function CO(e,t){return Promise.resolve(ye(e,t.item))}function PO(e,t){if(qi(t)&&!Rt(t))throw new kt(t,"Record with the minProperties constraint must have a default annotation");return{}}function UO(e,t){return s.HasPropertyKey(e,t.$ref)?ye(e,e[t.$ref]):(()=>{throw new kt(t,"Unable to deref Ref")})()}function NO(e,t){if((Hi(t)||Fi(t))&&!Rt(t))throw Error("Strings with format or pattern constraints must specify default");let o=Bi(t)?t.minLength:0;return"".padEnd(o)}function kO(e,t){return Symbol()}function wO(e,t){let r=Ye(t.pattern);if(Pe(r))throw new kt(t,"Unable to create TemplateLiteral due to infinite type expansion");return ye(e,r)}function LO(e,t){return Array.from({length:t.minItems},(r,o)=>ye(e,t.items[o]))}function MO(e,t){if(s.IsEqual(t.anyOf.length,0))throw Error("Unable to create Union with no variants");return ye(e,t.anyOf[0])}function ye(e,t){return Rt(t)?mO(e,t):ee(t)?uO(e,t):Xe(t)?lO(e,t):Ot(t)?dO(e,t):gt(t)?fO(e,t):it(t)?gO(e,t):ke(t)?yO(e,t):pe(t)?hO(e,t):Oe(t)?EO(e,t):we(t)?TO(e,t):De(t)?IO(e,t):U(t)?_O(e,t):Je(t)?bO(e,t):Z(t)?AO(e,t):or(t)?OO(e,t):Kt(t)?SO(e,t):Ee(t)?xO(e,t):M(t)?RO(e,t):ze(t)?CO(e,t):Te(t)?PO(e,t):ce(t)?UO(e,t):Pe(t)?NO(e,t):zt(t)?kO(e,t):Se(t)?wO(e,t):V(t)?LO(e,t):Qt(t)?void 0:b(t)?MO(e,t):ht(t)?void 0:void 0}function er(...e){let[t,r]=ie.Match(e,{2:(o,i)=>[o,i],1:o=>[{},o]});return ye(t,r)}var Mu=class extends zr{constructor(t,r){super("Parse",t,r)}};function U$(e,t,r){if(!me(e,t,r))throw new Mu(r,Kr(e,t,r));return r}var b0e=No([(e,t,r)=>le(r),(e,t,r)=>Pn(e,t,r),(e,t,r)=>Vr(e,t,r),(e,t,r)=>Rn(e,t,r),(e,t,r)=>U$(e,t,r)]);var k$=N({type:z("insert"),path:lt(),value:He()}),w$=Object({type:z("update"),path:lt(),value:He()}),L$=N({type:z("delete"),path:lt()}),P0e=G([k$,w$,L$]);function ko(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]:er(t)}function Xi(e,t,r,o,i){e.command(t).description(r).option("-f, --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){oe(ko(o));return}let c=Oo(a),u=await i()(o,{body:c});oe(u)})}function $O(e,t){let r=e.command("experimental").description("Experimental commands \u2014 unstable, subject to change without notice");Xi(r,"promql","Run a PromQL query (experimental)",B_,t)}var $$=`/${"v1"}/feedback`,G$=n.Object({id:n.String({description:"Identifier of the recorded feedback (matches the API request ID)."})},{$id:"Feedback",description:"A recorded piece of feedback"}),j$=n.Object({content:m({allowEmpty:!1,type:"long",description:"The feedback message."})}),GO=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:["feedback"],url:$$,method:"POST",body:j$,response:G$});function jO(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 r=>{let o=await t()(GO,{body:{content:r.join(" ")}});oe(o)})}var F$={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"]},"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"]},"crawler-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:["admin"]},"asset-change":{read:["public_viewer","public_editor","admin"],write:[]},"inventory-settings":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},dashboard:{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:{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"]},"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"]},service:{read:["public_viewer","public_editor","admin"],write:[]},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:[]}},B$={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"]},"audit-log":{read:["viewer","editor","admin"],write:[]},"asset-change":{read:["viewer","editor","admin"],write:[]},"custom-usage-tag":{read:[],write:[]},"cluster-integration-config":{read:[],write:[]},"crawler-integration-config":{read:[],write:[]},"explorer-saved-view":{read:["viewer","editor","admin"],write:["viewer","editor","admin"]},"operation-api-key":{read:["viewer","editor","admin"],write:["admin"]},"inventory-settings":{read:["viewer","editor","admin"],write:["editor","admin"]},dashboard:{read:["viewer","editor","admin"],write:["editor","admin"]},"dashboard-report":{read:["viewer","editor","admin"],write:[]},inventory:{read:["viewer","editor","admin"],write:[]},log:{read:["viewer","editor","admin"],write:[]},"log-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"]},"notification-silence":{read:["viewer","editor","admin"],write:["editor","admin"]},"saml-config":{read:["admin"],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:[]},service:{read:["viewer","editor","admin"],write:[]},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:[]}},q$={user:F$,team:B$};function Du(e){return FO(e,"team")}function $u(e){return FO(e,"user")}function FO(e,t){let r=[],o=q$[t];for(let[i,a]of Object.entries(o))for(let[c,u]of Object.entries(a))u.includes(e)&&r.push({actionType:c,resourceType:i});return r}var R$e={admin:{name:"Global admin",description:"Full control across the organization. Can view and modify everything, including private teams.",permissions:$u("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:$u("public_editor"),roleKey:"public_editor"},public_viewer:{name:"Public viewer",description:"Read-only access to public team data. Cannot make changes.",permissions:$u("public_viewer"),roleKey:"public_viewer"},teams_only:{name:"Teams only",description:"Only access data and assets in their own teams.",permissions:[],roleKey:"teams_only"}},C$e={admin:{name:"Team admin",description:"Full team control, manage assets, members, and settings.",permissions:Du("admin"),roleKey:"admin"},editor:{name:"Team editor",description:"Can view and update most assets (like dashboards, monitors).",permissions:Du("editor"),roleKey:"editor"},viewer:{name:"Team viewer",description:"Can view all team data but cannot make changes.",permissions:Du("viewer"),roleKey:"viewer"}};var Gu=["red","orange","amber","yellow","green","emerald","teal","cyan","sky","blue","indigo","purple","pink"],ju=["light","dark"];var H$={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)"}},BO=["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 L$e=H$.light.red.background;var qO=[{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-----
39
+ `}function $_(){return ea().lastUpdateCheck}function j_(e){F0({lastUpdateCheck:e})}async function B0(){let e=Lu(),{verifier:t,challenge:n}=Wd(),o=(0,q_.randomBytes)(16).toString("base64url"),{code:i,redirectUri:a}=await cf({state:o,buildAuthorizeUrl:m=>x_(e,{redirectUri:m,challenge:n,state:o})}),c=await R_(e,{code:i,verifier:t,redirectUri:a});N_(Vd(c)),q(`Logged in. Session token ${li(c.accessToken)} saved to ${ta()}`)}function H0(){let e=w_();if(!e){process.stderr.write("No user session. Run `tsuga auth login`.\n"),process.exitCode=1;return}if(Ts({kind:"user-session",userAuth:e},new Date)){process.stderr.write("Your session expired. Run `tsuga auth login` to sign in again.\n"),process.exitCode=1;return}q(e.accessToken)}function K0(){let{credential:e}=Uo({});if(!e){q("Not authenticated. Run `tsuga auth login` or `tsuga auth operation-key <key>`.");return}switch(e.kind){case"user-session":q(`Logged in as a user (token ${li(e.userAuth.accessToken)}, expires ${e.userAuth.accessExpiresAt}).`);return;case"operation-api-key":q("Authenticated with an operation API key.");return;default:Ye(e)}}function z0(){k_(),q("Local user session cleared.")}function F_(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").action(B0),t.command("logout").description("Clear the saved user session").action(z0),t.command("token").description("Print the saved user access token to stdout").action(H0),t.command("operation-key <operation-api-key>").description("Save an operation API key to the config file").action(n=>{L_(n),q(`Operation API key saved to ${ta()}`)}),t.command("status").description("Show the current authentication method").action(K0)}var V0=["cluster-integration-config","explorer-saved-view","inventory","saml-config","sensitive-data-scanner-rule","service","host","database","team-remap-config","user-self","oauth-grant","monitor-alert","monitor-debugging","retention-policy","org","allowed-domains","custom-usage-tag","widget-share"],Y0=["investigation","ingestion-api-key","operation-api-key","rum-public-token","audit-log","dashboard","dashboard-folder","dashboard-report","cloud-account","log-route","monitor","notification-integration","notification-rule","adaptive-notification-rule","notification-silence","quality-report","slo","tag-policy","team","team-members","user-data","user-invitation","user-permissions"],Q0=["log","metric","trace","rum"],W0=[...Y0,...Q0],mTe=[...V0,...W0];var fc=["admin","public_editor","public_viewer","teams_only"],wo=["admin","editor","viewer"];var Cn="/v0/team-membership",ku="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.",vu=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(wo,{description:ku})}),B_=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(wo,{description:ku})}),Z0=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."})}),X0=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."}))})),lTe=d({tags:["access-control"],url:Cn,method:"GET",query:X0,response:r.Array(vu)}),dTe=d({tags:["access-control"],url:Cn,method:"POST",body:B_,response:vu}),fTe=d({tags:["access-control"],url:Cn,method:"PUT",body:B_,response:vu}),gTe=d({tags:["access-control"],url:Cn,method:"DELETE",body:Z0,response:C}),dc=500,H_=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(wo,{description:ku})},{oneOf:[{required:["userId"]},{required:["userEmail"]}]}),{minItems:1,maxItems:dc,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 up to 500 users to add by ID or email, with a role for each user."}),J0={teamId:"team-123-abc",members:[{userId:"user-123-abc",roleKey:"viewer"},{userEmail:"sam@example.com",roleKey:"editor"}]};Object.assign(H_,{examples:[J0]});var K_=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."}),eD={results:[{userId:"user-123-abc",status:"added"},{userId:"sam@example.com",status:"user_not_found"}]};Object.assign(K_,{examples:[eD]});var yTe=d({tags:["access-control"],url:`${Cn}/bulk-add`,method:"POST",body:H_,response:K_}),hTe=d({tags:["access-control"],url:`${Cn}/bulk-update-user-roles`,method:"PUT",body:r.Object({userIds:r.Array(u({allowEmpty:!1}),{minItems:1,maxItems:dc}),teamId:u({allowEmpty:!1}),role:r.Enum(wo)}),response:r.Object({})}),z_=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:dc,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:dc,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."}),tD={teamId:"team-123-abc",userIds:["user-123-abc"]};Object.assign(z_,{examples:[tD]});var V_=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."}),rD={results:[{userId:"user-123-abc",status:"removed"},{userId:"missing@example.com",status:"user_not_found"}]};Object.assign(V_,{examples:[rD]});var TTe=d({tags:["access-control"],url:`${Cn}/bulk-remove`,method:"DELETE",body:z_,response:V_});var gc="/v0/admin",Be=`${gc}/clusters`,Q_=r.Object({helmParameters:r.Record(r.String(),r.Unsafe({type:["number","boolean","null","string"]})),helmVersion:r.String()}),Y_=r.Record(r.String(),Q_),Gu=["eu-central-1","eu-central-2","eu-north-1","eu-south-1","eu-south-2","eu-west-1","eu-west-2","eu-west-3","us-east-1","us-east-2","us-west-1","us-west-2","af-south-1","ap-east-1","ap-northeast-1","ap-northeast-2","ap-northeast-3","ap-south-1","ap-south-2","ap-southeast-1","ap-southeast-2","ap-southeast-3","ap-southeast-4","ap-southeast-5","ap-southeast-7","ca-central-1","ca-west-1","il-central-1","me-central-1","me-south-1","mx-central-1","sa-east-1"],$u=["europe-west1","europe-west2","europe-west3","europe-west4","europe-west6","europe-west9","europe-central2","europe-north1","us-central1","us-east1","us-east4","us-west1","us-west2","us-west3","us-west4","northamerica-northeast1","southamerica-east1","asia-east1","asia-east2","asia-northeast1","asia-northeast2","asia-northeast3","asia-south1","asia-south2","asia-southeast1","asia-southeast2","australia-southeast1","australia-southeast2"],ju=["australiacentral","australiacentral2","australiaeast","australiasoutheast","austriaeast","belgiumcentral","brazilsouth","brazilsoutheast","canadacentral","canadaeast","centralindia","centralus","chilecentral","eastasia","eastus","eastus2","francecentral","francesouth","germanynorth","germanywestcentral","indonesiacentral","israelcentral","italynorth","japaneast","japanwest","jioindiacentral","jioindiawest","koreacentral","koreasouth","malaysiawest","mexicocentral","newzealandnorth","northcentralus","northeurope","norwayeast","norwaywest","polandcentral","qatarcentral","southafricanorth","southafricawest","southcentralus","southeastasia","southindia","spaincentral","swedencentral","switzerlandnorth","switzerlandwest","uaecentral","uaenorth","uksouth","ukwest","westcentralus","westeurope","westindia","westus","westus2","westus3"],W_=["aws","gcp","azure"],ra=["xs","s","m","l"],qu=["1.0"],nD={id:r.String(),name:r.String(),createdAt:E(),clusterCertificateExpiresAt:E(),bridgeEndpoint:r.String(),deployerEndpoint:r.String(),targetConfiguration:Y_,appliedConfiguration:r.Optional(Y_),automaticallyDeployLatestVersion:r.Boolean(),automatedDeploymentDisabledBy:r.Optional(r.String()),automatedDeploymentDisabledReason:r.Optional(r.String()),automatedDeploymentDisabledAt:r.Optional(E()),soakTimeMin:r.Optional(r.Number()),clusterSize:r.Optional(r.Enum(ra))},Mu={...nD,orgId:r.String(),orgName:r.String()},ATe=d({tags:["admin"],method:"GET",url:Be,query:r.Object({orgId:r.Optional(u())}),response:r.Array(b("clusterType",[r.Object({...Mu,clusterType:r.Literal("aws"),clusterAccountId:r.String(),clusterBuilderRoleVersion:r.Optional(r.Enum(qu)),clusterRegion:r.Enum(Gu)}),r.Object({...Mu,clusterType:r.Literal("gcp"),clusterAccountId:r.String(),clusterRegion:r.Enum($u)}),r.Object({...Mu,clusterType:r.Literal("azure"),clusterTenantId:r.String(),clusterSubscriptionId:r.String(),clusterRegion:r.Enum(ju)})]))}),xTe=d({tags:["admin"],method:"PUT",url:`${Be}/create`,body:b("clusterType",[r.Object({clusterType:r.Literal("aws"),orgId:u(),name:u(),clusterSize:r.Enum(ra),clusterAccountId:r.String({minLength:12,maxLength:12}),clusterBuilderRoleVersion:r.Enum(qu),clusterRegion:r.Enum(Gu)}),r.Object({clusterType:r.Literal("gcp"),orgId:u(),name:u(),clusterSize:r.Enum(ra),clusterAccountId:u(),clusterRegion:r.Enum($u)}),r.Object({clusterType:r.Literal("azure"),orgId:u(),name:u(),clusterSize:r.Enum(ra),clusterTenantId:u(),clusterSubscriptionId:u(),clusterRegion:r.Enum(ju)})]),response:r.Object({id:r.String(),bridgeEndpoint:r.String(),deployerEndpoint:r.String()})}),RTe=d({tags:["admin"],method:"DELETE",url:`${Be}/:id`,params:r.Object({id:u()}),body:r.Object({orgId:u()}),response:C}),CTe=d({tags:["admin"],method:"PUT",url:`${Be}/add-inbounder-key`,body:r.Object({orgId:u(),clusterId:u()}),response:r.Object({orgId:u(),clusterId:u(),inbounderAuthenticationKey:r.String()})}),PTe=d({tags:["admin"],method:"PUT",url:`${Be}/replace-all-inbounder-keys`,body:r.Object({orgId:u(),clusterId:u()}),response:r.Object({orgId:u(),clusterId:u(),inbounderAuthenticationKey:r.String()})}),UTe=d({tags:["admin"],method:"PUT",url:`${Be}/replace-inbounder-key`,body:r.Object({orgId:u(),clusterId:u(),inbounderAuthenticationKeyToReplace:u()}),response:r.Object({orgId:u(),clusterId:u(),inbounderAuthenticationKey:r.String()})}),wTe=d({tags:["admin"],method:"PUT",url:`${Be}/delete-inbounder-key`,body:r.Object({orgId:u(),clusterId:u(),inbounderAuthenticationKeyToDelete:u()}),response:r.Object({orgId:u(),clusterId:u(),isKeyDeleted:r.Boolean()})}),NTe=d({tags:["admin"],method:"PUT",url:`${Be}/rotate-deployer-key`,body:r.Object({orgId:u(),clusterId:u(),newKey:u()}),response:r.Object({orgId:u(),clusterId:u(),isKeyUpdated:r.Boolean()})}),LTe=d({tags:["admin"],method:"PUT",url:`${Be}/rotate-bridge-key`,body:r.Object({orgId:u(),clusterId:u(),newKey:u()}),response:r.Object({orgId:u(),clusterId:u(),isKeyUpdated:r.Boolean()})}),Du={central:r.String(),ngrokBridgeDomain:r.String(),ngrokDeployerDomain:r.String(),clusterCertificateExpiresAt:E(),clusterName:r.String(),clusterSize:r.Optional(r.Enum(ra)),secretBridgeAuthenticationKey:r.String(),secretDeployerAuthenticationKey:r.String(),secretOutbounderAuthenticationKey:r.String(),slackChannelEmail:r.String(),customerTier:r.String()},kTe=d({tags:["admin"],method:"POST",url:`${Be}/:id`,body:r.Object({orgId:u()}),params:r.Object({id:u()}),response:b("clusterType",[r.Object({...Du,clusterType:r.Literal("aws"),clusterAccountId:r.String(),clusterBuilderRoleVersion:r.Optional(r.Enum(qu)),clusterRegion:r.Enum(Gu)}),r.Object({...Du,clusterType:r.Literal("gcp"),clusterAccountId:r.String(),clusterRegion:r.Enum($u)}),r.Object({...Du,clusterType:r.Literal("azure"),clusterTenantId:r.String(),clusterSubscriptionId:r.String(),clusterRegion:r.Enum(ju)})])}),vTe=d({tags:["admin"],method:"POST",url:`${Be}/configuration`,body:r.Object({id:u(),orgId:u(),installationName:u(),targetConfiguration:Q_}),response:r.Object({status:r.String()})}),MTe=d({tags:["admin"],method:"POST",url:`${Be}/automation`,body:r.Object({id:u(),orgId:u(),enableAutomatedDeployment:r.Boolean(),disabledReason:r.Optional(u())}),response:r.Object({status:r.String()})}),DTe=d({tags:["admin"],method:"POST",url:`${Be}/soak-time`,body:r.Object({id:u(),orgId:u(),soakTimeMin:r.Optional(r.Number())}),response:r.Object({status:r.String()})}),GTe=d({tags:["admin"],method:"POST",url:`${Be}/deploy`,body:r.Object({orgId:u(),clusterId:u(),chartName:u(),toVersion:u()}),response:r.Object({id:r.String()})}),oD=b("type",[r.Object({type:r.Literal("pending")}),r.Object({type:r.Literal("running")}),r.Object({type:r.Literal("cancelled")}),r.Object({type:r.Literal("timed_out")}),r.Object({type:r.Literal("success"),stateValue:r.Object({message:r.String()})}),r.Object({type:r.Literal("failure"),stateValue:r.Object({message:r.String()})})]),$Te=d({tags:["admin"],method:"GET",url:`${Be}/deploy`,query:r.Object({orgId:r.Optional(u()),clusterId:r.Optional(u())}),response:r.Array(r.Object({id:r.String(),orgId:r.String(),orgName:r.String(),clusterId:r.String(),clusterName:r.String(),fromVersion:r.Optional(r.String()),toVersion:r.String(),state:oD,updatedAt:E(),createdAt:E(),installationName:r.String(),chartName:r.String(),isAutomated:r.Boolean(),createdBy:r.Optional(r.String()),createdByName:r.Optional(r.String()),createdByEmail:r.Optional(r.String())}))}),iD=r.Object({installations:r.Array(r.Object({installationName:r.String(),parameters:r.Record(r.String(),r.Union([r.Number(),r.Boolean(),r.Null(),r.String()])),version:r.Union([r.String(),r.Null()]),resources:r.Array(r.Object({id:r.Object({kind:r.String(),name:r.String()}),status:r.String(),health:r.String(),rawDetails:r.Optional(r.Any()),liveManifest:r.Optional(r.String()),targetManifest:r.Optional(r.String())})),deployedAt:r.Optional(r.String()),syncStatus:r.Optional(r.String()),healthStatus:r.Optional(r.String())}))}),jTe=d({tags:["admin"],method:"POST",url:`${Be}/status`,body:r.Object({orgId:r.Optional(u()),clusterId:r.Optional(u())}),response:r.Array(r.Object({orgId:r.String(),clusterId:r.String(),status:iD}))}),qTe=d({tags:["admin"],method:"POST",url:`${Be}/argocd-cert-info`,body:r.Object({orgId:u(),clusterId:u()}),response:r.Object({certificateExpiresAt:r.String()})}),aD=r.Object({kind:r.String(),name:r.String()}),sD=r.Object({id:aD,liveManifest:r.Optional(r.String()),targetManifest:r.Optional(r.String())}),FTe=d({tags:["admin"],method:"POST",url:`${Be}/resource-details`,body:r.Object({orgId:u(),clusterId:u(),installationName:u()}),response:r.Object({resources:r.Array(sD)})}),BTe=d({tags:["admin"],method:"GET",url:`${Be}/versions`,query:r.Object({chartName:r.Optional(u())}),response:r.Array(r.Object({id:r.String(),chartName:r.String(),locator:r.String(),version:r.String(),repositoryArn:r.String(),type:r.Optional(r.String()),commitHash:r.Optional(r.String()),lastPulledAt:r.Optional(E()),pushedAt:r.Optional(E())}))});var cD=r.Object({id:r.Object({name:r.String(),kind:r.String()}),previewManifest:r.Optional(r.String())}),HTe=d({tags:["admin"],method:"POST",url:`${Be}/versions/render`,body:r.Object({chartName:u(),version:u(),values:u({type:"long"}),installationName:u(),namespace:u()}),response:r.Array(cD)}),gr=`${gc}/orgs`,KTe=d({tags:["admin"],url:gr,method:"GET",query:r.Object({onlyDeleted:r.Optional(r.Boolean())}),response:r.Array(r.Object({id:r.String(),name:r.String(),allowedDomains:r.Array(r.String()),createdAt:E(),updatedAt:E()}))}),zTe=d({tags:["admin"],url:gr,method:"POST",body:r.Object({emailDomains:r.Array(u({type:"lowercase-domain"}),{maxItems:20}),name:u()}),response:r.Object({id:r.String(),name:r.String()})}),VTe=d({tags:["admin"],url:`${gr}/:id`,method:"PUT",params:r.Object({id:u()}),body:r.Object({allowedDomains:r.Optional(r.Array(u({type:"lowercase-domain"}),{maxItems:20}))}),response:r.Object({id:r.String(),name:r.String(),allowedDomains:r.Array(r.String())})}),YTe=d({tags:["admin"],url:`${gr}/:id`,method:"DELETE",params:r.Object({id:u()}),response:C}),QTe=d({tags:["admin"],url:`${gr}/:id/restore`,method:"POST",params:r.Object({id:u()}),response:r.Object({success:r.Boolean()})}),WTe=d({tags:["admin"],url:`${gr}/:id/permanent-delete`,method:"DELETE",params:r.Object({id:u()}),response:r.Object({success:r.Boolean(),hasDeletedSecret:r.Boolean(),hasDeletedTenantDb:r.Boolean(),hasDeletedOrgRow:r.Boolean()})}),ZTe=d({tags:["admin"],url:`${gr}/synchronize-sds-rules`,method:"POST",response:r.Object({errorOrgs:r.Optional(r.Array(r.Object({id:r.String(),name:r.String()}))),synchronizedOrgsCount:r.Number()})}),pD=["custom_usage_tag","ingestion_api_key","inventory_resource","monitor","retention_policy","route","sensitive_data_scanner_rule","tag_policy","team"],uD=r.Enum(pD),XTe=d({tags:["admin"],url:`${gr}/refresh-assets`,method:"POST",body:r.Object({assetTypes:r.Array(uD,{minItems:1}),orgId:r.Optional(u({allowEmpty:!1}))}),response:r.Array(r.Object({orgId:r.String(),orgName:r.String(),results:r.Record(r.String(),r.Object({success:r.Boolean()}))}))}),JTe=d({tags:["admin"],url:`${gr}/sudo`,method:"POST",body:r.Object({orgId:u()}),response:r.Object({sudoToken:r.String()})}),mD=`${gc}/users`,eEe=d({tags:["admin"],url:`${mD}/invite`,method:"POST",body:r.Object({email:u({type:"email"}),orgId:u(),userRole:r.Enum(fc)}),response:r.Array(r.Object({inviteId:r.String(),email:r.String(),result:r.Union([r.Literal("success"),r.Literal("email-failed")])}))});var tEe=d({tags:["admin"],url:`${gc}/billing-data`,method:"GET",query:r.Object({orgId:u(),maxDaysFetched:r.Optional(r.Number({minimum:1,maximum:365}))}),response:r.Object({dataPoints:r.Array(r.Object({date:r.String(),telemetryKind:r.Union([r.Literal("logs"),r.Literal("metrics"),r.Literal("rum"),r.Literal("traces")]),totalBytes:r.Number(),clusterId:r.String(),apiKeyId:r.String(),apiKeyName:r.String(),teamName:r.String()})),availableFilters:r.Object({clusters:r.Array(r.Object({id:r.String(),name:r.String()})),apiKeys:r.Array(r.Object({id:r.String(),name:r.String()})),teamNames:r.Array(r.String())})})});var Z_=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(W_,{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`."}),lD={id:"abc-123-def",name:"production",friendlyName:"Production (US)",clusterType:"aws",clusterRegion:"us-east-1"};Object.assign(Z_,{examples:[lD]});var X_=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(Z_)});function J_(e,t){e.command("cluster").description("Manage Tsuga cluster selection. A Tsuga cluster contains your observability data.").command("list").description("List all Tsuga clusters available to the operation API key").action(async()=>{let o=await t()(X_);re(o)})}function tb(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("__")||tb(c,[...t,c.name()],n,o)}function dD(e){let t=new Map,n=new Set;return tb(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 eb(e){return e.map(({key:t,cmds:n,flags:o})=>` ${JSON.stringify(t)}) cmds=${JSON.stringify(n)} flags=${JSON.stringify(o)} ;;`).join(`
40
+ `)}function fD(e,t){return`_tsuga_complete() {
41
+ local cur key cmds flags words i word prev
42
+ local valueflags="${t}"
43
+ local -a path
44
+ cur="\${COMP_WORDS[COMP_CWORD]}"
45
+ prev=""
46
+ for (( i=1; i < COMP_CWORD; i++ )); do
47
+ word="\${COMP_WORDS[i]}"
48
+ if [[ "$word" == -* ]]; then prev="$word"; continue; fi
49
+ if [[ " $valueflags " == *" $prev "* ]]; then prev=""; continue; fi
50
+ path+=("$word"); prev=""
51
+ done
52
+ key="\${path[*]}"
53
+ case "$key" in
54
+ ${e}
55
+ *) cmds="" flags="" ;;
56
+ esac
57
+ if [[ "$cur" == -* ]]; then words="$flags"; else words="$cmds"; fi
58
+ COMPREPLY=( $(compgen -W "$words" -- "$cur") )
59
+ }
60
+ complete -F _tsuga_complete tsuga
61
+ `}function gD(e,t){return`#compdef tsuga
62
+ _tsuga_complete() {
63
+ local cur key cmds flags out i word prev
64
+ local valueflags="${t}"
65
+ local -a path
66
+ cur="\${words[CURRENT]}"
67
+ prev=""
68
+ for (( i=2; i < CURRENT; i++ )); do
69
+ word="\${words[i]}"
70
+ if [[ "$word" == -* ]]; then prev="$word"; continue; fi
71
+ if [[ " $valueflags " == *" $prev "* ]]; then prev=""; continue; fi
72
+ path+=("$word"); prev=""
73
+ done
74
+ key="\${(j: :)path}"
75
+ case "$key" in
76
+ ${e}
77
+ *) cmds="" flags="" ;;
78
+ esac
79
+ if [[ "$cur" == -* ]]; then out="$flags"; else out="$cmds"; fi
80
+ compadd -- \${=out}
81
+ }
82
+ compdef _tsuga_complete tsuga
83
+ `}function Fu(e){return`'${e.replace(/\\/g,"\\\\").replace(/'/g,"\\'")}'`}function yD(e){return e.map(({key:t,cmds:n,flags:o})=>` case ${Fu(t)}
84
+ set cmds ${Fu(n)}
85
+ set flags ${Fu(o)}`).join(`
86
+ `)}function hD(e,t){return`# Update with: tsuga completion fish > ~/.config/fish/completions/tsuga.fish
87
+ function __tsuga_complete
88
+ set -l valueflags -- ${t}
89
+ set -l tokens (commandline -xpc)
90
+ set -l cur (commandline -ct)
91
+ set -l path
92
+ set -l prev ""
93
+ set -l i 2
94
+ while test $i -le (count $tokens)
95
+ set -l word $tokens[$i]
96
+ set i (math $i + 1)
97
+ if string match -q -- '-*' $word
98
+ set prev $word
99
+ continue
100
+ end
101
+ if contains -- $prev $valueflags
102
+ set prev ""
103
+ continue
104
+ end
105
+ set -a path $word
106
+ set prev ""
107
+ end
108
+ set -l key "$path"
109
+ set -l cmds ""
110
+ set -l flags ""
111
+ switch "$key"
112
+ ${e}
113
+ end
114
+ if string match -q -- '-*' $cur
115
+ test -n "$flags"; and string split ' ' -- $flags
116
+ else
117
+ test -n "$cmds"; and string split ' ' -- $cmds
118
+ end
119
+ end
120
+ complete -c tsuga -f -a '(__tsuga_complete)'
121
+ `}function rb(e){e.command("completion <shell>").description("Print a shell completion script (bash, zsh, or fish)").addHelpText("after",`
122
+ Usage:
123
+ bash: eval "$(tsuga completion bash)" # add to ~/.bashrc
124
+ zsh: eval "$(tsuga completion zsh)" # add to ~/.zshrc
125
+ fish: tsuga completion fish > ~/.config/fish/completions/tsuga.fish`).action(t=>{let{rows:n,valueFlags:o}=dD(e);if(t==="bash")q(fD(eb(n),o));else if(t==="zsh")q(gD(eb(n),o));else if(t==="fish")q(hD(yD(n),o));else throw new Error(`Unsupported shell "${t}". Supported: bash, zsh, fish.`)})}function nb(e){let t=e.command("config").description("Show or manage configuration");t.action(()=>{let n=e.opts(),o=Uo({operationApiKey:n.operationApiKey,clusterId:n.cluster});q(G_(o,ta()).trimEnd())}),t.command("set").description("Set a configuration value").command("default <key> <value>").description("Set a custom default value for a command flag").allowUnknownOption(!0).action((n,o)=>{M_(n,o),q(`Default set: ${n} = ${o}`)}),t.command("reset").description("Reset configuration values").command("defaults").description("Clear all custom defaults").action(()=>{D_(),q("Custom defaults cleared")})}var ob=`/${"v1"}/docs`,ib=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"}),TD={path:"getting-started/send-your-first-logs",title:"Send your first logs",content:`# Send your first logs
126
+ ...`};Object.assign(ib,{examples:[TD]});var ab=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"}),ED={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(ab,{examples:[ED]});var sb=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:ob,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:ib}),cb=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:`${ob}/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(ab)});function pb(e,t){let n=e.command("docs").description("Browse and search documentation");n.command("get <path>").description("Get a documentation page by path (e.g. 'getting-started/send-your-first-logs')").action(async o=>{let i=await t()(sb,{query:{path:o}});re(i)}),n.command("search <query>").description("Search documentation pages").action(async o=>{let i=await t()(cb,{query:{query:o}});re(i)})}var ub=r.Object({type:r.Literal("number"),number:r.String()}),ID=r.Object({type:r.Literal("string"),string:r.String()}),_D=r.Object({type:r.Literal("timestamp"),timestamp:r.String()}),na=b("type",[ub,ID,_D]),bD=r.Object({by:r.Record(r.String(),na),computed:r.Record(r.String(),ub)}),SD=r.Object({type:r.Literal("buckets"),buckets:r.Array(bD)}),OD=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()))}),yc=b("type",[SD,OD]);var AD=["all","owning-team-and-public","owning-team-only"],Zr=r.Enum(AD,{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 lb=1456444800,db=4927737600,xD=lb*1e3,RD=db*1e3,hc=1704067200,Bu=hc*1e3,fb={title:"TimeRange",description:"Inclusive time range for telemetry queries. Use Unix timestamps in seconds unless the field description says milliseconds.",examples:[{from:hc,to:hc}]},CD={title:"TimeRange",description:"Inclusive time range for telemetry queries using Unix timestamps in milliseconds.",examples:[{from:Bu,to:Bu}]},Tc=e=>r.Integer({description:e,examples:[hc],minimum:lb,maximum:db,format:"int64"}),mb=e=>r.Integer({description:e,examples:[Bu],minimum:xD,maximum:RD,format:"int64"}),et=r.Object({from:r.Optional(Tc("Start of the query window as a Unix timestamp in seconds")),to:r.Optional(Tc("End of the query window as a Unix timestamp in seconds"))},fb),_t=r.Object({from:Tc("Start of the query window as a Unix timestamp in seconds"),to:Tc("End of the query window as a Unix timestamp in seconds")},fb),Ec=r.Object({from:mb("Start of the query window as a Unix timestamp in milliseconds"),to:mb("End of the query window as a Unix timestamp in milliseconds")},CD);var wD="/v0/aggregation",ND=r.Union([r.Literal("a"),r.Literal("d"),r.Literal("q"),r.Literal("w"),r.Literal("t")]),Ku=r.Object({parallelism:r.Number(),engine:ND,recordBatchCache:r.Optional(r.Boolean()),includeNullGroups:r.Optional(r.Boolean()),restartAwareGaugeSum:r.Optional(r.Boolean())}),zu=["logs","metrics","traces"];var hb={logs:"Logs",metrics:"Metrics",traces:"Traces"},LD=[...zu,"connections","log-patterns"];var qEe={...hb,connections:"Connections","log-patterns":"Log Patterns"},ir=[...zu,"rum"],FEe={...hb,rum:"RUM events"};var BEe=r.Enum(LD,{description:"Data source being queried"}),vt=r.Enum(zu,{description:"Telemetry source queried by this aggregation: `logs`, `metrics`, or `traces`."}),Pn=r.String({description:"Attribute containing the values to aggregate"}),Un=u({description:"Attribute containing the values to aggregate"}),kD=b("type",[r.Object({type:r.Literal("count",{description:"Counts the total number of records"}),field:r.Optional(Pn)},{$id:"AggregateCount",title:"Count"}),r.Object({type:r.Literal("unique-count",{description:"Counts the distinct values of the field"}),field:Pn},{$id:"AggregateUniqueCount",title:"UniqueCount"}),r.Object({type:r.Literal("average",{description:"Calculates the average value of the selected field"}),field:Pn},{$id:"AggregateAverage",title:"Average"}),r.Object({type:r.Literal("max",{description:"Finds the largest value of the field"}),field:Pn},{$id:"AggregateMax",title:"Max"}),r.Object({type:r.Literal("min",{description:"Finds the smallest value of the field"}),field:Pn},{$id:"AggregateMin",title:"Min"}),r.Object({type:r.Literal("sum",{description:"Sums the values of the selected field"}),field:Pn},{$id:"AggregateSum",title:"Sum"}),r.Object({type:r.Literal("percentile",{description:"Calculates a percentile of the selected field"}),field:Pn,percentile:r.Number({description:"Percentile to compute for the selected field, from 0 through 100."})},{$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`."}),vD=b("type",[r.Object({type:r.Literal("count",{description:"Counts the total number of records"}),field:r.Optional(Un)},{$id:"InputAggregateCount",title:"Count"}),r.Object({type:r.Literal("unique-count",{description:"Counts the distinct values of the field"}),field:Un},{$id:"InputAggregateUniqueCount",title:"UniqueCount"}),r.Object({type:r.Literal("average",{description:"Calculates the average value of the selected field"}),field:Un},{$id:"InputAggregateAverage",title:"Average"}),r.Object({type:r.Literal("max",{description:"Finds the largest value of the field"}),field:Un},{$id:"InputAggregateMax",title:"Max"}),r.Object({type:r.Literal("min",{description:"Finds the smallest value of the field"}),field:Un},{$id:"InputAggregateMin",title:"Min"}),r.Object({type:r.Literal("sum",{description:"Sums the values of the selected field"}),field:Un},{$id:"InputAggregateSum",title:"Sum"}),r.Object({type:r.Literal("percentile",{description:"Calculates a percentile of the selected field"}),field:Un,percentile:r.Number({description:"Percentile to compute for the selected field, from 0 through 100."})},{$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`."}),Tb=r.Object({type:r.Literal("per-second",{description:"Normalizes the metric to events per second"})},{$id:"FunctionPerSecond",title:"PerSecond"}),Eb=r.Object({type:r.Literal("per-minute",{description:"Normalizes the metric to events per minute"})},{$id:"FunctionPerMinute",title:"PerMinute"}),Ib=r.Object({type:r.Literal("per-hour",{description:"Normalizes the metric to events per hour"})},{$id:"FunctionPerHour",title:"PerHour"}),_b=r.Object({type:r.Literal("rate",{description:"Calculates the rate of change"})},{$id:"FunctionRate",title:"Rate"}),bb=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"}),Sb=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"}),Ob=r.Object({type:r.Literal("sqrt",{description:"Applies a square root transformation to the values"})},{$id:"FunctionSqrt",title:"Sqrt"}),Ab=r.Object({type:r.Literal("last",{description:"Takes the last value of the metric for the selected time frame"})},{$id:"FunctionLast",title:"Last"}),MD=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"}),DD=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"}),GD=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"}),$D=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"}),jD=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"}),qD=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"}),FD=b("type",[Tb,Eb,Ib,_b,bb,MD,GD,Sb,Ob,Ab,jD],{title:"Function",description:"Post-processing function applied to an aggregation query result after the aggregate is computed, selected by `type`."}),BD=b("type",[Tb,Eb,Ib,_b,bb,DD,$D,Sb,Ob,Ab,qD],{title:"InputFunction",description:"Post-processing function applied to an aggregation query result after the aggregate is computed, selected by `type`."});var gb=r.Object({min:r.Number({description:"Lower bound of the distribution range."}),max:r.Number({description:"Upper bound of the distribution range."})}),HD=["linear","log"],Ic=r.Enum(HD),yb=r.Integer({minimum:1}),KD=b("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(yb),bounds:r.Optional(gb),boundsScale:r.Optional(Ic),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(yb),bounds:r.Optional(gb)},{title:"Heatmap",description:"Returns a distribution per time window"})]),oa=15,zD=["zero","null"],VD=r.Enum(zD,{description:"`zero` fills missing points with zero. `null` keeps missing points null."}),xb=r.Object({mode:r.Object({type:VD},{description:"How missing aggregation points should be filled."})},{description:"Missing-point fill behavior for aggregation results. Optional; omit to keep missing points null."}),Rb={aggregate:kD,functions:r.Optional(r.Array(FD,{description:"Post-processing functions applied to aggregation results"})),fill:r.Optional(xb)},Cb={aggregate:vD,functions:r.Optional(r.Array(BD,{maxItems:10,description:"Post-processing functions applied to aggregation results. Defaults to an empty array when omitted. Limited to 10 items."})),fill:r.Optional(xb)},YD={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."},Pb={maxItems:oa,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 ${oa} 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").`},Ub=r.Array(r.Object({...Rb,filter:r.Optional(r.String({description:"Filter to apply to the aggregation"}))},{title:"AggregationQuery"}),YD),ia=r.Array(r.Object({...Cb,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"}),Pb),Xr=r.Array(r.Object({...Rb,filter:r.String({description:"Filter to apply to the aggregation"})},{title:"MonitorAggregationQuery"}),{description:"Aggregation queries used by alerting and SLO evaluation. Each query is referenced from formulas as q1, q2, and so on."}),Jr=r.Array(r.Object({...Cb,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"}),{...Pb,description:"Aggregation queries used by alerting and SLO evaluation. Each query is referenced from formulas as q1, q2, and so on."});var _c=r.String({description:"Formula referencing submitted query outputs, such as `q1 + q2`. References must be within `q1` through `qN` for the submitted queries."}),wn=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."}),QD=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"}),WD=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"}),Hu=7;var No=r.Array(QD,{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."}),yr=r.Array(WD,{maxItems:Hu,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. Limited to ${Hu} levels.`});var HEe=d({tags:["aggregation"],url:`${wD}/multi-query`,method:"POST",body:r.Object({timeRange:Ec,queries:ia,groupBy:r.Optional(yr),returnType:KD,dataSource:r.Enum(ir,{description:"Data source being queried for this aggregation"}),formula:wn,executionOptions:Ku,triggeredBy:r.Optional(r.Literal("refresh")),shouldStreamResults:r.Optional(r.Boolean()),clusterId:r.Optional(u({allowEmpty:!1})),viewAs:r.Optional(r.Object({owner:u({allowEmpty:!1,description:"Team ID to fetch data as"}),permissions:Zr}))}),response:yc});var ZD=r.Union([r.Literal("scalar"),r.Literal("timeseries")]),XD="/v0/promql",bc=r.Object({query:u({type:"long",allowEmpty:!1,description:"PromQL expression to evaluate."}),timeRange:Ec,step:u({allowEmpty:!1,description:"Evaluation step interval (e.g. `1m`, `5m`, `1h`). Must be a valid Prometheus duration string."}),returnType:r.Optional(ZD),executionOptions:Ku,clusterId:r.Optional(u({allowEmpty:!1,description:"Cluster to target. Defaults to the first cluster created in the organization when omitted."}))}),JD={query:"rate(http_requests_total[5m])",timeRange:{from:17822015e5,to:17822034e5},step:"1m",executionOptions:{parallelism:1,engine:"q"},clusterId:"cluster-abc"};Object.assign(bc,{examples:[JD]});var XEe=d({tags:["promql"],url:XD,method:"POST",body:bc,response:yc});var wb=`/${"v1"}/aggregation`,Nb=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."})}),Lb=r.Object({results:r.Array(r.Object({...Nb.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."}),eG={results:[{id:"q1",group:{host:"server-1"},value:123.45}]};Object.assign(Lb,{examples:[eG]});var Sc=r.Object({series:r.Array(r.Object({...Nb.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."}),tG={series:[{id:"q1",group:{host:"server-1"},points:[{timestamp:16094592e5,value:123.45},{timestamp:160945926e4,value:456.78}]}]};Object.assign(Sc,{examples:[tG]});var rG=r.Omit(ia.items,["fill"],{title:"AggregationQuery",description:"Aggregation query. Omit `filter` for an unfiltered query and omit `functions` when no post-processing is needed."}),nG=r.Optional(yr),kb={timeRange:_t,queries:r.Array(rG,{maxItems:oa,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 ${oa} 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:nG,dataSource:vt,formula:r.Optional(wn)},vb=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."}))}),Mb=r.Object(kb,{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."}),oG={timeRange:{from:1782201500,to:1782203400},dataSource:"logs",queries:[{aggregate:{type:"count"},filter:"context.service.name:checkout"}],groupBy:[{fields:["level"],limit:5}]};Object.assign(Mb,{examples:[oG]});var Db=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:`${wb}/multi-query/scalar`,method:"POST",body:Mb,query:vb,response:Lb}),Gb=r.Object({...kb,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."}),iG={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(Gb,{examples:[iG]});var $b=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:`${wb}/multi-query/timeseries`,method:"POST",body:Gb,query:vb,response:Sc});var aG=`/${"v1"}/promql`,sG=r.Object({...r.Pick(bc,["query","step"]).properties,timeRange:_t},{description:"PromQL range-query request. The client supplies query, timeRange, and step. Send clusterId as a query parameter, not in this JSON body.",examples:[{query:"sum(rate(http_requests_total[5m]))",timeRange:{from:1782201500,to:1782203400},step:"1m"}]}),cG=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."}))}),jb=d({description:"Runs an experimental 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.",operationId:"queryPromql",tags:["public","promql"],url:aG,method:"POST",body:sG,query:cG,response:Sc});var qb=Nd(require("node:fs"));function Lo(e){if(e.file){let t=qb.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> or -d <json>. Use --generate-skeleton to get a template.")}function pG(e){return s.IsObject(e)&&s.HasPropertyKey(e,"check")&&s.HasPropertyKey(e,"errors")&&s.IsFunction(e.check)&&s.IsFunction(e.errors)}function Vu(e){return s.HasPropertyKey(e,"~guard")&&pG(e["~guard"])}function Yu(e){return s.HasPropertyKey(e,"~refine")&&s.IsArray(e["~refine"])&&s.Every(e["~refine"],0,t=>s.IsObject(t)&&s.HasPropertyKey(t,"refine")&&s.HasPropertyKey(t,"message")&&s.IsFunction(t.refine)&&s.IsString(t.message))}function hr(e){return s.IsObject(e)&&!s.IsArray(e)}function Oc(e){return s.IsBoolean(e)}function G(e){return hr(e)||Oc(e)}function Qu(e){return s.HasPropertyKey(e,"additionalItems")&&G(e.additionalItems)}function Tr(e){return s.HasPropertyKey(e,"additionalProperties")&&G(e.additionalProperties)}function Wu(e){return s.HasPropertyKey(e,"allOf")&&s.IsArray(e.allOf)&&e.allOf.every(t=>G(t))}function aa(e){return s.HasPropertyKey(e,"$anchor")&&s.IsString(e.$anchor)}function Zu(e){return s.HasPropertyKey(e,"anyOf")&&s.IsArray(e.anyOf)&&e.anyOf.every(t=>G(t))}function Xu(e){return s.HasPropertyKey(e,"const")}function Nn(e){return s.HasPropertyKey(e,"contains")&&G(e.contains)}function wt(e){return s.HasPropertyKey(e,"default")}function Ju(e){return s.HasPropertyKey(e,"dependencies")&&s.IsObject(e.dependencies)&&Object.values(e.dependencies).every(t=>G(t)||s.IsArray(t)&&t.every(n=>s.IsString(n)))}function em(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 tm(e){return s.HasPropertyKey(e,"dependentSchemas")&&s.IsObject(e.dependentSchemas)&&Object.values(e.dependentSchemas).every(t=>G(t))}function rm(e){return s.HasPropertyKey(e,"$dynamicAnchor")&&s.IsString(e.$dynamicAnchor)}function nm(e){return s.HasPropertyKey(e,"else")&&G(e.else)}function om(e){return s.HasPropertyKey(e,"enum")&&s.IsArray(e.enum)}function im(e){return s.HasPropertyKey(e,"exclusiveMaximum")&&(s.IsNumber(e.exclusiveMaximum)||s.IsBigInt(e.exclusiveMaximum))}function Er(e){return s.HasPropertyKey(e,"exclusiveMinimum")&&(s.IsNumber(e.exclusiveMinimum)||s.IsBigInt(e.exclusiveMinimum))}function sa(e){return s.HasPropertyKey(e,"format")&&s.IsString(e.format)}function Ln(e){return s.HasPropertyKey(e,"$id")&&s.IsString(e.$id)}function am(e){return s.HasPropertyKey(e,"if")&&G(e.if)}function ko(e){return s.HasPropertyKey(e,"items")&&(G(e.items)||s.IsArray(e.items)&&e.items.every(t=>G(t)))}function sm(e){return ko(e)&&s.IsArray(e.items)}function cm(e){return s.HasPropertyKey(e,"maximum")&&(s.IsNumber(e.maximum)||s.IsBigInt(e.maximum))}function pm(e){return s.HasPropertyKey(e,"maxContains")&&s.IsNumber(e.maxContains)}function Ac(e){return s.HasPropertyKey(e,"maxItems")&&s.IsNumber(e.maxItems)}function um(e){return s.HasPropertyKey(e,"maxLength")&&s.IsNumber(e.maxLength)}function mm(e){return s.HasPropertyKey(e,"maxProperties")&&s.IsNumber(e.maxProperties)}function Ir(e){return s.HasPropertyKey(e,"minimum")&&(s.IsNumber(e.minimum)||s.IsBigInt(e.minimum))}function kn(e){return s.HasPropertyKey(e,"minContains")&&s.IsNumber(e.minContains)}function vo(e){return s.HasPropertyKey(e,"minItems")&&s.IsNumber(e.minItems)}function ca(e){return s.HasPropertyKey(e,"minLength")&&s.IsNumber(e.minLength)}function pa(e){return s.HasPropertyKey(e,"minProperties")&&s.IsNumber(e.minProperties)}function lm(e){return s.HasPropertyKey(e,"multipleOf")&&(s.IsNumber(e.multipleOf)||s.IsBigInt(e.multipleOf))}function dm(e){return s.HasPropertyKey(e,"not")&&G(e.not)}function fm(e){return s.HasPropertyKey(e,"oneOf")&&s.IsArray(e.oneOf)&&e.oneOf.every(t=>G(t))}function ua(e){return s.HasPropertyKey(e,"pattern")&&(s.IsString(e.pattern)||e.pattern instanceof RegExp)}function ma(e){return s.HasPropertyKey(e,"patternProperties")&&s.IsObject(e.patternProperties)&&Object.values(e.patternProperties).every(t=>G(t))}function Mo(e){return s.HasPropertyKey(e,"prefixItems")&&s.IsArray(e.prefixItems)&&e.prefixItems.every(t=>G(t))}function la(e){return s.HasPropertyKey(e,"properties")&&s.IsObject(e.properties)&&Object.values(e.properties).every(t=>G(t))}function gm(e){return s.HasPropertyKey(e,"propertyNames")&&(s.IsObject(e.propertyNames)||G(e.propertyNames))}function uG(e){return s.HasPropertyKey(e,"$recursiveAnchor")&&s.IsBoolean(e.$recursiveAnchor)}function xc(e){return uG(e)&&s.IsEqual(e.$recursiveAnchor,!0)}function ym(e){return s.HasPropertyKey(e,"$recursiveRef")&&s.IsString(e.$recursiveRef)}function hm(e){return s.HasPropertyKey(e,"$ref")&&s.IsString(e.$ref)}function vn(e){return s.HasPropertyKey(e,"required")&&s.IsArray(e.required)&&e.required.every(t=>s.IsString(t))}function Tm(e){return s.HasPropertyKey(e,"then")&&G(e.then)}function Em(e){return s.HasPropertyKey(e,"type")&&(s.IsString(e.type)||s.IsArray(e.type)&&e.type.every(t=>s.IsString(t)))}function Do(e){return s.HasPropertyKey(e,"uniqueItems")&&s.IsBoolean(e.uniqueItems)}function Rc(e){return s.HasPropertyKey(e,"unevaluatedItems")&&G(e.unevaluatedItems)}function Cc(e){return s.HasPropertyKey(e,"unevaluatedProperties")&&G(e.unevaluatedProperties)}var ut=class{constructor(){this.indices=new Set,this.keys=new Set}AddIndex(t){return this.indices.add(t),!0}AddKey(t){return this.keys.add(t),!0}GetIndices(){return this.indices}GetKeys(){return this.keys}Merge(t){for(let n of t)n.indices.forEach(o=>this.indices.add(o)),n.keys.forEach(o=>this.keys.add(o));return!0}},da=class extends ut{constructor(t){super(),this.callback=t}AddError(t){return this.callback(t),!1}},He=class extends da{constructor(){super(t=>this.errors.push(t)),this.errors=[]}AddError(t){return this.errors.push(t),!1}GetErrors(){return this.errors}};var mG="external_",lG=0,$Se={identifier:`${mG}${lG}`,variables:[]};function Fb(e,t,n,o){return n["~guard"].check(o)}function Bb(e,t,n,o,i,a){return i["~guard"].check(a)||t.AddError({keyword:"~guard",schemaPath:n,instancePath:o,params:{errors:i["~guard"].errors(a)}})}function Hb(e,t,n,o){return s.Every(n["~refine"],0,(i,a)=>i.refine(o))}function Kb(e,t,n,o,i,a){return s.EveryAll(i["~refine"],0,(c,m)=>c.refine(a)||t.AddError({keyword:"~refine",schemaPath:n,instancePath:o,params:{index:m,message:c.message}}))}function zb(e){return ko(e)&&s.IsArray(e.items)}function Vb(e,t,n,o){return zb(n)?o.every((a,c)=>s.IsLessThan(c,n.items.length)||D(e,t,n.additionalItems,a)&&t.AddIndex(c)):!0}function Yb(e,t,n,o,i,a){return zb(i)?a.every((m,l)=>{let f=`${n}/additionalItems`,y=`${o}/${l}`;return s.IsLessThan(l,i.items.length)||W(e,t,f,y,i.additionalItems,m)&&t.AddIndex(l)}):!0}function dG(e){return`^${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}$`}function Qb(e){let t=[];return ma(e)&&t.push(...s.Keys(e.patternProperties)),la(e)&&t.push(...s.Keys(e.properties).map(dG)),s.IsEqual(t.length,0)?"(?!)":`(${t.join("|")})`}function Wb(e,t,n,o){let i=new RegExp(Qb(n));return s.Every(s.Keys(o),0,(c,m)=>i.test(c)||D(e,t,n.additionalProperties,o[c])&&t.AddKey(c))}function Zb(e,t,n,o,i,a){let c=new RegExp(Qb(i)),m=[];return s.EveryAll(s.Keys(a),0,(f,y)=>{let T=`${n}/additionalProperties`,A=`${o}/${f}`,ye=new He,Ue=c.test(f)||W(e,ye,T,A,i.additionalProperties,a[f])&&t.AddKey(f);return Ue||m.push(f),Ue})||t.AddError({keyword:"additionalProperties",schemaPath:n,instancePath:o,params:{additionalProperties:m}})}function Xb(e,t,n,o){let i=n.allOf.reduce((a,c)=>{let m=new ut;return D(e,m,c,o)?[...a,m]:a},[]);return s.IsEqual(i.length,n.allOf.length)&&t.Merge(i)}function Jb(e,t,n,o,i,a){let c=[],m=i.allOf.reduce((f,y,T)=>{let A=`${n}/allOf/${T}`,ye=new He,Ue=W(e,ye,A,o,y,a);return Ue||c.push(ye),Ue?[...f,ye]:f},[]),l=s.IsEqual(m.length,i.allOf.length)&&t.Merge(m);return l||c.forEach(f=>f.GetErrors().forEach(y=>t.AddError(y))),l}function eS(e,t,n,o){let i=n.anyOf.reduce((a,c,m)=>{let l=new ut;return D(e,l,c,o)?[...a,l]:a},[]);return s.IsGreaterThan(i.length,0)&&t.Merge(i)}function tS(e,t,n,o,i,a){let c=[],m=i.anyOf.reduce((f,y,T)=>{let A=new He,ye=`${n}/anyOf/${T}`,Ue=W(e,A,ye,o,y,a);return Ue||c.push(A),Ue?[...f,A]:f},[]),l=s.IsGreaterThan(m.length,0)&&t.Merge(m);return l||c.forEach(f=>f.GetErrors().forEach(y=>t.AddError(y))),l||t.AddError({keyword:"anyOf",schemaPath:n,instancePath:o,params:{}})}function _m(e,t,n,o){return n}function rS(e,t,n,o,i,a){return _m(e,t,i,a)||t.AddError({keyword:"boolean",schemaPath:n,instancePath:o,params:{}})}function bm(e,t,n,o){return s.IsValueLike(n.const)?s.IsEqual(o,n.const):s.IsDeepEqual(o,n.const)}function nS(e,t,n,o,i,a){return bm(e,t,i,a)||t.AddError({keyword:"const",schemaPath:n,instancePath:o,params:{allowedValue:i.const}})}function fG(e){return!(kn(e)&&s.IsEqual(e.minContains,0))}function Sm(e,t,n,o){return fG(n)?!s.IsEqual(o.length,0)&&o.some(i=>D(e,t,n.contains,i)):!0}function oS(e,t,n,o,i,a){return Sm(e,t,i,a)||t.AddError({keyword:"contains",schemaPath:n,instancePath:o,params:{minContains:1}})}function iS(e,t,n,o){let i=s.IsEqual(s.Keys(o).length,0),a=s.Every(s.Entries(n.dependencies),0,([c,m])=>!s.HasPropertyKey(o,c)||(s.IsArray(m)?m.every(l=>s.HasPropertyKey(o,l)):D(e,t,m,o)));return i||a}function aS(e,t,n,o,i,a){let c=s.IsEqual(s.Keys(a).length,0),m=s.EveryAll(s.Entries(i.dependencies),0,([l,f])=>{let y=`${n}/dependencies/${l}`;return!s.HasPropertyKey(a,l)||(s.IsArray(f)?f.every(T=>s.HasPropertyKey(a,T)||t.AddError({keyword:"dependencies",schemaPath:n,instancePath:o,params:{property:l,dependencies:f}})):W(e,t,y,o,f,a))});return c||m}function sS(e,t,n,o){let i=s.IsEqual(s.Keys(o).length,0),a=s.Every(s.Entries(n.dependentRequired),0,([c,m])=>!s.HasPropertyKey(o,c)||m.every(l=>s.HasPropertyKey(o,l)));return i||a}function cS(e,t,n,o,i,a){let c=s.IsEqual(s.Keys(a).length,0),m=s.EveryAll(s.Entries(i.dependentRequired),0,([l,f])=>!s.HasPropertyKey(a,l)||s.EveryAll(f,0,y=>s.HasPropertyKey(a,y)||t.AddError({keyword:"dependentRequired",schemaPath:n,instancePath:o,params:{property:l,dependencies:f}})));return c||m}function pS(e,t,n,o){let i=s.IsEqual(s.Keys(o).length,0),a=s.Every(s.Entries(n.dependentSchemas),0,([c,m])=>!s.HasPropertyKey(o,c)||D(e,t,m,o));return i||a}function uS(e,t,n,o,i,a){let c=s.IsEqual(s.Keys(a).length,0),m=s.EveryAll(s.Entries(i.dependentSchemas),0,([l,f])=>{let y=`${n}/dependentSchemas/${l}`;return!s.HasPropertyKey(a,l)||W(e,t,y,o,f,a)});return c||m}function Om(e,t,n,o){return n.enum.some(i=>s.IsValueLike(i)?s.IsEqual(o,i):s.IsDeepEqual(o,i))}function mS(e,t,n,o,i,a){return Om(e,t,i,a)||t.AddError({keyword:"enum",schemaPath:n,instancePath:o,params:{allowedValues:i.enum}})}function Am(e,t,n,o){return s.IsLessThan(o,n.exclusiveMaximum)}function lS(e,t,n,o,i,a){return Am(e,t,i,a)||t.AddError({keyword:"exclusiveMaximum",schemaPath:n,instancePath:o,params:{comparison:"<",limit:i.exclusiveMaximum}})}function xm(e,t,n,o){return s.IsGreaterThan(o,n.exclusiveMinimum)}function dS(e,t,n,o,i,a){return xm(e,t,i,a)||t.AddError({keyword:"exclusiveMinimum",schemaPath:n,instancePath:o,params:{comparison:">",limit:i.exclusiveMinimum}})}var $o={};Lt($o,{Clear:()=>gS,Entries:()=>LG,Get:()=>MG,Has:()=>vG,IsDate:()=>fa,IsDateTime:()=>Rm,IsDuration:()=>Cm,IsEmail:()=>Pm,IsHostname:()=>Um,IsIPv4:()=>km,IsIPv6:()=>vm,IsIdnEmail:()=>wm,IsIdnHostname:()=>Lm,IsIri:()=>Dm,IsIriReference:()=>Mm,IsJsonPointer:()=>$m,IsJsonPointerUriFragment:()=>Gm,IsRegex:()=>jm,IsRelativeJsonPointer:()=>qm,IsTime:()=>ga,IsUri:()=>Hm,IsUriReference:()=>Fm,IsUriTemplate:()=>Bm,IsUrl:()=>Km,IsUuid:()=>zm,Reset:()=>yS,Set:()=>kG,Test:()=>DG});var gG=[0,31,28,31,30,31,30,31,31,30,31,30,31],yG=/^(\d\d\d\d)-(\d\d)-(\d\d)$/;function hG(e){return e%4===0&&(e%100!==0||e%400===0)}function fa(e){let t=yG.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&&hG(n)?29:gG[o])}var TG=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(?:Z|([+-])(\d\d):(\d\d))?$/i;function ga(e,t=!0){let n=TG.exec(e);if(!n)return!1;let o=+n[1],i=+n[2],a=+n[3],c=n[4]==="-"?-1:1,m=+(n[5]||0),l=+(n[6]||0);if(m>23||l>59||t&&!n[4]&&e.toLowerCase().indexOf("z")===-1)return!1;if(o<=23&&i<=59&&a<60)return!0;let f=i-l*c,y=o-m*c-(f<0?1:0);return(y===23||y===-1)&&(f===59||f===-1)&&a<61}function Rm(e,t=!0){let n=e.split(/T/i);return n.length===2&&fa(n[0])&&ga(n[1],t)}var EG=/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/;function Cm(e){return EG.test(e)}var IG=/^(?!.*\.\.)[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 Pm(e){return IG.test(e)}var _G=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i;function Um(e){return _G.test(e)}var bG=/^(?!.*\.\.)[\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 wm(e){return bG.test(e)}function Nm(e){let t=e.codePointAt(0);return t===void 0?!1:t>=12352&&t<=12447||t>=12448&&t<=12543&&t!==12539||t>=19968&&t<=40959}function Lm(e){if(e.length===0||e.includes(" "))return!1;let t=/[\u002E\u3002\uFF0E\uFF61]/g,n=e.normalize("NFC").replace(t,".");if(n.length>253)return!1;let o=n.split(".");if(o.some(i=>i.length===0))return!1;for(let i of o){if(i.length>63||i.startsWith("-")||i.endsWith("-"))return!1;if(/^xn--/i.test(i)){let l=i.slice(4);if(l.length<2||l.includes("---"))return!1;continue}if(/[\u302E\u302F\u3031\u3032\u3033\u3034\u3035\u303B\u0640\u07FA]/.test(i))return!1;let a=i.charAt(0);if(/[\u0903\u0300\u0488]/.test(a))return!1;for(let l=0;l<i.length;l++){let f=i.charAt(l);if(f==="\xB7"){if(l===0||l===i.length-1)return!1;let y=i.charAt(l-1),T=i.charAt(l+1);if(!/^[lL]$/.test(y)||!/^[lL]$/.test(T))return!1}if(f==="\u30FB"){if(i.length===1)return!1;if(l===0){let y=i.charAt(l+1);if(!Nm(y))return!1}else{let y=i.charAt(l-1),T=i.charAt(l+1);if(!Nm(y)||!Nm(T))return!1}}if(f==="\u0375"){if(l===i.length-1)return!1;let y=i.charAt(l+1);if(!/[\u0370-\u03FF]/.test(y))return!1}if(f==="\u05F3"||f==="\u05F4"){if(l===0)return!1;let y=i.charAt(l-1);if(!/[\u05D0-\u05EA]/.test(y))return!1}if(f==="\u200D"&&(l===0||i.charAt(l-1)!=="\u094D"))return!1}let c=!1,m=!1;for(let l=0;l<i.length;l++){let f=i.charAt(l);/[\u0660-\u0669]/.test(f)&&(c=!0),/[\u06F0-\u06F9]/.test(f)&&(m=!0)}if(c&&m)return!1}return!0}var SG=/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/;function km(e){return SG.test(e)}var OG=/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i;function vm(e){return OG.test(e)}function fS(e){try{return new URL(e,"http://example.com"),!0}catch{return!1}}function Mm(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))?fS(e):e.match(/^([a-zA-Z][a-zA-Z0-9+\-.]*)(\/\/)/)&&t===-1?!1:fS(e)}function Dm(e){try{return new URL(e),!0}catch{return!1}}var AG=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;function Gm(e){return AG.test(e)}var xG=/^(?:\/(?:[^~/]|~0|~1)*)*$/;function $m(e){return xG.test(e)}function jm(e){if(e.length===0)return!1;try{return new RegExp(e),!0}catch{return!1}}var RG=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function qm(e){return RG.test(e)}var CG=/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i;function Fm(e){return CG.test(e)}var PG=/^(?:(?:[^\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 Bm(e){return PG.test(e)}var UG=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i;function Hm(e){return UG.test(e)}var wG=/^(?: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 Km(e){return wG.test(e)}var NG=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;function zm(e){return NG.test(e)}var ge=new Map;function gS(){ge.clear()}function LG(){return[...ge.entries()]}function kG(e,t){ge.set(e,t)}function vG(e){return ge.has(e)}function MG(e){return ge.get(e)}function DG(e,t){return ge.get(e)?.(t)??!0}function yS(){gS(),ge.set("date-time",Rm),ge.set("date",fa),ge.set("duration",Cm),ge.set("email",Pm),ge.set("hostname",Um),ge.set("idn-email",wm),ge.set("idn-hostname",Lm),ge.set("ipv4",km),ge.set("ipv6",vm),ge.set("iri-reference",Mm),ge.set("iri",Dm),ge.set("json-pointer-uri-fragment",Gm),ge.set("json-pointer",$m),ge.set("regex",jm),ge.set("relative-json-pointer",qm),ge.set("time",ga),ge.set("uri-reference",Fm),ge.set("uri-template",Bm),ge.set("uri",Hm),ge.set("url",Km),ge.set("uuid",zm)}yS();function Vm(e,t,n,o){return $o.Test(n.format,o)}function hS(e,t,n,o,i,a){return Vm(e,t,i,a)||t.AddError({keyword:"format",schemaPath:n,instancePath:o,params:{format:i.format}})}function TS(e,t,n,o){let i=Tm(n)?n.then:!0,a=nm(n)?n.else:!0;return D(e,t,n.if,o)?D(e,t,i,o):D(e,t,a,o)}function ES(e,t,n,o,i,a){let c=Tm(i)?i.then:!0,m=nm(i)?i.else:!0,l=new He,f=W(e,l,`${n}/if`,o,i.if,a)?W(e,l,`${n}/then`,o,c,a)||t.AddError({keyword:"if",schemaPath:n,instancePath:o,params:{failingKeyword:"then"}}):W(e,t,`${n}/else`,o,m,a)||t.AddError({keyword:"if",schemaPath:n,instancePath:o,params:{failingKeyword:"else"}});return f&&t.Merge([l]),f}function GG(e,t,n,o){return s.Every(n.items,0,(i,a)=>s.IsLessEqualThan(o.length,a)||D(e,t,i,o[a])&&t.AddIndex(a))}function $G(e,t,n,o,i,a){return s.EveryAll(i.items,0,(c,m)=>{let l=`${n}/items/${m}`,f=`${o}/${m}`;return s.IsLessEqualThan(a.length,m)||W(e,t,l,f,c,a[m])&&t.AddIndex(m)})}function jG(e,t,n,o){let i=Mo(n)?n.prefixItems.length:0;return s.Every(o,i,(a,c)=>D(e,t,n.items,a)&&t.AddIndex(c))}function qG(e,t,n,o,i,a){let c=Mo(i)?i.prefixItems.length:0;return s.EveryAll(a,c,(m,l)=>{let f=`${n}/items`,y=`${o}/${l}`;return W(e,t,f,y,i.items,m)&&t.AddIndex(l)})}function IS(e,t,n,o){return sm(n)?GG(e,t,n,o):jG(e,t,n,o)}function _S(e,t,n,o,i,a){return sm(i)?$G(e,t,n,o,i,a):qG(e,t,n,o,i,a)}function FG(e){return Nn(e)}function Ym(e,t,n,o){if(!FG(n))return!0;let i=o.reduce((a,c)=>D(e,t,n.contains,c)?++a:a,0);return s.IsLessEqualThan(i,n.maxContains)}function bS(e,t,n,o,i,a){let c=kn(i)?i.minContains:1;return Ym(e,t,i,a)||t.AddError({keyword:"contains",schemaPath:n,instancePath:o,params:{minContains:c,maxContains:i.maxContains}})}function Qm(e,t,n,o){return s.IsLessEqualThan(o,n.maximum)}function SS(e,t,n,o,i,a){return Qm(e,t,i,a)||t.AddError({keyword:"maximum",schemaPath:n,instancePath:o,params:{comparison:"<=",limit:i.maximum}})}function Wm(e,t,n,o){return s.IsLessEqualThan(o.length,n.maxItems)}function OS(e,t,n,o,i,a){return Wm(e,t,i,a)||t.AddError({keyword:"maxItems",schemaPath:n,instancePath:o,params:{limit:i.maxItems}})}function Zm(e,t,n,o){return s.IsMaxLength(o,n.maxLength)}function AS(e,t,n,o,i,a){return Zm(e,t,i,a)||t.AddError({keyword:"maxLength",schemaPath:n,instancePath:o,params:{limit:i.maxLength}})}function Xm(e,t,n,o){return s.IsLessEqualThan(s.Keys(o).length,n.maxProperties)}function xS(e,t,n,o,i,a){return Xm(e,t,i,a)||t.AddError({keyword:"maxProperties",schemaPath:n,instancePath:o,params:{limit:i.maxProperties}})}function BG(e){return Nn(e)}function Jm(e,t,n,o){if(!BG(n))return!0;let i=o.reduce((a,c)=>D(e,t,n.contains,c)?++a:a,0);return s.IsGreaterEqualThan(i,n.minContains)}function RS(e,t,n,o,i,a){return Jm(e,t,i,a)||t.AddError({keyword:"contains",schemaPath:n,instancePath:o,params:{minContains:i.minContains}})}function el(e,t,n,o){return s.IsGreaterEqualThan(o,n.minimum)}function CS(e,t,n,o,i,a){return el(e,t,i,a)||t.AddError({keyword:"minimum",schemaPath:n,instancePath:o,params:{comparison:">=",limit:i.minimum}})}function tl(e,t,n,o){return s.IsGreaterEqualThan(o.length,n.minItems)}function PS(e,t,n,o,i,a){return tl(e,t,i,a)||t.AddError({keyword:"minItems",schemaPath:n,instancePath:o,params:{limit:i.minItems}})}function rl(e,t,n,o){return s.IsMinLength(o,n.minLength)}function US(e,t,n,o,i,a){return rl(e,t,i,a)||t.AddError({keyword:"minLength",schemaPath:n,instancePath:o,params:{limit:i.minLength}})}function nl(e,t,n,o){return s.IsGreaterEqualThan(s.Keys(o).length,n.minProperties)}function wS(e,t,n,o,i,a){return nl(e,t,i,a)||t.AddError({keyword:"minProperties",schemaPath:n,instancePath:o,params:{limit:i.minProperties}})}function ol(e,t,n,o){return s.IsMultipleOf(o,n.multipleOf)}function NS(e,t,n,o,i,a){return ol(e,t,i,a)||t.AddError({keyword:"multipleOf",schemaPath:n,instancePath:o,params:{multipleOf:i.multipleOf}})}function il(e,t,n,o){let i=new ut;return!D(e,i,n.not,o)&&t.Merge([i])}function LS(e,t,n,o,i,a){return il(e,t,i,a)||t.AddError({keyword:"not",schemaPath:n,instancePath:o,params:{}})}function kS(e,t,n,o){let i=n.oneOf.reduce((a,c)=>{let m=new ut;return D(e,m,c,o)?[...a,m]:a},[]);return s.IsEqual(i.length,1)&&t.Merge(i)}function vS(e,t,n,o,i,a){let c=[],m=[],l=i.oneOf.reduce((y,T,A)=>{let ye=new He,Ue=`${n}/oneOf/${A}`,Pr=W(e,ye,Ue,o,T,a);return Pr&&m.push(A),Pr||c.push(ye),Pr?[...y,ye]:y},[]),f=s.IsEqual(l.length,1)&&t.Merge(l);return!f&&s.IsEqual(m.length,0)&&c.forEach(y=>y.GetErrors().forEach(T=>t.AddError(T))),f||t.AddError({keyword:"oneOf",schemaPath:n,instancePath:o,params:{passingSchemas:m}})}function al(e,t,n,o){return(s.IsString(n.pattern)?new RegExp(n.pattern):n.pattern).test(o)}function MS(e,t,n,o,i,a){return al(e,t,i,a)||t.AddError({keyword:"pattern",schemaPath:n,instancePath:o,params:{pattern:i.pattern}})}function DS(e,t,n,o){return s.Every(s.Entries(n.patternProperties),0,([i,a])=>{let c=new RegExp(i);return s.Every(s.Entries(o),0,([m,l])=>!c.test(m)||D(e,t,a,l)&&t.AddKey(m))})}function GS(e,t,n,o,i,a){return s.EveryAll(s.Entries(i.patternProperties),0,([c,m])=>{let l=`${n}/patternProperties/${c}`,f=new RegExp(c);return s.EveryAll(s.Entries(a),0,([y,T])=>{let A=`${o}/${y}`;return!f.test(y)||W(e,t,l,A,m,T)&&t.AddKey(y)})})}function $S(e,t,n,o){return s.IsEqual(o.length,0)||s.Every(n.prefixItems,0,(i,a)=>s.IsLessEqualThan(o.length,a)||D(e,t,i,o[a])&&t.AddIndex(a))}function jS(e,t,n,o,i,a){return s.IsEqual(a.length,0)||s.EveryAll(i.prefixItems,0,(c,m)=>{let l=`${n}/prefixItems/${m}`,f=`${o}/${m}`;return s.IsLessEqualThan(a.length,m)||W(e,t,l,f,c,a[m])&&t.AddIndex(m)})}function sl(e,t){return e.includes(t)||Rt.Get().exactOptionalPropertyTypes}function cl(e,t){return s.IsUndefined(e[t])}function qS(e,t,n,o){let i=vn(n)?n.required:[];return s.Every(s.Entries(n.properties),0,([c,m])=>{let l=!s.HasPropertyKey(o,c)||D(e,t,m,o[c])&&t.AddKey(c);return sl(i,c)?l:cl(o,c)||l})}function FS(e,t,n,o,i,a){let c=vn(i)?i.required:[];return s.EveryAll(s.Entries(i.properties),0,([l,f])=>{let y=`${n}/properties/${l}`,T=`${o}/${l}`,A=()=>!s.HasPropertyKey(a,l)||W(e,t,y,T,f,a[l])&&t.AddKey(l);return sl(c,l)?A():cl(a,l)||A()})}function BS(e,t,n,o){return s.Every(s.Keys(o),0,(i,a)=>D(e,t,n.propertyNames,i))}function HS(e,t,n,o,i,a){let c=[];return s.EveryAll(s.Keys(a),0,(l,f)=>{let y=`${o}/${l}`,T=`${n}/propertyNames`,A=new He,ye=W(e,A,T,y,i.propertyNames,l);return ye||c.push(l),ye})||t.AddError({keyword:"propertyNames",schemaPath:n,instancePath:o,params:{propertyNames:c}})}function KS(e,t,n,o){let i=e.RecursiveRef(n.$recursiveRef)??!1;return G(i)&&D(e,t,i,o)}function zS(e,t,n,o,i,a){let c=e.RecursiveRef(i.$recursiveRef)??!1;return G(c)&&W(e,t,"#",o,c,a)}function QS(e,t,n,o){let i=e.Ref(n.$ref)??!1,a=new ut,c=G(i)&&D(e,a,i,o);return c&&t.Merge([a]),c}function WS(e,t,n,o,i,a){let c=e.Ref(i.$ref)??!1,m=new He,l=G(c)&&W(e,m,"#",o,c,a);return l&&t.Merge([m]),l||m.GetErrors().forEach(f=>t.AddError(f)),l}function ZS(e,t,n,o){return s.Every(n.required,0,i=>s.HasPropertyKey(o,i))}function XS(e,t,n,o,i,a){let c=[];return s.EveryAll(i.required,0,l=>{let f=s.HasPropertyKey(a,l);return f||c.push(l),f})||t.AddError({keyword:"required",schemaPath:n,instancePath:o,params:{requiredProperties:c}})}function pl(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,"asyncIterator")?s.IsAsyncIterator(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,"iterator")?s.IsIterator(i):s.IsEqual(n,"symbol")?s.IsSymbol(i):s.IsEqual(n,"undefined")?s.IsUndefined(i):s.IsEqual(n,"void")?s.IsUndefined(i):!0}function JS(e,t,n,o,i){return n.some(a=>pl(e,t,a,o,i))}function eO(e,t,n,o){return s.IsArray(n.type)?JS(e,t,n.type,n,o):pl(e,t,n.type,n,o)}function tO(e,t,n,o,i,a){return(s.IsArray(i.type)?JS(e,t,i.type,i,a):pl(e,t,i.type,i,a))||t.AddError({keyword:"type",schemaPath:n,instancePath:o,params:{type:i.type}})}function rO(e,t,n,o){let i=t.GetIndices();return s.Every(o,0,(a,c)=>(i.has(c)||D(e,t,n.unevaluatedItems,a))&&t.AddIndex(c))}function nO(e,t,n,o,i,a){let c=t.GetIndices(),m=[];return s.EveryAll(a,0,(f,y)=>{let T=new He,A=(c.has(y)||W(e,T,n,o,i.unevaluatedItems,f))&&t.AddIndex(y);return A||m.push(y),A})||t.AddError({keyword:"unevaluatedItems",schemaPath:n,instancePath:o,params:{unevaluatedItems:m}})}function oO(e,t,n,o){let i=t.GetKeys();return s.Every(s.Entries(o),0,([a,c])=>i.has(a)||D(e,t,n.unevaluatedProperties,c)&&t.AddKey(a))}function iO(e,t,n,o,i,a){let c=t.GetKeys(),m=[];return s.EveryAll(s.Entries(a),0,([f,y])=>{let T=new He,A=c.has(f)||W(e,T,n,o,i.unevaluatedProperties,y)&&t.AddKey(f);return A||m.push(f),A})||t.AddError({keyword:"unevaluatedProperties",schemaPath:n,instancePath:o,params:{unevaluatedProperties:m}})}function aO(e){return!s.IsEqual(e.uniqueItems,!1)}function sO(e,t,n,o){if(!aO(n))return!0;let i=new Set(o.map(Dr.Hash)).size,a=o.length;return s.IsEqual(i,a)}function cO(e,t,n,o,i,a){if(!aO(i))return!0;let c=new Set,m=a.reduce((f,y,T)=>{let A=Dr.Hash(y);return c.has(A)?[...f,T]:(c.add(A),f)},[]);return s.IsEqual(m.length,0)||t.AddError({keyword:"uniqueItems",schemaPath:n,instancePath:o,params:{duplicateItems:m}})}function D(e,t,n,o){e.Push(n);let i=Oc(n)?_m(e,t,n,o):(!Em(n)||eO(e,t,n,o))&&(!(s.IsObject(o)&&!s.IsArray(o))||(!vn(n)||ZS(e,t,n,o))&&(!Tr(n)||Wb(e,t,n,o))&&(!Ju(n)||iS(e,t,n,o))&&(!em(n)||sS(e,t,n,o))&&(!tm(n)||pS(e,t,n,o))&&(!ma(n)||DS(e,t,n,o))&&(!la(n)||qS(e,t,n,o))&&(!gm(n)||BS(e,t,n,o))&&(!pa(n)||nl(e,t,n,o))&&(!mm(n)||Xm(e,t,n,o)))&&(!s.IsArray(o)||(!Qu(n)||Vb(e,t,n,o))&&(!Nn(n)||Sm(e,t,n,o))&&(!ko(n)||IS(e,t,n,o))&&(!pm(n)||Ym(e,t,n,o))&&(!Ac(n)||Wm(e,t,n,o))&&(!kn(n)||Jm(e,t,n,o))&&(!vo(n)||tl(e,t,n,o))&&(!Mo(n)||$S(e,t,n,o))&&(!Do(n)||sO(e,t,n,o)))&&(!s.IsString(o)||(!sa(n)||Vm(e,t,n,o))&&(!um(n)||Zm(e,t,n,o))&&(!ca(n)||rl(e,t,n,o))&&(!ua(n)||al(e,t,n,o)))&&(!(s.IsNumber(o)||s.IsBigInt(o))||(!im(n)||Am(e,t,n,o))&&(!Er(n)||xm(e,t,n,o))&&(!cm(n)||Qm(e,t,n,o))&&(!Ir(n)||el(e,t,n,o))&&(!lm(n)||ol(e,t,n,o)))&&(!ym(n)||KS(e,t,n,o))&&(!hm(n)||QS(e,t,n,o))&&(!Vu(n)||Fb(e,t,n,o))&&(!Xu(n)||bm(e,t,n,o))&&(!om(n)||Om(e,t,n,o))&&(!am(n)||TS(e,t,n,o))&&(!dm(n)||il(e,t,n,o))&&(!Wu(n)||Xb(e,t,n,o))&&(!Zu(n)||eS(e,t,n,o))&&(!fm(n)||kS(e,t,n,o))&&(!Rc(n)||!s.IsArray(o)||rO(e,t,n,o))&&(!Cc(n)||!s.IsObject(o)||oO(e,t,n,o))&&(!Yu(n)||Hb(e,t,n,o));return e.Pop(n),i}function W(e,t,n,o,i,a){e.Push(i);let c=Oc(i)?rS(e,t,n,o,i,a):!!(+(!Em(i)||tO(e,t,n,o,i,a))&+(!(s.IsObject(a)&&!s.IsArray(a))||!!(+(!vn(i)||XS(e,t,n,o,i,a))&+(!Tr(i)||Zb(e,t,n,o,i,a))&+(!Ju(i)||aS(e,t,n,o,i,a))&+(!em(i)||cS(e,t,n,o,i,a))&+(!tm(i)||uS(e,t,n,o,i,a))&+(!ma(i)||GS(e,t,n,o,i,a))&+(!la(i)||FS(e,t,n,o,i,a))&+(!gm(i)||HS(e,t,n,o,i,a))&+(!pa(i)||wS(e,t,n,o,i,a))&+(!mm(i)||xS(e,t,n,o,i,a))))&+(!s.IsArray(a)||!!(+(!Qu(i)||Yb(e,t,n,o,i,a))&+(!Nn(i)||oS(e,t,n,o,i,a))&+(!ko(i)||_S(e,t,n,o,i,a))&+(!pm(i)||bS(e,t,n,o,i,a))&+(!Ac(i)||OS(e,t,n,o,i,a))&+(!kn(i)||RS(e,t,n,o,i,a))&+(!vo(i)||PS(e,t,n,o,i,a))&+(!Mo(i)||jS(e,t,n,o,i,a))&+(!Do(i)||cO(e,t,n,o,i,a))))&+(!s.IsString(a)||!!(+(!sa(i)||hS(e,t,n,o,i,a))&+(!um(i)||AS(e,t,n,o,i,a))&+(!ca(i)||US(e,t,n,o,i,a))&+(!ua(i)||MS(e,t,n,o,i,a))))&+(!(s.IsNumber(a)||s.IsBigInt(a))||!!(+(!im(i)||lS(e,t,n,o,i,a))&+(!Er(i)||dS(e,t,n,o,i,a))&+(!cm(i)||SS(e,t,n,o,i,a))&+(!Ir(i)||CS(e,t,n,o,i,a))&+(!lm(i)||NS(e,t,n,o,i,a))))&+(!ym(i)||zS(e,t,n,o,i,a))&+(!hm(i)||WS(e,t,n,o,i,a))&+(!Vu(i)||Bb(e,t,n,o,i,a))&+(!Xu(i)||nS(e,t,n,o,i,a))&+(!om(i)||mS(e,t,n,o,i,a))&+(!am(i)||ES(e,t,n,o,i,a))&+(!dm(i)||LS(e,t,n,o,i,a))&+(!Wu(i)||Jb(e,t,n,o,i,a))&+(!Zu(i)||tS(e,t,n,o,i,a))&+(!fm(i)||vS(e,t,n,o,i,a))&+(!Rc(i)||!s.IsArray(a)||nO(e,t,n,o,i,a))&+(!Cc(i)||!s.IsObject(a)||iO(e,t,n,o,i,a)))&&(!Yu(i)||Kb(e,t,n,o,i,a));return e.Pop(i),c}var Dn={};Lt(Dn,{Ref:()=>r$});var _r={};Lt(_r,{Delete:()=>WG,Get:()=>YG,Has:()=>VG,Indices:()=>ya,Set:()=>QG});function pO(e){if(e.length===0)throw Error("Cannot set root")}function uO(e){if(!s.IsObject(e))throw Error("Cannot set value")}function HG(e){return/^(0|[1-9]\d*)$/.test(e)}function mO(e){return[e.slice(0,e.length-1),e.slice(e.length-1)[0]]}function KG(e,t){return s.IsObject(t)&&s.HasPropertyKey(t,e)}function zG(e,t){return s.IsObject(t)?t[e]:void 0}function ul(e,t){return e.reduce((n,o)=>zG(o,n),t)}function ya(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 VG(e,t){let n=e;return ya(t).every(o=>KG(o,n)?(n=n[o],!0):!1)}function YG(e,t){let n=ya(t);return ul(n,e)}function QG(e,t,n){let o=ya(t);pO(o);let[i,a]=mO(o),c=ul(i,e);return uO(c),c[a]=n,e}function WG(e,t){let n=ya(t);pO(n);let[o,i]=mO(n),a=ul(o,e);return uO(a),s.IsArray(a)&&HG(i)?a.splice(+i,1):delete a[i],e}function ZG(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("#")?lO(e,t,n):e}function XG(e,t,n){let o=new URL(`#${e.$anchor}`,t.href),i=new URL(n.href,t.href);if(s.IsEqual(o.href,i.href))return e}function lO(e,t,n){return n.href.endsWith("#")?e:n.hash.startsWith("#")?_r.Get(e,decodeURIComponent(n.hash.slice(1))):void 0}function JG(e,t,n){if(Ln(e)){let o=ZG(e,t,n);if(!s.IsUndefined(o))return o}if(aa(e)){let o=XG(e,t,n);if(!s.IsUndefined(o))return o}return lO(e,t,n)}function e$(e,t,n){return e.reduce((o,i)=>{let a=ml(i,t,n);return s.IsUndefined(a)?o:a},void 0)}function t$(e,t,n){return s.Keys(e).reduce((o,i)=>{let a=ml(e[i],t,n);return s.IsUndefined(a)?o:a},void 0)}function ml(e,t,n){if(t=hr(e)&&Ln(e)?new URL(e.$id,t.href):t,hr(e)){let o=JG(e,t,n);if(!s.IsUndefined(o))return o}if(s.IsArray(e))return e$(e,t,n);if(s.IsObject(e))return t$(e,t,n)}function r$(e,t){let n=new URL("http://unknown"),o=Ln(e)?new URL(e.$id,n.href):n,i=new URL(t,o.href);return ml(e,o,i)}var Gn=class{constructor(t,n){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){hr(t)&&(Ln(t)&&this.ids.push(t),aa(t)&&this.anchors.push(t),xc(t)&&this.recursiveAnchors.push(t),rm(t)&&this.dynamicAnchors.push(t))}Pop(t){hr(t)&&(Ln(t)&&this.ids.pop(),aa(t)&&this.anchors.pop(),xc(t)&&this.recursiveAnchors.pop(),rm(t)&&this.dynamicAnchors.pop())}FromContext(t){return s.HasPropertyKey(this.context,t)?this.context[t]:void 0}FromRef(t){return t.startsWith("#")?Dn.Ref(this.Base(),t):Dn.Ref(this.schema,t)}Ref(t){return this.FromContext(t)??this.FromRef(t)}RecursiveRef(t){return xc(this.Base())?Dn.Ref(this.recursiveAnchors[0],t):Dn.Ref(this.Base(),t)}};function dO(...e){let[t,n,o]=ae.Match(e,{3:(c,m,l)=>[c,m,l],2:(c,m)=>[{},c,m]}),i=new Gn(t,n),a=new ut;return D(i,a,n,o)}function fO(...e){let[t,n,o]=ae.Match(e,{3:(y,T,A)=>[y,T,A],2:(y,T)=>[{},y,T]}),i=Rt.Get(),a=Yf(),c=[],m=new Gn(t,n),l=new da(y=>{if(!s.IsGreaterEqualThan(c.length,i.maxErrors))return c.push({...y,message:a(y)})});return[W(m,l,"#","",n,o),c]}function de(...e){let[t,n,o]=ae.Match(e,{3:(i,a,c)=>[i,a,c],2:(i,a)=>[{},i,a]});return dO(t,n,o)}function tn(...e){let[t,n,o]=ae.Match(e,{3:(c,m,l)=>[c,m,l],2:(c,m)=>[{},c,m]}),[i,a]=fO(t,n,o);return a}var rn=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 gO(e,t,n){return s.IsArray(n)?n.map(o=>ze(e,t.items,o)):n}function yO(e,t,n){return t.Clean(n)}function hO(e,t,n){return ze({...e,...t.$defs},we(t.$ref),n)}function o$(e){let t=s.HasPropertyKey(e,"unevaluatedProperties")?{additionalProperties:e.unevaluatedProperties}:{},n=Ft(e);return v(n)?mc(n,t):n}function TO(e,t,n){let o=o$(t);return ze(e,o,n)}function Pc(e){return s.HasPropertyKey(e,"additionalProperties")?e.additionalProperties:void 0}function EO(e,t,n){if(!s.IsObject(n)||s.IsArray(n))return n;let o=Pc(t);for(let i of s.Keys(n)){if(s.HasPropertyKey(t.properties,i)){n[i]=ze(e,t.properties[i],n[i]);continue}if(s.IsBoolean(o)&&s.IsEqual(o,!0)||O(o)&&de(e,o,n[i])){n[i]=ze(e,o,n[i]);continue}delete n[i]}return n}function IO(e,t,n){if(!s.IsObject(n))return n;let o=Pc(t),[i,a]=[new RegExp(St(t)),Xe(t)];for(let c of s.Keys(n)){if(i.test(c)){n[c]=ze(e,a,n[c]);continue}if(s.IsBoolean(o)&&s.IsEqual(o,!0)||O(o)&&de(e,o,n[c])){n[c]=ze(e,o,n[c]);continue}delete n[c]}return n}function _O(e,t,n){return s.HasPropertyKey(e,t.$ref)?ze(e,e[t.$ref],n):n}function bO(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]=ze(e,t.items[i],n[i]);return s.IsGreaterThan(n.length,o)?n.slice(0,o):n}function i$(e){let t={};for(let n of Object.getOwnPropertyNames(e))t[n]=fe(e[n]);for(let n of Object.getOwnPropertySymbols(e))t[n]=fe(e[n]);return t}function a$(e){return s.IsClassInstance(e)?e:i$(e)}function s$(e){return e.map(t=>fe(t))}function c$(e){return e.slice()}function p$(e){return new Map(fe([...e.entries()]))}function u$(e){return new Set(fe([...e.values()]))}function fe(e){return it.IsTypeArray(e)?c$(e):it.IsMap(e)?p$(e):it.IsSet(e)?u$(e):s.IsArray(e)?s$(e):s.IsObject(e)?a$(e):e}function SO(e,t,n){for(let o of t.anyOf){let i=ze(e,o,fe(n));if(de(e,o,i))return i}return n}function ze(e,t,n){return te(t)?gO(e,t,n):Ct(t)?yO(e,t,n):le(t)?hO(e,t,n):w(t)?TO(e,t,n):v(t)?EO(e,t,n):Ie(t)?IO(e,t,n):pe(t)?_O(e,t,n):Y(t)?bO(e,t,n):S(t)?SO(e,t,n):n}function jn(...e){let[t,n,o]=ae.Match(e,{3:(i,a,c)=>[i,a,c],2:(i,a)=>[{},i,a]});return ze(t,n,o)}function OO(e,t,n){return s.IsArray(n)?n.map(o=>Le(e,t.items,o)):n}function AO(e,t,n){return t.Convert(n)}var oe={};Lt(oe,{Fail:()=>qn,IsOk:()=>dl,Ok:()=>U,TryBigInt:()=>fl,TryBoolean:()=>P$,TryNull:()=>M$,TryNumber:()=>K$,TryString:()=>X$,TryUndefined:()=>i1});function dl(e){return s.IsObject(e)&&s.HasPropertyKey(e,"value")}function U(e){return{value:e}}function qn(){}function m$(e){return U(e)}function l$(e){return s.IsEqual(e,!0)?U(BigInt(1)):U(BigInt(0))}function d$(e){return U(BigInt(Math.trunc(e)))}function f$(e){return U(BigInt(0))}var g$=/^-?(0|[1-9]\d*)n$/,y$=/^-?(0|[1-9]\d*)\.\d+$/,h$=/^-?(0|[1-9]\d*)$/;function T$(e){return g$.test(e)}function E$(e){return y$.test(e)}function I$(e){return h$.test(e)}function _$(e){let t=e.toLowerCase();return T$(e)?U(BigInt(e.slice(0,e.length-1))):E$(e)?U(BigInt(e.split(".")[0])):I$(e)?U(BigInt(e)):s.IsEqual(t,"false")?U(BigInt(0)):s.IsEqual(t,"true")?U(BigInt(1)):void 0}function b$(e){return U(BigInt(0))}function fl(e){return s.IsBigInt(e)?m$(e):s.IsBoolean(e)?l$(e):s.IsNumber(e)?d$(e):s.IsNull(e)?f$(e):s.IsString(e)?_$(e):s.IsUndefined(e)?b$(e):void 0}function S$(e){return s.IsEqual(e,BigInt(0))?U(!1):s.IsEqual(e,BigInt(1))?U(!0):void 0}function O$(e){return U(e)}function A$(e){return s.IsEqual(e,0)?U(!1):s.IsEqual(e,1)?U(!0):void 0}function x$(e){return U(!1)}function R$(e){return s.IsEqual(e.toLowerCase(),"false")?U(!1):s.IsEqual(e.toLowerCase(),"true")?U(!0):s.IsEqual(e,"0")?U(!1):s.IsEqual(e,"1")?U(!0):void 0}function C$(e){return U(!1)}function P$(e){return s.IsBigInt(e)?S$(e):s.IsBoolean(e)?O$(e):s.IsNumber(e)?A$(e):s.IsNull(e)?x$(e):s.IsString(e)?R$(e):s.IsUndefined(e)?C$(e):void 0}function U$(e){return s.IsEqual(e,BigInt(0))?U(null):void 0}function w$(e){return s.IsEqual(e,!1)?U(null):void 0}function N$(e){return s.IsEqual(e,0)?U(null):void 0}function L$(e){return U(null)}function k$(e){let t=e.toLowerCase();return s.IsEqual(t,"undefined")||s.IsEqual(t,"null")||s.IsEqual(e,"")||s.IsEqual(e,"0")?U(null):void 0}function v$(e){return U(null)}function M$(e){return s.IsBigInt(e)?U$(e):s.IsBoolean(e)?w$(e):s.IsNumber(e)?N$(e):s.IsNull(e)?L$(e):s.IsString(e)?k$(e):s.IsUndefined(e)?v$(e):void 0}var D$=BigInt(Number.MAX_SAFE_INTEGER),G$=BigInt(Number.MIN_SAFE_INTEGER);function $$(e){return e<=D$&&e>=G$}function xO(e){return $$(e)?U(Number(e)):void 0}function j$(e){return e?U(1):U(0)}function q$(e){return U(e)}function F$(e){return U(0)}function B$(e){let t=+e;if(s.IsNumber(t))return U(t);let n=e.toLowerCase();if(s.IsEqual(n,"false"))return U(0);if(s.IsEqual(n,"true"))return U(1);let o=fl(e);return dl(o)?xO(o.value):void 0}function H$(e){return U(0)}function K$(e){return s.IsBigInt(e)?xO(e):s.IsBoolean(e)?j$(e):s.IsNumber(e)?q$(e):s.IsNull(e)?F$(e):s.IsString(e)?B$(e):s.IsUndefined(e)?H$(e):void 0}function z$(e){return U(e.toString())}function V$(e){return U(e.toString())}function Y$(e){return U(e.toString())}function Q$(e){return U("null")}function W$(e){return U(e)}function Z$(e){return U("")}function X$(e){return s.IsBigInt(e)?z$(e):s.IsBoolean(e)?V$(e):s.IsNumber(e)?Y$(e):s.IsNull(e)?Q$(e):s.IsString(e)?W$(e):s.IsUndefined(e)?Z$(e):void 0}function J$(e){return s.IsEqual(e,BigInt(0))?U(void 0):void 0}function e1(e){return s.IsEqual(e,!1)?U(void 0):void 0}function t1(e){return s.IsEqual(e,0)?U(void 0):void 0}function r1(e){return U(void 0)}function n1(e){let t=e.toLowerCase();return s.IsEqual(t,"undefined")||s.IsEqual(t,"null")||s.IsEqual(e,"")||s.IsEqual(e,"0")?U(void 0):void 0}function o1(e){return U(void 0)}function i1(e){return s.IsBigInt(e)?J$(e):s.IsBoolean(e)?e1(e):s.IsNumber(e)?t1(e):s.IsNull(e)?r1(e):s.IsString(e)?n1(e):s.IsUndefined(e)?o1(e):void 0}function RO(e,t,n){if(s.IsBigInt(n))return n;let o=oe.TryBigInt(n);return oe.IsOk(o)?o.value:n}function CO(e,t,n){if(s.IsBoolean(n))return n;let o=oe.TryBoolean(n);return oe.IsOk(o)?o.value:n}function PO(e,t,n){return Le({...e,...t.$defs},we(t.$ref),n)}function Uc(e,t,n){if(t.anyOf.some(c=>de(e,c,n)))return n;let a=t.anyOf.map(c=>Le(e,c,fe(n))).find(c=>de(e,t,c));return s.IsUndefined(a)?n:a}function UO(e,t,n){let o=On(t);return Uc(e,o,n)}function wO(e,t,n){if(s.IsInteger(n))return n;let o=oe.TryNumber(n);return oe.IsOk(o)?Math.trunc(o.value):n}function NO(e,t,n){let o=Ft(t);return Le(e,o,n)}function a1(e,t,n){let o=oe.TryBigInt(n);return oe.IsOk(o)&&s.IsEqual(t.const,o.value)?o.value:n}function s1(e,t,n){let o=oe.TryBoolean(n);return oe.IsOk(o)&&s.IsEqual(t.const,o.value)?o.value:n}function c1(e,t,n){let o=oe.TryNumber(n);return oe.IsOk(o)&&s.IsEqual(t.const,o.value)?o.value:n}function p1(e,t,n){let o=oe.TryString(n);return oe.IsOk(o)&&s.IsEqual(t.const,o.value)?o.value:n}function LO(e,t,n){return s.IsEqual(t.const,n)?n:rg(t)?a1(e,t,n):ng(t)?s1(e,t,n):oo(t)?c1(e,t,n):io(t)?p1(e,t,n):H()}function kO(e,t,n){if(s.IsNull(n))return n;let o=oe.TryNull(n);return oe.IsOk(o)?o.value:n}function vO(e,t,n){if(s.IsNumber(n))return n;let o=oe.TryNumber(n);return oe.IsOk(o)?o.value:n}function wc(e,t,n,o){let i=s.Keys(o);for(let[a,c]of t)for(let m of i)a.test(m)||(o[m]=Le(e,n,o[m]));return o}function ha(e,t,n){return ve(e)&&s.IsUndefined(n[t])}function u1(e,t,n){let o=s.EntriesRegExp(t.properties),i=s.Keys(n);for(let[a,c]of o)for(let m of i)!a.test(m)||ha(c,m,n)||(n[m]=Le(e,c,n[m]));return s.HasPropertyKey(t,"additionalProperties")&&s.IsObject(t.additionalProperties)?wc(e,o,t.additionalProperties,n):n}function MO(e,t,n){return s.IsObjectNotArray(n)?u1(e,t,n):n}function m1(e,t,n){let o=s.EntriesRegExp(t.patternProperties),i=s.Keys(n);for(let[a,c]of o)for(let m of i)a.test(m)&&(n[m]=Le(e,c,n[m]));return s.HasPropertyKey(t,"additionalProperties")&&s.IsObject(t.additionalProperties)?wc(e,o,t.additionalProperties,n):n}function DO(e,t,n){return s.IsObjectNotArray(n)?m1(e,t,n):n}function GO(e,t,n){return s.HasPropertyKey(e,t.$ref)?Le(e,e[t.$ref],n):n}function $O(e,t,n){if(s.IsString(n))return n;let o=oe.TryString(n);return oe.IsOk(o)?o.value:n}function jO(e,t,n){let o=Je(t.pattern);return Le(e,o,n)}function qO(e,t,n){if(!s.IsArray(n))return n;for(let o=0;o<Math.min(t.items.length,n.length);o++)n[o]=Le(e,t.items[o],n[o]);return n}function FO(e,t,n){if(s.IsUndefined(n))return n;let o=oe.TryUndefined(n);return oe.IsOk(o)?o.value:n}function BO(e,t,n){if(s.IsUndefined(n))return n;let o=oe.TryUndefined(n);return oe.IsOk(o)?void 0:n}function Le(e,t,n){return te(t)?OO(e,t,n):Ct(t)?AO(e,t,n):bt(t)?RO(e,t,n):ct(t)?CO(e,t,n):le(t)?PO(e,t,n):xe(t)?UO(e,t,n):qe(t)?wO(e,t,n):w(t)?NO(e,t,n):X(t)?LO(e,t,n):Wt(t)?kO(e,t,n):Ee(t)?vO(e,t,n):v(t)?MO(e,t,n):Ie(t)?DO(e,t,n):pe(t)?GO(e,t,n):Ne(t)?$O(e,t,n):Re(t)?jO(e,t,n):Y(t)?qO(e,t,n):er(t)?FO(e,t,n):S(t)?Uc(e,t,n):Ot(t)?BO(e,t,n):n}function nn(...e){let[t,n,o]=ae.Match(e,{3:(i,a,c)=>[i,a,c],2:(i,a)=>[{},i,a]});return Le(t,n,o)}function HO(e,t,n){if(!s.IsArray(n))return n;for(let o=0;o<n.length;o++)n[o]=je(e,t.items,n[o]);return n}function KO(e,t,n){return t.Default(n)}function zO(e,t,n){return je({...e,...t.$defs},we(t.$ref),n)}function VO(e,t){return s.IsUndefined(t)?s.IsFunction(e.default)?e.default():fe(e.default):t}function YO(e,t,n){let o=Ft(t);return je(e,o,n)}function QO(e,t,n){if(!s.IsObject(n))return n;let o=s.Keys(t.properties);for(let i of o){let a=je(e,t.properties[i],n[i]);s.IsUndefined(a)&&(ve(t.properties[i])||!s.HasPropertyKey(t.properties[i],"default"))||(n[i]=je(e,t.properties[i],n[i]))}if(!Tr(t)||s.IsBoolean(t.additionalProperties))return n;for(let i of s.Keys(n))o.includes(i)||(n[i]=je(e,t.additionalProperties,n[i]));return n}function WO(e,t,n){if(!s.IsObject(n))return n;let[o,i]=[new RegExp(St(t)),Xe(t)];for(let a of s.Keys(n))o.test(a)&&wt(i)&&(n[a]=je(e,i,n[a]));if(!Tr(t))return n;for(let a of s.Keys(n))o.test(a)||(n[a]=je(e,t.additionalProperties,n[a]));return n}function ZO(e,t,n){return s.HasPropertyKey(e,t.$ref)?je(e,e[t.$ref],n):n}function XO(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]=je(e,o[a],n[a]));return n}function JO(e,t,n){for(let o of t.anyOf){let i=je(e,o,fe(n));if(de(e,o,i))return i}return n}function je(e,t,n){let o=wt(t)?VO(t,n):n;return te(t)?HO(e,t,o):Ct(t)?KO(e,t,o):le(t)?zO(e,t,o):w(t)?YO(e,t,o):v(t)?QO(e,t,o):Ie(t)?WO(e,t,o):pe(t)?ZO(e,t,o):Y(t)?XO(e,t,o):S(t)?JO(e,t,o):o}function Fn(...e){let[t,n,o]=ae.Match(e,{3:(i,a,c)=>[i,a,c],2:(i,a)=>[{},i,a]});return je(t,n,o)}function jo(e){return(...t)=>{let[n,o,i]=ae.Match(t,{3:(a,c,m)=>[a,c,m],2:(a,c)=>[{},a,c]});return e.reduce((a,c)=>c(n,o,a),i)}}function l1(e,t,n){return t["~codec"].decode(n)}function d1(e,t,n){return t["~codec"].encode(n)}function Se(e,t,n,o){return En(n)?s.IsEqual(e,"Decode")?l1(t,n,o):d1(t,n,o):o}function f1(e,t,n,o){if(!s.IsArray(o))return H();for(let i=0;i<o.length;i++)o[i]=he(e,t,n.items,o[i]);return Se(e,t,n,o)}function g1(e,t,n,o){let i=Se(e,t,n,o);if(!s.IsArray(i))return i;for(let a=0;a<i.length;a++)i[a]=he(e,t,n.items,i[a]);return i}function eA(e,t,n,o){return s.IsEqual(e,"Decode")?f1(e,t,n,o):g1(e,t,n,o)}function tA(e,t,n,o){return o=he(e,{...t,...n.$defs},we(n.$ref),o),Se(e,t,n,o)}function y1(e,t,n,o){for(let i of n.allOf)o=he(e,t,i,o);return Se(e,t,n,o)}function h1(e,t,n,o){let i=Se(e,t,n,o);for(let a of n.allOf)i=he(e,t,a,i);return i}function rA(e,t,n,o){return s.IsEqual(e,"Decode")?y1(e,t,n,o):h1(e,t,n,o)}function T1(e,t,n,o){if(!s.IsObjectNotArray(o))return H();for(let i of s.Keys(n.properties))!s.HasPropertyKey(o,i)||ha(n.properties[i],i,o)||(o[i]=he(e,t,n.properties[i],o[i]));return Se(e,t,n,o)}function E1(e,t,n,o){let i=Se(e,t,n,o);if(!s.IsObjectNotArray(i))return i;for(let a of s.Keys(n.properties))!s.HasPropertyKey(i,a)||ha(n.properties[a],a,i)||(i[a]=he(e,t,n.properties[a],i[a]));return i}function nA(e,t,n,o){return s.IsEqual(e,"Decode")?T1(e,t,n,o):E1(e,t,n,o)}function I1(e,t,n,o){if(!s.IsObjectNotArray(o))return H();let i=new RegExp(St(n));for(let a of s.Keys(o))i.test(a)||H(),o[a]=he(e,t,Xe(n),o[a]);return Se(e,t,n,o)}function _1(e,t,n,o){let i=Se(e,t,n,o);if(!s.IsObjectNotArray(i))return i;let a=new RegExp(St(n));for(let c of s.Keys(i))a.test(c)&&(i[c]=he(e,t,Xe(n),i[c]));return i}function oA(e,t,n,o){return s.IsEqual(e,"Decode")?I1(e,t,n,o):_1(e,t,n,o)}function iA(e,t,n,o){return o=s.HasPropertyKey(t,n.$ref)?he(e,t,t[n.$ref],o):o,Se(e,t,n,o)}function b1(e,t,n,o){if(!s.IsArray(o))return H();for(let i=0;i<Math.min(n.items.length,o.length);i++)o[i]=he(e,t,n.items[i],o[i]);return Se(e,t,n,o)}function S1(e,t,n,o){let i=Se(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]=he(e,t,n.items[a],i[a]);return i}function aA(e,t,n,o){return s.IsEqual(e,"Decode")?b1(e,t,n,o):S1(e,t,n,o)}function O1(e,t,n,o){for(let i of n.anyOf){if(!de(t,i,o))continue;let a=he(e,t,i,o);return Se(e,t,n,a)}return H()}function A1(e,t,n,o){let i=Se(e,t,n,o);for(let a of n.anyOf){let c=he(e,t,a,fe(i));if(de(t,a,c))return c}return i}function sA(e,t,n,o){return s.IsEqual(e,"Decode")?O1(e,t,n,o):A1(e,t,n,o)}function he(e,t,n,o){return te(n)?eA(e,t,n,o):le(n)?tA(e,t,n,o):w(n)?rA(e,t,n,o):v(n)?nA(e,t,n,o):Ie(n)?oA(e,t,n,o):pe(n)?iA(e,t,n,o):Y(n)?aA(e,t,n,o):S(n)?sA(e,t,n,o):Se(e,t,n,o)}var gl=class extends rn{constructor(t,n){super("Decode",t,n)}};function x1(e,t,n){if(!de(e,t,n))throw new gl(n,tn(e,t,n));return n}function R1(e,t,n){return he("Decode",e,t,n)}var YMe=jo([(e,t,n)=>fe(n),(e,t,n)=>Fn(e,t,n),(e,t,n)=>nn(e,t,n),(e,t,n)=>jn(e,t,n),(e,t,n)=>x1(e,t,n),(e,t,n)=>R1(e,t,n)]);var yl=class extends rn{constructor(t,n){super("Encode",t,n)}};function C1(e,t,n){if(!de(e,t,n))throw new yl(n,tn(e,t,n));return n}function P1(e,t,n){return he("Encode",e,t,n)}var a0e=jo([(e,t,n)=>fe(n),(e,t,n)=>P1(e,t,n),(e,t,n)=>Fn(e,t,n),(e,t,n)=>nn(e,t,n),(e,t,n)=>jn(e,t,n),(e,t,n)=>C1(e,t,n)]);var Mt=class extends Error{constructor(t,n){super(n),this.type=t}};function cA(e,t){return s.IsFunction(t.default)?t.default(t):s.IsObject(t.default)?fe(t.default):t.default}function pA(e,t){if(Do(t)&&!wt(t))throw new Mt(t,"Arrays with uniqueItems constraints must specify a default annotation");let n=vo(t)?t.minItems:0;return Array.from({length:n},()=>Te(e,t.items))}async function*U1(){}function uA(e,t){return U1()}function mA(e,t){return t.Create()}function lA(e,t){return Er(t)?BigInt(t.exclusiveMinimum)+BigInt(1):Ir(t)?BigInt(t.minimum):BigInt(0)}function dA(e,t){return!1}function fA(e,t){let n=Te(e,t.instanceType);return class{constructor(){Object.assign(this,n)}}}function gA(e,t){return Te({...e,...t.$defs},we(t.$ref))}function yA(e,t){return Te(e,On(t))}function hA(e,t){let n=Te(e,t.returnType);return()=>n}function TA(e,t){return Er(t)&&s.IsNumber(t.exclusiveMinimum)?t.exclusiveMinimum+1:Ir(t)?t.minimum:0}function EA(e,t){return Te(e,Ft(t))}function*w1(){}function IA(e,t){return w1()}function _A(e,t){return t.const}function bA(e,t){throw new Mt(t,"Cannot create TNever types")}function SA(e,t){return null}function OA(e,t){return Er(t)&&s.IsNumber(t.exclusiveMinimum)?t.exclusiveMinimum+1:Ir(t)?t.minimum:0}function AA(e,t){return(s.IsUndefined(t.required)?[]:t.required).reduce((o,i)=>({...o,[i]:Te(e,t.properties[i])}),{})}function xA(e,t){return Promise.resolve(Te(e,t.item))}function RA(e,t){if(pa(t)&&!wt(t))throw new Mt(t,"Record with the minProperties constraint must have a default annotation");return{}}function CA(e,t){return s.HasPropertyKey(e,t.$ref)?Te(e,e[t.$ref]):(()=>{throw new Mt(t,"Unable to deref Ref")})()}function PA(e,t){if((ua(t)||sa(t))&&!wt(t))throw Error("Strings with format or pattern constraints must specify default");let o=ca(t)?t.minLength:0;return"".padEnd(o)}function UA(e,t){return Symbol()}function wA(e,t){let n=Je(t.pattern);if(Ne(n))throw new Mt(t,"Unable to create TemplateLiteral due to infinite type expansion");return Te(e,n)}function NA(e,t){return Array.from({length:t.minItems},(n,o)=>Te(e,t.items[o]))}function LA(e,t){if(s.IsEqual(t.anyOf.length,0))throw Error("Unable to create Union with no variants");return Te(e,t.anyOf[0])}function Te(e,t){return wt(t)?cA(e,t):te(t)?pA(e,t):nt(t)?uA(e,t):Ct(t)?mA(e,t):bt(t)?lA(e,t):ct(t)?dA(e,t):Me(t)?fA(e,t):le(t)?gA(e,t):xe(t)?yA(e,t):De(t)?hA(e,t):qe(t)?TA(e,t):w(t)?EA(e,t):ot(t)?IA(e,t):X(t)?_A(e,t):ur(t)?bA(e,t):Wt(t)?SA(e,t):Ee(t)?OA(e,t):v(t)?AA(e,t):Ze(t)?xA(e,t):Ie(t)?RA(e,t):pe(t)?CA(e,t):Ne(t)?PA(e,t):Zt(t)?UA(e,t):Re(t)?wA(e,t):Y(t)?NA(e,t):er(t)?void 0:S(t)?LA(e,t):Ot(t)?void 0:void 0}function ar(...e){let[t,n]=ae.Match(e,{2:(o,i)=>[o,i],1:o=>[{},o]});return Te(t,n)}var hl=class extends rn{constructor(t,n){super("Parse",t,n)}};function N1(e,t,n){if(!de(e,t,n))throw new hl(n,tn(e,t,n));return n}var m$e=jo([(e,t,n)=>fe(n),(e,t,n)=>Fn(e,t,n),(e,t,n)=>nn(e,t,n),(e,t,n)=>jn(e,t,n),(e,t,n)=>N1(e,t,n)]);var k1=N({type:V("insert"),path:Tt(),value:Qe()}),v1=Object({type:V("update"),path:Tt(),value:Qe()}),M1=N({type:V("delete"),path:Tt()}),T$e=$([k1,v1,M1]);function qo(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]:ar(t)}function Ta(e,t,n,o,i){e.command(t).description(n).option("-f, --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){re(qo(o));return}let c=Lo(a),m=await i()(o,{body:c});re(m)})}function MA(e,t){let n=e.command("experimental").description("Experimental commands \u2014 unstable, subject to change without notice");Ta(n,"promql","Run a PromQL query (experimental)",jb,t)}var j1=`/${"v1"}/feedback`,DA=r.Object({id:r.String({description:"API request ID recorded with the feedback."})},{$id:"Feedback",description:"A recorded piece of feedback"}),q1={id:"request-123-abc"};Object.assign(DA,{examples:[q1]});var GA=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."})}),F1={content:"The traces command times out for large services."};Object.assign(GA,{examples:[F1]});var $A=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:j1,method:"POST",body:GA,response:DA});function jA(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()($A,{body:{content:n.join(" ")}});re(o)})}var B1={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:["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:{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"]},service:{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:[]}},H1={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:[]},inventory:{read:["viewer","editor","admin"],write:[]},log:{read:["viewer","editor","admin"],write:[]},"log-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:["admin"],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:[]},service:{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:[]}},K1={user:B1,team:H1};function El(e){return qA(e,"team")}function Il(e){return qA(e,"user")}function qA(e,t){let n=[],o=K1[t];for(let[i,a]of Object.entries(o))for(let[c,m]of Object.entries(a))m.includes(e)&&n.push({actionType:c,resourceType:i});return n}var yqe={admin:{name:"Global admin",description:"Full control across the organization. Can view and modify everything, including private teams.",permissions:Il("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:Il("public_editor"),roleKey:"public_editor"},public_viewer:{name:"Public viewer",description:"Read-only access to public team data. Cannot make changes.",permissions:Il("public_viewer"),roleKey:"public_viewer"},teams_only:{name:"Teams only",description:"Only access data and assets in their own teams.",permissions:[],roleKey:"teams_only"}},hqe={admin:{name:"Team admin",description:"Full team control, manage assets, members, and settings.",permissions:El("admin"),roleKey:"admin"},editor:{name:"Team editor",description:"Can view and update most assets (like dashboards, monitors).",permissions:El("editor"),roleKey:"editor"},viewer:{name:"Team viewer",description:"Can view all team data but cannot make changes.",permissions:El("viewer"),roleKey:"viewer"}};var _l=["red","orange","amber","yellow","green","emerald","teal","cyan","sky","blue","indigo","purple","pink"],bl=["light","dark"];var z1={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)"}},FA=["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 Sqe=z1.light.red.background;var BA=[{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-----
41
127
  MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDAC4AWkdwKYSd8
42
128
  Ks14IReLcYgADhoXk56ZzXI=
43
- -----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}"}],K$=qO.map(e=>e.key),B$e=new Set(K$),q$e=qO.map(e=>e.key);function HO(e){return e.replace(/ies$/,"y").replace(/s$/,"")}var KO=["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"],zO=["alert_queries","alert_thresholds","alert_values"],z$=[...KO,...zO],VO=["alert_event_name","alert_message"],yGe=[...z$,...VO],hGe=new Set([...KO,...VO]),EGe=new Set(zO);var V$="^\\S(.*\\S)?$",YO=128,QO=256,Y$=n.Object({key:n.String({description:"Tag key attached to the resource. Consumers can use key/value tags for filtering, ownership context, and policy checks."}),value:n.String({description:"Tag value attached to the resource for this key. Tsuga returns the value exactly as stored."})},{title:"Tag"}),Q$=n.Object({key:n.String({maxLength:YO,description:`Tag key to attach to the resource. Maximum length is ${YO} characters.`}),value:n.String({maxLength:QO,pattern:V$,description:`Tag value to attach to the resource. Maximum length is ${QO} characters and leading or trailing whitespace is rejected.`})},{title:"Tag"}),Un=n.Array(Y$,{title:"Tags",description:"Key/value tags applied to the resource. Use them to organize resources and to satisfy tag policies."}),Nn=n.Array(Q$,{title:"Tags",maxItems:50,description:"Key/value tags to apply to the resource. Up to 50 tags are accepted and tag policies may require specific keys or values."}),Qe=n.Optional(Un),et=n.Optional(Nn);var Yr="/v0/teams",Js=["public","private"],Xs={NAME:"name",CREATED_AT:"createdAt",MEMBER_COUNT:"memberCount",VISIBILITY:"visibility"},W$=n.Enum([Xs.NAME,Xs.CREATED_AT,Xs.MEMBER_COUNT,Xs.VISIBILITY],{description:"Team field used for sorting list responses. Use `name`, `createdAt`, `memberCount`, or `visibility`."}),ZO=n.Object({color:n.Enum(Gu,{description:"Color token used by Tsuga when rendering the team avatar."}),mode:n.Enum(ju,{description:"Avatar rendering mode selected for the team."}),iconName:n.Enum(BO,{description:"Icon name rendered inside the team avatar when icon mode is used."})}),Fu=n.Object({color:n.Enum(Gu),mode:n.Enum(ju)}),Z$=100,WO=250,wo=n.Object({id:n.String({description:"Unique identifier of the team. Generated by Tsuga and stable for the team lifetime."}),name:n.String({description:"Human-readable team name displayed throughout Tsuga and used in team search."}),description:n.Optional(n.String({description:"Optional team description supplied by a user."})),visibility:n.Enum(Js,{description:"`public` makes team-owned resources discoverable according to access controls. `private` restricts discovery to team members and authorized users."}),tags:Qe,createdAt:T({description:"Timestamp when Tsuga created the team."}),updatedAt:T({description:"Timestamp when Tsuga last updated the team metadata."}),memberCount:n.Optional(n.Number({description:"Number of members currently in the team"})),avatar:n.Optional(ZO)}),ec=n.Object({name:n.String({minLength:1,maxLength:Z$,description:"Name to assign to the team"}),description:n.Optional(n.String({maxLength:WO,description:`Optional team description. Maximum length is ${WO} characters.`})),visibility:n.Enum(Js,{description:"`public` makes team-owned resources discoverable according to access controls. `private` restricts discovery to team members and authorized users."}),tags:et,avatar:n.Optional(ZO)}),X$=n.Object({id:n.String(),name:n.String(),email:n.String(),role:n.Enum(Io),joinedTeamAt:T(),orgRole:n.Enum($s),avatar:n.Optional(Fu)}),a1e=d({tags:["teams"],url:Yr,method:"GET",paginated:!0,response:n.Array(wo),query:n.Object({...te,includeMemberCount:n.Optional(n.Boolean()),searchQuery:n.Optional(m({description:"Substring matched against team names and descriptions."})),visibility:n.Optional(n.Enum(Js,{description:"Restrict results to teams with this visibility."})),myTeamsOnly:n.Optional(n.Boolean({description:"If true, return only teams that include the authenticated user."})),sortBy:n.Optional(W$),sortDirection:n.Optional(n.Enum(["asc","desc"],{description:"Sort direction: ascending or descending."}))})}),s1e=d({tags:["teams"],url:`${Yr}/:id`,method:"GET",params:n.Object({id:m()}),response:wo}),c1e=d({tags:["teams"],url:`${Yr}/:id/members`,method:"GET",params:n.Object({id:m()}),response:n.Array(X$)}),p1e=d({tags:["teams"],url:`${Yr}/:id/assets`,method:"GET",params:n.Object({id:m()}),response:n.Object({apiKeyCount:n.Number(),logRouteCount:n.Number(),monitorCount:n.Number(),notificationRuleCount:n.Number(),dashboardCount:n.Number()})}),m1e=d({tags:["teams"],url:Yr,method:"POST",body:ec,response:wo}),u1e=d({tags:["teams"],url:`${Yr}/:id`,method:"PUT",params:n.Object({id:m()}),body:ec,response:wo}),l1e=d({tags:["teams"],url:`${Yr}/bulk-update`,method:"POST",body:n.Object({teamIds:n.Array(m(),{maxItems:100}),config:n.Object({visibility:n.Enum(Js)})}),response:n.Object({})}),d1e=d({tags:["teams"],url:`${Yr}/:id`,method:"DELETE",params:n.Object({id:m()}),response:L});var J$=n.Enum(["terraform-provider","web-frontend","mcp-server","cli"],{description:"Tsuga client surface that performed the operation. Use this to distinguish UI, CLI, MCP, and Terraform-originated changes."}),he=O("type",[n.Object({type:n.Literal("user",{description:"The resource was created or updated by a user."}),id:n.String({description:"Unique identifier of the user actor."}),name:n.String({description:"Display name of the user actor at the time of response."}),avatar:n.Optional(Fu)}),n.Object({type:n.Literal("operation-api-key",{description:"The resource was created or updated by an operation API key."}),id:n.String({description:"Unique identifier of the operation API key actor."}),name:n.String({description:"Display name of the operation API key actor."}),source:n.Optional(J$)})],{description:"User or operation API key responsible for creating or updating a resource. Returned by Tsuga for audit context."});var eG=["all","owning-team-and-public","owning-team-only"],Bu=n.Enum(eG,{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 wt="/v0/monitors",Lo=["alert","resolve","keep_last_status","consider_zero"],tc=["alert","resolve","keep_last_status"];var JO=["no_aggregation","all","any","each","proportion"],eS=["greater_than","less_than","equal","not_equal","greater_than_or_equal","less_than_or_equal"];var tG=n.Object({formula:n.String({description:"Formula result to compare against the threshold, usually `q1` or a formula alias."}),operator:n.Enum(eS,{description:"Comparison operator used to evaluate the threshold condition."}),threshold:n.Number({description:"Numeric threshold value used by the comparison."})}),rG=n.Object({formula:m({type:"tsuga-formula",description:"Formula result to compare against the threshold, usually `q1` or a formula alias."}),operator:n.Enum(eS,{description:"Comparison operator used to evaluate the threshold condition."}),threshold:n.Number({description:"Numeric threshold value used by the comparison."})}),qu=n.Array(tG),Hu=n.Array(rG),tS=n.Object({formula:n.String({description:"Formula result analyzed for anomalous behavior, usually `q1` or a formula alias."}),conditionType:n.Enum(["rate","error","cpu","general","to_be_set"],{description:"Anomaly model type used to classify expected behavior."})}),rS=n.Object({formula:m({type:"tsuga-formula",description:"Formula result analyzed for anomalous behavior, usually `q1` or a formula alias."}),conditionType:n.Enum(["rate","error","cpu","general","to_be_set"],{description:"Anomaly model type used to classify expected behavior."})}),_t=[1,2,3,4,5];var Ji={timeframe:n.Number({description:"Timeframe of the monitor in minutes"}),groupByFields:n.Array(n.Object({fields:n.Array(n.String(),{description:"Fields used by the monitor group by."}),limit:n.Number({description:"Configured limit for this group by. Warning! This setting is currently ignored. Monitor evaluation will instead apply a fixed limit of 100 groups per field."})}),{description:"Monitor group by configuration. Warning! Note that the limit setting is currently ignored."}),aggregationAlertLogic:n.Optional(n.Enum(JO,{description:"How grouped results are combined into alert state: no aggregation, all groups, any group, each group, or a matching proportion."})),proportionAlertThreshold:n.Optional(n.Integer({description:"Percentage threshold used when `aggregationAlertLogic` is `proportion`."}))},ea={timeframe:n.Number({description:"Timeframe of the monitor in minutes"}),groupByFields:n.Array(n.Object({fields:n.Array(m(),{description:"Fields used by the monitor group by."}),limit:n.Number({description:"Configured limit for this group by. Warning! This setting is currently ignored. Monitor evaluation will instead apply a fixed limit of 100 groups per field."})}),{maxItems:1,description:"Monitor group by configuration. Warning! Note that the limit setting is currently ignored."}),aggregationAlertLogic:n.Optional(n.Enum(JO,{description:"How grouped results are combined into alert state: no aggregation, all groups, any group, each group, or a matching proportion."})),proportionAlertThreshold:n.Optional(n.Integer({minimum:1,maximum:99,description:"Percentage threshold used when `aggregationAlertLogic` is `proportion`. Valid values are 1 through 99."}))},nS=n.Object({type:n.Literal("metric",{description:"Threshold monitor over metric aggregations."}),conditions:qu,noDataBehavior:n.Enum(Lo,{description:"How the monitor updates state when no data is returned: alert, resolve, keep last status, or consider zero."}),...Ji,queries:_o},{$id:"MonitorConfigurationMetric"}),oS=n.Object({type:n.Literal("metric",{description:"Threshold monitor over metric aggregations."}),conditions:Hu,noDataBehavior:n.Enum(Lo,{description:"How the monitor updates state when no data is returned: alert, resolve, keep last status, or consider zero."}),...ea,queries:bo},{$id:"InputMonitorConfigurationMetric"}),iS=n.Object({type:n.Literal("log",{description:"Threshold monitor over log aggregations."}),conditions:qu,noDataBehavior:n.Enum(Lo,{description:"How the monitor updates state when no data is returned: alert, resolve, keep last status, or consider zero."}),...Ji,queries:_o},{$id:"MonitorConfigurationLog"}),aS=n.Object({type:n.Literal("log",{description:"Threshold monitor over log aggregations."}),conditions:Hu,noDataBehavior:n.Enum(Lo,{description:"How the monitor updates state when no data is returned: alert, resolve, keep last status, or consider zero."}),...ea,queries:bo},{$id:"InputMonitorConfigurationLog"}),sS=n.Object({type:n.Literal("trace",{description:"Threshold monitor over trace aggregations."}),conditions:qu,noDataBehavior:n.Enum(Lo,{description:"How the monitor updates state when no data is returned: alert, resolve, keep last status, or consider zero."}),...Ji,queries:_o},{$id:"MonitorConfigurationTrace"}),nG=n.Object({type:n.Literal("trace",{description:"Threshold monitor over trace aggregations."}),conditions:Hu,noDataBehavior:n.Enum(Lo,{description:"How the monitor updates state when no data is returned: alert, resolve, keep last status, or consider zero."}),...ea,queries:bo},{$id:"InputMonitorConfigurationTrace"}),cS=n.Object({type:n.Literal("anomaly-log",{description:"Anomaly monitor over log aggregations."}),condition:tS,noDataBehavior:n.Enum(tc,{description:"How the anomaly monitor updates state when no data is returned."}),...Ji,queries:_o},{$id:"MonitorConfigurationAnomalyLog"}),pS=n.Object({type:n.Literal("anomaly-log",{description:"Anomaly monitor over log aggregations."}),condition:rS,noDataBehavior:n.Enum(tc,{description:"How the anomaly monitor updates state when no data is returned."}),...ea,queries:bo},{$id:"InputMonitorConfigurationAnomalyLog"}),mS=n.Object({type:n.Literal("anomaly-metric",{description:"Anomaly monitor over metric aggregations."}),condition:tS,noDataBehavior:n.Enum(tc,{description:"How the anomaly monitor updates state when no data is returned."}),...Ji,queries:_o},{$id:"MonitorConfigurationAnomalyMetric"}),uS=n.Object({type:n.Literal("anomaly-metric",{description:"Anomaly monitor over metric aggregations."}),condition:rS,noDataBehavior:n.Enum(tc,{description:"How the anomaly monitor updates state when no data is returned."}),...ea,queries:bo},{$id:"InputMonitorConfigurationAnomalyMetric"}),lS=n.Object({type:n.Literal("certificate-expiry",{description:"Monitor that alerts before discovered certificates expire."}),warnBeforeInDays:n.Integer({description:"Number of days before certificate expiry when the monitor should warn."}),cloudAccounts:n.Optional(n.Array(n.String(),{description:"Cloud account IDs included in certificate checks."})),aggregationAlertLogic:n.Literal("each",{description:"Certificate expiry monitors alert independently for each certificate."}),noDataBehavior:n.Literal("resolve",{description:"Certificate expiry monitors resolve when matching certificate data disappears."})},{$id:"MonitorConfigurationCertificateExpiry"}),oG=n.Object({type:n.Literal("certificate-expiry",{description:"Monitor that alerts before discovered certificates expire."}),warnBeforeInDays:n.Integer({minimum:1,maximum:365,description:"Number of days before certificate expiry when the monitor should warn. Valid values are 1 through 365."}),cloudAccounts:n.Optional(n.Array(n.String(),{minItems:1,description:"Cloud account IDs included in certificate checks."})),aggregationAlertLogic:n.Literal("each",{description:"Certificate expiry monitors alert independently for each certificate."}),noDataBehavior:n.Literal("resolve",{description:"Certificate expiry monitors resolve when matching certificate data disappears."})},{$id:"InputMonitorConfigurationCertificateExpiry"}),dS=n.Object({type:n.Literal("log-error-pattern",{description:"Monitor that alerts on newly detected log error patterns."}),aggregationAlertLogic:n.Literal("each"),noDataBehavior:n.Literal("keep_last_status"),filter:n.Object({teamIds:n.Array(n.String(),{description:"Team IDs included in new error pattern detection."}),env:n.String({description:"Environment included in new error pattern detection."}),service:n.Optional(n.String({description:"Optional service name included in new error pattern detection."}))})},{$id:"MonitorConfigurationLogErrorPattern"}),iG=O("type",[nS,iS,sS,cS,mS,dS,lS]),aG=O("type",[oS,aS,nG,pS,uS,dS,oG]);var hr=n.Object({id:n.String({description:"Unique identifier of the monitor. Generated by Tsuga."}),name:n.String({description:"Display name of the monitor and alert source."}),owner:n.String({description:"Team ID that owns and manages the monitor."}),message:n.Optional(n.String({description:"Message to be displayed if a notification is triggered"})),tags:Qe,configuration:iG,priority:n.Enum(_t,{description:"Monitor priority from 1 through 5, where 1 is highest priority."}),permissions:Bu,dashboardId:n.Optional(n.String({description:"Identifier of a dashboard related to the monitor"})),pauseUntil:n.Optional(T({description:"Timestamp until which the monitor is snoozed."})),creator:n.Optional(he),updater:n.Optional(he),createdAt:T({description:"Timestamp when Tsuga created the monitor."}),updatedAt:T({description:"Timestamp when Tsuga last updated the monitor."}),assetUpdatedAt:T({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."}),clusterIds:n.Array(n.String(),{description:"Cluster IDs where the monitor is deployed. Empty means all eligible clusters."})},{title:"Monitor"}),sG=O("type",[nS,iS,sS,cS,mS,lS]),N1e=n.Object({...hr.properties,configuration:sG},{title:"Monitor"}),k1e=n.Object({...hr.properties,configuration:O("type",[oS,aS,pS,uS])},{title:"Monitor"}),ta=n.Object({name:m({description:"Display name of the monitor and alert source."}),message:n.Optional(m({type:"long",description:"Optional message included when notifications are sent."})),tags:et,configuration:aG,priority:n.Enum(_t,{description:"Monitor priority from 1 through 5, where 1 is highest priority."}),owner:m({allowEmpty:!1,description:"Team ID that owns and manages the monitor."}),dashboardId:n.Optional(m({description:"Optional dashboard ID related to this monitor."})),pauseUntil:n.Optional(m({allowEmpty:!1,type:"date-time",description:"ISO timestamp until which the monitor should be snoozed."})),permissions:Bu,clusterIds:n.Optional(n.Array(m({allowEmpty:!1}),{description:"Cluster IDs where the monitor should be deployed. Empty or omitted means all eligible clusters for cluster-deployed monitor types."}))}),XO=["threshold","certificate-expiry","anomaly-detection","log-error-pattern"],Qr={PRIORITY:"priority",TYPE:"type",NAME:"name",OWNER:"owner",TAGS:"tags",CLUSTER_IDS:"clusterIds",PAUSE_UNTIL:"pauseUntil",ASSET_UPDATED_AT:"assetUpdatedAt"};var fS=n.Object({owners:cr(m({allowEmpty:!1}),{description:"Restrict results to monitors owned by any of these team IDs",maxItems:50}),searchQuery:n.Object({value:m({allowEmpty:!1}),exclude:n.Optional(n.Boolean({description:"If true, exclude monitors matching this value instead of including them"}))},{description:"Substring matched against monitor name and configuration"}),tags:cr(Nn.items,{description:"Restrict results to monitors that have at least one of the listed key/value tags",maxItems:50}),priorities:cr(n.Enum(_t),{description:"Restrict results to monitors with one of these priorities",maxItems:_t.length}),types:cr(n.Enum(XO),{description:"Restrict results to monitors with these types",maxItems:XO.length}),activity:n.Enum(["active","snoozed"],{description:"Restrict results by activity status: active monitors or currently snoozed monitors"}),clusterIds:cr(m({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"}),Ku=n.Partial(n.Object({...te,filters:n.Partial(fS),sort:n.Object({by:n.Enum([Qr.PRIORITY,Qr.TYPE,Qr.NAME,Qr.OWNER,Qr.TAGS,Qr.CLUSTER_IDS,Qr.PAUSE_UNTIL,Qr.ASSET_UPDATED_AT],{description:"Field to sort the returned monitors by"}),direction:n.Enum(["asc","desc"],{description:"Sort direction: ascending or descending"})},{description:"Optional sorting applied to the returned monitors"})})),w1e=d({tags:["monitors"],url:`${wt}/query`,method:"POST",paginated:!0,response:n.Array(hr),body:Ku}),L1e=d({tags:["monitors"],url:`${wt}/tags/query`,method:"POST",body:n.Object({filters:n.Optional(n.Partial(n.Omit(fS,["tags"])))}),response:Un}),M1e=d({tags:["monitors"],url:`${wt}/:id`,method:"GET",params:n.Object({id:m()}),response:hr}),v1e=d({tags:["monitors"],url:wt,method:"POST",body:ta,response:hr}),D1e=d({tags:["monitors"],url:`${wt}/:id`,method:"PUT",params:n.Object({id:m()}),body:ta,response:hr}),$1e=d({tags:["monitors"],url:`${wt}/:id`,method:"DELETE",params:n.Object({id:m()}),response:L}),G1e=d({tags:["monitors"],url:`${wt}/:id/snooze`,method:"POST",params:n.Object({id:m()}),body:n.Object({pauseUntil:m({allowEmpty:!1,type:"date-time"})}),response:hr}),cG=["alert","ok","alert_consider_zero","ok_consider_zero","alert_no_data","ok_no_data","keep_last_status_ok","keep_last_status_alert"],kn=n.Enum(cG),pG=O("type",[n.Object({type:n.Literal("each"),subStates:n.Record(n.String(),n.Object({stateValue:n.Union([kn,n.Null()]),lastChangedAt:T()}))}),n.Object({type:n.Literal("no_aggregation"),stateValue:n.Optional(kn)}),n.Object({type:n.Literal("any"),stateValue:n.Optional(kn)}),n.Object({type:n.Literal("all"),stateValue:n.Optional(kn)}),n.Object({type:n.Literal("proportion"),stateValue:n.Optional(kn)})]),mG=n.Object({monitorId:n.String(),currentState:pG,lastChangedAt:n.Optional(T())}),j1e=d({tags:["monitors"],url:`${wt}/states/:id`,method:"GET",params:n.Object({id:m()}),response:mG}),F1e=d({tags:["monitors"],url:`${wt}/:id/transitions`,method:"GET",params:n.Object({id:m()}),query:n.Object({from:n.Number(),to:n.Number()}),response:n.Array(n.Object({id:n.String(),createdAt:T(),fromState:n.Optional(kn),toState:n.Optional(kn),dimension:n.Optional(n.String())}))}),uG=["unprocessed","processed","failed-to-process"],B1e=d({tags:["monitors"],url:`${wt}/:id/results`,method:"GET",params:n.Object({id:m()}),query:n.Object({from:n.Number(),to:n.Number()}),response:n.Object({isTruncated:n.Boolean(),results:n.Array(n.Object({id:n.String(),evaluationAt:T(),formulaResult:n.Object({groups:n.Array(n.Object({groupKey:n.Record(n.String(),cm),results:n.Array(n.Union([n.Number(),n.Null()])),conditionMet:n.Enum(["true","false","nan-no-data"])}))}),createdAt:T(),status:n.Enum(uG)}))})});var j="context";var H1e=`${j}.team`,K1e=`${j}.env`,z1e=`${j}.api_key_id`,rc=`${j}.service.name`,V1e=`${j}.service.version`,Y1e=`${j}.span.kind`,Q1e=`${j}.status.code`,gS=["SPAN_KIND_UNSPECIFIED","SPAN_KIND_INTERNAL","SPAN_KIND_SERVER","SPAN_KIND_CLIENT","SPAN_KIND_PRODUCER","SPAN_KIND_CONSUMER"];var ra=`${j}.host.name`,lG=`${j}.instance`,dG=`${j}.instanceid`,fG=`${j}.instance_name`,W1e=`${j}.telemetry.sdk.language`,Z1e=`${j}.process.runtime.name`,X1e=`${j}.scope.name`,J1e=`${j}.cloud.provider`,eje=`${j}.cloud.platform`,tje=`${j}.aws.ecs.task.arn`,rje=`${j}.k8s.cluster.name`,nje=`${j}.k8s.cluster.uid`,oje=`${j}.k8s.namespace.name`,ije=`${j}.k8s.pod.name`,aje=`${j}.k8s.pod.uid`,sje=`${j}.k8s.container.name`,cje=`${j}.k8s.node.name`,pje=`${j}.k8s.node.uid`,mje=`${j}.k8s.deployment.name`,uje=`${j}.k8s.deployment.uid`,lje=`${j}.k8s.replicaset.name`,dje=`${j}.k8s.replicaset.uid`,fje=`${j}.k8s.statefulset.name`,gje=`${j}.k8s.statefulset.uid`,yje=`${j}.k8s.daemonset.name`,hje=`${j}.k8s.daemonset.uid`,Eje=`${j}.k8s.job.name`,Tje=`${j}.k8s.job.uid`,Ije=`${j}.k8s.cronjob.name`,_je=`${j}.k8s.cronjob.uid`;var gG="db.system.name",yG="db.system",hG="db.namespace",EG="db.name";var bje=`span_attributes.${hG}`,Aje=`span_attributes.${EG}`,Oje=`span_attributes.${gG}`,Sje=`span_attributes.${yG}`;var xje={name:"tsuga.internal.processing_tag_policy_violations_total",attributes:{tagPolicyId:`${j}.tag_policy_id`,dataSource:`${j}.data_source`}};var Rje={name:"tsuga.internal.event_size_bytes",attributes:{batchKind:`${j}.batch_kind`,batchKindMetricsFilter:`${j}.batch_kind:metrics`,sourceApiKeyId:`${j}.source_api_key_id`,sourceEnv:`${j}.source_env`,sourceTeam:`${j}.source_team`}},yS="__tsuga_metadata__",Cje=`${yS}.signature`,Pje=`${yS}.routes`;var tr="/v0/service-catalog";var ES=n.Object({team:n.String({description:"Team name observed on telemetry for this service."}),lastSeenAt:T({description:"Most recent time this team was observed for the service."})}),TG=n.Object({ingestionApiKey:n.String({description:"Ingestion API key name or identifier observed on telemetry for this service."}),lastSeenAt:T({description:"Most recent time this ingestion key was observed for the service."})}),TS=n.Object({version:n.String({description:"Service version value observed in telemetry."}),firstSeenAt:T({description:"First time this version was observed for the service."}),lastSeenAt:T({description:"Most recent time this version was observed for the service."}),faulty:n.Optional(n.Boolean({description:"Whether Tsuga detected this version as associated with faulty behavior."}))}),IG=n.Object({language:n.String({description:"Programming language observed for this service."}),lastSeenAt:T({description:"Most recent time this language was observed."})}),_G=n.Object({runtime:n.String({description:"Runtime observed for this service."}),lastSeenAt:T({description:"Most recent time this runtime was observed."})}),hS=n.Object({protocol:n.String({description:"Observed API protocol (e.g. 'http', 'grpc', 'graphql')"}),lastSeenAt:T({description:"Most recent observation timestamp"})}),bG=n.Object({framework:n.String({description:"Observed application framework (e.g. 'express', 'fastify', 'django', 'rails')"}),lastSeenAt:T({description:"Most recent observation timestamp"})}),AG=n.Object({platform:n.String({description:"Observed cloud platform"}),lastSeenAt:T({description:"Most recent observation timestamp"})}),OG=n.Object({provider:n.String({description:"Observed cloud provider"}),lastSeenAt:T({description:"Most recent observation timestamp"})}),na=n.Object({id:n.String({description:"Unique identifier of this service catalog entry. Use it with service detail and graph endpoints."}),serviceName:n.String({description:"OpenTelemetry service name observed in telemetry."}),serviceNamespace:n.Optional(n.String({description:"OpenTelemetry service namespace observed in telemetry."})),env:n.Optional(n.String({description:"Environment value observed for this service."})),teams:n.Array(ES),ingestionApiKeys:n.Array(TG),versions:n.Array(TS),languages:n.Array(IG),runtimes:n.Array(_G),serverProtocols:n.Array(hS,{description:"API protocols this service exposes (from server-kind spans)"}),clientProtocols:n.Array(hS,{description:"API protocols this service calls out over (from client-kind spans)"}),frameworks:n.Array(bG,{description:"Application frameworks detected from OTel instrumentation scope"}),cloudPlatforms:n.Array(AG,{description:"Cloud platforms this service is running on"}),cloudProviders:n.Array(OG,{description:"Cloud providers this service is running on"}),lastSeenAt:T({description:"Most recent time Tsuga observed telemetry for this service."}),firstSeenAt:T({description:"First time Tsuga observed telemetry for this service."}),sources:n.Array(n.String(),{description:"Telemetry sources that contributed evidence for this service entry."}),additionalUserFields:n.Optional(n.Unsafe({type:"object",additionalProperties:!0,description:"Additional user-defined service metadata, when configured."})),logsCount24h:n.Number({description:"Number of logs observed for this service in the last 24 hours."}),errorLogsCount24h:n.Number({description:"Number of error logs observed for this service in the last 24 hours."}),tracesCount24h:n.Number({description:"Number of traces observed for this service in the last 24 hours."}),errorTracesCount24h:n.Number({description:"Number of error traces observed for this service in the last 24 hours."}),createdAt:T({description:"Timestamp when Tsuga created this service catalog entry."}),updatedAt:T({description:"Timestamp when Tsuga last updated this service catalog entry."})}),Dje=d({tags:["service-catalog"],query:n.Object({...te,clusterId:n.Optional(m())}),method:"GET",paginated:!0,url:`${tr}/services`,response:n.Array(na)}),SG=n.Object({spanKind:n.Enum(gS),count:n.Number()}),IS=n.Object({...na.properties,spanKindCounts:n.Array(SG),envs:n.Object({primaryEnv:n.String(),allEnvs:n.Array(n.String())})}),$je=d({tags:["service-catalog"],query:n.Object({...te,clusterId:n.Optional(m()),env:n.Optional(m())}),method:"GET",paginated:!0,url:`${tr}/v2/services`,response:n.Array(IS)}),Gje=d({tags:["service-catalog"],query:n.Object({serviceName:m({allowEmpty:!1}),serviceNamespace:n.Optional(m({allowEmpty:!1})),env:m({allowEmpty:!1}),clusterId:n.Optional(m())}),method:"GET",url:`${tr}/v2/service`,response:IS}),jje=d({tags:["service-catalog"],method:"GET",url:`${tr}/services/:serviceId`,params:n.Object({serviceId:m()}),response:na}),xG=n.Object({id:n.String(),endpointName:n.String(),serviceName:n.String(),serviceNamespace:n.Optional(n.String()),env:n.Optional(n.String()),teams:n.Array(ES),versions:n.Array(TS),lastSeenAt:T(),firstSeenAt:T(),sources:n.Array(n.String()),additionalUserFields:n.Optional(n.Unsafe({type:"object",additionalProperties:!0})),createdAt:T(),updatedAt:T()}),Fje=d({tags:["service-catalog"],method:"GET",url:`${tr}/endpoints`,response:n.Array(xG)}),RG=["otel_kube","otel_host_kube","otel_host","prometheus","aws_ec2","gcp_compute_engine"];var _S=n.Object({id:n.String(),hostName:n.String(),env:n.Optional(n.String()),cpuUtilizationAverage:n.Number(),hostType:n.Enum(RG),teams:n.Array(n.String()),tags:n.Array(n.String()),firstSeenAt:T(),lastSeenAt:T(),clusterId:n.String()}),Bje=d({tags:["service-catalog"],method:"GET",url:`${tr}/hosts`,response:n.Array(_S)}),qje=d({tags:["service-catalog"],method:"GET",url:`${tr}/hosts/:hostId`,params:n.Object({hostId:m()}),response:_S}),CG=["http","db","rpc","messaging","genai","object_store"],bS={name:n.String({description:"Service or inferred dependency name shown in the graph."}),env:n.Optional(n.String({description:"Environment observed from spans."}))},zu=n.Object({...bS,nodeType:n.Literal("observed",{description:"Observed service node that corresponds to a service catalog entry."}),id:n.Union([n.String(),n.Null()],{description:"Service ID from catalog, null if ambiguous (multiple namespaces match)"}),namespace:n.Union([n.String(),n.Null()],{description:"Service namespace from catalog, null if ambiguous"}),errorRate:n.Optional(n.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:n.Number({description:"Number of entry requests on this service where at least one entry span had error status."}),entryRequestCount:n.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."})}),Vu=n.Object({...bS,nodeType:n.Literal("inferred",{description:"Dependency node inferred from spans but not resolved to a service catalog entry."}),serviceType:n.Enum(CG,{description:"Inferred service type, e.g. http, db, rpc"}),endpoint:n.Optional(n.String({description:"Inferred service endpoint address"})),resourceName:n.Optional(n.String({description:"Inferred resource name, e.g. table or queue name"}))}),PG=O("nodeType",[zu,Vu]),Yu=n.Object({from:n.Object({env:n.Optional(n.String({description:"Environment of the source node"})),name:n.String({description:"Name of the source node"})},{description:"Reference to the source node"}),to:n.Object({env:n.Optional(n.String({description:"Environment of the target node"})),name:n.String({description:"Name of the target node"})},{description:"Reference to the target node"}),count:n.Number({description:"Number of cross-service transitions observed"}),errorRate:n.Optional(n.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:n.Number({description:"Number of client spans with error status observed on this edge"}),clientSpanCount:n.Number({description:"Number of client spans observed on this edge"})}),Hje=d({tags:["service-catalog"],url:`${tr}/services/:serviceId/graph`,method:"GET",params:n.Object({serviceId:m()}),query:n.Object({...Tt.properties,query:n.Optional(m({type:"tsuga-query"}))}),response:n.Object({clusterId:n.String(),nodes:n.Array(PG),edges:n.Array(Yu)})}),UG=n.Object({monitors:n.Array(n.Object({id:n.String({description:"Identifier of the monitor"}),name:n.String({description:"Display name of the monitor"}),owner:n.String({description:"Team ID that owns the monitor"}),priority:n.Enum(_t,{description:"Priority of the monitor"})})),slos:n.Array(n.Object({id:n.String({description:"Identifier of the SLO"}),name:n.String({description:"Display name of the SLO"}),owner:n.String({description:"Team ID that owns the SLO"})}))}),Kje=d({tags:["service-catalog"],method:"GET",url:`${tr}/services/:serviceId/related-resources`,params:n.Object({serviceId:m()}),response:UG}),zje=d({tags:["service-catalog"],method:"GET",url:`${tr}/services/by-api-keys`,response:n.Record(n.String(),n.Array(n.Object({serviceName:n.String(),serviceNamespace:n.Optional(n.String())})))});var Qu=`/${"v1"}/services`,Wu=n.Pick(na,["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)."}),NG={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:!1}],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(Wu,{examples:[NG]});var AS=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:Qu,method:"GET",paginated:!0,query:n.Object({...te,clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))},{description:"Service list query. Use pagination and optional cluster scope."}),response:n.Array(Wu)}),OS=d({description:"Retrieves one telemetry-inferred service by service ID. Use this to inspect observed metadata and recent activity for a service.",operationId:"getService",tags:["services"],url:`${Qu}/:serviceId`,method:"GET",params:n.Object({serviceId:m({allowEmpty:!1,description:"Identifier of the service catalog entry to retrieve. Use the `id` returned by service list responses."})}),response:Wu}),kG=n.Pick(zu,["name","env","nodeType","id","namespace","errorRate","entryErrorRequestCount","entryRequestCount"],{$id:"ObservedServiceGraphNode",description:"Observed service node that corresponds to a service catalog entry."}),wG=n.Pick(Vu,["name","env","nodeType","serviceType","endpoint","resourceName"],{$id:"InferredServiceGraphNode",description:"Dependency node inferred from spans but not resolved to a service catalog entry."}),LG=O("nodeType",[kG,wG]),MG=n.Pick(Yu,["from","to","count","errorRate","errorCount","clientSpanCount"],{$id:"ServiceGraphEdge",description:"Directed dependency edge between two service graph nodes."}),SS=d({description:"Retrieves a dependency graph for one service over an optional time range and query filter. Use this to inspect observed downstream and upstream service relationships. See [Service page](/documentation/categorize/services/service-page).",operationId:"getServiceGraph",tags:["services"],url:`${Qu}/:serviceId/graph`,method:"GET",params:n.Object({serviceId:m({allowEmpty:!1,description:"Identifier of the service catalog entry to use as the graph root. Use the `id` returned by service list or get responses."})}),query:n.Object({...Tt.properties,query:n.Optional(m({type:"tsuga-query",description:"Optional Tsuga query used to filter spans considered for the graph."}))},{description:"Service graph query. Use time range and optional span query filters."}),response:n.Object({clusterId:n.String({description:"Cluster ID the graph was built from"}),nodes:n.Array(LG),edges:n.Array(MG)})});function xS(e,t){let r=t??pr(e);return r===void 0?void 0:Ka(r)}function Zu(e){let t=pr(e);return t===void 0?"":` (default: ${t})`}function RS(e,t){e.command("service-graph").description("Inspect service dependency graphs").command("get <serviceId>").description("Retrieve the dependency graph for a service").option("--from <timestamp>",`Start of time range${Zu("from")}`).option("--to <timestamp>",`End of time range${Zu("to")}`).option("--query <query>",`Search query${Zu("query")}`).action(async(o,i)=>{let a={},c=xS("from",i.from),u=xS("to",i.to);c!==void 0&&(a.from=c),u!==void 0&&(a.to=u),i.query!==void 0&&(a.query=i.query);let l=await t()(SS,{params:{serviceId:o},query:a});oe(l)})}var CS=require("node:child_process"),PS=require("node:fs"),US=require("node:os"),ic=require("node:path");var wn=require("node:fs");function oa(e,t){let r=`${e}.tmp.${process.pid}`;(0,wn.writeFileSync)(r,t),(0,wn.renameSync)(r,e)}function ia(e){try{return(0,wn.readFileSync)(e,"utf8")}catch(t){if(t.code==="ENOENT")return;throw t}}function aa(e,t){if(t===void 0)return;let r=`${e}.bak.${new Date().toISOString().replaceAll(":","-")}`;return(0,wn.writeFileSync)(r,t),r}function Ln(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var Xu="tsuga-dev/agent-plugins",nc="tsuga";function oc(e,t){Q(` $ ${e} ${t.join(" ")}`);try{(0,CS.execFileSync)(e,t,{stdio:["ignore","inherit","inherit"]})}catch(r){let o=r.status??1;throw new Error(`${e} ${t.join(" ")} exited ${o}`,{cause:r})}}function vG(e,t){Q("Claude Code \u2192 installing Tsuga plugin"),oc("claude",["plugin","marketplace","add",Xu]),oc("claude",["plugin","install",`tsuga@${nc}`]),t.autoUpdate&&DG(e)}function DG(e){let t=(0,ic.join)(e,".claude","settings.json");Q(`Claude Code \u2192 ${t} (autoUpdate)`),(0,PS.mkdirSync)((0,ic.dirname)(t),{recursive:!0});let r=ia(t),o=JSON.parse(r??"{}");if(!Ln(o))throw new Error(`${t} must contain a JSON object`);let i=o.extraKnownMarketplaces??{};if(!Ln(i))throw new Error(`${t} "extraKnownMarketplaces" must be a JSON object`);let a=i[nc],c=Ln(a)?a:{};o.extraKnownMarketplaces={...i,[nc]:{source:{source:"github",repo:Xu},...c,autoUpdate:!0}};let u=aa(t,r);oa(t,`${JSON.stringify(o,null,2)}
44
- `),Q(u===void 0?" created":` patched (backup: ${u})`)}function $G(){Q("Codex \u2192 installing Tsuga plugin"),oc("codex",["plugin","marketplace","add",Xu]),oc("codex",["plugin","add",`tsuga@${nc}`])}function NS(e){let t=e.command("install").description("Install Tsuga components into local LLM CLIs").command("plugin").description("Install Tsuga plugins");t.command("claude-code").description("Install the Tsuga plugin into Claude Code").option("--no-auto-update","Skip patching ~/.claude/settings.json with autoUpdate=true").action(r=>{vG((0,US.homedir)(),r),Q("Restart your claude session to load the new plugins.")}),t.command("codex").description("Install the Tsuga plugin into Codex").action(()=>{$G(),Q("Restart your codex session to load the new plugins.")})}var Er="/v0/dashboards",wS=["white","gray.100","amber.200","lime.200","emerald.200","cyan.200","blue.200","violet.200","fuchsia.200","pink.200","red.200"],GG=["bar","distribution","gauge","heatmap","list","pie","query-value","table","timeseries","top-list"],IFe=[...GG,"note"];var jG=["ns","us","ms","s","m","h","days"];var FG=["B","KB","MB","GB","TB","PB"];var BG=20;var LS=n.Object({type:n.Literal("cpu",{description:"Normalizes values as CPU usage"})},{$id:"DataNormalizerCpu",title:"CPU"}),MS=n.Object({type:n.Literal("duration",{description:"Normalizes values as durations using standard time units"}),unit:n.Enum(jG,{description:"Time unit used to present the normalized values"})},{$id:"DataNormalizerDuration",title:"Duration"}),vS=n.Object({type:n.Literal("data",{description:"Normalizes values as data sizes using byte units"}),unit:n.Enum(FG,{description:"Data size unit used to present the normalized values"})},{$id:"DataNormalizerData",title:"Data"}),DS=n.Object({type:n.Literal("percent",{description:"Format values as percentages"})},{$id:"DataNormalizerPercent",title:"Percent"}),$S=n.Object({type:n.Literal("date",{description:"Formats values as calendar dates"})},{$id:"DataNormalizerDate",title:"Date"}),GS=n.Object({type:n.Literal("level",{description:"Displays values using their log level name"})},{$id:"DataNormalizerLevel",title:"Level"}),qG=n.Object({type:n.Literal("custom",{description:"Normalizes values using a custom unit label"}),unit:n.String({description:"Text label describing the custom unit"})},{$id:"DataNormalizerCustom",title:"Custom"}),HG=n.Object({type:n.Literal("custom",{description:"Normalizes values using a custom unit label"}),unit:n.String({description:"Text label describing the custom unit",maxLength:BG})},{$id:"InputDataNormalizerCustom",title:"Custom"}),jt=O("type",[MS,vS,DS,$S,GS,LS,qG],{title:"Normalizer"}),Ft=O("type",[MS,vS,DS,$S,GS,LS,HG],{title:"Normalizer"}),jS=n.Object({attribute:n.String({description:"Attribute (log field or database row column) displayed as a column in the list"}),normalizer:n.Optional(jt)},{title:"WidgetListColumn"}),FS=n.Object({attribute:n.String({description:"Attribute (log field or database row column) displayed as a column in the list"}),normalizer:n.Optional(Ft)},{title:"WidgetListColumn"}),sc=["background","no-background"],KG=["table","legend-only","no-legend"];var zG=["greater_than","less_than","equal","not_equal","greater_than_or_equal","less_than_or_equal"],BS=["alert","warning","success"],Mo=n.Object({operator:n.Enum(zG,{description:"Comparator used to evaluate the metric value"}),value:n.Number({description:"Threshold value used when evaluating the operator"}),color:n.Enum(BS,{description:"Color applied when the condition is met"})},{title:"ConditionalFormatting"}),VG=n.Object({value:n.Number({description:"Y-axis value where the threshold marker is placed"}),level:n.Enum(BS,{description:"Level applied to the threshold marker"})},{title:"ThresholdMarker"}),YG=["sec","min","hour","day"],cc=n.Object({time:n.Number({description:"Number of units that make up each bar bucket"}),metric:n.Enum(YG,{description:"Unit used to measure the bucket width"})});var Wr=n.Enum(["flex-start","center","flex-end"],{description:"Flex alignment keyword used for widget layout"}),QG=n.Object({formula:n.Optional(n.String({description:"Optional alias for formula (only used for display in the UI)"})),queries:n.Optional(n.Record(n.String(),n.String({description:"Optional alias for a query (only used for display in the UI)"})))}),WG=n.Object({formula:n.Optional(m({type:"short",description:"Optional alias for formula (only used for display in the UI)"})),queries:n.Optional(n.Record(n.String(),m({type:"short",description:"Optional alias for a query (only used for display in the UI)"})))}),pc={source:En,queries:k_,formula:n.Optional(w_),aliases:n.Optional(QG),visibleSeries:n.Optional(n.Array(n.Boolean(),{description:"Flags indicating whether each query or formula series is visible"}))},mc={source:En,queries:$i,formula:n.Optional(Gi),aliases:n.Optional(WG),visibleSeries:n.Optional(n.Array(n.Boolean(),{description:"Flags indicating whether each query or formula series is visible"}))},vo={...pc,groupBy:n.Optional(mm)},Do={...mc,groupBy:n.Optional(Ao)},ct=n.Enum(KG,{description:"Controls whether and how the widget displays legend or series details (e.g. table, legend-only, or no legend)"}),qe=n.Optional(n.Number({description:"Number of decimal places to display in the value"})),Zr=n.Optional(n.Array(VG,{description:"Threshold markers displayed on the chart"})),ZG=n.Object({name:n.String({description:"Display name of the table column"}),...pc,source:En,normalizer:n.Optional(jt),precision:qe},{title:"TableColumn"}),XG=n.Object({name:m({description:"Display name of the table column"}),...mc,source:En,normalizer:n.Optional(Ft),precision:qe},{title:"TableColumn"}),JG=n.Array(n.Object({id:n.String({description:"ID of the column to sort by"}),desc:n.Boolean({description:"Whether the sort is descending"})},{title:"TableDefaultSorting"})),e1=n.Array(n.Object({id:m({description:"ID of the column to sort by"}),desc:n.Boolean({description:"Whether the sort is descending"})},{title:"TableDefaultSorting"})),qS=["horizontal","vertical"],t1=n.Object({type:n.Literal("list",{description:"Displays matching logs in a tabular list"}),query:n.String({description:"Query that selects logs for the list"}),listColumns:n.Optional(n.Array(jS,{description:"Custom columns to display for each log"})),listColumnsSize:n.Optional(n.Record(n.String(),n.Number({description:"List column width by column id"})))},{$id:"GraphVisualizationList",title:"List"}),r1=n.Object({type:n.Literal("list",{description:"Displays matching logs in a tabular list"}),query:m({type:"tsuga-query",description:"Query that selects logs for the list"}),listColumns:n.Optional(n.Array(FS,{description:"Custom columns to display for each log"})),listColumnsSize:n.Optional(n.Record(n.String(),n.Number({description:"List column width by column id"})))},{$id:"InputGraphVisualizationList",title:"List"}),ac=O("type",[n.Object({type:n.Literal("auto")}),n.Object({type:n.Literal("number"),value:n.Number()})]),uc=n.Object({min:ac,max:ac,scale:O("type",[n.Object({type:n.Literal("pow"),exponent:n.Number()}),n.Object({type:n.Enum(["linear","log","sqrt"])})]),alwaysIncludeZero:n.Boolean()}),lc=n.Object({min:ac,max:ac,scale:O("type",[n.Object({type:n.Literal("pow"),exponent:n.Number({minimum:0})}),n.Object({type:n.Enum(["linear","log","sqrt"])})]),alwaysIncludeZero:n.Boolean()}),n1=n.Array(n.Integer({description:"Marker value expressed as a percentage between 0 and 100"}),{description:"Percentile markers displayed on top of the distribution chart"}),o1=n.Array(n.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 i1=n.Object({type:n.Literal("timeseries-connection",{description:"Displays the database rows-based aggregation as a time series chart"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),queries:n.Array(n.String({description:"The read-only SQL query to execute against the connection."})),legendMode:n.Optional(ct),thresholds:Zr,yAxisSettings:n.Optional(uc)},{$id:"GraphVisualizationTimeseriesConnection",title:"TimeseriesConnection"}),a1=n.Object({type:n.Literal("timeseries-connection",{description:"Displays the database rows-based aggregation as a time series chart"}),connectionId:m({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(m({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:n.Optional(ct),thresholds:Zr,yAxisSettings:n.Optional(lc)},{$id:"InputGraphVisualizationTimeseriesConnection",title:"TimeseriesConnection"}),s1=n.Object({type:n.Literal("list-connection",{description:"Displays database rows as a tabular list"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),query:n.String({description:"The read-only SQL query to execute against the connection."}),listColumns:n.Optional(n.Array(jS,{description:"Custom columns to display for each database row"})),listColumnsSize:n.Optional(n.Record(n.String(),n.Number({description:"List column width by column id"})))},{$id:"GraphVisualizationListConnection",title:"ListConnection"}),c1=n.Object({type:n.Literal("list-connection",{description:"Displays database rows as a tabular list"}),connectionId:m({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),query:m({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),listColumns:n.Optional(n.Array(FS,{description:"Custom columns to display for each database row"})),listColumnsSize:n.Optional(n.Record(n.String(),n.Number({description:"List column width by column id"})))},{$id:"InputGraphVisualizationListConnection",title:"ListConnection"}),p1=n.Object({type:n.Literal("top-list-connection",{description:"Displays the database rows-based aggregation as a ranked top list"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),queries:n.Array(n.String({description:"The read-only SQL query to execute against the connection."}))},{$id:"GraphVisualizationTopListConnection",title:"TopListConnection"}),m1=n.Object({type:n.Literal("top-list-connection",{description:"Displays the database rows-based aggregation as a ranked top list"}),connectionId:m({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(m({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1})},{$id:"InputGraphVisualizationTopListConnection",title:"TopListConnection"}),u1=n.Object({type:n.Literal("pie-connection",{description:"Displays the database rows-based aggregation as a pie chart"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),queries:n.Array(n.String({description:"The read-only SQL query to execute against the connection."})),legendMode:n.Optional(ct)},{$id:"GraphVisualizationPieConnection",title:"PieConnection"}),l1=n.Object({type:n.Literal("pie-connection",{description:"Displays the database rows-based aggregation as a pie chart"}),connectionId:m({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(m({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:n.Optional(ct)},{$id:"InputGraphVisualizationPieConnection",title:"PieConnection"}),d1=n.Object({type:n.Literal("bar-connection",{description:"Displays the database rows-based aggregation as a bar chart"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),queries:n.Array(n.String({description:"The read-only SQL query to execute against the connection."})),legendMode:n.Optional(ct),thresholds:Zr,yAxisSettings:n.Optional(uc)},{$id:"GraphVisualizationBarConnection",title:"BarConnection"}),f1=n.Object({type:n.Literal("bar-connection",{description:"Displays the database rows-based aggregation as a bar chart"}),connectionId:m({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(m({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:n.Optional(ct),thresholds:Zr,yAxisSettings:n.Optional(lc)},{$id:"InputGraphVisualizationBarConnection",title:"BarConnection"}),g1=n.Object({type:n.Literal("query-value-connection",{description:"Displays a single value computed by a SQL query against a database connection"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),queries:n.Array(n.String({description:"The read-only SQL query to execute against the connection."})),backgroundMode:n.Optional(n.Enum(sc,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(Mo,{description:"Conditional formatting rules applied to the displayed value"})),precision:qe,normalizer:n.Optional(jt),legendMode:n.Optional(ct)},{$id:"GraphVisualizationQueryValueConnection",title:"QueryValueConnection"}),y1=n.Object({type:n.Literal("query-value-connection",{description:"Displays a single value computed by a SQL query against a database connection"}),connectionId:m({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(m({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),backgroundMode:n.Optional(n.Enum(sc,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(Mo,{description:"Conditional formatting rules applied to the displayed value"})),precision:qe,normalizer:n.Optional(Ft),legendMode:n.Optional(ct)},{$id:"InputGraphVisualizationQueryValueConnection",title:"QueryValueConnection"}),h1=n.Object({type:n.Literal("list-log-patterns",{description:"Displays log patterns clustered from logs matching the query"}),query:n.String({description:"Tsuga query that selects logs to cluster into patterns"}),layout:n.Optional(n.Enum(qS,{description:"Layout used to render log patterns"}))},{$id:"GraphVisualizationListLogPatterns",title:"ListLogPatterns"}),E1=n.Object({type:n.Literal("list-log-patterns",{description:"Displays log patterns clustered from logs matching the query"}),query:m({type:"tsuga-query",description:"Tsuga query that selects logs to cluster into patterns"}),layout:n.Optional(n.Enum(qS,{description:"Layout used to render log patterns"}))},{$id:"InputGraphVisualizationListLogPatterns",title:"ListLogPatterns"}),T1=n.Object({type:n.Literal("timeseries",{description:"Displays the aggregation as a time series chart"}),...vo,timeBucket:n.Optional(cc),normalizer:n.Optional(jt),precision:qe,legendMode:n.Optional(ct),thresholds:Zr,yAxisSettings:n.Optional(uc),smoothing:n.Optional(n.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"}))},{$id:"GraphVisualizationTimeseries",title:"Timeseries"}),I1=n.Object({type:n.Literal("timeseries",{description:"Displays the aggregation as a time series chart"}),...Do,timeBucket:n.Optional(cc),normalizer:n.Optional(Ft),precision:qe,legendMode:n.Optional(ct),thresholds:Zr,yAxisSettings:n.Optional(lc),smoothing:n.Optional(n.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"}))},{$id:"InputGraphVisualizationTimeseries",title:"Timeseries"}),_1=n.Object({type:n.Literal("top-list",{description:"Displays the aggregation as a ranked list of top results"}),...vo,normalizer:n.Optional(jt),precision:qe,conditions:n.Optional(n.Array(Mo,{description:"Conditional formatting rules applied to the displayed value"}))},{$id:"GraphVisualizationTopList",title:"TopList"}),b1=n.Object({type:n.Literal("top-list",{description:"Displays the aggregation as a ranked list of top results"}),...Do,normalizer:n.Optional(Ft),precision:qe,conditions:n.Optional(n.Array(Mo,{description:"Conditional formatting rules applied to the displayed value"}))},{$id:"InputGraphVisualizationTopList",title:"TopList"}),A1=n.Object({type:n.Literal("pie",{description:"Displays the aggregation as a pie chart"}),...vo,normalizer:n.Optional(jt),precision:qe,legendMode:n.Optional(ct)},{$id:"GraphVisualizationPie",title:"Pie"}),O1=n.Object({type:n.Literal("pie",{description:"Displays the aggregation as a pie chart"}),...Do,normalizer:n.Optional(Ft),precision:qe,legendMode:n.Optional(ct)},{$id:"InputGraphVisualizationPie",title:"Pie"}),S1=n.Object({type:n.Literal("query-value",{description:"Displays the aggregation as a single value"}),...pc,backgroundMode:n.Optional(n.Enum(sc,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(Mo,{description:"Conditional formatting rules applied to the displayed value"})),precision:qe,normalizer:n.Optional(jt),legendMode:n.Optional(ct)},{$id:"GraphVisualizationQueryValue",title:"QueryValue"}),x1=n.Object({type:n.Literal("query-value",{description:"Displays the aggregation as a single value"}),...mc,backgroundMode:n.Optional(n.Enum(sc,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(Mo,{description:"Conditional formatting rules applied to the displayed value"})),precision:qe,normalizer:n.Optional(Ft),legendMode:n.Optional(ct)},{$id:"InputGraphVisualizationQueryValue",title:"QueryValue"}),R1=n.Object({type:n.Literal("bar",{description:"Displays the aggregation as a bar chart"}),...vo,timeBucket:n.Optional(cc),precision:qe,normalizer:n.Optional(jt),thresholds:Zr,legendMode:n.Optional(ct),yAxisSettings:n.Optional(uc)},{$id:"GraphVisualizationBar",title:"Bar"}),C1=n.Object({type:n.Literal("bar",{description:"Displays the aggregation as a bar chart"}),...Do,timeBucket:n.Optional(cc),precision:qe,normalizer:n.Optional(Ft),thresholds:Zr,legendMode:n.Optional(ct),yAxisSettings:n.Optional(lc)},{$id:"InputGraphVisualizationBar",title:"Bar"}),P1=n.Object({type:n.Literal("distribution",{description:"Displays the aggregation as a distribution chart"}),...vo,precision:qe,normalizer:n.Optional(jt),percentileMarkers:n.Optional(n1),boundsScale:n.Optional(Bs)},{$id:"GraphVisualizationDistribution",title:"Distribution"}),U1=n.Object({type:n.Literal("distribution",{description:"Displays the aggregation as a distribution chart"}),...Do,precision:qe,normalizer:n.Optional(Ft),percentileMarkers:n.Optional(o1),boundsScale:n.Optional(Bs)},{$id:"InputGraphVisualizationDistribution",title:"Distribution"}),HS=["red","pink","violet","blue","cyan","green","yellow","orange"],KS=n.Enum(HS,{description:"Color palette used to render the heatmap intensity gradient"}),N1=n.Object({type:n.Literal("heatmap",{description:"Displays the aggregation as a heatmap chart"}),...vo,precision:qe,normalizer:n.Optional(jt),palette:n.Optional(KS)},{$id:"GraphVisualizationHeatmap",title:"Heatmap"}),k1=n.Object({type:n.Literal("heatmap",{description:"Displays the aggregation as a heatmap chart"}),...Do,precision:qe,normalizer:n.Optional(Ft),palette:n.Optional(KS)},{$id:"InputGraphVisualizationHeatmap",title:"Heatmap"}),zS=n.Object({from:n.Number({description:"Lower bound of the Gauge color threshold; runs up to the next threshold or the max"}),color:n.Enum(HS,{description:"Color applied to the band starting at this value"})},{title:"GaugeColorThreshold"}),w1=n.Object({type:n.Literal("gauge",{description:"Displays the aggregation as a gauge"}),...pc,max:n.Optional(n.Number({description:"Gauge maximum value"})),colorThresholds:n.Optional(n.Array(zS,{description:"Color thresholds inside the gauge range"})),precision:qe,normalizer:n.Optional(jt)},{$id:"GraphVisualizationGauge",title:"Gauge"}),L1=n.Object({type:n.Literal("gauge",{description:"Displays the aggregation as a gauge"}),...mc,max:n.Optional(n.Number({description:"Gauge maximum value"})),colorThresholds:n.Optional(n.Array(zS,{description:"Color thresholds inside the gauge range"})),precision:qe,normalizer:n.Optional(Ft)},{$id:"InputGraphVisualizationGauge",title:"Gauge"}),M1=n.Object({type:n.Literal("table",{description:"Displays the aggregation as a table with multi-level grouping"}),columns:n.Array(ZG,{description:"Each column defines an independent aggregation displayed as a table column"}),groupBy:n.Optional(mm),defaultSorting:n.Optional(JG),columnSizes:n.Optional(n.Record(n.String(),n.Number({description:"Column width by column id"})))},{$id:"GraphVisualizationTable",title:"Table"}),v1=n.Object({type:n.Literal("table",{description:"Displays the aggregation as a table with multi-level grouping"}),columns:n.Array(XG,{minItems:1,description:"Each column defines an independent aggregation displayed as a table column"}),groupBy:n.Optional(Ao),defaultSorting:n.Optional(e1),columnSizes:n.Optional(n.Record(n.String(),n.Number({description:"Column width by column id"})))},{$id:"InputGraphVisualizationTable",title:"Table"}),D1=n.Object({type:n.Literal("note",{description:"Displays static text on the dashboard"}),note:n.Optional(n.String({description:"Markdown-compatible text shown in the note"})),noteColor:n.Optional(n.Enum(wS,{description:"Background color used to render the note"})),noteAlign:n.Optional(Wr),noteJustifyContent:n.Optional(Wr)},{$id:"GraphVisualizationNote",title:"Note"}),$1=n.Object({type:n.Literal("note",{description:"Displays static text on the dashboard"}),note:n.Optional(m({type:"long",description:"Markdown-compatible text shown in the note"})),noteColor:n.Optional(n.Enum(wS,{description:"Background color used to render the note"})),noteAlign:n.Optional(Wr),noteJustifyContent:n.Optional(Wr)},{$id:"InputGraphVisualizationNote",title:"Note"}),G1=O("type",[i1,s1,p1,u1,d1,g1,T1,_1,A1,S1,w1,R1,P1,N1,M1,t1,D1,h1],{description:"Widget visualization configuration. The `type` discriminator selects the widget kind and its required fields."}),j1=O("type",[a1,c1,m1,l1,f1,y1,I1,b1,O1,x1,L1,C1,U1,k1,v1,r1,$1,E1],{description:"Widget visualization configuration. The `type` discriminator selects the widget kind and its required fields."}),dc=n.Object({id:n.String({description:"Unique identifier of the graph widget inside the dashboard."}),name:n.Optional(n.String({description:"Display name of the graph widget."})),description:n.Optional(n.String({description:"Optional text shown with the graph widget."})),descriptionAlign:n.Optional(Wr),descriptionJustifyContent:n.Optional(Wr),visualization:G1,layout:n.Optional(n.Object({x:n.Number({description:"Horizontal grid position of the widget"}),y:n.Number({description:"Vertical grid position of the widget"}),w:n.Number({description:"Width of the widget in grid units"}),h:n.Number({description:"Height of the widget in grid units"})},{description:"Grid layout coordinates for this widget"}))},{title:"Graph"}),fc=n.Object({id:m({description:"Unique identifier of the graph widget inside the dashboard."}),name:n.Optional(m({description:"Display name of the graph widget."})),description:n.Optional(n.String({minLength:1,maxLength:800,description:"Optional text shown with the graph widget. Maximum length is 800 characters."})),descriptionAlign:n.Optional(Wr),descriptionJustifyContent:n.Optional(Wr),visualization:j1,layout:n.Optional(n.Object({x:n.Number({description:"Horizontal grid position of the widget"}),y:n.Number({description:"Vertical grid position of the widget"}),w:n.Number({description:"Width of the widget in grid units"}),h:n.Number({description:"Height of the widget in grid units"})},{description:"Grid layout coordinates for this widget"}))},{title:"Graph"}),kS=10,F1=n.Array(n.Object({key:n.String({description:"Dashboard-wide filter key, usually a telemetry attribute name."}),values:n.Array(n.String({description:"Allowed value for this dashboard-wide filter."}))}),{description:"Dashboard-wide filters applied to every widget on the dashboard."}),B1=n.Array(n.Object({key:m({description:"Dashboard-wide filter key, usually a telemetry attribute name."}),values:n.Array(m({description:"Allowed value for this dashboard-wide filter."}))}),{maxItems:kS,description:`Dashboard-wide filters applied to every widget on the dashboard. Up to ${kS} filters are allowed.`}),$o=n.Object({id:n.String({description:"Unique identifier of the dashboard. Generated by Tsuga."}),name:n.String({description:"Display name of the dashboard."}),owner:n.String({description:"Team ID that owns and manages the dashboard."}),graphs:n.Array(dc,{description:"Ordered widgets that compose the dashboard"}),filters:n.Optional(F1),createdAt:T({description:"Timestamp when Tsuga created the dashboard."}),updatedAt:T({description:"Timestamp when Tsuga last updated the dashboard."}),creator:n.Optional(he),updater:n.Optional(he),tags:Qe,timePreset:n.Optional(n.Enum(op,{description:"Relative time preset used when opening the dashboard."}))}),gc=n.Object({name:m({description:"Display name of the dashboard."}),owner:m({allowEmpty:!1,description:"Team ID that owns and manages the dashboard."}),graphs:n.Array(fc,{description:"Ordered widgets that compose the dashboard"}),filters:n.Optional(B1),tags:et,timePreset:n.Optional(n.Enum(op,{description:"Relative time preset used when opening the dashboard."}))}),Gt={IS_FAVORITE:"isFavorite",OWNER:"owner",TAGS:"tags",WIDGET_COUNT:"widgetCount",UPDATED_AT:"updatedAt",NAME:"name"},VS=[Gt.OWNER,Gt.TAGS,Gt.WIDGET_COUNT,Gt.UPDATED_AT,Gt.NAME],yc=n.Partial(n.Object({owners:cr(m({allowEmpty:!1}),{description:"Restrict results to dashboards owned by any of these team IDs",maxItems:50}),searchQuery:n.Object({value:m({allowEmpty:!1,description:"Substring to match against dashboard names."}),exclude:n.Optional(n.Boolean({description:"If true, exclude dashboards matching this value instead of including them"}))},{description:"Substring matched against the dashboard name"}),tags:cr(Nn.items,{description:"Restrict results to dashboards that have at least one of the listed key/value tags",maxItems:50})},{description:"Optional filters applied to narrow the returned dashboards"})),q1=n.Partial(n.Object({...te,filters:yc,sort:n.Object({by:n.Enum([Gt.IS_FAVORITE,Gt.OWNER,Gt.TAGS,Gt.WIDGET_COUNT,Gt.UPDATED_AT,Gt.NAME],{description:"Field to sort the returned dashboards by"}),direction:n.Enum(["asc","desc"],{description:"Sort direction: ascending or descending"})},{description:"Optional sorting applied to the returned dashboards"})})),_Fe=d({tags:["dashboards"],url:`${Er}/query`,method:"POST",paginated:!0,response:n.Array($o),body:q1}),bFe=d({tags:["dashboards"],url:`${Er}/tags/query`,method:"POST",body:n.Object({filters:n.Optional(n.Omit(yc,["tags"]))}),response:Un}),AFe=d({tags:["dashboards"],url:`${Er}/:id`,method:"GET",params:n.Object({id:m()}),response:$o}),OFe=d({tags:["dashboards"],url:Er,method:"POST",body:gc,response:$o}),SFe=d({tags:["dashboards"],url:`${Er}/:id`,method:"PUT",params:n.Object({id:m()}),body:n.Partial(gc),response:$o}),xFe=d({tags:["dashboards"],url:`${Er}/bulk-update`,method:"PUT",body:n.Object({dashboardIds:n.Array(m()),owner:m({allowEmpty:!1})}),response:n.Object({})}),RFe=d({tags:["dashboards"],url:`${Er}/:id`,method:"DELETE",params:n.Object({id:m()}),response:L}),CFe=d({tags:["dashboards"],url:`${Er}/:id/graphs/:graphId`,method:"PUT",params:n.Object({id:m({allowEmpty:!1}),graphId:m({allowEmpty:!1})}),body:n.Omit(fc,["id"]),response:dc}),PFe=d({tags:["dashboards"],url:`${Er}/bulk-delete`,method:"DELETE",body:n.Object({ids:n.Array(m())}),response:n.Object({})});var Go=`/${"v1"}/dashboards`,sa=n.Pick($o,["id","name","owner","graphs","filters","tags","timePreset"],{$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)."}),H1={id:"123-456-abc",name:"API Performance Overview",owner:"abc-123-def",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(sa,{examples:[H1]});var YS=n.Partial(n.Object({...te,filters:yc,sort:n.Object({by:n.Enum([...VS],{description:"Field to sort the returned dashboards by"}),direction:n.Enum(["asc","desc"],{description:"Sort direction: ascending or descending"})},{description:"Optional sorting applied to the returned dashboards"})}),{description:"Dashboard query request. Use filters, sorting, limit, and offset to page through visible dashboards."}),K1={filters:{owners:{values:["team-123-abc"]},searchQuery:{value:"API"},tags:{values:[{key:"service",value:"api-gateway"}]}},sort:{by:"name",direction:"asc"},limit:10,offset:0};Object.assign(YS,{examples:[K1]});var QS=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:`${Go}/query`,method:"POST",paginated:!0,body:YS,response:n.Array(sa)}),WS=d({description:"Retrieves one dashboard by ID when the authenticated operation key can read it. Use this before updating or cloning a dashboard definition.",operationId:"getDashboard",tags:["dashboards"],url:`${Go}/:id`,method:"GET",params:n.Object({id:m({allowEmpty:!1,description:"Identifier of the saved dashboard to retrieve. Use the `id` returned by dashboard query, create, or update responses."})}),response:sa}),Ju=n.Pick(gc,["name","owner","graphs","filters","tags","timePreset"],{description:"Dashboard create or update request. Provide the dashboard identity, owner team, widgets, filters, tags, and optional time preset."}),z1={name:"API Performance Overview",owner:"abc-123-def",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(Ju,{examples:[z1]});var ZS=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:Go,method:"POST",body:Ju,response:sa}),XS=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:`${Go}/:id`,method:"PUT",params:n.Object({id:m({allowEmpty:!1,description:"Identifier of the saved dashboard to update. Use the `id` returned by dashboard query, get, or create responses."})}),body:n.Partial(Ju),response:sa}),V1=n.Object({id:m({allowEmpty:!1,description:"Identifier of the saved dashboard to delete. Use the `id` returned by dashboard query, get, create, or update responses."})}),JS=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:`${Go}/:id`,method:"DELETE",params:V1,response:L}),DFe=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:`${Go}/:id/graphs/:graphId`,method:"PUT",params:n.Object({id:m({allowEmpty:!1,description:"Identifier of the dashboard that contains the graph to update. Use the `id` returned by dashboard responses."}),graphId:m({allowEmpty:!1,description:"Identifier of the graph to update within the dashboard. Use graph IDs from the dashboard response."})}),body:n.Omit(fc,["id"]),response:dc});var ex=100,tx=3,jo=n.Object({id:n.String({description:"Unique identifier of the ingestion API key. Generated by Tsuga."}),name:n.String({description:"Human-readable key name. Names must be kebab-case when creating or updating keys."}),keyLastCharacters:n.String({description:"Last visible characters of the secret key. Use this to identify a key without exposing the full secret."}),owner:n.String({description:"Team ID that owns and manages the ingestion API key."}),tags:Un,teamOverrideFields:n.Optional(n.Array(n.String(),{description:"Telemetry attribute names used to override ownership for data sent with this key."})),updatedAt:T({description:"Timestamp when Tsuga last updated the key metadata."}),createdAt:T({description:"Timestamp when Tsuga created the key."}),creator:n.Optional(he),updater:n.Optional(he),assetUpdatedAt:T({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})}),ca=n.Object({name:n.String({format:vs,minLength:1,maxLength:ex,description:`Kebab-case name for the ingestion API key. Maximum length is ${ex} characters.`}),owner:m({allowEmpty:!1,description:"Team ID that will own and manage the ingestion API key."}),tags:Nn,teamOverrideFields:n.Union([n.Array(m({allowEmpty:!1}),{minItems:1,maxItems:tx,description:`Telemetry attribute names used to override ownership for data sent with this key. Up to ${tx} fields are allowed.`}),n.Null({description:"Clear any existing team override fields."})])}),pa="/v0/ingestion-api-keys",zFe=d({tags:["ingestion-api-keys"],url:pa,method:"POST",body:ca,response:n.Intersect([jo,n.Object({key:n.String()})])}),VFe=d({tags:["ingestion-api-keys"],url:pa,method:"GET",paginated:!0,query:n.Object(te),response:n.Array(jo)}),YFe=d({tags:["ingestion-api-keys"],url:`${pa}/:id`,method:"GET",params:n.Object({id:m({allowEmpty:!1})}),response:jo}),QFe=d({tags:["ingestion-api-keys"],url:`${pa}/:id`,method:"PUT",params:n.Object({id:m({allowEmpty:!1})}),body:ca,response:jo}),WFe=d({tags:["ingestion-api-keys"],url:`${pa}/:id`,method:"DELETE",params:n.Object({id:m({allowEmpty:!1})}),response:L});var ma=`/${"v1"}/ingestion-api-keys`,ua=n.Pick(jo,["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)."}),rx={id:"123-456-abc",name:"Production Logs Ingestion",keyLastCharacters:"x7Qm",owner:"abc-123-def",tags:[{key:"env",value:"production"}],teamOverrideFields:["service"]};Object.assign(ua,{examples:[rx]});var nx=n.Pick(ca,["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."}),ox=n.Pick(ca,["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."}),ix={name:"Production Logs Ingestion",owner:"abc-123-def",tags:[{key:"env",value:"production"}],teamOverrideFields:["service"]};Object.assign(nx,{examples:[ix]});Object.assign(ox,{examples:[ix]});var Y1={...rx,key:"tsuga_in:v1:abc123xyx7Qm"},ax=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:ma,method:"GET",paginated:!0,query:n.Object(te),response:n.Array(ua)}),oBe=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:`${ma}/:id`,method:"GET",params:n.Object({id:m({allowEmpty:!1,description:"Identifier of the ingestion API key to retrieve. Use the `id` returned by ingestion API key list or create responses."})}),response:ua}),Q1=n.Intersect([n.Pick(ua,["id","name","keyLastCharacters","owner","tags","teamOverrideFields"]),n.Object({key:n.String({description:"The full API key value, returned only at creation time"})})],{title:"IngestionApiKeyCreated",example:Y1}),sx=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:ma,method:"POST",body:nx,response:Q1}),cx=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:`${ma}/:id`,method:"PUT",params:n.Object({id:m({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:ox,response:ua}),px=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:`${ma}/:id`,method:"DELETE",params:n.Object({id:m({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:L});var W1={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"]}},[cBe,pBe,mBe]=Z1(W1);function Z1(e){let t=[],r=[],o=[],i=Object.keys(e);for(let a of i){t.push(a);let c=e[a];for(let u in c){r.push(u);let l=c[u];Array.isArray(l)&&o.push(...l)}}return[el(t),el(r),el(o)]}function el(e){if(e.length===0)throw new Error("Array must have at least one element.");return e}var tl=n.Enum(["HTTP","HTTPS","TCP","UDP","GENEVE","TLS","TLS_QUIC","TCP_UDP","TCP_QUIC","QUIC"]),X1=n.Object({versioningStatus:n.Optional(n.Enum(["Enabled","Disabled","Suspended","Not configured"]))}),J1=n.Object({domainName:n.Optional(n.String()),origins:n.Optional(n.Array(n.String()))}),ej=n.Object({allocatedStorageGib:n.Optional(n.Number()),encryptedAtRest:n.Optional(n.Boolean()),engine:n.Optional(n.String()),dynamoDbItemCount:n.Optional(n.Number()),dynamoDbActualSizeGib:n.Optional(n.Number())}),tj=n.Object({version:n.Optional(n.String()),virtualNetworkId:n.Optional(n.String()),subnets:n.Optional(n.Array(n.String()))}),rj=n.Object({artifactRegistryFormat:n.Optional(n.Enum(["FORMAT_UNSPECIFIED","DOCKER","MAVEN","NPM","APT","YUM","PYTHON","KFP","GO","GENERIC"])),uri:n.Optional(n.String()),tagMutability:n.Optional(n.Enum(["MUTABLE","IMMUTABLE"])),scanOnPush:n.Optional(n.Boolean()),encryptionType:n.Optional(n.String())}),nj=n.Object({status:n.Optional(n.String()),activeServices:n.Optional(n.Number()),pendingTasks:n.Optional(n.Number()),runningTasks:n.Optional(n.Number()),registeredContainerInstances:n.Optional(n.Number()),capacityProviders:n.Optional(n.Array(n.String()))}),oj=n.Object({status:n.Optional(n.String()),desiredStatus:n.Optional(n.String()),healthStatus:n.Optional(n.String()),availabilityZone:n.Optional(n.String()),startedAt:n.Optional(T())}),ij=n.Object({isEncrypted:n.Optional(n.Boolean()),ownerId:n.Optional(n.String()),state:n.Optional(n.Enum(["creating","available","deleting","deleted","error","updating"]))}),aj=n.Object({type:n.Optional(n.String()),osType:n.Optional(n.String()),subnetIds:n.Optional(n.Array(n.String())),nbContainers:n.Optional(n.Number())}),sj=n.Object({digest:n.String(),imageTags:n.Array(n.String()),imageSizeBytes:n.Optional(n.Number()),imagePushedAt:n.Optional(T()),mediaType:n.Optional(n.String()),repositoryName:n.String(),repositoryId:n.Optional(n.String()),scanStatus:n.Optional(n.String())}),cj=n.Object({url:n.Optional(n.String()),maxMessageSizeBytes:n.Optional(n.Number()),messageRetentionHours:n.Optional(n.Number())}),pj=n.Object({runtime:n.Optional(n.String()),memoryAllocationMib:n.Optional(n.Number()),timeoutMs:n.Optional(n.Number()),codeSha256:n.Optional(n.String())}),mj=n.Object({kind:n.Optional(n.String())}),uj=n.Object({instanceId:n.String(),architecture:n.Optional(n.String()),instanceType:n.Optional(n.String()),operatingSystem:n.Optional(n.String()),memoryMib:n.Optional(n.Number()),vCpus:n.Optional(n.Number()),vpcId:n.Optional(n.String()),k8sClusterId:n.Optional(n.String())}),lj=n.Object({id:n.Optional(n.String()),ipCidrBlocks:n.Array(n.String())}),dj=n.Object({protocol:n.Optional(tl),port:n.Optional(n.Number()),instanceProtocol:n.Optional(tl),instancePort:n.Optional(n.Number())}),fj=n.Object({protocol:n.Optional(n.String()),ports:n.Optional(n.Array(n.String())),portRange:n.Optional(n.String()),allPorts:n.Optional(n.Boolean())}),gj=n.Object({name:n.String(),ip:n.Optional(n.String()),type:n.Enum(["public","private"])}),yj=n.Object({type:n.String(),name:n.String()}),hj=n.Object({frontendIp:n.Optional(gj),backendIpPools:n.Array(yj)}),Ej=n.Object({targetId:n.String(),targetPort:n.Optional(n.Number()),targetType:n.Optional(n.Enum(["instance","ip","lambda","alb"])),healthState:n.Optional(n.String()),healthReason:n.Optional(n.String()),healthDescription:n.Optional(n.String()),availabilityZone:n.Optional(n.String())}),Tj=n.Object({protocol:n.Optional(tl),port:n.Optional(n.Number()),type:n.Optional(n.Enum(["alb","lambda","instance","ip"])),name:n.Optional(n.String()),targetGroupArn:n.Optional(n.String()),virtualNetworkId:n.Optional(n.String()),healthCheckProtocol:n.Optional(n.String()),healthCheckPort:n.Optional(n.String()),healthCheckPath:n.Optional(n.String()),healthCheckIntervalSeconds:n.Optional(n.Number()),healthCheckTimeoutSeconds:n.Optional(n.Number()),healthyThresholdCount:n.Optional(n.Number()),unhealthyThresholdCount:n.Optional(n.Number()),targets:n.Optional(n.Array(Ej)),targetCount:n.Optional(n.Number()),healthyTargetCount:n.Optional(n.Number()),loadBalancerArns:n.Optional(n.Array(n.String()))}),Ij=n.Object({first:n.Optional(n.String()),last:n.Optional(n.String()),scope:n.Optional(n.Number())}),_j=n.Object({type:n.Optional(n.String()),name:n.Optional(n.String()),alwaysServe:n.Optional(n.Boolean()),subnets:n.Optional(n.Array(n.Union([n.Number(),Ij]))),target:n.Optional(n.String()),weight:n.Optional(n.Number()),priority:n.Optional(n.Number()),status:n.Optional(n.String())}),bj=n.Object({instanceId:n.Optional(n.String()),state:n.Optional(n.String()),reasonCode:n.Optional(n.String()),description:n.Optional(n.String())}),Aj=n.Object({loadBalancerType:n.Optional(n.String()),dnsName:n.Optional(n.String()),virtualNetworkId:n.Optional(n.String()),subnetIds:n.Array(n.String()),scheme:n.Optional(n.String()),listeners:n.Optional(n.Union([n.Array(dj),n.Array(fj)])),targets:n.Optional(n.Union([n.Array(n.String()),n.Array(bj),n.Array(_j)])),azureLoadBalancingRules:n.Optional(n.Array(hj))}),Oj=n.Object({domainName:n.Optional(n.String()),expiresAt:n.Optional(T()),inUseBy:n.Optional(n.Array(n.String())),renewalEligibility:n.Optional(n.String()),revokedAt:n.Optional(T()),status:n.Optional(n.String()),type:n.Optional(n.String())}),Sj=n.Object({state:n.Optional(n.Enum(["creating","available","deleting","deleted","error","in-use"])),volumeType:n.Optional(n.Enum(["gp2","gp3","io1","io2","st1","sc1","standard"]))}),xj=n.Object({osType:n.Optional(n.Enum(["Windows","Linux"]))}),Rj=n.Object({state:n.Optional(n.String()),volumeType:n.Optional(n.String())}),Cj=n.Intersect([n.Object({isEncrypted:n.Optional(n.Boolean()),sizeGib:n.Optional(n.Number())}),n.Union([Sj,Rj,xj])]),Pj=n.Object({instanceCount:n.Optional(n.Number()),hostnames:n.Optional(n.Array(n.String())),runtime:n.Optional(n.String())}),hc=n.Union([n.Object({category:n.Literal("application"),resourceType:n.Literal("webService"),attributes:n.Optional(Pj)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("bucket"),attributes:n.Optional(X1)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("messagingService"),attributes:n.Optional(cj)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("fileSystem"),attributes:n.Optional(ij)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("contentDeliveryNetwork"),attributes:n.Optional(J1)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("database"),attributes:n.Optional(ej)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("storageAccount"),attributes:n.Optional(mj)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("volume"),attributes:n.Optional(Cj)}),n.Object({category:n.Literal("compute"),resourceType:n.Literal("virtualMachine"),attributes:n.Optional(uj)}),n.Object({category:n.Literal("compute"),resourceType:n.Literal("serverless"),attributes:n.Optional(pj)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("kubernetesCluster"),attributes:n.Optional(tj)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerRepository"),attributes:n.Optional(rj)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerCluster"),attributes:n.Optional(nj)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerServiceTask"),attributes:n.Optional(oj)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerService"),attributes:n.Optional(aj)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerImage"),attributes:n.Optional(sj)}),n.Object({category:n.Literal("network"),resourceType:n.Literal("virtualNetwork"),attributes:n.Optional(lj)}),n.Object({category:n.Literal("network"),resourceType:n.Literal("loadBalancer"),attributes:Aj}),n.Object({category:n.Literal("network"),resourceType:n.Literal("targetGroup"),attributes:n.Optional(Tj)}),n.Object({category:n.Literal("network"),resourceType:n.Literal("certificate"),attributes:n.Optional(Oj)})]);var la="/v0/inventory",rl=["aws","gcp","azure"],mx=["scan_in_progress","success","failure"],nl=n.Object({id:n.String({description:"Identifier of the inventory resource"}),cloudPlatform:n.Enum(rl,{description:"Cloud platform that hosts this resource"}),cloudAccount:n.String({description:"Cloud-native account identifier the resource was discovered in"}),cloudRegion:n.Optional(n.String({description:"Cloud region the resource was discovered in, when applicable"})),fullyQualifiedResourceId:n.String({description:"Cloud-native unique identifier for this resource (for example an AWS ARN or GCP resource name)"}),displayName:n.String({description:"Human-readable name shown in the Tsuga UI"}),nativeResourceType:n.String({description:"Cloud-native resource type, for example aws_ec2_instance or gcp_bucket"}),resourceCreatedAt:n.Optional(T({description:"When the resource was created in the cloud, when known"})),resourceUpdatedAt:n.Optional(T({description:"When the resource was last updated in the cloud, when known"})),resourceLastSeenAt:T({description:"When this resource was last observed during an inventory scan"}),tags:Qe,nativeAttributes:n.Optional(n.Unsafe({type:"object",additionalProperties:!0})),covered:n.Optional(n.Boolean({description:"Whether the resource is covered by the configured infrastructure-as-code identifiers"}))}),EBe=d({tags:["inventory"],method:"GET",url:`${la}/resources`,paginated:!0,query:n.Object(te),response:n.Array(n.Intersect([nl,hc]))}),Uj=O("type",[n.Object({type:n.Literal("aws"),accountId:n.String(),externalId:n.String(),roleArn:n.String()}),n.Object({type:n.Literal("gcp"),projectId:n.String(),serviceAccountId:n.String(),workloadIdentityProvider:n.String()}),n.Object({type:n.Literal("azure"),clientId:n.String(),subscriptionId:n.String(),tenantId:n.String()})]),Nj=n.Object({type:n.Literal("aws"),accountId:m(),externalId:m(),roleArn:m()}),kj=n.Object({type:n.Literal("gcp"),projectId:m(),serviceAccountId:m(),workloadIdentityProvider:m()}),wj=n.Object({type:n.Literal("azure"),clientId:m(),subscriptionId:m(),tenantId:m()}),ux=O("type",[Nj,kj,wj]),Ec=n.Object({id:n.String(),cloudType:n.Enum(rl),cloudAccountId:n.String(),accountFriendlyName:n.Optional(n.String()),organizationId:n.Optional(n.String()),connectionSettings:Uj,createdBy:n.Optional(n.String()),createdAt:T(),lastScanStartedAt:n.Optional(T()),lastScanFinishedAt:n.Optional(T()),lastScanStatus:n.Optional(n.Enum(mx))}),Lj=n.Object({cloudType:n.Enum(rl),cloudAccountId:m(),accountFriendlyName:n.Optional(m()),organizationId:n.Optional(m()),connectionSettings:ux,lastScanStatus:n.Optional(n.Enum(mx))}),Mn=`${la}/cloud-accounts`,TBe=d({tags:["inventory"],url:Mn,method:"GET",response:n.Array(Ec)}),IBe=d({tags:["inventory"],url:`${Mn}/:id`,method:"GET",params:n.Object({id:m()}),response:Ec}),_Be=d({tags:["inventory"],url:Mn,method:"POST",body:Lj,response:Ec}),bBe=d({tags:["inventory"],url:`${Mn}/:id`,method:"PUT",params:n.Object({id:m()}),body:n.Object({accountFriendlyName:m()}),response:Ec}),ABe=d({tags:["inventory"],url:`${Mn}/:id`,method:"DELETE",params:n.Object({id:m()}),response:L}),OBe=d({tags:["inventory"],url:`${la}/trigger-scan`,method:"POST",body:n.Object({}),response:n.Object({success:n.Literal(!0)})}),SBe=d({tags:["inventory"],url:`${Mn}/azure/onboarding`,method:"POST",body:n.Object({tenantId:m()}),response:n.Object({subjectId:n.String(),audience:n.String()})}),xBe=d({tags:["inventory"],method:"POST",url:`${Mn}/validate/:type`,params:n.Object({type:m()}),body:n.Object({data:ux,id:n.Optional(m())}),response:n.Object({areAccountSettingsValid:n.Boolean(),message:n.Optional(n.String())})}),lx=`${la}/settings`,RBe=d({tags:["inventory"],url:lx,method:"GET",response:n.Object({settings:n.Optional(n.Object({id:n.String(),infrastructureIdentifiers:n.Array(n.Object({name:n.String(),value:n.Optional(n.String())}))}))})}),CBe=d({tags:["inventory"],url:lx,method:"POST",body:n.Object({infrastructureIdentifiers:n.Array(n.Object({name:m({allowEmpty:!1}),value:n.Optional(m({allowEmpty:!1}))}),{maxItems:50})}),response:n.Object({})}),PBe=d({tags:["inventory"],url:`${la}/iac-tags-proposal`,method:"GET",response:n.Array(n.Object({name:n.String(),value:n.Optional(n.String())}))});var Mj=`/${"v1"}/inventory`,vj=n.Omit(nl,["nativeAttributes","covered"],{$id:"InventoryResourceBase",description:"Base fields shared by cloud resources discovered during inventory scans. See [Cloud resources](/documentation/categorize/cloud-resources)."}),dx=n.Intersect([vj,hc],{$id:"InventoryResource",description:"Cloud resource discovered by an inventory scan, together with category, resource type, and category-specific attributes. See [Cloud resources](/documentation/categorize/cloud-resources)."}),Dj={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(dx,{examples:[Dj]});var fx=d({description:"Lists cloud resources discovered by inventory scans. Use this endpoint to build infrastructure inventories across connected cloud accounts. Pagination fields limit the returned page.",operationId:"listInventoryResources",tags:["inventory"],url:`${Mj}/resources`,method:"GET",paginated:!0,query:n.Object(te),response:n.Array(dx)});var da="/v0/investigations",$j=["dashboard","monitor","service","slo","log-route"],Gj=n.Object({type:n.String({description:'Kind of linked asset, e.g. "dashboard"'}),id:n.String({description:"Identifier of the linked asset"})}),jj=n.Object({type:n.Enum($j,{description:"Kind of linked asset"}),id:m({allowEmpty:!1,description:"Identifier of the linked asset"})}),Tr=n.Object({id:n.String({description:"Identifier of the investigation"}),name:n.String({description:"Human readable name shown for the investigation"}),contentMd:n.Optional(n.String({description:"Markdown content capturing the investigation notes and findings"})),tags:Qe,owner:n.String({description:"Team ID owning the investigation"}),env:n.Optional(n.String({description:'Environment the investigation relates to, e.g. "prod"'})),linkedAssets:n.Array(Gj,{description:"Assets (dashboards, monitors, \u2026) referenced by this investigation"}),creator:n.Optional(he),updater:n.Optional(he),createdAt:T(),updatedAt:T()},{title:"Investigation"}),fa=n.Object({name:m({allowEmpty:!1,description:"Human readable name shown for the investigation"}),contentMd:n.Optional(m({type:"long",description:"Markdown content capturing the investigation notes and findings"})),tags:et,owner:m({allowEmpty:!1,description:"Team ID owning the investigation"}),env:n.Optional(m({allowEmpty:!0,description:"Environment the investigation relates to"})),linkedAssets:n.Optional(n.Array(jj,{maxItems:100,description:"Assets (dashboards, monitors, \u2026) referenced by this investigation"}))}),HBe=d({tags:["investigations"],url:da,method:"GET",paginated:!0,query:n.Object(te),response:n.Array(Tr)}),KBe=d({tags:["investigations"],url:`${da}/:id`,params:n.Object({id:m()}),method:"GET",response:Tr}),zBe=d({tags:["investigations"],url:da,method:"POST",body:fa,response:Tr}),VBe=d({tags:["investigations"],url:`${da}/:id`,method:"PUT",body:fa,params:n.Object({id:m()}),response:Tr}),YBe=d({tags:["investigations"],url:`${da}/:id`,method:"DELETE",params:n.Object({id:m()}),response:L});var ga=`/${"v1"}/investigations`,gx=d({description:"Retrieve all investigations",tags:["private"],url:ga,method:"GET",paginated:!0,query:n.Object(te),response:n.Array(Tr)}),yx=d({description:"Retrieve an investigation by its id",tags:["private"],url:`${ga}/:id`,method:"GET",params:n.Object({id:m({allowEmpty:!1})}),response:Tr}),hx=d({description:"Create a new investigation",tags:["private"],url:ga,method:"POST",body:fa,response:Tr}),Ex=d({description:"Update an investigation by its id",tags:["private"],url:`${ga}/:id`,method:"PUT",body:fa,params:n.Object({id:m({allowEmpty:!1})}),response:Tr}),Tx=d({description:"Delete an investigation by its id",tags:["private"],url:`${ga}/:id`,method:"DELETE",params:n.Object({id:m({allowEmpty:!1})}),response:L});var ya=`/${"v1"}/monitors`,ha=n.Pick(hr,["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)."}),Fj={id:"123-456-abc",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:[],queries:[{aggregate:{type:"count"},filter:"level:ERROR service:api-gateway"}],conditions:[{formula:"q1",operator:"greater_than",threshold:100}],noDataBehavior:"resolve"},priority:1,owner:"abc-123-def",dashboardId:"789-abc-def",permissions:"all",clusterIds:[]},Bj={id:"456-789-def",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:["abc-123-def"],env:"production",service:"api-gateway"}},priority:2,owner:"abc-123-def",dashboardId:"789-abc-def",permissions:"all",clusterIds:[]};Object.assign(ha,{examples:[Fj,Bj]});var Ix=n.Pick(Ku,["filters","sort","limit","offset"],{description:"Monitor query request. Use filters, sorting, limit, and offset to page through visible monitors."}),qj={filters:{owners:{values:["team-123-abc"]},searchQuery:{value:"service:api-gateway"},tags:{values:[{key:"paging",value:"true"}]},priorities:{values:[4,5],exclude:!0}},sort:{by:"name",direction:"asc"},limit:10,offset:0};Object.assign(Ix,{examples:[qj]});var _x=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:`${ya}/query`,method:"POST",paginated:!0,body:Ix,response:n.Array(ha)}),bx=d({description:"Retrieves one monitor definition by ID when the authenticated operation key can read it. Use this before updating, duplicating, or auditing a monitor.",operationId:"getMonitor",tags:["monitors"],url:`${ya}/:id`,method:"GET",params:n.Object({id:m({allowEmpty:!1,description:"Monitor ID returned by monitor query, create, or update operations."})}),response:ha}),Ax=["name","message","tags","configuration","priority","owner","dashboardId","permissions","clusterIds"],Ox=n.Pick(ta,Ax,{$id:"CreateMonitorRequest",description:"Monitor creation request. Provide ownership, data access, alert configuration, priority, tags, and optional dashboard or cluster scope."}),Sx=n.Pick(ta,Ax,{$id:"UpdateMonitorRequest",description:"Monitor update request. Send the full monitor definition, including ownership, data access, alert configuration, priority, tags, and optional dashboard or cluster scope."}),xx={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:[],queries:[{aggregate:{type:"count"},filter:"level:ERROR service:api-gateway"}],conditions:[{formula:"q1",operator:"greater_than",threshold:100}],noDataBehavior:"resolve"},priority:1,owner:"abc-123-def",dashboardId:"789-abc-def",permissions:"all",clusterIds:[]},Rx={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:["abc-123-def"],env:"production",service:"api-gateway"}},priority:2,owner:"abc-123-def",dashboardId:"789-abc-def",permissions:"all",clusterIds:[]};Object.assign(Ox,{examples:[xx,Rx]});Object.assign(Sx,{examples:[xx,Rx]});var Cx=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:ya,method:"POST",body:Ox,response:ha}),Px=d({description:"Replaces an existing monitor definition by ID. Send the full monitor input shape, including configuration, ownership, permissions, and cluster scope.",operationId:"updateMonitor",tags:["monitors"],url:`${ya}/:id`,method:"PUT",params:n.Object({id:m({allowEmpty:!1,description:"Identifier of the saved monitor to update. Use the `id` returned by monitor query or create responses."})}),body:Sx,response:ha}),Hj=n.Object({id:m({allowEmpty:!1,description:"Identifier of the saved monitor to delete. Use the `id` returned by monitor query, create, or update responses."})}),Ux=d({description:"Deletes a monitor by ID. Deleting a monitor stops future evaluations and alert transitions for that monitor.",operationId:"deleteMonitor",tags:["monitors"],url:`${ya}/:id`,method:"DELETE",params:Hj,response:L});var Ea="/v0/notifications",Dn=`${Ea}/rules`,Nx=`${Ea}/slack/setup`,Tc=`${Ea}/integrations`,vn=["triggered","resolved","no-data"],Kj=["sent","stale","pending","rate-limited","failed","silenced"],zj=n.Optional(n.Object({maxMessages:n.Integer({description:"Maximum number of messages allowed during the rate-limiting window"}),minutes:n.Integer({description:"Length of the rate-limiting window in minutes"})},{description:"Per-target rate-limiting configuration"})),Vj=n.Optional(n.Object({maxMessages:n.Integer({minimum:1,description:"Maximum number of messages allowed during the rate-limiting window"}),minutes:n.Integer({minimum:1,description:"Length of the rate-limiting window in minutes"})},{description:"Per-target rate-limiting configuration"})),Yj=n.Optional(n.Object({mode:n.Literal("each"),renotificationStates:n.Array(n.Enum(["alert","alert_no_data"]),{description:"Alert states that will trigger a renotification"}),renotifyIntervalMinutes:n.Integer({description:"Minimum number of minutes to wait before renotifying"})},{description:"Configuration for repeating notifications over time"})),Qj=n.Optional(n.Object({mode:n.Literal("each"),renotificationStates:n.Array(n.Enum(["alert","alert_no_data"]),{description:"Alert states that will trigger a renotification"}),renotifyIntervalMinutes:n.Integer({minimum:1,description:"Minimum number of minutes to wait before renotifying"})},{description:"Configuration for repeating notifications over time"})),Wj=n.Object({id:n.String({description:"Identifier of the notification target"}),rateLimit:zj,renotifyConfig:Yj,config:O("type",[n.Object({type:n.Literal("slack"),channel:n.String({description:"Slack channel ID that receives the notification"}),integrationId:n.String({description:"Slack workspace ID that receives the notification"}),integrationName:n.String({description:"Human readable name of the Slack integration"})},{$id:"RuleTargetConfigSlack"}),n.Object({type:n.Literal("incident-io"),integrationId:n.String({description:"Identifier of the incident.io integration to use"}),integrationName:n.String({description:"Human readable name of the incident.io integration"})},{$id:"RuleTargetConfigIncidentIo"}),n.Object({type:n.Literal("email"),addresses:n.Array(n.String(),{description:"Email addresses that will receive the alert"})},{$id:"RuleTargetConfigEmail"}),n.Object({type:n.Literal("grafana-irm"),integrationId:n.String({description:"Identifier of the Grafana IRM integration to use"}),integrationName:n.String({description:"Human readable name of the Grafana IRM integration"})},{$id:"RuleTargetConfigGrafanaIrm"}),n.Object({type:n.Literal("pagerduty"),integrationId:n.String({description:"Identifier of the PagerDuty integration to use"}),integrationName:n.String({description:"Human readable name of the PagerDuty integration"})},{$id:"RuleTargetConfigPagerDuty"}),n.Object({type:n.Literal("microsoft-teams"),integrationId:n.String({description:"Identifier of the Microsoft Teams integration to use"}),integrationName:n.String({description:"Human readable name of the Microsoft Teams integration"})},{$id:"RuleTargetConfigMicrosoftTeams"}),n.Object({type:n.Literal("webhook"),integrationId:n.String({description:"Identifier of the webhook integration to use"}),integrationName:n.String({description:"Human readable name of the webhook integration"})},{$id:"RuleTargetConfigWebhook"}),n.Object({type:n.Literal("servicenow"),integrationId:n.String({description:"Identifier of the ServiceNow integration to use"}),integrationName:n.String({description:"Human readable name of the ServiceNow integration"})},{$id:"RuleTargetConfigServiceNow"}),n.Object({type:n.Literal("google-chat"),integrationId:n.String({description:"Identifier of the Google Chat integration to use"}),integrationName:n.String({description:"Human readable name of the Google Chat integration"})},{$id:"RuleTargetConfigGoogleChat"}),n.Object({type:n.Literal("squadcast"),integrationId:n.String({description:"Identifier of the Squadcast integration to use"}),integrationName:n.String({description:"Human readable name of the Squadcast integration"})},{$id:"RuleTargetConfigSquadcast"})],{description:"Configuration describing how the alert was delivered"})}),Zj=n.Object({id:m({description:"Identifier of the notification target"}),rateLimit:Vj,config:O("type",[n.Object({type:n.Literal("slack"),channel:m({allowEmpty:!1,description:"Slack channel ID that receives the notification"}),integrationId:m({allowEmpty:!1,description:"Slack workspace ID that receives the notification"})},{$id:"RuleTargetInputSlack"}),n.Object({type:n.Literal("incident-io"),integrationId:m({allowEmpty:!1,description:"Identifier of the incident.io integration to use"})},{$id:"RuleTargetInputIncidentIo"}),n.Object({type:n.Literal("pagerduty"),integrationId:m({allowEmpty:!1,description:"Identifier of the PagerDuty integration to use"})},{$id:"RuleTargetInputPagerDuty"}),n.Object({type:n.Literal("email"),addresses:n.Array(m({type:"email"}),{minItems:1,maxItems:20,description:"Email addresses that will receive the alert"})},{$id:"RuleTargetInputEmail"}),n.Object({type:n.Literal("grafana-irm"),integrationId:m({allowEmpty:!1,description:"Identifier of the Grafana IRM integration to use"})},{$id:"RuleTargetInputGrafanaIrm"}),n.Object({type:n.Literal("microsoft-teams"),integrationId:m({allowEmpty:!1,description:"Identifier of the Microsoft Teams integration to use"})},{$id:"RuleTargetInputMicrosoftTeams"}),n.Object({type:n.Literal("webhook"),integrationId:m({allowEmpty:!1,description:"Identifier of the webhook integration to use"})},{$id:"RuleTargetInputWebhook"}),n.Object({type:n.Literal("servicenow"),integrationId:m({allowEmpty:!1,description:"Identifier of the ServiceNow integration to use"})},{$id:"RuleTargetInputServiceNow"}),n.Object({type:n.Literal("google-chat"),integrationId:m({allowEmpty:!1,description:"Identifier of the Google Chat integration to use"})},{$id:"RuleTargetInputGoogleChat"}),n.Object({type:n.Literal("squadcast"),integrationId:m({allowEmpty:!1,description:"Identifier of the Squadcast integration to use"})},{$id:"RuleTargetInputSquadcast"})],{description:"Configuration describing how the alert should be delivered"}),renotifyConfig:Qj}),ol=O("type",[n.Object({type:n.Literal("specific-teams",{description:"Match alert transitions associated with specific teams."}),teams:n.Array(n.String(),{description:"Team IDs to select"})}),n.Object({type:n.Literal("all-teams",{description:"Match alert transitions for all teams."})}),n.Object({type:n.Literal("all-public-teams",{description:"Match alert transitions for public teams."})})]),il=O("type",[n.Object({type:n.Literal("specific-teams",{description:"Match alert transitions associated with specific teams."}),teams:n.Array(m(),{minItems:1,maxItems:100,description:"Team IDs to select"})}),n.Object({type:n.Literal("all-teams",{description:"Match alert transitions for all teams."})}),n.Object({type:n.Literal("all-public-teams",{description:"Match alert transitions for public teams."})})]),Fo=n.Object({id:n.String({description:"Unique identifier of the notification rule. Generated by Tsuga."}),name:n.String({description:"Display name of the notification rule."}),queryString:n.Optional(n.String({description:"Query string that narrows down which alerts trigger the rule"})),teamsFilter:ol,prioritiesFilter:n.Array(n.Enum(_t),{description:"Priorities that narrow down the alerts that can trigger a notification"}),transitionTypesFilter:n.Array(n.Enum(vn),{description:"Alert state transitions that can trigger a notification"}),clusterIdsFilter:n.Array(n.String(),{description:"Cluster IDs that can trigger a notification"}),owner:n.String({description:"Team ID that owns and manages the rule."}),createdAt:T({description:"Timestamp when Tsuga created the rule."}),updatedAt:T({description:"Timestamp when Tsuga last updated the rule."}),isActive:n.Boolean({description:"Whether the rule currently sends notifications when its filters match."}),tags:Qe,targets:n.Array(Wj,{description:"Notification targets that can receive notifications when the rule matches"}),creator:n.Optional(he),updater:n.Optional(he)}),Ta=n.Object({name:m({description:"Display name of the notification rule."}),queryString:n.Optional(m({type:"tags-query",description:"Query string that narrows down which alerts trigger the rule"})),teamsFilter:il,prioritiesFilter:n.Array(n.Enum(_t),{maxItems:_t.length,description:"Priorities that narrow down the alerts that can trigger a notification"}),transitionTypesFilter:n.Array(n.Enum(vn),{maxItems:vn.length,description:"Alert state transitions that can trigger a notification"}),clusterIdsFilter:n.Optional(n.Array(m({allowEmpty:!1}),{description:"Cluster IDs that can trigger a notification"})),owner:m({allowEmpty:!1,description:"Team ID that owns and manages the rule"}),tags:et,isActive:n.Boolean({description:"Set to true for the rule to send notifications when its filters match."}),targets:n.Array(Zj,{minItems:1,description:"Notification targets that can receive notifications when the rule matches"})}),hqe=d({tags:["notification-rules"],url:Dn,method:"GET",paginated:!0,query:n.Object(te),response:n.Array(Fo)}),Eqe=d({tags:["notification-rules"],url:`${Dn}/:id`,params:n.Object({id:m()}),method:"GET",response:Fo}),Tqe=d({tags:["notification-rules"],url:Dn,method:"POST",body:Ta,response:Fo}),Iqe=d({tags:["notification-rules"],url:`${Dn}/:id`,method:"PUT",params:n.Object({id:m()}),body:Ta,response:Fo}),_qe=d({tags:["notification-rules"],url:`${Dn}/:id`,method:"DELETE",params:n.Object({id:m()}),response:L}),bqe=d({tags:["notification-integrations"],url:`${Nx}/start`,method:"POST",response:n.Object({redirectUrl:n.String()})}),Xj=n.Object({id:n.String(),name:n.String(),type:n.Enum(["slack","incident-io","grafana-irm","pagerduty","microsoft-teams","webhook","servicenow","google-chat","squadcast"]),createdAt:T(),ruleCount:n.Number(),creator:n.Optional(he)}),Aqe=d({tags:["notification-integrations"],url:`${Dn}/integrations`,method:"GET",paginated:!0,query:n.Object(te),response:n.Array(Xj)}),Oqe=d({tags:["notification-integrations"],url:`${Nx}/callback`,method:"GET",query:n.Object({code:m()}),response:n.Object({success:n.Boolean()})}),al=["POST","PUT"],Jj=n.Record(n.String(),n.String()),eF=n.Record(n.String(),n.Unknown()),tF=n.Record(n.String(),n.Union([n.String(),n.Number(),n.Boolean(),n.Null(),n.Array(n.Union([n.String(),n.Number(),n.Boolean()]))])),rF=O("type",[n.Object({type:n.Literal("json"),value:eF}),n.Object({type:n.Literal("form"),value:tF})]),nF=n.Object({ok:n.String(),alert:n.String()}),sl=n.Object({id:n.String(),name:n.String(),setting:O("type",[n.Object({type:n.Literal("incident-io"),alertSourceConfigId:n.String(),tokenLastChars:n.String()}),n.Object({type:n.Literal("grafana-irm"),urlLastChars:n.String()}),n.Object({type:n.Literal("pagerduty"),integrationKeyLastChars:n.String()}),n.Object({type:n.Literal("microsoft-teams"),webhookUrlLastChars:n.String()}),n.Object({type:n.Literal("webhook"),urlLastChars:n.String(),method:n.Enum(al),authentication:O("type",[n.Object({type:n.Literal("bearer"),tokenLastChars:n.String()}),n.Object({type:n.Literal("basic"),username:n.String(),passwordLastChars:n.String()}),n.Object({type:n.Literal("custom-header"),key:n.String(),valueLastChars:n.String()}),n.Object({type:n.Literal("none")})]),customHeaders:n.Optional(Jj),payloadTemplate:rF,eventNameMapping:n.Optional(nF)}),n.Object({type:n.Literal("servicenow"),instanceName:n.String(),username:n.String(),passwordLastChars:n.String()}),n.Object({type:n.Literal("google-chat"),webhookUrlLastChars:n.String()}),n.Object({type:n.Literal("squadcast"),webhookUrlLastChars:n.String()})]),tags:Qe}),oF=n.Object({type:n.Literal("webhook"),url:m({type:"uri"}),method:n.Enum(al),authentication:O("type",[n.Object({type:n.Literal("bearer"),token:m({allowEmpty:!1})}),n.Object({type:n.Literal("basic"),username:m({allowEmpty:!1}),password:m({allowEmpty:!1})}),n.Object({type:n.Literal("custom-header"),key:m({allowEmpty:!1}),value:m({allowEmpty:!1})}),n.Object({type:n.Literal("none")})]),customHeaders:n.Record(m({allowEmpty:!1}),m()),payloadTemplate:O("type",[n.Object({type:n.Literal("json"),value:n.Record(m({allowEmpty:!1}),n.Unknown())}),n.Object({type:n.Literal("form"),value:n.Record(m({allowEmpty:!1}),n.Union([n.String(),n.Number(),n.Boolean(),n.Null(),n.Array(n.Union([n.String(),n.Number(),n.Boolean()]))]))})]),eventNameMapping:n.Optional(n.Object({ok:m({allowEmpty:!1}),alert:m({allowEmpty:!1})}))}),kx=n.Object({type:n.Literal("incident-io"),alertSourceConfigId:m(),token:m()}),wx=n.Object({type:n.Literal("grafana-irm"),url:m({type:"uri"})}),Lx=n.Object({type:n.Literal("pagerduty"),integrationKey:m()}),Mx=n.Object({type:n.Literal("microsoft-teams"),webhookUrl:m({type:"uri"})}),iF=n.Object({type:n.Literal("servicenow"),instanceName:m({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:m({allowEmpty:!1}),password:m({allowEmpty:!1})}),aF=n.Object({type:n.Literal("google-chat"),webhookUrl:m({type:"uri"})}),sF=n.Object({type:n.Literal("squadcast"),webhookUrl:m({type:"uri"})}),cF=n.Object({name:m(),setting:O("type",[kx,wx,Lx,Mx,oF,iF,aF,sF]),tags:et}),pF=n.Object({type:n.Literal("webhook"),url:n.Optional(m({type:"uri"})),method:n.Optional(n.Enum(al)),authentication:n.Optional(O("type",[n.Object({type:n.Literal("bearer"),token:n.Optional(m({allowEmpty:!1}))}),n.Object({type:n.Literal("basic"),username:n.Optional(m({allowEmpty:!1})),password:n.Optional(m({allowEmpty:!1}))}),n.Object({type:n.Literal("custom-header"),key:n.Optional(m({allowEmpty:!1})),value:n.Optional(m({allowEmpty:!1}))}),n.Object({type:n.Literal("none")})])),customHeaders:n.Optional(n.Record(m({allowEmpty:!1}),m())),payloadTemplate:n.Optional(O("type",[n.Object({type:n.Literal("json"),value:n.Record(m({allowEmpty:!1}),n.Unknown())}),n.Object({type:n.Literal("form"),value:n.Record(m({allowEmpty:!1}),n.Union([n.String(),n.Number(),n.Boolean(),n.Null(),n.Array(n.Union([n.String(),n.Number(),n.Boolean()]))]))})])),eventNameMapping:n.Optional(n.Object({ok:n.Optional(m({allowEmpty:!1})),alert:n.Optional(m({allowEmpty:!1}))}))}),mF=n.Object({type:n.Literal("servicenow"),instanceName:n.Optional(m({allowEmpty:!1})),username:n.Optional(m({allowEmpty:!1})),password:n.Optional(m({allowEmpty:!1}))}),uF=n.Object({type:n.Literal("google-chat"),webhookUrl:m({type:"uri"})}),lF=n.Object({type:n.Literal("squadcast"),webhookUrl:m({type:"uri"})}),dF=n.Object({name:n.Optional(m()),setting:n.Optional(O("type",[kx,wx,Lx,Mx,pF,mF,uF,lF]))}),Sqe=d({tags:["notification-integrations"],url:Tc,method:"POST",body:cF,response:sl}),xqe=d({tags:["notification-integrations"],url:`${Tc}/:id`,method:"GET",params:n.Object({id:m()}),response:sl}),Rqe=d({tags:["notification-integrations"],url:`${Tc}/:id`,method:"PUT",params:n.Object({id:m()}),body:dF,response:sl}),Cqe=d({tags:["notification-integrations"],url:`${Tc}/:id`,method:"DELETE",params:n.Object({id:m()}),response:L}),Pqe=d({tags:["notification-rules"],url:`${wt}/:id/notifications`,method:"GET",params:n.Object({id:m()}),query:n.Optional(n.Object({from:n.Optional(n.Number()),to:n.Optional(n.Number())})),response:n.Object({notifications:n.Array(n.Object({id:n.String(),monitorId:n.String(),monitorResultId:n.String(),ruleId:n.Optional(n.String()),targetId:n.Optional(n.String()),status:n.Enum(Kj),tryCount:n.Number(),nextTryAt:T(),createdAt:T(),updatedAt:T(),sentAt:n.Optional(T())})),isTruncated:n.Boolean()})}),fF=["slack","incident-io","pagerduty","email","grafana-irm","microsoft-teams","webhook","servicenow","google-chat","squadcast"],Uqe=d({tags:["notification-rules"],url:`${Dn}/test`,method:"POST",body:n.Object({notificationRule:Ta,targetIds:n.Optional(n.Array(m({allowEmpty:!1}),{description:"Target IDs to test specific targets",minItems:1,maxItems:10}))}),response:n.Union([n.Object({success:n.Literal(!1),overallMessage:n.String({description:"Message when there is an overall error"})}),n.Object({success:n.Boolean(),results:n.Array(n.Object({targetId:n.String({description:"The ID of the target that was tested"}),targetType:n.Enum(fF,{description:"The type of the target (e.g., slack, webhook)"}),status:n.Enum(["success","failure"],{description:"Whether the test notification was sent successfully"}),message:n.Optional(n.String({description:"Message if the notification failed for this specific target"}))}))})])});var Ia=`/${"v1"}/notification-rules`,_a=n.Pick(Fo,["id","name","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)."}),gF={id:"123-456-abc",name:"Critical Alerts",teamsFilter:{type:"all-teams"},prioritiesFilter:[1,2],transitionTypesFilter:["triggered","resolved"],clusterIdsFilter:[],owner:"abc-123-def",isActive:!0,tags:[{key:"channel",value:"alerts"}],targets:[{id:"789-abc-def",config:{type:"email",addresses:["oncall@example.com"]}}]};Object.assign(_a,{examples:[gF]});var vx=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:Ia,method:"GET",paginated:!0,query:n.Object(te),response:n.Array(_a)}),Dx=d({description:"Retrieves one notification rule by ID when the authenticated operation key can read it. Use this before updating routing or target configuration.",operationId:"getNotificationRule",tags:["notification-rules"],url:`${Ia}/:id`,method:"GET",params:n.Object({id:m({allowEmpty:!1,description:"Identifier of the notification rule to retrieve. Use the `id` returned by notification rule list or create responses."})}),response:_a}),cl=n.Pick(Ta,["name","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."}),yF={name:"Critical Alerts",teamsFilter:{type:"all-teams"},prioritiesFilter:[1,2],transitionTypesFilter:["triggered","resolved"],clusterIdsFilter:[],owner:"abc-123-def",isActive:!0,tags:[{key:"channel",value:"alerts"}],targets:[{id:"789-abc-def",config:{type:"email",addresses:["oncall@example.com"]}}]};Object.assign(cl,{examples:[yF]});var $x=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:Ia,method:"POST",body:cl,response:_a}),Gx=d({description:"Replaces an existing notification rule by ID. Send the full rule input shape, including filters, owner, active state, tags, and targets.",operationId:"updateNotificationRule",tags:["notification-rules"],url:`${Ia}/:id`,method:"PUT",params:n.Object({id:m({allowEmpty:!1,description:"Identifier of the notification rule to update. Use the `id` returned by notification rule list, get, or create responses."})}),body:cl,response:_a}),hF=n.Object({id:m({allowEmpty:!1,description:"Identifier of the notification rule to delete. Use the `id` returned by notification rule list, get, create, or update responses."})}),jx=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:`${Ia}/:id`,method:"DELETE",params:hF,response:L});var Bo=`${Ea}/silences`,Fx=n.Union([n.Literal("monday"),n.Literal("tuesday"),n.Literal("wednesday"),n.Literal("thursday"),n.Literal("friday"),n.Literal("saturday"),n.Literal("sunday")]),EF=n.Partial(n.Record(Fx,n.Array(n.Object({startTime:n.String({format:Qp,description:"Start time for the silence window on this day."}),endTime:n.String({format:Qp,description:"End time for the silence window on this day."})},{title:"SilenceTimeRange"}),{minItems:1,description:"Time ranges for this day"}),{description:"Weekly schedule mapping day of week to time ranges"})),TF=n.Partial(n.Record(Fx,n.Array(n.Object({startTime:n.String({description:"Start time for the silence window on this day."}),endTime:n.String({description:"End time for the silence window on this day."})},{title:"SilenceTimeRange"}),{description:"Time ranges for this day"}),{description:"Weekly schedule mapping day of week to time ranges"})),Ic='IANA timezone identifier (e.g. "America/New_York"). Defaults to UTC if omitted.',Bx="One-time silence schedule with specific start and end times",qx="Recurring weekly silence schedule",IF=O("type",[n.Object({type:n.Literal("one-time",{description:"Silence active once between the configured start and end times."}),startTime:n.String({format:Wp,description:"Start date and time for the one-time silence."}),endTime:n.String({format:Wp,description:"End date and time for the one-time silence."}),timeZone:n.Optional(n.String({format:Yp,description:Ic}))},{$id:"InputSilenceScheduleOneTime",description:Bx}),n.Object({type:n.Literal("recurring",{description:"Silence active on a recurring weekly schedule."}),weeklySchedule:EF,timeZone:n.Optional(n.String({format:Yp,description:Ic}))},{$id:"InputSilenceScheduleRecurring",description:qx})],{description:"Schedule defining when the silence is active"}),_F=O("type",[n.Object({type:n.Literal("one-time",{description:"Silence active once between the configured start and end times."}),startTime:n.String({description:"Start date and time for the one-time silence."}),endTime:n.String({description:"End date and time for the one-time silence."}),timeZone:n.Optional(n.String({description:Ic}))},{$id:"OutputSilenceScheduleOneTime",description:Bx}),n.Object({type:n.Literal("recurring",{description:"Silence active on a recurring weekly schedule."}),weeklySchedule:TF,timeZone:n.Optional(n.String({description:Ic}))},{$id:"OutputSilenceScheduleRecurring",description:qx})],{description:"Schedule defining when the silence is active"}),_c=n.Object({name:m({description:"Display name of the silence"}),reason:m({allowEmpty:!1,type:"long",description:"Reason for the silence"}),owner:m({allowEmpty:!1,description:"Team ID that owns and manages the silence"}),tags:et,isActive:n.Boolean({description:"Whether the silence is currently enabled"}),schedule:IF,notificationRuleIds:n.Optional(n.Array(m(),{description:"Notification rule IDs this silence applies to"})),queryString:n.Optional(m({type:"tags-query",description:"Query string to filter which alerts this silence applies to"})),teamsFilter:il,prioritiesFilter:n.Array(n.Enum(_t),{maxItems:_t.length,description:"Monitor priorities to filter which alerts this silence applies to"}),transitionTypesFilter:n.Array(n.Enum(vn),{maxItems:vn.length,description:"Transition types to filter which alerts this silence applies to"})}),qo=n.Object({id:n.String({description:"Unique identifier of the silence"}),name:n.String({description:"Display name of the silence"}),reason:n.String({description:"Reason for the silence"}),owner:n.String({description:"Team ID that owns and manages the silence"}),tags:Qe,isActive:n.Boolean({description:"Whether the silence is currently enabled"}),schedule:_F,notificationRuleIds:n.Optional(n.Array(n.String(),{description:"Notification rule IDs this silence applies to"})),queryString:n.Optional(n.String({description:"Query string filtering which alerts this silence applies to"})),teamsFilter:ol,prioritiesFilter:n.Array(n.Enum(_t),{description:"Monitor priorities filtering which alerts this silence applies to"}),transitionTypesFilter:n.Array(n.Enum(vn),{description:"Transition types filtering which alerts this silence applies to"}),createdAt:T(),updatedAt:T(),creator:n.Optional(he),updater:n.Optional(he)}),Yqe=d({tags:["notification-silences"],url:Bo,method:"GET",response:n.Array(qo)}),Qqe=d({tags:["notification-silences"],url:`${Bo}/:id`,params:n.Object({id:m()}),method:"GET",response:qo}),Wqe=d({tags:["notification-silences"],url:Bo,method:"POST",body:_c,response:qo}),Zqe=d({tags:["notification-silences"],url:`${Bo}/:id`,method:"PUT",params:n.Object({id:m()}),body:_c,response:qo}),Xqe=d({tags:["notification-silences"],url:`${Bo}/:id`,method:"DELETE",params:n.Object({id:m()}),response:L}),Jqe=d({tags:["notification-silences"],url:`${Bo}/bulk-delete`,method:"DELETE",body:n.Object({ids:n.Array(m())}),response:n.Object({})});var ba=`/${"v1"}/notification-silences`,bc=n.Pick(qo,["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)."}),Hx=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:ba,method:"GET",response:n.Array(bc)}),Kx=d({description:"Retrieves one notification silence by ID when the authenticated operation key can read it. Use this before updating a mute schedule or filter.",operationId:"getNotificationSilence",tags:["notification-silences"],url:`${ba}/:id`,method:"GET",params:n.Object({id:m({allowEmpty:!1,description:"Identifier of the notification silence to retrieve. Use the `id` returned by notification silence list or create responses."})}),response:bc}),zx=n.Pick(_c,["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."}),Vx=d({description:"Creates a notification silence. Matching notifications are suppressed during the configured schedule; monitor evaluation is not paused.",operationId:"createNotificationSilence",tags:["notification-silences"],url:ba,method:"POST",body:zx,response:bc}),Yx=d({description:"Replaces an existing notification silence by ID. Send the full silence input shape, including schedule, filters, owner, active state, and tags.",operationId:"updateNotificationSilence",tags:["notification-silences"],url:`${ba}/:id`,method:"PUT",params:n.Object({id:m({allowEmpty:!1,description:"Identifier of the notification silence to update. Use the `id` returned by notification silence list, get, or create responses."})}),body:zx,response:bc}),bF=n.Object({id:m({allowEmpty:!1,description:"Identifier of the notification silence to delete. Use the `id` returned by notification silence list, get, create, or update responses."})}),Qx=d({description:"Deletes a notification silence by ID. Matching notifications are no longer suppressed by this silence.",operationId:"deleteNotificationSilence",tags:["notification-silences"],url:`${ba}/:id`,method:"DELETE",params:bF,response:L});var AF={critical:3,important:2,normal:1},ue=e=>({label:e,weight:AF[e]}),OF={"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:"log",category:"routing",impact:ue("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:"log",category:"routing",impact:ue("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:"resource",category:"routing",impact:ue("important"),recommendation:"Ensure every team manages a dedicated route scoped to its context.team value."},"service-name-present":{key:"service-name-present",title:`${rc} present`,summary:`Logs and spans must populate ${rc} with a non-empty value.`,rationale:"Core identifier used to correlate telemetry across services.",objectType:"resource",category:"hygiene",impact:ue("critical"),recommendation:`Populate ${rc} 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:"integrity",impact:ue("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:"consistency",impact:ue("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:`${ra} presence`,summary:`Logs and spans must populate ${ra} with a non-empty value.`,rationale:"Core identifier used to correlate telemetry across services.",objectType:"resource",category:"hygiene",impact:ue("important"),recommendation:`Populate ${ra} 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:"consistency",impact:ue("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:"redundancy",impact:ue("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:"cost",impact:ue("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:"hygiene",impact:ue("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-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:"resource",category:"hygiene",impact:ue("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:"resource",category:"hygiene",impact:ue("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:"integrity",impact:ue("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 in dashboards and monitors",summary:"Percentage of ingested metrics that are referenced by at least one dashboard or monitor.",rationale:"Unused metrics increase costs and cardinality without providing value. Tracking usage helps identify waste.",objectType:"metric",category:"cost",impact:ue("important"),recommendation:"Create dashboards or monitors for unused metrics, or stop collecting them to reduce costs.",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:"resource",category:"hygiene",impact:ue("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:"resource",category:"hygiene",impact:ue("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:"resource",category:"hygiene",impact:ue("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:"resource",category:"hygiene",impact:ue("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:"resource",category:"hygiene",impact:ue("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:"resource",category:"hygiene",impact:ue("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:"resource",category:"hygiene",impact:ue("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:"resource",category:"integrity",impact:ue("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:"hygiene",impact:ue("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 k8sattributes 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:"hygiene",impact:ue("important"),recommendation:"Enable the OpenTelemetry Collector k8sclusterreceiver (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:"hygiene",impact:ue("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."},"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:"consistency",impact:ue("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:"resource",category:"hygiene",impact:ue("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:"resource",category:"hygiene",impact:ue("important"),recommendation:"Rotate or delete ingestion API keys that have sent no data in the last 30 days."}},Wx=Object.values(OF);var Zx=["passed","failed","ignored"],SF=n.Enum(Zx),ml=["unrouted-logs","no-over-routed-logs","team-has-route","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-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","use-standard-attributes","no-unused-operation-api-keys","no-unused-ingestion-api-keys"],xF=n.Enum(ml),RF=["log","metric","resource","span"],CF=["team","global"],ul=n.Object({key:n.Enum(ml),title:n.String(),summary:n.String(),rationale:n.String(),objectType:n.Enum(RF),category:n.Enum(["hygiene","routing","integrity","consistency","redundancy","cost"]),impact:n.Object({label:n.Enum(["critical","important","normal"]),weight:n.Number()}),recommendation:n.String(),scope:n.Optional(n.Enum(CF))}),Xx=n.Object({type:n.String({description:"Tsuga asset kind referenced by this example (e.g. `monitor`)"}),label:n.String({description:"Human-readable summary of the example"}),link:n.Object({to:n.String({description:"In-app route the example deep-links to"}),search:n.Optional(n.Unknown({description:"Search-query payload for the deep link"})),params:n.Optional(n.Unknown({description:"Route params for the deep link"}))},{description:"In-app deep link to inspect the example"})}),pl=n.Intersect([ul,n.Object({status:SF,normalizedScore:n.Number(),details:n.Optional(n.Record(n.String(),n.Unknown())),recommendation:n.Optional(n.String()),examples:n.Optional(n.Array(Xx))})]),PF=n.Object({generatedAt:n.String(),overallScore:n.Optional(n.Number()),rules:n.Array(ul),teamResults:n.Array(n.Object({teamId:n.String(),teamName:n.String(),teamWeight:n.Number(),score:n.Number(),weightedScore:n.Number(),totalWeight:n.Number(),ruleResults:n.Array(pl)})),globalResults:n.Optional(n.Object({score:n.Optional(n.Number()),ruleResults:n.Array(pl)}))}),ll=n.Object({id:n.String({description:"Quality report row id"}),reportId:n.String({description:"Identifier shared by every row from the same generation for a given owner (team or cluster)"}),ruleId:n.Enum(ml,{description:"Rule key evaluated in this row"}),owner:n.Optional(n.String({description:"Team id this row applies to; absent for global rules"})),status:n.Enum(Zx,{description:"Outcome of evaluating the rule for this owner"}),score:n.Number({description:"Score in [0, 1] for this rule on this owner"}),weight:n.Number({description:"Rule impact weight captured at generation time"}),reportOverallScore:n.Number({description:"Aggregated score across this owner\u2019s rule rows in the same generation"}),reportTotalWeight:n.Number({description:"Sum of weights of this owner\u2019s applicable rule rows in the same generation"}),recommendation:n.Optional(n.String({description:"Owner-specific recommendation; falls back to the rule\u2019s default if absent"})),examples:n.Optional(n.Array(Xx,{description:"Concrete assets supporting this evaluation; absent for global rules unless the caller is an admin"})),createdAt:n.String({description:"ISO timestamp the row was generated at"})}),fHe=d({tags:["quality-reports"],url:"/v0/quality-reports",method:"POST",response:PF}),gHe=d({tags:["quality-reports"],url:"/v0/quality-reports/latest",method:"GET",query:n.Object({clusterId:n.Optional(m({allowEmpty:!1})),team:n.Optional(m({allowEmpty:!1}))}),response:n.Array(ll,{description:"Latest persisted rule evaluation rows for the cluster"})}),yHe=d({tags:["quality-reports"],url:"/v0/quality-reports/preview",method:"POST",body:n.Object({ruleKey:xF,teamId:m(),lookbackMinutes:n.Optional(n.Integer({minimum:1,maximum:60})),clusterId:n.Optional(m({allowEmpty:!1}))}),response:n.Object({rule:ul,result:pl,teamId:n.String(),teamName:n.String()})}),hHe=new Map(Wx.map(e=>[e.key,e]));var UF=`/${"v1"}/quality-reports`,Jx=n.Object(ll.properties,{$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)."}),NF={id:"r_01J9X3Z4VYABCDEF",reportId:"b_01J9X3Z4VYABCDEF",ruleId:"team-has-route",owner:"t_01J9X3Z4VYABCDEF",status:"passed",score:1,weight:2,reportOverallScore:.85,reportTotalWeight:2,createdAt:"2026-02-26T12:00:00.000Z"};Object.assign(Jx,{examples:[NF]});var kF=n.Object({clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Required when the org has more than one cluster."})),team:n.Optional(m({allowEmpty:!1,description:"Name of the team to scope the report to. When set, only this team's rule rows are returned and cluster-wide global rows are omitted."}))},{description:"Latest quality report lookup query."}),eR=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:`${UF}/latest`,method:"GET",query:kF,response:n.Array(Jx)});var Aa="/v0/admin-center";var rr=`${Aa}/retention-policies`,tR=3650,wF=n.Integer({description:"Number of days Tsuga retains matching telemetry."}),rR=n.Integer({minimum:1,maximum:tR,description:`Number of days Tsuga should retain matching telemetry. Valid values are 1 through ${tR}.`}),Ir=n.Object({id:n.String({description:"Unique identifier of the retention policy. Generated by Tsuga."}),env:n.Optional(n.String({description:"Environment tag value this policy applies to. Omitted policies apply across environments unless a more specific policy exists."})),teamId:n.Optional(n.String({description:"Team ID this policy applies to. Omitted policies apply globally unless a team-specific policy exists."})),dataSource:n.Enum(Nt,{description:"Telemetry signal retained by this policy: logs, metrics, or traces."}),durationDays:wF,isEnabled:n.Boolean({description:"Whether this policy participates in retention resolution."}),createdAt:T({description:"Timestamp when Tsuga created the retention policy."}),updatedAt:T({description:"Timestamp when Tsuga last updated the retention policy."})}),Ac=n.Object({env:n.Optional(m({description:"Environment tag value this policy applies to. Omit for a policy that is not environment-specific."})),teamId:n.Optional(m({description:"Team ID this policy applies to. Omit for a policy that is not team-specific."})),dataSource:n.Enum(Nt,{description:"Telemetry signal retained by this policy: logs, metrics, or traces."}),durationDays:rR,isEnabled:n.Boolean({description:"Set to true for the policy to participate in retention resolution."})}),nR=n.Array(n.Object({env:m(),dataSource:n.Enum(Nt),durationDays:n.Union([rR,n.Null()]),isEnabled:n.Boolean()})),oR=n.Object({inserted:n.Array(Ir),updated:n.Array(Ir),deleted:n.Array(Ir)}),kHe=d({tags:["retention-policies"],url:rr,method:"POST",body:Ac,response:Ir}),wHe=d({tags:["retention-policies"],url:rr,method:"GET",response:n.Array(Ir)}),LHe=d({tags:["retention-policies"],url:`${rr}/:id`,method:"GET",params:n.Object({id:m()}),response:Ir}),MHe=d({tags:["retention-policies"],url:`${rr}/:id`,method:"PUT",params:n.Object({id:m()}),body:Ac,response:Ir}),vHe=d({tags:["retention-policies"],url:`${rr}/bulk-update`,method:"POST",body:nR,response:oR}),DHe=d({tags:["retention-policies"],url:`${rr}/bulk-update-for-team`,method:"POST",body:n.Object({teamId:m(),policies:nR}),response:oR}),$He=d({tags:["retention-policies"],url:`${rr}/:id`,method:"DELETE",params:n.Object({id:m()}),response:L}),Oa=["past-24-hours","past-7-days","past-30-days"],GHe=d({tags:["retention-policies"],url:`${rr}/requested-history-percentile/:teamId`,method:"POST",params:n.Object({teamId:m()}),body:n.Object({percentile:n.Number({minimum:0,maximum:1}),observationWindow:n.Enum(Oa),dataSource:n.Enum(Nt)}),response:n.Object({percentile:n.Number(),observationWindow:n.Enum(Oa),dataSource:n.Enum(Nt),teamId:n.String(),requestedHistoryDays:n.Number()})}),LF=["1-day","3-days","7-days","1-month","6-months","more-than-6-months"];var MF=n.Array(n.Object({bucket:n.Enum(LF),count:n.Number()})),jHe=d({tags:["retention-policies"],url:`${rr}/requested-history-histogram/:teamId`,method:"POST",params:n.Object({teamId:m()}),body:n.Object({observationWindow:n.Enum(Oa),dataSource:n.Enum(Nt)}),response:n.Object({observationWindow:n.Enum(Oa),dataSource:n.Enum(Nt),teamId:n.String(),histogram:MF})}),FHe=d({tags:["retention-policies"],url:`${rr}/top-teams-with-retention-surplus`,method:"POST",body:n.Object({dataSource:n.Enum(Nt),observationWindow:n.Enum(Oa),percentile:n.Number({minimum:0,maximum:1}),topN:n.Optional(n.Number({minimum:1,maximum:20}))}),response:n.Array(n.Object({teamId:n.String(),retentionSurplusDays:n.Number()}))});var Sa=`/${"v1"}/retention-policies`,xa=n.Pick(Ir,["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)."}),vF={id:"123-456-abc",env:"production",teamId:"abc-123-def",dataSource:"logs",durationDays:30,isEnabled:!0};Object.assign(xa,{examples:[vF]});var iR=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:Sa,method:"GET",response:n.Array(xa)}),aR=d({description:"Retrieves one retention policy by ID when the authenticated operation key can read it. Use this before updating duration or enabled state.",operationId:"getRetentionPolicy",tags:["retention-policies"],url:`${Sa}/:id`,method:"GET",params:n.Object({id:m({allowEmpty:!1,description:"Identifier of the retention policy to retrieve. Use the `id` returned by retention policy list or create responses."})}),response:xa}),dl=n.Pick(Ac,["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."}),DF={env:"production",teamId:"abc-123-def",dataSource:"logs",durationDays:30,isEnabled:!0};Object.assign(dl,{examples:[DF]});var sR=d({description:"Creates a retention policy row for a telemetry signal, optionally scoped to an environment or team.",operationId:"createRetentionPolicy",tags:["retention-policies"],url:Sa,method:"POST",body:dl,response:xa}),cR=d({description:"Replaces an existing retention policy by ID, including signal, scope fields, duration, and enabled state.",operationId:"updateRetentionPolicy",tags:["retention-policies"],url:`${Sa}/:id`,method:"PUT",params:n.Object({id:m({allowEmpty:!1,description:"Identifier of the retention policy to update. Use the `id` returned by retention policy list, get, or create responses."})}),body:dl,response:xa}),pR=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:`${Sa}/:id`,method:"DELETE",params:n.Object({id:m({allowEmpty:!1,description:"Identifier of the retention policy to delete. Use the `id` returned by retention policy list, create, or update responses."})}),response:L});var $F=15,Oc={id:n.String({description:"Unique identifier of the processor within the route. Used to preserve processor identity during updates."}),description:n.Optional(n.String({description:"Optional user-provided processor note."})),tags:Qe,updatedAt:n.Optional(T({description:"Timestamp when Tsuga last updated the processor."}))},Sc={id:m({allowEmpty:!1,description:"Unique identifier of the processor within the route. Preserve it across updates for existing processors."}),description:n.Optional(m({type:"long",description:"Optional processor note."})),tags:et,updatedAt:n.Optional(T())},GF={...Oc,type:n.Literal("creator",{description:"Create processor. It writes a new attribute from a format string, formula, or category rule."})},jF={...Sc,type:n.Literal("creator",{description:"Create processor. It writes a new attribute from a format string, formula, or category rule."})},FF=O("subtype",[n.Object({targetAttribute:n.String({description:"Attribute that will receive the formatted value"}),formatString:n.String({description:"Template string used to build the target attribute value"}),overrideTarget:n.Optional(n.Boolean({description:"Whether to overwrite the target attribute when it already exists."})),subtype:n.Literal("format-string",{description:"Builds a string from literal text and existing attribute values."}),replaceMissingByEmpty:n.Optional(n.Boolean({description:"Whether missing referenced attributes render as empty strings."}))},{$id:"ProcessorParamsCreatorFormatString"}),n.Object({targetAttribute:n.String({description:"Attribute that will receive the computed value"}),formula:n.String({description:"Mathematical formula evaluated to populate the target attribute"}),overrideTarget:n.Optional(n.Boolean({description:"Whether to overwrite the target attribute when it already exists."})),subtype:n.Literal("math-formula",{description:"Evaluates a mathematical expression and writes the numeric result."}),replaceMissingBy0:n.Optional(n.Boolean({description:"Whether missing referenced attributes evaluate as zero."}))},{$id:"ProcessorParamsCreatorMathFormula"}),n.Object({targetAttribute:n.String({description:"Attribute that will receive the category value"}),clauses:n.Array(n.Object({query:n.String({description:"Query that selects the logs assigned to this category"}),value:n.String({description:"Category value assigned when the query matches"})}),{description:"Conditions evaluated in order to determine the category value"}),defaultValue:n.Optional(n.String({description:"Category value used when no condition matches"})),subtype:n.Literal("category",{description:"Assigns the first matching category value from ordered query clauses, with an optional default."})},{$id:"ProcessorParamsCreatorCategory"})]),BF=O("subtype",[n.Object({targetAttribute:m({allowEmpty:!1,description:"Attribute that will receive the formatted value"}),formatString:m({allowEmpty:!1,type:"long",description:"Template string used to build the target attribute value"}),overrideTarget:n.Optional(n.Boolean({description:"Set to true to overwrite an existing target attribute value (defaults to true)"})),subtype:n.Literal("format-string"),replaceMissingByEmpty:n.Optional(n.Boolean({description:"Set to true for missing referenced attributes to render as empty strings."}))},{$id:"InputProcessorParamsCreatorFormatString"}),n.Object({targetAttribute:m({allowEmpty:!1,description:"Attribute that will receive the computed value"}),formula:m({allowEmpty:!1,type:"long",description:"Mathematical formula evaluated to populate the target attribute"}),overrideTarget:n.Optional(n.Boolean({description:"Set to true to overwrite an existing target attribute value (defaults to true)"})),subtype:n.Literal("math-formula"),replaceMissingBy0:n.Optional(n.Boolean({description:"Set to true for missing referenced attributes to evaluate as zero."}))},{$id:"InputProcessorParamsCreatorMathFormula"}),n.Object({targetAttribute:m({allowEmpty:!1,description:"Attribute that will receive the category value"}),clauses:n.Array(n.Object({query:m({allowEmpty:!1,type:"tsuga-query",description:"Query that selects the logs assigned to this category"}),value:m({allowEmpty:!1,description:"Category value assigned when the query matches"})}),{minItems:1,maxItems:$F,description:"Conditions evaluated in order to determine the category value"}),defaultValue:n.Optional(m({description:"Category value used when no condition matches"})),subtype:n.Literal("category")},{$id:"InputProcessorParamsCreatorCategory"})]),qF=n.Object({...GF,params:FF}),HF=n.Object({...jF,params:BF}),KF={...Oc,type:n.Literal("mapper",{description:"Map processor. It moves, copies, or normalizes existing log attributes."})},zF={...Sc,type:n.Literal("mapper",{description:"Map processor. It moves, copies, or normalizes existing log attributes."})},VF=O("subtype",[n.Object({attributes:n.Array(n.Object({originAttribute:n.String({description:"Attribute name to map to the target attribute"}),keepOrigin:n.Optional(n.Boolean({description:"Whether the source attribute is preserved after mapping."})),overrideTarget:n.Optional(n.Boolean({description:"Whether to overwrite the target attribute when it already exists."})),targetAttribute:n.String({description:"Attribute name that will receive the mapped value"})}),{description:"Mappings that map individual attributes to new targets"}),subtype:n.Literal("map-attributes",{description:"Copies or moves one or more source attributes to target attributes."})},{$id:"ProcessorParamsMapperMapAttributes"}),n.Object({attributeName:n.String({description:"Attribute whose value will determine the log level"}),subtype:n.Literal("map-level",{description:"Normalizes a severity or status attribute into Tsuga log levels."})},{$id:"ProcessorParamsMapperMapLevel"}),n.Object({attributeName:n.String({description:"Attribute whose value will determine the log timestamp"}),subtype:n.Literal("map-timestamp",{description:"Uses an event-time attribute as the log timestamp."})},{$id:"ProcessorParamsMapperMapTimestamp"})]),YF=O("subtype",[n.Object({attributes:n.Array(n.Object({originAttribute:m({allowEmpty:!1,description:"Attribute name to map to the target attribute"}),keepOrigin:n.Optional(n.Boolean({description:"Preserve the source attribute after mapping (defaults to false)"})),overrideTarget:n.Optional(n.Boolean({description:"Overwrite the target attribute when it already exists (defaults to true)"})),targetAttribute:m({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:n.Literal("map-attributes")},{$id:"InputProcessorParamsMapperMapAttributes"}),n.Object({attributeName:m({allowEmpty:!1,description:"Attribute whose value will determine the log level"}),subtype:n.Literal("map-level")},{$id:"InputProcessorParamsMapperMapLevel"}),n.Object({attributeName:m({allowEmpty:!1,description:"Attribute whose value will determine the log timestamp"}),subtype:n.Literal("map-timestamp")},{$id:"InputProcessorParamsMapperMapTimestamp"})]),QF=n.Object({...zF,params:YF}),WF=n.Object({...KF,params:VF}),ZF={...Oc,type:n.Literal("parse-attribute",{description:"Parse processor. It extracts structured fields from a text attribute."})},XF={...Sc,type:n.Literal("parse-attribute",{description:"Parse processor. It extracts structured fields from a text attribute."})},JF=5,eB=O("subtype",[n.Object({attributeName:n.String({description:"Attribute whose value will be parsed with Grok rules"}),rules:n.Array(n.String({description:"Grok rule applied to parse text"}),{description:"Ordered Grok rules evaluated until one matches"}),samples:n.Optional(n.Array(n.String(),{description:"Example log lines for validation"})),subtype:n.Literal("grok",{description:"Extracts fields from unstructured text using ordered Grok rules."})}),n.Object({sourceAttribute:n.String({description:"Attribute containing the URL to parse"}),subtype:n.Literal("url",{description:"Parses a URL attribute and writes URL detail fields."})}),n.Object({sourceAttribute:n.String({description:"Attribute containing the user agent string to parse"}),subtype:n.Literal("user-agent",{description:"Parses a user-agent string and writes browser, operating system, and device details."})}),n.Object({sourceAttribute:n.String({description:"Attribute containing the key/value string segment to parse"}),targetAttribute:n.String({description:"Attribute prefix where extracted key/value pairs will be written"}),keyValueSplitter:n.String({description:"Delimiter separating keys from values in the source string"}),pairsSplitter:n.String({description:"Delimiter separating each key/value pair. Will default to whitespace if not set."}),acceptStandaloneKey:n.Boolean({description:"Whether keys without explicit values are accepted by the parser."}),subtype:n.Literal("key-value",{description:"Parses delimited key/value text into attributes."})})]),tB=O("subtype",[n.Object({attributeName:m({allowEmpty:!1,description:"Attribute whose value will be parsed with Grok rules"}),rules:n.Array(m({allowEmpty:!1,type:"long",description:"Grok rule applied to parse text"}),{minItems:1,maxItems:5,description:"Ordered Grok rules evaluated until one matches"}),samples:n.Optional(n.Array(m({type:"long"}),{maxItems:JF,description:"Example log lines for validation"})),subtype:n.Literal("grok")}),n.Object({sourceAttribute:m({allowEmpty:!1,description:"Attribute containing the URL to parse"}),subtype:n.Literal("url")}),n.Object({sourceAttribute:m({allowEmpty:!1,description:"Attribute containing the user agent string to parse"}),subtype:n.Literal("user-agent")}),n.Object({sourceAttribute:m({allowEmpty:!1,description:"Attribute containing the key/value string segment to parse"}),targetAttribute:m({description:"Attribute prefix where extracted key/value pairs will be written"}),keyValueSplitter:m({allowEmpty:!1,description:"Delimiter separating keys from values in the source string"}),pairsSplitter:m({allowEmpty:!0,description:"Delimiter separating each key/value pair. Will default to whitespace if not set."}),acceptStandaloneKey:n.Boolean({description:"Set to true to accept keys without explicit values."}),subtype:n.Literal("key-value",{description:"Parses delimited key/value text into attributes."})})]),rB=n.Object({...ZF,params:eB}),nB=n.Object({...XF,params:tB}),oB=11,mR=n.Cyclic({OutputProcessor:n.Union([WF,rB,qF,n.Object({...Oc,params:n.Object({items:n.Array(n.Object({query:n.String({description:"Query that determines whether logs enter this branch"}),processors:n.Array(n.Ref("OutputProcessor"),{description:"Processors executed when the branch query matches"})}),{description:"Conditional branches evaluated in order before falling back to the default"})}),type:n.Literal("split",{description:"Split processor. It sends each log through the first matching conditional branch."})})])},"OutputProcessor",{description:"Processing step executed sequentially on route logs"}),uR=n.Cyclic({InputProcessor:n.Union([QF,nB,HF,n.Object({...Sc,params:n.Object({items:n.Array(n.Object({query:m({type:"tsuga-query",description:"Query that determines whether logs enter this branch"}),processors:n.Array(n.Ref("InputProcessor"),{maxItems:50,description:"Processors executed when the branch query matches"})}),{minItems:2,maxItems:oB,description:"Conditional branches evaluated in order before falling back to the default"})}),type:n.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 iB="/v0/logs",Xr=`${iB}/routes`,$n=n.Object({id:n.String({description:"Unique identifier of the log route. Generated by Tsuga."}),name:n.String({description:"Human-readable route name shown in Tsuga."}),description:n.Optional(n.String({description:"Optional user-provided route description."})),isEnabled:n.Boolean({description:"Whether this route is active for newly ingested logs. Disabled routes remain saved but do not process logs."}),query:n.String({description:"Tsuga query that selects which newly ingested logs enter the route processor chain."}),rank:n.Number({description:"Route evaluation order. Enabled routes are checked from lower rank to higher rank during ingestion."}),tags:Qe,owner:n.String({description:"Team ID that owns and manages the route."}),processors:n.Array(mR,{description:"Ordered processors applied to logs that match the route"}),creator:n.Optional(he),updater:n.Optional(he),updatedAt:T({description:"Timestamp when Tsuga last updated the route."}),createdAt:T({description:"Timestamp when Tsuga created the route."}),assetUpdatedAt:T({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})},{title:"Route"}),Ra=n.Object({name:m({allowEmpty:!1,description:"Human-readable route name shown in Tsuga."}),description:n.Optional(m({type:"long",description:"Optional route description."})),isEnabled:n.Boolean({description:"Set to true for the route to process newly ingested matching logs. Set to false to save it without running it."}),query:m({type:"tsuga-query",description:"Tsuga query that selects which newly ingested logs enter the route processor chain."}),tags:et,owner:m({allowEmpty:!1,description:"Team ID that will own and manage the route."}),processors:n.Array(uR,{maxItems:50,description:"Ordered processors applied to logs that match the route"})}),c2e=d({tags:["routes"],url:Xr,method:"GET",paginated:!0,query:n.Object(te),response:n.Array($n)}),p2e=d({tags:["routes"],url:`${Xr}/:id`,params:n.Object({id:m()}),method:"GET",response:$n}),m2e=d({tags:["routes"],url:Xr,method:"POST",body:Ra,response:$n}),u2e=d({tags:["routes"],url:`${Xr}/:id`,method:"PUT",body:Ra,params:n.Object({id:m()}),response:$n}),l2e=d({tags:["routes"],url:`${Xr}/:id/clone`,method:"POST",params:n.Object({id:m()}),body:Ra,response:$n}),d2e=d({tags:["routes"],url:`${Xr}/:id`,method:"DELETE",params:n.Object({id:m()}),response:L}),f2e=d({tags:["routes"],url:`${Xr}/:id/modify-ranking`,method:"PUT",params:n.Object({id:m()}),body:n.Object({rank:n.Number()}),response:n.Object({})}),g2e=d({tags:["routes"],url:`${Xr}/:id/enable`,method:"PUT",params:n.Object({id:m()}),body:n.Object({enable:n.Boolean()}),response:n.Object({})});var Ca=`/${"v1"}/routes`,Pa=n.Pick($n,["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)."}),aB={id:"123-456-abc",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:"abc-123-def",processors:[{id:"789-abc-def",type:"parse-attribute",tags:[],params:{subtype:"grok",attributeName:"message",rules:["%{TIMESTAMP_ISO8601:timestamp} %{LOGLEVEL:level} %{GREEDYDATA:msg}"]}}]};Object.assign(Pa,{examples:[aB]});var lR=d({description:"Lists log routes visible to the authenticated operation key. Use this to inventory ingest-time processing definitions and owners. Pagination fields limit the returned page.",operationId:"listRoutes",tags:["routes"],url:Ca,method:"GET",paginated:!0,query:n.Object(te),response:n.Array(Pa)}),dR=d({description:"Retrieves one log route by ID when the authenticated operation key can read it. Use this before updating processors or route metadata.",operationId:"getRoute",tags:["routes"],url:`${Ca}/:id`,method:"GET",params:n.Object({id:m({allowEmpty:!1,description:"Identifier of the log route to retrieve. Use the `id` returned by route list or create responses."})}),response:Pa}),fl=n.Pick(Ra,["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."}),sB={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:"abc-123-def",processors:[{id:"789-abc-def",type:"parse-attribute",tags:[],params:{subtype:"grok",attributeName:"message",rules:["%{TIMESTAMP_ISO8601:timestamp} %{LOGLEVEL:level} %{GREEDYDATA:msg}"]}}]};Object.assign(fl,{examples:[sB]});var fR=d({description:"Creates a log route. Routes affect only newly ingested logs after the cluster receives the updated configuration.",operationId:"createRoute",tags:["routes"],url:Ca,method:"POST",body:fl,response:Pa}),gR=d({description:"Replaces an existing log route by ID. Routes affect only newly ingested logs after the cluster receives the updated configuration.",operationId:"updateRoute",tags:["routes"],url:`${Ca}/:id`,method:"PUT",body:fl,params:n.Object({id:m({allowEmpty:!1,description:"Identifier of the log route to update. Use the `id` returned by route list, get, or create responses."})}),response:Pa}),yR=d({description:"Deletes a log route by ID. The route stops processing future logs after the cluster receives the updated configuration.",operationId:"deleteRoute",tags:["routes"],url:`${Ca}/:id`,method:"DELETE",params:n.Object({id:m({allowEmpty:!1,description:"Identifier of the log route to delete. Use the `id` returned by route list, create, or update responses."})}),response:L});var Gn=`${Aa}/tag-policies`;var hR=["ingestion-api-key","operation-api-key","rum-public-token","dashboard","log-route","monitor","notification-rule","notification-silence","slo"],cB=["logs","metrics","traces"],gl=n.Array(n.Enum(hR,{description:"Tsuga-managed asset type covered by an asset tag policy."}),{description:"Tsuga-managed asset types covered by the policy. An empty array means all supported asset types."}),yl=n.Array(n.Enum(cB,{description:"Telemetry signal covered by a data tag policy."}),{description:"Telemetry signals covered by the policy. An empty array means logs, metrics, and traces."}),pB=n.Union([gl,yl]),mB=n.Object({teamIds:n.Array(n.String(),{description:"Team IDs used by this policy scope."}),mode:n.Enum(["include","exclude"],{description:"`include` applies the policy only to listed teams. `exclude` applies it to all teams except the listed teams."})}),uB=O("type",[n.Object({type:n.Literal("telemetry",{description:"Policy applies to telemetry data points during ingestion or evaluation."}),assetTypes:yl,shouldInsertWarning:n.Boolean({description:"When true, Tsuga annotates non-compliant telemetry with tag policy warnings instead of only measuring violations."}),dropSample:n.Optional(n.Number({description:"Percentage of non-compliant telemetry datapoints to drop. Omitted means no sampling drop is configured."}))}),n.Object({type:n.Literal("tsuga_asset",{description:"Policy applies to Tsuga-managed resources such as dashboards, routes, and keys."}),assetTypes:gl})]),lB=O("type",[n.Object({type:n.Literal("telemetry",{description:"Policy applies to telemetry data points during ingestion or evaluation."}),assetTypes:yl,shouldInsertWarning:n.Boolean({description:"When true, Tsuga annotates non-compliant telemetry with tag policy warnings instead of only measuring violations."}),dropSample:n.Optional(n.Number({minimum:0,maximum:100,description:"Percentage of non-compliant telemetry datapoints to drop. Valid values are 0 through 100."}))}),n.Object({type:n.Literal("tsuga_asset",{description:"Policy applies to Tsuga-managed resources such as dashboards, routes, and keys."}),assetTypes:gl})]),Ho=n.Object({id:n.String({description:"Unique identifier of the tag policy. Generated by Tsuga."}),name:n.String({description:"Human-readable tag policy name."}),description:n.Optional(n.String({description:"Optional user-provided policy description."})),isActive:n.Boolean({description:"Whether Tsuga currently evaluates this policy."}),tagKey:n.String({description:"Tag key enforced by this policy."}),allowedTagValues:n.Array(n.String(),{description:"Allowed values for `tagKey`. An empty array means any value is accepted when the tag exists."}),isRequired:n.Boolean({description:"Whether the tag must be present. If false, `allowedTagValues` is still enforced when the tag exists."}),teamScope:n.Optional(mB),configuration:uB,creator:n.Optional(he),updater:n.Optional(he),owner:n.Optional(n.String({description:"Team ID that owns and manages the policy."})),createdAt:T({description:"Timestamp when Tsuga created the tag policy."}),updatedAt:T({description:"Timestamp when Tsuga last updated the tag policy."}),assetUpdatedAt:T({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})});var Ua=n.Object({name:m({description:"Human-readable tag policy name."}),description:n.Optional(m({description:"Optional policy description."})),isActive:n.Boolean({description:"Set to true for Tsuga to evaluate this policy."}),tagKey:m({allowEmpty:!1,description:"Tag key enforced by this policy."}),allowedTagValues:n.Array(m({allowEmpty:!1}),{maxItems:1e3,description:"Allowed values for `tagKey`. Leave empty to allow any value when the tag exists."}),isRequired:n.Boolean({description:"Set to true to require the tag. If false, allowed values still apply when the tag exists."}),teamScope:n.Optional(n.Object({teamIds:n.Array(m(),{minItems:1,maxItems:100,description:"Team IDs used by this policy scope."}),mode:n.Enum(["include","exclude"],{description:"`include` applies the policy only to listed teams. `exclude` applies it to all teams except the listed teams."})})),configuration:lB,owner:m({allowEmpty:!1,description:"Team ID that will own and manage the policy."})}),U2e=d({tags:["tag-policies"],url:Gn,method:"GET",query:n.Object({teamIds:n.Optional(n.Array(m(),{maxItems:100})),assetTypes:n.Optional(pB),searchQuery:n.Optional(m())}),response:n.Array(Ho)}),N2e=d({tags:["tag-policies"],url:`${Gn}/:id`,method:"GET",params:n.Object({id:m()}),response:Ho}),k2e=d({tags:["tag-policies"],url:Gn,method:"POST",body:Ua,response:Ho}),w2e=d({tags:["tag-policies"],url:`${Gn}/:id`,method:"PUT",params:n.Object({id:m()}),body:Ua,response:Ho}),L2e=d({tags:["tag-policies"],url:`${Gn}/:id`,method:"DELETE",params:n.Object({id:m()}),response:L}),M2e=d({tags:["tag-policies"],url:`${Aa}/applicable-tag-rules`,method:"GET",query:n.Object({assetType:n.Enum(hR),teamId:m()}),response:n.Array(n.Object({tagKey:n.String(),allowedTagValues:n.Array(n.String()),isRequired:n.Boolean()}))}),ER=n.Object({total:n.Number(),totalNonCompliant:n.Number(),idsNonCompliant:n.Array(n.String())}),TR=n.Union([n.Literal("ingestion-api-key"),n.Literal("operation-api-key"),n.Literal("rum-public-token"),n.Literal("dashboard"),n.Literal("log-route"),n.Literal("monitor"),n.Literal("notification-rule"),n.Literal("notification-silence"),n.Literal("slo")]),dB=n.Object({total:n.Number(),totalNonCompliant:n.Number(),byAssetType:n.Record(TR,ER)}),fB=n.Omit(ER,["total"]),gB=n.Object({totalNonCompliant:n.Number(),byAssetType:n.Record(TR,fB)}),IR=n.Object({totals:dB,byTeam:n.Record(n.String(),gB)}),v2e=d({tags:["tag-policies"],url:`${Gn}/:id/stats`,method:"GET",params:n.Object({id:m()}),response:IR}),D2e=d({tags:["tag-policies"],url:`${Gn}/new-policy-stats`,method:"POST",body:Ua,response:IR});var Na=`/${"v1"}/tag-policies`,xc=n.Pick(Ho,["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)."}),_R=n.Pick(Ua,["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."}),bR=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:Na,method:"GET",response:n.Array(xc)}),AR=d({description:"Retrieves one tag policy by ID when the authenticated operation key can read it. Use this before updating policy scope or enforcement settings.",operationId:"getTagPolicy",tags:["tag-policies"],url:`${Na}/:id`,method:"GET",params:n.Object({id:m({allowEmpty:!1,description:"Identifier of the tag policy to retrieve. Use the `id` returned by tag policy list or create responses."})}),response:xc}),OR=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:Na,method:"POST",body:_R,response:xc}),SR=d({description:"Replaces an existing tag policy by ID, including scope, requiredness, allowed values, owner, active state, and configuration.",operationId:"updateTagPolicy",tags:["tag-policies"],url:`${Na}/:id`,method:"PUT",params:n.Object({id:m({allowEmpty:!1,description:"Identifier of the tag policy to update. Use the `id` returned by tag policy list, get, or create responses."})}),body:_R,response:xc}),xR=d({description:"Deletes a tag policy by ID. Tsuga stops evaluating the policy after deletion.",operationId:"deleteTagPolicy",tags:["tag-policies"],url:`${Na}/:id`,method:"DELETE",params:n.Object({id:m({allowEmpty:!1,description:"Identifier of the tag policy to delete. Use the `id` returned by tag policy list, create, or update responses."})}),response:L});var ka=`/${"v1"}/teams`,wa=n.Pick(wo,["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)."}),yB={id:"abc-123-def",name:"Platform Engineering",description:"Responsible for internal developer tooling and infrastructure",visibility:"public",tags:[{key:"department",value:"engineering"}]};Object.assign(wa,{examples:[yB]});var RR=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:ka,method:"GET",paginated:!0,query:n.Object(te),response:n.Array(wa)}),CR=d({description:"Retrieves one team by ID when the authenticated operation key can read it. Use this to resolve ownership metadata before creating or updating team-owned resources.",operationId:"getTeam",tags:["teams"],url:`${ka}/:id`,method:"GET",params:n.Object({id:m({allowEmpty:!1,description:"Identifier of the team to retrieve. Use the `id` returned by team list or create responses."})}),response:wa}),hl=n.Pick(ec,["name","description","visibility","tags"],{description:"Team create or update request. Provide the team name, optional description, visibility, and tags."}),hB={name:"Platform Engineering",description:"Responsible for internal developer tooling and infrastructure",visibility:"public",tags:[{key:"department",value:"engineering"}]};Object.assign(hl,{examples:[hB]});var PR=d({description:"Creates a team for ownership and access control. Use this before assigning resources to a new owner team.",operationId:"createTeam",tags:["teams"],url:ka,method:"POST",body:hl,response:wa}),UR=d({description:"Replaces a team definition by ID, including name, description, visibility, and tags.",operationId:"updateTeam",tags:["teams"],url:`${ka}/:id`,method:"PUT",params:n.Object({id:m({allowEmpty:!1,description:"Identifier of the team to update. Use the `id` returned by team list, get, or create responses."})}),body:hl,response:wa}),NR=d({description:"Deletes a team by ID. Use only after moving or deleting resources and memberships that depend on the team.",operationId:"deleteTeam",tags:["teams"],url:`${ka}/:id`,method:"DELETE",params:n.Object({id:m({allowEmpty:!1,description:"Identifier of the team to delete. Use the `id` returned by team list, create, or update responses."})}),response:L});function El(e){let t=e.params;if(t?.properties){let r=Object.keys(t.properties);if(r.length===1&&r[0])return r[0]}return"id"}function kR(e,t,r){let o=e.command(t.commandName).description(t.description),i=HO(t.commandName).replace(/-/g," "),a=o.command("list").description(`List all ${t.commandName}`);if(t.listOptions)for(let c of t.listOptions)a.option(c.flag,c.description);if(t.enableListBody?a.option("-d, --data <json>","Inline JSON body").option("--generate-skeleton","Print a JSON skeleton for the request body and exit").action(async c=>{if(c.generateSkeleton){oe(ko(t.endpoints.list));return}let u=await r()(t.endpoints.list,{body:c.data?Oo({data:c.data}):{}});oe(u)}):a.action(async c=>{let u={};if(t.listOptions)for(let f of t.listOptions){let y=c[f.queryParam];y!==void 0&&(u[f.queryParam]=y)}let l=await r()(t.endpoints.list,Object.keys(u).length>0?{query:u}:void 0);oe(l)}),t.endpoints.get){let c=t.endpoints.get,u=El(c);o.command("get <id>").description(`Get a ${i} by ID`).action(async l=>{let f=await r()(c,{params:{[u]:l}});oe(f)})}if(t.endpoints.create){let c=t.endpoints.create;o.command("create").description(`Create a new ${i}`).option("-f, --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 u=>{if(u.generateSkeleton){oe(ko(c));return}let l=Oo(u),f=await r()(c,{body:l});oe(f)})}if(t.endpoints.update){let c=t.endpoints.update,u=El(c);o.command("update <id>").description(`Update a ${i} by ID`).option("-f, --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(l,f)=>{if(f.generateSkeleton){oe(ko(c));return}let y=Oo(f),E=await r()(c,{params:{[u]:l},body:y});oe(E)})}if(t.endpoints.delete){let c=t.endpoints.delete,u=El(c);o.command("delete <id>").description(`Delete a ${i} by ID`).action(async l=>{let f=await r()(c,{params:{[u]:l}});oe(f)})}}var EB=[{commandName:"cloud-resources",description:"List cloud resources discovered by inventory scans",endpoints:{list:fx}},{commandName:"dashboards",description:"Manage dashboards",endpoints:{list:QS,get:WS,create:ZS,update:XS,delete:JS},enableListBody:!0},{commandName:"ingestion-api-keys",description:"Manage ingestion API keys",endpoints:{list:ax,create:sx,update:cx,delete:px}},{commandName:"investigations",description:"Manage investigations (beta)",endpoints:{list:gx,get:yx,create:hx,update:Ex,delete:Tx}},{commandName:"monitors",description:"Manage monitors",endpoints:{list:_x,get:bx,create:Cx,update:Px,delete:Ux},enableListBody:!0},{commandName:"notification-rules",description:"Manage notification rules",endpoints:{list:vx,get:Dx,create:$x,update:Gx,delete:jx}},{commandName:"notification-silences",description:"Manage notification silences",endpoints:{list:Hx,get:Kx,create:Vx,update:Yx,delete:Qx}},{commandName:"quality-reports",description:"Get the latest quality report rows for a cluster (pass --cluster <id> when the org has more than one cluster)",endpoints:{list:eR},listOptions:[{flag:"--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:iR,get:aR,create:sR,update:cR,delete:pR}},{commandName:"routes",description:"Manage routes",endpoints:{list:lR,get:dR,create:fR,update:gR,delete:yR}},{commandName:"services",description:"Manage services",endpoints:{list:AS,get:OS}},{commandName:"tag-policies",description:"Manage tag policies",endpoints:{list:bR,get:AR,create:OR,update:SR,delete:xR}},{commandName:"teams",description:"Manage teams",endpoints:{list:RR,get:CR,create:PR,update:UR,delete:NR}}];function wR(e,t){for(let r of EB)kR(e,r,t)}var LR=require("node:child_process");var Rc="@tsuga/cli@latest";function TB(){Q(`Updating ${Rc}`),Q(` $ npm install -g ${Rc}`);try{(0,LR.execFileSync)("npm",["install","-g",Rc],{stdio:["ignore","inherit","inherit"]})}catch(e){let t=e.status??1;throw new Error(`npm install -g ${Rc} exited ${t}`,{cause:e})}Q("Updated. Run `tsuga --version` to confirm the new version.")}function MR(e){e.command("self-update").description("Update the Tsuga CLI to the latest version via npm").action(()=>{TB()})}var Sl=require("node:fs"),Ol=require("node:os"),zo=require("node:path");function IB(e,t){let r=e.slice(0,t).split(/\r\n|\n|\r/g);return[r.length,r.pop().length+1]}function _B(e,t,r){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 u=o[c-1];u&&(i+=c.toString().padEnd(a," "),i+=": ",i+=u,i+=`
45
- `,c===t&&(i+=" ".repeat(a+r+2),i+=`^
46
- `))}return i}var K=class extends Error{line;column;codeblock;constructor(t,r){let[o,i]=IB(r.toml,r.ptr),a=_B(r.toml,o,i);super(`Invalid TOML document: ${t}
129
+ -----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}"}],V1=BA.map(e=>e.key),wqe=new Set(V1),Nqe=BA.map(e=>e.key);function HA(e){return e.replace(/ies$/,"y").replace(/s$/,"")}var KA=["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"],zA=["alert_queries","alert_thresholds","alert_values"],Y1=[...KA,...zA],VA=["alert_event_name","alert_message"],uFe=[...Y1,...VA],mFe=new Set([...KA,...VA]),lFe=new Set(zA);var j="context";var YA="trace_id",VFe=`${j}.team`,YFe=`${j}.env`,QFe=`${j}.api_key_id`,Nc=`${j}.service.name`,WFe=`${j}.service.version`,ZFe=`${j}.span.kind`,XFe=`${j}.status.code`,QA=["SPAN_KIND_UNSPECIFIED","SPAN_KIND_INTERNAL","SPAN_KIND_SERVER","SPAN_KIND_CLIENT","SPAN_KIND_PRODUCER","SPAN_KIND_CONSUMER"];var Ea=`${j}.host.name`,Q1=`${j}.instance`,W1=`${j}.instanceid`,Z1=`${j}.instance_name`,JFe=`${j}.telemetry.sdk.language`,eBe=`${j}.process.runtime.name`,tBe=`${j}.scope.name`,rBe=`${j}.cloud.provider`,nBe=`${j}.cloud.platform`,oBe=`${j}.aws.ecs.task.arn`,iBe=`${j}.k8s.cluster.name`,aBe=`${j}.k8s.cluster.uid`,sBe=`${j}.k8s.namespace.name`,cBe=`${j}.k8s.pod.name`,pBe=`${j}.k8s.pod.uid`,uBe=`${j}.k8s.container.name`,mBe=`${j}.k8s.node.name`,lBe=`${j}.k8s.node.uid`,dBe=`${j}.k8s.deployment.name`,fBe=`${j}.k8s.deployment.uid`,gBe=`${j}.k8s.replicaset.name`,yBe=`${j}.k8s.replicaset.uid`,hBe=`${j}.k8s.statefulset.name`,TBe=`${j}.k8s.statefulset.uid`,EBe=`${j}.k8s.daemonset.name`,IBe=`${j}.k8s.daemonset.uid`,_Be=`${j}.k8s.job.name`,bBe=`${j}.k8s.job.uid`,SBe=`${j}.k8s.cronjob.name`,OBe=`${j}.k8s.cronjob.uid`;var X1="db.system.name",J1="db.system",ej="db.namespace",tj="db.name";var ABe=`span_attributes.${ej}`,xBe=`span_attributes.${tj}`,RBe=`span_attributes.${X1}`,CBe=`span_attributes.${J1}`;var PBe={name:"tsuga.internal.processing_tag_policy_violations_total",attributes:{tagPolicyId:`${j}.tag_policy_id`,dataSource:`${j}.data_source`}};var UBe={name:"tsuga.internal.event_size_bytes",attributes:{batchKind:`${j}.batch_kind`,batchKindMetricsFilter:`${j}.batch_kind:metrics`,sourceApiKeyId:`${j}.source_api_key_id`,sourceEnv:`${j}.source_env`,sourceTeam:`${j}.source_team`}};var WA="__tsuga_metadata__",wBe=`${WA}.signature`,NBe=`${WA}.routes`;var rj="^\\S(.*\\S)?$",ZA=128,XA=256,nj=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"}),oj=r.Object({key:r.String({maxLength:ZA,description:`Tag key to attach to the resource. Maximum length is ${ZA} characters.`}),value:r.String({maxLength:XA,pattern:rj,description:`Tag value to attach to the resource. Maximum length is ${XA} characters and leading or trailing whitespace is rejected.`})},{title:"Tag"}),Bt=r.Array(nj,{title:"Tags",description:"Key/value tags applied to the resource. Use them to organize resources and to satisfy tag policies."}),Ht=r.Array(oj,{title:"Tags",maxItems:50,description:"Key/value tags to apply to the resource. Up to 50 tags are accepted and tag policies may require specific keys or values."}),ke=r.Optional(Bt),Ve=r.Optional(Ht);var on="/v0/teams",kc=["public","private"],Lc={NAME:"name",CREATED_AT:"createdAt",MEMBER_COUNT:"memberCount",VISIBILITY:"visibility"},ij=r.Enum([Lc.NAME,Lc.CREATED_AT,Lc.MEMBER_COUNT,Lc.VISIBILITY],{description:"Team field used for sorting list responses. Use `name`, `createdAt`, `memberCount`, or `visibility`."}),tx=r.Object({color:r.Enum(_l,{description:"Color token used by Tsuga when rendering the team avatar."}),mode:r.Enum(bl,{description:"Avatar rendering mode selected for the team."}),iconName:r.Enum(FA,{description:"Icon name rendered inside the team avatar when icon mode is used."})}),Sl=r.Object({color:r.Enum(_l),mode:r.Enum(bl)}),JA=100,ex=250,Fo=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 team description supplied by a user."})),visibility:r.Enum(kc,{description:"`public` makes team-owned resources discoverable according to access controls. `private` restricts discovery to team members and authorized users."}),tags:ke,createdAt:E({description:"Timestamp when Tsuga created the team."}),updatedAt:E({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(tx)}),vc=r.Object({name:r.String({minLength:1,maxLength:JA,format:Ro,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 ${JA} characters.`}),description:r.Optional(r.String({maxLength:ex,description:`Optional team description. Maximum length is ${ex} characters.`})),visibility:r.Enum(kc,{description:"`public` makes team-owned resources discoverable according to access controls. `private` restricts discovery to team members and authorized users."}),tags:Ve,avatar:r.Optional(tx)}),aj=r.Object({id:r.String(),name:r.String(),email:r.String(),role:r.Enum(wo),joinedTeamAt:E(),orgRole:r.Enum(fc),avatar:r.Optional(Sl)}),HBe=d({tags:["teams"],url:on,method:"GET",paginated:!0,response:r.Array(Fo),query:r.Object({...Q,includeMemberCount:r.Optional(r.Boolean()),searchQuery:r.Optional(u({description:"Substring matched against team names and descriptions."})),visibility:r.Optional(r.Enum(kc,{description:"Restrict results to teams with this visibility."})),myTeamsOnly:r.Optional(r.Boolean({description:"If true, return only teams that include the authenticated user."})),sortBy:r.Optional(ij),sortDirection:r.Optional(r.Enum(["asc","desc"],{description:"Sort direction: ascending or descending."}))})}),KBe=d({tags:["teams"],url:`${on}/:id`,method:"GET",params:r.Object({id:u()}),response:Fo}),zBe=d({tags:["teams"],url:`${on}/:id/members`,method:"GET",params:r.Object({id:u()}),response:r.Array(aj)}),VBe=d({tags:["teams"],url:`${on}/: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()})}),YBe=d({tags:["teams"],url:on,method:"POST",body:vc,response:Fo}),QBe=d({tags:["teams"],url:`${on}/:id`,method:"PUT",params:r.Object({id:u()}),body:vc,response:Fo}),WBe=d({tags:["teams"],url:`${on}/bulk-update`,method:"POST",body:r.Object({teamIds:r.Array(u(),{maxItems:100}),config:r.Object({visibility:r.Enum(kc)})}),response:r.Object({})}),ZBe=d({tags:["teams"],url:`${on}/:id`,method:"DELETE",params:r.Object({id:u()}),response:C});var sj=r.Enum(["terraform-provider","web-frontend","mcp-server","cli"],{description:"Tsuga client surface that performed the operation. Use this to distinguish UI, CLI, MCP, and Terraform-originated changes."}),ue=b("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(Sl)}),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(sj)})],{description:"User or operation API key responsible for creating or updating a resource. Returned by Tsuga for audit context."});var xt="/v0/monitors",Bo=["alert","resolve","keep_last_status","consider_zero"],Mc=["alert","resolve","keep_last_status"];var nx=["no_aggregation","all","any","each","proportion"],ox=["greater_than","less_than","equal","not_equal","greater_than_or_equal","less_than_or_equal"];var cj=r.Object({formula:r.String({description:"Formula result to compare against the threshold, usually `q1` or a formula alias."}),operator:r.Enum(ox,{description:"Comparison operator used to evaluate the threshold condition."}),threshold:r.Number({description:"Numeric threshold value used by the comparison."})}),pj=r.Object({formula:u({type:"tsuga-formula",description:"Formula result to compare against the threshold, usually `q1` or a formula alias."}),operator:r.Enum(ox,{description:"Comparison operator used to evaluate the threshold condition."}),threshold:r.Number({description:"Numeric threshold value used by the comparison."})}),uj=5,Ol=r.Array(cj,{description:"Threshold conditions evaluated against query and formula results. All listed conditions must match for a non-grouped threshold monitor to alert."}),Al=r.Array(pj,{minItems:1,maxItems:uj,description:"Threshold conditions evaluated against query and formula results. Provide at least one condition and no more than five conditions."}),ix=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."})}),ax=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."})}),mt=[1,2,3,4,5];var Ia={timeframe:r.Number({description:"Lookback window, in minutes, that each monitor evaluation aggregates over."}),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. Warning! This setting is currently ignored. Monitor evaluation will instead apply 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. Warning! Note that the limit setting is currently ignored."}),aggregationAlertLogic:r.Optional(r.Enum(nx,{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`."}))},_a={timeframe:r.Number({description:"Lookback window, in minutes, that each 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. Warning! This setting is currently ignored. Monitor evaluation will instead apply 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. Warning! Note that the limit setting is currently ignored."}),aggregationAlertLogic:r.Optional(r.Enum(nx,{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`. Valid values are 1 through 99."}))},sx=r.Object({type:r.Literal("metric",{description:"Threshold monitor over metric aggregations."}),conditions:Ol,noDataBehavior:r.Enum(Bo,{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."}),...Ia,queries:Xr},{$id:"MonitorConfigurationMetric"}),cx=r.Object({type:r.Literal("metric",{description:"Threshold monitor over metric aggregations."}),conditions:Al,noDataBehavior:r.Enum(Bo,{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."}),..._a,queries:Jr},{$id:"InputMonitorConfigurationMetric"}),px=r.Object({type:r.Literal("log",{description:"Threshold monitor over log aggregations."}),conditions:Ol,noDataBehavior:r.Enum(Bo,{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."}),...Ia,queries:Xr},{$id:"MonitorConfigurationLog"}),ux=r.Object({type:r.Literal("log",{description:"Threshold monitor over log aggregations."}),conditions:Al,noDataBehavior:r.Enum(Bo,{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."}),..._a,queries:Jr},{$id:"InputMonitorConfigurationLog"}),mx=r.Object({type:r.Literal("trace",{description:"Threshold monitor over trace aggregations."}),conditions:Ol,noDataBehavior:r.Enum(Bo,{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."}),...Ia,queries:Xr},{$id:"MonitorConfigurationTrace"}),mj=r.Object({type:r.Literal("trace",{description:"Threshold monitor over trace aggregations."}),conditions:Al,noDataBehavior:r.Enum(Bo,{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."}),..._a,queries:Jr},{$id:"InputMonitorConfigurationTrace"}),lx=r.Object({type:r.Literal("anomaly-log",{description:"Anomaly monitor over log aggregations."}),condition:ix,noDataBehavior:r.Enum(Mc,{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."}),...Ia,queries:Xr},{$id:"MonitorConfigurationAnomalyLog"}),dx=r.Object({type:r.Literal("anomaly-log",{description:"Anomaly monitor over log aggregations."}),condition:ax,noDataBehavior:r.Enum(Mc,{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."}),..._a,queries:Jr},{$id:"InputMonitorConfigurationAnomalyLog"}),fx=r.Object({type:r.Literal("anomaly-metric",{description:"Anomaly monitor over metric aggregations."}),condition:ix,noDataBehavior:r.Enum(Mc,{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."}),...Ia,queries:Xr},{$id:"MonitorConfigurationAnomalyMetric"}),gx=r.Object({type:r.Literal("anomaly-metric",{description:"Anomaly monitor over metric aggregations."}),condition:ax,noDataBehavior:r.Enum(Mc,{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."}),..._a,queries:Jr},{$id:"InputMonitorConfigurationAnomalyMetric"}),yx=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"}),lj=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"}),dj=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"}),fj=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"}),gj=b("type",[sx,px,mx,lx,fx,dj,yx],{description:"Monitor evaluation configuration. The `type` discriminator determines which telemetry source, condition shape, and evaluation rules Tsuga uses."}),yj=b("type",[cx,ux,mj,dx,gx,fj,lj],{description:"Monitor evaluation configuration. The `type` discriminator determines which telemetry source, condition shape, and evaluation rules Tsuga uses."});var Sr=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:ke,configuration:gj,priority:r.Enum(mt,{description:"Monitor priority from 1 through 5, where 1 is highest priority."}),permissions:Zr,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(E({description:"Timestamp until which the monitor is snoozed."})),creator:r.Optional(ue),updater:r.Optional(ue),createdAt:E({description:"Timestamp when Tsuga created the monitor."}),updatedAt:E({description:"Timestamp when Tsuga last updated the monitor."}),assetUpdatedAt:E({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"}),hj=b("type",[sx,px,mx,lx,fx,yx]),hHe=r.Object({...Sr.properties,configuration:hj},{title:"Monitor"}),THe=r.Object({...Sr.properties,configuration:b("type",[cx,ux,dx,gx])},{title:"Monitor"}),ba=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:Ve,configuration:yj,priority:r.Enum(mt,{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(u({description:"ID of the dashboard to link to this monitor for context when investigating alerts. Omit to leave the monitor unlinked on create, or to clear an existing link on update."})),pauseUntil:r.Optional(u({allowEmpty:!1,type:"date-time",description:"ISO timestamp until which the monitor should be snoozed."})),permissions:Zr,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."}))}),rx=["threshold","certificate-expiry","anomaly-detection","log-error-pattern"],an={PRIORITY:"priority",TYPE:"type",NAME:"name",OWNER:"owner",TAGS:"tags",CLUSTER_IDS:"clusterIds",PAUSE_UNTIL:"pauseUntil",ASSET_UPDATED_AT:"assetUpdatedAt"};var hx=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(Ht.items,{description:"Restrict results to monitors that have at least one of the listed key/value tags",maxItems:50}),priorities:$e(r.Enum(mt),{description:"Restrict results to monitors with one of these priorities",maxItems:mt.length}),types:$e(r.Enum(rx),{description:"Restrict results to monitors with these types",maxItems:rx.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"}),xl=r.Partial(r.Object({...Q,filters:r.Partial(hx),sort:r.Object({by:r.Enum([an.PRIORITY,an.TYPE,an.NAME,an.OWNER,an.TAGS,an.CLUSTER_IDS,an.PAUSE_UNTIL,an.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."})})),EHe=d({tags:["monitors"],url:`${xt}/query`,method:"POST",paginated:!0,response:r.Array(Sr),body:xl}),IHe=d({tags:["monitors"],url:`${xt}/tags/query`,method:"POST",body:r.Object({filters:r.Optional(r.Partial(r.Omit(hx,["tags"])))}),response:Bt}),_He=d({tags:["monitors"],url:`${xt}/:id`,method:"GET",params:r.Object({id:u()}),response:Sr}),bHe=d({tags:["monitors"],url:xt,method:"POST",body:ba,response:Sr}),SHe=d({tags:["monitors"],url:`${xt}/:id`,method:"PUT",params:r.Object({id:u()}),body:ba,response:Sr}),OHe=d({tags:["monitors"],url:`${xt}/:id`,method:"DELETE",params:r.Object({id:u()}),response:C}),AHe=d({tags:["monitors"],url:`${xt}/bulk-delete`,method:"DELETE",body:r.Object({ids:r.Array(u())}),response:r.Object({})}),xHe=d({tags:["monitors"],url:`${xt}/bulk-update`,method:"PUT",body:r.Object({monitorIds:r.Array(u()),owner:u({allowEmpty:!1})}),response:r.Object({})}),RHe=d({tags:["monitors"],url:`${xt}/:id/snooze`,method:"POST",params:r.Object({id:u()}),body:r.Object({pauseUntil:u({allowEmpty:!1,type:"date-time"})}),response:Sr}),Tj=["alert","ok","alert_consider_zero","ok_consider_zero","alert_no_data","ok_no_data","keep_last_status_ok","keep_last_status_alert"],Bn=r.Enum(Tj),Ej=b("type",[r.Object({type:r.Literal("each"),subStates:r.Record(r.String(),r.Object({stateValue:r.Union([Bn,r.Null()]),lastChangedAt:E()}))}),r.Object({type:r.Literal("no_aggregation"),stateValue:r.Optional(Bn)}),r.Object({type:r.Literal("any"),stateValue:r.Optional(Bn)}),r.Object({type:r.Literal("all"),stateValue:r.Optional(Bn)}),r.Object({type:r.Literal("proportion"),stateValue:r.Optional(Bn)})]),Ij=r.Object({monitorId:r.String(),currentState:Ej,lastChangedAt:r.Optional(E())}),CHe=d({tags:["monitors"],url:`${xt}/states/:id`,method:"GET",params:r.Object({id:u()}),response:Ij}),PHe=d({tags:["monitors"],url:`${xt}/: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:E(),fromState:r.Optional(Bn),toState:r.Optional(Bn),dimension:r.Optional(r.String())}))}),_j=["unprocessed","processed","failed-to-process"],UHe=d({tags:["monitors"],url:`${xt}/: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:E(),formulaResult:r.Object({groups:r.Array(r.Object({groupKey:r.Record(r.String(),na),results:r.Array(r.Union([r.Number(),r.Null()])),conditionMet:r.Enum(["true","false","nan-no-data"])}))}),createdAt:E(),status:r.Enum(_j)}))})});var Or="/v0/slos",bj=[7,30,90],Sj=["good","bad"],_x=r.Enum(Sj,{description:"How to treat SLO with no data: good (count as meeting the SLO), bad (count as breaching it)"}),Oj=["good","bad","ignore"],bx=r.Enum(Oj,{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)"}),Tx=30,Ex=1440,Sx=["greater_than","less_than","greater_than_or_equal","less_than_or_equal"],Aj=["healthy","breached","no_data"],Dc=r.Enum(Aj,{description:"SLO status: healthy (meeting the target), breached (breaching it), or no_data (not evaluated yet)"}),Ix={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:Dc},xj=r.Object({overall:r.Object(Ix,{description:"Latest overall evaluation for the cluster"}),perGroup:r.Array(r.Object({groupKey:r.Record(r.String(),na,{description:"Group-by field values identifying this group, keyed by field name. Present only when the SLO configuration sets `groupByFields`."}),...Ix}),{description:"Latest evaluation for each group produced by the SLO configuration's `groupByFields`. Empty when the SLO is not grouped."})},{title:"SloClusterResults"}),Ox=r.Record(r.String(),xj,{description:"Latest evaluation results keyed by cluster ID."}),Rl=r.Object({queries:Xr,formula:_c},{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."}),Cl=r.Object({queries:Jr,formula:wn},{title:"SloQueryFormula",description:"Aggregation queries combined by a formula to produce the SLO signal. Set by the caller on create or update; formulas reference queries as q1, q2, and so on."}),Rj=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"}),Cj=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 Pj=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"}),Uj=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"}),wj=b("type",[Rj,Pj],{description:"Alert trigger configuration: burn-rate or threshold"}),Ax=b("type",[Cj,Uj],{description:"Alert trigger configuration: burn-rate or threshold"}),Pl=r.Enum(mt,{description:"Alert priority (1 is highest, 5 is lowest)"}),Ul=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:Pl,configuration:wj,createdAt:E({description:"Timestamp when Tsuga created the alert."}),updatedAt:E({description:"Timestamp when Tsuga last updated the alert."}),assetUpdatedAt:E({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})},{title:"SloAlert"}),Nj=r.Object({priority:Pl,configuration:Ax}),Lj=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:Pl,configuration:Ax}),kj=b("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:vt,goodQuery:Rl,totalQuery:Rl,groupByFields:r.Optional(No),noDataBehavior:_x},{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:vt,query:Rl,sliceSizeMinutes:r.Integer({description:"Length of each time-SLO evaluation slice in minutes. Required for `type: time`."}),threshold:r.Object({operator:r.Enum(Sx,{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(No),noDataBehavior:bx},{title:"TimeSliceSloConfiguration"})],{description:"SLI configuration for this SLO. Set by the caller on create or update and returned on read and list responses. Use `event` for good/total event-ratio SLOs or `time` for thresholded time-slice SLOs."}),vj=b("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:vt,goodQuery:Cl,totalQuery:Cl,groupByFields:r.Optional(yr),noDataBehavior:_x},{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:vt,query:Cl,sliceSizeMinutes:r.Integer({minimum:Tx,maximum:Ex,description:`Length of each time-SLO evaluation slice in minutes. Required for \`type: time\`. Valid input is ${Tx} through ${Ex}.`}),threshold:r.Object({operator:r.Enum(Sx,{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(yr),noDataBehavior:bx},{title:"TimeSliceSloConfiguration"})],{description:"SLI configuration for this SLO. Set by the caller on create or update. Use `event` for good/total event-ratio SLOs or `time` for thresholded time-slice SLOs."}),Mj=r.Number({exclusiveMinimum:0,exclusiveMaximum:100,description:"Target percentage (0 < target < 100, e.g. 99.9)"}),xx=r.Enum(bj,{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."}),Dj=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."}),Gj=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."}),Ho=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:ke,configuration:kj,target:r.Number({description:"Target percentage (0 < target < 100, e.g. 99.9)"}),timeframeDays:xx,owner:r.String({description:"Team ID that owns the SLO"}),permissions:Zr,clusterIds:Dj,creator:r.Optional(ue),updater:r.Optional(ue),alerts:r.Array(Ul,{description:"Alerts attached to this SLO"}),createdAt:E({description:"Timestamp when Tsuga created the SLO."}),updatedAt:E({description:"Timestamp when Tsuga last updated the SLO."}),assetUpdatedAt:E({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})},{title:"Slo"}),$j=r.Object({...Ho.properties,results:Ox},{title:"SloWithResults"}),Gc=r.Object({name:u({allowEmpty:!1,description:"Display name of the SLO, set by the caller"}),description:r.Optional(u({type:"long",description:"Free-form, caller-provided description of what the SLO measures. Optional."})),tags:Ve,configuration:vj,target:Mj,timeframeDays:xx,owner:u({allowEmpty:!1,description:"Team ID that owns the SLO"}),permissions:Zr,clusterIds:r.Optional(Gj),alerts:r.Array(Nj,{description:"Alerts to create on this SLO. Send an empty array for none."})}),wl=r.Object({...r.Omit(Gc,["alerts"]).properties,alerts:r.Array(Lj,{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."})}),Rx=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. Set by the caller in SLO query requests."}),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. Set by the caller in SLO query requests. Optional; `exclude: true` removes matching SLOs."}),tags:$e(Ht.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(Dc,{description:"Restrict results to SLOs whose status is one of these values",maxItems:3})},{description:"Optional filters applied to narrow the returned SLOs"}),Nl=r.Partial(r.Object({...Q,filters:r.Partial(Rx),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"})})),FHe=d({tags:["slos"],url:`${Or}/query`,method:"POST",paginated:!0,response:r.Array($j),body:Nl}),BHe=d({tags:["slos"],url:`${Or}/tags/query`,method:"POST",body:r.Object({filters:r.Optional(r.Partial(r.Omit(Rx,["tags","statuses"])))}),response:Bt}),HHe=d({tags:["slos"],url:`${Or}/:id`,method:"GET",params:r.Object({id:u()}),response:Ho}),KHe=d({tags:["slos"],url:`${Or}/:id/results`,method:"GET",params:r.Object({id:u()}),response:Ox}),zHe=d({tags:["slos"],url:Or,method:"POST",body:Gc,response:Ho}),VHe=d({tags:["slos"],url:`${Or}/:id`,method:"PUT",params:r.Object({id:u()}),body:wl,response:Ho}),YHe=d({tags:["slos"],url:`${Or}/:id`,method:"DELETE",params:r.Object({id:u()}),response:C}),QHe=d({tags:["slos"],url:`${Or}/bulk-delete`,method:"DELETE",body:r.Object({ids:r.Array(u())}),response:r.Object({})}),WHe=d({tags:["slos"],url:`${Or}/bulk-update`,method:"PUT",body:r.Object({sloIds:r.Array(u()),owner:u({allowEmpty:!1})}),response:r.Object({})});var Ko="/v0/notifications",Kn=`${Ko}/rules`,Cx=`${Ko}/slack/setup`,Sa=`${Ko}/integrations`,Hn=["triggered","resolved","no-data"],jj=["sent","stale","pending","rate-limited","failed","silenced"],qj=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."})),Fj=r.Optional(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."})),Bj=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."})),Hj=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."})),$c=r.Object({id:r.String({description:"Identifier of the notification target within this rule. Set by the rule author and used with the rule ID for per-target delivery state such as rate limiting."}),rateLimit:qj,renotifyConfig:Bj,config:b("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"})},{$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"})},{$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"})},{$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"})},{$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"})},{$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"})},{$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"})},{$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"})},{$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"})},{$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"})},{$id:"RuleTargetConfigSquadcast"}),r.Object({type:r.Literal("jira",{description:"Jira target backed by a configured Jira integration."}),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".'})},{$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`."})}),jc=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:Fj,config:b("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"})},{$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"})},{$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"})},{$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"})},{$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"})},{$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"})},{$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"})},{$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"})},{$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"})},{$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"})},{$id:"RuleTargetInputSquadcast"}),r.Object({type:r.Literal("jira",{description:"Jira target backed by a configured Jira integration."}),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".'})},{$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)."}),renotifyConfig:Hj}),Ll=b("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."}),kl=b("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."}),zo=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:"Query string that narrows down which alerts trigger the rule"})),teamsFilter:Ll,prioritiesFilter:r.Array(r.Enum(mt),{description:"Monitor priorities that must match for this rule to fire. An empty array matches every priority."}),transitionTypesFilter:r.Array(r.Enum(Hn),{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:E({description:"Timestamp when Tsuga created the rule."}),updatedAt:E({description:"Timestamp when Tsuga last updated the rule."}),isActive:r.Boolean({description:"Whether the rule currently sends notifications when its filters match."}),tags:ke,targets:r.Array($c,{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(ue),updater:r.Optional(ue)}),Oa=r.Object({name:u({description:"Display name of the notification rule."}),queryString:r.Optional(u({type:"tags-query",description:"Query string that narrows down which alerts trigger the rule"})),teamsFilter:kl,prioritiesFilter:r.Array(r.Enum(mt),{maxItems:mt.length,description:"Monitor priorities that must match for this rule to fire. An empty array matches every priority."}),transitionTypesFilter:r.Array(r.Enum(Hn),{maxItems:Hn.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:Ve,isActive:r.Boolean({description:"Set to true for the rule to send notifications when its filters match."}),targets:r.Array(jc,{minItems:1,description:"Destinations that receive a notification whenever this rule matches an alert transition. At least one target is required. This list replaces the existing targets on update."})}),qc=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:E({description:"Timestamp when Tsuga created the rule."}),updatedAt:E({description:"Timestamp when Tsuga last updated the rule."}),isActive:r.Boolean({description:"Whether the rule currently sends notifications when one of its monitors fires."}),tags:ke,monitorIds:r.Array(r.String(),{description:"Monitors this rule reacts to."}),fallbackTarget:$c,creator:r.Optional(ue),updater:r.Optional(ue)}),Px=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:Ve,isActive:r.Boolean({description:"Set to true for the rule to send notifications when one of its monitors fires."}),monitorIds:r.Array(u({allowEmpty:!1}),{minItems:1,maxItems:100,description:"Monitors this rule reacts to. Only trace monitors and metric monitors over OTel span metrics are eligible."}),fallbackTarget:jc}),i2e=d({tags:["notification-rules"],url:Kn,method:"GET",paginated:!0,query:r.Object(Q),response:r.Array(zo)}),a2e=d({tags:["notification-rules"],url:`${Kn}/:id`,params:r.Object({id:u()}),method:"GET",response:zo}),s2e=d({tags:["notification-rules"],url:Kn,method:"POST",body:Oa,response:zo}),c2e=d({tags:["notification-rules"],url:`${Kn}/:id`,method:"PUT",params:r.Object({id:u()}),body:Oa,response:zo}),p2e=d({tags:["notification-rules"],url:`${Kn}/:id`,method:"DELETE",params:r.Object({id:u()}),response:C}),Aa=`${Ko}/adaptive-rules`,u2e=d({tags:["notification-rules"],url:Aa,method:"GET",paginated:!0,query:r.Object(Q),response:r.Array(qc)}),m2e=d({tags:["notification-rules"],url:`${Aa}/:id`,params:r.Object({id:u()}),method:"GET",response:qc}),l2e=d({tags:["notification-rules"],url:Aa,method:"POST",body:Px,response:qc}),d2e=d({tags:["notification-rules"],url:`${Aa}/:id`,method:"PUT",params:r.Object({id:u()}),body:Px,response:qc}),f2e=d({tags:["notification-rules"],url:`${Aa}/:id`,method:"DELETE",params:r.Object({id:u()}),response:C}),g2e=d({tags:["notification-integrations"],url:`${Cx}/start`,method:"POST",response:r.Object({redirectUrl:r.String()})}),Kj=["google-chat","grafana-irm","incident-io","jira","microsoft-teams","pagerduty","servicenow","slack","squadcast","webhook"],zj=r.Object({id:r.String(),name:r.String(),type:r.Enum(Kj),createdAt:E(),ruleCount:r.Number(),creator:r.Optional(ue)}),y2e=d({tags:["notification-integrations"],url:`${Kn}/integrations`,method:"GET",paginated:!0,query:r.Object(Q),response:r.Array(zj)}),h2e=d({tags:["notification-integrations"],url:`${Cx}/callback`,method:"GET",query:r.Object({code:u()}),response:r.Object({success:r.Boolean()})}),vl=["POST","PUT"],Vj=r.Record(r.String(),r.String()),Yj=r.Record(r.String(),r.Unknown()),Qj=r.Record(r.String(),r.Union([r.String(),r.Number(),r.Boolean(),r.Null(),r.Array(r.Union([r.String(),r.Number(),r.Boolean()]))])),Wj=b("type",[r.Object({type:r.Literal("json"),value:Yj}),r.Object({type:r.Literal("form"),value:Qj})]),Zj=r.Object({ok:r.String(),alert:r.String()}),Ml=r.Object({id:r.String(),name:r.String(),setting:b("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(vl),authentication:b("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(Vj),payloadTemplate:Wj,eventNameMapping:r.Optional(Zj)}),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:ke}),Xj=r.Object({type:r.Literal("webhook"),url:u({type:"uri"}),method:r.Enum(vl),authentication:b("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:b("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})}))}),Ux=r.Object({type:r.Literal("incident-io"),alertSourceConfigId:u(),token:u()}),wx=r.Object({type:r.Literal("grafana-irm"),url:u({type:"uri"})}),Nx=r.Object({type:r.Literal("pagerduty"),integrationKey:u()}),Lx=r.Object({type:r.Literal("microsoft-teams"),webhookUrl:u({type:"uri"})}),Jj=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})}),eq=r.Object({type:r.Literal("google-chat"),webhookUrl:u({type:"uri"})}),tq=r.Object({type:r.Literal("squadcast"),webhookUrl:u({type:"uri"})}),rq=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."})}),nq=r.Object({name:u(),setting:b("type",[Ux,wx,Nx,Lx,Xj,Jj,eq,tq,rq]),tags:Ve}),oq=r.Object({type:r.Literal("webhook"),url:r.Optional(u({type:"uri"})),method:r.Optional(r.Enum(vl)),authentication:r.Optional(b("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(b("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}))}))}),iq=r.Object({type:r.Literal("servicenow"),instanceName:r.Optional(u({allowEmpty:!1})),username:r.Optional(u({allowEmpty:!1})),password:r.Optional(u({allowEmpty:!1}))}),aq=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}))}),sq=r.Object({type:r.Literal("google-chat"),webhookUrl:u({type:"uri"})}),cq=r.Object({type:r.Literal("squadcast"),webhookUrl:u({type:"uri"})}),pq=r.Object({name:r.Optional(u()),setting:r.Optional(b("type",[Ux,wx,Nx,Lx,oq,iq,sq,cq,aq]))}),T2e=d({tags:["notification-integrations"],url:Sa,method:"POST",body:nq,response:Ml}),E2e=d({tags:["notification-integrations"],url:`${Sa}/:id`,method:"GET",params:r.Object({id:u()}),response:Ml}),I2e=d({tags:["notification-integrations"],url:`${Sa}/:id`,method:"PUT",params:r.Object({id:u()}),body:pq,response:Ml}),_2e=d({tags:["notification-integrations"],url:`${Sa}/:id`,method:"DELETE",params:r.Object({id:u()}),response:C}),uq=b("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.Array(r.String(),{description:"Status names an issue in this project can be transitioned to."})}),{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."}),b2e=d({tags:["notification-integrations"],url:`${Sa}/:id/jira-metadata`,method:"GET",params:r.Object({id:u()}),response:uq}),S2e=d({tags:["notification-rules"],url:`${xt}/: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(jj),tryCount:r.Number(),nextTryAt:E(),createdAt:E(),updatedAt:E(),sentAt:r.Optional(E())})),isTruncated:r.Boolean()})}),mq=["slack","incident-io","pagerduty","email","grafana-irm","microsoft-teams","webhook","servicenow","google-chat","squadcast","jira"],O2e=d({tags:["notification-rules"],url:`${Kn}/test`,method:"POST",body:r.Object({notificationRule:Oa,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(mq,{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 Kt="/v0/service-catalog";var vx=r.Object({team:r.String({description:"Team name observed on telemetry for this service."}),lastSeenAt:E({description:"Most recent time this team was observed for the service."})}),lq=r.Object({ingestionApiKey:r.String({description:"Ingestion API key name or identifier observed on telemetry for this service."}),lastSeenAt:E({description:"Most recent time this ingestion key was observed for the service."})}),Mx=r.Object({version:r.String({description:"Service version value observed in telemetry."}),firstSeenAt:E({description:"First time this version was observed for the service."}),lastSeenAt:E({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."}))}),dq=r.Object({language:r.String({description:"Programming language observed for this service."}),lastSeenAt:E({description:"Most recent time this language was observed."})}),fq=r.Object({runtime:r.String({description:"Runtime observed for this service."}),lastSeenAt:E({description:"Most recent time this runtime was observed."})}),kx=r.Object({protocol:r.String({description:"Observed API protocol (e.g. 'http', 'grpc', 'graphql')"}),lastSeenAt:E({description:"Most recent observation timestamp"})}),gq=r.Object({framework:r.String({description:"Observed application framework (e.g. 'express', 'fastify', 'django', 'rails')"}),lastSeenAt:E({description:"Most recent observation timestamp"})}),yq=r.Object({platform:r.String({description:"Observed cloud or orchestration platform (e.g. 'aws_eks', 'kubernetes')"}),lastSeenAt:E({description:"Most recent observation timestamp"})}),hq=r.Object({provider:r.String({description:"Observed cloud provider (e.g. 'aws', 'gcp', 'azure')"}),lastSeenAt:E({description:"Most recent observation timestamp"})}),Vo=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(vx,{description:"Team names observed on telemetry for this service and when each was last seen."}),ingestionApiKeys:r.Array(lq,{description:"Ingestion API keys observed on telemetry for this service and when each was last seen."}),versions:r.Array(Mx,{description:"Service version values observed in telemetry, including first and last seen timestamps."}),languages:r.Array(dq,{description:"Programming languages observed for this service."}),runtimes:r.Array(fq,{description:"Runtime values observed for this service."}),serverProtocols:r.Array(kx,{description:"API protocols this service exposes (from server-kind spans)"}),clientProtocols:r.Array(kx,{description:"API protocols this service calls out over (from client-kind spans)"}),frameworks:r.Array(gq,{description:"Application frameworks detected from OTel instrumentation scope"}),cloudPlatforms:r.Array(yq,{description:"Cloud platforms this service is running on"}),cloudProviders:r.Array(hq,{description:"Cloud providers this service is running on"}),lastSeenAt:E({description:"Most recent time Tsuga observed telemetry for this service."}),firstSeenAt:E({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."}),targets:r.Optional(r.Array($c,{description:"User-set notification targets that adaptive rules page when this service is the failing one."})),createdAt:E({description:"Timestamp when Tsuga created this service catalog entry."}),updatedAt:E({description:"Timestamp when Tsuga last updated this service catalog entry."})}),k2e=d({tags:["service-catalog"],query:r.Object({...Q,clusterId:r.Optional(u())}),method:"GET",paginated:!0,url:`${Kt}/services`,response:r.Array(Vo)}),Tq=r.Object({spanKind:r.Enum(QA),count:r.Number()}),Dx=r.Object({...Vo.properties,spanKindCounts:r.Array(Tq),envs:r.Object({primaryEnv:r.String(),allEnvs:r.Array(r.String())})}),v2e=d({tags:["service-catalog"],query:r.Object({...Q,clusterId:r.Optional(u()),env:r.Optional(u())}),method:"GET",paginated:!0,url:`${Kt}/v2/services`,response:r.Array(Dx)}),M2e=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:`${Kt}/v2/service`,response:Dx}),D2e=d({tags:["service-catalog"],method:"GET",url:`${Kt}/services/:serviceId`,params:r.Object({serviceId:u()}),response:Vo}),G2e=d({tags:["service-catalog"],method:"PATCH",url:`${Kt}/services/:serviceId`,params:r.Object({serviceId:u()}),body:r.Object({targets:r.Optional(r.Union([r.Array(jc,{description:"Replacement set of notification targets that adaptive rules page when this service is the failing one. Replaces all existing targets.",maxItems:3}),r.Null()]))}),response:Vo}),Eq=r.Object({id:r.String(),endpointName:r.String(),serviceName:r.String(),serviceNamespace:r.Optional(r.String()),env:r.Optional(r.String()),teams:r.Array(vx),versions:r.Array(Mx),lastSeenAt:E(),firstSeenAt:E(),sources:r.Array(r.String()),additionalUserFields:r.Optional(r.Unsafe({type:"object",additionalProperties:!0})),createdAt:E(),updatedAt:E()}),$2e=d({tags:["service-catalog"],method:"GET",url:`${Kt}/endpoints`,response:r.Array(Eq)}),Iq=["otel_kube","otel_host_kube","otel_host","prometheus","aws_ec2","gcp_compute_engine"];var Gx=r.Object({id:r.String(),hostName:r.String(),env:r.Optional(r.String()),cpuUtilizationAverage:r.Number(),hostType:r.Enum(Iq),teams:r.Array(r.String()),tags:r.Array(r.String()),firstSeenAt:E(),lastSeenAt:E(),clusterId:r.String()}),j2e=d({tags:["service-catalog"],method:"GET",url:`${Kt}/hosts`,response:r.Array(Gx)}),q2e=d({tags:["service-catalog"],method:"GET",url:`${Kt}/hosts/:hostId`,params:r.Object({hostId:u()}),response:Gx}),_q=["http","db","rpc","messaging","genai","object_store"],$x={name:r.String({description:"Service or inferred dependency name shown in the graph."}),env:r.Optional(r.String({description:"Environment observed from spans."}))},Dl=r.Object({...$x,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."})}),Gl=r.Object({...$x,nodeType:r.Literal("inferred",{description:"Discriminator for this node variant. Always `inferred` for a dependency detected from client-span attributes (e.g. a database, queue, or external HTTP call) that could not be matched to a service catalog entry."}),serviceType:r.Enum(_q,{description:"Inferred dependency type from span metadata, such as http, db, rpc, messaging, genai, or object_store."}),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"}))}),bq=b("nodeType",[Dl,Gl]),$l=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"})},{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."}),F2e=d({tags:["service-catalog"],url:`${Kt}/services/:serviceId/graph`,method:"GET",params:r.Object({serviceId:u()}),query:r.Object({...et.properties,query:r.Optional(u({type:"tsuga-query"}))}),response:r.Object({clusterId:r.String(),nodes:r.Array(bq),edges:r.Array($l)})}),Sq=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(mt,{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(Dc,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"})}))}),B2e=d({tags:["service-catalog"],method:"GET",url:`${Kt}/services/:serviceId/related-resources`,params:r.Object({serviceId:u()}),response:Sq}),H2e=d({tags:["service-catalog"],method:"GET",url:`${Kt}/services/by-api-keys`,response:r.Record(r.String(),r.Array(r.Object({serviceName:r.String(),serviceNamespace:r.Optional(r.String())})))});var jl=`/${"v1"}/services`,ql=r.Pick(Vo,["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)."}),Oq={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:!1}],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(ql,{examples:[Oq]});var jx=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:jl,method:"GET",paginated:!0,query:r.Object({...Q,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(ql)}),qx=d({description:"Retrieves one telemetry-inferred service by service ID. Use this to inspect observed metadata and recent activity for a service.",operationId:"getService",tags:["services"],url:`${jl}/: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:ql}),Aq=r.Pick(Dl,["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."}),xq=r.Pick(Gl,["name","env","nodeType","serviceType","endpoint","resourceName"],{$id:"InferredServiceGraphNode",description:"Dependency node detected from client-span attributes (e.g. a database, queue, or external HTTP call) that could not be matched to a service catalog entry."}),Rq=b("nodeType",[Aq,xq]),Cq=r.Pick($l,["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."}),Pq=r.Optional(r.Integer({...et.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."})),Uq=r.Optional(r.Integer({...et.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."})),wq=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."}),Fx=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:`${jl}/: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:Pq,to:Uq,query:r.Optional(wq)},{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(Rq,{description:"Observed and inferred nodes included in the service dependency graph."}),edges:r.Array(Cq,{description:"Directed dependency edges between graph nodes."})})});function Bx(e,t){let n=t??fr(e);return n===void 0?void 0:_s(n)}function Fl(e){let t=fr(e);return t===void 0?"":` (default: ${t})`}function Hx(e,t){e.command("service-graph").description("Inspect service dependency graphs").command("get <serviceId>").description("Retrieve the dependency graph for a service").option("--from <timestamp>",`Start of time range${Fl("from")}`).option("--to <timestamp>",`End of time range${Fl("to")}`).option("--query <query>",`Search query${Fl("query")}`).action(async(o,i)=>{let a={},c=Bx("from",i.from),m=Bx("to",i.to);c!==void 0&&(a.from=c),m!==void 0&&(a.to=m),i.query!==void 0&&(a.query=i.query);let l=await t()(Fx,{params:{serviceId:o},query:a});re(l)})}var Kx=require("node:child_process"),zx=require("node:fs"),Vx=require("node:os"),Hc=require("node:path");var zn=require("node:fs");function xa(e,t){let n=`${e}.tmp.${process.pid}`;(0,zn.writeFileSync)(n,t),(0,zn.renameSync)(n,e)}function Ra(e){try{return(0,zn.readFileSync)(e,"utf8")}catch(t){if(t.code==="ENOENT")return;throw t}}function Ca(e,t){if(t===void 0)return;let n=`${e}.bak.${new Date().toISOString().replaceAll(":","-")}`;return(0,zn.writeFileSync)(n,t),n}function Vn(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var Bl="tsuga-dev/agent-plugins",Fc="tsuga";function Bc(e,t){q(` $ ${e} ${t.join(" ")}`);try{(0,Kx.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 Nq(e,t){q("Claude Code \u2192 installing Tsuga plugin"),Bc("claude",["plugin","marketplace","add",Bl]),Bc("claude",["plugin","install",`tsuga@${Fc}`]),t.autoUpdate&&Lq(e)}function Lq(e){let t=(0,Hc.join)(e,".claude","settings.json");q(`Claude Code \u2192 ${t} (autoUpdate)`),(0,zx.mkdirSync)((0,Hc.dirname)(t),{recursive:!0});let n=Ra(t),o=JSON.parse(n??"{}");if(!Vn(o))throw new Error(`${t} must contain a JSON object`);let i=o.extraKnownMarketplaces??{};if(!Vn(i))throw new Error(`${t} "extraKnownMarketplaces" must be a JSON object`);let a=i[Fc],c=Vn(a)?a:{};o.extraKnownMarketplaces={...i,[Fc]:{source:{source:"github",repo:Bl},...c,autoUpdate:!0}};let m=Ca(t,n);xa(t,`${JSON.stringify(o,null,2)}
130
+ `),q(m===void 0?" created":` patched (backup: ${m})`)}function kq(){q("Codex \u2192 installing Tsuga plugin"),Bc("codex",["plugin","marketplace","add",Bl]),Bc("codex",["plugin","add",`tsuga@${Fc}`])}function Yx(e){let t=e.command("install").description("Install Tsuga components into local LLM CLIs").command("plugin").description("Install Tsuga plugins");t.command("claude-code").description("Install the Tsuga plugin into Claude Code").option("--no-auto-update","Skip patching ~/.claude/settings.json with autoUpdate=true").action(n=>{Nq((0,Vx.homedir)(),n),q("Restart your claude session to load the new plugins.")}),t.command("codex").description("Install the Tsuga plugin into Codex").action(()=>{kq(),q("Restart your codex session to load the new plugins.")})}var Ar="/v0/dashboards",Wx=["white","gray.100","amber.200","lime.200","emerald.200","cyan.200","blue.200","violet.200","fuchsia.200","pink.200","red.200"],vq=["bar","distribution","gauge","heatmap","list","pie","query-value","table","timeseries","top-list"],TKe=[...vq,"note"];var Mq=["ns","us","ms","s","m","h","days"];var Dq=["B","KB","MB","GB","TB","PB"];var Gq=20;var Zx=r.Object({type:r.Literal("cpu",{description:"Normalizes values as CPU usage"})},{$id:"DataNormalizerCpu",title:"CPU"}),Xx=r.Object({type:r.Literal("duration",{description:"Normalizes values as durations using standard time units"}),unit:r.Enum(Mq,{description:"Time unit used to present the normalized values"})},{$id:"DataNormalizerDuration",title:"Duration"}),Jx=r.Object({type:r.Literal("data",{description:"Normalizes values as data sizes using byte units"}),unit:r.Enum(Dq,{description:"Data size unit used to present the normalized values"})},{$id:"DataNormalizerData",title:"Data"}),eR=r.Object({type:r.Literal("percent",{description:"Format values as percentages"})},{$id:"DataNormalizerPercent",title:"Percent"}),tR=r.Object({type:r.Literal("date",{description:"Formats values as calendar dates"})},{$id:"DataNormalizerDate",title:"Date"}),rR=r.Object({type:r.Literal("level",{description:"Displays values using their log level name"})},{$id:"DataNormalizerLevel",title:"Level"}),nR=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"}),$q=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"}),jq=r.Object({type:r.Literal("custom",{description:"Normalizes values using a custom unit label"}),unit:r.String({description:"Text label describing the custom unit",maxLength:Gq})},{$id:"InputDataNormalizerCustom",title:"Custom"}),lt=b("type",[Xx,Jx,eR,tR,rR,Zx,nR,$q],{title:"Normalizer",description:"Display-value formatter for widget values or list/table columns. Set by the dashboard author and returned when configured."}),dt=b("type",[Xx,Jx,eR,tR,rR,Zx,nR,jq],{title:"Normalizer",description:"Display-value formatter for widget values or list/table columns. Set by the dashboard author. Optional; custom unit labels are limited to 20 characters."}),oR=r.Object({attribute:r.String({description:"Attribute (log field or database row column) displayed as a column in the list"}),normalizer:r.Optional(lt)},{title:"WidgetListColumn"}),iR=r.Object({attribute:r.String({description:"Attribute (log field or database row column) displayed as a column in the list"}),normalizer:r.Optional(dt)},{title:"WidgetListColumn"}),Yo=["background","no-background"],qq=["table","legend-only","no-legend"];var Fq=["greater_than","less_than","equal","not_equal","greater_than_or_equal","less_than_or_equal"],aR=["alert","warning","success"],sr=r.Object({operator:r.Enum(Fq,{description:"Comparator used to evaluate the metric value"}),value:r.Number({description:"Threshold value used when evaluating the operator"}),color:r.Enum(aR,{description:"Color applied when the condition is met"})},{title:"ConditionalFormatting"}),Bq=r.Object({value:r.Number({description:"Y-axis value where the threshold marker is placed"}),level:r.Enum(aR,{description:"Level applied to the threshold marker"})},{title:"ThresholdMarker"}),Hq=["sec","min","hour","day"],cn=r.Object({time:r.Number({description:"Numeric count of `metric` units in each bucket. Required when `timeBucket` is present."}),metric:r.Enum(Hq,{description:"Unit used to measure the bucket width"})},{description:"Time bucket width for time-based chart widgets. Set by the dashboard author. Optional; when present, `time` and `metric` together define the bucket width."});var sn=r.Enum(["flex-start","center","flex-end"],{description:"Flex alignment keyword used for widget layout"}),Qo=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>".'})))}),Wo=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>".'})))}),zc={source:vt,queries:Ub,formula:r.Optional(_c),aliases:r.Optional(Qo),visibleSeries:r.Optional(r.Array(r.Boolean(),{description:"Flags indicating whether each query or formula series is visible"}))},Vc={source:vt,queries:ia,formula:r.Optional(wn),aliases:r.Optional(Wo),visibleSeries:r.Optional(r.Array(r.Boolean(),{description:"Flags indicating whether each query or formula series is visible"}))},Zo={...zc,groupBy:r.Optional(No)},Xo={...Vc,groupBy:r.Optional(yr)},Oe=r.Enum(qq,{description:"Controls whether and how the widget displays legend or series details (e.g. table, legend-only, or no legend)"}),me=r.Optional(r.Number({description:"Number of decimal places to display in the value"})),Dt=r.Optional(r.Array(Bq,{description:"Threshold markers displayed on the chart"})),Kq=r.Object({name:r.String({description:"Display name of the table column"}),...zc,source:vt,normalizer:r.Optional(lt),precision:me},{title:"TableColumn"}),zq=r.Object({name:u({description:"Display name of the table column"}),...Vc,source:vt,normalizer:r.Optional(dt),precision:me},{title:"TableColumn"}),Vq=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"})),Yq=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"})),sR=["horizontal","vertical"],Qq=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(oR,{description:"Custom columns to display for each log"})),listColumnsSize:r.Optional(r.Record(r.String(),r.Number({description:"List column width by column id"}))),isCellWrapped:r.Optional(r.Boolean({description:"Whether list widget cell text wraps instead of truncating. Set by the dashboard author for list widgets. Optional on create or update and returned when configured."}))},{$id:"GraphVisualizationList",title:"List"}),Wq=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(iR,{description:"Custom columns to display for each log"})),listColumnsSize:r.Optional(r.Record(r.String(),r.Number({description:"List column width by column id"}))),isCellWrapped:r.Optional(r.Boolean({description:"Whether list widget cell text wraps instead of truncating. Set by the dashboard author for list widgets. Optional on create or update; omit or set false to use truncated cells."}))},{$id:"InputGraphVisualizationList",title:"List"}),Kc=b("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"}),Jo=r.Object({min:Kc,max:Kc,scale:b("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. Set by the dashboard author and returned when configured."}),ei=r.Object({min:Kc,max:Kc,scale:b("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. Set by the dashboard author. Optional on create or update and returned when configured."}),Zq=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"}),Xq=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 Jq=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(Oe),thresholds:Dt,yAxisSettings:r.Optional(Jo)},{$id:"GraphVisualizationTimeseriesConnection",title:"TimeseriesConnection"}),eF=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(Oe),thresholds:Dt,yAxisSettings:r.Optional(ei)},{$id:"InputGraphVisualizationTimeseriesConnection",title:"TimeseriesConnection"}),tF=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(oR,{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"}))),isCellWrapped:r.Optional(r.Boolean({description:"Whether list widget cell text wraps instead of truncating. Set by the dashboard author for connection list widgets. Optional on create or update and returned when configured."}))},{$id:"GraphVisualizationListConnection",title:"ListConnection"}),rF=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(iR,{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"}))),isCellWrapped:r.Optional(r.Boolean({description:"Whether list widget cell text wraps instead of truncating. Set by the dashboard author for connection list widgets. Optional on create or update; omit or set false to use truncated cells."}))},{$id:"InputGraphVisualizationListConnection",title:"ListConnection"}),nF=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"}),oF=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"}),iF=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(Oe)},{$id:"GraphVisualizationPieConnection",title:"PieConnection"}),aF=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(Oe)},{$id:"InputGraphVisualizationPieConnection",title:"PieConnection"}),sF=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(Oe),thresholds:Dt,yAxisSettings:r.Optional(Jo)},{$id:"GraphVisualizationBarConnection",title:"BarConnection"}),cF=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(Oe),thresholds:Dt,yAxisSettings:r.Optional(ei)},{$id:"InputGraphVisualizationBarConnection",title:"BarConnection"}),pF=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(Yo,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:r.Optional(r.Array(sr,{description:"Conditional formatting rules applied to the displayed value"})),precision:me,normalizer:r.Optional(lt),legendMode:r.Optional(Oe)},{$id:"GraphVisualizationQueryValueConnection",title:"QueryValueConnection"}),uF=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(Yo,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:r.Optional(r.Array(sr,{description:"Conditional formatting rules applied to the displayed value"})),precision:me,normalizer:r.Optional(dt),legendMode:r.Optional(Oe)},{$id:"InputGraphVisualizationQueryValueConnection",title:"QueryValueConnection"}),mF=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(sR,{description:"Layout used to render log patterns"}))},{$id:"GraphVisualizationListLogPatterns",title:"ListLogPatterns"}),lF=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(sR,{description:"Layout used to render log patterns"}))},{$id:"InputGraphVisualizationListLogPatterns",title:"ListLogPatterns"}),Pa=r.Array(r.String({description:"Raw PromQL expression for this widget. Set by the dashboard author and returned as stored."}),{description:"PromQL expressions configured for this widget. PromQL-backed widgets require at least one query."}),Ua=r.Array(u({allowEmpty:!1,type:"long",description:"Raw PromQL expression for this widget. Set by the dashboard author."}),{minItems:1,description:"PromQL expressions configured for this widget. PromQL-backed widgets require at least one query."}),dF=r.Object({type:r.Literal("timeseries-promql",{description:"Displays PromQL metrics query-based aggregation as a time series chart"}),queries:Pa,aliases:r.Optional(Qo),timeBucket:r.Optional(cn),normalizer:r.Optional(lt),precision:me,legendMode:r.Optional(Oe),thresholds:Dt,yAxisSettings:r.Optional(Jo),smoothing:r.Optional(r.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"}))},{$id:"GraphVisualizationTimeseriesPromql",title:"TimeseriesPromql"}),fF=r.Object({type:r.Literal("timeseries-promql",{description:"Displays PromQL metrics query-based aggregation as a time series chart"}),queries:Ua,aliases:r.Optional(Wo),timeBucket:r.Optional(cn),normalizer:r.Optional(dt),precision:me,legendMode:r.Optional(Oe),thresholds:Dt,yAxisSettings:r.Optional(ei),smoothing:r.Optional(r.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"}))},{$id:"InputGraphVisualizationTimeseriesPromql",title:"TimeseriesPromql"}),gF=r.Object({type:r.Literal("query-value-promql",{description:"Configures a PromQL metrics query-based aggregation as a single value"}),queries:Pa,aliases:r.Optional(Qo),backgroundMode:r.Optional(r.Enum(Yo,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:r.Optional(r.Array(sr,{description:"Conditional formatting rules applied to the displayed value"})),precision:me,normalizer:r.Optional(lt),legendMode:r.Optional(Oe)},{$id:"GraphVisualizationQueryValuePromql",title:"QueryValuePromql"}),yF=r.Object({type:r.Literal("query-value-promql",{description:"Configures a PromQL metrics query-based aggregation as a single value"}),queries:Ua,aliases:r.Optional(Wo),backgroundMode:r.Optional(r.Enum(Yo,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:r.Optional(r.Array(sr,{description:"Conditional formatting rules applied to the displayed value"})),precision:me,normalizer:r.Optional(dt),legendMode:r.Optional(Oe)},{$id:"InputGraphVisualizationQueryValuePromql",title:"QueryValuePromql"}),hF=r.Object({type:r.Literal("top-list-promql",{description:"Displays PromQL metrics query-based aggregation as a ranked top list"}),queries:Pa,aliases:r.Optional(Qo),normalizer:r.Optional(lt),precision:me,conditions:r.Optional(r.Array(sr,{description:"Conditional formatting rules applied to the displayed value"}))},{$id:"GraphVisualizationTopListPromql",title:"TopListPromql"}),TF=r.Object({type:r.Literal("top-list-promql",{description:"Displays PromQL metrics query-based aggregation as a ranked top list"}),queries:Ua,aliases:r.Optional(Wo),normalizer:r.Optional(dt),precision:me,conditions:r.Optional(r.Array(sr,{description:"Conditional formatting rules applied to the displayed value"}))},{$id:"InputGraphVisualizationTopListPromql",title:"TopListPromql"}),EF=r.Object({type:r.Literal("pie-promql",{description:"Displays PromQL metrics query-based aggregation as a pie chart"}),queries:Pa,aliases:r.Optional(Qo),normalizer:r.Optional(lt),precision:me,legendMode:r.Optional(Oe)},{$id:"GraphVisualizationPiePromql",title:"PiePromql"}),IF=r.Object({type:r.Literal("pie-promql",{description:"Displays PromQL metrics query-based aggregation as a pie chart"}),queries:Ua,aliases:r.Optional(Wo),normalizer:r.Optional(dt),precision:me,legendMode:r.Optional(Oe)},{$id:"InputGraphVisualizationPiePromql",title:"PiePromql"}),_F=r.Object({type:r.Literal("bar-promql",{description:"Displays PromQL metrics query-based aggregation as a bar chart"}),queries:Pa,aliases:r.Optional(Qo),timeBucket:r.Optional(cn),precision:me,normalizer:r.Optional(lt),thresholds:Dt,legendMode:r.Optional(Oe),yAxisSettings:r.Optional(Jo)},{$id:"GraphVisualizationBarPromql",title:"BarPromql"}),bF=r.Object({type:r.Literal("bar-promql",{description:"Displays PromQL metrics query-based aggregation as a bar chart"}),queries:Ua,aliases:r.Optional(Wo),timeBucket:r.Optional(cn),precision:me,normalizer:r.Optional(dt),thresholds:Dt,legendMode:r.Optional(Oe),yAxisSettings:r.Optional(ei)},{$id:"InputGraphVisualizationBarPromql",title:"BarPromql"}),SF=r.Object({type:r.Literal("timeseries",{description:"Displays the aggregation as a time series chart"}),...Zo,timeBucket:r.Optional(cn),normalizer:r.Optional(lt),precision:me,legendMode:r.Optional(Oe),thresholds:Dt,yAxisSettings:r.Optional(Jo),smoothing:r.Optional(r.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"}))},{$id:"GraphVisualizationTimeseries",title:"Timeseries"}),OF=r.Object({type:r.Literal("timeseries",{description:"Displays the aggregation as a time series chart"}),...Xo,timeBucket:r.Optional(cn),normalizer:r.Optional(dt),precision:me,legendMode:r.Optional(Oe),thresholds:Dt,yAxisSettings:r.Optional(ei),smoothing:r.Optional(r.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"}))},{$id:"InputGraphVisualizationTimeseries",title:"Timeseries"}),AF=r.Object({type:r.Literal("top-list",{description:"Displays the aggregation as a ranked list of top results"}),...Zo,normalizer:r.Optional(lt),precision:me,conditions:r.Optional(r.Array(sr,{description:"Conditional formatting rules applied to the displayed value"}))},{$id:"GraphVisualizationTopList",title:"TopList"}),xF=r.Object({type:r.Literal("top-list",{description:"Displays the aggregation as a ranked list of top results"}),...Xo,normalizer:r.Optional(dt),precision:me,conditions:r.Optional(r.Array(sr,{description:"Conditional formatting rules applied to the displayed value"}))},{$id:"InputGraphVisualizationTopList",title:"TopList"}),RF=r.Object({type:r.Literal("pie",{description:"Displays the aggregation as a pie chart"}),...Zo,normalizer:r.Optional(lt),precision:me,legendMode:r.Optional(Oe)},{$id:"GraphVisualizationPie",title:"Pie"}),CF=r.Object({type:r.Literal("pie",{description:"Displays the aggregation as a pie chart"}),...Xo,normalizer:r.Optional(dt),precision:me,legendMode:r.Optional(Oe)},{$id:"InputGraphVisualizationPie",title:"Pie"}),PF=r.Object({type:r.Literal("query-value",{description:"Displays the aggregation as a single value"}),...zc,backgroundMode:r.Optional(r.Enum(Yo,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:r.Optional(r.Array(sr,{description:"Conditional formatting rules applied to the displayed value"})),precision:me,normalizer:r.Optional(lt),legendMode:r.Optional(Oe)},{$id:"GraphVisualizationQueryValue",title:"QueryValue"}),UF=r.Object({type:r.Literal("query-value",{description:"Displays the aggregation as a single value"}),...Vc,backgroundMode:r.Optional(r.Enum(Yo,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:r.Optional(r.Array(sr,{description:"Conditional formatting rules applied to the displayed value"})),precision:me,normalizer:r.Optional(dt),legendMode:r.Optional(Oe)},{$id:"InputGraphVisualizationQueryValue",title:"QueryValue"}),wF=r.Object({type:r.Literal("bar",{description:"Displays the aggregation as a bar chart"}),...Zo,timeBucket:r.Optional(cn),precision:me,normalizer:r.Optional(lt),thresholds:Dt,legendMode:r.Optional(Oe),yAxisSettings:r.Optional(Jo)},{$id:"GraphVisualizationBar",title:"Bar"}),NF=r.Object({type:r.Literal("bar",{description:"Displays the aggregation as a bar chart"}),...Xo,timeBucket:r.Optional(cn),precision:me,normalizer:r.Optional(dt),thresholds:Dt,legendMode:r.Optional(Oe),yAxisSettings:r.Optional(ei)},{$id:"InputGraphVisualizationBar",title:"Bar"}),LF=r.Object({type:r.Literal("distribution",{description:"Displays the aggregation as a distribution chart"}),...Zo,precision:me,normalizer:r.Optional(lt),percentileMarkers:r.Optional(Zq),boundsScale:r.Optional(Ic)},{$id:"GraphVisualizationDistribution",title:"Distribution"}),kF=r.Object({type:r.Literal("distribution",{description:"Displays the aggregation as a distribution chart"}),...Xo,precision:me,normalizer:r.Optional(dt),percentileMarkers:r.Optional(Xq),boundsScale:r.Optional(Ic)},{$id:"InputGraphVisualizationDistribution",title:"Distribution"}),cR=["red","pink","violet","blue","cyan","green","yellow","orange"],pR=r.Enum(cR,{description:"Color palette used to render the heatmap intensity gradient"}),vF=r.Object({type:r.Literal("heatmap",{description:"Displays the aggregation as a heatmap chart"}),...Zo,precision:me,normalizer:r.Optional(lt),palette:r.Optional(pR)},{$id:"GraphVisualizationHeatmap",title:"Heatmap"}),MF=r.Object({type:r.Literal("heatmap",{description:"Displays the aggregation as a heatmap chart"}),...Xo,precision:me,normalizer:r.Optional(dt),palette:r.Optional(pR)},{$id:"InputGraphVisualizationHeatmap",title:"Heatmap"}),uR=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(cR,{description:"Color applied to the band starting at this value"})},{title:"GaugeColorThreshold"}),DF=r.Object({type:r.Literal("gauge",{description:"Displays the aggregation as a gauge"}),...zc,max:r.Optional(r.Number({description:"Gauge maximum value"})),colorThresholds:r.Optional(r.Array(uR,{description:"Color thresholds inside the gauge range"})),precision:me,normalizer:r.Optional(lt)},{$id:"GraphVisualizationGauge",title:"Gauge"}),GF=r.Object({type:r.Literal("gauge",{description:"Displays the aggregation as a gauge"}),...Vc,max:r.Optional(r.Number({description:"Gauge maximum value"})),colorThresholds:r.Optional(r.Array(uR,{description:"Color thresholds inside the gauge range"})),precision:me,normalizer:r.Optional(dt)},{$id:"InputGraphVisualizationGauge",title:"Gauge"}),$F=r.Object({type:r.Literal("table",{description:"Displays the aggregation as a table with multi-level grouping"}),columns:r.Array(Kq,{description:"Each column defines an independent aggregation displayed as a table column"}),groupBy:r.Optional(No),defaultSorting:r.Optional(Vq),columnSizes:r.Optional(r.Record(r.String(),r.Number({description:"Column width by column id"})))},{$id:"GraphVisualizationTable",title:"Table"}),jF=r.Object({type:r.Literal("table",{description:"Displays the aggregation as a table with multi-level grouping"}),columns:r.Array(zq,{minItems:1,description:"Each column defines an independent aggregation displayed as a table column"}),groupBy:r.Optional(yr),defaultSorting:r.Optional(Yq),columnSizes:r.Optional(r.Record(r.String(),r.Number({description:"Column width by column id"})))},{$id:"InputGraphVisualizationTable",title:"Table"}),qF=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(Wx,{description:"Background color used to render the note"})),noteAlign:r.Optional(sn),noteJustifyContent:r.Optional(sn)},{$id:"GraphVisualizationNote",title:"Note"}),FF=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(Wx,{description:"Background color used to render the note"})),noteAlign:r.Optional(sn),noteJustifyContent:r.Optional(sn)},{$id:"InputGraphVisualizationNote",title:"Note"}),BF=b("type",[Jq,tF,nF,iF,sF,pF,dF,gF,hF,EF,_F,SF,AF,RF,PF,DF,wF,LF,vF,$F,Qq,qF,mF],{description:"Widget visualization configuration. The `type` discriminator selects the widget kind and its required fields."}),HF=b("type",[eF,rF,oF,aF,cF,uF,fF,yF,TF,IF,bF,OF,xF,CF,UF,GF,NF,kF,MF,jF,Wq,FF,lF],{description:"Widget visualization configuration. The `type` discriminator selects the widget kind and its required fields."}),Yc=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(sn),descriptionJustifyContent:r.Optional(sn),visualization:BF,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."}),h:r.Number({description:"Height of the widget in grid rows, where each row is 50 pixels tall."})},{description:"Grid position and size of the widget. Set by the dashboard author when arranging widgets. Optional; when provided, width and height must meet the minimum size for the widget type."}))},{title:"Graph"}),Qc=r.Object({id:u({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(u({description:"Display name of the graph widget."})),description:r.Optional(r.String({minLength:1,maxLength:800,description:"Optional text shown with the graph widget. Maximum length is 800 characters."})),descriptionAlign:r.Optional(sn),descriptionJustifyContent:r.Optional(sn),visualization:HF,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."}),h:r.Number({description:"Height of the widget in grid rows, where each row is 50 pixels tall."})},{description:"Grid position and size of the widget. Set by the dashboard author when arranging widgets. Optional; when provided, width and height must meet the minimum size for the widget type."}))},{title:"Graph"}),Qx=10,KF=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. Set by the dashboard author and returned as stored."})}),{description:"Dashboard-wide filters applied to every widget on the dashboard."}),zF=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. Set by the dashboard author."})}),{maxItems:Qx,description:`Dashboard-wide filters applied to every widget on the dashboard. Up to ${Qx} filters are allowed.`}),ti=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(Yc,{description:"Ordered widgets that compose the dashboard"}),filters:r.Optional(KF),createdAt:E({description:"Timestamp when Tsuga created the dashboard."}),updatedAt:E({description:"Timestamp when Tsuga last updated the dashboard."}),creator:r.Optional(ue),updater:r.Optional(ue),tags:ke,timePreset:r.Optional(r.Enum(Dp,{description:"Relative time preset used when opening the dashboard."})),folderId:r.Optional(r.String({description:"Folder that contains the dashboard. Set from the dashboard\u2019s saved folder relationship. Returned when the dashboard is in a folder; omitted when it is not."}))}),Wc=r.Object({name:u({description:"Display name of the dashboard. Set by the caller on create or update."}),owner:u({allowEmpty:!1,description:"ID of the team that owns the dashboard. Set by the caller on create or update. Required and used for dashboard access control."}),graphs:r.Array(Qc,{description:"Ordered widgets that compose the dashboard"}),filters:r.Optional(zF),tags:Ve,timePreset:r.Optional(r.Enum(Dp,{description:"Relative time preset used when opening the dashboard. Set by the caller or by Tsuga\u2019s default. 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. Set by the caller on create or update. 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."}))}),zt={IS_FAVORITE:"isFavorite",OWNER:"owner",TAGS:"tags",WIDGET_COUNT:"widgetCount",UPDATED_AT:"updatedAt",NAME:"name"},mR=[zt.OWNER,zt.TAGS,zt.WIDGET_COUNT,zt.UPDATED_AT,zt.NAME],Zc=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. Set by the caller in dashboard query requests. Optional; omit to avoid 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. Set by the caller in dashboard query requests. Optional; `exclude: true` returns dashboards whose name and ID do not match the substring."}),tags:$e(Ht.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. Set by the caller in dashboard query requests. 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"})),VF=r.Partial(r.Object({...Q,filters:Zc,sort:r.Object({by:r.Enum([zt.IS_FAVORITE,zt.OWNER,zt.TAGS,zt.WIDGET_COUNT,zt.UPDATED_AT,zt.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"})})),EKe=d({tags:["dashboards"],url:`${Ar}/query`,method:"POST",paginated:!0,response:r.Array(ti),body:VF}),IKe=d({tags:["dashboards"],url:`${Ar}/tags/query`,method:"POST",body:r.Object({filters:r.Optional(r.Omit(Zc,["tags"]))}),response:Bt}),_Ke=d({tags:["dashboards"],url:`${Ar}/:id`,method:"GET",params:r.Object({id:u()}),response:ti}),bKe=d({tags:["dashboards"],url:Ar,method:"POST",body:Wc,response:ti}),SKe=d({tags:["dashboards"],url:`${Ar}/:id`,method:"PUT",params:r.Object({id:u()}),body:r.Partial(Wc),response:ti}),OKe=d({tags:["dashboards"],url:`${Ar}/bulk-update`,method:"PUT",body:r.Object({dashboardIds:r.Array(u()),owner:u({allowEmpty:!1})}),response:r.Object({})}),AKe=d({tags:["dashboards"],url:`${Ar}/:id`,method:"DELETE",params:r.Object({id:u()}),response:C}),xKe=d({tags:["dashboards"],url:`${Ar}/:id/graphs/:graphId`,method:"PUT",params:r.Object({id:u({allowEmpty:!1}),graphId:u({allowEmpty:!1})}),body:r.Omit(Qc,["id"]),response:Yc}),RKe=d({tags:["dashboards"],url:`${Ar}/bulk-delete`,method:"DELETE",body:r.Object({ids:r.Array(u())}),response:r.Object({})});var ri=`/${"v1"}/dashboards`,wa=r.Pick(ti,["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)."}),YF={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(wa,{examples:[YF]});var QF=r.Object({by:r.Enum([...mR],{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"}),lR=r.Object({...Q,filters:r.Optional(r.Pick(Zc,["owners","searchQuery","tags","folderId"])),sort:r.Optional(QF)},{description:"Dashboard query request. Use filters, sorting, limit, and offset to page through visible dashboards."}),WF={filters:{owners:{values:["team-123-abc"]},searchQuery:{value:"API"},tags:{values:[{key:"service",value:"api-gateway"}]}},sort:{by:"name",direction:"asc"},limit:10,offset:0};Object.assign(lR,{examples:[WF]});var dR=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:`${ri}/query`,method:"POST",paginated:!0,body:lR,response:r.Array(wa)}),fR=d({description:"Retrieves one dashboard by ID when the authenticated operation key can read it. Use this before updating or cloning a dashboard definition.",operationId:"getDashboard",tags:["dashboards"],url:`${ri}/: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:wa}),Hl=r.Pick(Wc,["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."}),ZF={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(Hl,{examples:[ZF]});var XF=r.Omit(Qc,["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."}),gR=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:ri,method:"POST",body:Hl,response:wa}),yR=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:`${ri}/: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(Hl),response:wa}),JF=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."})}),hR=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:`${ri}/:id`,method:"DELETE",params:JF,response:C}),vKe=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:`${ri}/: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:XF,response:Yc});var TR=100,ER=3,ni=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:Bt,teamOverrideFields:r.Optional(r.Array(r.String(),{description:"Telemetry attribute names used to override ownership for data sent with this key."})),updatedAt:E({description:"Timestamp when Tsuga last updated the key metadata."}),createdAt:E({description:"Timestamp when Tsuga created the key."}),creator:r.Optional(ue),updater:r.Optional(ue),assetUpdatedAt:E({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})}),Na=r.Object({name:r.String({format:Ro,minLength:1,maxLength:TR,description:`Kebab-case name for the ingestion API key. Maximum length is ${TR} characters.`}),owner:u({allowEmpty:!1,description:"Team ID that will own and manage the ingestion API key."}),tags:Ht,teamOverrideFields:r.Union([r.Array(u({allowEmpty:!1}),{minItems:1,maxItems:ER,description:`Array form. Up to ${ER} 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."})}),La="/v0/ingestion-api-keys",HKe=d({tags:["ingestion-api-keys"],url:La,method:"POST",body:Na,response:r.Intersect([ni,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."})})])}),KKe=d({tags:["ingestion-api-keys"],url:La,method:"GET",paginated:!0,query:r.Object(Q),response:r.Array(ni)}),zKe=d({tags:["ingestion-api-keys"],url:`${La}/:id`,method:"GET",params:r.Object({id:u({allowEmpty:!1})}),response:ni}),VKe=d({tags:["ingestion-api-keys"],url:`${La}/:id`,method:"PUT",params:r.Object({id:u({allowEmpty:!1})}),body:Na,response:ni}),YKe=d({tags:["ingestion-api-keys"],url:`${La}/:id`,method:"DELETE",params:r.Object({id:u({allowEmpty:!1})}),response:C});var ka=`/${"v1"}/ingestion-api-keys`,va=r.Pick(ni,["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)."}),IR={id:"123-456-abc",name:"production-logs-ingestion",keyLastCharacters:"x7Qm",owner:"team-123-abc",tags:[{key:"env",value:"production"}],teamOverrideFields:["service"]};Object.assign(va,{examples:[IR]});var _R=r.Pick(Na,["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."}),bR=r.Pick(Na,["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."}),SR={name:"production-logs-ingestion",owner:"team-123-abc",tags:[{key:"env",value:"production"}],teamOverrideFields:["service"]};Object.assign(_R,{examples:[SR]});Object.assign(bR,{examples:[SR]});var eB={...IR,key:"tsuga_in:v1:abc123xyx7Qm"},OR=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:ka,method:"GET",paginated:!0,query:r.Object(Q),response:r.Array(va)}),rze=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:`${ka}/: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:va}),tB=r.Intersect([r.Pick(va,["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:eB}),AR=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:ka,method:"POST",body:_R,response:tB}),xR=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:`${ka}/: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:bR,response:va}),RR=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:`${ka}/: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:C});var rB={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"]}},[aze,Vl,Ma]=nB(rB);function nB(e){let t=[],n=[],o=[],i=Object.keys(e);for(let a of i){t.push(a);let c=e[a];for(let m in c){n.push(m);let l=c[m];Array.isArray(l)&&o.push(...l)}}return[Kl(t),Kl(n),Kl(o)]}function Kl(e){if(e.length===0)throw new Error("Array must have at least one element.");return e}var zl=r.Enum(["HTTP","HTTPS","TCP","UDP","GENEVE","TLS","TLS_QUIC","TCP_UDP","TCP_QUIC","QUIC"]),oB=r.Object({versioningStatus:r.Optional(r.Enum(["Enabled","Disabled","Suspended","Not configured"]))}),iB=r.Object({domainName:r.Optional(r.String()),origins:r.Optional(r.Array(r.String()))}),aB=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())}),sB=r.Object({version:r.Optional(r.String()),virtualNetworkId:r.Optional(r.String()),subnets:r.Optional(r.Array(r.String()))}),cB=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())}),pB=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()))}),uB=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(E())}),mB=r.Object({isEncrypted:r.Optional(r.Boolean()),ownerId:r.Optional(r.String()),state:r.Optional(r.Enum(["creating","available","deleting","deleted","error","updating"]))}),lB=r.Object({type:r.Optional(r.String()),osType:r.Optional(r.String()),subnetIds:r.Optional(r.Array(r.String())),nbContainers:r.Optional(r.Number())}),dB=r.Object({digest:r.String(),imageTags:r.Array(r.String()),imageSizeBytes:r.Optional(r.Number()),imagePushedAt:r.Optional(E()),mediaType:r.Optional(r.String()),repositoryName:r.String(),repositoryId:r.Optional(r.String()),scanStatus:r.Optional(r.String())}),fB=r.Object({url:r.Optional(r.String()),maxMessageSizeBytes:r.Optional(r.Number()),messageRetentionHours:r.Optional(r.Number())}),gB=r.Object({runtime:r.Optional(r.String()),memoryAllocationMib:r.Optional(r.Number()),timeoutMs:r.Optional(r.Number()),codeSha256:r.Optional(r.String())}),yB=r.Object({kind:r.Optional(r.String())}),hB=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())}),TB=r.Object({id:r.Optional(r.String()),ipCidrBlocks:r.Array(r.String())}),EB=r.Object({protocol:r.Optional(zl),port:r.Optional(r.Number()),instanceProtocol:r.Optional(zl),instancePort:r.Optional(r.Number())}),IB=r.Object({protocol:r.Optional(r.String()),ports:r.Optional(r.Array(r.String())),portRange:r.Optional(r.String()),allPorts:r.Optional(r.Boolean())}),_B=r.Object({name:r.String(),ip:r.Optional(r.String()),type:r.Enum(["public","private"])}),bB=r.Object({type:r.String(),name:r.String()}),SB=r.Object({frontendIp:r.Optional(_B),backendIpPools:r.Array(bB)}),OB=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())}),AB=r.Object({protocol:r.Optional(zl),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(OB)),targetCount:r.Optional(r.Number()),healthyTargetCount:r.Optional(r.Number()),loadBalancerArns:r.Optional(r.Array(r.String()))}),xB=r.Object({first:r.Optional(r.String()),last:r.Optional(r.String()),scope:r.Optional(r.Number())}),RB=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(),xB]))),target:r.Optional(r.String()),weight:r.Optional(r.Number()),priority:r.Optional(r.Number()),status:r.Optional(r.String())}),CB=r.Object({instanceId:r.Optional(r.String()),state:r.Optional(r.String()),reasonCode:r.Optional(r.String()),description:r.Optional(r.String())}),PB=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(EB),r.Array(IB)])),targets:r.Optional(r.Union([r.Array(r.String()),r.Array(CB),r.Array(RB)])),azureLoadBalancingRules:r.Optional(r.Array(SB))}),UB=r.Object({domainName:r.Optional(r.String()),expiresAt:r.Optional(E()),inUseBy:r.Optional(r.Array(r.String())),renewalEligibility:r.Optional(r.String()),revokedAt:r.Optional(E()),status:r.Optional(r.String()),type:r.Optional(r.String())}),wB=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"]))}),NB=r.Object({osType:r.Optional(r.Enum(["Windows","Linux"]))}),LB=r.Object({state:r.Optional(r.String()),volumeType:r.Optional(r.String())}),kB=r.Intersect([r.Object({isEncrypted:r.Optional(r.Boolean()),sizeGib:r.Optional(r.Number())}),r.Union([wB,LB,NB])]),vB=r.Object({instanceCount:r.Optional(r.Number()),hostnames:r.Optional(r.Array(r.String())),runtime:r.Optional(r.String())}),Da=r.Union([r.Object({category:r.Literal("application"),resourceType:r.Literal("webService"),attributes:r.Optional(vB)}),r.Object({category:r.Literal("data"),resourceType:r.Literal("bucket"),attributes:r.Optional(oB)}),r.Object({category:r.Literal("data"),resourceType:r.Literal("messagingService"),attributes:r.Optional(fB)}),r.Object({category:r.Literal("data"),resourceType:r.Literal("fileSystem"),attributes:r.Optional(mB)}),r.Object({category:r.Literal("data"),resourceType:r.Literal("contentDeliveryNetwork"),attributes:r.Optional(iB)}),r.Object({category:r.Literal("data"),resourceType:r.Literal("database"),attributes:r.Optional(aB)}),r.Object({category:r.Literal("data"),resourceType:r.Literal("storageAccount"),attributes:r.Optional(yB)}),r.Object({category:r.Literal("data"),resourceType:r.Literal("volume"),attributes:r.Optional(kB)}),r.Object({category:r.Literal("compute"),resourceType:r.Literal("virtualMachine"),attributes:r.Optional(hB)}),r.Object({category:r.Literal("compute"),resourceType:r.Literal("serverless"),attributes:r.Optional(gB)}),r.Object({category:r.Literal("container"),resourceType:r.Literal("kubernetesCluster"),attributes:r.Optional(sB)}),r.Object({category:r.Literal("container"),resourceType:r.Literal("containerRepository"),attributes:r.Optional(cB)}),r.Object({category:r.Literal("container"),resourceType:r.Literal("containerCluster"),attributes:r.Optional(pB)}),r.Object({category:r.Literal("container"),resourceType:r.Literal("containerServiceTask"),attributes:r.Optional(uB)}),r.Object({category:r.Literal("container"),resourceType:r.Literal("containerService"),attributes:r.Optional(lB)}),r.Object({category:r.Literal("container"),resourceType:r.Literal("containerImage"),attributes:r.Optional(dB)}),r.Object({category:r.Literal("network"),resourceType:r.Literal("virtualNetwork"),attributes:r.Optional(TB)}),r.Object({category:r.Literal("network"),resourceType:r.Literal("loadBalancer"),attributes:PB}),r.Object({category:r.Literal("network"),resourceType:r.Literal("targetGroup"),attributes:r.Optional(AB)}),r.Object({category:r.Literal("network"),resourceType:r.Literal("certificate"),attributes:r.Optional(UB)})],{description:"Normalized public inventory category, resource type, and category-specific attributes. Attribute shape depends on the category and resourceType combination."});var pn="/v0/inventory",Ga=["aws","gcp","azure"],CR=["scan_in_progress","success","failure","partial"],Xc=r.Object({id:r.String({description:"Identifier of the inventory resource. Generated by Tsuga."}),cloudPlatform:r.Enum(Ga,{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(E({description:"Timestamp when the resource was created in the cloud, when known."})),resourceUpdatedAt:r.Optional(E({description:"Timestamp when the resource was last updated in the cloud, when known."})),resourceLastSeenAt:E({description:"Timestamp when Tsuga last observed this resource during an inventory scan."}),tags:ke,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"}))}),fze=d({tags:["inventory"],method:"GET",url:`${pn}/resources`,paginated:!0,query:r.Object(Q),response:r.Array(r.Intersect([Xc,Da]))}),oi={DISPLAY_NAME:"displayName",CLOUD_ACCOUNT:"cloudAccount",NATIVE_RESOURCE_TYPE:"nativeResourceType",CLOUD_REGION:"cloudRegion",RESOURCE_TYPE:"resourceType",RESOURCE_CREATED_AT:"resourceCreatedAt"},PR=r.Object({cloudPlatforms:$e(r.Enum(Ga),{description:"Restrict results to resources discovered on any of these cloud platforms",maxItems:Ga.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(Ma),{description:"Restrict results to resources of any of these cloud-native resource types",maxItems:Ma.length}),resourceTypes:$e(r.Enum(Vl),{description:"Restrict results to resources of any of these normalized resource types",maxItems:Vl.length}),tags:$e(Ht.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"}),MB=r.Partial(r.Object({...Q,filters:r.Partial(PR),sort:r.Object({by:r.Enum([oi.DISPLAY_NAME,oi.CLOUD_ACCOUNT,oi.NATIVE_RESOURCE_TYPE,oi.CLOUD_REGION,oi.RESOURCE_TYPE,oi.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."})})),gze=d({tags:["inventory"],method:"POST",url:`${pn}/resources/query`,paginated:!0,body:MB,response:r.Array(r.Intersect([Xc,Da]))}),DB=["resourceType","cloudAccount","isIacManaged"],yze=d({tags:["inventory"],method:"POST",url:`${pn}/resources/counts`,body:r.Object({filters:r.Optional(r.Partial(PR)),groupBy:r.Enum(DB,{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."})}))}),hze=d({tags:["inventory"],method:"GET",url:`${pn}/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:Bt})}),GB=b("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."})})]),$B="^[0-9]{12}$",jB="^arn:aws[a-z-]*:iam::[0-9]{12}:role/.+$",qB="^[a-z][a-z0-9-]{4,28}[a-z0-9]$",FB="^[^@\\s]+@[^@\\s]+\\.iam\\.gserviceaccount\\.com$",BB="^//iam\\.googleapis\\.com/projects/[0-9]+/locations/global/workloadIdentityPools/[^/]+/providers/[^/]+$",Yl="^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$",HB=r.Object({type:r.Literal("aws",{description:"Discriminator identifying AWS connection settings."}),accountId:r.String({pattern:$B,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:jB,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"}),KB=r.Object({type:r.Literal("gcp",{description:"Discriminator identifying GCP connection settings."}),projectId:r.String({pattern:qB,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:FB,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:BB,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"}),zB=r.Object({type:r.Literal("azure",{description:"Discriminator identifying Azure connection settings."}),clientId:r.String({pattern:Yl,minLength:1,description:"Client ID of the Azure application Tsuga authenticates as (GUID).",errorMessage:{pattern:"Must be a GUID."}}),subscriptionId:r.String({pattern:Yl,minLength:1,description:"Azure subscription ID that Tsuga scans (GUID).",errorMessage:{pattern:"Must be a GUID."}}),tenantId:r.String({pattern:Yl,minLength:1,description:"Azure tenant ID that owns the subscription (GUID).",errorMessage:{pattern:"Must be a GUID."}})},{$id:"AzureConnectionSettings"}),UR=b("type",[HB,KB,zB]),ii=r.Object({id:r.String({description:"Identifier of the cloud account. Generated by Tsuga."}),cloudType:r.Enum(Ga,{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."})),connectionSettings:GB,createdBy:r.Optional(r.String({description:"Identifier of the user who created the account, when created by a user."})),createdAt:E({description:"Timestamp when the account was registered in Tsuga."}),lastScanStartedAt:r.Optional(E({description:"Timestamp when the most recent inventory scan started."})),lastScanFinishedAt:r.Optional(E({description:"Timestamp when the most recent inventory scan finished."})),lastScanStatus:r.Optional(r.Enum(CR,{description:"Status of the most recent inventory scan."}))}),Ql=r.Object({cloudType:r.Enum(Ga,{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:UR,lastScanStatus:r.Optional(r.Enum(CR,{description:"Status of the most recent inventory scan."}))}),Yn=`${pn}/cloud-accounts`,Tze=d({tags:["inventory"],url:Yn,method:"GET",response:r.Array(ii)}),Eze=d({tags:["inventory"],url:`${Yn}/:id`,method:"GET",params:r.Object({id:u()}),response:ii}),Ize=d({tags:["inventory"],url:Yn,method:"POST",body:Ql,response:ii}),Wl=r.Object({accountFriendlyName:u()}),_ze=d({tags:["inventory"],url:`${Yn}/:id`,method:"PUT",params:r.Object({id:u()}),body:Wl,response:ii}),bze=d({tags:["inventory"],url:`${Yn}/:id`,method:"DELETE",params:r.Object({id:u()}),response:C}),Sze=d({tags:["inventory"],url:`${pn}/trigger-scan`,method:"POST",body:r.Object({}),response:r.Object({success:r.Literal(!0)})}),Oze=d({tags:["inventory"],url:`${Yn}/azure/onboarding`,method:"POST",body:r.Object({tenantId:u()}),response:r.Object({subjectId:r.String(),audience:r.String()})}),Aze=d({tags:["inventory"],method:"POST",url:`${Yn}/validate/:type`,params:r.Object({type:u()}),body:r.Object({data:UR,id:r.Optional(u())}),response:r.Object({areAccountSettingsValid:r.Boolean(),message:r.Optional(r.String())})}),wR=`${pn}/settings`,xze=d({tags:["inventory"],url:wR,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())}))}))})}),VB=50,Rze=d({tags:["inventory"],url:wR,method:"POST",body:r.Object({infrastructureIdentifiers:r.Array(r.Object({name:u({allowEmpty:!1}),value:r.Optional(u({allowEmpty:!1}))}),{maxItems:VB})}),response:r.Object({})}),Cze=d({tags:["inventory"],url:`${pn}/iac-tags-proposal`,method:"GET",response:r.Array(r.Object({name:r.String(),value:r.Optional(r.String())}))});var NR=`/${"v1"}/inventory`,YB=r.Omit(Xc,["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)."}),LR=r.Intersect([YB,Da],{$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)."}),QB={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(LR,{examples:[QB]});var kR=d({description:"Lists cloud resources discovered by inventory scans. Use this endpoint to build infrastructure inventories across connected cloud accounts. Pagination fields limit the returned page.",operationId:"listInventoryResources",tags:["inventory"],url:`${NR}/resources`,method:"GET",paginated:!0,query:r.Object(Q),response:r.Array(LR)}),$a=`${NR}/cloud-accounts`,ja=r.Pick(ii,["id","cloudType","cloudAccountId","accountFriendlyName"],{$id:"CloudAccount"}),WB={id:"123-456-abc",cloudType:"aws",cloudAccountId:"123456789012",accountFriendlyName:"Production AWS"};Object.assign(ja,{examples:[WB]});var vR=r.Pick(Ql,["cloudType","cloudAccountId","accountFriendlyName","connectionSettings"]),ZB={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(vR,{examples:[ZB]});var XB=r.Pick(Wl,["accountFriendlyName"]),Dze=d({description:"Lists cloud accounts connected to Tsuga that the authenticated operation key can read.",operationId:"listCloudAccounts",tags:["inventory"],url:$a,method:"GET",response:r.Array(ja)}),Gze=d({description:"Retrieves one cloud account by ID.",operationId:"getCloudAccount",tags:["inventory"],url:`${$a}/:id`,method:"GET",params:r.Object({id:u()}),response:ja}),$ze=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:$a,method:"POST",body:vR,response:ja}),jze=d({description:"Updates the friendly name of a cloud account by ID.",operationId:"updateCloudAccount",tags:["inventory"],url:`${$a}/:id`,method:"PUT",params:r.Object({id:u()}),body:XB,response:ja}),qze=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:`${$a}/:id`,method:"DELETE",params:r.Object({id:u()}),response:C});var qa="/v0/investigations",JB=["dashboard","monitor","service","slo","log-route"],eH=r.Object({type:r.String({description:'Kind of linked asset, e.g. "dashboard"'}),id:r.String({description:"Identifier of the linked asset"})}),tH=r.Object({type:r.Enum(JB,{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:ke,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(eH,{description:"Assets (dashboards, monitors, \u2026) referenced by this investigation"}),creator:r.Optional(ue),updater:r.Optional(ue),createdAt:E({description:"Timestamp the investigation was created at."}),updatedAt:E({description:"Timestamp the investigation was last updated at."})},{title:"Investigation"}),Jc=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:Ve,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(tH,{maxItems:100,description:"Assets (dashboards, monitors, \u2026) referenced by this investigation"}))}),Zl=r.Object(r.Omit(Jc,["slug"]).properties),Qze=d({tags:["investigations"],url:qa,method:"GET",paginated:!0,query:r.Object(Q),response:r.Array(xr)}),Wze=d({tags:["investigations"],url:`${qa}/:id`,params:r.Object({id:u()}),method:"GET",response:xr}),Zze=d({tags:["investigations"],url:qa,method:"POST",body:Jc,response:xr}),Xze=d({tags:["investigations"],url:`${qa}/:id`,method:"PUT",body:Zl,params:r.Object({id:u()}),response:xr}),Jze=d({tags:["investigations"],url:`${qa}/:id`,method:"DELETE",params:r.Object({id:u()}),response:C});var Fa=`/${"v1"}/investigations`,MR=d({description:"Retrieve all investigations",tags:["private"],url:Fa,method:"GET",paginated:!0,query:r.Object(Q),response:r.Array(xr)}),DR=d({description:"Retrieve an investigation by its id",tags:["private"],url:`${Fa}/:id`,method:"GET",params:r.Object({id:u({allowEmpty:!1})}),response:xr}),GR=d({description:"Create a new investigation",tags:["private"],url:Fa,method:"POST",body:Jc,response:xr}),$R=d({description:"Update an investigation by its id",tags:["private"],url:`${Fa}/:id`,method:"PUT",body:Zl,params:r.Object({id:u({allowEmpty:!1})}),response:xr}),jR=d({description:"Delete an investigation by its id",tags:["private"],url:`${Fa}/:id`,method:"DELETE",params:r.Object({id:u({allowEmpty:!1})}),response:C});var Ba=`/${"v1"}/monitors`,Ha=r.Pick(Sr,["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)."}),FR={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:[]},BR={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:[]},HR={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:[]},KR={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:[]},rH={id:"123-456-abc",...FR},nH={id:"234-567-bcd",...BR},oH={id:"345-678-cde",...HR},iH={id:"456-789-def",...KR};Object.assign(Ha,{examples:[rH,nH,oH,iH]});var qR=r.Pick(xl,["filters","sort","limit","offset"]),zR=r.Object({...qR.properties,filters:qR.properties.filters},{description:"Monitor query request. Use filters, sorting, limit, and offset to page through visible monitors."}),aH={filters:{owners:{values:["team-123-abc"]},searchQuery:{value:"service:api-gateway"},tags:{values:[{key:"paging",value:"true"}]},priorities:{values:[4,5],exclude:!0}},sort:{by:"name",direction:"asc"},limit:10,offset:0};Object.assign(zR,{examples:[aH]});var VR=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:`${Ba}/query`,method:"POST",paginated:!0,body:zR,response:r.Array(Ha)}),YR=d({description:"Retrieves one monitor definition by ID when the authenticated operation key can read it. Use this before updating, duplicating, or auditing a monitor.",operationId:"getMonitor",tags:["monitors"],url:`${Ba}/:id`,method:"GET",params:r.Object({id:u({allowEmpty:!1,description:"Monitor ID returned by monitor query, create, or update operations."})}),response:Ha}),QR=["name","message","tags","configuration","priority","owner","dashboardId","permissions","clusterIds"],WR=r.Pick(ba,QR,{$id:"CreateMonitorRequest",description:"Monitor creation request. Provide ownership, data access, alert configuration, priority, tags, and optional dashboard or cluster scope."}),ZR=r.Pick(ba,QR,{$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."}),XR=FR,JR=BR,eC=HR,tC=KR;Object.assign(WR,{examples:[XR,JR,eC,tC]});Object.assign(ZR,{examples:[XR,JR,eC,tC]});var rC=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:Ba,method:"POST",body:WR,response:Ha}),nC=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:`${Ba}/: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:ZR,response:Ha}),sH=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."})}),oC=d({description:"Deletes a monitor by ID. Deleting a monitor stops future evaluations and alert transitions for that monitor.",operationId:"deleteMonitor",tags:["monitors"],url:`${Ba}/:id`,method:"DELETE",params:sH,response:C});var Ka=`/${"v1"}/notification-rules`,za=r.Pick(zo,["id","name","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)."}),iC={name:"Critical Alerts",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},renotifyConfig:{mode:"each",renotificationStates:["alert"],renotifyIntervalMinutes:30},config:{type:"email",addresses:["oncall@example.com"]}}]},cH={id:"123-456-abc",...iC};Object.assign(za,{examples:[cH]});var aC=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:Ka,method:"GET",paginated:!0,query:r.Object(Q),response:r.Array(za)}),sC=d({description:"Retrieves one notification rule by ID when the authenticated operation key can read it. Use this before updating routing or target configuration.",operationId:"getNotificationRule",tags:["notification-rules"],url:`${Ka}/: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:za}),Xl=r.Pick(Oa,["name","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."}),pH=iC;Object.assign(Xl,{examples:[pH]});var cC=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:Ka,method:"POST",body:Xl,response:za}),pC=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:`${Ka}/: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:Xl,response:za}),uH=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."})}),uC=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:`${Ka}/:id`,method:"DELETE",params:uH,response:C});var ai=`${Ko}/silences`,mC=r.Union([r.Literal("monday"),r.Literal("tuesday"),r.Literal("wednesday"),r.Literal("thursday"),r.Literal("friday"),r.Literal("saturday"),r.Literal("sunday")]),mH=r.Partial(r.Record(mC,r.Array(r.Object({startTime:r.String({format:Cu,description:"Local start time for this recurring silence window on this day, using the schedule time zone."}),endTime:r.String({format:Cu,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:"Weekly recurring schedule keyed by day of week. Omitted days have no silence window, and at least one day must be defined."})),lH=r.Partial(r.Record(mC,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:"Weekly recurring schedule keyed by day of week. Omitted days have no silence window."})),ep='IANA timezone identifier (e.g. "America/New_York"). Defaults to UTC if omitted.',lC="One-time silence schedule with specific start and end times",dC="Recurring weekly silence schedule",dH=b("type",[r.Object({type:r.Literal("one-time",{description:"Silence active once between the configured start and end times."}),startTime:r.String({format:Pu,description:"Local start date and time for the one-time silence, interpreted in `timeZone` when provided."}),endTime:r.String({format:Pu,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:Ru,description:ep}))},{$id:"InputSilenceScheduleOneTime",description:lC}),r.Object({type:r.Literal("recurring",{description:"Silence active on a recurring weekly schedule."}),weeklySchedule:mH,timeZone:r.Optional(r.String({format:Ru,description:ep}))},{$id:"InputSilenceScheduleRecurring",description:dC})],{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."}),fH=b("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:ep}))},{$id:"OutputSilenceScheduleOneTime",description:lC}),r.Object({type:r.Literal("recurring",{description:"Silence active on a recurring weekly schedule."}),weeklySchedule:lH,timeZone:r.Optional(r.String({description:ep}))},{$id:"OutputSilenceScheduleRecurring",description:dC})],{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."}),tp=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:Ve,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:dH,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:"Query string to filter which alerts this silence applies to"})),teamsFilter:kl,prioritiesFilter:r.Array(r.Enum(mt),{maxItems:mt.length,description:"Monitor priorities that must match for this silence to apply. An empty array matches every priority."}),transitionTypesFilter:r.Array(r.Enum(Hn),{maxItems:Hn.length,description:"Alert state transitions that must match for this silence to apply. An empty array matches every transition type."})}),si=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:ke,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:fH,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:"Query string filtering which alerts this silence applies to"})),teamsFilter:Ll,prioritiesFilter:r.Array(r.Enum(mt),{description:"Monitor priorities that must match for this silence to apply. An empty array matches every priority."}),transitionTypesFilter:r.Array(r.Enum(Hn),{description:"Alert state transitions that must match for this silence to apply. An empty array matches every transition type."}),createdAt:E(),updatedAt:E(),creator:r.Optional(ue),updater:r.Optional(ue)}),w9e=d({tags:["notification-silences"],url:ai,method:"GET",response:r.Array(si)}),N9e=d({tags:["notification-silences"],url:`${ai}/:id`,params:r.Object({id:u()}),method:"GET",response:si}),L9e=d({tags:["notification-silences"],url:ai,method:"POST",body:tp,response:si}),k9e=d({tags:["notification-silences"],url:`${ai}/:id`,method:"PUT",params:r.Object({id:u()}),body:tp,response:si}),v9e=d({tags:["notification-silences"],url:`${ai}/:id`,method:"DELETE",params:r.Object({id:u()}),response:C}),M9e=d({tags:["notification-silences"],url:`${ai}/bulk-delete`,method:"DELETE",body:r.Object({ids:r.Array(u())}),response:r.Object({})});var Va=`/${"v1"}/notification-silences`,Ya=r.Pick(si,["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)."}),gH={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"]},yH={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(Ya,{examples:[gH,yH]});var fC=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:Va,method:"GET",response:r.Array(Ya)}),gC=d({description:"Retrieves one notification silence by ID when the authenticated operation key can read it. Use this before updating a mute schedule or filter.",operationId:"getNotificationSilence",tags:["notification-silences"],url:`${Va}/: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:Ya}),Jl=r.Pick(tp,["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."}),hH={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"]},TH={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(Jl,{examples:[hH,TH]});var yC=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:Va,method:"POST",body:Jl,response:Ya}),hC=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:`${Va}/: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:Jl,response:Ya}),EH=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."})}),TC=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:`${Va}/:id`,method:"DELETE",params:EH,response:C});var IH={critical:3,important:2,normal:1},ie=e=>({label:e,weight:IH[e]}),_H={"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:"log",category:"routing",impact:ie("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:"log",category:"routing",impact:ie("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:"asset",category:"routing",impact:ie("important"),recommendation:"Ensure every team manages a dedicated route scoped to its context.team value."},"service-name-present":{key:"service-name-present",title:`${Nc} present`,summary:`Logs and spans must populate ${Nc} with a non-empty value.`,rationale:"Core identifier used to correlate telemetry across services.",objectType:"resource",category:"telemetry-hygiene",impact:ie("critical"),recommendation:`Populate ${Nc} 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:ie("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:ie("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:`${Ea} presence`,summary:`Logs and spans must populate ${Ea} with a non-empty value.`,rationale:"Core identifier used to correlate telemetry across services.",objectType:"resource",category:"telemetry-hygiene",impact:ie("important"),recommendation:`Populate ${Ea} 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:ie("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:ie("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:"cost-usage",impact:ie("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:ie("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:ie("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:"asset",category:"dashboards",impact:ie("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:"asset",category:"monitors",impact:ie("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:ie("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:"cost-usage",impact:ie("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:"asset",category:"dashboards",impact:ie("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:"asset",category:"dashboards",impact:ie("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:"asset",category:"monitors",impact:ie("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:"asset",category:"monitors",impact:ie("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:"asset",category:"monitors",impact:ie("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:"asset",category:"monitors",impact:ie("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:"asset",category:"monitors",impact:ie("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:"asset",category:"dashboards",impact:ie("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:ie("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 k8sattributes 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:ie("important"),recommendation:"Enable the OpenTelemetry Collector k8sclusterreceiver (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:ie("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:ie("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:ie("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:"asset",category:"cost-usage",impact:ie("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:"asset",category:"cost-usage",impact:ie("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 ${YA} 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:ie("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"},"db-server-metrics-collected":{key:"db-server-metrics-collected",title:"Database server metrics collected",summary:"Every database technology seen in client spans should have its OpenTelemetry server-metrics receiver configured.",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:ie("important"),recommendation:"Configure the matching OpenTelemetry server-metrics receiver for each detected database technology (for example postgresqlreceiver, mysqlreceiver, mongodbreceiver, redisreceiver).",scope:"global"}},bH=new Set(["azure_container_registry","azure_container_registry_image","azure_app_service_certificate","azure_virtual_network"]),SH=Ma.filter(e=>e.startsWith("azure_")&&!bH.has(e)),EC={"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:SH,metricPrefixes:["azure_"]}},OH=Object.fromEntries(Object.keys(EC).map(e=>{let{label:t,source:n}=EC[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:ie("important"),recommendation:`Enable the ${n} metrics integration so ${t} metrics are ingested.`,scope:"global"}]})),AH={..._H,...OH},IC=Object.values(AH);var _C=["passed","failed","ignored"],xH=r.Enum(_C,{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."}),RH=["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"],td=["unrouted-logs","no-over-routed-logs","team-has-route","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","db-server-metrics-collected",...RH],CH=r.Enum(td),PH=["log","metric","resource","span","asset"],UH=["collection-coverage","telemetry-hygiene","routing","dashboards","monitors","cost-usage"],wH=["critical","important","normal"],NH=["team","global"],rd=r.Object({key:r.Enum(td),title:r.String(),summary:r.String(),rationale:r.String(),objectType:r.Enum(PH),category:r.Enum(UH),impact:r.Object({label:r.Enum(wH),weight:r.Number()}),recommendation:r.String(),scope:r.Optional(r.Enum(NH))}),bC=r.Object({type:r.String({description:"Tsuga asset kind referenced by this example (e.g. `monitor`)"}),label:r.String({description:"Human-readable summary of the example"}),link:r.Object({to:r.String({description:"In-app route the example deep-links to"}),search:r.Optional(r.Unknown({description:"Search-query payload for the deep link"})),params:r.Optional(r.Unknown({description:"Route params for the deep link"}))},{description:"In-app deep link to inspect the example"})}),ed=r.Intersect([rd,r.Object({status:xH,normalizedScore:r.Number(),details:r.Optional(r.Record(r.String(),r.Unknown())),recommendation:r.Optional(r.String()),examples:r.Optional(r.Array(bC))})]),LH=r.Object({generatedAt:r.String(),overallScore:r.Optional(r.Number()),rules:r.Array(rd),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(ed)})),globalResults:r.Optional(r.Object({score:r.Optional(r.Number()),ruleResults:r.Array(ed)}))}),nd=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(td,{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(_C,{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\u2019s 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\u2019s 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\u2019s 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(bC,{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."})),createdAt:r.String({description:"ISO timestamp the row was generated at"})}),X9e=d({tags:["quality-reports"],url:"/v0/quality-reports",method:"POST",response:LH}),od=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."})),J9e=d({tags:["quality-reports"],url:"/v0/quality-reports/latest",method:"GET",query:r.Object({clusterId:od,team:r.Optional(u({allowEmpty:!1}))}),response:r.Array(nd,{description:"Latest persisted rule evaluation rows for the cluster"})}),e3e=d({tags:["quality-reports"],url:"/v0/quality-reports/preview",method:"POST",body:r.Object({ruleKey:CH,teamId:u(),lookbackMinutes:r.Optional(r.Integer({minimum:1,maximum:60})),clusterId:r.Optional(u({allowEmpty:!1}))}),response:r.Object({rule:rd,result:ed,teamId:r.String(),teamName:r.String()})}),t3e=new Map(IC.map(e=>[e.key,e]));var kH=`/${"v1"}/quality-reports`,SC=r.Pick(nd,["id","reportId","ruleId","owner","status","score","weight","reportOverallScore","reportTotalWeight","recommendation","examples","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)."}),vH={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(SC,{examples:[vH]});var MH=r.Object({clusterId:od,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."}),OC=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:`${kH}/latest`,method:"GET",query:MH,response:r.Array(SC)});var Qa="/v0/admin-center";var cr=`${Qa}/retention-policies`,AC=3650,DH=r.Integer({description:"Number of days Tsuga retains matching telemetry."}),xC=r.Integer({minimum:1,maximum:AC,description:`Number of days Tsuga should retain matching telemetry. Valid values are 1 through ${AC}.`}),Rr=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:DH,isEnabled:r.Boolean({description:"Whether this policy participates in retention resolution."}),createdAt:E({description:"Timestamp when Tsuga created the retention policy."}),updatedAt:E({description:"Timestamp when Tsuga last updated the retention policy."})}),rp=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:xC,isEnabled:r.Boolean({description:"Set to true for the policy to participate in retention resolution."})}),RC=r.Array(r.Object({env:u(),dataSource:r.Enum(ir),durationDays:r.Union([xC,r.Null()]),isEnabled:r.Boolean()})),CC=r.Object({inserted:r.Array(Rr),updated:r.Array(Rr),deleted:r.Array(Rr)}),y3e=d({tags:["retention-policies"],url:cr,method:"POST",body:rp,response:Rr}),h3e=d({tags:["retention-policies"],url:cr,method:"GET",response:r.Array(Rr)}),T3e=d({tags:["retention-policies"],url:`${cr}/:id`,method:"GET",params:r.Object({id:u()}),response:Rr}),E3e=d({tags:["retention-policies"],url:`${cr}/:id`,method:"PUT",params:r.Object({id:u()}),body:rp,response:Rr}),I3e=d({tags:["retention-policies"],url:`${cr}/bulk-update`,method:"POST",body:RC,response:CC}),_3e=d({tags:["retention-policies"],url:`${cr}/bulk-update-for-team`,method:"POST",body:r.Object({teamId:u(),policies:RC}),response:CC}),b3e=d({tags:["retention-policies"],url:`${cr}/:id`,method:"DELETE",params:r.Object({id:u()}),response:C}),Wa=["past-24-hours","past-7-days","past-30-days"],S3e=d({tags:["retention-policies"],url:`${cr}/requested-history-percentile/:teamId`,method:"POST",params:r.Object({teamId:u()}),body:r.Object({percentile:r.Number({minimum:0,maximum:1}),observationWindow:r.Enum(Wa),dataSource:r.Enum(ir)}),response:r.Object({percentile:r.Number(),observationWindow:r.Enum(Wa),dataSource:r.Enum(ir),teamId:r.String(),requestedHistoryDays:r.Number()})}),GH=["1-day","3-days","7-days","1-month","6-months","more-than-6-months"];var $H=r.Array(r.Object({bucket:r.Enum(GH),count:r.Number()})),O3e=d({tags:["retention-policies"],url:`${cr}/requested-history-histogram/:teamId`,method:"POST",params:r.Object({teamId:u()}),body:r.Object({observationWindow:r.Enum(Wa),dataSource:r.Enum(ir)}),response:r.Object({observationWindow:r.Enum(Wa),dataSource:r.Enum(ir),teamId:r.String(),histogram:$H})}),A3e=d({tags:["retention-policies"],url:`${cr}/top-teams-with-retention-surplus`,method:"POST",body:r.Object({dataSource:r.Enum(ir),observationWindow:r.Enum(Wa),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 Za=`/${"v1"}/retention-policies`,Xa=r.Pick(Rr,["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)."}),jH={id:"123-456-abc",env:"production",teamId:"team-123-abc",dataSource:"logs",durationDays:30,isEnabled:!0};Object.assign(Xa,{examples:[jH]});var PC=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:Za,method:"GET",response:r.Array(Xa)}),UC=d({description:"Retrieves one retention policy by ID when the authenticated operation key can read it. Use this before updating duration or enabled state.",operationId:"getRetentionPolicy",tags:["retention-policies"],url:`${Za}/: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:Xa}),id=r.Pick(rp,["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."}),qH={env:"production",teamId:"team-123-abc",dataSource:"logs",durationDays:30,isEnabled:!0};Object.assign(id,{examples:[qH]});var wC=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:Za,method:"POST",body:id,response:Xa}),NC=d({description:"Replaces an existing retention policy by ID, including signal, scope fields, duration, and enabled state.",operationId:"updateRetentionPolicy",tags:["retention-policies"],url:`${Za}/: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:id,response:Xa}),LC=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:`${Za}/: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:C});var FH=15,np={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:ke,updatedAt:r.Optional(E({description:"Timestamp when Tsuga last updated the processor."}))},op={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:Ve,updatedAt:r.Optional(E({description:"Backend-maintained timestamp for this processor. Omit this field on create and update requests; Tsuga sets or preserves it based on processor changes."}))},BH={...np,type:r.Literal("creator",{description:"Create processor. It writes a new attribute from a format string, formula, or category rule."})},HH={...op,type:r.Literal("creator",{description:"Create processor. It writes a new attribute from a format string, formula, or category rule."})},KH=b("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"})]),zH=b("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."}))},{$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"),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:FH,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")},{$id:"InputProcessorParamsCreatorCategory"})]),VH=r.Object({...BH,params:KH}),YH=r.Object({...HH,params:zH}),QH={...np,type:r.Literal("mapper",{description:"Map processor. It moves, copies, or normalizes existing log attributes."})},WH={...op,type:r.Literal("mapper",{description:"Map processor. It moves, copies, or normalizes existing log attributes."})},ZH=b("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"})]),XH=b("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")},{$id:"InputProcessorParamsMapperMapAttributes"}),r.Object({attributeName:u({allowEmpty:!1,description:"Attribute whose value will determine the log level"}),subtype:r.Literal("map-level")},{$id:"InputProcessorParamsMapperMapLevel"}),r.Object({attributeName:u({allowEmpty:!1,description:"Attribute whose value will determine the log timestamp"}),subtype:r.Literal("map-timestamp")},{$id:"InputProcessorParamsMapperMapTimestamp"})]),JH=r.Object({...WH,params:XH}),e2=r.Object({...QH,params:ZH}),t2={...np,type:r.Literal("parse-attribute",{description:"Parse processor. It extracts structured fields from a text attribute."})},r2={...op,type:r.Literal("parse-attribute",{description:"Parse processor. It extracts structured fields from a text attribute."})},n2=5,o2=b("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."})})]),i2=b("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:n2,description:"Example log lines for validating the Grok rules. Samples are not sent to the ingestion engine."})),subtype:r.Literal("grok")}),r.Object({sourceAttribute:u({allowEmpty:!1,description:"Attribute containing the URL to parse"}),subtype:r.Literal("url")}),r.Object({sourceAttribute:u({allowEmpty:!1,description:"Attribute containing the user agent string to parse"}),subtype:r.Literal("user-agent")}),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."})})]),a2=r.Object({...t2,params:o2}),s2=r.Object({...r2,params:i2}),c2=11,kC=r.Cyclic({OutputProcessor:r.Union([e2,a2,VH,r.Object({...np,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"}),vC=r.Cyclic({InputProcessor:r.Union([JH,s2,YH,r.Object({...op,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:c2,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 p2="/v0/logs",un=`${p2}/routes`,Qn=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:ke,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(kC,{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(ue),updater:r.Optional(ue),updatedAt:E({description:"Timestamp when Tsuga last updated the route."}),createdAt:E({description:"Timestamp when Tsuga created the route."}),assetUpdatedAt:E({description:"Timestamp when Tsuga last changed route behavior. This can differ from `updatedAt` when only metadata such as `description` or `tags` changed."})},{title:"Route"}),Ja=r.Object({name:u({allowEmpty:!1,description:"Human-readable route name shown in Tsuga."}),description:r.Optional(u({type:"long",description:"Optional free-text note about the route's purpose. This metadata is not evaluated when matching or processing logs."})),isEnabled:r.Boolean({description:"Set to true for the 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 route processor chain."}),tags:Ve,owner:u({allowEmpty:!1,description:"ID of the team that will own the 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 route."}),processors:r.Array(vC,{maxItems:50,description:"Processors applied in array order to logs that match the 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."})}),z3e=d({tags:["routes"],url:un,method:"GET",paginated:!0,query:r.Object(Q),response:r.Array(Qn)}),V3e=d({tags:["routes"],url:`${un}/:id`,params:r.Object({id:u()}),method:"GET",response:Qn}),Y3e=d({tags:["routes"],url:un,method:"POST",body:Ja,response:Qn}),Q3e=d({tags:["routes"],url:`${un}/:id`,method:"PUT",body:Ja,params:r.Object({id:u()}),response:Qn}),W3e=d({tags:["routes"],url:`${un}/:id/clone`,method:"POST",params:r.Object({id:u()}),body:Ja,response:Qn}),Z3e=d({tags:["routes"],url:`${un}/:id`,method:"DELETE",params:r.Object({id:u()}),response:C}),X3e=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:`${un}/: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({})}),J3e=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:`${un}/: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:r.Object({})});var es=`/${"v1"}/routes`,MC={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}"]}}]},DC={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}}]},ts=r.Pick(Qn,["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)."}),u2={id:"123-456-abc",...MC},m2={id:"456-789-def",...DC};Object.assign(ts,{examples:[u2,m2]});var GC=d({description:"Lists log routes visible to the authenticated public API caller. 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:es,method:"GET",paginated:!0,query:r.Object(Q),response:r.Array(ts)}),$C=d({description:"Retrieves one log route by ID when the authenticated public API caller can read it. Use this before updating processors or route metadata.",operationId:"getRoute",tags:["routes"],url:`${es}/: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:ts}),ad=r.Pick(Ja,["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."}),l2=MC,d2=DC;Object.assign(ad,{examples:[l2,d2]});var jC=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:es,method:"POST",body:ad,response:ts}),qC=d({description:"Updates an existing log route by ID without changing its evaluation order. Required fields and submitted processors are overwritten; omitted optional fields keep their existing values. Routes affect only newly ingested logs after the cluster receives the updated configuration.",operationId:"updateRoute",tags:["routes"],url:`${es}/:id`,method:"PUT",body:ad,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:ts}),FC=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:`${es}/: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:C});var rs=`/${"v1"}/slos`,f2=r.Pick(Ul,["id","sloId","priority","configuration"],{$id:"SloAlert",description:"Alert attached to an SLO, triggered on a burn-rate multiplier or an SLO target threshold"}),ns=r.Object({...r.Pick(Ho,["id","name","description","tags","configuration","target","timeframeDays","owner","permissions","clusterIds"]).properties,alerts:r.Array(f2,{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"}),g2={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(ns,{examples:[g2]});var BC=r.Pick(Nl,["filters","sort","limit","offset"]),HC=r.Object({...BC.properties,filters:BC.properties.filters},{description:"SLO query request. Use filters, sorting, limit, and offset to page through visible SLOs."}),y2={filters:{owners:{values:["team-123-abc"]},searchQuery:{value:"availability"},tags:{values:[{key:"team",value:"platform"}]},statuses:{values:["breached"]}},sort:{by:"name",direction:"asc"},limit:10,offset:0};Object.assign(HC,{examples:[y2]});var KC=d({description:"Queries SLOs visible to the authenticated public API caller. Use this endpoint to inventory SLO definitions, filter by owner, tag, status, or cluster, and page through results.",operationId:"querySlos",tags:["slos"],url:`${rs}/query`,method:"POST",paginated:!0,body:HC,response:r.Array(ns)}),zC=d({description:"Retrieves one SLO definition by ID when the authenticated public API caller can read it. Use this before updating or auditing an SLO.",operationId:"getSlo",tags:["slos"],url:`${rs}/:id`,method:"GET",params:r.Object({id:u({allowEmpty:!1,description:"SLO ID returned by SLO query, create, or update operations."})}),response:ns}),VC=["name","description","tags","configuration","target","timeframeDays","owner","permissions","clusterIds","alerts"],YC=r.Pick(Gc,VC,{$id:"CreateSloRequest",description:"SLO creation request. Provide ownership, data access, SLI configuration, target, timeframe, optional cluster scope, and the alerts to create."}),QC=r.Pick(wl,VC,{$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."}),WC={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(YC,{examples:[WC]});Object.assign(QC,{examples:[WC]});var ZC=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:rs,method:"POST",body:YC,response:ns}),XC=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:`${rs}/: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:QC,response:ns}),JC=d({description:"Deletes an SLO by ID. Deleting an SLO stops future evaluations and removes its attached alerts.",operationId:"deleteSlo",tags:["slos"],url:`${rs}/: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:C});var Wn=`${Qa}/tag-policies`;var h2=["logs","metrics","traces"],sd=r.Array(r.Enum(h2,{description:"Telemetry signal covered by a data tag policy."}),{description:"Telemetry signals covered by the policy. An empty array means logs, metrics, and traces."}),T2=r.Union([lc,sd]),E2=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."}),I2=b("type",[r.Object({type:r.Literal("telemetry",{description:"Policy applies to telemetry data points during ingestion or evaluation."}),assetTypes:sd,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:lc},{title:"TsugaAssetTagPolicy"})]),_2=b("type",[r.Object({type:r.Literal("telemetry",{description:"Policy applies to telemetry data points during ingestion or evaluation."}),assetTypes:sd,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:lc},{title:"TsugaAssetTagPolicy"})]),eP="Policy surface and enforcement behavior. Use `telemetry` for telemetry data or `tsuga_asset` for Tsuga-managed resources.",b2=r.Unsafe({...I2,description:eP}),S2=r.Unsafe({..._2,description:eP}),ci=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(E2),configuration:b2,creator:r.Optional(ue),updater:r.Optional(ue),owner:r.Optional(r.String({description:"Team ID that owns and manages the policy."})),createdAt:E({description:"Timestamp when Tsuga created the tag policy."}),updatedAt:E({description:"Timestamp when Tsuga last updated the tag policy."}),assetUpdatedAt:E({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})});var os=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:S2,owner:u({allowEmpty:!1,description:"Team ID that will own and manage the policy."})}),b4e=d({tags:["tag-policies"],url:Wn,method:"GET",query:r.Object({teamIds:r.Optional(r.Array(u(),{maxItems:100})),assetTypes:r.Optional(T2),searchQuery:r.Optional(u())}),response:r.Array(ci)}),S4e=d({tags:["tag-policies"],url:`${Wn}/:id`,method:"GET",params:r.Object({id:u()}),response:ci}),O4e=d({tags:["tag-policies"],url:Wn,method:"POST",body:os,response:ci}),A4e=d({tags:["tag-policies"],url:`${Wn}/:id`,method:"PUT",params:r.Object({id:u()}),body:os,response:ci}),x4e=d({tags:["tag-policies"],url:`${Wn}/:id`,method:"DELETE",params:r.Object({id:u()}),response:C}),R4e=d({tags:["tag-policies"],url:`${Qa}/applicable-tag-rules`,method:"GET",query:r.Object({assetType:r.Enum(Xi),teamId:u()}),response:r.Array(r.Object({tagKey:r.String(),allowedTagValues:r.Array(r.String()),isRequired:r.Boolean(),tagPolicyId:r.String()}))}),tP=r.Object({total:r.Number(),totalNonCompliant:r.Number(),idsNonCompliant:r.Array(r.String())}),rP=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("monitor"),r.Literal("notification-rule"),r.Literal("notification-silence"),r.Literal("slo")]),O2=r.Object({total:r.Number(),totalNonCompliant:r.Number(),byAssetType:r.Record(rP,tP)}),A2=r.Omit(tP,["total"]),x2=r.Object({totalNonCompliant:r.Number(),byAssetType:r.Record(rP,A2)}),nP=r.Object({totals:O2,byTeam:r.Record(r.String(),x2)}),C4e=d({tags:["tag-policies"],url:`${Wn}/:id/stats`,method:"GET",params:r.Object({id:u()}),response:nP}),P4e=d({tags:["tag-policies"],url:`${Wn}/new-policy-stats`,method:"POST",body:os,response:nP});var is=`/${"v1"}/tag-policies`,oP={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"},iP={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"},R2={id:"123-456-abc",...oP},C2={id:"456-789-def",...iP},as=r.Pick(ci,["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)."}),P2=R2,U2=C2;Object.assign(as,{examples:[P2,U2]});var cd=r.Pick(os,["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."}),w2=oP,N2=iP;Object.assign(cd,{examples:[w2,N2]});var aP=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:is,method:"GET",response:r.Array(as)}),sP=d({description:"Retrieves one tag policy by ID when the authenticated operation key can read it. Use this before updating policy scope or enforcement settings.",operationId:"getTagPolicy",tags:["tag-policies"],url:`${is}/: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:as}),cP=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:is,method:"POST",body:cd,response:as}),pP=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:`${is}/: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:cd,response:as}),uP=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:`${is}/: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:C});var ss=`/${"v1"}/teams`,cs=r.Pick(Fo,["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)."}),L2={id:"team-123-abc",name:"platform-engineering",visibility:"public",tags:[{key:"department",value:"engineering"}]};Object.assign(cs,{examples:[L2]});var mP=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:ss,method:"GET",paginated:!0,query:r.Object(Q),response:r.Array(cs)}),lP=d({description:"Retrieves one team by ID when the authenticated operation key can read it. Use this to resolve ownership metadata before creating or updating team-owned resources.",operationId:"getTeam",tags:["teams"],url:`${ss}/: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:cs}),pd=r.Pick(vc,["name","description","visibility","tags"],{description:"Team create or update request. Provide the team name, optional description, visibility, and tags."}),k2={name:"platform-engineering",visibility:"public",tags:[{key:"department",value:"engineering"}]};Object.assign(pd,{examples:[k2]});var dP=d({description:"Creates a team for ownership and access control. Use this before assigning resources to a new owner team.",operationId:"createTeam",tags:["teams"],url:ss,method:"POST",body:pd,response:cs}),fP=d({description:"Replaces a team definition by ID, including name, description, visibility, and tags.",operationId:"updateTeam",tags:["teams"],url:`${ss}/: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:pd,response:cs}),gP=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:`${ss}/: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:C});function ud(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 yP(e,t,n){let o=e.command(t.commandName).description(t.description),i=HA(t.commandName).replace(/-/g," "),a=o.command("list").description(`List all ${t.commandName}`);if(t.listOptions)for(let c of t.listOptions)a.option(c.flag,c.description);if(t.enableListBody?a.option("-d, --data <json>","Inline JSON body").option("--generate-skeleton","Print a JSON skeleton for the request body and exit").action(async c=>{if(c.generateSkeleton){re(qo(t.endpoints.list));return}let m=await n()(t.endpoints.list,{body:c.data?Lo({data:c.data}):{}});re(m)}):a.action(async c=>{let m={};if(t.listOptions)for(let f of t.listOptions){let y=c[f.queryParam];y!==void 0&&(m[f.queryParam]=y)}let l=await n()(t.endpoints.list,Object.keys(m).length>0?{query:m}:void 0);re(l)}),t.endpoints.get){let c=t.endpoints.get,m=ud(c);o.command("get <id>").description(`Get a ${i} by ID`).action(async l=>{let f=await n()(c,{params:{[m]:l}});re(f)})}if(t.endpoints.create){let c=t.endpoints.create;o.command("create").description(`Create a new ${i}`).option("-f, --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 m=>{if(m.generateSkeleton){re(qo(c));return}let l=Lo(m),f=await n()(c,{body:l});re(f)})}if(t.endpoints.update){let c=t.endpoints.update,m=ud(c);o.command("update <id>").description(`Update a ${i} by ID`).option("-f, --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(l,f)=>{if(f.generateSkeleton){re(qo(c));return}let y=Lo(f),T=await n()(c,{params:{[m]:l},body:y});re(T)})}if(t.endpoints.delete){let c=t.endpoints.delete,m=ud(c);o.command("delete <id>").description(`Delete a ${i} by ID`).action(async l=>{let f=await n()(c,{params:{[m]:l}});re(f)})}}var v2=[{commandName:"cloud-resources",description:"List cloud resources discovered by inventory scans",endpoints:{list:kR}},{commandName:"dashboards",description:"Manage dashboards",endpoints:{list:dR,get:fR,create:gR,update:yR,delete:hR},enableListBody:!0},{commandName:"ingestion-api-keys",description:"Manage ingestion API keys",endpoints:{list:OR,create:AR,update:xR,delete:RR}},{commandName:"investigations",description:"Manage investigations (beta)",endpoints:{list:MR,get:DR,create:GR,update:$R,delete:jR}},{commandName:"monitors",description:"Manage monitors",endpoints:{list:VR,get:YR,create:rC,update:nC,delete:oC},enableListBody:!0},{commandName:"notification-rules",description:"Manage notification rules",endpoints:{list:aC,get:sC,create:cC,update:pC,delete:uC}},{commandName:"notification-silences",description:"Manage notification silences",endpoints:{list:fC,get:gC,create:yC,update:hC,delete:TC}},{commandName:"quality-reports",description:"Get the latest quality report rows for a cluster (pass --cluster <id> when the org has more than one cluster)",endpoints:{list:OC},listOptions:[{flag:"--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:PC,get:UC,create:wC,update:NC,delete:LC}},{commandName:"routes",description:"Manage routes",endpoints:{list:GC,get:$C,create:jC,update:qC,delete:FC}},{commandName:"services",description:"Manage services",endpoints:{list:jx,get:qx}},{commandName:"slos",description:"Manage SLOs",endpoints:{list:KC,get:zC,create:ZC,update:XC,delete:JC},enableListBody:!0},{commandName:"tag-policies",description:"Manage tag policies",endpoints:{list:aP,get:sP,create:cP,update:pP,delete:uP}},{commandName:"teams",description:"Manage teams",endpoints:{list:mP,get:lP,create:dP,update:fP,delete:gP}}];function hP(e,t){for(let n of v2)yP(e,n,t)}var TP=require("node:child_process");var ip="@tsuga/cli@latest";function M2(){q(`Updating ${ip}`),q(` $ npm install -g ${ip}`);try{(0,TP.execFileSync)("npm",["install","-g",ip],{stdio:["ignore","inherit","inherit"]})}catch(e){let t=e.status??1;throw new Error(`npm install -g ${ip} exited ${t}`,{cause:e})}q("Updated. Run `tsuga --version` to confirm the new version.")}function EP(e){e.command("self-update").description("Update the Tsuga CLI to the latest version via npm").action(()=>{M2()})}var hd=require("node:fs"),yd=require("node:os"),ui=require("node:path");function D2(e,t){let n=e.slice(0,t).split(/\r\n|\n|\r/g);return[n.length,n.pop().length+1]}function G2(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 m=o[c-1];m&&(i+=c.toString().padEnd(a," "),i+=": ",i+=m,i+=`
131
+ `,c===t&&(i+=" ".repeat(a+n+2),i+=`^
132
+ `))}return i}var z=class extends Error{line;column;codeblock;constructor(t,n){let[o,i]=D2(n.toml,n.ptr),a=G2(n.toml,o,i);super(`Invalid TOML document: ${t}
47
133
 
48
- ${a}`,r),this.line=o,this.column=i,this.codeblock=a}};function bB(e,t){let r=0;for(;e[t-++r]==="\\";);return--r&&r%2}function Cc(e,t=0,r=e.length){let o=e.indexOf(`
49
- `,t);return e[o-1]==="\r"&&o--,o<=r?o:-1}function Ko(e,t){for(let r=t;r<e.length;r++){let o=e[r];if(o===`
50
- `)return r;if(o==="\r"&&e[r+1]===`
51
- `)return r+1;if(o<" "&&o!==" "||o==="\x7F")throw new K("control characters are not allowed in comments",{toml:e,ptr:t})}return e.length}function Ct(e,t,r,o){let i;for(;;){for(;(i=e[t])===" "||i===" "||!r&&(i===`
134
+ ${a}`,n),this.line=o,this.column=i,this.codeblock=a}};function $2(e,t){let n=0;for(;e[t-++n]==="\\";);return--n&&n%2}function ap(e,t=0,n=e.length){let o=e.indexOf(`
135
+ `,t);return e[o-1]==="\r"&&o--,o<=n?o:-1}function pi(e,t){for(let n=t;n<e.length;n++){let o=e[n];if(o===`
136
+ `)return n;if(o==="\r"&&e[n+1]===`
137
+ `)return n+1;if(o<" "&&o!==" "||o==="\x7F")throw new z("control characters are not allowed in comments",{toml:e,ptr:t})}return e.length}function Nt(e,t,n,o){let i;for(;;){for(;(i=e[t])===" "||i===" "||!n&&(i===`
52
138
  `||i==="\r"&&e[t+1]===`
53
- `);)t++;if(o||i!=="#")break;t=Ko(e,t)}return t}function vR(e,t,r,o,i=!1){if(!o)return t=Cc(e,t),t<0?e.length:t;for(let a=t;a<e.length;a++){let c=e[a];if(c==="#")a=Cc(e,a);else{if(c===r)return a+1;if(c===o||i&&(c===`
139
+ `);)t++;if(o||i!=="#")break;t=pi(e,t)}return t}function IP(e,t,n,o,i=!1){if(!o)return t=ap(e,t),t<0?e.length:t;for(let a=t;a<e.length;a++){let c=e[a];if(c==="#")a=ap(e,a);else{if(c===n)return a+1;if(c===o||i&&(c===`
54
140
  `||c==="\r"&&e[a+1]===`
55
- `))return a}}throw new K("cannot find end of structure",{toml:e,ptr:t})}function Pc(e,t){let r=e[t],o=r===e[t+1]&&e[t+1]===e[t+2]?e.slice(t,t+3):r;t+=o.length-1;do t=e.indexOf(o,++t);while(t>-1&&r!=="'"&&bB(e,t));return t>-1&&(t+=o.length,o.length>1&&(e[t]===r&&t++,e[t]===r&&t++)),t}var AB=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i,La=class e extends Date{#t=!1;#r=!1;#e=null;constructor(t){let r=!0,o=!0,i="Z";if(typeof t=="string"){let a=t.match(AB);a?(a[1]||(r=!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=r,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 r=+this.#e.slice(1,3)*60+ +this.#e.slice(4,6);return r=this.#e[0]==="-"?r:-r,new Date(this.getTime()-r*6e4).toISOString().slice(0,-1)+this.#e}static wrapAsOffsetDateTime(t,r="Z"){let o=new e(t);return o.#e=r,o}static wrapAsLocalDateTime(t){let r=new e(t);return r.#e=null,r}static wrapAsLocalDate(t){let r=new e(t);return r.#r=!1,r.#e=null,r}static wrapAsLocalTime(t){let r=new e(t);return r.#t=!1,r.#e=null,r}};var OB=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,SB=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,xB=/^[+-]?0[0-9_]/,RB=/^[0-9a-f]{2,8}$/i,DR={b:"\b",t:" ",n:`
56
- `,f:"\f",r:"\r",e:"\x1B",'"':'"',"\\":"\\"};function Uc(e,t=0,r=e.length){let o=e[t]==="'",i=e[t++]===e[t]&&e[t]===e[t+1];i&&(r-=2,e[t+=2]==="\r"&&t++,e[t]===`
57
- `&&t++);let a=0,c,u="",l=t;for(;t<r-1;){let f=e[t++];if(f===`
141
+ `))return a}}throw new z("cannot find end of structure",{toml:e,ptr:t})}function sp(e,t){let n=e[t],o=n===e[t+1]&&e[t+1]===e[t+2]?e.slice(t,t+3):n;t+=o.length-1;do t=e.indexOf(o,++t);while(t>-1&&n!=="'"&&$2(e,t));return t>-1&&(t+=o.length,o.length>1&&(e[t]===n&&t++,e[t]===n&&t++)),t}var j2=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i,ps=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(j2);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}};var q2=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,F2=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,B2=/^[+-]?0[0-9_]/,H2=/^[0-9a-f]{2,8}$/i,_P={b:"\b",t:" ",n:`
142
+ `,f:"\f",r:"\r",e:"\x1B",'"':'"',"\\":"\\"};function cp(e,t=0,n=e.length){let o=e[t]==="'",i=e[t++]===e[t]&&e[t]===e[t+1];i&&(n-=2,e[t+=2]==="\r"&&t++,e[t]===`
143
+ `&&t++);let a=0,c,m="",l=t;for(;t<n-1;){let f=e[t++];if(f===`
58
144
  `||f==="\r"&&e[t]===`
59
- `){if(!i)throw new K("newlines are not allowed in strings",{toml:e,ptr:t-1})}else if(f<" "&&f!==" "||f==="\x7F")throw new K("control characters are not allowed in strings",{toml:e,ptr:t-1});if(c){if(c=!1,f==="x"||f==="u"||f==="U"){let y=e.slice(t,t+=f==="x"?2:f==="u"?4:8);if(!RB.test(y))throw new K("invalid unicode escape",{toml:e,ptr:a});try{u+=String.fromCodePoint(parseInt(y,16))}catch{throw new K("invalid unicode escape",{toml:e,ptr:a})}}else if(i&&(f===`
60
- `||f===" "||f===" "||f==="\r")){if(t=Ct(e,t-1,!0),e[t]!==`
61
- `&&e[t]!=="\r")throw new K("invalid escape: only line-ending whitespace may be escaped",{toml:e,ptr:a});t=Ct(e,t)}else if(f in DR)u+=DR[f];else throw new K("unrecognized escape sequence",{toml:e,ptr:a});l=t}else!o&&f==="\\"&&(a=t-1,c=!0,u+=e.slice(l,a))}return u+e.slice(l,r-1)}function $R(e,t,r,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=OB.test(e);if(i||SB.test(e)){if(xB.test(e))throw new K("leading zeroes are not allowed",{toml:t,ptr:r});e=e.replace(/_/g,"");let c=+e;if(isNaN(c))throw new K("invalid number",{toml:t,ptr:r});if(i){if((i=!Number.isSafeInteger(c))&&!o)throw new K("integer value cannot be represented losslessly",{toml:t,ptr:r});(i||o===!0)&&(c=BigInt(e))}return c}let a=new La(e);if(!a.isValid())throw new K("invalid value",{toml:t,ptr:r});return a}function CB(e,t,r){let o=e.slice(t,r),i=o.indexOf("#");return i>-1&&(Ko(e,i),o=o.slice(0,i)),[o.trimEnd(),i]}function Ma(e,t,r,o,i){if(o===0)throw new K("document contains excessively nested structures. aborting.",{toml:e,ptr:t});let a=e[t];if(a==="["||a==="{"){let[l,f]=a==="["?jR(e,t,o,i):GR(e,t,o,i);if(r){if(f=Ct(e,f),e[f]===",")f++;else if(e[f]!==r)throw new K("expected comma or end of structure",{toml:e,ptr:f})}return[l,f]}let c;if(a==='"'||a==="'"){c=Pc(e,t);let l=Uc(e,t,c);if(r){if(c=Ct(e,c),e[c]&&e[c]!==","&&e[c]!==r&&e[c]!==`
62
- `&&e[c]!=="\r")throw new K("unexpected character encountered",{toml:e,ptr:c});c+=+(e[c]===",")}return[l,c]}c=vR(e,t,",",r);let u=CB(e,t,c-+(e[c-1]===","));if(!u[0])throw new K("incomplete key-value declaration: no value specified",{toml:e,ptr:t});return r&&u[1]>-1&&(c=Ct(e,t+u[1]),c+=+(e[c]===",")),[$R(u[0],e,t,i),c]}var PB=/^[a-zA-Z0-9-_]+[ \t]*$/;function Nc(e,t,r="="){let o=t-1,i=[],a=e.indexOf(r,t);if(a<0)throw new K("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 K("multiline strings are not allowed in keys",{toml:e,ptr:t});let u=Pc(e,t);if(u<0)throw new K("unfinished string encountered",{toml:e,ptr:t});o=e.indexOf(".",u);let l=e.slice(u,o<0||o>a?a:o),f=Cc(l);if(f>-1)throw new K("newlines are not allowed in keys",{toml:e,ptr:t+o+f});if(l.trimStart())throw new K("found extra tokens after the string part",{toml:e,ptr:u});if(a<u&&(a=e.indexOf(r,u),a<0))throw new K("incomplete key-value: cannot find end of key",{toml:e,ptr:t});i.push(Uc(e,t,u))}else{o=e.indexOf(".",t);let u=e.slice(t,o<0||o>a?a:o);if(!PB.test(u))throw new K("only letter, numbers, dashes and underscores are allowed in keys",{toml:e,ptr:t});i.push(u.trimEnd())}}while(o+1&&o<a);return[i,Ct(e,a+1,!0,!0)]}function GR(e,t,r,o){let i={},a=new Set,c;for(t++;(c=e[t++])!=="}"&&c;){if(c===",")throw new K("expected value, found comma",{toml:e,ptr:t-1});if(c==="#")t=Ko(e,t);else if(c!==" "&&c!==" "&&c!==`
63
- `&&c!=="\r"){let u,l=i,f=!1,[y,E]=Nc(e,t-1);for(let Re=0;Re<y.length;Re++){if(Re&&(l=f?l[u]:l[u]={}),u=y[Re],(f=Object.hasOwn(l,u))&&(typeof l[u]!="object"||a.has(l[u])))throw new K("trying to redefine an already defined value",{toml:e,ptr:t});!f&&u==="__proto__"&&Object.defineProperty(l,u,{enumerable:!0,configurable:!0,writable:!0})}if(f)throw new K("trying to redefine an already defined value",{toml:e,ptr:t});let[S,fe]=Ma(e,E,"}",r-1,o);a.add(S),l[u]=S,t=fe}}if(!c)throw new K("unfinished table encountered",{toml:e,ptr:t});return[i,t]}function jR(e,t,r,o){let i=[],a;for(t++;(a=e[t++])!=="]"&&a;){if(a===",")throw new K("expected value, found comma",{toml:e,ptr:t-1});if(a==="#")t=Ko(e,t);else if(a!==" "&&a!==" "&&a!==`
64
- `&&a!=="\r"){let c=Ma(e,t-1,"]",r-1,o);i.push(c[0]),t=c[1]}}if(!a)throw new K("unfinished array encountered",{toml:e,ptr:t});return[i,t]}function FR(e,t,r,o){let i=t,a=r,c,u=!1,l;for(let f=0;f<e.length;f++){if(f){if(i=u?i[c]:i[c]={},a=(l=a[c]).c,o===0&&(l.t===1||l.t===2))return null;if(l.t===2){let y=i.length-1;i=i[y],a=a[y].c}}if(c=e[f],(u=Object.hasOwn(i,c))&&a[c]?.t===0&&a[c]?.d)return null;u||(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(l=a[c],l.t!==o&&!(o===1&&l.t===3)||(o===2&&(l.d||(l.d=!0,i[c]=[]),i[c].push(i={}),l.c[l.i++]=l={t:1,d:!1,i:0,c:{}}),l.d))return null;if(l.d=!0,o===1)i=u?i[c]:i[c]={};else if(o===0&&u)return null;return[c,i,l.c]}function Tl(e,{maxDepth:t=1e3,integersAsBigInt:r}={}){let o={},i={},a=o,c=i;for(let u=Ct(e,0);u<e.length;){if(e[u]==="["){let l=e[++u]==="[",f=Nc(e,u+=+l,"]");if(l){if(e[f[1]-1]!=="]")throw new K("expected end of table declaration",{toml:e,ptr:f[1]-1});f[1]++}let y=FR(f[0],o,i,l?2:1);if(!y)throw new K("trying to redefine an already defined table or value",{toml:e,ptr:u});c=y[2],a=y[1],u=f[1]}else{let l=Nc(e,u),f=FR(l[0],a,c,0);if(!f)throw new K("trying to redefine an already defined table or value",{toml:e,ptr:u});let y=Ma(e,l[1],void 0,t,r);f[1][f[0]]=y[0],u=y[1]}if(u=Ct(e,u,!0),e[u]&&e[u]!==`
65
- `&&e[u]!=="\r")throw new K("each key-value declaration must be followed by an end-of-line",{toml:e,ptr:u});u=Ct(e,u)}return o}var BR=/^[a-z0-9-_]+$/i;function va(e){let t=typeof e;if(t==="object"){if(Array.isArray(e))return"array";if(e instanceof Date)return"date"}return t}function UB(e){for(let t=0;t<e.length;t++)if(va(e[t])!=="object")return!1;return e.length!=0}function Il(e){return JSON.stringify(e).replace(/\x7f/g,"\\u007f")}function _l(e,t,r,o){if(r===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":o&&Number.isInteger(e)?e.toFixed(1):e.toString();if(t==="bigint"||t==="boolean")return e.toString();if(t==="string")return Il(e);if(t==="date"){if(isNaN(e.getTime()))throw new TypeError("cannot serialize invalid date");return e.toISOString()}if(t==="object")return NB(e,r,o);if(t==="array")return kB(e,r,o)}function NB(e,t,r){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+=BR.test(c)?c:Il(c),i+=" = ",i+=_l(e[c],va(e[c]),t-1,r)}return i+" }"}function kB(e,t,r){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+=_l(e[i],va(e[i]),t-1,r)}return o+" ]"}function wB(e,t,r,o){if(r===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&&`
145
+ `){if(!i)throw new z("newlines are not allowed in strings",{toml:e,ptr:t-1})}else if(f<" "&&f!==" "||f==="\x7F")throw new z("control characters are not allowed in strings",{toml:e,ptr:t-1});if(c){if(c=!1,f==="x"||f==="u"||f==="U"){let y=e.slice(t,t+=f==="x"?2:f==="u"?4:8);if(!H2.test(y))throw new z("invalid unicode escape",{toml:e,ptr:a});try{m+=String.fromCodePoint(parseInt(y,16))}catch{throw new z("invalid unicode escape",{toml:e,ptr:a})}}else if(i&&(f===`
146
+ `||f===" "||f===" "||f==="\r")){if(t=Nt(e,t-1,!0),e[t]!==`
147
+ `&&e[t]!=="\r")throw new z("invalid escape: only line-ending whitespace may be escaped",{toml:e,ptr:a});t=Nt(e,t)}else if(f in _P)m+=_P[f];else throw new z("unrecognized escape sequence",{toml:e,ptr:a});l=t}else!o&&f==="\\"&&(a=t-1,c=!0,m+=e.slice(l,a))}return m+e.slice(l,n-1)}function bP(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=q2.test(e);if(i||F2.test(e)){if(B2.test(e))throw new z("leading zeroes are not allowed",{toml:t,ptr:n});e=e.replace(/_/g,"");let c=+e;if(isNaN(c))throw new z("invalid number",{toml:t,ptr:n});if(i){if((i=!Number.isSafeInteger(c))&&!o)throw new z("integer value cannot be represented losslessly",{toml:t,ptr:n});(i||o===!0)&&(c=BigInt(e))}return c}let a=new ps(e);if(!a.isValid())throw new z("invalid value",{toml:t,ptr:n});return a}function K2(e,t,n){let o=e.slice(t,n),i=o.indexOf("#");return i>-1&&(pi(e,i),o=o.slice(0,i)),[o.trimEnd(),i]}function us(e,t,n,o,i){if(o===0)throw new z("document contains excessively nested structures. aborting.",{toml:e,ptr:t});let a=e[t];if(a==="["||a==="{"){let[l,f]=a==="["?OP(e,t,o,i):SP(e,t,o,i);if(n){if(f=Nt(e,f),e[f]===",")f++;else if(e[f]!==n)throw new z("expected comma or end of structure",{toml:e,ptr:f})}return[l,f]}let c;if(a==='"'||a==="'"){c=sp(e,t);let l=cp(e,t,c);if(n){if(c=Nt(e,c),e[c]&&e[c]!==","&&e[c]!==n&&e[c]!==`
148
+ `&&e[c]!=="\r")throw new z("unexpected character encountered",{toml:e,ptr:c});c+=+(e[c]===",")}return[l,c]}c=IP(e,t,",",n);let m=K2(e,t,c-+(e[c-1]===","));if(!m[0])throw new z("incomplete key-value declaration: no value specified",{toml:e,ptr:t});return n&&m[1]>-1&&(c=Nt(e,t+m[1]),c+=+(e[c]===",")),[bP(m[0],e,t,i),c]}var z2=/^[a-zA-Z0-9-_]+[ \t]*$/;function pp(e,t,n="="){let o=t-1,i=[],a=e.indexOf(n,t);if(a<0)throw new z("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 z("multiline strings are not allowed in keys",{toml:e,ptr:t});let m=sp(e,t);if(m<0)throw new z("unfinished string encountered",{toml:e,ptr:t});o=e.indexOf(".",m);let l=e.slice(m,o<0||o>a?a:o),f=ap(l);if(f>-1)throw new z("newlines are not allowed in keys",{toml:e,ptr:t+o+f});if(l.trimStart())throw new z("found extra tokens after the string part",{toml:e,ptr:m});if(a<m&&(a=e.indexOf(n,m),a<0))throw new z("incomplete key-value: cannot find end of key",{toml:e,ptr:t});i.push(cp(e,t,m))}else{o=e.indexOf(".",t);let m=e.slice(t,o<0||o>a?a:o);if(!z2.test(m))throw new z("only letter, numbers, dashes and underscores are allowed in keys",{toml:e,ptr:t});i.push(m.trimEnd())}}while(o+1&&o<a);return[i,Nt(e,a+1,!0,!0)]}function SP(e,t,n,o){let i={},a=new Set,c;for(t++;(c=e[t++])!=="}"&&c;){if(c===",")throw new z("expected value, found comma",{toml:e,ptr:t-1});if(c==="#")t=pi(e,t);else if(c!==" "&&c!==" "&&c!==`
149
+ `&&c!=="\r"){let m,l=i,f=!1,[y,T]=pp(e,t-1);for(let Ue=0;Ue<y.length;Ue++){if(Ue&&(l=f?l[m]:l[m]={}),m=y[Ue],(f=Object.hasOwn(l,m))&&(typeof l[m]!="object"||a.has(l[m])))throw new z("trying to redefine an already defined value",{toml:e,ptr:t});!f&&m==="__proto__"&&Object.defineProperty(l,m,{enumerable:!0,configurable:!0,writable:!0})}if(f)throw new z("trying to redefine an already defined value",{toml:e,ptr:t});let[A,ye]=us(e,T,"}",n-1,o);a.add(A),l[m]=A,t=ye}}if(!c)throw new z("unfinished table encountered",{toml:e,ptr:t});return[i,t]}function OP(e,t,n,o){let i=[],a;for(t++;(a=e[t++])!=="]"&&a;){if(a===",")throw new z("expected value, found comma",{toml:e,ptr:t-1});if(a==="#")t=pi(e,t);else if(a!==" "&&a!==" "&&a!==`
150
+ `&&a!=="\r"){let c=us(e,t-1,"]",n-1,o);i.push(c[0]),t=c[1]}}if(!a)throw new z("unfinished array encountered",{toml:e,ptr:t});return[i,t]}function AP(e,t,n,o){let i=t,a=n,c,m=!1,l;for(let f=0;f<e.length;f++){if(f){if(i=m?i[c]:i[c]={},a=(l=a[c]).c,o===0&&(l.t===1||l.t===2))return null;if(l.t===2){let y=i.length-1;i=i[y],a=a[y].c}}if(c=e[f],(m=Object.hasOwn(i,c))&&a[c]?.t===0&&a[c]?.d)return null;m||(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(l=a[c],l.t!==o&&!(o===1&&l.t===3)||(o===2&&(l.d||(l.d=!0,i[c]=[]),i[c].push(i={}),l.c[l.i++]=l={t:1,d:!1,i:0,c:{}}),l.d))return null;if(l.d=!0,o===1)i=m?i[c]:i[c]={};else if(o===0&&m)return null;return[c,i,l.c]}function md(e,{maxDepth:t=1e3,integersAsBigInt:n}={}){let o={},i={},a=o,c=i;for(let m=Nt(e,0);m<e.length;){if(e[m]==="["){let l=e[++m]==="[",f=pp(e,m+=+l,"]");if(l){if(e[f[1]-1]!=="]")throw new z("expected end of table declaration",{toml:e,ptr:f[1]-1});f[1]++}let y=AP(f[0],o,i,l?2:1);if(!y)throw new z("trying to redefine an already defined table or value",{toml:e,ptr:m});c=y[2],a=y[1],m=f[1]}else{let l=pp(e,m),f=AP(l[0],a,c,0);if(!f)throw new z("trying to redefine an already defined table or value",{toml:e,ptr:m});let y=us(e,l[1],void 0,t,n);f[1][f[0]]=y[0],m=y[1]}if(m=Nt(e,m,!0),e[m]&&e[m]!==`
151
+ `&&e[m]!=="\r")throw new z("each key-value declaration must be followed by an end-of-line",{toml:e,ptr:m});m=Nt(e,m)}return o}var xP=/^[a-z0-9-_]+$/i;function ms(e){let t=typeof e;if(t==="object"){if(Array.isArray(e))return"array";if(e instanceof Date)return"date"}return t}function V2(e){for(let t=0;t<e.length;t++)if(ms(e[t])!=="object")return!1;return e.length!=0}function ld(e){return JSON.stringify(e).replace(/\x7f/g,"\\u007f")}function dd(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":o&&Number.isInteger(e)?e.toFixed(1):e.toString();if(t==="bigint"||t==="boolean")return e.toString();if(t==="string")return ld(e);if(t==="date"){if(isNaN(e.getTime()))throw new TypeError("cannot serialize invalid date");return e.toISOString()}if(t==="object")return Y2(e,n,o);if(t==="array")return Q2(e,n,o)}function Y2(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+=xP.test(c)?c:ld(c),i+=" = ",i+=dd(e[c],ms(e[c]),t-1,n)}return i+" }"}function Q2(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+=dd(e[i],ms(e[i]),t-1,n)}return o+" ]"}function W2(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&&`
66
152
  `}[[${t}]]
67
- `,i+=bl(0,e[a],t,r,o);return i}function bl(e,t,r,o,i){if(o===0)throw new Error("Could not stringify the object: maximum object depth exceeded");let a="",c="",u=Object.keys(t);for(let l=0;l<u.length;l++){let f=u[l];if(t[f]!==null&&t[f]!==void 0){let y=va(t[f]);if(y==="symbol"||y==="function")throw new TypeError(`cannot serialize values of type '${y}'`);let E=BR.test(f)?f:Il(f);if(y==="array"&&UB(t[f]))c+=(c&&`
68
- `)+wB(t[f],r?`${r}.${E}`:E,o-1,i);else if(y==="object"){let S=r?`${r}.${E}`:E;c+=(c&&`
69
- `)+bl(S,t[f],S,o-1,i)}else a+=E,a+=" = ",a+=_l(t[f],y,o,i),a+=`
153
+ `,i+=fd(0,e[a],t,n,o);return i}function fd(e,t,n,o,i){if(o===0)throw new Error("Could not stringify the object: maximum object depth exceeded");let a="",c="",m=Object.keys(t);for(let l=0;l<m.length;l++){let f=m[l];if(t[f]!==null&&t[f]!==void 0){let y=ms(t[f]);if(y==="symbol"||y==="function")throw new TypeError(`cannot serialize values of type '${y}'`);let T=xP.test(f)?f:ld(f);if(y==="array"&&V2(t[f]))c+=(c&&`
154
+ `)+W2(t[f],n?`${n}.${T}`:T,o-1,i);else if(y==="object"){let A=n?`${n}.${T}`:T;c+=(c&&`
155
+ `)+fd(A,t[f],A,o-1,i)}else a+=T,a+=" = ",a+=dd(t[f],y,o,i),a+=`
70
156
  `}}return e&&(a||!c)&&(a=a?`[${e}]
71
157
  ${a}`:`[${e}]`),a&&c?`${a}
72
- ${c}`:a||c}function Al(e,{maxDepth:t=1e3,numbersAsFloat:r=!1}={}){if(va(e)!=="object")throw new TypeError("stringify can only be called with an object");let o=bl(0,e,"",t,r);return o[o.length-1]!==`
158
+ ${c}`:a||c}function gd(e,{maxDepth:t=1e3,numbersAsFloat:n=!1}={}){if(ms(e)!=="object")throw new TypeError("stringify can only be called with an object");let o=fd(0,e,"",t,n);return o[o.length-1]!==`
73
159
  `?o+`
74
- `:o}var LB={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 MB(e,t,r,o){let i=(0,zo.join)(e,".claude","settings.json");Q(`Claude Code \u2192 ${i}`),(0,Sl.mkdirSync)((0,zo.dirname)(i),{recursive:!0});let a=ia(i),c;try{c=JSON.parse(a??"{}")}catch{throw new Error(`${i} is not valid JSON. Fix or remove it before re-running.`)}if(!Ln(c))throw new Error(`${i} must contain a JSON object at the top level.`);let u=c.env??{};if(!Ln(u))throw new Error(`${i} "env" must be a JSON object.`);let l=o?"1":"0";c.env={...u,...LB,OTEL_EXPORTER_OTLP_ENDPOINT:t,OTEL_LOG_USER_PROMPTS:l,OTEL_LOG_TOOL_DETAILS:l,OTEL_LOG_TOOL_CONTENT:l,OTEL_EXPORTER_OTLP_HEADERS:`Authorization=Bearer ${r}`};let f=aa(i,a);oa(i,`${JSON.stringify(c,null,2)}
75
- `),Q(f===void 0?" created":` patched (backup: ${f})`)}function vB(e,t,r){return{environment:"dev",log_user_prompt:r,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 DB(e,t,r,o){let i=(0,zo.join)(e,".codex"),a=(0,zo.join)(i,"config.toml");Q(`Codex \u2192 ${a}`),(0,Sl.mkdirSync)(i,{recursive:!0});let c=ia(a),u=c===void 0?{}:Tl(c),l="otel"in u;delete u.otel,u.otel=vB(t,r,o);let f=aa(a,c);oa(a,Al(u)),Q(f===void 0?" created":l?` replaced existing [otel] tables (backup: ${f})`:` appended (backup: ${f})`)}function qR(){return new ep("--endpoint <url>","OTLP base URL").env("TSUGA_OTLP_ENDPOINT").makeOptionMandatory()}function HR(){return new ep("--ingestion-api-key <key>","Tsuga ingestion API key").env("TSUGA_INGESTION_API_KEY").makeOptionMandatory()}var KR="Restart your claude / codex session to load the new config.";function zR(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(qR()).addOption(HR()).option("--no-include-prompts","Strip user prompts + tool content from telemetry (default: include)").action(r=>{MB((0,Ol.homedir)(),r.endpoint.replace(/\/+$/,""),r.ingestionApiKey,r.includePrompts),Q(KR)}),t.command("codex").description("Patch ~/.codex/config.toml with Tsuga OTEL settings").addOption(qR()).addOption(HR()).option("--no-include-prompts","Strip user prompts + tool content from telemetry (default: include)").action(r=>{DB((0,Ol.homedir)(),r.endpoint.replace(/\/+$/,""),r.ingestionApiKey,r.includePrompts),Q(KR)})}var kc="/v0/logs";var Da=["CRITICAL","ERROR","WARN","NOTICE","INFO","DEBUG","TRACE"];var $B=0,GB=n.Object({__tsuga_metadata__:n.Object({id:n.String(),source:n.Optional(n.String())},{additionalProperties:!0}),context:n.Optional(n.Object({team:n.Optional(n.String()),tag_policy_warnings:n.Optional(n.Record(n.String(),n.String()))},{additionalProperties:!0})),message:n.Optional(n.Unknown()),timestamp:n.Number(),level:n.Enum(Da)},{additionalProperties:!0});var jB="log_timestamp",FB=n.Union([n.Literal(jB)]),jn=n.Partial(n.Object({...Tt.properties,query:m({type:"tsuga-query",description:"Tsuga query used to filter logs in the selected time range."}),maxResults:n.Integer({minimum:1,maximum:1e3,description:"Maximum number of logs to return. Valid values are 1 through 1000."}),shouldRecommendAttributes:n.Boolean({description:"Whether Tsuga should return suggested attributes to highlight in results."}),triggeredBy:n.Literal("refresh",{description:"Indicates the query was triggered by a refresh action."}),startOffset:n.Number({minimum:$B,description:"Result offset used when fetching additional log rows."}),clusterId:m({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}),sortBy:FB,sortDirection:n.Union([n.Literal("asc"),n.Literal("desc")],{description:"Timestamp sort direction for log results."})})),ize=d({tags:["logs"],url:`${kc}/count`,method:"GET",query:n.Pick(jn,["from","to","query","clusterId"]),response:n.Object({count:n.Number()})}),xl=n.Object({value:n.String(),priority:n.Number()}),aze=d({tags:["logs"],url:`${kc}/search`,method:"GET",query:jn,response:n.Object({logs:n.Optional(n.Array(GB)),attributesToHighlight:n.Optional(n.Array(xl))},{additionalProperties:!0})}),BB=n.Cyclic({TokenOutput:n.Union([n.Object({type:n.Literal("top"),values:n.Array(n.String())}),n.Object({type:n.Literal("ip"),value:n.String()}),n.Object({type:n.Literal("range"),min:n.Number(),max:n.Number()}),n.Object({type:n.Literal("variable"),value:n.String()}),n.Object({type:n.Literal("text"),value:n.String()}),n.Object({type:n.Literal("date"),value:n.String()}),n.Object({type:n.Literal("url"),value:n.String()}),n.Object({type:n.Literal("structure"),key:n.Array(n.String()),value:n.Array(n.Ref("TokenOutput"))})])},"TokenOutput",{description:"A token identified as part of the pattern"}),qB=n.Object({id:n.String(),pattern:n.Array(BB),size:n.Integer({description:"Number of logs that matched the pattern"}),examples:n.Array(n.Object({id:n.String(),timestampUnix:n.Number()})),timeDistribution:n.Array(n.Number()),staticFeatures:n.Array(n.Object({key:n.String(),value:n.String()},{description:"Fixed groups present in all logs matching the pattern"}))}),sze=d({tags:["logs"],url:`${kc}/patterns`,method:"GET",query:n.Object({...Tt.properties,query:m({type:"tsuga-query"}),clusteringThreshold:n.Optional(n.Number()),clusterId:n.Optional(m({allowEmpty:!1}))}),response:n.Object({patterns:n.Array(qB),sampleSize:n.Number()})}),cze=d({tags:["logs"],url:`${kc}/attributes`,method:"GET",query:n.Object({...Tt.properties,clusterId:n.Optional(m({allowEmpty:!1,description:"Cluster ID"}))}),response:n.Object({attributes:n.Array(n.String())})});var $a=`/${"v1"}/logs`,Rl=n.Object({context:n.Optional(n.Object({team:n.Optional(n.String({description:"Team name associated with this log."}))},{additionalProperties:!0,$id:"LogContext"})),message:n.Optional(n.Unknown({description:"Log message after ingestion and route processing. It can be any JSON value because processors may map arbitrary data into `message`."})),timestamp:n.Number({description:"Log timestamp as a Unix timestamp in milliseconds."}),level:n.Enum(Da,{description:"Normalized Tsuga log level."})},{additionalProperties:!0,$id:"LogEvent"}),HB={context:{team:"platform"},message:"Request completed successfully",timestamp:17040672e5,level:"INFO"};Object.assign(Rl,{examples:[HB]});var KB={query:"level:ERROR",maxResults:100,from:1704067200,to:1704067200},VR=n.Object({...n.Pick(jn,["query","maxResults"]).properties,clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit for single-cluster organizations."})),...It.properties},{description:"Log search query. Provide a time range, optional Tsuga query, and optional limit."});Object.assign(VR,{examples:[KB]});var YR=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:`${$a}/search`,method:"GET",query:VR,response:n.Object({logs:n.Array(Rl,{description:"Log events matching the query and time range."})})}),zB=n.Object({pattern:n.String({description:"Clustered log pattern formatted as a readable string."}),size:n.Integer({description:"Number of logs that matched the pattern"}),groups:n.Array(n.Object({key:n.String(),value:n.String()},{description:"Fixed groups present in all logs matching the pattern"}))}),QR=n.Object({patterns:n.Array(zB,{description:"Log patterns clustered from logs matching the query."}),sampleSize:n.Number({description:"Number of logs sampled while computing patterns."})}),VB={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(QR,{examples:[VB]});var WR=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:`${$a}/patterns`,method:"GET",query:n.Object({...It.properties,query:m({type:"tsuga-query",description:"Tsuga query selecting logs to cluster into patterns."}),clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit for single-cluster organizations."}))}),response:QR}),YB=n.Object({exampleLog:n.Optional(Rl),team:n.String({description:"Team associated with the new error pattern."}),env:n.String({description:"Environment associated with the new error pattern."}),service:n.String({description:"Service associated with the new error pattern."}),firstSeen:n.Number({description:"Timestamp in milliseconds when this pattern was first seen"}),lastSeen:n.Number({description:"Timestamp in milliseconds when this pattern was last seen"})}),ZR=n.Object({newErrorPatterns:n.Array(YB,{description:"Error patterns first seen in the requested time range."})}),QB={newErrorPatterns:[{team:"platform",env:"production",service:"api-gateway",firstSeen:17040672e5,lastSeen:17041536e5,exampleLog:{message:"ConnectionError: Failed to connect to database",timestamp:17041536e5,level:"ERROR"}}]};Object.assign(ZR,{examples:[QB]});var XR=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:`${$a}/patterns/new`,method:"GET",query:n.Object({...It.properties,team:n.Optional(m({description:"Team name to restrict pattern detection to."})),env:n.Optional(m({description:"Environment to restrict pattern detection to."})),service:n.Optional(m({description:"Service name to restrict pattern detection to."})),clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit for single-cluster organizations."}))}),response:ZR}),WB=n.Object({team:n.String({description:"Team associated with the error pattern."}),env:n.String({description:"Environment associated with the error pattern."}),pattern:n.String({description:"Error pattern formatted as a readable string."}),increaseTimestamps:n.Array(n.Number({description:"Timestamps in milliseconds when there were increases in this pattern"}))}),JR=n.Object({errorPatternIncreases:n.Array(WB,{description:"Error patterns with increased occurrence in the requested time range."})}),ZB={errorPatternIncreases:[{team:"platform",env:"production",pattern:"Non-resolved segment SegmentId(*) from cache",increaseTimestamps:[17041536e5,17042392e5]}]};Object.assign(JR,{examples:[ZB]});var eC=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:`${$a}/patterns/increase`,method:"GET",query:n.Object({...It.properties,team:m({description:"Team name to analyze for pattern increases."}),env:n.Optional(m({description:"Environment to restrict the analysis to."})),clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit for single-cluster organizations."}))}),response:JR}),tC=n.Object({attributes:n.Array(n.String(),{description:"Log attribute dot-paths observed in the time range"})}),XB={attributes:["context.env","context.k8s.pod.name","context.service.name","context.team","level","message","timestamp"]};Object.assign(tC,{examples:[XB]});var JB=n.Object({...It.properties,clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit for single-cluster organizations."}))},{description:"Log attribute discovery query. Provide a time range and optional cluster ID."}),rC=d({description:"Lists log attribute dot-paths observed in the requested time range. Use this to discover fields for Tsuga queries, filters, and grouping. See [Logs](/documentation/explore/logs).",operationId:"getLogAttributes",tags:["public","logs"],url:`${$a}/attributes`,method:"GET",query:JB,response:tC});var _r="/v0/metrics",eq=n.Object({__tsuga_metadata__:n.Object({},{additionalProperties:!0}),context:n.Optional(n.Object({},{additionalProperties:!0})),message:n.Optional(n.String()),timestamp:n.Number(),level:n.Enum(Da)},{additionalProperties:!0}),bze=d({tags:["metrics"],url:`${_r}/count`,method:"GET",query:n.Pick(jn,["from","to","query","clusterId"]),response:n.Object({count:n.Number()})}),Aze=d({tags:["metrics"],url:`${_r}/search`,method:"GET",query:jn,response:n.Object({logs:n.Optional(n.Array(eq)),totalHits:n.Optional(n.Number()),attributesToHighlight:n.Optional(n.Array(xl))},{additionalProperties:!0})}),wc=n.Enum(["counter","gauge","histogram","summary"],{description:"Metric instrument type: counter, gauge, histogram, or summary."}),Cl=n.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."}),tq=n.Object({capabilities:n.Optional(n.Array(n.String())),description:n.Optional(n.String()),tags:n.Optional(n.Array(n.String())),temporality:n.Optional(Cl),type:n.Optional(wc),unit:n.Optional(n.String())}),Oze=d({url:`${_r}/metadata`,method:"GET",query:n.Object({...Tt.properties,metricName:m({allowEmpty:!1}),clusterId:n.Optional(m({allowEmpty:!1,description:"Cluster ID"}))}),response:tq}),Sze=d({tags:["metrics"],url:_r,method:"GET",query:n.Object({...Tt.properties,clusterId:n.Optional(m({allowEmpty:!1,description:"Cluster ID"}))}),response:n.Array(n.String())}),Pl=n.Array(n.Object({name:n.String({description:"Metric name observed by Tsuga."}),type:wc}),{description:"List of metric names and their types"}),xze=d({tags:["metrics"],url:`${_r}/names-and-types`,method:"GET",query:n.Object({...Tt.properties,clusterId:n.Optional(m({allowEmpty:!1,description:"Cluster ID"}))}),response:Pl}),Lc=n.Array(n.String(),{description:"List of attribute names"}),Rze=d({tags:["metrics"],url:`${_r}/attributes`,method:"GET",query:n.Object({...Tt.properties,metricName:m({allowEmpty:!1}),clusterId:n.Optional(m({allowEmpty:!1,description:"Cluster ID"}))}),response:Lc}),Cze=d({tags:["metrics"],url:`${_r}/attributes/batch`,method:"GET",query:n.Object({...Tt.properties,metricNames:n.Array(m({allowEmpty:!1}),{minItems:1,description:"Metric names to fetch attributes for"}),clusterId:n.Optional(m({allowEmpty:!1,description:"Cluster ID"}))}),response:Lc}),Ul=n.Object({assets:n.Array(n.Object({type:n.Enum(["dashboard","monitor"]),id:n.String(),name:n.String(),owner:n.String()},{description:"An asset that uses a metric"}),{description:"List of assets (dashboards and monitors) using this metric"})}),Pze=d({tags:["metrics"],url:`${_r}/assets-usage`,method:"GET",query:n.Object({metricName:m({allowEmpty:!1})}),response:Ul}),Uze=d({url:`${_r}/per-attribute`,method:"GET",query:n.Object({from:n.Optional(n.Number()),to:n.Optional(n.Number()),attribute:m(),clusterId:n.Optional(m({allowEmpty:!1}))}),response:n.Array(n.String())});var Nl=`/${"v1"}/metrics`,rq=[{name:"http.server.request.duration",type:"histogram"},{name:"http.server.active_requests",type:"gauge"},{name:"http.server.request.count",type:"counter"}];Object.assign(Pl,{examples:[rq]});var kl=n.Object({name:n.String({description:"Metric name observed by Tsuga. Use this value in metric queries and aggregations."}),type:wc,description:n.Optional(n.String({description:"Human-readable description of the metric"})),unit:n.Optional(n.String({description:"Metric unit reported by instrumentation or inferred metadata."})),temporality:n.Optional(Cl),capabilities:n.Optional(n.Array(n.String(),{description:"Supported metric capabilities for query and visualization. An empty array means all capabilities are supported."})),attributes:n.Optional(n.Array(n.String(),{description:"Metric attribute names available as dimensions for filtering or grouping."}))}),nq={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(kl,{examples:[nq]});var nC=n.Object({...It.properties,clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit for single-cluster organizations."}))},{description:"Metric metadata query. Provide the time range to inspect and optionally a cluster ID."}),oC=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:Nl,method:"GET",query:nC,response:n.Array(kl)}),iC=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:`${Nl}/:name`,method:"GET",params:n.Object({name:m({allowEmpty:!1,description:"Metric name to retrieve, for example `http.server.request.duration`."})}),query:nC,response:kl}),oq=["service","env","host","method","status_code"];Object.assign(Lc,{examples:[oq]});var aC=n.Pick(Ul,["assets"]),iq={assets:[{type:"dashboard",id:"dash-123-abc",name:"API Performance Overview",owner:"user-456-def"},{type:"monitor",id:"mon-789-ghi",name:"High Latency Alert",owner:"user-456-def"}]};Object.assign(aC,{examples:[iq]});var sC=d({description:"Retrieve dashboards and monitors that use a specific metric",operationId:"getMetricAssetsUsage",tags:["private"],url:`${Nl}/assets-usage`,method:"GET",query:n.Object({metricName:m({allowEmpty:!1,description:"The name of the metric to find usage for"})}),response:aC});var aq=`/${"v1"}/traces`,cC=n.Object({context:n.Optional(n.Object({service:n.Optional(n.Object({name:n.Optional(n.String({description:"Service name associated with the span."})),version:n.Optional(n.String({description:"Service version associated with the span."}))},{additionalProperties:!0}))},{additionalProperties:!0})),parentSpanId:n.Optional(n.String({description:"Parent span ID when this span has a parent in the trace."})),resourceAttributes:n.Object({},{additionalProperties:!0,description:"OpenTelemetry resource attributes associated with the span."}),spanAttributes:n.Object({},{additionalProperties:!0,description:"OpenTelemetry span attributes."}),duration:n.Number({description:"In milliseconds."}),startTime:n.String({description:"In nanoseconds. Transmitted as a string to avoid losing precision, as BigInt is not JSON-compatible."}),endTime:n.String({description:"In nanoseconds. Transmitted as a string to avoid losing precision, as BigInt is not JSON-compatible."}),error:n.Optional(n.Object({message:n.String({description:"Error message associated with the span."})})),events:n.Optional(n.Array(n.Object({event_attributes:n.Object({},{additionalProperties:!0,description:"Attributes attached to the span event."}),event_name:n.String({description:"Name of the span event."}),event_timestamp_nanos:n.String({description:"Event timestamp in nanoseconds, transmitted as a string for precision."})}),{description:"Events recorded on the span."})),spanId:n.String({description:"Unique span ID within the trace."}),span:n.Object({kind:n.String({description:"OpenTelemetry span kind."}),name:n.String({description:"Operation name recorded on the span."})}),statusCode:n.Optional(n.String({description:"OpenTelemetry span status code."})),traceId:n.String({description:"Trace ID shared by all spans in the trace."})},{additionalProperties:!0,$id:"SpanEvent"}),sq={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(cC,{examples:[sq]});var cq={from:1704067200,to:1704067200,query:"context.service.name:my-service",maxResults:100},pC=n.Object({...It.properties,query:n.Optional(m({type:"tsuga-query",description:"Tsuga query selecting spans to return. Omit to search all spans in the range."})),maxResults:n.Optional(n.Integer({minimum:1,maximum:1e4,description:"Maximum number of spans to return. Valid values are 1 through 10000."})),clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit for single-cluster organizations."}))},{description:"Span search query. Provide a time range, optional Tsuga query, and optional limit."});Object.assign(pC,{examples:[cq]});var mC=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:`${aq}/search`,method:"GET",query:pC,response:n.Object({spans:n.Array(cC,{description:"Spans matching the query and time range."})})});var dC=["timestamp","level","message"],fC=["count","ratio","team","level","pattern"];function bt(e,t){let r=t??pr(e);if(!r)throw new Error(`--${e} is required`);return Ka(r)}function uC(e){let t={from:bt("from",e.from),to:bt("to",e.to)},r=e.query??pr("query");r!==void 0&&(t.query=r);let o=e.maxResults??pr("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 ve(e){let t=pr(e);return t===void 0?"":` (default: ${t})`}function pq(e){let t=ip(e.output),r=e.fields===void 0?void 0:ap(e.fields);return t==="json"?{format:t,fields:r}:{format:t,fields:r??dC}}function mq(e){let t=ip(e.output),r=e.fields===void 0?void 0:ap(e.fields);return t==="json"?{format:t,fields:r}:{format:t,fields:r??fC}}function lC(e,t){let r={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"?r.team=i:r[o]=i;return r}function uq(e,t){if(t.format==="json"){if(t.fields===void 0){oe(e);return}let{fields:i}=t;oe({patterns:e.patterns.map(a=>lC(a,e.sampleSize)).map(a=>sp(a,i)),sampleSize:e.sampleSize});return}let r=e.patterns.map(i=>lC(i,e.sampleSize)),o=cp(t.format,r,t.fields);o.length>0&&Q(o)}function lq(e,t){if(t.format==="json"){if(t.fields===void 0){oe(e);return}let{fields:o}=t;oe({logs:e.logs.map(i=>sp(i,o))});return}let r=cp(t.format,e.logs,t.fields);r.length>0&&Q(r)}function gC(e,t){let r=e.command("logs").description("Search and analyze logs");r.command("search").description("Search logs").option("--from <timestamp>",`Start of time range${ve("from")}`).option("--to <timestamp>",`End of time range${ve("to")}`).option("--query <query>",`Search query${ve("query")}`).option("--max-results <n>",`Maximum number of results${ve("max-results")}`).option("--fields <fields>",`Comma-separated dot-paths to project from each log (default for --output=tsv|csv: ${dC.join(",")})`).option("-o, --output <format>","Output format: json | tsv | csv","json").action(async c=>{let u=pq(c),l=await t()(YR,{query:uC(c)});lq(l,u)}),r.command("attributes").description("List log attribute dot-paths observed in the time range").option("--from <timestamp>",`Start of time range${ve("from")}`).option("--to <timestamp>",`End of time range${ve("to")}`).action(async c=>{let u=await t()(rC,{query:{from:bt("from",c.from),to:bt("to",c.to)}});oe(u)}),r.command("patterns").description("List log patterns").option("--from <timestamp>",`Start of time range${ve("from")}`).option("--to <timestamp>",`End of time range${ve("to")}`).option("--query <query>",`Search query${ve("query")}`).option("--fields <fields>",`Comma-separated dot-paths to project from each pattern (default for --output=tsv|csv: ${fC.join(",")})`).option("-o, --output <format>","Output format: json | tsv | csv","json").action(async c=>{let u=mq(c),l={from:bt("from",c.from),to:bt("to",c.to)},f=c.query??pr("query");f!==void 0&&(l.query=f);let y=await t()(WR,{query:l});uq(y,u)}),r.command("new-error-patterns").description("List new error patterns").option("--from <timestamp>",`Start of time range${ve("from")}`).option("--to <timestamp>",`End of time range${ve("to")}`).option("--team <team>","Filter by team").option("--env <env>","Filter by environment").option("--service <service>","Filter by service").action(async c=>{let u={from:bt("from",c.from),to:bt("to",c.to)};c.team!==void 0&&(u.team=c.team),c.env!==void 0&&(u.env=c.env),c.service!==void 0&&(u.service=c.service);let l=await t()(XR,{query:u});oe(l)}),r.command("error-pattern-increases").description("List error pattern increases for a given team").option("--from <timestamp>",`Start of time range${ve("from")}`).option("--to <timestamp>",`End of time range${ve("to")}`).requiredOption("--team <team>","Team to query").option("--env <env>","Filter by environment").action(async c=>{let u={from:bt("from",c.from),to:bt("to",c.to),team:c.team};c.env!==void 0&&(u.env=c.env);let l=await t()(eC,{query:u});oe(l)});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${ve("from")}`).option("--to <timestamp>",`End of time range${ve("to")}`).action(async c=>{let u=await t()(oC,{query:{from:bt("from",c.from),to:bt("to",c.to)}});oe(u)}),o.command("get <name>").description("Retrieve a metric by name with its metadata").option("--from <timestamp>",`Start of time range${ve("from")}`).option("--to <timestamp>",`End of time range${ve("to")}`).action(async(c,u)=>{let l=await t()(iC,{params:{name:c},query:{from:bt("from",u.from),to:bt("to",u.to)}});oe(l)}),o.command("assets-usage <name>").description("List dashboards and monitors that use a specific metric").action(async c=>{let u=await t()(sC,{query:{metricName:c}});oe(u)}),e.command("traces").description("Search traces").command("search").description("Search spans").option("--from <timestamp>",`Start of time range${ve("from")}`).option("--to <timestamp>",`End of time range${ve("to")}`).option("--query <query>",`Search query${ve("query")}`).option("--max-results <n>",`Maximum number of results${ve("max-results")}`).action(async c=>{let u=await t()(mC,{query:uC(c)});oe(u)});let a=e.command("aggregation").description("Run aggregation queries");Xi(a,"scalar","Run aggregation queries and return scalar results",j_,t),Xi(a,"timeseries","Run aggregation queries and return timeseries results",F_,t)}var dq="x-tsuga-session-id",wl="x-tsuga-source",Ll="x-tsuga-source-version",Ml="x-tsuga-source-commit",vl="x-tsuga-source-date",Dl="x-tsuga-rationale",fq="x-request-id",e9e={[dq]:"Session identifier for request correlation",[wl]:"SDK or client source identifier (e.g., web-frontend, terraform-provider)",[Ll]:"SDK version",[Ml]:"SDK commit hash",[vl]:"SDK commit date",[Dl]:"Optional caller-supplied rationale for this request, recorded for telemetry",[fq]:"Unique identifier for this API request, useful for debugging and support"};var Fn=class e extends Error{constructor(r,o,i,a){super(r);this.statusCode=o;this.code=i;this.requestId=a;this.name="CliError"}static fromErrorResponse(r,o){return new e(r.message,r.statusCode,r.code,o)}};function yC(e){if(e instanceof Fn){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}`),t.join(`
76
- `)}return e instanceof Error?`Error: ${e.message}`:String(e)}function gq(e){return e.replace(/\s+/g," ").replace(/[^\x20-\x7e\x80-\xff]/g,"").trim()}function hC(e,t,r,o){return async function(a,c={}){let{body:u,params:l,query:f}=c,y;if(a.url!==void 0)y=a.url;else if(a.buildUrl){if(!l)throw new Fn("Internal error: params required for this endpoint");y=a.buildUrl(l)}else throw new Fn("Internal error: endpoint has neither url nor buildUrl");let E=r===void 0?f:{clusterId:r,...f},S=UI(`${e}${y}`,E),fe={Accept:"application/json",Authorization:`Bearer ${t}`,[wl]:"cli",[Ll]:"1.1.0",[Ml]:"bf280b3",[vl]:"2026-06-23T07:47:54.050Z"};u&&(fe["Content-Type"]="application/json");let Re=o?.(),br=Re?gq(Re):"";br&&(fe[Dl]=br);let qn=await(await fetch(S,{method:a.method,headers:fe,body:u?JSON.stringify(u):null})).json();if(qn.error)throw Fn.fromErrorResponse(qn.error,qn.requestId);return qn.data}}var yq=3e3,hq="https://registry.npmjs.org/@tsuga/cli/latest";function Eq(e,t){let r=e.split(".").map(Number),o=t.split(".").map(Number);for(let i=0;i<Math.max(r.length,o.length);i++){let a=r[i]??0,c=o[i]??0;if(a>c)return!0;if(a<c)return!1}return!1}async function EC(e){try{let t=zI();if(t&&Date.now()-new Date(t).getTime()<Ha)return;let r=await fetch(hq,{signal:AbortSignal.timeout(yq)});if(!r.ok)return;let i=(await r.json()).version;Eq(i,e)&&(process.stderr.write(`
160
+ `:o}var Z2={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 X2(e,t,n,o){let i=(0,ui.join)(e,".claude","settings.json");q(`Claude Code \u2192 ${i}`),(0,hd.mkdirSync)((0,ui.dirname)(i),{recursive:!0});let a=Ra(i),c;try{c=JSON.parse(a??"{}")}catch{throw new Error(`${i} is not valid JSON. Fix or remove it before re-running.`)}if(!Vn(c))throw new Error(`${i} must contain a JSON object at the top level.`);let m=c.env??{};if(!Vn(m))throw new Error(`${i} "env" must be a JSON object.`);let l=o?"1":"0";c.env={...m,...Z2,OTEL_EXPORTER_OTLP_ENDPOINT:t,OTEL_LOG_USER_PROMPTS:l,OTEL_LOG_TOOL_DETAILS:l,OTEL_LOG_TOOL_CONTENT:l,OTEL_EXPORTER_OTLP_HEADERS:`Authorization=Bearer ${n}`};let f=Ca(i,a);xa(i,`${JSON.stringify(c,null,2)}
161
+ `),q(f===void 0?" created":` patched (backup: ${f})`)}function J2(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 eK(e,t,n,o){let i=(0,ui.join)(e,".codex"),a=(0,ui.join)(i,"config.toml");q(`Codex \u2192 ${a}`),(0,hd.mkdirSync)(i,{recursive:!0});let c=Ra(a),m=c===void 0?{}:md(c),l="otel"in m;delete m.otel,m.otel=J2(t,n,o);let f=Ca(a,c);xa(a,gd(m)),q(f===void 0?" created":l?` replaced existing [otel] tables (backup: ${f})`:` appended (backup: ${f})`)}function RP(){return new Lp("--endpoint <url>","OTLP base URL").env("TSUGA_OTLP_ENDPOINT").makeOptionMandatory()}function CP(){return new Lp("--ingestion-api-key <key>","Tsuga ingestion API key").env("TSUGA_INGESTION_API_KEY").makeOptionMandatory()}var PP="Restart your claude / codex session to load the new config.";function UP(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(RP()).addOption(CP()).option("--no-include-prompts","Strip user prompts + tool content from telemetry (default: include)").action(n=>{X2((0,yd.homedir)(),n.endpoint.replace(/\/+$/,""),n.ingestionApiKey,n.includePrompts),q(PP)}),t.command("codex").description("Patch ~/.codex/config.toml with Tsuga OTEL settings").addOption(RP()).addOption(CP()).option("--no-include-prompts","Strip user prompts + tool content from telemetry (default: include)").action(n=>{eK((0,yd.homedir)(),n.endpoint.replace(/\/+$/,""),n.ingestionApiKey,n.includePrompts),q(PP)})}var up="/v0/logs";var Td=["CRITICAL","ERROR","WARN","NOTICE","INFO","DEBUG","TRACE"];var Ed=0,Id=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(Td,{description:"Log severity, normalized from the source severity into one of the fixed Tsuga levels (ordered `CRITICAL` to `TRACE`)."})},{additionalProperties:!0}),wP=100,tK="timestamp",rK=r.Union([r.Literal(tK)]),Zn=r.Partial(r.Object({...et.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:Ed,description:"Result offset used when fetching additional log rows."}),clusterId:u({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}),sortBy:rK,sortDirection:r.Union([r.Literal("asc"),r.Literal("desc")],{description:"Timestamp sort direction for log results."})})),XVe=d({tags:["logs"],url:`${up}/count`,method:"GET",query:r.Pick(Zn,["from","to","query","clusterId"]),response:r.Object({count:r.Number()})}),ls=r.Object({value:r.String(),priority:r.Number()}),JVe=d({tags:["logs"],url:`${up}/search`,method:"GET",query:Zn,response:r.Object({logs:r.Optional(r.Array(Id)),attributesToHighlight:r.Optional(r.Array(ls))},{additionalProperties:!0})}),nK=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"}),oK=r.Object({id:r.String(),pattern:r.Array(nK),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"}))}),eYe=d({tags:["logs"],url:`${up}/patterns`,method:"GET",query:r.Object({...et.properties,query:u({type:"tsuga-query"}),clusteringThreshold:r.Optional(r.Number()),clusterId:r.Optional(u({allowEmpty:!1}))}),response:r.Object({patterns:r.Array(oK),sampleSize:r.Number()})}),tYe=d({tags:["logs"],url:`${up}/attributes`,method:"GET",query:r.Object({...et.properties,clusterId:r.Optional(u({allowEmpty:!1,description:"Cluster ID"}))}),response:r.Object({attributes:r.Array(r.String())})});var ds=`/${"v1"}/logs`,_d=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(Id,["message","timestamp","level"]).properties},{additionalProperties:!0,$id:"LogEvent",description:"Log event including message, timestamp, severity level, and optional enriched context attributes."}),iK={context:{team:"platform"},message:"Request completed successfully",timestamp:17040672e5,level:"INFO"};Object.assign(_d,{examples:[iK]});var NP=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:wP,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."})),..._t.properties},{description:"Log search query. Provide a time range, optional Tsuga query, and optional limit."}),aK={query:"level:ERROR",maxResults:100,from:1704067200,to:1704070800};Object.assign(NP,{examples:[aK]});var LP=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:`${ds}/search`,method:"GET",query:NP,response:r.Object({logs:r.Array(_d,{description:"Log events matching the query and time range."})})}),sK=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`."}))}),kP=r.Object({patterns:r.Array(sK,{description:"Log patterns clustered from logs matching the query."}),sampleSize:r.Number({description:"Number of logs sampled while computing patterns."})},{}),cK={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(kP,{examples:[cK]});var vP=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:`${ds}/patterns`,method:"GET",query:r.Object({..._t.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:kP}),pK=r.Object({exampleLog:r.Optional(_d),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."})}),MP=r.Object({newErrorPatterns:r.Array(pK,{description:"Error patterns first seen in the requested time range."})},{}),uK={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(MP,{examples:[uK]});var DP=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:`${ds}/patterns/new`,method:"GET",query:r.Object({..._t.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:MP}),mK=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."}))}),GP=r.Object({errorPatternIncreases:r.Array(mK,{description:"Error patterns with increased occurrence in the requested time range."})},{}),lK={errorPatternIncreases:[{team:"platform",env:"production",pattern:"Non-resolved segment SegmentId(*) from cache",increaseTimestamps:[17041536e5,17042392e5]}]};Object.assign(GP,{examples:[lK]});var $P=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:`${ds}/patterns/increase`,method:"GET",query:r.Object({..._t.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:GP}),jP=r.Object({attributes:r.Array(r.String(),{description:"Log attribute dot-paths observed in the time range"})},{}),dK={attributes:["context.env","context.k8s.pod.name","context.service.name","context.team","level","message","timestamp"]};Object.assign(jP,{examples:[dK]});var fK=r.Object({..._t.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."}),qP=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:`${ds}/attributes`,method:"GET",query:fK,response:jP});var Cr="/v0/metrics",gK=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(Td)},{additionalProperties:!0}),gYe=d({tags:["metrics"],url:`${Cr}/count`,method:"GET",query:r.Pick(Zn,["from","to","query","clusterId"]),response:r.Object({count:r.Number()})}),yYe=d({tags:["metrics"],url:`${Cr}/search`,method:"GET",query:Zn,response:r.Object({logs:r.Optional(r.Array(gK)),totalHits:r.Optional(r.Number()),attributesToHighlight:r.Optional(r.Array(ls))},{additionalProperties:!0})}),mp=r.Enum(["counter","gauge","histogram","summary"],{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` and `summary` report a distribution of values, from which percentiles can be computed."}),bd=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."}),yK=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(bd),type:r.Optional(mp),unit:r.Optional(r.String({description:"Metric unit reported by instrumentation or inferred metadata."}))}),hYe=d({url:`${Cr}/metadata`,method:"GET",query:r.Object({...et.properties,metricName:u({allowEmpty:!1}),clusterId:r.Optional(u({allowEmpty:!1,description:"Cluster ID"}))}),response:yK}),TYe=d({tags:["metrics"],url:Cr,method:"GET",query:r.Object({...et.properties,clusterId:r.Optional(u({allowEmpty:!1,description:"Cluster ID"}))}),response:r.Array(r.String())}),lp=r.Array(r.Object({name:r.String({description:"Metric name observed by Tsuga."}),type:mp}),{description:"Metrics observed in the requested time range, with the instrument type each was reported as."}),hK=[{name:"http.server.request.duration",type:"histogram"},{name:"http.server.active_requests",type:"gauge"},{name:"http.server.request.count",type:"counter"}];Object.assign(lp,{examples:[hK]});var EYe=d({tags:["metrics"],url:`${Cr}/names-and-types`,method:"GET",query:r.Object({...et.properties,clusterId:r.Optional(u({allowEmpty:!1,description:"Cluster ID"}))}),response:lp}),fs=r.Array(r.String(),{description:"Attribute names available as dimensions for filtering or grouping the requested metric(s)."}),TK=["service","env","host","method","status_code"];Object.assign(fs,{examples:[TK]});var IYe=d({tags:["metrics"],url:`${Cr}/attributes`,method:"GET",query:r.Object({...et.properties,metricName:u({allowEmpty:!1}),clusterId:r.Optional(u({allowEmpty:!1,description:"Cluster ID"}))}),response:fs}),_Ye=d({tags:["metrics"],url:`${Cr}/attributes/batch`,method:"GET",query:r.Object({...et.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:fs}),Sd=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."})}),bYe=d({tags:["metrics"],url:`${Cr}/assets-usage`,method:"GET",query:r.Object({metricName:u({allowEmpty:!1})}),response:Sd}),SYe=d({url:`${Cr}/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 Od=`/${"v1"}/metrics`,EK=[{name:"http.server.request.duration",type:"histogram"},{name:"http.server.active_requests",type:"gauge"},{name:"http.server.request.count",type:"counter"}];Object.assign(lp,{examples:[EK]});var Ad=r.Object({name:r.String({description:"Metric name observed by Tsuga. Use this value in metric queries and aggregations."}),type:mp,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(bd),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."}))}),IK={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(Ad,{examples:[IK]});var FP=r.Object({..._t.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."}),BP=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:Od,method:"GET",query:FP,response:r.Array(Ad)}),HP=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:`${Od}/:name`,method:"GET",params:r.Object({name:u({allowEmpty:!1,description:"Metric name to retrieve, for example `http.server.request.duration`."})}),query:FP,response:Ad}),_K=["service","env","host","method","status_code"];Object.assign(fs,{examples:[_K]});var KP=r.Pick(Sd,["assets"]),bK={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(KP,{examples:[bK]});var zP=d({description:"Retrieve dashboards and monitors that use a specific metric",operationId:"getMetricAssetsUsage",tags:["private"],url:`${Od}/assets-usage`,method:"GET",query:r.Object({metricName:u({allowEmpty:!1,description:"The name of the metric to find usage for"})}),response:KP});var dp="/v0/traces",DYe=d({tags:["traces"],url:`${dp}/count`,method:"GET",query:r.Pick(Zn,["from","to","query","clusterId"]),response:r.Object({count:r.Number()})}),SK=["unset","ok","error"],OK=r.Enum(SK),AK=["unspecified","internal","server","client","producer","consumer"],xK=r.Enum(AK),VP=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:xK,name:r.String()}),status_code:r.Optional(OK),trace_id:r.String()}),YP=100,RK="start_time",CK="duration_ns",PK=r.Union([r.Literal(RK),r.Literal(CK)]),UK={...et.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:Ed})),clusterId:r.Optional(u({allowEmpty:!1,description:"Cluster ID"})),sortBy:r.Optional(PK),sortDirection:r.Optional(r.Union([r.Literal("asc"),r.Literal("desc")]))},GYe=d({tags:["traces"],url:`${dp}/search`,method:"GET",query:r.Object(UK),response:r.Object({spans:r.Optional(r.Array(VP)),attributesToHighlight:r.Optional(r.Array(ls))})});var wK=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."})}),NK=r.Object({...et.properties,traceId:u({allowEmpty:!1,description:"Trace ID to summarize"}),clusterId:r.Optional(u({allowEmpty:!1,description:"Cluster ID"})),...r.Partial(wK).properties}),$Ye=d({tags:["traces"],url:`${dp}/summarize`,method:"GET",query:NK,response:r.Object({spans:r.Array(VP)})}),jYe=d({tags:["traces"],url:`${dp}/attributes`,method:"GET",query:r.Object({...et.properties,clusterId:r.Optional(u({allowEmpty:!1,description:"Cluster ID"}))}),response:r.Object({attributes:r.Array(r.String())})});var QP=`/${"v1"}/traces`,xd=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}))},{additionalProperties:!0})),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."})})),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:"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."})}),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."}),LK={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(xd,{examples:[LK]});var kK={from:1704067200,to:1704070800,query:"context.service.name:my-service",maxResults:100},WP=r.Object({..._t.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:YP,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(WP,{examples:[kK]});var ZP=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:`${QP}/search`,method:"GET",query:WP,response:r.Object({spans:r.Array(xd,{description:"Spans matching the query and time range."})})}),vK={from:1704067200,to:1704070800,traceId:"78c99c5bb1e4a30297fa134b9dbec64f"},XP=r.Object({..._t.properties,traceId:u({allowEmpty:!1,description:"ID of the trace to summarize."}),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 (e.g. `db.*`). Matches against flattened dotted span attribute keys. Defaults to none."})),minLeafSpansToAggregate:r.Optional(r.Integer({minimum:2,default:5,description:"Minimum number of similar leaf spans in a group before they are aggregated into a single summary span. Defaults to 5."})),maxParentDepth:r.Optional(r.Integer({minimum:-1,default:-1,description:"Maximum depth of recursive parent aggregation. Use 0 to aggregate leaf spans only, -1 for unlimited (default)."})),aggregationHistogramBucketsSeconds:r.Optional(r.Array(r.Number({minimum:0}),{description:"Upper bounds in seconds for the latency histogram recorded on summary spans. Pass an empty array to omit histogram attributes. Defaults to standard buckets from 5ms to 10s."})),sortSpans:r.Optional(r.Boolean({default:!0,description:"Whether to sort the returned spans by start time, with the span ID as a tie-breaker for identical start times. Set to false to skip the sort when you reconstruct the trace tree yourself; summary spans are then appended after the surviving spans. Defaults to true."}))},{description:"Trace summarization query. Provide a trace ID, a time range covering the trace, and optional aggregation tuning."});Object.assign(XP,{examples:[vK]});var JP=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:`${QP}/summarize`,method:"GET",query:XP,response:r.Object({spans:r.Array(xd,{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`."})})});var rU=["timestamp","level","message"],nU=["count","ratio","team","level","pattern"];function ft(e,t){let n=t??fr(e);if(!n)throw new Error(`--${e} is required`);return _s(n)}function eU(e){let t={from:ft("from",e.from),to:ft("to",e.to)},n=e.query??fr("query");n!==void 0&&(t.query=n);let o=e.maxResults??fr("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 Pe(e){let t=fr(e);return t===void 0?"":` (default: ${t})`}function MK(e){let t=Gp(e.output),n=e.fields===void 0?void 0:$p(e.fields);return t==="json"?{format:t,fields:n}:{format:t,fields:n??rU}}function DK(e){let t=Gp(e.output),n=e.fields===void 0?void 0:$p(e.fields);return t==="json"?{format:t,fields:n}:{format:t,fields:n??nU}}function tU(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 GK(e,t){if(t.format==="json"){if(t.fields===void 0){re(e);return}let{fields:i}=t;re({patterns:e.patterns.map(a=>tU(a,e.sampleSize)).map(a=>jp(a,i)),sampleSize:e.sampleSize});return}let n=e.patterns.map(i=>tU(i,e.sampleSize)),o=qp(t.format,n,t.fields);o.length>0&&q(o)}function $K(e,t){if(t.format==="json"){if(t.fields===void 0){re(e);return}let{fields:o}=t;re({logs:e.logs.map(i=>jp(i,o))});return}let n=qp(t.format,e.logs,t.fields);n.length>0&&q(n)}function oU(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${Pe("from")}`).option("--to <timestamp>",`End of time range${Pe("to")}`).option("--query <query>",`Search query${Pe("query")}`).option("--max-results <n>",`Maximum number of results${Pe("max-results")}`).option("--fields <fields>",`Comma-separated dot-paths to project from each log (default for --output=tsv|csv: ${rU.join(",")})`).option("-o, --output <format>","Output format: json | tsv | csv","json").action(async c=>{let m=MK(c),l=await t()(LP,{query:eU(c)});$K(l,m)}),n.command("attributes").description("List log attribute dot-paths observed in the time range").option("--from <timestamp>",`Start of time range${Pe("from")}`).option("--to <timestamp>",`End of time range${Pe("to")}`).action(async c=>{let m=await t()(qP,{query:{from:ft("from",c.from),to:ft("to",c.to)}});re(m)}),n.command("patterns").description("List log patterns").option("--from <timestamp>",`Start of time range${Pe("from")}`).option("--to <timestamp>",`End of time range${Pe("to")}`).option("--query <query>",`Search query${Pe("query")}`).option("--fields <fields>",`Comma-separated dot-paths to project from each pattern (default for --output=tsv|csv: ${nU.join(",")})`).option("-o, --output <format>","Output format: json | tsv | csv","json").action(async c=>{let m=DK(c),l={from:ft("from",c.from),to:ft("to",c.to)},f=c.query??fr("query");f!==void 0&&(l.query=f);let y=await t()(vP,{query:l});GK(y,m)}),n.command("new-error-patterns").description("List new error patterns").option("--from <timestamp>",`Start of time range${Pe("from")}`).option("--to <timestamp>",`End of time range${Pe("to")}`).option("--team <team>","Filter by team").option("--env <env>","Filter by environment").option("--service <service>","Filter by service").action(async c=>{let m={from:ft("from",c.from),to:ft("to",c.to)};c.team!==void 0&&(m.team=c.team),c.env!==void 0&&(m.env=c.env),c.service!==void 0&&(m.service=c.service);let l=await t()(DP,{query:m});re(l)}),n.command("error-pattern-increases").description("List error pattern increases for a given team").option("--from <timestamp>",`Start of time range${Pe("from")}`).option("--to <timestamp>",`End of time range${Pe("to")}`).requiredOption("--team <team>","Team to query").option("--env <env>","Filter by environment").action(async c=>{let m={from:ft("from",c.from),to:ft("to",c.to),team:c.team};c.env!==void 0&&(m.env=c.env);let l=await t()($P,{query:m});re(l)});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${Pe("from")}`).option("--to <timestamp>",`End of time range${Pe("to")}`).action(async c=>{let m=await t()(BP,{query:{from:ft("from",c.from),to:ft("to",c.to)}});re(m)}),o.command("get <name>").description("Retrieve a metric by name with its metadata").option("--from <timestamp>",`Start of time range${Pe("from")}`).option("--to <timestamp>",`End of time range${Pe("to")}`).action(async(c,m)=>{let l=await t()(HP,{params:{name:c},query:{from:ft("from",m.from),to:ft("to",m.to)}});re(l)}),o.command("assets-usage <name>").description("List dashboards and monitors that use a specific metric").action(async c=>{let m=await t()(zP,{query:{metricName:c}});re(m)});let i=e.command("traces").description("Search traces");i.command("search").description("Search spans").option("--from <timestamp>",`Start of time range${Pe("from")}`).option("--to <timestamp>",`End of time range${Pe("to")}`).option("--query <query>",`Search query${Pe("query")}`).option("--max-results <n>",`Maximum number of results${Pe("max-results")}`).action(async c=>{let m=await t()(ZP,{query:eU(c)});re(m)}),i.command("summarize").description("Summarize a trace by aggregating groups of similar spans into summary spans").requiredOption("--trace-id <id>","Trace ID to summarize").option("--from <timestamp>",`Start of time range${Pe("from")}`).option("--to <timestamp>",`End of time range${Pe("to")}`).action(async c=>{let m=await t()(JP,{query:{traceId:c.traceId,from:ft("from",c.from),to:ft("to",c.to)}});re(m)});let a=e.command("aggregation").description("Run aggregation queries");Ta(a,"scalar","Run aggregation queries and return scalar results",Db,t),Ta(a,"timeseries","Run aggregation queries and return timeseries results",$b,t)}var jK="x-tsuga-session-id",Rd="x-tsuga-source",Cd="x-tsuga-source-version",Pd="x-tsuga-source-commit",Ud="x-tsuga-source-date",wd="x-tsuga-rationale",qK="x-request-id",o5e={[jK]:"Session identifier for request correlation",[Rd]:"SDK or client source identifier (e.g., web-frontend, terraform-provider)",[Cd]:"SDK version",[Pd]:"SDK commit hash",[Ud]:"SDK commit date",[wd]:"Optional caller-supplied rationale for this request, recorded for telemetry",[qK]:"Unique identifier for this API request, useful for debugging and support"};var mn=class e extends Error{constructor(n,o,i,a){super(n);this.statusCode=o;this.code=i;this.requestId=a;this.name="CliError"}static fromErrorResponse(n,o){return new e(n.message,n.statusCode,n.code,o)}};function iU(e){if(e instanceof mn){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}`),t.join(`
162
+ `)}return e instanceof Error?`Error: ${e.message}`:String(e)}function FK(e){return e.replace(/\s+/g," ").replace(/[^\x20-\x7e\x80-\xff]/g,"").trim()}function aU(e,t,n,o){return async function(a,c={}){let{body:m,params:l,query:f}=c,y;if(a.url!==void 0)y=a.url;else if(a.buildUrl){if(!l)throw new mn("Internal error: params required for this endpoint");y=a.buildUrl(l)}else throw new mn("Internal error: endpoint has neither url nor buildUrl");let T=n===void 0?f:{clusterId:n,...f},A=S_(`${e}${y}`,T),ye={Accept:"application/json",Authorization:`Bearer ${t}`,[Rd]:"cli",[Cd]:"1.2.0",[Pd]:"0d0be51",[Ud]:"2026-07-10T14:15:39.953Z"};m&&(ye["Content-Type"]="application/json");let Ue=o?.(),Pr=Ue?FK(Ue):"";Pr&&(ye[wd]=Pr);let Jn=await fetch(A,{method:a.method,headers:ye,body:m?JSON.stringify(m):null}),ln;try{ln=await Jn.json()}catch{throw new mn(Jn.status===504?"The server timed out (504). Try a smaller time range.":`Server returned a non-JSON response (HTTP ${Jn.status}).`,Jn.status)}if(ln.error)throw mn.fromErrorResponse(ln.error,ln.requestId);return ln.data}}var BK=3e3,HK="https://registry.npmjs.org/@tsuga/cli/latest";function KK(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 sU(e){try{let t=$_();if(t&&Date.now()-new Date(t).getTime()<Is)return;let n=await fetch(HK,{signal:AbortSignal.timeout(BK)});if(!n.ok)return;let i=(await n.json()).version;KK(i,e)&&(process.stderr.write(`
77
163
  Update available: ${e} \u2192 ${i}
78
- `),process.stderr.write("Run `tsuga self-update` to update\n")),VI(new Date().toISOString())}catch{}}var tt=new Jl().name("tsuga").description("Tsuga CLI - manage resources from the command line").version("1.1.0").option("--operation-api-key <operation-api-key>","Operation API key").option("--cluster <cluster-id>","Target cluster (overrides config and TSUGA_CLUSTER_ID)"),Mc,TC;function Bn(){if(Mc)return Mc;let e=tt.opts(),t=To({operationApiKey:e.operationApiKey,clusterId:e.cluster});Ba(t.credential,new Date)&&(console.error("Your session expired. Run `tsuga auth login` to sign in again."),process.exit(1));let r=DI(t);return r||(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)),Mc=hC(t.apiUrl,r,t.clusterId,()=>TC),Mc}QI(tt);n_(tt);var Tq=new Set(tt.commands);wR(tt,Bn);gC(tt,Bn);RS(tt,Bn);p_(tt,Bn);jO(tt,Bn);r_(tt,Bn);$O(tt,Bn);zR(tt);NS(tt);MR(tt);function IC(e){for(let t of e.commands)t.commands.length===0&&t.option("--rationale <text>",'Why you are making this call, e.g. "confirming the deploy caused the error spike". Recorded to explain intent; does not affect the result.'),IC(t)}for(let e of tt.commands)Tq.has(e)||IC(e);tt.hook("preAction",(e,t)=>{let{rationale:r}=t.opts();TC=r});tt.parseAsync().then(()=>EC("1.1.0")).catch(e=>{console.error(yC(e)),process.exitCode=1});
164
+ `),process.stderr.write("Run `tsuga self-update` to update\n")),j_(new Date().toISOString())}catch{}}var rt=new zd().name("tsuga").description("Tsuga CLI - manage resources from the command line").version("1.2.0").option("--operation-api-key <operation-api-key>","Operation API key").option("--cluster <cluster-id>","Target cluster (overrides config and TSUGA_CLUSTER_ID)"),fp,cU;function Xn(){if(fp)return fp;let e=rt.opts(),t=Uo({operationApiKey:e.operationApiKey,clusterId:e.cluster});Ts(t.credential,new Date)&&(console.error("Your session expired. Run `tsuga auth login` to sign in again."),process.exit(1));let n=U_(t);return 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)),fp=aU(t.apiUrl,n,t.clusterId,()=>cU),fp}F_(rt);nb(rt);var zK=new Set(rt.commands);hP(rt,Xn);oU(rt,Xn);Hx(rt,Xn);pb(rt,Xn);jA(rt,Xn);J_(rt,Xn);MA(rt,Xn);UP(rt);Yx(rt);EP(rt);rb(rt);function pU(e){for(let t of e.commands)t.commands.length===0&&t.option("--rationale <text>",'Why you are making this call, e.g. "confirming the deploy caused the error spike". Recorded to explain intent; does not affect the result.'),pU(t)}for(let e of rt.commands)zK.has(e)||pU(e);rt.hook("preAction",(e,t)=>{let{rationale:n}=t.opts();cU=n});rt.parseAsync().then(()=>sU("1.2.0")).catch(e=>{console.error(iU(e)),process.exitCode=1});
79
165
  /**
80
166
  * The following is a list of HTTP status codes and their meanings.
81
167
  *