@tsuga/cli 1.5.1 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/cli.js +59 -59
- package/package.json +7 -8
package/dist/cli.js
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var
|
|
3
|
-
`)}displayWidth(r){return
|
|
4
|
-
`+" ".repeat(n+
|
|
5
|
-
${c}`)}boxWrap(r,n){if(n<this.minWidthToWrap)return r;let o=r.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
|
|
6
|
-
`)}};function
|
|
2
|
+
"use strict";var CN=Object.create;var $p=Object.defineProperty;var PN=Object.getOwnPropertyDescriptor;var UN=Object.getOwnPropertyNames;var wN=Object.getPrototypeOf,NN=Object.prototype.hasOwnProperty;var En=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),kt=(e,r)=>{for(var n in r)$p(e,n,{get:r[n],enumerable:!0})},LN=(e,r,n,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of UN(r))!NN.call(e,i)&&i!==n&&$p(e,i,{get:()=>r[i],enumerable:!(o=PN(r,i))||o.enumerable});return e};var Ls=(e,r,n)=>(n=e!=null?CN(wN(e)):{},LN(r||!e||!e.__esModule?$p(n,"default",{value:e,enumerable:!0}):n,e));var Ai=En(qp=>{var vs=class extends Error{constructor(r,n,o){super(o),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=n,this.exitCode=r,this.nestedError=void 0}},jp=class extends vs{constructor(r){super(1,"commander.invalidArgument",r),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};qp.CommanderError=vs;qp.InvalidArgumentError=jp});var ks=En(Fp=>{var{InvalidArgumentError:vN}=Ai(),Bp=class{constructor(r,n){switch(this.description=n||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,r[0]){case"<":this.required=!0,this._name=r.slice(1,-1);break;case"[":this.required=!1,this._name=r.slice(1,-1);break;default:this.required=!0,this._name=r;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(r,n){return n===this.defaultValue||!Array.isArray(n)?[r]:n.concat(r)}default(r,n){return this.defaultValue=r,this.defaultValueDescription=n,this}argParser(r){return this.parseArg=r,this}choices(r){return this.argChoices=r.slice(),this.parseArg=(n,o)=>{if(!this.argChoices.includes(n))throw new vN(`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 kN(e){let r=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+r+">":"["+r+"]"}Fp.Argument=Bp;Fp.humanReadableArgName=kN});var zp=En(Kp=>{var{humanReadableArgName:MN}=ks(),Hp=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(r){this.helpWidth=this.helpWidth??r.helpWidth??80}visibleCommands(r){let n=r.commands.filter(i=>!i._hidden),o=r._getHelpCommand();return o&&!o._hidden&&n.push(o),this.sortSubcommands&&n.sort((i,a)=>i.name().localeCompare(a.name())),n}compareOptions(r,n){let o=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return o(r).localeCompare(o(n))}visibleOptions(r){let n=r.options.filter(i=>!i.hidden),o=r._getHelpOption();if(o&&!o.hidden){let i=o.short&&r._findOption(o.short),a=o.long&&r._findOption(o.long);!i&&!a?n.push(o):o.long&&!a?n.push(r.createOption(o.long,o.description)):o.short&&!i&&n.push(r.createOption(o.short,o.description))}return this.sortOptions&&n.sort(this.compareOptions),n}visibleGlobalOptions(r){if(!this.showGlobalOptions)return[];let n=[];for(let o=r.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(r){return r._argsDescription&&r.registeredArguments.forEach(n=>{n.description=n.description||r._argsDescription[n.name()]||""}),r.registeredArguments.find(n=>n.description)?r.registeredArguments:[]}subcommandTerm(r){let n=r.registeredArguments.map(o=>MN(o)).join(" ");return r._name+(r._aliases[0]?"|"+r._aliases[0]:"")+(r.options.length?" [options]":"")+(n?" "+n:"")}optionTerm(r){return r.flags}argumentTerm(r){return r.name()}longestSubcommandTermLength(r,n){return n.visibleCommands(r).reduce((o,i)=>Math.max(o,this.displayWidth(n.styleSubcommandTerm(n.subcommandTerm(i)))),0)}longestOptionTermLength(r,n){return n.visibleOptions(r).reduce((o,i)=>Math.max(o,this.displayWidth(n.styleOptionTerm(n.optionTerm(i)))),0)}longestGlobalOptionTermLength(r,n){return n.visibleGlobalOptions(r).reduce((o,i)=>Math.max(o,this.displayWidth(n.styleOptionTerm(n.optionTerm(i)))),0)}longestArgumentTermLength(r,n){return n.visibleArguments(r).reduce((o,i)=>Math.max(o,this.displayWidth(n.styleArgumentTerm(n.argumentTerm(i)))),0)}commandUsage(r){let n=r._name;r._aliases[0]&&(n=n+"|"+r._aliases[0]);let o="";for(let i=r.parent;i;i=i.parent)o=i.name()+" "+o;return o+n+" "+r.usage()}commandDescription(r){return r.description()}subcommandDescription(r){return r.summary()||r.description()}optionDescription(r){let n=[];return r.argChoices&&n.push(`choices: ${r.argChoices.map(o=>JSON.stringify(o)).join(", ")}`),r.defaultValue!==void 0&&(r.required||r.optional||r.isBoolean()&&typeof r.defaultValue=="boolean")&&n.push(`default: ${r.defaultValueDescription||JSON.stringify(r.defaultValue)}`),r.presetArg!==void 0&&r.optional&&n.push(`preset: ${JSON.stringify(r.presetArg)}`),r.envVar!==void 0&&n.push(`env: ${r.envVar}`),n.length>0?`${r.description} (${n.join(", ")})`:r.description}argumentDescription(r){let n=[];if(r.argChoices&&n.push(`choices: ${r.argChoices.map(o=>JSON.stringify(o)).join(", ")}`),r.defaultValue!==void 0&&n.push(`default: ${r.defaultValueDescription||JSON.stringify(r.defaultValue)}`),n.length>0){let o=`(${n.join(", ")})`;return r.description?`${r.description} ${o}`:o}return r.description}formatHelp(r,n){let o=n.padWidth(r,n),i=n.helpWidth??80;function a(E,A){return n.formatItem(E,o,A,n)}let c=[`${n.styleTitle("Usage:")} ${n.styleUsage(n.commandUsage(r))}`,""],m=n.commandDescription(r);m.length>0&&(c=c.concat([n.boxWrap(n.styleCommandDescription(m),i),""]));let d=n.visibleArguments(r).map(E=>a(n.styleArgumentTerm(n.argumentTerm(E)),n.styleArgumentDescription(n.argumentDescription(E))));d.length>0&&(c=c.concat([n.styleTitle("Arguments:"),...d,""]));let f=n.visibleOptions(r).map(E=>a(n.styleOptionTerm(n.optionTerm(E)),n.styleOptionDescription(n.optionDescription(E))));if(f.length>0&&(c=c.concat([n.styleTitle("Options:"),...f,""])),n.showGlobalOptions){let E=n.visibleGlobalOptions(r).map(A=>a(n.styleOptionTerm(n.optionTerm(A)),n.styleOptionDescription(n.optionDescription(A))));E.length>0&&(c=c.concat([n.styleTitle("Global Options:"),...E,""]))}let y=n.visibleCommands(r).map(E=>a(n.styleSubcommandTerm(n.subcommandTerm(E)),n.styleSubcommandDescription(n.subcommandDescription(E))));return y.length>0&&(c=c.concat([n.styleTitle("Commands:"),...y,""])),c.join(`
|
|
3
|
+
`)}displayWidth(r){return $f(r).length}styleTitle(r){return r}styleUsage(r){return r.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(r){return this.styleDescriptionText(r)}styleOptionDescription(r){return this.styleDescriptionText(r)}styleSubcommandDescription(r){return this.styleDescriptionText(r)}styleArgumentDescription(r){return this.styleDescriptionText(r)}styleDescriptionText(r){return r}styleOptionTerm(r){return this.styleOptionText(r)}styleSubcommandTerm(r){return r.split(" ").map(n=>n==="[options]"?this.styleOptionText(n):n[0]==="["||n[0]==="<"?this.styleArgumentText(n):this.styleSubcommandText(n)).join(" ")}styleArgumentTerm(r){return this.styleArgumentText(r)}styleOptionText(r){return r}styleArgumentText(r){return r}styleSubcommandText(r){return r}styleCommandText(r){return r}padWidth(r,n){return Math.max(n.longestOptionTermLength(r,n),n.longestGlobalOptionTermLength(r,n),n.longestSubcommandTermLength(r,n),n.longestArgumentTermLength(r,n))}preformatted(r){return/\n[^\S\r\n]/.test(r)}formatItem(r,n,o,i){let c=" ".repeat(2);if(!o)return c+r;let m=r.padEnd(n+r.length-i.displayWidth(r)),d=2,y=(this.helpWidth??80)-n-d-2,E;return y<this.minWidthToWrap||i.preformatted(o)?E=o:E=i.boxWrap(o,y).replace(/\n/g,`
|
|
4
|
+
`+" ".repeat(n+d)),c+m+" ".repeat(d)+E.replace(/\n/g,`
|
|
5
|
+
${c}`)}boxWrap(r,n){if(n<this.minWidthToWrap)return r;let o=r.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 d=[m.shift()],f=this.displayWidth(d[0]);m.forEach(y=>{let E=this.displayWidth(y);if(f+E<=n){d.push(y),f+=E;return}a.push(d.join(""));let A=y.trimStart();d=[A],f=this.displayWidth(A)}),a.push(d.join(""))}),a.join(`
|
|
6
|
+
`)}};function $f(e){let r=/\x1b\[\d*(;\d*)*m/g;return e.replace(r,"")}Kp.Help=Hp;Kp.stripColor=$f});var Wp=En(Qp=>{var{InvalidArgumentError:DN}=Ai(),Yp=class{constructor(r,n){this.flags=r,this.description=n||"",this.required=r.includes("<"),this.optional=r.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(r),this.mandatory=!1;let o=GN(r);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(r,n){return this.defaultValue=r,this.defaultValueDescription=n,this}preset(r){return this.presetArg=r,this}conflicts(r){return this.conflictsWith=this.conflictsWith.concat(r),this}implies(r){let n=r;return typeof r=="string"&&(n={[r]:!0}),this.implied=Object.assign(this.implied||{},n),this}env(r){return this.envVar=r,this}argParser(r){return this.parseArg=r,this}makeOptionMandatory(r=!0){return this.mandatory=!!r,this}hideHelp(r=!0){return this.hidden=!!r,this}_concatValue(r,n){return n===this.defaultValue||!Array.isArray(n)?[r]:n.concat(r)}choices(r){return this.argChoices=r.slice(),this.parseArg=(n,o)=>{if(!this.argChoices.includes(n))throw new DN(`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?jf(this.name().replace(/^no-/,"")):jf(this.name())}is(r){return this.short===r||this.long===r}isBoolean(){return!this.required&&!this.optional&&!this.negate}},Vp=class{constructor(r){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,r.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(r,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===r)}};function jf(e){return e.split("-").reduce((r,n)=>r+n[0].toUpperCase()+n.slice(1))}function GN(e){let r,n,o=/^-[^-]$/,i=/^--[^-]/,a=e.split(/[ |,]+/).concat("guard");if(o.test(a[0])&&(r=a.shift()),i.test(a[0])&&(n=a.shift()),!r&&o.test(a[0])&&(r=a.shift()),!r&&i.test(a[0])&&(r=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
9
|
- or use a double dash for a long option (and can have two, like '--ws, --workspace')`):o.test(c)?new Error(`${m}
|
|
10
10
|
- too many short flags`):i.test(c)?new Error(`${m}
|
|
11
11
|
- too many long flags`):new Error(`${m}
|
|
12
|
-
- unrecognised flag format`)}if(r===void 0&&n===void 0)throw new Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:r,longFlag:n}}
|
|
12
|
+
- unrecognised flag format`)}if(r===void 0&&n===void 0)throw new Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:r,longFlag:n}}Qp.Option=Yp;Qp.DualOptions=Vp});var Bf=En(qf=>{function $N(e,r){if(Math.abs(e.length-r.length)>3)return Math.max(e.length,r.length);let n=[];for(let o=0;o<=e.length;o++)n[o]=[o];for(let o=0;o<=r.length;o++)n[0][o]=o;for(let o=1;o<=r.length;o++)for(let i=1;i<=e.length;i++){let a=1;e[i-1]===r[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]===r[o-2]&&e[i-2]===r[o-1]&&(n[i][o]=Math.min(n[i][o],n[i-2][o-2]+1))}return n[e.length][r.length]}function jN(e,r){if(!r||r.length===0)return"";r=Array.from(new Set(r));let n=e.startsWith("--");n&&(e=e.slice(2),r=r.map(c=>c.slice(2)));let o=[],i=3,a=.4;return r.forEach(c=>{if(c.length<=1)return;let m=$N(e,c),d=Math.max(e.length,c.length);(d-m)/d>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]}?)`:""}
|
|
15
|
-
- specify the name in Command constructor or using .name()`);return n=n||{},n.isDefault&&(this._defaultCommandName=r._name),(n.noHelp||n.hidden)&&(r._hidden=!0),this._registerCommand(r),r.parent=this,r._checkForBrokenPassThrough(),this}createArgument(r,n){return new
|
|
16
|
-
Expecting one of '${o.join("', '")}'`);return this._lifeCycleHooks[r]?this._lifeCycleHooks[r].push(n):this._lifeCycleHooks[r]=[n],this}exitOverride(r){return r?this._exitCallback=r:this._exitCallback=n=>{if(n.code!=="commander.executeSubCommandAsync")throw n},this}_exit(r,n,o){this._exitCallback&&this._exitCallback(new
|
|
17
|
-
- already used by option '${n.flags}'`)}this.options.push(r)}_registerCommand(r){let n=i=>[i.name()].concat(i.aliases()),o=n(r).find(i=>this._findCommand(i));if(o){let i=n(this._findCommand(o)).join("|"),a=n(r).join("|");throw new Error(`cannot add command '${a}' as already have command '${i}'`)}this.commands.push(r)}addOption(r){this._registerOption(r);let n=r.name(),o=r.attributeName();if(r.negate){let a=r.long.replace(/^--no-/,"--");this._findOption(a)||this.setOptionValueWithSource(o,r.defaultValue===void 0?!0:r.defaultValue,"default")}else r.defaultValue!==void 0&&this.setOptionValueWithSource(o,r.defaultValue,"default");let i=(a,c,m)=>{a==null&&r.presetArg!==void 0&&(a=r.presetArg);let
|
|
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(r,n,o){if(
|
|
14
|
+
(Did you mean ${o[0]}?)`:""}qf.suggestSimilar=jN});var zf=En(tu=>{var qN=require("node:events").EventEmitter,Zp=require("node:child_process"),dr=require("node:path"),Ms=require("node:fs"),se=require("node:process"),{Argument:BN,humanReadableArgName:FN}=ks(),{CommanderError:Xp}=Ai(),{Help:HN,stripColor:KN}=zp(),{Option:Ff,DualOptions:zN}=Wp(),{suggestSimilar:Hf}=Bf(),Jp=class e extends qN{constructor(r){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=r||"",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=>se.stdout.write(n),writeErr:n=>se.stderr.write(n),outputError:(n,o)=>o(n),getOutHelpWidth:()=>se.stdout.isTTY?se.stdout.columns:void 0,getErrHelpWidth:()=>se.stderr.isTTY?se.stderr.columns:void 0,getOutHasColors:()=>eu()??(se.stdout.isTTY&&se.stdout.hasColors?.()),getErrHasColors:()=>eu()??(se.stderr.isTTY&&se.stderr.hasColors?.()),stripColor:n=>KN(n)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(r){return this._outputConfiguration=r._outputConfiguration,this._helpOption=r._helpOption,this._helpCommand=r._helpCommand,this._helpConfiguration=r._helpConfiguration,this._exitCallback=r._exitCallback,this._storeOptionsAsProperties=r._storeOptionsAsProperties,this._combineFlagAndOptionalValue=r._combineFlagAndOptionalValue,this._allowExcessArguments=r._allowExcessArguments,this._enablePositionalOptions=r._enablePositionalOptions,this._showHelpAfterError=r._showHelpAfterError,this._showSuggestionAfterError=r._showSuggestionAfterError,this}_getCommandAndAncestors(){let r=[];for(let n=this;n;n=n.parent)r.push(n);return r}command(r,n,o){let i=n,a=o;typeof i=="object"&&i!==null&&(a=i,i=null),a=a||{};let[,c,m]=r.match(/([^ ]+) *(.*)/),d=this.createCommand(c);return i&&(d.description(i),d._executableHandler=!0),a.isDefault&&(this._defaultCommandName=d._name),d._hidden=!!(a.noHelp||a.hidden),d._executableFile=a.executableFile||null,m&&d.arguments(m),this._registerCommand(d),d.parent=this,d.copyInheritedSettings(this),i?this:d}createCommand(r){return new e(r)}createHelp(){return Object.assign(new HN,this.configureHelp())}configureHelp(r){return r===void 0?this._helpConfiguration:(this._helpConfiguration=r,this)}configureOutput(r){return r===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,r),this)}showHelpAfterError(r=!0){return typeof r!="string"&&(r=!!r),this._showHelpAfterError=r,this}showSuggestionAfterError(r=!0){return this._showSuggestionAfterError=!!r,this}addCommand(r,n){if(!r._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=r._name),(n.noHelp||n.hidden)&&(r._hidden=!0),this._registerCommand(r),r.parent=this,r._checkForBrokenPassThrough(),this}createArgument(r,n){return new BN(r,n)}argument(r,n,o,i){let a=this.createArgument(r,n);return typeof o=="function"?a.default(i).argParser(o):a.default(o),this.addArgument(a),this}arguments(r){return r.trim().split(/ +/).forEach(n=>{this.argument(n)}),this}addArgument(r){let n=this.registeredArguments.slice(-1)[0];if(n&&n.variadic)throw new Error(`only the last argument can be variadic '${n.name()}'`);if(r.required&&r.defaultValue!==void 0&&r.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${r.name()}'`);return this.registeredArguments.push(r),this}helpCommand(r,n){if(typeof r=="boolean")return this._addImplicitHelpCommand=r,this;r=r??"help [command]";let[,o,i]=r.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(r,n){return typeof r!="object"?(this.helpCommand(r,n),this):(this._addImplicitHelpCommand=!0,this._helpCommand=r,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(r,n){let o=["preSubcommand","preAction","postAction"];if(!o.includes(r))throw new Error(`Unexpected value for event passed to hook : '${r}'.
|
|
16
|
+
Expecting one of '${o.join("', '")}'`);return this._lifeCycleHooks[r]?this._lifeCycleHooks[r].push(n):this._lifeCycleHooks[r]=[n],this}exitOverride(r){return r?this._exitCallback=r:this._exitCallback=n=>{if(n.code!=="commander.executeSubCommandAsync")throw n},this}_exit(r,n,o){this._exitCallback&&this._exitCallback(new Xp(r,n,o)),se.exit(r)}action(r){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),r.apply(this,a)};return this._actionHandler=n,this}createOption(r,n){return new Ff(r,n)}_callParseArg(r,n,o,i){try{return r.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(r){let n=r.short&&this._findOption(r.short)||r.long&&this._findOption(r.long);if(n){let o=r.long&&this._findOption(r.long)?r.long:r.short;throw new Error(`Cannot add option '${r.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${o}'
|
|
17
|
+
- already used by option '${n.flags}'`)}this.options.push(r)}_registerCommand(r){let n=i=>[i.name()].concat(i.aliases()),o=n(r).find(i=>this._findCommand(i));if(o){let i=n(this._findCommand(o)).join("|"),a=n(r).join("|");throw new Error(`cannot add command '${a}' as already have command '${i}'`)}this.commands.push(r)}addOption(r){this._registerOption(r);let n=r.name(),o=r.attributeName();if(r.negate){let a=r.long.replace(/^--no-/,"--");this._findOption(a)||this.setOptionValueWithSource(o,r.defaultValue===void 0?!0:r.defaultValue,"default")}else r.defaultValue!==void 0&&this.setOptionValueWithSource(o,r.defaultValue,"default");let i=(a,c,m)=>{a==null&&r.presetArg!==void 0&&(a=r.presetArg);let d=this.getOptionValue(o);a!==null&&r.parseArg?a=this._callParseArg(r,a,d,c):a!==null&&r.variadic&&(a=r._concatValue(a,d)),a==null&&(r.negate?a=!1:r.isBoolean()||r.optional?a=!0:a=""),this.setOptionValueWithSource(o,a,m)};return this.on("option:"+n,a=>{let c=`error: option '${r.flags}' argument '${a}' is invalid.`;i(a,c,"cli")}),r.envVar&&this.on("optionEnv:"+n,a=>{let c=`error: option '${r.flags}' value '${a}' from env '${r.envVar}' is invalid.`;i(a,c,"env")}),this}_optionEx(r,n,o,i,a){if(typeof n=="object"&&n instanceof Ff)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let c=this.createOption(n,o);if(c.makeOptionMandatory(!!r.mandatory),typeof i=="function")c.default(a).argParser(i);else if(i instanceof RegExp){let m=i;i=(d,f)=>{let y=m.exec(d);return y?y[0]:f},c.default(a).argParser(i)}else c.default(i);return this.addOption(c)}option(r,n,o,i){return this._optionEx({},r,n,o,i)}requiredOption(r,n,o,i){return this._optionEx({mandatory:!0},r,n,o,i)}combineFlagAndOptionalValue(r=!0){return this._combineFlagAndOptionalValue=!!r,this}allowUnknownOption(r=!0){return this._allowUnknownOption=!!r,this}allowExcessArguments(r=!0){return this._allowExcessArguments=!!r,this}enablePositionalOptions(r=!0){return this._enablePositionalOptions=!!r,this}passThroughOptions(r=!0){return this._passThroughOptions=!!r,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(r=!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=!!r,this}getOptionValue(r){return this._storeOptionsAsProperties?this[r]:this._optionValues[r]}setOptionValue(r,n){return this.setOptionValueWithSource(r,n,void 0)}setOptionValueWithSource(r,n,o){return this._storeOptionsAsProperties?this[r]=n:this._optionValues[r]=n,this._optionValueSources[r]=o,this}getOptionValueSource(r){return this._optionValueSources[r]}getOptionValueSourceWithGlobals(r){let n;return this._getCommandAndAncestors().forEach(o=>{o.getOptionValueSource(r)!==void 0&&(n=o.getOptionValueSource(r))}),n}_prepareUserArgs(r,n){if(r!==void 0&&!Array.isArray(r))throw new Error("first parameter to parse must be array or undefined");if(n=n||{},r===void 0&&n.from===void 0){se.versions?.electron&&(n.from="electron");let i=se.execArgv??[];(i.includes("-e")||i.includes("--eval")||i.includes("-p")||i.includes("--print"))&&(n.from="eval")}r===void 0&&(r=se.argv),this.rawArgs=r.slice();let o;switch(n.from){case void 0:case"node":this._scriptPath=r[1],o=r.slice(2);break;case"electron":se.defaultApp?(this._scriptPath=r[1],o=r.slice(2)):o=r.slice(1);break;case"user":o=r.slice(0);break;case"eval":o=r.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(r,n){this._prepareForParse();let o=this._prepareUserArgs(r,n);return this._parseCommand([],o),this}async parseAsync(r,n){this._prepareForParse();let o=this._prepareUserArgs(r,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(r,n,o){if(Ms.existsSync(r))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=`'${r}' 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(r,n){n=n.slice();let o=!1,i=[".js",".ts",".tsx",".mjs",".cjs"];function a(y,E){let A=
|
|
21
|
+
- ${i}`;throw new Error(a)}_executeSubCommand(r,n){n=n.slice();let o=!1,i=[".js",".ts",".tsx",".mjs",".cjs"];function a(y,E){let A=dr.resolve(y,E);if(Ms.existsSync(A))return A;if(i.includes(dr.extname(E)))return;let ye=i.find(Ue=>Ms.existsSync(`${A}${Ue}`));if(ye)return`${A}${ye}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let c=r._executableFile||`${this._name}-${r._name}`,m=this._executableDir||"";if(this._scriptPath){let y;try{y=Ms.realpathSync(this._scriptPath)}catch{y=this._scriptPath}m=dr.resolve(dr.dirname(y),m)}if(m){let y=a(m,c);if(!y&&!r._executableFile&&this._scriptPath){let E=dr.basename(this._scriptPath,dr.extname(this._scriptPath));E!==this._name&&(y=a(m,`${E}-${r._name}`))}c=y||c}o=i.includes(dr.extname(c));let d;se.platform!=="win32"?o?(n.unshift(c),n=Kf(se.execArgv).concat(n),d=Zp.spawn(se.argv[0],n,{stdio:"inherit"})):d=Zp.spawn(c,n,{stdio:"inherit"}):(this._checkForMissingExecutable(c,m,r._name),n.unshift(c),n=Kf(se.execArgv).concat(n),d=Zp.spawn(se.execPath,n,{stdio:"inherit"})),d.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(E=>{se.on(E,()=>{d.killed===!1&&d.exitCode===null&&d.kill(E)})});let f=this._exitCallback;d.on("close",y=>{y=y??1,f?f(new Xp(y,"commander.executeSubCommandAsync","(close)")):se.exit(y)}),d.on("error",y=>{if(y.code==="ENOENT")this._checkForMissingExecutable(c,m,r._name);else if(y.code==="EACCES")throw new Error(`'${c}' not executable`);if(!f)se.exit(1);else{let E=new Xp(1,"commander.executeSubCommandAsync","(error)");E.nestedError=y,f(E)}}),this.runningCommand=d}_dispatchSubcommand(r,n,o){let i=this._findCommand(r);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(r){r||this.help();let n=this._findCommand(r);return n&&!n._executableHandler&&n.help(),this._dispatchSubcommand(r,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((r,n)=>{r.required&&this.args[n]==null&&this.missingArgument(r.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let r=(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)=>r(o,m,c),o.defaultValue))):a===void 0&&(a=[]):i<this.args.length&&(a=this.args[i],o.parseArg&&(a=r(o,a,o.defaultValue))),n[i]=a}),this.processedArgs=n}_chainOrCall(r,n){return r&&r.then&&typeof r.then=="function"?r.then(()=>n()):n()}_chainOrCallHooks(r,n){let o=r,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(r,n,o){let i=r;return this._lifeCycleHooks[o]!==void 0&&this._lifeCycleHooks[o].forEach(a=>{i=this._chainOrCall(i,()=>a(this,n))}),i}_parseCommand(r,n){let o=this.parseOptions(n);if(this._parseOptionsEnv(),this._parseOptionsImplied(),r=r.concat(o.operands),n=o.unknown,this.args=r.concat(n),r&&this._findCommand(r[0]))return this._dispatchSubcommand(r[0],r.slice(1),n);if(this._getHelpCommand()&&r[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(r[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(n),this._dispatchSubcommand(this._defaultCommandName,r,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,r,n)})),c=this._chainOrCallHooks(c,"postAction"),c}if(this.parent&&this.parent.listenerCount(a))i(),this._processArguments(),this.parent.emit(a,r,n);else if(r.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",r,n);this.listenerCount("command:*")?this.emit("command:*",r,n):this.commands.length?this.unknownCommand():(i(),this._processArguments())}else this.commands.length?(i(),this.help({error:!0})):(i(),this._processArguments())}_findCommand(r){if(r)return this.commands.find(n=>n._name===r||n._aliases.includes(r))}_findOption(r){return this.options.find(n=>n.is(r))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(r=>{r.options.forEach(n=>{n.mandatory&&r.getOptionValue(n.attributeName())===void 0&&r.missingMandatoryOptionValue(n)})})}_checkForConflictingLocalOptions(){let r=this.options.filter(o=>{let i=o.attributeName();return this.getOptionValue(i)===void 0?!1:this.getOptionValueSource(i)!=="default"});r.filter(o=>o.conflictsWith.length>0).forEach(o=>{let i=r.find(a=>o.conflictsWith.includes(a.attributeName()));i&&this._conflictingOption(o,i)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(r=>{r._checkForConflictingLocalOptions()})}parseOptions(r){let n=[],o=[],i=n,a=r.slice();function c(d){return d.length>1&&d[0]==="-"}let m=null;for(;a.length;){let d=a.shift();if(d==="--"){i===o&&i.push(d),i.push(...a);break}if(m&&!c(d)){this.emit(`option:${m.name()}`,d);continue}if(m=null,c(d)){let f=this._findOption(d);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(d.length>2&&d[0]==="-"&&d[1]!=="-"){let f=this._findOption(`-${d[1]}`);if(f){f.required||f.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${f.name()}`,d.slice(2)):(this.emit(`option:${f.name()}`),a.unshift(`-${d.slice(2)}`));continue}}if(/^--[^=]+=/.test(d)){let f=d.indexOf("="),y=this._findOption(d.slice(0,f));if(y&&(y.required||y.optional)){this.emit(`option:${y.name()}`,d.slice(f+1));continue}}if(c(d)&&(i=o),(this._enablePositionalOptions||this._passThroughOptions)&&n.length===0&&o.length===0){if(this._findCommand(d)){n.push(d),a.length>0&&o.push(...a);break}else if(this._getHelpCommand()&&d===this._getHelpCommand().name()){n.push(d),a.length>0&&n.push(...a);break}else if(this._defaultCommandName){o.push(d),a.length>0&&o.push(...a);break}}if(this._passThroughOptions){i.push(d),a.length>0&&i.push(...a);break}i.push(d)}return{operands:n,unknown:o}}opts(){if(this._storeOptionsAsProperties){let r={},n=this.options.length;for(let o=0;o<n;o++){let i=this.options[o].attributeName();r[i]=i===this._versionOptionName?this._version:this[i]}return r}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((r,n)=>Object.assign(r,n.opts()),{})}error(r,n){this._outputConfiguration.outputError(`${r}
|
|
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=n||{},i=o.exitCode||1,a=o.code||"commander.error";this._exit(i,a,r)}_parseOptionsEnv(){this.options.forEach(r=>{if(r.envVar&&r.envVar in
|
|
25
|
-
`),this._exit(0,"commander.version",r)}),this}description(r,n){return r===void 0&&n===void 0?this._description:(this._description=r,n&&(this._argsDescription=n),this)}summary(r){return r===void 0?this._summary:(this._summary=r,this)}alias(r){if(r===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]),r===n._name)throw new Error("Command alias can't be the same as its name");let o=this.parent?._findCommand(r);if(o){let i=[o.name()].concat(o.aliases()).join("|");throw new Error(`cannot add alias '${r}' to command '${this.name()}' as already have command '${i}'`)}return n._aliases.push(r),this}aliases(r){return r===void 0?this._aliases:(r.forEach(n=>this.alias(n)),this)}usage(r){if(r===void 0){if(this._usage)return this._usage;let n=this.registeredArguments.map(o=>
|
|
24
|
+
`),this.outputHelp({error:!0}));let o=n||{},i=o.exitCode||1,a=o.code||"commander.error";this._exit(i,a,r)}_parseOptionsEnv(){this.options.forEach(r=>{if(r.envVar&&r.envVar in se.env){let n=r.attributeName();(this.getOptionValue(n)===void 0||["default","config","env"].includes(this.getOptionValueSource(n)))&&(r.required||r.optional?this.emit(`optionEnv:${r.name()}`,se.env[r.envVar]):this.emit(`optionEnv:${r.name()}`))}})}_parseOptionsImplied(){let r=new zN(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())&&r.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(r){let n=`error: missing required argument '${r}'`;this.error(n,{code:"commander.missingArgument"})}optionMissingArgument(r){let n=`error: option '${r.flags}' argument missing`;this.error(n,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(r){let n=`error: required option '${r.flags}' not specified`;this.error(n,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(r,n){let o=c=>{let m=c.attributeName(),d=this.getOptionValue(m),f=this.options.find(E=>E.negate&&m===E.attributeName()),y=this.options.find(E=>!E.negate&&m===E.attributeName());return f&&(f.presetArg===void 0&&d===!1||f.presetArg!==void 0&&d===f.presetArg)?f:y||c},i=c=>{let m=o(c),d=m.attributeName();return this.getOptionValueSource(d)==="env"?`environment variable '${m.envVar}'`:`option '${m.flags}'`},a=`error: ${i(r)} cannot be used with ${i(n)}`;this.error(a,{code:"commander.conflictingOption"})}unknownOption(r){if(this._allowUnknownOption)return;let n="";if(r.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=Hf(r,i)}let o=`error: unknown option '${r}'${n}`;this.error(o,{code:"commander.unknownOption"})}_excessArguments(r){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 ${r.length}.`;this.error(a,{code:"commander.excessArguments"})}unknownCommand(){let r=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=Hf(r,i)}let o=`error: unknown command '${r}'${n}`;this.error(o,{code:"commander.unknownCommand"})}version(r,n,o){if(r===void 0)return this._version;this._version=r,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(`${r}
|
|
25
|
+
`),this._exit(0,"commander.version",r)}),this}description(r,n){return r===void 0&&n===void 0?this._description:(this._description=r,n&&(this._argsDescription=n),this)}summary(r){return r===void 0?this._summary:(this._summary=r,this)}alias(r){if(r===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]),r===n._name)throw new Error("Command alias can't be the same as its name");let o=this.parent?._findCommand(r);if(o){let i=[o.name()].concat(o.aliases()).join("|");throw new Error(`cannot add alias '${r}' to command '${this.name()}' as already have command '${i}'`)}return n._aliases.push(r),this}aliases(r){return r===void 0?this._aliases:(r.forEach(n=>this.alias(n)),this)}usage(r){if(r===void 0){if(this._usage)return this._usage;let n=this.registeredArguments.map(o=>FN(o));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?n:[]).join(" ")}return this._usage=r,this}name(r){return r===void 0?this._name:(this._name=r,this)}nameFromFilename(r){return this._name=dr.basename(r,dr.extname(r)),this}executableDir(r){return r===void 0?this._executableDir:(this._executableDir=r,this)}helpInformation(r){let n=this.createHelp(),o=this._getOutputContext(r);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(r){r=r||{};let n=!!r.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(r){let n;typeof r=="function"&&(n=r,r=void 0);let o=this._getOutputContext(r),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(r,n){return typeof r=="boolean"?(r?this._helpOption=this._helpOption??void 0:this._helpOption=null,this):(r=r??"-h, --help",n=n??"display help for command",this._helpOption=this.createOption(r,n),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(r){return this._helpOption=r,this}help(r){this.outputHelp(r);let n=Number(se.exitCode??0);n===0&&r&&typeof r!="function"&&r.error&&(n=1),this._exit(n,"commander.help","(outputHelp)")}addHelpText(r,n){let o=["beforeAll","before","after","afterAll"];if(!o.includes(r))throw new Error(`Unexpected value for position to addHelpText.
|
|
26
26
|
Expecting one of '${o.join("', '")}'`);let i=`${r}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(r){let n=this._getHelpOption();n&&r.find(i=>n.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function
|
|
28
|
-
`)}function
|
|
29
|
-
`)}var cg="/oauth/callback",HN=5*nu,KN="<!doctype html><html><body><h1>Login complete</h1><p>You can close this tab and return to the terminal.</p></body></html>",js="<!doctype html><html><body><h1>Login failed</h1><p>Return to the terminal for details.</p></body></html>";function zN(e){return(0,pu.platform)()==="darwin"?["open",[e]]:(0,pu.platform)()==="win32"?["rundll32",["url.dll,FileProtocolHandler",e]]:["xdg-open",[e]]}function YN(e){let[r,n]=zN(e),o=(0,ag.spawnSync)(r,n,{stdio:"ignore"});return o.error===void 0&&o.status===0}async function VN(e,r,n){return new Promise((o,i)=>{let a=setTimeout(()=>{i(new Error("Timed out waiting for the browser to complete login (5 minutes)."))},HN),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!==cg){l.writeHead(404,{"Content-Type":"text/html"}),l.end(js);return}let y=f.searchParams.get("error");if(y){let A=f.searchParams.get("error_description")??"";c(l,400,js,()=>i(new Error(`Authorization failed: ${y}${A?` (${A})`:""}`)));return}if(f.searchParams.get("state")!==r){c(l,400,js,()=>i(new Error("State mismatch on OAuth callback; aborting for safety.")));return}let E=f.searchParams.get("code");if(!E){c(l,400,js,()=>i(new Error("OAuth callback did not include an authorization code.")));return}c(l,200,KN,()=>o(E))})})}async function pg(e){let r=(0,sg.createServer)();r.on("connection",a=>a.unref()),await new Promise((a,c)=>{r.once("error",c),r.listen(0,"127.0.0.1",()=>{r.off("error",c),a()})});let{port:n}=r.address(),o=`http://127.0.0.1:${n}`,i=`${o}${cg}`;try{let a=e.buildAuthorizeUrl(i);return YN(a)?B("Opening your browser to complete login..."):(B("Visit this URL in your browser to complete login:"),B(` ${a}`)),{code:await VN(r,e.state,o),redirectUri:i}}finally{r.close()}}var g={};vt(g,{Assign:()=>QN,Clone:()=>Ci,Create:()=>ZL,Discard:()=>XL,Metrics:()=>jt,Update:()=>JL});var jt={assign:0,create:0,clone:0,discard:0,update:0};function QN(e,r){return jt.assign+=1,{...e,...r}}var s={};vt(s,{Entries:()=>TL,EntriesRegExp:()=>hL,Every:()=>fL,EveryAll:()=>gL,GraphemeCount:()=>mL,HasPropertyKey:()=>yL,IsArray:()=>En,IsAsyncIterator:()=>tL,IsBigInt:()=>Ri,IsBoolean:()=>yg,IsClassInstance:()=>pL,IsConstructor:()=>rL,IsDeepEqual:()=>du,IsEqual:()=>te,IsFunction:()=>hg,IsGreaterEqualThan:()=>Eg,IsGreaterThan:()=>aL,IsInteger:()=>mu,IsIterator:()=>nL,IsLessEqualThan:()=>Tg,IsLessThan:()=>sL,IsMaxLength:()=>lL,IsMinLength:()=>dL,IsMultipleOf:()=>cL,IsNull:()=>Hs,IsNumber:()=>Ks,IsObject:()=>_n,IsObjectNotArray:()=>oL,IsString:()=>Gr,IsSymbol:()=>iL,IsUndefined:()=>lu,IsValueLike:()=>uL,Keys:()=>Fs,Symbols:()=>EL,Values:()=>_L});function Dr(e,r,n){return e>=r&&e<=n}function ug(e){return Dr(e,127462,127487)}function WN(e){return Dr(e,65024,65039)}function ZN(e){return Dr(e,768,879)||Dr(e,6832,6911)||Dr(e,7616,7679)||Dr(e,65056,65071)}function Bs(e){return e>65535?2:1}function mg(e,r){for(;r<e.length;){let n=e.codePointAt(r);if(ZN(n)||WN(n))r+=Bs(n);else break}return r}function uu(e,r){let n=e.codePointAt(r),o=r+Bs(n);for(o=mg(e,o);o<e.length-1&&e[o]==="\u200D";){let i=e.codePointAt(o+1);o+=1+Bs(i),o=mg(e,o)}return ug(n)&&o<e.length&&ug(e.codePointAt(o))&&(o+=Bs(e.codePointAt(o))),o}function lg(e){return Dr(e,55296,56319)||Dr(e,768,879)||e===8205}function dg(e){let r=0,n=0;for(;n<e.length;)n=uu(e,n),r++;return r}function XN(e,r){let n=0,o=0;for(;o<e.length;)if(o=uu(e,o),n++,n>=r)return!0;return!1}function JN(e,r){let n=0,o=0;for(;o<e.length;)if(o=uu(e,o),n++,n>r)return!1;return!0}function fg(e,r){let n=0;for(;n<e.length;){if(lg(e.charCodeAt(n)))return XN(e,r);if(n++,n>=r)return!0}return!1}function gg(e,r){let n=0;for(;n<e.length;){if(lg(e.charCodeAt(n)))return JN(e,r);if(n++,n>r)return!1}return!0}function En(e){return Array.isArray(e)}function tL(e){return _n(e)&&Symbol.asyncIterator in e}function Ri(e){return te(typeof e,"bigint")}function yg(e){return te(typeof e,"boolean")}function rL(e){if(lu(e)||!hg(e))return!1;let r=Function.prototype.toString.call(e);return!!(/^class\s/.test(r)||/\[native code\]/.test(r))}function hg(e){return te(typeof e,"function")}function mu(e){return Number.isInteger(e)}function nL(e){return _n(e)&&Symbol.iterator in e}function Hs(e){return te(e,null)}function Ks(e){return Number.isFinite(e)}function oL(e){return _n(e)&&!En(e)}function _n(e){return te(typeof e,"object")&&!Hs(e)}function Gr(e){return te(typeof e,"string")}function iL(e){return te(typeof e,"symbol")}function lu(e){return te(e,void 0)}function te(e,r){return e===r}function aL(e,r){return e>r}function sL(e,r){return e<r}function Tg(e,r){return e<=r}function Eg(e,r){return e>=r}function cL(e,r){if(Ri(e)||Ri(r))return BigInt(e)%BigInt(r)===0n;let n=1e-10;if(!Ks(e)||mu(e)&&1/r%1===0)return!0;let o=e%r;return Math.min(Math.abs(o),Math.abs(o-r))<n}function pL(e){if(!_n(e))return!1;let r=globalThis.Object.getPrototypeOf(e);return Hs(r)?!1:te(typeof r.constructor,"function")&&!(te(r.constructor,globalThis.Object)||te(r.constructor.name,"Object"))}function uL(e){return Ri(e)||yg(e)||Hs(e)||Ks(e)||Gr(e)||lu(e)}function mL(e){return dg(e)}function lL(e,r){return gg(e,r)}function dL(e,r){return fg(e,r)}function fL(e,r,n){for(let o=r;o<e.length;o++)if(!n(e[o],o))return!1;return!0}function gL(e,r,n){let o=!0;for(let i=r;i<e.length;i++)n(e[i],i)||(o=!1);return o}function yL(e,r){return te(r,"__proto__")||te(r,"constructor")?Object.prototype.hasOwnProperty.call(e,r):r in e}function hL(e){return Fs(e).map(r=>[new RegExp(`^${r}$`),e[r]])}function TL(e){return Object.entries(e)}function Fs(e){return Object.getOwnPropertyNames(e)}function EL(e){return Object.getOwnPropertySymbols(e)}function _L(e){return Object.values(e)}function IL(e,r){if(!_n(r))return!1;let n=Fs(e);return te(n.length,Fs(r).length)&&n.every(o=>du(e[o],r[o]))}function bL(e,r){return En(r)&&te(e.length,r.length)&&e.every((n,o)=>du(e[o],r[o]))}function du(e,r){return En(e)?bL(e,r):_n(e)?IL(e,r):te(e,r)}var at={};vt(at,{IsBigInt64Array:()=>ML,IsBigUint64Array:()=>DL,IsBoolean:()=>SL,IsDate:()=>$L,IsFloat32Array:()=>vL,IsFloat64Array:()=>kL,IsInt16Array:()=>UL,IsInt32Array:()=>NL,IsInt8Array:()=>RL,IsMap:()=>qL,IsNumber:()=>OL,IsRegExp:()=>GL,IsSet:()=>jL,IsString:()=>AL,IsTypeArray:()=>xL,IsUint16Array:()=>wL,IsUint32Array:()=>LL,IsUint8Array:()=>CL,IsUint8ClampedArray:()=>PL});function SL(e){return e instanceof Boolean}function OL(e){return e instanceof Number}function AL(e){return e instanceof String}function xL(e){return globalThis.ArrayBuffer.isView(e)}function RL(e){return e instanceof globalThis.Int8Array}function CL(e){return e instanceof globalThis.Uint8Array}function PL(e){return e instanceof globalThis.Uint8ClampedArray}function UL(e){return e instanceof globalThis.Int16Array}function wL(e){return e instanceof globalThis.Uint16Array}function NL(e){return e instanceof globalThis.Int32Array}function LL(e){return e instanceof globalThis.Uint32Array}function vL(e){return e instanceof globalThis.Float32Array}function kL(e){return e instanceof globalThis.Float64Array}function ML(e){return e instanceof globalThis.BigInt64Array}function DL(e){return e instanceof globalThis.BigUint64Array}function GL(e){return e instanceof globalThis.RegExp}function $L(e){return e instanceof globalThis.Date}function jL(e){return e instanceof globalThis.Set}function qL(e){return e instanceof globalThis.Map}function FL(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~guard")}function HL(e){return e.map(r=>fu(r))}function KL(e){let r={},n=Object.getOwnPropertyDescriptors(e);for(let o of Object.keys(n)){let i=n[o];s.HasPropertyKey(i,"value")&&Object.defineProperty(r,o,{...i,value:fu(i.value)})}return r}function zL(e){return new RegExp(e.source,e.flags)}function fu(e){return e instanceof RegExp?zL(e):FL(e)?e:s.IsArray(e)?HL(e):s.IsObject(e)?KL(e):e}function Ci(e){return jt.clone+=1,fu(e)}var Rt={};vt(Rt,{Get:()=>QL,Reset:()=>YL,Set:()=>VL});var In={immutableTypes:!1,maxErrors:8,useEval:!0,exactOptionalPropertyTypes:!1,enumerableKind:!1};function YL(){In.immutableTypes=!1,In.maxErrors=8,In.useEval=!0,In.exactOptionalPropertyTypes=!1,In.enumerableKind=!1}function VL(e){for(let r of s.Keys(e)){let n=e[r];n!==void 0&&Object.defineProperty(In,r,{value:n})}}function QL(){return In}function WL(e,r,n={}){for(let o of Object.keys(r))Object.defineProperty(e,o,{configurable:!0,writable:!0,enumerable:!1,value:r[o]});return e}function _g(e,r){return{...e,...r}}function ZL(e,r,n={}){jt.create+=1;let o=Rt.Get(),i=_g(r,n),a=o.enumerableKind?_g(i,e):WL(i,e);return o.immutableTypes?Object.freeze(a):a}function XL(e,r){jt.discard+=1;let n={},o=Object.getOwnPropertyDescriptors(Ci(e)),i=new Set(r);for(let a of Object.keys(o))i.has(a)||Object.defineProperty(n,a,o[a]);return n}function JL(e,r,n){jt.update+=1;let o=Rt.Get(),i=Ci(e);for(let a of Object.keys(r))Object.defineProperty(i,a,{configurable:!0,writable:!0,enumerable:o.enumerableKind,value:r[a]});for(let a of Object.keys(n))Object.defineProperty(i,a,{configurable:!0,enumerable:!0,writable:!0,value:n[a]});return i}function b(e,r){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.IsEqual(e["~kind"],r)}function O(e){return s.IsObject(e)}function Ig(e){return g.Create({"~kind":"OptionalAddAction"},{type:e},{})}function bg(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"type")&&s.IsEqual(e["~kind"],"OptionalAddAction")&&O(e.type)}function Sg(e){return g.Create({"~kind":"OptionalRemoveAction"},{type:e},{})}function Og(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"type")&&s.IsEqual(e["~kind"],"OptionalRemoveAction")&&O(e.type)}function Ag(e){return g.Create({"~kind":"ReadonlyAddAction"},{type:e},{})}function xg(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"type")&&s.IsEqual(e["~kind"],"ReadonlyAddAction")&&O(e.type)}function Rg(e){return g.Create({"~kind":"ReadonlyRemoveAction"},{type:e},{})}function Cg(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"type")&&s.IsEqual(e["~kind"],"ReadonlyRemoveAction")&&O(e.type)}function P(e,r,n){return g.Create({"~kind":"Deferred"},{action:e,parameters:r,options:n},{})}function Pg(e){return b(e,"Deferred")}function gu(e){return g.Update(e,{"~immutable":!0},{})}function $r(e){return gu(e)}function bn(e){return O(e)&&s.HasPropertyKey(e,"~immutable")}function so(e){return g.Discard(e,["~optional"])}function ht(e){return g.Update(e,{"~optional":!0},{})}function zs(e){return ht(e)}function Me(e){return O(e)&&s.HasPropertyKey(e,"~optional")}function Ys(e){return g.Discard(e,["~readonly"])}function Tt(e){return g.Update(e,{"~readonly":!0},{})}function Vs(e){return Tt(e)}function Sn(e){return O(e)&&s.HasPropertyKey(e,"~readonly")}function qt(e,r){return g.Create({"~kind":"Array"},{type:"array",items:e},r)}function re(e){return b(e,"Array")}function Qs(e){return g.Discard(e,["~kind","type","items"])}function Wt(e,r){return g.Create({"~kind":"AsyncIterator"},{type:"asyncIterator",iteratorItems:e},r)}function ot(e){return b(e,"AsyncIterator")}function Ug(e){return g.Discard(e,["~kind","type","iteratorItems"])}function wg(e){return{enumerable:Rt.Get().enumerableKind,writable:!1,configurable:!1,value:e}}var Ws=class{constructor(){globalThis.Object.defineProperty(this,"~kind",wg("Base")),globalThis.Object.defineProperty(this,"~guard",wg({check:r=>this.Check(r),errors:r=>this.Errors(r)}))}Check(r){return!0}Errors(r){return[]}Convert(r){return r}Clean(r){return r}Default(r){return r}Create(){throw new Error("Create not implemented")}Clone(){throw Error("Clone not implemented")}};function Ct(e){return b(e,"Base")}function jr(e,r,n={}){return g.Create({"~kind":"Constructor"},{type:"constructor",parameters:e,instanceType:r},n)}function De(e){return b(e,"Constructor")}function Ng(e){return g.Discard(e,["~kind","type","parameters","instanceType"])}function qr(e,r,n={}){return g.Create({"~kind":"Function"},{type:"function",parameters:e,returnType:r},n)}function Ge(e){return b(e,"Function")}function Lg(e){return g.Discard(e,["~kind","type","parameters","returnType"])}function we(e,r){return g.Create({"~kind":"Ref"},{$ref:e},r)}function pe(e){return b(e,"Ref")}function Br(e,r){return g.Create({"~kind":"Generic"},{type:"generic",parameters:e,expression:r})}function co(e){return b(e,"Generic")}var vg="(?!)";function X(e){return g.Create({"~kind":"Never"},{not:{}},e)}function dr(e){return b(e,"Never")}function ev(){return["(not-resolvable)",X()]}function tv(){return["(not-generic)",X()]}function rv(e,r,n){return[e,Br(r,n)]}function nv(e,r,n){return r in e?kg(e,r,e[r],n):ev()}function kg(e,r,n,o){return co(n)?rv(r,n.parameters,n.expression):pe(n)?nv(e,n.$ref,o):tv()}function Mg(e,r,n){return kg(e,"(anonymous)",r,n)}function Zt(e,r,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:r},n)}function le(e){return b(e,"Cyclic")}var ae={};vt(ae,{Match:()=>ov});function ov(e,r){return r[e.length]?.(...e)??(()=>{throw Error("Invalid Arguments")})()}function Ze(e){return g.Create({"~kind":"Unknown"},{},e)}function Et(e){return b(e,"Unknown")}function Pi(...e){let[r,n]=ae.Match(e,{2:(o,i)=>[o,i,i],1:o=>[o,Ze(),Ze()]});return g.Create({"~kind":"Infer"},{type:"infer",name:r,extends:n},{})}function xe(e){return b(e,"Infer")}function po(e){return g.Create({"~kind":"Any"},{},e)}function st(e){return b(e,"Any")}function Dg(e){return s.IsObjectNotArray(e)}function Gg(e){return s.Keys(e).filter(n=>isNaN(n)).reduce((n,o)=>[...n,e[o]],[])}function $g(e,r){let n=Dg(e)?Gg(e):e;return g.Create({"~kind":"Enum"},{enum:n},r)}function Re(e){return b(e,"Enum")}function Pt(e,r={}){return g.Create({"~kind":"Intersect"},{allOf:e},r)}function w(e){return b(e,"Intersect")}function jg(e){return g.Discard(e,["~kind","allOf"])}function H(){throw new Error("Unreachable")}var Hr={};vt(Hr,{Hash:()=>bv,HashCode:()=>Yg});function iv(e){let r=new Set,n=e;for(;n&&n!==Object.prototype;){for(let o of Reflect.ownKeys(n))o!=="constructor"&&typeof o!="symbol"&&r.add(o);n=Object.getPrototypeOf(n)}return[...r]}function av(e){return typeof e=="number"}var ct;(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"})(ct||(ct={}));var uo=BigInt("14695981039346656037"),[sv,cv]=[BigInt("1099511628211"),BigInt("18446744073709551616")],pv=Array.from({length:256}).map((e,r)=>BigInt(r)),Hg=new Float64Array(1),Kg=new DataView(Hg.buffer),zg=new Uint8Array(Hg.buffer);function Xe(e){uo=uo^pv[e],uo=uo*sv%cv}function uv(e){Xe(ct.Array);for(let r of e)Fr(r)}function mv(e){Xe(ct.BigInt),Kg.setBigInt64(0,e);for(let r of zg)Xe(r)}function Bg(e){Xe(ct.Boolean),Xe(e?1:0)}function lv(e){Xe(ct.Constructor),Fr(e.toString())}function dv(e){Xe(ct.Date),Fr(e.getTime())}function fv(e){Xe(ct.Function),Fr(e.toString())}function gv(e){Xe(ct.Null)}function Fg(e){Xe(ct.Number),Kg.setFloat64(0,e,!0);for(let r of zg)Xe(r)}function yv(e){Xe(ct.Object);for(let r of iv(e).sort())Fr(r),Fr(e[r])}function hv(e){Xe(ct.RegExp),yu(e.toString())}var Tv=new TextEncoder;function yu(e){Xe(ct.String);for(let r of Tv.encode(e))Xe(r)}function Ev(e){Xe(ct.Symbol),Fr(e.toString())}function _v(e){Xe(ct.TypeArray);let r=new Uint8Array(e.buffer);for(let n=0;n<r.length;n++)Xe(r[n])}function Iv(e){return Xe(ct.Undefined)}function Fr(e){return at.IsTypeArray(e)?_v(e):at.IsDate(e)?dv(e):at.IsRegExp(e)?hv(e):at.IsBoolean(e)?Bg(e.valueOf()):at.IsString(e)?yu(e.valueOf()):at.IsNumber(e)?Fg(e.valueOf()):av(e)?Fg(e):s.IsArray(e)?uv(e):s.IsBoolean(e)?Bg(e):s.IsBigInt(e)?mv(e):s.IsConstructor(e)?lv(e):s.IsNull(e)?gv(e):s.IsObject(e)?yv(e):s.IsString(e)?yu(e):s.IsSymbol(e)?Ev(e):s.IsUndefined(e)?Iv(e):s.IsFunction(e)?fv(e):H()}function Yg(e){return uo=BigInt("14695981039346656037"),Fr(e),uo}function bv(e){return Yg(e).toString(16).padStart(16,"0")}function Vg(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 Sv=Vg;function Qg(){return Sv}var Ui=class{constructor(r,n){this.type=r,this.decode=n}Encode(r){let n=this.type,o=On(n)?c=>this.decode(n["~codec"].decode(c)):this.decode,i=On(n)?c=>n["~codec"].encode(r(c)):r,a={decode:o,encode:i};return g.Update(this.type,{"~codec":a},{})}},wi=class{constructor(r){this.type=r}Decode(r){return new Ui(this.type,r)}};function Zs(e){return new wi(e)}function Zg(e,r){return Zs(e).Decode(r).Encode(()=>{throw Error("Encode not implemented")})}function Xg(e,r){return Zs(e).Decode(()=>{throw Error("Decode not implemented")}).Encode(r)}function On(e){return O(e)&&s.HasPropertyKey(e,"~codec")&&s.IsObject(e["~codec"])&&s.HasPropertyKey(e["~codec"],"encode")&&s.HasPropertyKey(e["~codec"],"decode")}function Av(e,r){let n=Xs(e)?[...e["~refine"],r]:[r];return g.Update(e,{"~refine":n},{})}function Jg(e,r,n="error"){return Av(e,{refine:r,message:n})}function Xs(e){return O(e)&&s.HasPropertyKey(e,"~refine")}var ey="-?(?:0|[1-9][0-9]*)n";function Ni(e){return g.Create({"~kind":"BigInt"},{type:"bigint"},e)}function St(e){return b(e,"BigInt")}function Js(e){return g.Create({"~kind":"Boolean"},{type:"boolean"},e)}function pt(e){return b(e,"Boolean")}function Li(e){return g.Create({"~kind":"Identifier"},{name:e})}function ty(e){return b(e,"Identifier")}var ec="-?(?:0|[1-9][0-9]*)";function An(e){return g.Create({"~kind":"Integer"},{type:"integer"},e)}function Be(e){return b(e,"Integer")}function Xt(e,r){return g.Create({"~kind":"Iterator"},{type:"iterator",iteratorItems:e},r)}function it(e){return b(e,"Iterator")}function ry(e){return g.Discard(e,["~kind","type","iteratorItems"])}var hu=class extends Error{constructor(r){super("Invalid Literal value"),Object.defineProperty(this,"cause",{value:{value:r},writable:!1,configurable:!1,enumerable:!1})}};function xv(e){return s.IsBigInt(e)?"bigint":s.IsBoolean(e)?"boolean":s.IsNumber(e)?"number":s.IsString(e)?"string":(()=>{throw new hu(e)})()}function Y(e,r){return g.Create({"~kind":"Literal"},{type:xv(e),const:e},r)}function tc(e){return s.IsBigInt(e)||s.IsBoolean(e)||s.IsNumber(e)||s.IsString(e)}function ny(e){return J(e)&&s.IsBigInt(e.const)}function oy(e){return J(e)&&s.IsBoolean(e.const)}function mo(e){return J(e)&&s.IsNumber(e.const)}function lo(e){return J(e)&&s.IsString(e.const)}function J(e){return b(e,"Literal")}function Kr(e){return g.Create({"~kind":"Null"},{type:"null"},e)}function Jt(e){return b(e,"Null")}var rc="-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?";function Ut(e){return g.Create({"~kind":"Number"},{type:"number"},e)}function _e(e){return b(e,"Number")}function fo(e){return g.Create({"~kind":"Symbol"},{type:"symbol"},e)}function er(e){return b(e,"Symbol")}function iy(e){return s.Keys(e).filter(r=>!Me(e[r]))}function ay(e){return s.Keys(e)}function nc(e){return s.Values(e)}function Rv(e,r={}){let n=iy(e),o=n.length>0?{required:n}:{};return g.Create({"~kind":"Object"},{type:"object",...o,properties:e},r)}var N=Rv;function k(e){return b(e,"Object")}function sy(e){return g.Discard(e,["~kind","type","properties","required"])}function xn(...e){let[r,n,o]=ae.Match(e,{3:(i,a,c)=>[i,a,c],2:(i,a)=>[i,a,a],1:i=>[i,Ze(),Ze()]});return g.Create({"~kind":"Parameter"},{name:r,extends:n,equals:o},{})}function cy(e){return b(e,"Parameter")}function tr(e,r){return g.Create({"~kind":"Promise"},{type:"promise",item:e},r)}function Je(e){return b(e,"Promise")}function py(e){return g.Discard(e,["~kind","type","item"])}var oc=".*";function _t(e){return g.Create({"~kind":"String"},{type:"string"},e)}function Ne(e){return b(e,"String")}function It(e,r){let n="object",o={[e]:r};return g.Create({"~kind":"Record"},{type:n,patternProperties:o})}var go=`^${ec}$`,yo=`^${rc}$`,Mt=`^${oc}$`;function vi(e,r,n={}){return P("Record",[e,r],n)}function Cv(e,r,n={}){return C({},vi(e,r,n))}function ic(e,r,n={}){return Cv(e,r,n)}function ac(e,r){return It(e,r)}function Ot(e){return s.Keys(e.patternProperties)[0]}function ho(e){let r=Ot(e);return s.IsEqual(r,go)?An():s.IsEqual(r,yo)?Ut():_t()}function et(e){return e.patternProperties[Ot(e)]}function Ie(e){return b(e,"Record")}function Rn(e){return g.Create({"~kind":"Rest"},{type:"rest",items:e},{})}function zr(e){return b(e,"Rest")}function sc(e){return g.Create({"~kind":"This"},{$ref:"#"},e)}function uy(e){return b(e,"This")}function Fe(e,r={}){let[n,o,i]=[e,e.length,!1];return g.Create({"~kind":"Tuple"},{type:"array",additionalItems:i,items:n,minItems:o},r)}function V(e){return b(e,"Tuple")}function my(e){return g.Discard(e,["~kind","type","items","minItems","additionalItems"])}function To(e){return g.Create({"~kind":"Undefined"},{type:"undefined"},e)}function rr(e){return b(e,"Undefined")}function q(e,r={}){return g.Create({"~kind":"Union"},{anyOf:e},r)}function S(e){return b(e,"Union")}function ly(e){return g.Discard(e,["~kind","anyOf"])}function dy(e){return g.Create({"~kind":"Unsafe"},{},e)}function fy(e){return b(e,"Unsafe")}function cc(e){return g.Create({"~kind":"Void"},{type:"void"},e)}function At(e){return b(e,"Void")}function Uv(e,r){return s.IsEqual(e,"Array")?qt(r[0]):s.IsEqual(e,"AsyncIterator")?Wt(r[0]):s.IsEqual(e,"Iterator")?Xt(r[0]):s.IsEqual(e,"Promise")?tr(r[0]):s.IsEqual(e,"Awaited")?Ji(r[0]):s.IsEqual(e,"Capitalize")?Mi(r[0]):s.IsEqual(e,"ConstructorParameters")?qi(r[0]):s.IsEqual(e,"Evaluate")?Eu(r[0]):s.IsEqual(e,"Exclude")?Bi(r[0],r[1]):s.IsEqual(e,"Extract")?Fi(r[0],r[1]):s.IsEqual(e,"Index")?Io(r[0],r[1]):s.IsEqual(e,"InstanceType")?Hi(r[0]):s.IsEqual(e,"Lowercase")?Di(r[0]):s.IsEqual(e,"NonNullable")?Ki(r[0]):s.IsEqual(e,"Omit")?zi(r[0],r[1]):s.IsEqual(e,"Options")?So(r[0],r[1]):s.IsEqual(e,"Parameters")?Yi(r[0]):s.IsEqual(e,"Partial")?Vi(r[0]):s.IsEqual(e,"Pick")?Qi(r[0],r[1]):s.IsEqual(e,"Readonly")?Wi(r[0]):s.IsEqual(e,"KeyOf")?bo(r[0]):s.IsEqual(e,"Record")?vi(r[0],r[1]):s.IsEqual(e,"Required")?Zi(r[0]):s.IsEqual(e,"ReturnType")?Xi(r[0]):s.IsEqual(e,"Uncapitalize")?Gi(r[0]):s.IsEqual(e,"Uppercase")?$i(r[0]):pc(we(e),r)}function Cn(){throw Error("Unreachable")}var wv=(e,r=[])=>e.reduce((n,o)=>s.IsArray(o)&&s.IsEqual(o.length,2)?[...n,o[0]]:[...n,o],[]),fr=e=>{let[r,n]=e;return wv([...r,...n])};function Ey(e){return xn(e[0],e[2],e[4])}function _y(e){return xn(e[0],e[2],e[2])}function Iy(e){return xn(e[0],Ze(),e[2])}function by(e){return xn(e,Ze(),Ze())}function Sy(e){return fr(e)}function Oy(e){return e[1]}function Ay(e){return fr(e)}function xy(e){return e[1]}function Ry(e){return Uv(e[0],e[1])}function Cy(e){return null}function Py(e){return _t()}function Uy(e){return Ut()}function wy(e){return Js()}function Ny(e){return To()}function Ly(e){return Kr()}function vy(e){return An()}function ky(e){return Ni()}function My(e){return Ze()}function Dy(e){return po()}function Gy(e){return N({})}function $y(e){return X()}function jy(e){return fo()}function qy(e){return cc()}function By(e){return sc()}function Fy(e){return e[1]}function Hy(e){return Y(e)}function Ky(e){return s.IsEqual(e.length,3)?[e[0],e[1],...e[2]]:[e[0]]}function zy(e){return e[1]}function Yy(e){return ki(e)}function Vy(e){return Y(BigInt(e))}function Qy(e){return Y(s.IsEqual(e,"true"))}function Wy(e){return Y(parseFloat(e))}function Zy(e){return Y(e)}function Xy(e){return e.length>0}function Jy(e){return e.reduce((r,n)=>s.IsEqual(n.length,3)?[...r,[n[1]]]:[...r,[]],[])}function eh(e){return s.IsEqual(e.length,6)?[e[1],e[3],e[5]]:[]}function th(e){return s.IsArray(e)&&s.IsEqual(e.length,3)?e[1]:e}var gy=(e,r)=>r.reduceRight((n,o)=>{let i=o;return s.IsEqual(i.length,1)?Io(n,i[0]):s.IsEqual(i.length,0)?qt(n):Cn()},e),yy=(e,r)=>s.IsEqual(r.length,3)?ji(e,r[0],r[1],r[2]):e;function rh(e){let[r,n,o,i]=e;return yy(r?bo(gy(n,o)):gy(n,o),i)}function Tu(e,r){return s.IsEqual(r.length,3)?(()=>{let[n,o,i]=r,a=Tu(o,i);if(s.IsEqual(n,"&"))return w(a)?Pt([e,...a.allOf]):Pt([e,a]);if(s.IsEqual(n,"|"))return S(a)?q([e,...a.anyOf]):q([e,a]);Cn()})():e}function nh(e){let[r,n]=e;return Tu(r,n)}function oh(e){let[r,n]=e;return Tu(r,n)}function ih(e){return gu(e[1])}function ah(e){return e[1]}function sh(e){return Br(e[0],e[2])}function ch(e){return s.IsEqual(e.length,4)?Pi(e[1],e[3]):s.IsEqual(e.length,2)?Pi(e[1],Ze()):Cn()}function ph(e){return`${e}`}function uh(e){return Be(e[3])?go:_e(e[3])?yo:er(e[3])?Mt:Ne(e[3])?Mt:Cn()}function mh(e){return e.length>0}function lh(e){return e.length>0}function dh(e){let[r,n,o,i,a]=e;return{[n]:r&&o?Tt(ht(a)):r&&!o?Tt(a):!r&&o?ht(a):a}}function fh(e){return fr(e)}function gh(e){return e.reduce((r,n)=>s.HasPropertyKey(n,go)||s.HasPropertyKey(n,yo)||s.HasPropertyKey(n,Mt)?[r[0],g.Assign(r[1],n)]:[g.Assign(r[0],n),r[1]],[{},{}])}function yh(e){return gh(e[1])}function hh(e){let[r,n]=e,o=s.IsEqual(s.Keys(n).length,0)?{}:{patternProperties:n};return N(r,o)}function Th(e){return s.IsEqual(e.length,5)?Tt(ht(e[4])):s.IsEqual(e.length,3)?e[2]:s.IsEqual(e.length,4)?s.IsEqual(e[2],"readonly")?Tt(e[3]):ht(e[3]):Cn()}function Eh(e){return Tt(ht(e[1]))}function _h(e){return Tt(e[1])}function Ih(e){return ht(e[0])}function bh(e){return s.IsEqual(e.length,2)?Rn(e[1]):s.IsEqual(e.length,1)?e[0]:Cn()}function Sh(e){return fr(e)}function Oh(e){return Fe(e[1])}function Ah(e){return Tt(ht(e[4]))}function xh(e){return Tt(e[3])}function Rh(e){return ht(e[3])}function Ch(e){return e[2]}function Ph(e){return s.IsEqual(e.length,2)?Rn(e[1]):s.IsEqual(e.length,1)?e[0]:Cn()}function Uh(e){return fr(e)}function wh(e){return qr(e[1],e[4])}function Nh(e){return jr(e[2],e[5])}function hy(e,r){return s.IsEqual(e,"remove")?Rg(r):s.IsEqual(e,"add")?Ag(r):r}function Lh(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 Ty(e,r){return s.IsEqual(e,"remove")?Sg(r):s.IsEqual(e,"add")?Ig(r):r}function vh(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 kh(e){return s.IsEqual(e.length,2)?[e[1]]:[]}function Mh(e){return s.IsArray(e[6])&&s.IsEqual(e[6].length,1)?Eo(Li(e[3]),e[5],e[6][0],hy(e[1],Ty(e[8],e[10]))):Eo(Li(e[3]),e[5],we(e[3]),hy(e[1],Ty(e[8],e[10])))}function Dh(e){return we(e)}function Gh(e){return So(e[2],e[4])}function $h(e){return parseFloat(e)}function jh(e){return s.IsEqual(e,"true")}function qh(e){return null}function Bh(e){return{[e[0]]:e[2]}}function Fh(e){return fr(e)}function Nv(e){return e.reduce((r,n)=>g.Assign(r,n),{})}function Hh(e){return Nv(e[1])}function Kh(e){return fr(e)}function zh(e){return e[1]}function Yh(e){return Ni()}function Vh(e){return _t()}function Qh(e){return Ut()}function Wh(e){return An()}function Zh(e){return X()}function Xh(e){return Y(e)}function Jh(e){return q(e[1])}function eT(e){return e.length===3?[...e[0],...e[2]]:e.length===1?[...e[0]]:[]}function tT(e){return[e[0],...e[1]]}function rT(e){return e[1]}function nT(e){return fr(e)}function oT(e){return s.IsEqual(e.length,2)?e[1]:[]}function iT(e){let r=e[2],n=e[3],[o,i]=e[4],a=s.IsEqual(s.Keys(i).length,0)?{}:{patternProperties:i};return{[e[1]]:Br(r,_o(n,o,a))}}function aT(e){let r=e[2],[n,o]=e[3],i=s.IsEqual(s.Keys(o).length,0)?{}:{patternProperties:o};return{[e[1]]:_o(r,n,i)}}function sT(e){return{[e[1]]:Br(e[2],e[4])}}function cT(e){return{[e[1]]:e[3]}}function pT(e){return null}function uT(e){return gh(fr(e))}function mT(e){return e[1]}function lT(e){let r=e[0],n=e[1];return _u(g.Assign(r,n[0]))}function se(e){return En(e)&&te(e.length,2)}function kv(e,r){return te(r.indexOf(e),0)?[e,r.slice(e.length)]:[]}function $e(e,r){let[n,...o]=e;return Gr(n)?(()=>{let i=kv(n,r);return te(i.length,2)?i:$e(o,r)})():[]}function Iu(e,r){return Array.from({length:r-e+1},(n,o)=>String.fromCharCode(e+o))}var dT=[...Iu(97,122),...Iu(65,90)],bu="0",Su=Iu(49,57),Oo=[bu,...Su],fT=" ",Ao=`
|
|
30
|
-
`;var
|
|
27
|
+
`)}),this}_outputHelpIfRequested(r){let n=this._getHelpOption();n&&r.find(i=>n.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function Kf(e){return e.map(r=>{if(!r.startsWith("--inspect"))return r;let n,o="127.0.0.1",i="9229",a;return(a=r.match(/^(--inspect(-brk)?)$/))!==null?n=a[1]:(a=r.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(n=a[1],/^\d+$/.test(a[3])?i=a[3]:o=a[3]):(a=r.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(n=a[1],o=a[3],i=a[4]),n&&i!=="0"?`${n}=${o}:${parseInt(i)+1}`:r})}function eu(){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}tu.Command=Jp;tu.useColor=eu});var Wf=En(Mt=>{var{Argument:Yf}=ks(),{Command:ru}=zf(),{CommanderError:YN,InvalidArgumentError:Vf}=Ai(),{Help:VN}=zp(),{Option:Qf}=Wp();Mt.program=new ru;Mt.createCommand=e=>new ru(e);Mt.createOption=(e,r)=>new Qf(e,r);Mt.createArgument=(e,r)=>new Yf(e,r);Mt.Command=ru;Mt.Option=Qf;Mt.Argument=Yf;Mt.Help=VN;Mt.CommanderError=YN;Mt.InvalidArgumentError=Vf;Mt.InvalidOptionArgumentError=Vf});var Zf=Ls(Wf(),1),{program:f3,createCommand:g3,createArgument:y3,createOption:h3,CommanderError:T3,InvalidArgumentError:E3,InvalidOptionArgumentError:_3,Command:Xf,Argument:I3,Option:nu,Help:b3}=Zf.default;function Ze(e){throw new Error(`assertUnreachable: ${JSON.stringify(e,null,2)}`)}function xi(e){return`\u2022\u2022\u2022\u2022${e.slice(-4)}`}function Jf(e){return{accessToken:e.accessToken,accessExpiresAt:e.expiresAt.toISOString()}}function eg(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 tg(e){if(e)switch(e.kind){case"operation-api-key":return e.token;case"user-session":return e.userAuth.accessToken;default:Ze(e)}}function Ds(e,r){return e?.kind==="user-session"&&new Date(e.userAuth.accessExpiresAt)<=r}var Wb=require("node:crypto");var Ri=require("node:crypto");function QN(e){return(0,Ri.createHash)("sha256").update(e).digest("base64url")}function rg(){let e=(0,Ri.randomBytes)(32).toString("base64url");return{verifier:e,challenge:QN(e)}}var ug=require("node:child_process"),mg=require("node:http"),lu=require("node:os");var U3=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 j3=60*1e3;var b4=1/1e6,iu=1e3,au=60*iu,tL=60*au,$s=24*tL,S4=7*$s,O4=30*$s;var su=["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 rL={s:1,m:60,h:3600,d:86400};function og(e){for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);if(n<48||n>57)return!1}return!0}function ig(){return Math.floor(Date.now()/1e3)}function js(e){if(typeof e=="number")return e;if(e==="now")return ig();if(e.startsWith("-")&&e.length>=3){let n=e.at(-1),o=n?rL[n]:void 0;if(o){let i=e.slice(1,-1);if(i.length>0&&og(i))return ig()-parseInt(i,10)*o}}if(og(e)&&e.length>0)return parseInt(e,10);let r=Date.parse(e);if(!Number.isNaN(r))return Math.floor(r/1e3);throw new Error(`Invalid time value: ${e}. Use unix seconds, relative (-30m, -1h), 'now', or ISO 8601.`)}function B(e){process.stdout.write(`${e}
|
|
28
|
+
`)}function Q(e){B(JSON.stringify(e,null,2))}var ag=["json","tsv","csv"];function cu(e){let r=ag.find(n=>n===e);if(r!==void 0)return r;throw new Error(`--output must be one of: ${ag.join(", ")} (got: ${e})`)}function pu(e){let r=e.split(",").map(n=>n.trim()).filter(n=>n.length>0);if(r.length===0)throw new Error("--fields must contain at least one field name");return r}function sg(e,r){let n=e;for(let o of r.split(".")){if(n===null||typeof n!="object"||!Object.hasOwn(n,o))return;n=n[o]}return n}function uu(e,r){let n=Object.create(null);for(let o of r){let i=sg(e,o);if(i===void 0)continue;let a=o.split("."),c=a.pop();if(c===void 0)continue;let m=n;for(let d of a)(typeof m[d]!="object"||m[d]===null)&&(m[d]=Object.create(null)),m=m[d];m[c]=i}return n}function cg(e){return e==null?null:typeof e=="string"?e:JSON.stringify(e)}var nL={"\\":"\\\\"," ":"\\t","\r":"\\r","\n":"\\n"};function oL(e){let r=cg(e);return r===null?"":r.replace(/[\\\t\r\n]/g,n=>nL[n]??n)}function iL(e){let r=cg(e);return r===null?"":/[,"\n\r]/.test(r)?`"${r.replaceAll('"','""')}"`:r}function mu(e,r,n){if(r.length===0)return"";let o=e==="csv"?",":" ",i=e==="csv"?iL:oL,a=n.map(m=>i(m)).join(o),c=r.map(m=>n.map(d=>i(sg(m,d))).join(o));return[a,...c].join(`
|
|
29
|
+
`)}var lg="/oauth/callback",sL=5*au,cL="<!doctype html><html><body><h1>Login complete</h1><p>You can close this tab and return to the terminal.</p></body></html>",qs="<!doctype html><html><body><h1>Login failed</h1><p>Return to the terminal for details.</p></body></html>";function pL(e){return(0,lu.platform)()==="darwin"?["open",[e]]:(0,lu.platform)()==="win32"?["rundll32",["url.dll,FileProtocolHandler",e]]:["xdg-open",[e]]}function uL(e){let[r,n]=pL(e),o=(0,ug.spawnSync)(r,n,{stdio:"ignore"});return o.error===void 0&&o.status===0}async function mL(e,r,n){return new Promise((o,i)=>{let a=setTimeout(()=>{i(new Error("Timed out waiting for the browser to complete login (5 minutes)."))},sL),c=(m,d,f,y)=>{m.writeHead(d,{"Content-Type":"text/html"}),m.end(f),clearTimeout(a),y()};e.on("request",(m,d)=>{let f=new URL(m.url??"/",n);if(f.pathname!==lg){d.writeHead(404,{"Content-Type":"text/html"}),d.end(qs);return}let y=f.searchParams.get("error");if(y){let A=f.searchParams.get("error_description")??"";c(d,400,qs,()=>i(new Error(`Authorization failed: ${y}${A?` (${A})`:""}`)));return}if(f.searchParams.get("state")!==r){c(d,400,qs,()=>i(new Error("State mismatch on OAuth callback; aborting for safety.")));return}let E=f.searchParams.get("code");if(!E){c(d,400,qs,()=>i(new Error("OAuth callback did not include an authorization code.")));return}c(d,200,cL,()=>o(E))})})}async function dg(e){let r=(0,mg.createServer)();r.on("connection",a=>a.unref()),await new Promise((a,c)=>{r.once("error",c),r.listen(0,"127.0.0.1",()=>{r.off("error",c),a()})});let{port:n}=r.address(),o=`http://127.0.0.1:${n}`,i=`${o}${lg}`;try{let a=e.buildAuthorizeUrl(i);return uL(a)?B("Opening your browser to complete login..."):(B("Visit this URL in your browser to complete login:"),B(` ${a}`)),{code:await mL(r,e.state,o),redirectUri:i}}finally{r.close()}}var g={};kt(g,{Assign:()=>lL,Clone:()=>Pi,Create:()=>fv,Discard:()=>gv,Metrics:()=>qt,Update:()=>yv});var qt={assign:0,create:0,clone:0,discard:0,update:0};function lL(e,r){return qt.assign+=1,{...e,...r}}var s={};kt(s,{Entries:()=>kL,EntriesRegExp:()=>vL,Every:()=>wL,EveryAll:()=>NL,GraphemeCount:()=>CL,HasPropertyKey:()=>LL,IsArray:()=>_n,IsAsyncIterator:()=>TL,IsBigInt:()=>Ci,IsBoolean:()=>_g,IsClassInstance:()=>xL,IsConstructor:()=>EL,IsDeepEqual:()=>yu,IsEqual:()=>ee,IsFunction:()=>Ig,IsGreaterEqualThan:()=>Sg,IsGreaterThan:()=>SL,IsInteger:()=>fu,IsIterator:()=>_L,IsLessEqualThan:()=>bg,IsLessThan:()=>OL,IsMaxLength:()=>PL,IsMinLength:()=>UL,IsMultipleOf:()=>AL,IsNull:()=>Ks,IsNumber:()=>zs,IsObject:()=>In,IsObjectNotArray:()=>IL,IsString:()=>$r,IsSymbol:()=>bL,IsUndefined:()=>gu,IsValueLike:()=>RL,Keys:()=>Hs,Symbols:()=>ML,Values:()=>DL});function Gr(e,r,n){return e>=r&&e<=n}function fg(e){return Gr(e,127462,127487)}function dL(e){return Gr(e,65024,65039)}function fL(e){return Gr(e,768,879)||Gr(e,6832,6911)||Gr(e,7616,7679)||Gr(e,65056,65071)}function Fs(e){return e>65535?2:1}function gg(e,r){for(;r<e.length;){let n=e.codePointAt(r);if(fL(n)||dL(n))r+=Fs(n);else break}return r}function du(e,r){let n=e.codePointAt(r),o=r+Fs(n);for(o=gg(e,o);o<e.length-1&&e[o]==="\u200D";){let i=e.codePointAt(o+1);o+=1+Fs(i),o=gg(e,o)}return fg(n)&&o<e.length&&fg(e.codePointAt(o))&&(o+=Fs(e.codePointAt(o))),o}function yg(e){return Gr(e,55296,56319)||Gr(e,768,879)||e===8205}function hg(e){let r=0,n=0;for(;n<e.length;)n=du(e,n),r++;return r}function gL(e,r){let n=0,o=0;for(;o<e.length;)if(o=du(e,o),n++,n>=r)return!0;return!1}function yL(e,r){let n=0,o=0;for(;o<e.length;)if(o=du(e,o),n++,n>r)return!1;return!0}function Tg(e,r){let n=0;for(;n<e.length;){if(yg(e.charCodeAt(n)))return gL(e,r);if(n++,n>=r)return!0}return!1}function Eg(e,r){let n=0;for(;n<e.length;){if(yg(e.charCodeAt(n)))return yL(e,r);if(n++,n>r)return!1}return!0}function _n(e){return Array.isArray(e)}function TL(e){return In(e)&&Symbol.asyncIterator in e}function Ci(e){return ee(typeof e,"bigint")}function _g(e){return ee(typeof e,"boolean")}function EL(e){if(gu(e)||!Ig(e))return!1;let r=Function.prototype.toString.call(e);return!!(/^class\s/.test(r)||/\[native code\]/.test(r))}function Ig(e){return ee(typeof e,"function")}function fu(e){return Number.isInteger(e)}function _L(e){return In(e)&&Symbol.iterator in e}function Ks(e){return ee(e,null)}function zs(e){return Number.isFinite(e)}function IL(e){return In(e)&&!_n(e)}function In(e){return ee(typeof e,"object")&&!Ks(e)}function $r(e){return ee(typeof e,"string")}function bL(e){return ee(typeof e,"symbol")}function gu(e){return ee(e,void 0)}function ee(e,r){return e===r}function SL(e,r){return e>r}function OL(e,r){return e<r}function bg(e,r){return e<=r}function Sg(e,r){return e>=r}function AL(e,r){if(Ci(e)||Ci(r))return BigInt(e)%BigInt(r)===0n;let n=1e-10;if(!zs(e)||fu(e)&&1/r%1===0)return!0;let o=e%r;return Math.min(Math.abs(o),Math.abs(o-r))<n}function xL(e){if(!In(e))return!1;let r=globalThis.Object.getPrototypeOf(e);return Ks(r)?!1:ee(typeof r.constructor,"function")&&!(ee(r.constructor,globalThis.Object)||ee(r.constructor.name,"Object"))}function RL(e){return Ci(e)||_g(e)||Ks(e)||zs(e)||$r(e)||gu(e)}function CL(e){return hg(e)}function PL(e,r){return Eg(e,r)}function UL(e,r){return Tg(e,r)}function wL(e,r,n){for(let o=r;o<e.length;o++)if(!n(e[o],o))return!1;return!0}function NL(e,r,n){let o=!0;for(let i=r;i<e.length;i++)n(e[i],i)||(o=!1);return o}function LL(e,r){return ee(r,"__proto__")||ee(r,"constructor")?Object.prototype.hasOwnProperty.call(e,r):r in e}function vL(e){return Hs(e).map(r=>[new RegExp(`^${r}$`),e[r]])}function kL(e){return Object.entries(e)}function Hs(e){return Object.getOwnPropertyNames(e)}function ML(e){return Object.getOwnPropertySymbols(e)}function DL(e){return Object.values(e)}function GL(e,r){if(!In(r))return!1;let n=Hs(e);return ee(n.length,Hs(r).length)&&n.every(o=>yu(e[o],r[o]))}function $L(e,r){return _n(r)&&ee(e.length,r.length)&&e.every((n,o)=>yu(e[o],r[o]))}function yu(e,r){return _n(e)?$L(e,r):In(e)?GL(e,r):ee(e,r)}var st={};kt(st,{IsBigInt64Array:()=>JL,IsBigUint64Array:()=>ev,IsBoolean:()=>jL,IsDate:()=>rv,IsFloat32Array:()=>ZL,IsFloat64Array:()=>XL,IsInt16Array:()=>YL,IsInt32Array:()=>QL,IsInt8Array:()=>HL,IsMap:()=>ov,IsNumber:()=>qL,IsRegExp:()=>tv,IsSet:()=>nv,IsString:()=>BL,IsTypeArray:()=>FL,IsUint16Array:()=>VL,IsUint32Array:()=>WL,IsUint8Array:()=>KL,IsUint8ClampedArray:()=>zL});function jL(e){return e instanceof Boolean}function qL(e){return e instanceof Number}function BL(e){return e instanceof String}function FL(e){return globalThis.ArrayBuffer.isView(e)}function HL(e){return e instanceof globalThis.Int8Array}function KL(e){return e instanceof globalThis.Uint8Array}function zL(e){return e instanceof globalThis.Uint8ClampedArray}function YL(e){return e instanceof globalThis.Int16Array}function VL(e){return e instanceof globalThis.Uint16Array}function QL(e){return e instanceof globalThis.Int32Array}function WL(e){return e instanceof globalThis.Uint32Array}function ZL(e){return e instanceof globalThis.Float32Array}function XL(e){return e instanceof globalThis.Float64Array}function JL(e){return e instanceof globalThis.BigInt64Array}function ev(e){return e instanceof globalThis.BigUint64Array}function tv(e){return e instanceof globalThis.RegExp}function rv(e){return e instanceof globalThis.Date}function nv(e){return e instanceof globalThis.Set}function ov(e){return e instanceof globalThis.Map}function av(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~guard")}function sv(e){return e.map(r=>hu(r))}function cv(e){let r={},n=Object.getOwnPropertyDescriptors(e);for(let o of Object.keys(n)){let i=n[o];s.HasPropertyKey(i,"value")&&Object.defineProperty(r,o,{...i,value:hu(i.value)})}return r}function pv(e){return new RegExp(e.source,e.flags)}function hu(e){return e instanceof RegExp?pv(e):av(e)?e:s.IsArray(e)?sv(e):s.IsObject(e)?cv(e):e}function Pi(e){return qt.clone+=1,hu(e)}var Ct={};kt(Ct,{Get:()=>lv,Reset:()=>uv,Set:()=>mv});var bn={immutableTypes:!1,maxErrors:8,useEval:!0,exactOptionalPropertyTypes:!1,enumerableKind:!1};function uv(){bn.immutableTypes=!1,bn.maxErrors=8,bn.useEval=!0,bn.exactOptionalPropertyTypes=!1,bn.enumerableKind=!1}function mv(e){for(let r of s.Keys(e)){let n=e[r];n!==void 0&&Object.defineProperty(bn,r,{value:n})}}function lv(){return bn}function dv(e,r,n={}){for(let o of Object.keys(r))Object.defineProperty(e,o,{configurable:!0,writable:!0,enumerable:!1,value:r[o]});return e}function Og(e,r){return{...e,...r}}function fv(e,r,n={}){qt.create+=1;let o=Ct.Get(),i=Og(r,n),a=o.enumerableKind?Og(i,e):dv(i,e);return o.immutableTypes?Object.freeze(a):a}function gv(e,r){qt.discard+=1;let n={},o=Object.getOwnPropertyDescriptors(Pi(e)),i=new Set(r);for(let a of Object.keys(o))i.has(a)||Object.defineProperty(n,a,o[a]);return n}function yv(e,r,n){qt.update+=1;let o=Ct.Get(),i=Pi(e);for(let a of Object.keys(r))Object.defineProperty(i,a,{configurable:!0,writable:!0,enumerable:o.enumerableKind,value:r[a]});for(let a of Object.keys(n))Object.defineProperty(i,a,{configurable:!0,enumerable:!0,writable:!0,value:n[a]});return i}function b(e,r){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.IsEqual(e["~kind"],r)}function O(e){return s.IsObject(e)}function Ag(e){return g.Create({"~kind":"OptionalAddAction"},{type:e},{})}function xg(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"type")&&s.IsEqual(e["~kind"],"OptionalAddAction")&&O(e.type)}function Rg(e){return g.Create({"~kind":"OptionalRemoveAction"},{type:e},{})}function Cg(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"type")&&s.IsEqual(e["~kind"],"OptionalRemoveAction")&&O(e.type)}function Pg(e){return g.Create({"~kind":"ReadonlyAddAction"},{type:e},{})}function Ug(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"type")&&s.IsEqual(e["~kind"],"ReadonlyAddAction")&&O(e.type)}function wg(e){return g.Create({"~kind":"ReadonlyRemoveAction"},{type:e},{})}function Ng(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"type")&&s.IsEqual(e["~kind"],"ReadonlyRemoveAction")&&O(e.type)}function P(e,r,n){return g.Create({"~kind":"Deferred"},{action:e,parameters:r,options:n},{})}function Lg(e){return b(e,"Deferred")}function Tu(e){return g.Update(e,{"~immutable":!0},{})}function jr(e){return Tu(e)}function Sn(e){return O(e)&&s.HasPropertyKey(e,"~immutable")}function co(e){return g.Discard(e,["~optional"])}function Tt(e){return g.Update(e,{"~optional":!0},{})}function Ys(e){return Tt(e)}function Me(e){return O(e)&&s.HasPropertyKey(e,"~optional")}function Vs(e){return g.Discard(e,["~readonly"])}function Et(e){return g.Update(e,{"~readonly":!0},{})}function Qs(e){return Et(e)}function On(e){return O(e)&&s.HasPropertyKey(e,"~readonly")}function Bt(e,r){return g.Create({"~kind":"Array"},{type:"array",items:e},r)}function te(e){return b(e,"Array")}function Ws(e){return g.Discard(e,["~kind","type","items"])}function Zt(e,r){return g.Create({"~kind":"AsyncIterator"},{type:"asyncIterator",iteratorItems:e},r)}function it(e){return b(e,"AsyncIterator")}function vg(e){return g.Discard(e,["~kind","type","iteratorItems"])}function kg(e){return{enumerable:Ct.Get().enumerableKind,writable:!1,configurable:!1,value:e}}var Zs=class{constructor(){globalThis.Object.defineProperty(this,"~kind",kg("Base")),globalThis.Object.defineProperty(this,"~guard",kg({check:r=>this.Check(r),errors:r=>this.Errors(r)}))}Check(r){return!0}Errors(r){return[]}Convert(r){return r}Clean(r){return r}Default(r){return r}Create(){throw new Error("Create not implemented")}Clone(){throw Error("Clone not implemented")}};function Pt(e){return b(e,"Base")}function qr(e,r,n={}){return g.Create({"~kind":"Constructor"},{type:"constructor",parameters:e,instanceType:r},n)}function De(e){return b(e,"Constructor")}function Mg(e){return g.Discard(e,["~kind","type","parameters","instanceType"])}function Br(e,r,n={}){return g.Create({"~kind":"Function"},{type:"function",parameters:e,returnType:r},n)}function Ge(e){return b(e,"Function")}function Dg(e){return g.Discard(e,["~kind","type","parameters","returnType"])}function we(e,r){return g.Create({"~kind":"Ref"},{$ref:e},r)}function ce(e){return b(e,"Ref")}function Fr(e,r){return g.Create({"~kind":"Generic"},{type:"generic",parameters:e,expression:r})}function po(e){return b(e,"Generic")}var Gg="(?!)";function Z(e){return g.Create({"~kind":"Never"},{not:{}},e)}function fr(e){return b(e,"Never")}function hv(){return["(not-resolvable)",Z()]}function Tv(){return["(not-generic)",Z()]}function Ev(e,r,n){return[e,Fr(r,n)]}function _v(e,r,n){return r in e?$g(e,r,e[r],n):hv()}function $g(e,r,n,o){return po(n)?Ev(r,n.parameters,n.expression):ce(n)?_v(e,n.$ref,o):Tv()}function jg(e,r,n){return $g(e,"(anonymous)",r,n)}function Xt(e,r,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:r},n)}function me(e){return b(e,"Cyclic")}var ie={};kt(ie,{Match:()=>Iv});function Iv(e,r){return r[e.length]?.(...e)??(()=>{throw Error("Invalid Arguments")})()}function Xe(e){return g.Create({"~kind":"Unknown"},{},e)}function _t(e){return b(e,"Unknown")}function Ui(...e){let[r,n]=ie.Match(e,{2:(o,i)=>[o,i,i],1:o=>[o,Xe(),Xe()]});return g.Create({"~kind":"Infer"},{type:"infer",name:r,extends:n},{})}function xe(e){return b(e,"Infer")}function uo(e){return g.Create({"~kind":"Any"},{},e)}function ct(e){return b(e,"Any")}function qg(e){return s.IsObjectNotArray(e)}function Bg(e){return s.Keys(e).filter(n=>isNaN(n)).reduce((n,o)=>[...n,e[o]],[])}function Fg(e,r){let n=qg(e)?Bg(e):e;return g.Create({"~kind":"Enum"},{enum:n},r)}function Re(e){return b(e,"Enum")}function Ut(e,r={}){return g.Create({"~kind":"Intersect"},{allOf:e},r)}function w(e){return b(e,"Intersect")}function Hg(e){return g.Discard(e,["~kind","allOf"])}function H(){throw new Error("Unreachable")}var Kr={};kt(Kr,{Hash:()=>$v,HashCode:()=>Zg});function bv(e){let r=new Set,n=e;for(;n&&n!==Object.prototype;){for(let o of Reflect.ownKeys(n))o!=="constructor"&&typeof o!="symbol"&&r.add(o);n=Object.getPrototypeOf(n)}return[...r]}function Sv(e){return typeof e=="number"}var pt;(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"})(pt||(pt={}));var mo=BigInt("14695981039346656037"),[Ov,Av]=[BigInt("1099511628211"),BigInt("18446744073709551616")],xv=Array.from({length:256}).map((e,r)=>BigInt(r)),Vg=new Float64Array(1),Qg=new DataView(Vg.buffer),Wg=new Uint8Array(Vg.buffer);function Je(e){mo=mo^xv[e],mo=mo*Ov%Av}function Rv(e){Je(pt.Array);for(let r of e)Hr(r)}function Cv(e){Je(pt.BigInt),Qg.setBigInt64(0,e);for(let r of Wg)Je(r)}function zg(e){Je(pt.Boolean),Je(e?1:0)}function Pv(e){Je(pt.Constructor),Hr(e.toString())}function Uv(e){Je(pt.Date),Hr(e.getTime())}function wv(e){Je(pt.Function),Hr(e.toString())}function Nv(e){Je(pt.Null)}function Yg(e){Je(pt.Number),Qg.setFloat64(0,e,!0);for(let r of Wg)Je(r)}function Lv(e){Je(pt.Object);for(let r of bv(e).sort())Hr(r),Hr(e[r])}function vv(e){Je(pt.RegExp),Eu(e.toString())}var kv=new TextEncoder;function Eu(e){Je(pt.String);for(let r of kv.encode(e))Je(r)}function Mv(e){Je(pt.Symbol),Hr(e.toString())}function Dv(e){Je(pt.TypeArray);let r=new Uint8Array(e.buffer);for(let n=0;n<r.length;n++)Je(r[n])}function Gv(e){return Je(pt.Undefined)}function Hr(e){return st.IsTypeArray(e)?Dv(e):st.IsDate(e)?Uv(e):st.IsRegExp(e)?vv(e):st.IsBoolean(e)?zg(e.valueOf()):st.IsString(e)?Eu(e.valueOf()):st.IsNumber(e)?Yg(e.valueOf()):Sv(e)?Yg(e):s.IsArray(e)?Rv(e):s.IsBoolean(e)?zg(e):s.IsBigInt(e)?Cv(e):s.IsConstructor(e)?Pv(e):s.IsNull(e)?Nv(e):s.IsObject(e)?Lv(e):s.IsString(e)?Eu(e):s.IsSymbol(e)?Mv(e):s.IsUndefined(e)?Gv(e):s.IsFunction(e)?wv(e):H()}function Zg(e){return mo=BigInt("14695981039346656037"),Hr(e),mo}function $v(e){return Zg(e).toString(16).padStart(16,"0")}function Xg(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 jv=Xg;function Jg(){return jv}var wi=class{constructor(r,n){this.type=r,this.decode=n}Encode(r){let n=this.type,o=An(n)?c=>this.decode(n["~codec"].decode(c)):this.decode,i=An(n)?c=>n["~codec"].encode(r(c)):r,a={decode:o,encode:i};return g.Update(this.type,{"~codec":a},{})}},Ni=class{constructor(r){this.type=r}Decode(r){return new wi(this.type,r)}};function Xs(e){return new Ni(e)}function ty(e,r){return Xs(e).Decode(r).Encode(()=>{throw Error("Encode not implemented")})}function ry(e,r){return Xs(e).Decode(()=>{throw Error("Decode not implemented")}).Encode(r)}function An(e){return O(e)&&s.HasPropertyKey(e,"~codec")&&s.IsObject(e["~codec"])&&s.HasPropertyKey(e["~codec"],"encode")&&s.HasPropertyKey(e["~codec"],"decode")}function Bv(e,r){let n=Js(e)?[...e["~refine"],r]:[r];return g.Update(e,{"~refine":n},{})}function ny(e,r,n="error"){return Bv(e,{refine:r,message:n})}function Js(e){return O(e)&&s.HasPropertyKey(e,"~refine")}var oy="-?(?:0|[1-9][0-9]*)n";function Li(e){return g.Create({"~kind":"BigInt"},{type:"bigint"},e)}function Ot(e){return b(e,"BigInt")}function ec(e){return g.Create({"~kind":"Boolean"},{type:"boolean"},e)}function ut(e){return b(e,"Boolean")}function vi(e){return g.Create({"~kind":"Identifier"},{name:e})}function iy(e){return b(e,"Identifier")}var tc="-?(?:0|[1-9][0-9]*)";function xn(e){return g.Create({"~kind":"Integer"},{type:"integer"},e)}function Be(e){return b(e,"Integer")}function Jt(e,r){return g.Create({"~kind":"Iterator"},{type:"iterator",iteratorItems:e},r)}function at(e){return b(e,"Iterator")}function ay(e){return g.Discard(e,["~kind","type","iteratorItems"])}var _u=class extends Error{constructor(r){super("Invalid Literal value"),Object.defineProperty(this,"cause",{value:{value:r},writable:!1,configurable:!1,enumerable:!1})}};function Fv(e){return s.IsBigInt(e)?"bigint":s.IsBoolean(e)?"boolean":s.IsNumber(e)?"number":s.IsString(e)?"string":(()=>{throw new _u(e)})()}function Y(e,r){return g.Create({"~kind":"Literal"},{type:Fv(e),const:e},r)}function rc(e){return s.IsBigInt(e)||s.IsBoolean(e)||s.IsNumber(e)||s.IsString(e)}function sy(e){return X(e)&&s.IsBigInt(e.const)}function cy(e){return X(e)&&s.IsBoolean(e.const)}function lo(e){return X(e)&&s.IsNumber(e.const)}function fo(e){return X(e)&&s.IsString(e.const)}function X(e){return b(e,"Literal")}function zr(e){return g.Create({"~kind":"Null"},{type:"null"},e)}function er(e){return b(e,"Null")}var nc="-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?";function wt(e){return g.Create({"~kind":"Number"},{type:"number"},e)}function _e(e){return b(e,"Number")}function go(e){return g.Create({"~kind":"Symbol"},{type:"symbol"},e)}function tr(e){return b(e,"Symbol")}function py(e){return s.Keys(e).filter(r=>!Me(e[r]))}function uy(e){return s.Keys(e)}function oc(e){return s.Values(e)}function Hv(e,r={}){let n=py(e),o=n.length>0?{required:n}:{};return g.Create({"~kind":"Object"},{type:"object",...o,properties:e},r)}var N=Hv;function k(e){return b(e,"Object")}function my(e){return g.Discard(e,["~kind","type","properties","required"])}function Rn(...e){let[r,n,o]=ie.Match(e,{3:(i,a,c)=>[i,a,c],2:(i,a)=>[i,a,a],1:i=>[i,Xe(),Xe()]});return g.Create({"~kind":"Parameter"},{name:r,extends:n,equals:o},{})}function ly(e){return b(e,"Parameter")}function rr(e,r){return g.Create({"~kind":"Promise"},{type:"promise",item:e},r)}function et(e){return b(e,"Promise")}function dy(e){return g.Discard(e,["~kind","type","item"])}var ic=".*";function It(e){return g.Create({"~kind":"String"},{type:"string"},e)}function Ne(e){return b(e,"String")}function bt(e,r){let n="object",o={[e]:r};return g.Create({"~kind":"Record"},{type:n,patternProperties:o})}var yo=`^${tc}$`,ho=`^${nc}$`,Dt=`^${ic}$`;function ki(e,r,n={}){return P("Record",[e,r],n)}function Kv(e,r,n={}){return C({},ki(e,r,n))}function ac(e,r,n={}){return Kv(e,r,n)}function sc(e,r){return bt(e,r)}function At(e){return s.Keys(e.patternProperties)[0]}function To(e){let r=At(e);return s.IsEqual(r,yo)?xn():s.IsEqual(r,ho)?wt():It()}function tt(e){return e.patternProperties[At(e)]}function Ie(e){return b(e,"Record")}function Cn(e){return g.Create({"~kind":"Rest"},{type:"rest",items:e},{})}function Yr(e){return b(e,"Rest")}function cc(e){return g.Create({"~kind":"This"},{$ref:"#"},e)}function fy(e){return b(e,"This")}function Fe(e,r={}){let[n,o,i]=[e,e.length,!1];return g.Create({"~kind":"Tuple"},{type:"array",additionalItems:i,items:n,minItems:o},r)}function V(e){return b(e,"Tuple")}function gy(e){return g.Discard(e,["~kind","type","items","minItems","additionalItems"])}function Eo(e){return g.Create({"~kind":"Undefined"},{type:"undefined"},e)}function nr(e){return b(e,"Undefined")}function q(e,r={}){return g.Create({"~kind":"Union"},{anyOf:e},r)}function S(e){return b(e,"Union")}function yy(e){return g.Discard(e,["~kind","anyOf"])}function hy(e){return g.Create({"~kind":"Unsafe"},{},e)}function Ty(e){return b(e,"Unsafe")}function pc(e){return g.Create({"~kind":"Void"},{type:"void"},e)}function xt(e){return b(e,"Void")}function Yv(e,r){return s.IsEqual(e,"Array")?Bt(r[0]):s.IsEqual(e,"AsyncIterator")?Zt(r[0]):s.IsEqual(e,"Iterator")?Jt(r[0]):s.IsEqual(e,"Promise")?rr(r[0]):s.IsEqual(e,"Awaited")?ea(r[0]):s.IsEqual(e,"Capitalize")?Di(r[0]):s.IsEqual(e,"ConstructorParameters")?Bi(r[0]):s.IsEqual(e,"Evaluate")?bu(r[0]):s.IsEqual(e,"Exclude")?Fi(r[0],r[1]):s.IsEqual(e,"Extract")?Hi(r[0],r[1]):s.IsEqual(e,"Index")?bo(r[0],r[1]):s.IsEqual(e,"InstanceType")?Ki(r[0]):s.IsEqual(e,"Lowercase")?Gi(r[0]):s.IsEqual(e,"NonNullable")?zi(r[0]):s.IsEqual(e,"Omit")?Yi(r[0],r[1]):s.IsEqual(e,"Options")?Oo(r[0],r[1]):s.IsEqual(e,"Parameters")?Vi(r[0]):s.IsEqual(e,"Partial")?Qi(r[0]):s.IsEqual(e,"Pick")?Wi(r[0],r[1]):s.IsEqual(e,"Readonly")?Zi(r[0]):s.IsEqual(e,"KeyOf")?So(r[0]):s.IsEqual(e,"Record")?ki(r[0],r[1]):s.IsEqual(e,"Required")?Xi(r[0]):s.IsEqual(e,"ReturnType")?Ji(r[0]):s.IsEqual(e,"Uncapitalize")?$i(r[0]):s.IsEqual(e,"Uppercase")?ji(r[0]):uc(we(e),r)}function Pn(){throw Error("Unreachable")}var Vv=(e,r=[])=>e.reduce((n,o)=>s.IsArray(o)&&s.IsEqual(o.length,2)?[...n,o[0]]:[...n,o],[]),gr=e=>{let[r,n]=e;return Vv([...r,...n])};function Sy(e){return Rn(e[0],e[2],e[4])}function Oy(e){return Rn(e[0],e[2],e[2])}function Ay(e){return Rn(e[0],Xe(),e[2])}function xy(e){return Rn(e,Xe(),Xe())}function Ry(e){return gr(e)}function Cy(e){return e[1]}function Py(e){return gr(e)}function Uy(e){return e[1]}function wy(e){return Yv(e[0],e[1])}function Ny(e){return null}function Ly(e){return It()}function vy(e){return wt()}function ky(e){return ec()}function My(e){return Eo()}function Dy(e){return zr()}function Gy(e){return xn()}function $y(e){return Li()}function jy(e){return Xe()}function qy(e){return uo()}function By(e){return N({})}function Fy(e){return Z()}function Hy(e){return go()}function Ky(e){return pc()}function zy(e){return cc()}function Yy(e){return e[1]}function Vy(e){return Y(e)}function Qy(e){return s.IsEqual(e.length,3)?[e[0],e[1],...e[2]]:[e[0]]}function Wy(e){return e[1]}function Zy(e){return Mi(e)}function Xy(e){return Y(BigInt(e))}function Jy(e){return Y(s.IsEqual(e,"true"))}function eh(e){return Y(parseFloat(e))}function th(e){return Y(e)}function rh(e){return e.length>0}function nh(e){return e.reduce((r,n)=>s.IsEqual(n.length,3)?[...r,[n[1]]]:[...r,[]],[])}function oh(e){return s.IsEqual(e.length,6)?[e[1],e[3],e[5]]:[]}function ih(e){return s.IsArray(e)&&s.IsEqual(e.length,3)?e[1]:e}var Ey=(e,r)=>r.reduceRight((n,o)=>{let i=o;return s.IsEqual(i.length,1)?bo(n,i[0]):s.IsEqual(i.length,0)?Bt(n):Pn()},e),_y=(e,r)=>s.IsEqual(r.length,3)?qi(e,r[0],r[1],r[2]):e;function ah(e){let[r,n,o,i]=e;return _y(r?So(Ey(n,o)):Ey(n,o),i)}function Iu(e,r){return s.IsEqual(r.length,3)?(()=>{let[n,o,i]=r,a=Iu(o,i);if(s.IsEqual(n,"&"))return w(a)?Ut([e,...a.allOf]):Ut([e,a]);if(s.IsEqual(n,"|"))return S(a)?q([e,...a.anyOf]):q([e,a]);Pn()})():e}function sh(e){let[r,n]=e;return Iu(r,n)}function ch(e){let[r,n]=e;return Iu(r,n)}function ph(e){return Tu(e[1])}function uh(e){return e[1]}function mh(e){return Fr(e[0],e[2])}function lh(e){return s.IsEqual(e.length,4)?Ui(e[1],e[3]):s.IsEqual(e.length,2)?Ui(e[1],Xe()):Pn()}function dh(e){return`${e}`}function fh(e){return Be(e[3])?yo:_e(e[3])?ho:tr(e[3])?Dt:Ne(e[3])?Dt:Pn()}function gh(e){return e.length>0}function yh(e){return e.length>0}function hh(e){let[r,n,o,i,a]=e;return{[n]:r&&o?Et(Tt(a)):r&&!o?Et(a):!r&&o?Tt(a):a}}function Th(e){return gr(e)}function Eh(e){return e.reduce((r,n)=>s.HasPropertyKey(n,yo)||s.HasPropertyKey(n,ho)||s.HasPropertyKey(n,Dt)?[r[0],g.Assign(r[1],n)]:[g.Assign(r[0],n),r[1]],[{},{}])}function _h(e){return Eh(e[1])}function Ih(e){let[r,n]=e,o=s.IsEqual(s.Keys(n).length,0)?{}:{patternProperties:n};return N(r,o)}function bh(e){return s.IsEqual(e.length,5)?Et(Tt(e[4])):s.IsEqual(e.length,3)?e[2]:s.IsEqual(e.length,4)?s.IsEqual(e[2],"readonly")?Et(e[3]):Tt(e[3]):Pn()}function Sh(e){return Et(Tt(e[1]))}function Oh(e){return Et(e[1])}function Ah(e){return Tt(e[0])}function xh(e){return s.IsEqual(e.length,2)?Cn(e[1]):s.IsEqual(e.length,1)?e[0]:Pn()}function Rh(e){return gr(e)}function Ch(e){return Fe(e[1])}function Ph(e){return Et(Tt(e[4]))}function Uh(e){return Et(e[3])}function wh(e){return Tt(e[3])}function Nh(e){return e[2]}function Lh(e){return s.IsEqual(e.length,2)?Cn(e[1]):s.IsEqual(e.length,1)?e[0]:Pn()}function vh(e){return gr(e)}function kh(e){return Br(e[1],e[4])}function Mh(e){return qr(e[2],e[5])}function Iy(e,r){return s.IsEqual(e,"remove")?wg(r):s.IsEqual(e,"add")?Pg(r):r}function Dh(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 by(e,r){return s.IsEqual(e,"remove")?Rg(r):s.IsEqual(e,"add")?Ag(r):r}function Gh(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 $h(e){return s.IsEqual(e.length,2)?[e[1]]:[]}function jh(e){return s.IsArray(e[6])&&s.IsEqual(e[6].length,1)?_o(vi(e[3]),e[5],e[6][0],Iy(e[1],by(e[8],e[10]))):_o(vi(e[3]),e[5],we(e[3]),Iy(e[1],by(e[8],e[10])))}function qh(e){return we(e)}function Bh(e){return Oo(e[2],e[4])}function Fh(e){return parseFloat(e)}function Hh(e){return s.IsEqual(e,"true")}function Kh(e){return null}function zh(e){return{[e[0]]:e[2]}}function Yh(e){return gr(e)}function Qv(e){return e.reduce((r,n)=>g.Assign(r,n),{})}function Vh(e){return Qv(e[1])}function Qh(e){return gr(e)}function Wh(e){return e[1]}function Zh(e){return Li()}function Xh(e){return It()}function Jh(e){return wt()}function eT(e){return xn()}function tT(e){return Z()}function rT(e){return Y(e)}function nT(e){return q(e[1])}function oT(e){return e.length===3?[...e[0],...e[2]]:e.length===1?[...e[0]]:[]}function iT(e){return[e[0],...e[1]]}function aT(e){return e[1]}function sT(e){return gr(e)}function cT(e){return s.IsEqual(e.length,2)?e[1]:[]}function pT(e){let r=e[2],n=e[3],[o,i]=e[4],a=s.IsEqual(s.Keys(i).length,0)?{}:{patternProperties:i};return{[e[1]]:Fr(r,Io(n,o,a))}}function uT(e){let r=e[2],[n,o]=e[3],i=s.IsEqual(s.Keys(o).length,0)?{}:{patternProperties:o};return{[e[1]]:Io(r,n,i)}}function mT(e){return{[e[1]]:Fr(e[2],e[4])}}function lT(e){return{[e[1]]:e[3]}}function dT(e){return null}function fT(e){return Eh(gr(e))}function gT(e){return e[1]}function yT(e){let r=e[0],n=e[1];return Su(g.Assign(r,n[0]))}function ae(e){return _n(e)&&ee(e.length,2)}function Xv(e,r){return ee(r.indexOf(e),0)?[e,r.slice(e.length)]:[]}function $e(e,r){let[n,...o]=e;return $r(n)?(()=>{let i=Xv(n,r);return ee(i.length,2)?i:$e(o,r)})():[]}function Ou(e,r){return Array.from({length:r-e+1},(n,o)=>String.fromCharCode(e+o))}var hT=[...Ou(97,122),...Ou(65,90)],Au="0",xu=Ou(49,57),Ao=[Au,...xu],TT=" ",xo=`
|
|
30
|
+
`;var Vr="_",mc=".",ET="$",lc="-";var _T="//",IT="/*",ek="*/";function bT(e){let r=e.indexOf(ek);return ee(r,-1)?"":e.slice(r+2)}function ST(e){let r=e.indexOf(xo);return ee(r,-1)?"":e.slice(r)}function tk(e){return e.replace(/^[ \t\r\f\v]+/,"")}function dc(e){let r=tk(e);return r.startsWith(IT)?dc(bT(r.slice(2))):r.startsWith(_T)?dc(ST(r.slice(2))):r}function St(e){let r=e.trimStart();return r.startsWith(IT)?St(bT(r.slice(2))):r.startsWith(_T)?St(ST(r.slice(2))):r}function rk(e,r){return e.includes(r)}function Ro(e,r,n,o=""){let i=$e(e,n);return ae(i)?rk(r,i[0])?Ro(e,r,i[1],o):Ro(e,r,i[1],`${o}${i[0]}`):[o,n]}function fc(e,r){let n=$e([e],r);return ae(n)?n:["",r]}function nk(e){return fc(lc,e)}function ok(e){return $e(xu,e)}var ik=[...Ao,Vr];function ak(e){return Ro(ik,[Vr],e)}function sk(e){let r=nk(e);return ae(r)?(()=>{let n=$e([Au],r[1]);return ae(n)?[`${r[0]}${n[0]}`,n[1]]:(()=>{let o=ok(r[1]);return ae(o)?(()=>{let i=ak(o[1]);return ae(i)?[`${r[0]}${o[0]}${i[0]}`,i[1]]:[]})():[]})()})():[]}function gc(e){return sk(St(e))}function ck(e){let r=gc(e);return ae(r)?(()=>{let n=$e(["n"],r[1]);return ae(n)?[`${r[0]}`,n[1]]:[]})():[]}function OT(e){return ck(e)}function Ru(e,r){return $e([e],r)}function h(e,r){return ee(e,"")?["",r]:e.startsWith(xo)?Ru(e,dc(r)):e.startsWith(TT)?Ru(e,r):Ru(e,St(r))}var AT=[...hT,Vr,ET];function pk(e){return $e(AT,e)}var uk=[...AT,...Ao];function xT(e,r=""){let n=$e(uk,e);return ae(n)?xT(n[1],`${r}${n[0]}`):[r,e]}function mk(e){let r=pk(e);return ae(r)?(()=>{let n=xT(r[1]);return ae(n)?[`${r[0]}${n[0]}`,n[1]]:[]})():[]}function be(e){return mk(St(e))}var lk=[...Ao,Vr];function dk(e){return fc(lc,e)}function fk(e){return ae($e([mc],e))}function RT(e){let r=Ro(lk,[Vr],e);return ae(r)?ee(r[0],"")?[]:[r[0],r[1]]:[]}function gk(e,r){let n=$e([mc],r);return ae(n)?(()=>{let o=RT(n[1]);return ae(o)?[`${e}0${n[0]}${o[0]}`,o[1]]:[]})():[]}function yk(e,r){let n=gc(r);return ae(n)?(()=>{let o=$e([mc],n[1]);return ae(o)?(()=>{let i=RT(o[1]);return ae(i)?[`${e}${n[0]}${o[0]}${i[0]}`,i[1]]:[`${e}${n[0]}`,o[1]]})():[`${e}${n[0]}`,n[1]]})():[]}function hk(e){let r=dk(e);return ae(r)?fk(r[1])?gk(r[0],r[1]):yk(r[0],r[1]):[]}function yc(e){return hk(St(e))}function CT(e,r){let[n,...o]=e;return $r(n)?r.startsWith(n)?!0:CT(o,r):!1}function Qr(e,r,n=""){return ee(r,"")?[]:CT(e,r)?[n,r]:(()=>{let[o,i]=[r.slice(0,1),r.slice(1)];return Qr(e,i,`${n}${o}`)})()}function Tk(e,r,n){return n.startsWith(e)?(()=>{let o=Qr([r],n.slice(e.length));return ae(o)?o[1].startsWith(r)?[`${o[0]}`,o[1].slice(r.length)]:[]:[]})():[]}function Ek(e,r,n){return n.startsWith(e)?(()=>{let o=Qr([xo,r],n.slice(e.length));return ae(o)?o[1].startsWith(r)?[`${o[0]}`,o[1].slice(r.length)]:[]:[]})():[]}function PT(e,r,n,o){return n?Tk(e,r,St(o)):Ek(e,r,St(o))}function _k(e,r){return $e(e,r)}function Ik(e,r){return PT(e,e,!1,r)}function bk(e,r){let n=_k(e,r);return ae(n)?Ik(n[0],`${n[0]}${n[1]}`):[]}function hc(e,r){return bk(e,St(r))}function UT(e,r){let n=Qr(e,r);return ae(n)?ee(n[0],"")?[]:n:[]}var u=(e,r,n=()=>[])=>e.length===2?r(e):n(),Ok=e=>u(u(be(e),([r,n])=>u(h("extends",n),([o,i])=>u(J(i),([a,c])=>u(h("=",c),([m,d])=>u(J(d),([f,y])=>[[r,o,a,m,f],y]))))),([r,n])=>[Sy(r),n]),Ak=e=>u(u(be(e),([r,n])=>u(h("extends",n),([o,i])=>u(J(i),([a,c])=>[[r,o,a],c]))),([r,n])=>[Oy(r),n]),xk=e=>u(u(be(e),([r,n])=>u(h("=",n),([o,i])=>u(J(i),([a,c])=>[[r,o,a],c]))),([r,n])=>[Ay(r),n]),Rk=e=>u(be(e),([r,n])=>[xy(r),n]),LT=e=>u(u(Ok(e),([r,n])=>[r,n],()=>u(Ak(e),([r,n])=>[r,n],()=>u(xk(e),([r,n])=>[r,n],()=>u(Rk(e),([r,n])=>[r,n],()=>[])))),([r,n])=>[r,n]),vT=(e,r=[])=>u(u(LT(e),([n,o])=>u(h(",",o),([i,a])=>[[n,i],a])),([n,o])=>vT(o,[...r,n]),()=>[r,e]),Ck=e=>u(u(vT(e),([r,n])=>u(u(u(LT(n),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>u([[],n],([o,i])=>[o,i],()=>[])),([o,i])=>[[r,o],i])),([r,n])=>[Ry(r),n]),Uu=e=>u(u(h("<",e),([r,n])=>u(Ck(n),([o,i])=>u(h(">",i),([a,c])=>[[r,o,a],c]))),([r,n])=>[Cy(r),n]),kT=(e,r=[])=>u(u(J(e),([n,o])=>u(h(",",o),([i,a])=>[[n,i],a])),([n,o])=>kT(o,[...r,n]),()=>[r,e]),Pk=e=>u(u(kT(e),([r,n])=>u(u(u(J(n),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>u([[],n],([o,i])=>[o,i],()=>[])),([o,i])=>[[r,o],i])),([r,n])=>[Py(r),n]),Uk=e=>u(u(h("<",e),([r,n])=>u(Pk(n),([o,i])=>u(h(">",i),([a,c])=>[[r,o,a],c]))),([r,n])=>[Uy(r),n]),wk=e=>u(u(be(e),([r,n])=>u(Uk(n),([o,i])=>[[r,o],i])),([r,n])=>[wy(r),n]),MT=e=>u(u(u(h(";",e),([r,n])=>[[r],n]),([r,n])=>[r,n],()=>u([[],e],([r,n])=>[r,n],()=>[])),([r,n])=>[Ny(r),n]),DT=e=>u(h("string",e),([r,n])=>[Ly(r),n]),GT=e=>u(h("number",e),([r,n])=>[vy(r),n]),Nk=e=>u(h("boolean",e),([r,n])=>[ky(r),n]),Lk=e=>u(h("undefined",e),([r,n])=>[My(r),n]),vk=e=>u(h("null",e),([r,n])=>[Dy(r),n]),$T=e=>u(h("integer",e),([r,n])=>[Gy(r),n]),kk=e=>u(h("bigint",e),([r,n])=>[$y(r),n]),Mk=e=>u(h("unknown",e),([r,n])=>[jy(r),n]),Dk=e=>u(h("any",e),([r,n])=>[qy(r),n]),Gk=e=>u(h("object",e),([r,n])=>[By(r),n]),$k=e=>u(h("never",e),([r,n])=>[Fy(r),n]),jT=e=>u(h("symbol",e),([r,n])=>[Hy(r),n]),jk=e=>u(h("void",e),([r,n])=>[Ky(r),n]),qk=e=>u(h("this",e),([r,n])=>[zy(r),n]),Bk=e=>u(u(DT(e),([r,n])=>[r,n],()=>u(GT(e),([r,n])=>[r,n],()=>u(Nk(e),([r,n])=>[r,n],()=>u(Lk(e),([r,n])=>[r,n],()=>u(vk(e),([r,n])=>[r,n],()=>u($T(e),([r,n])=>[r,n],()=>u(kk(e),([r,n])=>[r,n],()=>u(Mk(e),([r,n])=>[r,n],()=>u(Dk(e),([r,n])=>[r,n],()=>u(Gk(e),([r,n])=>[r,n],()=>u($k(e),([r,n])=>[r,n],()=>u(jT(e),([r,n])=>[r,n],()=>u(jk(e),([r,n])=>[r,n],()=>u(qk(e),([r,n])=>[r,n],()=>[])))))))))))))),([r,n])=>[r,n]),Fk=e=>u(u(h("${",e),([r,n])=>u(J(n),([o,i])=>u(h("}",i),([a,c])=>[[r,o,a],c]))),([r,n])=>[Yy(r),n]),Cu=e=>u(Qr(["${","`"],e),([r,n])=>[Vy(r),n]),qT=e=>u(u(u(Cu(e),([r,n])=>u(Fk(n),([o,i])=>u(qT(i),([a,c])=>[[r,o,a],c]))),([r,n])=>[r,n],()=>u(u(Cu(e),([r,n])=>[[r],n]),([r,n])=>[r,n],()=>u(u(Cu(e),([r,n])=>[[r],n]),([r,n])=>[r,n],()=>[]))),([r,n])=>[Qy(r),n]),wu=e=>u(u(h("`",e),([r,n])=>u(qT(n),([o,i])=>u(h("`",i),([a,c])=>[[r,o,a],c]))),([r,n])=>[Wy(r),n]),Hk=e=>u(wu(e),([r,n])=>[Zy(r),n]),Kk=e=>u(OT(e),([r,n])=>[Xy(r),n]),zk=e=>u(u(h("true",e),([r,n])=>[r,n],()=>u(h("false",e),([r,n])=>[r,n],()=>[])),([r,n])=>[Jy(r),n]),Yk=e=>u(yc(e),([r,n])=>[eh(r),n]),Vk=e=>u(hc(["'",'"'],e),([r,n])=>[th(r),n]),Qk=e=>u(u(Kk(e),([r,n])=>[r,n],()=>u(zk(e),([r,n])=>[r,n],()=>u(Yk(e),([r,n])=>[r,n],()=>u(Vk(e),([r,n])=>[r,n],()=>[])))),([r,n])=>[r,n]),Wk=e=>u(u(u(h("keyof",e),([r,n])=>[[r],n]),([r,n])=>[r,n],()=>u([[],e],([r,n])=>[r,n],()=>[])),([r,n])=>[rh(r),n]),BT=(e,r=[])=>u(u(u(h("[",e),([n,o])=>u(J(o),([i,a])=>u(h("]",a),([c,m])=>[[n,i,c],m]))),([n,o])=>[n,o],()=>u(u(h("[",e),([n,o])=>u(h("]",o),([i,a])=>[[n,i],a])),([n,o])=>[n,o],()=>[])),([n,o])=>BT(o,[...r,n]),()=>[r,e]),Zk=e=>u(BT(e),([r,n])=>[nh(r),n]),Xk=e=>u(u(u(h("extends",e),([r,n])=>u(J(n),([o,i])=>u(h("?",i),([a,c])=>u(J(c),([m,d])=>u(h(":",d),([f,y])=>u(J(y),([E,A])=>[[r,o,a,m,f,E],A])))))),([r,n])=>[r,n],()=>u([[],e],([r,n])=>[r,n],()=>[])),([r,n])=>[oh(r),n]),Jk=e=>u(u(u(h("(",e),([r,n])=>u(J(n),([o,i])=>u(h(")",i),([a,c])=>[[r,o,a],c]))),([r,n])=>[r,n],()=>u(Bk(e),([r,n])=>[r,n],()=>u(mM(e),([r,n])=>[r,n],()=>u(hM(e),([r,n])=>[r,n],()=>u(Hk(e),([r,n])=>[r,n],()=>u(Qk(e),([r,n])=>[r,n],()=>u(SM(e),([r,n])=>[r,n],()=>u(bM(e),([r,n])=>[r,n],()=>u(RM(e),([r,n])=>[r,n],()=>u(PM(e),([r,n])=>[r,n],()=>u(wk(e),([r,n])=>[r,n],()=>u(CM(e),([r,n])=>[r,n],()=>[])))))))))))),([r,n])=>[ih(r),n]),FT=e=>u(u(Wk(e),([r,n])=>u(Jk(n),([o,i])=>u(Zk(i),([a,c])=>u(Xk(c),([m,d])=>[[r,o,a,m],d])))),([r,n])=>[ah(r),n]),HT=e=>u(u(u(h("&",e),([r,n])=>u(FT(n),([o,i])=>u(HT(i),([a,c])=>[[r,o,a],c]))),([r,n])=>[r,n],()=>u([[],e],([r,n])=>[r,n],()=>[])),([r,n])=>[r,n]),KT=e=>u(u(FT(e),([r,n])=>u(HT(n),([o,i])=>[[r,o],i])),([r,n])=>[sh(r),n]),zT=e=>u(u(u(h("|",e),([r,n])=>u(KT(n),([o,i])=>u(zT(i),([a,c])=>[[r,o,a],c]))),([r,n])=>[r,n],()=>u([[],e],([r,n])=>[r,n],()=>[])),([r,n])=>[r,n]),Tc=e=>u(u(KT(e),([r,n])=>u(zT(n),([o,i])=>[[r,o],i])),([r,n])=>[ch(r),n]),eM=e=>u(u(h("readonly",e),([r,n])=>u(Tc(n),([o,i])=>[[r,o],i])),([r,n])=>[ph(r),n]),tM=e=>u(u(h("|",e),([r,n])=>u(Tc(n),([o,i])=>[[r,o],i])),([r,n])=>[uh(r),n]),rM=e=>u(u(Uu(e),([r,n])=>u(h("=",n),([o,i])=>u(J(i),([a,c])=>[[r,o,a],c]))),([r,n])=>[mh(r),n]),nM=e=>u(u(u(h("infer",e),([r,n])=>u(be(n),([o,i])=>u(h("extends",i),([a,c])=>u(Tc(c),([m,d])=>[[r,o,a,m],d])))),([r,n])=>[r,n],()=>u(u(h("infer",e),([r,n])=>u(be(n),([o,i])=>[[r,o],i])),([r,n])=>[r,n],()=>[])),([r,n])=>[lh(r),n]),J=e=>u(u(nM(e),([r,n])=>[r,n],()=>u(tM(e),([r,n])=>[r,n],()=>u(eM(e),([r,n])=>[r,n],()=>u(Tc(e),([r,n])=>[r,n],()=>[])))),([r,n])=>[r,n]),oM=e=>u(yc(e),([r,n])=>[dh(r),n]),iM=e=>u(be(e),([r,n])=>[r,n]),aM=e=>u(hc(["'",'"'],e),([r,n])=>[r,n]),sM=e=>u(u(h("[",e),([r,n])=>u(be(n),([o,i])=>u(h(":",i),([a,c])=>u(u($T(c),([m,d])=>[m,d],()=>u(GT(c),([m,d])=>[m,d],()=>u(DT(c),([m,d])=>[m,d],()=>u(jT(c),([m,d])=>[m,d],()=>[])))),([m,d])=>u(h("]",d),([f,y])=>[[r,o,a,m,f],y]))))),([r,n])=>[fh(r),n]),YT=e=>u(u(oM(e),([r,n])=>[r,n],()=>u(iM(e),([r,n])=>[r,n],()=>u(aM(e),([r,n])=>[r,n],()=>u(sM(e),([r,n])=>[r,n],()=>[])))),([r,n])=>[r,n]),cM=e=>u(u(u(h("readonly",e),([r,n])=>[[r],n]),([r,n])=>[r,n],()=>u([[],e],([r,n])=>[r,n],()=>[])),([r,n])=>[gh(r),n]),pM=e=>u(u(u(h("?",e),([r,n])=>[[r],n]),([r,n])=>[r,n],()=>u([[],e],([r,n])=>[r,n],()=>[])),([r,n])=>[yh(r),n]),VT=e=>u(u(cM(e),([r,n])=>u(YT(n),([o,i])=>u(pM(i),([a,c])=>u(h(":",c),([m,d])=>u(J(d),([f,y])=>[[r,o,a,m,f],y]))))),([r,n])=>[hh(r),n]),QT=e=>u(u(u(h(",",e),([r,n])=>u(h(`
|
|
31
31
|
`,n),([o,i])=>[[r,o],i])),([r,n])=>[r,n],()=>u(u(h(";",e),([r,n])=>u(h(`
|
|
32
32
|
`,n),([o,i])=>[[r,o],i])),([r,n])=>[r,n],()=>u(u(h(",",e),([r,n])=>[[r],n]),([r,n])=>[r,n],()=>u(u(h(";",e),([r,n])=>[[r],n]),([r,n])=>[r,n],()=>u(u(h(`
|
|
33
|
-
`,e),([r,n])=>[[r],n]),([r,n])=>[r,n],()=>[]))))),([r,n])=>[r,n]),
|
|
33
|
+
`,e),([r,n])=>[[r],n]),([r,n])=>[r,n],()=>[]))))),([r,n])=>[r,n]),WT=(e,r=[])=>u(u(VT(e),([n,o])=>u(QT(o),([i,a])=>[[n,i],a])),([n,o])=>WT(o,[...r,n]),()=>[r,e]),uM=e=>u(u(WT(e),([r,n])=>u(u(u(VT(n),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>u([[],n],([o,i])=>[o,i],()=>[])),([o,i])=>[[r,o],i])),([r,n])=>[Th(r),n]),Nu=e=>u(u(h("{",e),([r,n])=>u(uM(n),([o,i])=>u(h("}",i),([a,c])=>[[r,o,a],c]))),([r,n])=>[_h(r),n]),mM=e=>u(Nu(e),([r,n])=>[Ih(r),n]),lM=e=>u(u(u(be(e),([r,n])=>u(h("?",n),([o,i])=>u(h(":",i),([a,c])=>u(h("readonly",c),([m,d])=>u(J(d),([f,y])=>[[r,o,a,m,f],y]))))),([r,n])=>[r,n],()=>u(u(be(e),([r,n])=>u(h(":",n),([o,i])=>u(h("readonly",i),([a,c])=>u(J(c),([m,d])=>[[r,o,a,m],d])))),([r,n])=>[r,n],()=>u(u(be(e),([r,n])=>u(h("?",n),([o,i])=>u(h(":",i),([a,c])=>u(J(c),([m,d])=>[[r,o,a,m],d])))),([r,n])=>[r,n],()=>u(u(be(e),([r,n])=>u(h(":",n),([o,i])=>u(J(i),([a,c])=>[[r,o,a],c]))),([r,n])=>[r,n],()=>[])))),([r,n])=>[bh(r),n]),dM=e=>u(u(h("readonly",e),([r,n])=>u(J(n),([o,i])=>u(h("?",i),([a,c])=>[[r,o,a],c]))),([r,n])=>[Sh(r),n]),fM=e=>u(u(h("readonly",e),([r,n])=>u(J(n),([o,i])=>[[r,o],i])),([r,n])=>[Oh(r),n]),gM=e=>u(u(J(e),([r,n])=>u(h("?",n),([o,i])=>[[r,o],i])),([r,n])=>[Ah(r),n]),wT=e=>u(u(lM(e),([r,n])=>[r,n],()=>u(dM(e),([r,n])=>[r,n],()=>u(fM(e),([r,n])=>[r,n],()=>u(gM(e),([r,n])=>[r,n],()=>u(J(e),([r,n])=>[r,n],()=>[]))))),([r,n])=>[r,n]),ZT=e=>u(u(u(h("...",e),([r,n])=>u(wT(n),([o,i])=>[[r,o],i])),([r,n])=>[r,n],()=>u(u(wT(e),([r,n])=>[[r],n]),([r,n])=>[r,n],()=>[])),([r,n])=>[xh(r),n]),XT=(e,r=[])=>u(u(ZT(e),([n,o])=>u(h(",",o),([i,a])=>[[n,i],a])),([n,o])=>XT(o,[...r,n]),()=>[r,e]),yM=e=>u(u(XT(e),([r,n])=>u(u(u(ZT(n),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>u([[],n],([o,i])=>[o,i],()=>[])),([o,i])=>[[r,o],i])),([r,n])=>[Rh(r),n]),hM=e=>u(u(h("[",e),([r,n])=>u(yM(n),([o,i])=>u(h("]",i),([a,c])=>[[r,o,a],c]))),([r,n])=>[Ch(r),n]),TM=e=>u(u(be(e),([r,n])=>u(h("?",n),([o,i])=>u(h(":",i),([a,c])=>u(h("readonly",c),([m,d])=>u(J(d),([f,y])=>[[r,o,a,m,f],y]))))),([r,n])=>[Ph(r),n]),EM=e=>u(u(be(e),([r,n])=>u(h(":",n),([o,i])=>u(h("readonly",i),([a,c])=>u(J(c),([m,d])=>[[r,o,a,m],d])))),([r,n])=>[Uh(r),n]),_M=e=>u(u(be(e),([r,n])=>u(h("?",n),([o,i])=>u(h(":",i),([a,c])=>u(J(c),([m,d])=>[[r,o,a,m],d])))),([r,n])=>[wh(r),n]),IM=e=>u(u(be(e),([r,n])=>u(h(":",n),([o,i])=>u(J(i),([a,c])=>[[r,o,a],c]))),([r,n])=>[Nh(r),n]),NT=e=>u(u(TM(e),([r,n])=>[r,n],()=>u(EM(e),([r,n])=>[r,n],()=>u(_M(e),([r,n])=>[r,n],()=>u(IM(e),([r,n])=>[r,n],()=>[])))),([r,n])=>[r,n]),JT=e=>u(u(u(h("...",e),([r,n])=>u(NT(n),([o,i])=>[[r,o],i])),([r,n])=>[r,n],()=>u(u(NT(e),([r,n])=>[[r],n]),([r,n])=>[r,n],()=>[])),([r,n])=>[Lh(r),n]),eE=(e,r=[])=>u(u(JT(e),([n,o])=>u(h(",",o),([i,a])=>[[n,i],a])),([n,o])=>eE(o,[...r,n]),()=>[r,e]),tE=e=>u(u(eE(e),([r,n])=>u(u(u(JT(n),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>u([[],n],([o,i])=>[o,i],()=>[])),([o,i])=>[[r,o],i])),([r,n])=>[vh(r),n]),bM=e=>u(u(h("(",e),([r,n])=>u(tE(n),([o,i])=>u(h(")",i),([a,c])=>u(h("=>",c),([m,d])=>u(J(d),([f,y])=>[[r,o,a,m,f],y]))))),([r,n])=>[kh(r),n]),SM=e=>u(u(h("new",e),([r,n])=>u(h("(",n),([o,i])=>u(tE(i),([a,c])=>u(h(")",c),([m,d])=>u(h("=>",d),([f,y])=>u(J(y),([E,A])=>[[r,o,a,m,f,E],A])))))),([r,n])=>[Mh(r),n]),OM=e=>u(u(u(h("+",e),([r,n])=>u(h("readonly",n),([o,i])=>[[r,o],i])),([r,n])=>[r,n],()=>u(u(h("-",e),([r,n])=>u(h("readonly",n),([o,i])=>[[r,o],i])),([r,n])=>[r,n],()=>u(u(h("readonly",e),([r,n])=>[[r],n]),([r,n])=>[r,n],()=>u([[],e],([r,n])=>[r,n],()=>[])))),([r,n])=>[Dh(r),n]),AM=e=>u(u(u(h("+",e),([r,n])=>u(h("?",n),([o,i])=>[[r,o],i])),([r,n])=>[r,n],()=>u(u(h("-",e),([r,n])=>u(h("?",n),([o,i])=>[[r,o],i])),([r,n])=>[r,n],()=>u(u(h("?",e),([r,n])=>[[r],n]),([r,n])=>[r,n],()=>u([[],e],([r,n])=>[r,n],()=>[])))),([r,n])=>[Gh(r),n]),xM=e=>u(u(u(h("as",e),([r,n])=>u(J(n),([o,i])=>[[r,o],i])),([r,n])=>[r,n],()=>u([[],e],([r,n])=>[r,n],()=>[])),([r,n])=>[$h(r),n]),RM=e=>u(u(h("{",e),([r,n])=>u(OM(n),([o,i])=>u(h("[",i),([a,c])=>u(be(c),([m,d])=>u(h("in",d),([f,y])=>u(J(y),([E,A])=>u(xM(A),([ye,Ue])=>u(h("]",Ue),([Dr,so])=>u(AM(so),([Tn,EN])=>u(h(":",EN),([_N,IN])=>u(J(IN),([bN,SN])=>u(MT(SN),([ON,AN])=>u(h("}",AN),([xN,RN])=>[[r,o,a,m,f,E,ye,Dr,Tn,_N,bN,ON,xN],RN]))))))))))))),([r,n])=>[jh(r),n]),CM=e=>u(be(e),([r,n])=>[qh(r),n]),PM=e=>u(u(h("Options",e),([r,n])=>u(h("<",n),([o,i])=>u(J(i),([a,c])=>u(h(",",c),([m,d])=>u(oE(d),([f,y])=>u(h(">",y),([E,A])=>[[r,o,a,m,f,E],A])))))),([r,n])=>[Bh(r),n]),UM=e=>u(yc(e),([r,n])=>[Fh(r),n]),wM=e=>u(u(h("true",e),([r,n])=>[r,n],()=>u(h("false",e),([r,n])=>[r,n],()=>[])),([r,n])=>[Hh(r),n]),NM=e=>u(hc(['"',"'"],e),([r,n])=>[r,n]),LM=e=>u(h("null",e),([r,n])=>[Kh(r),n]),rE=e=>u(u(YT(e),([r,n])=>u(h(":",n),([o,i])=>u(Lu(i),([a,c])=>[[r,o,a],c]))),([r,n])=>[zh(r),n]),nE=(e,r=[])=>u(u(rE(e),([n,o])=>u(QT(o),([i,a])=>[[n,i],a])),([n,o])=>nE(o,[...r,n]),()=>[r,e]),vM=e=>u(u(nE(e),([r,n])=>u(u(u(rE(n),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>u([[],n],([o,i])=>[o,i],()=>[])),([o,i])=>[[r,o],i])),([r,n])=>[Yh(r),n]),oE=e=>u(u(h("{",e),([r,n])=>u(vM(n),([o,i])=>u(h("}",i),([a,c])=>[[r,o,a],c]))),([r,n])=>[Vh(r),n]),iE=(e,r=[])=>u(u(Lu(e),([n,o])=>u(h(",",o),([i,a])=>[[n,i],a])),([n,o])=>iE(o,[...r,n]),()=>[r,e]),kM=e=>u(u(iE(e),([r,n])=>u(u(u(Lu(n),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>u([[],n],([o,i])=>[o,i],()=>[])),([o,i])=>[[r,o],i])),([r,n])=>[Qh(r),n]),MM=e=>u(u(h("[",e),([r,n])=>u(kM(n),([o,i])=>u(h("]",i),([a,c])=>[[r,o,a],c]))),([r,n])=>[Wh(r),n]),Lu=e=>u(u(UM(e),([r,n])=>[r,n],()=>u(wM(e),([r,n])=>[r,n],()=>u(NM(e),([r,n])=>[r,n],()=>u(LM(e),([r,n])=>[r,n],()=>u(oE(e),([r,n])=>[r,n],()=>u(MM(e),([r,n])=>[r,n],()=>[])))))),([r,n])=>[r,n]),DM=e=>u(h("-?(?:0|[1-9][0-9]*)n",e),([r,n])=>[Zh(r),n]),GM=e=>u(h(".*",e),([r,n])=>[Xh(r),n]),$M=e=>u(h("-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?",e),([r,n])=>[Jh(r),n]),jM=e=>u(h("-?(?:0|[1-9][0-9]*)",e),([r,n])=>[eT(r),n]),qM=e=>u(h("(?!)",e),([r,n])=>[tT(r),n]),BM=e=>u(UT(["-?(?:0|[1-9][0-9]*)n",".*","-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?","-?(?:0|[1-9][0-9]*)","(?!)","(",")","$","|"],e),([r,n])=>[rT(r),n]),FM=e=>u(u(DM(e),([r,n])=>[r,n],()=>u(GM(e),([r,n])=>[r,n],()=>u($M(e),([r,n])=>[r,n],()=>u(jM(e),([r,n])=>[r,n],()=>u(qM(e),([r,n])=>[r,n],()=>u(HM(e),([r,n])=>[r,n],()=>u(BM(e),([r,n])=>[r,n],()=>[]))))))),([r,n])=>[r,n]),HM=e=>u(u(h("(",e),([r,n])=>u(vu(n),([o,i])=>u(h(")",i),([a,c])=>[[r,o,a],c]))),([r,n])=>[nT(r),n]),aE=e=>u(u(u(Pu(e),([r,n])=>u(h("|",n),([o,i])=>u(aE(i),([a,c])=>[[r,o,a],c]))),([r,n])=>[r,n],()=>u(u(Pu(e),([r,n])=>[[r],n]),([r,n])=>[r,n],()=>u([[],e],([r,n])=>[r,n],()=>[]))),([r,n])=>[oT(r),n]),Pu=e=>u(u(FM(e),([r,n])=>u(vu(n),([o,i])=>[[r,o],i])),([r,n])=>[iT(r),n]),vu=e=>u(u(aE(e),([r,n])=>[r,n],()=>u(Pu(e),([r,n])=>[r,n],()=>[])),([r,n])=>[r,n]),sE=e=>u(u(h("^",e),([r,n])=>u(vu(n),([o,i])=>u(h("$",i),([a,c])=>[[r,o,a],c]))),([r,n])=>[aT(r),n]),cE=(e,r=[])=>u(u(J(e),([n,o])=>u(h(",",o),([i,a])=>[[n,i],a])),([n,o])=>cE(o,[...r,n]),()=>[r,e]),KM=e=>u(u(cE(e),([r,n])=>u(u(u(J(n),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>u([[],n],([o,i])=>[o,i],()=>[])),([o,i])=>[[r,o],i])),([r,n])=>[sT(r),n]),pE=e=>u(u(u(h("extends",e),([r,n])=>u(KM(n),([o,i])=>[[r,o],i])),([r,n])=>[r,n],()=>u([[],e],([r,n])=>[r,n],()=>[])),([r,n])=>[cT(r),n]),zM=e=>u(u(h("interface",e),([r,n])=>u(be(n),([o,i])=>u(Uu(i),([a,c])=>u(pE(c),([m,d])=>u(Nu(d),([f,y])=>[[r,o,a,m,f],y]))))),([r,n])=>[pT(r),n]),YM=e=>u(u(h("interface",e),([r,n])=>u(be(n),([o,i])=>u(pE(i),([a,c])=>u(Nu(c),([m,d])=>[[r,o,a,m],d])))),([r,n])=>[uT(r),n]),VM=e=>u(u(h("type",e),([r,n])=>u(be(n),([o,i])=>u(Uu(i),([a,c])=>u(h("=",c),([m,d])=>u(J(d),([f,y])=>[[r,o,a,m,f],y]))))),([r,n])=>[mT(r),n]),QM=e=>u(u(h("type",e),([r,n])=>u(be(n),([o,i])=>u(h("=",i),([a,c])=>u(J(c),([m,d])=>[[r,o,a,m],d])))),([r,n])=>[lT(r),n]),WM=e=>u(u(u(h("export",e),([r,n])=>[[r],n]),([r,n])=>[r,n],()=>u([[],e],([r,n])=>[r,n],()=>[])),([r,n])=>[dT(r),n]),ZM=e=>u(u(u(h(";",e),([r,n])=>u(h(`
|
|
34
34
|
`,n),([o,i])=>[[r,o],i])),([r,n])=>[r,n],()=>u(u(h(";",e),([r,n])=>[[r],n]),([r,n])=>[r,n],()=>u(u(h(`
|
|
35
|
-
`,e),([r,n])=>[[r],n]),([r,n])=>[r,n],()=>[]))),([r,n])=>[r,n]),aE=(e,r=[])=>u(u(Nu(e),([n,o])=>u(vM(o),([i,a])=>[[n,i],a])),([n,o])=>aE(o,[...r,n]),()=>[r,e]),kM=e=>u(u(aE(e),([r,n])=>u(u(u(Nu(n),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>u([[],n],([o,i])=>[o,i],()=>[])),([o,i])=>[[r,o],i])),([r,n])=>[uT(r),n]),Nu=e=>u(u(LM(e),([r,n])=>u(u(PM(n),([o,i])=>[o,i],()=>u(UM(n),([o,i])=>[o,i],()=>u(wM(n),([o,i])=>[o,i],()=>u(NM(n),([o,i])=>[o,i],()=>[])))),([o,i])=>u(NT(i),([a,c])=>[[r,o,a],c]))),([r,n])=>[mT(r),n]),MM=e=>u(u(Nu(e),([r,n])=>u(kM(n),([o,i])=>[[r,o],i])),([r,n])=>[lT(r),n]),sE=e=>u(u(MM(e),([r,n])=>[r,n],()=>u($k(e),([r,n])=>[r,n],()=>u(ee(e),([r,n])=>[r,n],()=>[]))),([r,n])=>[r,n]);function cE(e){let r=Cu(`\`${e}\``);return s.IsEqual(r.length,2)?r[0]:H()}function ki(e,r={}){return P("TemplateLiteral",[e],r)}function pE(e){return C({},ki(e,{}))}function GM(e){let r=cE(e);return pE(r)}function uE(e,r={}){let n=s.IsString(e)?GM(e):pE(e);return g.Update(n,{},r)}function Ce(e){return b(e,"TemplateLiteral")}var L={};vt(L,{ExtendsFalse:()=>F,ExtendsTrue:()=>x,ExtendsUnion:()=>Lu,IsExtendsFalse:()=>$M,IsExtendsTrue:()=>lE,IsExtendsTrueLike:()=>Se,IsExtendsUnion:()=>mE});function Lu(e){return g.Create({"~kind":"ExtendsUnion"},{inferred:e})}function mE(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 lE(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 $M(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.IsEqual(e["~kind"],"ExtendsFalse")}function Se(e){return mE(e)||lE(e)}function Tc(e){let r=nE(e);return s.IsEqual(r.length,2)?r[0]:H()}function jM(e){return!0}function dE(e){let[r,...n]=e;return O(r)?qM(r)?dE(n):!1:!0}function fE(e){return s.IsEqual(e.length,0)?!1:dE(e)}function qM(e){return S(e)?fE(e.anyOf):J(e)?jM(e.const):!1}function Ec(e){return fE(e)}function gE(e,r,n=[]){let[o,...i]=e;return s.IsString(o)?gE(i,r,[...n,`${o}${r}`]):n}function BM(e,r){return s.IsEqual(e.length,0)?[`${r}`]:gE(e,r)}function yE(e,r,n=[]){let[o,...i]=r;return O(o)?yE(e,i,[...n,...hE(e,o)]):n}function hE(e,r){return S(r)?yE(e,r.anyOf):J(r)?BM(e,r.const):H()}function TE(e,r){let[n,...o]=r;return O(n)?TE(hE(e,n),o):e}function FM(e){return e.map(r=>Y(r))}function HM(e){let r=TE([],e),n=FM(r);return q(n)}function KM(e){return s.IsEqual(e.length,0)?H():s.IsEqual(e.length,1)&&J(e[0])?e[0]:HM(e)}function tt(e){let r=Tc(e);return Ec(r)?KM(r):_t()}function zM(e){return s.IsString(e)||s.IsNumber(e)?Y(e):s.IsNull(e)?Kr():X()}function Bt(e){return e.map(n=>zM(n))}function ea(e){let r=Bt(e);return q(r)}function Pn(e){return ea(e.enum)}function YM(e,r,n,o){let i=ne(e,n,o);return Se(i)?x(g.Assign(g.Assign(e,i.inferred),{[r]:n})):F()}function VM(e,r){return x(e)}function QM(e,r,n){let o=ea(n);return ne(e,r,o)}function EE(e,r,n){let[o,...i]=n;return O(o)?(()=>{let a=ne(e,r,o);return Se(a)?EE(a.inferred,r,i):F()})():x(e)}function WM(e,r,n){let o=tt(n);return ne(e,r,o)}function _E(e,r,n){let[o,...i]=n;return O(o)?(()=>{let a=ne(e,r,o);return Se(a)?x(a.inferred):_E(e,r,i)})():F()}function K(e,r,n){return st(n)?VM(e,r):Re(n)?QM(e,r,n.enum):xe(n)?YM(e,n.name,r,n.extends):w(n)?EE(e,r,n.allOf):Ce(n)?WM(e,r,n.pattern):S(n)?_E(e,r,n.anyOf):Et(n)?x(e):F()}function IE(e,r,n){return xe(n)?K(e,r,n):st(n)?x(e):Et(n)?x(e):Lu(e)}function ZM(e,r){let n=bn(e),o=bn(r);return n&&o||!n&&o?!0:!(n&&!o)}function bE(e,r,n,o){return re(o)?ZM(r,o)?ne(e,n,o.items):F():K(e,r,o)}function SE(e,r,n){return ot(n)?ne(e,r,n.iteratorItems):K(e,Wt(r),n)}function OE(e,r,n){return St(n)?x(e):K(e,r,n)}function AE(e,r,n){return pt(n)?x(e):K(e,r,n)}function XM(e,r,n,o,i){let a=xe(o)?r:o,c=xe(o)?o:r,m=Me(r),l=Me(o),f=ne(e,a,c);return!m&&l?F():Se(f)?ta(f.inferred,n,i):F()}function JM(e,r,n,o){let[i,...a]=o;return O(i)?XM(e,r,n,i,a):Me(r)?x(e):F()}function e0(e,r,n){let[o,...i]=r;return O(o)?JM(e,o,i,n):x(e)}function ta(e,r,n){return e0(e,r,n)}function _c(e,r,n){return At(n)?x(e):ne(e,r,n)}function xE(e,r,n,o){return De(o)?(()=>{let i=ta(e,r,o.parameters);return Se(i)?_c(i.inferred,n,o.instanceType):F()})():F()}function RE(e,r,n){return ne(e,Pn(r),n)}function CE(e,r,n,o){return Ge(o)?(()=>{let i=ta(e,r,o.parameters);return Se(i)?_c(i.inferred,n,o.returnType):F()})():F()}function PE(e,r,n){return Be(n)?x(e):_e(n)?x(e):K(e,r,n)}var ra="equal",t0="disjoint",na="left-inside",oa="right-inside";function ia(e,r){let n=[Et(e)?L.ExtendsFalse():rt({},e,r),Et(e)?L.ExtendsTrue({}):rt({},r,e)];return L.IsExtendsTrueLike(n[0])&&L.IsExtendsTrueLike(n[1])?ra:L.IsExtendsTrueLike(n[0])&&L.IsExtendsFalse(n[1])?na:L.IsExtendsFalse(n[0])&&L.IsExtendsTrueLike(n[1])?oa:t0}function r0(e){return S(e)?nr(e.anyOf):[e]}function nr(e){return e.reduce((r,n)=>[...r,...r0(n)],[])}function vu(e){return e.reduceRight((n,o,i)=>({[i]:o,...n}),{})}function UE(e){let r=vu(e.items);return N(r)}function n0(e,r){return Sn(e)?!!Sn(r):!1}function o0(e,r){return Me(e)?!!Me(r):!1}function i0(e,r){let n=n0(e,r),o=o0(e,r),i=Pe([e,r]),a=Ys(so(i));return n&&o?Tt(ht(a)):n&&!o?Tt(a):!n&&o?ht(a):a}function a0(e,r,n){return n in e?n in r?i0(e[n],r[n]):e[n]:n in r?r[n]:X()}function s0(e,r){return[...new Set([...s.Keys(r),...s.Keys(e)])].reduce((o,i)=>({...o,[i]:a0(e,r,i)}),{})}function wE(e){return k(e)?e.properties:V(e)?vu(e.items):H()}function NE(e,r){let n=wE(e),o=wE(r),i=s0(n,o);return N(i)}function LE(e,r){let n=ia(e,r);return s.IsEqual(n,na)?e:s.IsEqual(n,oa)||s.IsEqual(n,ra)?r:X()}function vE(e){return k(e)||V(e)}function kE(e){return w(e)?Pe(e.allOf):e}function c0(e,r){let n=kE(e),o=kE(r),i=vE(n),a=vE(o);return i&&a?NE(Qr(n),o):i&&!a?Qr(n):!i&&a?o:LE(Qr(n),o)}function ME(e,r,n=[]){let[o,...i]=r;return s.IsUndefined(o)?n.length===0?[e]:n:ME(e,i,[...n,c0(e,o)])}function DE(e,r,n=[]){let[o,...i]=e;return O(o)?DE(i,r,[...n,...aa([o],r)]):n}function aa(e,r=[]){let[n,...o]=e;return O(n)?S(n)?aa(o,DE(n.anyOf,r)):aa(o,ME(n,r)):r}function Pe(e){let r=aa(e);return ku(r)}function gr(e){return ku(e)}function Qr(e){return w(e)?Pe(e.allOf):S(e)?gr(e.anyOf):e}function Un(e){return s.IsEqual(e.length,1)?e[0]:s.IsEqual(e.length,0)?X():q(e)}function p0(e,r){return r.filter(n=>ia(e,n)!==oa)}function u0(e,r){let n=r.some(o=>{let i=ia(e,o);return s.IsEqual(i,na)||s.IsEqual(i,ra)});return s.IsEqual(n,!1)}function m0(e,r){let n=Qr(e);return st(n)?[n]:u0(n,r)?[...p0(n,r),n]:r}function Mu(e,r=[]){let[n,...o]=e;return O(n)?k(n)?Mu(o,[...r,n]):Mu(o,m0(n,r)):r}function ku(e){let r=Mu(e),n=nr(r);return n.length===0?X():n.length===1?n[0]:q(n)}function l0(e,r,n,o){let i=_(e,r,n);return g.Update(Qr(i),{},o)}function GE(e,r,n,o){return l0(e,r,n,o)}function $E(e,r,n){let o=Pe(r);return ne(e,o,n)}function jE(e,r,n){return it(n)?ne(e,r,n.iteratorItems):K(e,Xt(r),n)}function Ic(e,r,n){return r===n?x(e):F()}function d0(e,r,n){return J(n)?Ic(e,r,n.const):St(n)?x(e):K(e,Y(r),n)}function f0(e,r,n){return J(n)?Ic(e,r,n.const):pt(n)?x(e):K(e,Y(r),n)}function g0(e,r,n){return J(n)?Ic(e,r,n.const):_e(n)?x(e):K(e,Y(r),n)}function y0(e,r,n){return J(n)?Ic(e,r,n.const):Ne(n)?x(e):K(e,Y(r),n)}function qE(e,r,n){return s.IsBigInt(r.const)?d0(e,r.const,n):s.IsBoolean(r.const)?f0(e,r.const,n):s.IsNumber(r.const)?g0(e,r.const,n):s.IsString(r.const)?y0(e,r.const,n):H()}function BE(e,r,n){return xe(n)?K(e,r,n):x(e)}function FE(e,r,n){return Jt(n)?x(e):K(e,r,n)}function HE(e,r,n){return _e(n)?x(e):K(e,r,n)}function h0(e,r,n){return Me(r)?Me(n)?x(e):F():x(e)}function T0(e,r,n){return xe(n)&&dr(n.extends)?F():(()=>{let o=ne(e,r,n);return Se(o)?h0(o.inferred,r,n):F()})()}function E0(e,r){return e.reduce((n,o)=>o in r?Se(r[o])?{...n,...r[o].inferred}:H():H(),{})}function _0(e,r,n){let o={};for(let c of s.Keys(n))o[c]=c in r?T0({},r[c],n[c]):Me(n[c])?xe(n[c])?x(g.Assign(e,{[n[c].name]:n[c].extends})):x(e):F();let i=s.Values(o).every(c=>Se(c)),a=i?E0(s.Keys(o),o):{};return i?x(a):F()}function I0(e,r,n){let o=_0(e,r,n);return Se(o)?x(g.Assign(e,o.inferred)):F()}function b0(e,r,n){return I0(e,r,n)}function KE(e,r,n){return k(n)?b0(e,r,n.properties):K(e,N(r),n)}function zE(e,r,n){return Je(n)?ne(e,r,n.item):K(e,tr(r),n)}function YE(e,r,n){return Ne(n)?x(e):K(e,r,n)}function VE(e,r,n){return er(n)?x(e):K(e,r,n)}function QE(e,r,n){let o=tt(r);return ne(e,o,n)}function Du(e,r){return g.Create({"~kind":"Inferrable"},{name:e,type:r},{})}function sa(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 Gu(e){return zr(e)?xe(e.items)?re(e.items.extends)?Du(e.items.name,e.items.extends.items):Et(e.items.extends)?Du(e.items.name,e.items.extends):void 0:H():void 0}function bc(e){return xe(e)?Du(e.name,e.extends):void 0}function $u(e,r,n=[]){let[o,...i]=e;return O(o)?(()=>{let a=ne({},o,r);return Se(a)?$u(i,r,[...n,o]):void 0})():n}function WE(e,r,n,o){let i=$u(n,o);return s.IsArray(i)?x(g.Assign(e,{[r]:Fe(i)})):F()}function Sc(e,r,n,o){let i=$u(n,o);return s.IsArray(i)?x(g.Assign(e,{[r]:q(i)})):F()}function S0(e){return[...e].reverse()}function ju(e,r){return r?S0(e):e}function O0(e){let r=e.length>0?e[0]:void 0,n=O(r)?Gu(r):void 0;return O(n)}function A0(e,r,n,o,i,a){let c=ne(e,n,i);return Se(c)?ZE(c.inferred,r,o,a):F()}function x0(e,r,n,o,i){let a=Gu(o);return sa(a)?WE(e,a.name,ju(n,r),a.type):(()=>{let[c,...m]=n;return O(c)?A0(e,r,c,m,o,i):F()})()}function R0(e,r,n,o){let[i,...a]=o;return O(i)?x0(e,r,n,i,a):s.IsEqual(n.length,0)?x(e):F()}function ZE(e,r,n,o){return R0(e,r,n,o)}function C0(e,r,n){let o=Oc(e,{callstack:[]},n),i=O0(o);return ZE(e,i,ju(r,i),ju(o,i))}function XE(e,r,n){let o=bc(n);return sa(o)?Sc(e,o.name,r,o.type):(()=>{let[i,...a]=r;return O(i)?(()=>{let c=ne(e,i,n);return Se(c)?XE(c.inferred,a,n):F()})():x(e)})()}function JE(e,r,n){let o=Oc(e,{callstack:[]},r);return V(n)?C0(e,o,n.items):re(n)?XE(e,o,n.items):K(e,Fe(o),n)}function e_(e,r,n){return At(n)?x(e):rr(n)?x(e):K(e,r,n)}function t_(e,r,n){let[o,...i]=n;return O(o)?(()=>{let a=ne(e,r,o);return Se(a)?x(a.inferred):t_(e,r,i)})():F()}function qu(e,r,n){let[o,...i]=r;return O(o)?(()=>{let a=t_(e,o,n);return Se(a)?qu(a.inferred,i,n):F()})():x(e)}function r_(e,r,n){let o=bc(n);return sa(o)?Sc(e,o.name,r,o.type):S(n)?qu(e,r,n.anyOf):qu(e,r,[n])}function n_(e,r,n){return xe(n)?K(e,r,n):st(n)?x(e):Et(n)?x(e):F()}function o_(e,r,n){return At(n)?x(e):K(e,r,n)}function ne(e,r,n){return st(r)?IE(e,r,n):re(r)?bE(e,r,r.items,n):ot(r)?SE(e,r.iteratorItems,n):St(r)?OE(e,r,n):pt(r)?AE(e,r,n):De(r)?xE(e,r.parameters,r.instanceType,n):Re(r)?RE(e,r,n):Ge(r)?CE(e,r.parameters,r.returnType,n):Be(r)?PE(e,r,n):w(r)?$E(e,r.allOf,n):it(r)?jE(e,r.iteratorItems,n):J(r)?qE(e,r,n):dr(r)?BE(e,r,n):Jt(r)?FE(e,r,n):_e(r)?HE(e,r,n):k(r)?KE(e,r.properties,n):Je(r)?zE(e,r.item,n):Ne(r)?YE(e,r,n):er(r)?VE(e,r,n):Ce(r)?QE(e,r.pattern,n):V(r)?JE(e,r.items,n):rr(r)?e_(e,r,n):S(r)?r_(e,r.anyOf,n):Et(r)?n_(e,r,n):At(r)?o_(e,r,n):F()}function _o(e,r,n={}){return P("Interface",[e,r],n)}function Ro(e){return O(e)&&s.HasPropertyKey(e,"action")&&s.IsEqual(e.action,"Interface")}function i_(e,r,n={}){return C({},_o(e,r,n))}function P0(e,r,n){return e.includes(n)?!0:Wr([...e,n],r,r[n])}function a_(e,r,n){let o=nc(n);return wn(e,r,o)}function wn(e,r,n){let[o,...i]=n;return O(o)?Wr(e,r,o)?!0:wn(e,r,i):!1}function Wr(e,r,n){return pe(n)?P0(e,r,n.$ref):re(n)?Wr(e,r,n.items):ot(n)?Wr(e,r,n.iteratorItems):De(n)?wn(e,r,[...n.parameters,n.instanceType]):Ge(n)?wn(e,r,[...n.parameters,n.returnType]):Ro(n)?a_(e,r,n.parameters[1]):w(n)?wn(e,r,n.allOf):it(n)?Wr(e,r,n.iteratorItems):k(n)?a_(e,r,n.properties):Je(n)?Wr(e,r,n.item):S(n)?wn(e,r,n.anyOf):V(n)?wn(e,r,n.items):Ie(n)?Wr(e,r,et(n)):!1}function Ac(e,r,n){return Wr(e,r,n)}function U0(e,r){return r.reduce((n,o)=>o in e?Ac([o],e,e[o])?[...n,o]:n:H(),[])}function s_(e){let r=ay(e);return U0(e,r)}function w0(e,r,n){return n.includes(r)?n:r in e?Zr(e,e[r],[...n,r]):H()}function c_(e,r,n){let o=nc(r);return Co(e,o,n)}function Co(e,r,n){return r.reduce((o,i)=>Zr(e,i,o),n)}function Zr(e,r,n){return pe(r)?w0(e,r.$ref,n):re(r)?Zr(e,r.items,n):ot(r)?Zr(e,r.iteratorItems,n):De(r)?Co(e,[...r.parameters,r.instanceType],n):Ge(r)?Co(e,[...r.parameters,r.returnType],n):Ro(r)?c_(e,r.parameters[1],n):w(r)?Co(e,r.allOf,n):it(r)?Zr(e,r.iteratorItems,n):k(r)?c_(e,r.properties,n):Je(r)?Zr(e,r.item,n):S(r)?Co(e,r.anyOf,n):V(r)?Co(e,r.items,n):Ie(r)?Zr(e,et(r),n):n}function p_(e,r,n){return Zr(e,n,[r])}function N0(e){return po()}function L0(e){return s.Keys(e).reduce((r,n)=>({...r,[n]:or(e[n])}),{})}function ca(e){return e.reduce((r,n)=>[...r,or(n)],[])}function or(e){return pe(e)?N0(e.$ref):re(e)?qt(or(e.items),Qs(e)):ot(e)?Wt(or(e.iteratorItems)):De(e)?jr(ca(e.parameters),or(e.instanceType)):Ge(e)?qr(ca(e.parameters),or(e.returnType)):w(e)?Pt(ca(e.allOf)):it(e)?Xt(or(e.iteratorItems)):k(e)?N(L0(e.properties)):Je(e)?tr(or(e.item)):Ie(e)?ic(ho(e),or(et(e))):S(e)?q(ca(e.anyOf)):V(e)?Fe(ca(e.items)):e}function v0(e,r){return r in e?or(e[r]):Ze()}function u_(e){return v0(e.$defs,e.$ref)}function k0(e,r,n){let o=xt(e,{callstack:[]},r),i=pa({},{callstack:[]},n);return Pe([...o,N(i)])}function M0(e,r){return s.Keys(e).filter(o=>r.includes(o)).reduce((o,i)=>{let a=e[i],c=Ro(a)?k0(e,a.parameters[0],a.parameters[1]):a;return{...o,[i]:c}},{})}function m_(e,r,n){let o=p_(e,r,n),i=M0(e,o);return Zt(i,r)}function l_(e,r){return r in e?pe(e[r])?l_(e,e[r].$ref):e[r]:X()}function ir(e,r){return l_(e,r)}function d_(e){return le(e)?u_(e):e}function rt(e,r,n){let o=d_(r),i=d_(n);return ne(e,o,i)}function D0(e,r,n){if(xe(r)||Po(r)||L.IsExtendsTrueLike(rt({},r,n)))return;let o={parameter:e,extends:n,received:r};throw new Error("Generic argument does not satify constraint",{cause:o})}function f_(e,r,n,o,i){let a=_(e,r,i);return D0(n,a,o),g.Assign(e,{[n]:a})}function G0(e,r,n,o,i){let a=_(e,r,n.extends),c=_(e,r,n.equals),[m,...l]=i;return O(m)?Bu(f_(e,r,n.name,a,m),r,o,l):Bu(f_(e,r,n.name,a,c),r,o,[])}function Bu(e,r,n,o){let[i,...a]=n;return O(i)?G0(e,r,i,a,o):e}function g_(e,r,n,o){return Bu(e,r,n,o)}function $0(e){return s.IsGreaterThan(e.length,0)?e[0]:""}function y_(e,r,n,o){let i=xt(e,r,o);return pc(n,i)}function j0(e,r,n,o){return y_(e,r,we(n),o)}function q0(e,r,n,o,i,a){let c=xt(e,r,a),m=g_(e,r,o,c),l=_(m,{callstack:[...r.callstack,n]},i);return _(e,r,l)}function xc(e,r,n,o){let[i,a]=Mg(e,n,o);return co(a)?s.IsEqual($0(r.callstack),i)?j0(e,r,i,o):q0(e,r,i,a.parameters,a.expression,o):y_(e,r,n,o)}function pc(e,r){return g.Create({"~kind":"Call"},{target:e,arguments:r},{})}function h_(e,r){return xc({},{callstack:[]},e,r)}function Po(e){return b(e,"Call")}function T_(e){return Je(e)?T_(e.item):e}function B0(e,r,n,o){let i=_(e,r,n);return g.Update(T_(i),{},o)}function E_(e,r,n,o){return v(e,[n])?B0(e,r,n,o):Ji(n,o)}function __(e,r){return e(r)}function I_(e,r){return s.IsString(r)?Y(__(e,r)):Y(r)}function b_(e,r){let n=tt(r);return yr(e,n)}function S_(e,r){let n=r.map(o=>yr(e,o));return q(n)}function yr(e,r){return J(r)?I_(e,r.const):Ce(r)?b_(e,r.pattern):S(r)?S_(e,r.anyOf):r}function Mi(e,r={}){return P("Capitalize",[e],r)}function O_(e,r={}){return C({},Mi(e,r))}function Di(e,r={}){return P("Lowercase",[e],r)}function A_(e,r={}){return C({},Di(e,r))}function Gi(e,r={}){return P("Uncapitalize",[e],r)}function x_(e,r={}){return C({},Gi(e,r))}function $i(e,r={}){return P("Uppercase",[e],r)}function R_(e,r={}){return C({},$i(e,r))}var F0=e=>e[0].toUpperCase()+e.slice(1),H0=e=>e.toLowerCase(),K0=e=>e[0].toLowerCase()+e.slice(1),z0=e=>e.toUpperCase();function Y0(e,r,n,o){let i=_(e,r,n);return g.Update(yr(F0,i),{},o)}function C_(e,r,n,o){return v(e,[n])?Y0(e,r,n,o):Mi(n,o)}function V0(e,r,n,o){let i=_(e,r,n);return g.Update(yr(H0,i),{},o)}function P_(e,r,n,o){return v(e,[n])?V0(e,r,n,o):Di(n,o)}function Q0(e,r,n,o){let i=_(e,r,n);return g.Update(yr(K0,i),{},o)}function U_(e,r,n,o){return v(e,[n])?Q0(e,r,n,o):Gi(n,o)}function W0(e,r,n,o){let i=_(e,r,n);return g.Update(yr(z0,i),{},o)}function w_(e,r,n,o){return v(e,[n])?W0(e,r,n,o):$i(n,o)}function ji(e,r,n,o,i={}){return P("Conditional",[e,r,n,o],i)}function N_(e,r,n,o,i={}){return C({},ji(e,r,n,o,i))}function Z0(e,r,n,o,i,a,c){let m=_(e,r,n),l=_(e,r,o),f=rt(e,m,l);return g.Update(L.IsExtendsUnion(f)?q([_(f.inferred,r,i),_(e,r,a)]):L.IsExtendsTrue(f)?_(f.inferred,r,i):_(e,r,a),{},c)}function L_(e,r,n,o,i,a,c){return v(e,[n,o])?Z0(e,r,n,o,i,a,c):ji(n,o,i,a,c)}function qi(e,r={}){return P("ConstructorParameters",[e],r)}function v_(e,r={}){return C({},qi(e,r))}function X0(e){return De(e)?_({},{callstack:[]},Fe(e.parameters)):X()}function J0(e,r,n,o){let i=_(e,r,n);return g.Update(X0(i),{},o)}function k_(e,r,n,o){return v(e,[n])?J0(e,r,n,o):qi(n,o)}function Bi(e,r,n={}){return P("Exclude",[e,r],n)}function M_(e,r,n={}){return C({},Bi(e,r,n))}function D_(e,r){return e.reduce((n,o)=>[...n,...G_(o,r)],[])}function G_(e,r){let n=rt({},e,r);return L.IsExtendsTrueLike(n)?[]:[e]}function eD(e,r){let n=Re(e)?D_(Bt(e.enum),r):S(e)?D_(nr(e.anyOf),r):G_(e,r);return gr(n)}function tD(e,r,n,o,i){let a=_(e,r,n),c=_(e,r,o);return g.Update(eD(a,c),{},i)}function Rc(e,r,n,o,i){return v(e,[n,o])?tD(e,r,n,o,i):Bi(n,o,i)}function Fi(e,r,n={}){return P("Extract",[e,r],n)}function $_(e,r,n={}){return C({},Fi(e,r,n))}function j_(e,r){return e.reduce((n,o)=>[...n,...q_(o,r)],[])}function q_(e,r){let n=rt({},e,r);return L.IsExtendsTrueLike(n)?[e]:[]}function rD(e,r){let n=Re(e)?j_(Bt(e.enum),r):S(e)?j_(nr(e.anyOf),r):q_(e,r);return gr(n)}function nD(e,r,n,o,i){let a=_(e,r,n),c=_(e,r,o);return g.Update(rD(a,c),{},i)}function B_(e,r,n,o,i){return v(e,[n,o])?nD(e,r,n,o,i):Fi(n,o,i)}var oD=new RegExp("^(?:0|[1-9][0-9]*)$");function Uo(e){let r=`${e}`;return oD.test(r)?parseInt(r):e}function iD(e){return Y(Uo(e))}function F_(e){return e.map(r=>H_(r))}function H_(e){return w(e)?Pt(F_(e.allOf)):S(e)?q(F_(e.anyOf)):J(e)?iD(e.const):e}function K_(e,r){let n=H_(r),o=rt({},n,Ut());return L.IsExtendsTrueLike(o)?e:X()}function z_(e,r){let n=ir(e,r);return ar(n)}function Cc(e){return e.reduce((r,n)=>[...r,...ar(n)],[])}function Y_(e){let r=Bt(e);return Cc(r)}function V_(e){let r=Pe(e);return ar(r)}function Q_(e){return[`${e}`]}function W_(e){let r=tt(e);return ar(r)}function ar(e){return le(e)?z_(e.$defs,e.$ref):Re(e)?Y_(e.enum):w(e)?V_(e.allOf):J(e)?Q_(e.const):Ce(e)?W_(e.pattern):S(e)?Cc(e.anyOf):[]}function wo(e){return ar(e)}function aD(e,r){return r in e?[e[r]]:[]}function sD(e,r){return r.reduce((n,o)=>[...n,...aD(e,o)],[])}function Z_(e,r){let n=wo(r),o=sD(e,n);return gr(o)}function cD(e){return Y(Uo(e))}function X_(e){return e.map(r=>Fu(r))}function Fu(e){return w(e)?Pt(X_(e.allOf)):S(e)?q(X_(e.anyOf)):J(e)?cD(e.const):e}function pD(e,r){return e.reduceRight((n,o,i)=>{let a=rt({},Y(i),r);return L.IsExtendsTrueLike(a)?[o,...n]:n},[])}function uD(e,r){let n=Fu(r),o=pD(e,n);return Un(o)}function mD(e){return Un(e)}function J_(e,r){return _e(r)||Be(r)?mD(e):uD(e,r)}function lD(e){return e.reduce((r,n)=>tc(n)?[...r,Y(n)]:r,[])}function No(e){let r=lD(e);return q(r)}function Io(e,r,n={}){return P("Index",[e,r],n)}function eI(e,r,n={}){let o=s.IsArray(r)?No(r):r;return C({},Io(e,o,n))}function tI(e,r){let n=ir(e,r);return Ft(n)}function dD(e,r){let n=s.Keys(e).filter(y=>!s.HasPropertyKey(r,y)),o=s.Keys(r).filter(y=>!s.HasPropertyKey(e,y)),i=s.Keys(e).filter(y=>s.HasPropertyKey(r,y)),a=n.reduce((y,E)=>({...y,[E]:e[E]}),{}),c=o.reduce((y,E)=>({...y,[E]:r[E]}),{}),m=i.reduce((y,E)=>({...y,[E]:Pe([e[E],r[E]])}),{}),l=g.Assign(a,c);return g.Assign(l,m)}function rI(e){return e.reduce((r,n)=>dD(r,Ft(n)),{})}function nI(e){let r=UE(Fe(e));return Ft(r)}function fD(e,r){return s.Keys(e).filter(i=>i in r).reduce((i,a)=>({...i,[a]:gr([e[a],r[a]])}),{})}function oI(e,r){let[n,...o]=e;return O(n)?oI(o,fD(r,Ft(n))):r}function iI(e){let[r,...n]=e;return O(r)?oI(n,Ft(r)):H()}function Ft(e){return le(e)?tI(e.$defs,e.$ref):w(e)?rI(e.allOf):S(e)?iI(e.anyOf):V(e)?nI(e.items):k(e)?e.properties:{}}function Lo(e){let r=Ft(e);return N(r)}function gD(e){return le(e)||w(e)||S(e)?Lo(e):e}function yD(e,r){let n=gD(e);return re(n)?K_(n.items,r):k(n)?Z_(n.properties,r):V(n)?J_(n.items,r):X()}function hD(e,r,n,o,i){let a=_(e,r,n),c=_(e,r,o);return g.Update(yD(a,c),{},i)}function aI(e,r,n,o,i){return v(e,[n,o])?hD(e,r,n,o,i):Io(n,o,i)}function Hi(e,r={}){return P("InstanceType",[e],r)}function sI(e,r={}){return C({},Hi(e,r))}function TD(e){return De(e)?e.instanceType:X()}function ED(e,r,n,o){let i=_(e,r,n);return g.Update(TD(i),{},o)}function cI(e,r,n,o={}){return v(e,[n])?ED(e,r,n,o):Hi(n,o)}function _D(e,r,n,o,i){let a=xt(e,{callstack:[]},n),c=pa(e,{callstack:[]},o),m=Pe([...a,N(c)]);return g.Update(m,{},i)}function pI(e,r,n,o,i){return v(e,n)?_D(e,r,n,o,i):_o(n,o,i)}function bo(e,r={}){return P("KeyOf",[e],r)}function uI(e,r={}){return C({},bo(e,r))}function mI(){return q([Ut(),_t(),fo()])}function lI(e){return Ut()}function ID(e){return e.reduce((n,o)=>tc(o)?[...n,Y(Uo(o))]:H(),[])}function dI(e){let r=s.Keys(e),n=ID(r);return Un(n)}function fI(e){return ho(e)}function gI(e){let r=e.map((n,o)=>Y(o));return Un(r)}function bD(e){return le(e)||w(e)||S(e)?Lo(e):e}function SD(e){let r=bD(e);return st(r)?mI():re(r)?lI(r.items):k(r)?dI(r.properties):Ie(r)?fI(r):V(r)?gI(r.items):X()}function OD(e,r,n,o){let i=_(e,r,n);return g.Update(SD(i),{},o)}function yI(e,r,n,o){return v(e,[n])?OD(e,r,n,o):bo(n,o)}function AD(e){let r=tt(e);return Hu(r)}function hI(e){return e.reduce((r,n)=>[...r,...Hu(n)],[])}function Hu(e){return Re(e)?hI(Bt(e.enum)):lo(e)||mo(e)?[e]:Ce(e)?AD(e.pattern):S(e)?hI(e.anyOf):[]}function TI(e){return Hu(e)}function Eo(e,r,n,o,i={}){return P("Mapped",[e,r,n,o],i)}function EI(e,r,n,o,i={}){return C({},Eo(e,r,n,o,i))}function xD(e,r,n,o,i){let a=g.Assign(e,{[n.name]:o}),c=_(a,r,i);return Ce(c)?tt(c.pattern):c}function RD(e,r,n,o,i){let a=g.Assign(e,{[n.name]:o});return _(a,r,i)}function CD(e,r,n,o,i,a){let c=RD(e,r,n,o,a),m=xD(e,r,n,o,i);return lo(m)||mo(m)?{[m.const]:c}:{}}function PD(e,r,n,o,i,a){return o.reduce((c,m)=>({...c,...CD(e,r,n,m,i,a)}),{})}function UD(e,r,n,o,i,a){let c=TI(o),m=PD(e,r,n,c,i,a);return N(m)}function wD(e,r,n,o,i,a,c){let m=_(e,r,o);return g.Update(UD(e,r,n,m,i,a),{},c)}function _I(e,r,n,o,i,a,c){return v(e,[o])?wD(e,r,n,o,i,a,c):Eo(n,o,i,a,c)}function ND(e,r){return s.Keys(e).filter(o=>r.includes(o)).reduce((o,i)=>({...o,[i]:m_(e,i,e[i])}),{})}function LD(e,r){return s.Keys(e).filter(o=>!r.includes(o)).reduce((o,i)=>({...o,[i]:_(e,{callstack:[]},e[i])}),{})}function vD(e,r){let n=s_(e),o=ND(e,n),i=LD(e,n),a={...o,...i};return g.Update(a,{},r)}function II(e,r,n,o){let i=g.Assign(e,n);return vD(i,o)}function Ki(e,r={}){return P("NonNullable",[e],r)}function bI(e,r={}){return C({},Ki(e,r))}function kD(e){let r=q([Kr(),To()]);return Rc({},{callstack:[]},e,r,{})}function MD(e,r,n,o){let i=_(e,r,n);return g.Update(kD(i),{},o)}function SI(e,r,n,o){return v(e,[n])?MD(e,r,n,o):Ki(n,o)}function Pc(e){let r=Lo(e);return k(r)?r.properties:H()}function zi(e,r,n={}){return P("Omit",[e,r],n)}function OI(e,r,n={}){let o=s.IsArray(r)?No(r):r;return C({},zi(e,o,n))}function DD(e,r){return s.Keys(e).reduce((o,i)=>r.includes(i)?o:{...o,[i]:e[i]},{})}function GD(e,r){let n=Pc(e),o=wo(r),i=DD(n,o);return N(i)}function $D(e,r,n,o,i){let a=_(e,r,n),c=_(e,r,o);return g.Update(GD(a,c),{},i)}function AI(e,r,n,o,i){return v(e,[n,o])?$D(e,r,n,o,i):zi(n,o,i)}function So(e,r){return P("Options",[e,r],{})}function Uc(e,r){return C({},So(e,r))}function jD(e,r,n,o){let i=_(e,r,n);return g.Update(i,{},o)}function xI(e,r,n,o){return v(e,[n])?jD(e,r,n,o):So(n,o)}function Yi(e,r={}){return P("Parameters",[e],r)}function RI(e,r={}){return C({},Yi(e,r))}function qD(e){return Ge(e)?_({},{callstack:[]},Fe(e.parameters)):X()}function BD(e,r,n,o){let i=_(e,r,n);return g.Update(qD(i),{},o)}function CI(e,r,n,o){return v(e,[n])?BD(e,r,n,o):Yi(n,o)}function Vi(e,r={}){return P("Partial",[e],r)}function PI(e,r={}){return C({},Vi(e,r))}function UI(e,r){let n=ir(e,r),o=Xr(n);return Zt(g.Assign(e,{[r]:o}),r)}function wI(e){let r=e.map(n=>Xr(n));return Pe(r)}function NI(e){let r=e.map(n=>Xr(n));return q(r)}function LI(e){let r=s.Keys(e).reduce((o,i)=>({...o,[i]:zs(e[i])}),{});return N(r)}function Xr(e){return le(e)?UI(e.$defs,e.$ref):w(e)?wI(e.allOf):S(e)?NI(e.anyOf):k(e)?LI(e.properties):N({})}function FD(e,r,n,o){let i=_(e,r,n);return g.Update(Xr(i),{},o)}function vI(e,r,n,o){return v(e,[n])?FD(e,r,n,o):Vi(n,o)}function Qi(e,r,n={}){return P("Pick",[e,r],n)}function kI(e,r,n={}){let o=s.IsArray(r)?No(r):r;return C({},Qi(e,o,n))}function HD(e,r){return s.Keys(e).reduce((o,i)=>r.includes(i)?g.Assign(o,{[i]:e[i]}):o,{})}function KD(e,r){let n=Pc(e),o=wo(r),i=HD(n,o);return N(i)}function zD(e,r,n,o,i){let a=_(e,r,n),c=_(e,r,o);return g.Update(KD(a,c),{},i)}function MI(e,r,n,o,i){return v(e,[n,o])?zD(e,r,n,o,i):Qi(n,o,i)}function Wi(e,r={}){return P("ReadonlyType",[e],r)}function DI(e,r={}){return C({},Wi(e,r))}function GI(e){return $r(qt(e))}function $I(e,r){let n=ir(e,r),o=Jr(n);return Zt(g.Assign(e,{[r]:o}),r)}function jI(e){let r=e.map(n=>Jr(n));return Pe(r)}function qI(e){let r=s.Keys(e).reduce((o,i)=>({...o,[i]:Vs(e[i])}),{});return N(r)}function BI(e){return $r(Fe(e))}function FI(e){let r=e.map(n=>Jr(n));return q(r)}function Jr(e){return re(e)?GI(e.items):le(e)?$I(e.$defs,e.$ref):w(e)?jI(e.allOf):k(e)?qI(e.properties):V(e)?BI(e.items):S(e)?FI(e.anyOf):e}function YD(e,r,n,o){let i=_(e,r,n);return g.Update(Jr(i),{},o)}function HI(e,r,n,o){return v(e,[n])?YD(e,r,n,o):Wi(n,o)}function KI(e){return It(Mt,e)}function zI(e){return N({true:e,false:e})}function YI(e,r){let n=ea(e);return en(n,r)}function VI(e,r){return It(go,r)}function QI(e,r){let n=Pe(e);return en(n,r)}function WI(e,r){return s.IsString(e)||s.IsNumber(e)?N({[e]:r}):s.IsEqual(e,!1)?N({false:r}):s.IsEqual(e,!0)?N({true:r}):N({})}function ZI(e,r){return It(yo,r)}function XI(e,r){return s.HasPropertyKey(e,"pattern")&&(s.IsString(e.pattern)||e.pattern instanceof RegExp)?It(e.pattern.toString(),r):It(Mt,r)}function JI(e,r){let n=Tc(e);return Ec(n)?en(tt(e),r):It(e,r)}function VD(e){return e.some(r=>Ne(r)||_e(r)||Be(r))}function QD(e,r){return s.IsEqual(VD(e),!0)?It(Mt,r):void 0}function WD(e,r){return e.reduce((n,o)=>J(o)&&(s.IsString(o.const)||s.IsNumber(o.const))?{...n,[o.const]:r}:n,{})}function ZD(e,r){let n=WD(e,r);return N(n)}function eb(e,r){let n=nr(e),o=QD(n,r);return O(o)?o:ZD(n,r)}function en(e,r){return st(e)?KI(r):pt(e)?zI(r):Re(e)?YI(e.enum,r):Be(e)?VI(e,r):w(e)?QI(e.allOf,r):J(e)?WI(e.const,r):_e(e)?ZI(e,r):S(e)?eb(e.anyOf,r):Ne(e)?XI(e,r):Ce(e)?JI(e.pattern,r):N({})}function XD(e,r,n,o,i){let a=_(e,r,n),c=_(e,r,o);return g.Update(en(a,c),{},i)}function tb(e,r,n,o,i){return v(e,[n])?XD(e,r,n,o,i):vi(n,o,i)}function rb(e,r,n){return n in e?Ac([n],e,e[n])?we(n):_(e,r,e[n]):we(n)}function nb(e,r){let n=ir(e,r),o=tn(n);return Zt(g.Assign(e,{[r]:o}),r)}function ob(e){let r=e.map(n=>tn(n));return Pe(r)}function ib(e){let r=e.map(n=>tn(n));return q(r)}function ab(e){let r=s.Keys(e).reduce((o,i)=>({...o,[i]:so(e[i])}),{});return N(r)}function tn(e){return le(e)?nb(e.$defs,e.$ref):w(e)?ob(e.allOf):S(e)?ib(e.anyOf):k(e)?ab(e.properties):N({})}function Zi(e,r={}){return P("Required",[e],r)}function sb(e,r={}){return C({},Zi(e,r))}function JD(e,r,n,o){let i=_(e,r,n);return g.Update(tn(i),{},o)}function cb(e,r,n,o){return v(e,[n])?JD(e,r,n,o):Zi(n,o)}function Xi(e,r={}){return P("ReturnType",[e],r)}function pb(e,r={}){return C({},Xi(e,r))}function eG(e){return Ge(e)?e.returnType:X()}function tG(e,r,n,o){let i=_(e,r,n);return g.Update(eG(i),{},o)}function ub(e,r,n,o){return v(e,[n])?tG(e,r,n,o):Xi(n,o)}function mb(e){return g.Create({"~kind":"TemplateLiteral"},{type:"string",pattern:e},{})}function rG(e){return e.join("|")}function nG(e){return e.slice(1,e.length-1)}function oG(e,r,n){return rn(r,`${n}${e}`)}function iG(e,r){return rn(e,`${r}${ey}`)}function aG(e,r){return rn(e,`${r}${ec}`)}function sG(e,r){return rn(e,`${r}${rc}`)}function cG(e,r){return zu(q([Y("false"),Y("true")]),e,r)}function pG(e,r){return rn(e,`${r}${oc}`)}function uG(e,r,n){return rn(r,`${n}${nG(e)}`)}function mG(e,r,n,o=[]){let i=Bt(e);return Ku(i,r,n)}function Ku(e,r,n,o=[]){let[i,...a]=e;return O(i)?Ku(a,r,n,[...o,zu(i,[],"")]):rn(r,`${n}(${rG(o)})`)}function zu(e,r,n){return Re(e)?mG(e.enum,r,n):Be(e)?aG(r,n):J(e)?oG(e.const,r,n):St(e)?iG(r,n):pt(e)?cG(r,n):_e(e)?sG(r,n):Ne(e)?pG(r,n):Ce(e)?uG(e.pattern,r,n):S(e)?Ku(e.anyOf,r,n):vg}function rn(e,r){let[n,...o]=e;return O(n)?zu(n,o,r):r}function lG(e){return`^${rn(e,"")}$`}function lb(e){let r=lG(e);return mb(r)}function dG(e,r,n,o){let i=xt(e,r,n);return g.Update(lb(i),{},o)}function db(e,r,n,o){return v(e,n)?dG(e,r,n,o):ki(n,o)}function fG(e){return zr(e)?V(e.items)?Yu(e.items.items):xe(e.items)?[e]:pe(e.items)?[e]:[X()]:[e]}function Yu(e){return e.reduce((n,o)=>[...n,...fG(o)],[])}function gG(e,r){return r in e}function yG(e,r){return w(r)?v(e,r.allOf):S(r)?v(e,r.anyOf):pe(r)?gG(e,r.$ref):!0}function v(e,r){let[n,...o]=r;return O(n)?yG(e,n)?v(e,o):!1:!0}function ua(e,r,n){return Cg(e)?ua(e.type,"remove",n):Og(e)?ua(e.type,r,"remove"):xg(e)?ua(e.type,"add",n):bg(e)?ua(e.type,r,"add"):[e,r,n]}function hG(e,r){return s.IsEqual(e,"remove")?Ys(r):s.IsEqual(e,"add")?Tt(r):r}function TG(e,r){return s.IsEqual(e,"remove")?so(r):s.IsEqual(e,"add")?ht(r):r}function pa(e,r,n){return s.Keys(n).reduce((o,i)=>({...o,[i]:_(e,r,n[i])}),{})}function Oc(e,r,n){let o=xt(e,r,n);return Yu(o)}function xt(e,r,n){return n.map(o=>_(e,r,o))}function EG(e,r,n,o,i){return s.IsEqual(n,"Awaited")?E_(e,r,o[0],i):s.IsEqual(n,"Capitalize")?C_(e,r,o[0],i):s.IsEqual(n,"Conditional")?L_(e,r,o[0],o[1],o[2],o[3],i):s.IsEqual(n,"ConstructorParameters")?k_(e,r,o[0],i):s.IsEqual(n,"Evaluate")?GE(e,r,o[0],i):s.IsEqual(n,"Exclude")?Rc(e,r,o[0],o[1],i):s.IsEqual(n,"Extract")?B_(e,r,o[0],o[1],i):s.IsEqual(n,"Index")?aI(e,r,o[0],o[1],i):s.IsEqual(n,"InstanceType")?cI(e,r,o[0],i):s.IsEqual(n,"Interface")?pI(e,r,o[0],o[1],i):s.IsEqual(n,"KeyOf")?yI(e,r,o[0],i):s.IsEqual(n,"Lowercase")?P_(e,r,o[0],i):s.IsEqual(n,"Mapped")?_I(e,r,o[0],o[1],o[2],o[3],i):s.IsEqual(n,"Module")?II(e,r,o[0],i):s.IsEqual(n,"NonNullable")?SI(e,r,o[0],i):s.IsEqual(n,"Pick")?MI(e,r,o[0],o[1],i):s.IsEqual(n,"Options")?xI(e,r,o[0],o[1]):s.IsEqual(n,"Parameters")?CI(e,r,o[0],i):s.IsEqual(n,"Partial")?vI(e,r,o[0],i):s.IsEqual(n,"Omit")?AI(e,r,o[0],o[1],i):s.IsEqual(n,"ReadonlyType")?HI(e,r,o[0],i):s.IsEqual(n,"Record")?tb(e,r,o[0],o[1],i):s.IsEqual(n,"Required")?cb(e,r,o[0],i):s.IsEqual(n,"ReturnType")?ub(e,r,o[0],i):s.IsEqual(n,"TemplateLiteral")?db(e,r,o[0],i):s.IsEqual(n,"Uncapitalize")?U_(e,r,o[0],i):s.IsEqual(n,"Uppercase")?w_(e,r,o[0],i):P(n,o,i)}function _(e,r,n){let o=bn(n),i=ua(n,Sn(n)?"add":"none",Me(n)?"add":"none"),a=Ct(i[0])?i[0].Clone():i[0],c=pe(a)?rb(e,r,a.$ref):re(a)?qt(_(e,r,a.items),Qs(a)):ot(a)?Wt(_(e,r,a.iteratorItems),Ug(a)):Po(a)?xc(e,r,a.target,a.arguments):De(a)?jr(xt(e,r,a.parameters),_(e,r,a.instanceType),Ng(a)):Pg(a)?EG(e,r,a.action,a.parameters,a.options):Ge(a)?qr(xt(e,r,a.parameters),_(e,r,a.returnType),Lg(a)):w(a)?Pt(xt(e,r,a.allOf),jg(a)):it(a)?Xt(_(e,r,a.iteratorItems),ry(a)):k(a)?N(pa(e,r,a.properties),sy(a)):Je(a)?tr(_(e,r,a.item),py(a)):Ie(a)?ac(Ot(a),_(e,r,et(a))):zr(a)?Rn(_(e,r,a.items)):V(a)?Fe(Oc(e,r,a.items),my(a)):S(a)?q(xt(e,r,a.anyOf),ly(a)):a,m=o?$r(c):c;return hG(i[1],TG(i[2],m))}function C(e,r){return _(e,{callstack:[]},r)}function Ji(e,r={}){return P("Awaited",[e],r)}function fb(e,r={}){return C({},Ji(e,r))}function Eu(e,r={}){return P("Evaluate",[e],r)}function Ht(e,r={}){return C({},Eu(e,r))}function _u(e,r={}){return P("Module",[e],r)}function gb(e,r={}){return C({},_u(e,r))}function yb(...e){let[r,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=sE(n),a=s.IsArray(i)&&s.IsEqual(i.length,2)?_(r,{callstack:[]},i[0]):X();return g.Update(a,{},o)}var t={};vt(t,{Any:()=>po,Array:()=>qt,AsyncIterator:()=>Wt,Awaited:()=>fb,Base:()=>Ws,BigInt:()=>Ni,Boolean:()=>Js,Call:()=>h_,Capitalize:()=>O_,Codec:()=>Zs,Conditional:()=>N_,Constructor:()=>jr,ConstructorParameters:()=>v_,Cyclic:()=>Zt,Decode:()=>Zg,DecodeBuilder:()=>wi,Encode:()=>Xg,EncodeBuilder:()=>Ui,Enum:()=>$g,Evaluate:()=>Ht,Exclude:()=>M_,Extends:()=>rt,ExtendsResult:()=>L,Extract:()=>$_,Function:()=>qr,Generic:()=>Br,Identifier:()=>Li,Immutable:()=>$r,Index:()=>eI,Infer:()=>Pi,InstanceType:()=>sI,Instantiate:()=>C,Integer:()=>An,Interface:()=>i_,Intersect:()=>Pt,IsAny:()=>st,IsArray:()=>re,IsAsyncIterator:()=>ot,IsBase:()=>Ct,IsBigInt:()=>St,IsBoolean:()=>pt,IsCall:()=>Po,IsCodec:()=>On,IsConstructor:()=>De,IsCyclic:()=>le,IsEnum:()=>Re,IsFunction:()=>Ge,IsGeneric:()=>co,IsIdentifier:()=>ty,IsImmutable:()=>bn,IsInfer:()=>xe,IsInteger:()=>Be,IsIntersect:()=>w,IsIterator:()=>it,IsKind:()=>b,IsLiteral:()=>J,IsNever:()=>dr,IsNull:()=>Jt,IsNumber:()=>_e,IsObject:()=>k,IsOptional:()=>Me,IsParameter:()=>cy,IsPromise:()=>Je,IsReadonly:()=>Sn,IsRecord:()=>Ie,IsRef:()=>pe,IsRefine:()=>Xs,IsRest:()=>zr,IsSchema:()=>O,IsString:()=>Ne,IsSymbol:()=>er,IsTemplateLiteral:()=>Ce,IsThis:()=>uy,IsTuple:()=>V,IsUndefined:()=>rr,IsUnion:()=>S,IsUnknown:()=>Et,IsUnsafe:()=>fy,IsVoid:()=>At,Iterator:()=>Xt,KeyOf:()=>uI,Literal:()=>Y,Lowercase:()=>A_,Mapped:()=>EI,Module:()=>gb,Never:()=>X,NonNullable:()=>bI,Null:()=>Kr,Number:()=>Ut,Object:()=>N,Omit:()=>OI,Optional:()=>zs,Options:()=>Uc,Parameter:()=>xn,Parameters:()=>RI,Partial:()=>PI,Pick:()=>kI,Promise:()=>tr,Readonly:()=>Vs,ReadonlyType:()=>DI,Record:()=>ic,RecordKey:()=>ho,RecordKeyAsPattern:()=>Ot,RecordValue:()=>et,Ref:()=>we,Refine:()=>Jg,Required:()=>sb,Rest:()=>Rn,ReturnType:()=>pb,Script:()=>yb,String:()=>_t,Symbol:()=>fo,TemplateLiteral:()=>uE,This:()=>sc,Tuple:()=>Fe,Uncapitalize:()=>x_,Undefined:()=>To,Union:()=>q,Unknown:()=>Ze,Unsafe:()=>dy,Uppercase:()=>R_,Void:()=>cc});var hb="lowercase-email",Vu="iana-timezone",Qu="simple-time",Wu="simple-date-time";var _G=(e,r)=>RegExp(`^${e.source}(${r.source}${e.source})*$`),IG=/[a-zA-Z0-9-_]+/,bG=/\./,QEe=_G(IG,bG);var Tb="lowercase-domain";var vo="kebab-case";var Eb="camel-case";var SG=new Set;function I(e,r,n={}){let o=r.map(i=>{let a=i;return a.$id?(SG.add(i),t.Ref(a.$id)):i});return t.Unsafe({...n,type:"object",discriminator:{propertyName:e},required:[e],oneOf:o})}function je(e,r){return t.Object({values:t.Array(e,{maxItems:r.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:t.Optional(t.Boolean({description:"If true, exclude rows matching these values instead of including them"}))},{description:r.description})}var Q={limit:t.Optional(t.Integer({minimum:1,maximum:1e3,description:"Maximum number of items to return in this page."})),offset:t.Optional(t.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 OG=t.Object({totalCount:t.Integer({description:"Total number of items matching the query before `limit` and `offset` are applied."}),pageCount:t.Integer({description:"Total number of pages available for the requested `limit`."})},{description:"Counts describing the full result set that the returned page was taken from, for computing how many further pages remain."}),e_e=t.Object({pagination:OG},{$id:"ResponseMetadata",description:"Metadata accompanying `data` on paginated operations, describing the full result set the page was taken from."});function T(e={}){return t.Unsafe({...e,type:"string"})}var ko=250;function p({allowEmpty:e=!0,type:r="short",description:n,default:o}={}){let i=e?0:1,a={...n===void 0?{}:{description:n},...o===void 0?{}:{default:o}};switch(r){case"camel-case":return t.String({format:Eb,minLength:i,maxLength:ko,...a});case"kebab-case":return t.String({format:vo,minLength:i,maxLength:ko,...a});case"email":return t.String({format:hb,minLength:i,maxLength:254,errorMessage:{format:"Must be a valid lowercase email address."},...a});case"lowercase-domain":return t.String({format:Tb,minLength:i,maxLength:ko,...a});case"tsuga-query":return t.String({format:"tsuga-query",minLength:i,maxLength:1e4,...a});case"tags-query":return t.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 t.String({format:"date-time",...a});case"uri":return t.String({format:"uri",...a});case"user-password":return t.String({format:"user-password",minLength:12,maxLength:ko,...a});case"long":return t.String({minLength:i,maxLength:5e4,...a});case"short":return t.String({minLength:i,maxLength:ko,...a});case"tsuga-formula":return t.String({format:"tsuga-formula",minLength:i,maxLength:ko,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 t.String({format:"time",...a});case"readonly-sql-query":return t.String({format:"readonly-sql-query",minLength:i,maxLength:5e4,errorMessage:{format:"Must be a readonly SQL query - only SELECT statements are allowed."},...a});default:We(r)}}var ma=["ingestion-api-key","operation-api-key","rum-public-token","dashboard","log-route","metric-route","monitor","notification-rule","notification-silence","slo"],wc=t.Array(t.Enum(ma,{description:"Tsuga-managed asset type."}),{description:"Tsuga-managed asset types covered by the policy. An empty array means all supported asset types."});var Zu=["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"],l_e=t.Enum(Zu),AG=["CLUSTER_AGGREGATION_STRUCTURE"],d_e=t.Object({code:t.Enum(Zu),message:t.String()}),_b=[...Zu,...AG,"ABORT_ERROR","BAD_REQUEST","DUPLICATE_KEY_VIOLATION","FOREIGN_KEY_VIOLATION","FST_ERR_VALIDATION","GROK_RULE_VALIDATION_ERROR","INVALID_INPUT","FORBIDDEN","MISSING_PERMISSION","PRIVILEGE_ESCALATION","RATE_LIMITED","RESERVED_TAG_POLICY_ERROR","RESOURCE_NOT_FOUND","INVALID_INVITATION","TAG_POLICY_ALREADY_EXISTS_ERROR","TAG_POLICY_VALIDATION_ERROR","UNAUTHORIZED","URL_NOT_FOUND"],Ib=["INTERNAL_ERROR","INVALID_QUERY_TO_CLUSTER"];var xG=["NETWORK_ERROR","RESPONSE_PARSE_ERROR"],RG=[..._b,...Ib,...xG],CG=t.Object({assetId:t.Optional(t.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:t.String({description:"Name of the asset that violated the policy. Set from submitted data or the existing asset row. Returned for every violation."}),assetType:t.Enum(ma,{description:"Type of Tsuga asset validated by the policy. Set by the route that ran tag-policy validation. Returned for every violation."}),tagPolicyId:t.String({description:"Identifier of the active tag policy that was violated. Generated by Tsuga when the policy is created. Returned for every violation."}),tagKey:t.String({description:"Tag key required or constrained by the violated policy. Set by the tag policy. Returned for every violation."}),message:t.String({description:"Human-readable reason this policy failed for the asset. Generated by Tsuga's tag-policy validator. Returned for every violation."})},{description:"A single tag-policy violation, identifying the offending asset, the policy and tag key involved, and why validation failed."}),PG=I("type",[t.Object({type:t.Literal("invalid-syntax",{description:"Discriminator identifying a rule the grok parser could not parse at all."}),error:t.Object({offset:t.Integer({description:"Byte offset in the rule where parsing failed."}),detail:t.String({description:"Parser detail message."})},{description:"Position and parser message for the syntax failure."})},{$id:"GrokInvalidSyntax"}),t.Object({type:t.Literal("unknown-pattern",{description:"Discriminator identifying a rule that references a pattern name the grok engine does not provide."}),error:t.Object({offset:t.Integer({description:"Byte offset of the unknown pattern."}),unknownPattern:t.String({description:"The pattern name that is not supported."})},{description:"Position and name of the unsupported pattern."})},{$id:"GrokUnknownPattern"}),t.Object({type:t.Literal("invalid-filter",{description:"Discriminator identifying a rule whose filter is a known filter used incorrectly."}),error:t.Object({offset:t.Integer({description:"Byte offset of the invalid filter."}),invalidFilter:t.String({description:"The filter that is invalid."}),message:t.String({description:"Why the filter is invalid."})},{description:"Position, text, and reason for the invalid filter."})},{$id:"GrokInvalidFilter"}),t.Object({type:t.Literal("unknown-filter",{description:"Discriminator identifying a rule that references a filter name the grok engine does not implement."}),error:t.Object({offset:t.Integer({description:"Byte offset of the unknown filter."}),unknownFilter:t.String({description:"The filter name that is not implemented."}),message:t.String({description:"Details about the unsupported filter."})},{description:"Position and name of the unimplemented filter."})},{$id:"GrokUnknownFilter"})],{description:"Full structured detail of a grok rule that failed to compile, discriminated by `type`."}),UG=t.Object({rule:t.String({description:"The rule that failed to compile."}),ruleIndex:t.Integer({description:"0-based index of the failing rule in the submitted `rules` array."}),error:PG},{description:"A single grok rule that failed to compile, with its position in the submitted rules and the structured compile error."}),bb=I("type",[t.Object({type:t.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:t.Array(CG,{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"}),t.Object({type:t.Literal("grok_rule_error",{description:"Discriminator identifying grok rule validation details. Set by Tsuga to `grok_rule_error`. Returned when the error code is `GROK_RULE_VALIDATION_ERROR`."}),ruleErrors:t.Array(UG,{description:"Grok rules that failed to compile, with full structured detail. One entry per invalid rule."})},{$id:"GrokRuleErrorDetails"})],{description:"Structured details for a client error. Set by Tsuga only for error types with machine-readable remediation data, and omitted for every other client error."}),f_e=t.Object({code:t.Optional(t.Enum(RG,{description:"Machine readable error code describing what went wrong"})),message:t.String({description:"Human readable explanation of the error"}),statusCode:t.Number({description:"HTTP status code that was returned"}),details:t.Optional(bb)},{$id:"ErrorResponse",description:"Standard envelope for API errors"}),g_e=t.Object({code:t.Optional(t.Enum(_b,{description:"Machine readable error code describing what went wrong"})),message:t.String({description:"Human readable explanation of the error"}),statusCode:t.Number({description:"HTTP status code that was returned"}),details:t.Optional(bb)},{$id:"ClientErrorResponse",description:"Standard envelope for client (4XX) API errors"}),y_e=t.Object({code:t.Optional(t.Enum(Ib,{description:"Machine readable error code describing what went wrong"})),message:t.String({description:"Human readable explanation of the error"}),statusCode:t.Number({description:"HTTP status code that was returned"})},{$id:"ServerErrorResponse",description:"Standard envelope for server (5XX) API errors"}),h_e=t.Object({requestId:t.String({description:"Identifier used to trace the lifecycle of this API request"}),error:t.Ref("ClientErrorResponse")},{$id:"ClientErrorEnvelope",description:"Standard envelope wrapping all client (4XX) error responses"}),T_e=t.Object({requestId:t.String({description:"Identifier used to trace the lifecycle of this API request"}),error:t.Ref("ServerErrorResponse")},{$id:"ServerErrorEnvelope",description:"Standard envelope wrapping all server (5XX) error responses"});function d({body:e,description:r,method:n,operationId:o,params:i,tags:a,query:c,paginated:m,response:l,url:f}){return i?{buildUrl:E=>f.replace(/:[a-zA-Z_]+/g,A=>E[A.slice(1)]),method:n,params:i,response:l,templateUrl:f,...e===void 0?{}:{body:e},...r===void 0?{}:{description:r},...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},...r===void 0?{}:{description:r},...o===void 0?{}:{operationId:o},...c===void 0?{}:{query:c},...m===void 0?{}:{paginated:m},...a===void 0?{}:{tags:a}}}function Sb(e,r){if(!r||typeof r!="object")return e;let n=new URLSearchParams;return Object.entries(r).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 R=t.Object({success:t.Literal(!0,{description:"Always `true` when the delete request completed and the resource was removed."})},{$id:"DeleteResponse",description:"Confirmation that the targeted resource was deleted.",example:{success:!0}});var Xu="tsuga-cli";var Nn="/v0/oauth",Ob=d({description:"OAuth 2.1 authorization endpoint: validates the client and redirect URI, then redirects to the consent page",url:`${Nn}/authorize`,method:"GET",query:t.Partial(t.Object({response_type:t.String({description:"Must be `code`"}),client_id:t.String({description:"First-party client id or CIMD document URL"}),redirect_uri:t.String({description:"Client redirect URI"}),code_challenge:t.String({description:"PKCE code challenge"}),code_challenge_method:t.String({description:"Must be `S256`"}),state:t.String({description:"Opaque client state, echoed back"}),resource:t.String({description:"RFC 8707 resource indicator"})})),response:t.Object({},{description:"Never returned: this endpoint redirects (302) or renders an HTML error (400)"})}),Ab=d({description:"OAuth 2.1 token endpoint: exchanges an authorization code (PKCE) or refresh token for a token pair",url:`${Nn}/token`,method:"POST",body:t.Partial(t.Object({grant_type:t.String({description:"`authorization_code` or `refresh_token`"}),code:t.String({description:"Authorization code being exchanged"}),code_verifier:t.String({description:"PKCE code verifier"}),redirect_uri:t.String({description:"Must match the redirect URI used on /authorize"}),client_id:t.String({description:"Client id, when sent by the client"}),refresh_token:t.String({description:"Refresh token, for `grant_type=refresh_token`"})})),response:t.Object({access_token:t.String(),token_type:t.Literal("Bearer"),expires_in:t.Number({description:"Access token lifetime in seconds"}),refresh_token:t.String()})}),v_e=d({description:"Resolve a signed authorization request handle for the consent page",url:`${Nn}/authorization-request`,method:"GET",query:t.Object({handle:t.String()}),response:t.Object({clientId:t.String(),clientName:t.String(),redirectUri:t.String()})}),k_e=d({description:"Approve or deny an OAuth authorization request from the consent page",url:`${Nn}/approve`,method:"POST",body:t.Object({handle:t.String({description:"The signed authorization request handle"}),approve:t.Boolean()}),response:t.Object({redirectTo:t.String({description:"The client's redirect URI carrying either the code or the denial"})})}),M_e=d({description:"Validate an OAuth access token (internal, for the MCP resource server)",url:`${Nn}/introspect`,method:"POST",body:t.Object({token:t.String()}),response:t.Object({active:t.Boolean(),userId:t.Optional(t.String()),orgId:t.Optional(t.String())})}),wG=["pending","active","revoked"],NG=t.Object({id:t.String(),createdAt:T(),clientId:t.String({description:"Client ID Metadata Document URL or first-party client id"}),clientName:t.String({description:"Display name derived from the client identity"}),userId:t.String(),status:t.Enum(wG),lastUsedAt:t.Optional(T())}),D_e=d({tags:["oauth"],description:"List OAuth grants: your own, or all users for admins",url:`${Nn}/grants`,method:"GET",query:t.Object({allUsers:t.Optional(t.Boolean({description:"Admins only: list grants of every user in the org"}))}),response:t.Array(NG)}),G_e=d({tags:["oauth"],description:"Delete an OAuth grant (own grant, or any grant for admins)",url:`${Nn}/grants/:id`,method:"DELETE",params:t.Object({id:t.String()}),response:R});function xb(e,r){let n=new URL(Ob.url,e);return n.search=new URLSearchParams({response_type:"code",client_id:Xu,redirect_uri:r.redirectUri,code_challenge:r.challenge,code_challenge_method:"S256",state:r.state}).toString(),n.href}function LG(e){if(!e)return{};try{let r=JSON.parse(e);return typeof r=="object"&&r!==null?r:{}}catch{return{}}}async function vG(e,r){let n=await fetch(new URL(Ab.url,e).href,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams(r).toString()}),o=await n.text(),i=LG(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*ru)}}async function Rb(e,r){return vG(e,{grant_type:"authorization_code",client_id:Xu,code:r.code,code_verifier:r.verifier,redirect_uri:r.redirectUri})}var Dt=require("node:fs"),em=require("node:os"),vn=require("node:path");var Pb=Ns(require("os"),1),la=Ns(require("path"),1),nn=Pb.default.homedir(),{env:Ln}=process,Cb=Ln.XDG_DATA_HOME||(nn?la.default.join(nn,".local","share"):void 0),Nc=Ln.XDG_CONFIG_HOME||(nn?la.default.join(nn,".config"):void 0),F_e=Ln.XDG_STATE_HOME||(nn?la.default.join(nn,".local","state"):void 0),Ub=Ln.XDG_CACHE_HOME||(nn?la.default.join(nn,".cache"):void 0),H_e=Ln.XDG_RUNTIME_DIR||void 0,kG=(Ln.XDG_DATA_DIRS||"/usr/local/share/:/usr/share/").split(":");Cb&&kG.unshift(Cb);var MG=(Ln.XDG_CONFIG_DIRS||"/etc/xdg").split(":");Nc&&MG.unshift(Nc);var wb=(0,vn.join)(Nc??(0,vn.join)((0,em.homedir)(),".config"),"tsuga"),da=(0,vn.join)(wb,"config.json"),Nb=(0,vn.join)(Ub??(0,vn.join)((0,em.homedir)(),".cache"),"tsuga"),Ju=(0,vn.join)(Nb,"update-check.json"),fa="https://api.tsuga.com";function Lb(e){return Zf(e.credential)}function Lc(){if(!(0,Dt.existsSync)(da))return{};try{let e=JSON.parse((0,Dt.readFileSync)(da,"utf-8")),{operationApiKey:r,userAuth:n,...o}=e;return!r&&!n?e:{...o,credentials:{...e.credentials??{},[fa]:{...r?{operationApiKey:r}:{},...n?{userAuth:n}:{},...e.credentials?.[fa]??{}}}}}catch{throw new Error(`Config file corrupted: ${da}
|
|
36
|
-
Re-authenticate with \`tsuga auth login\` or \`tsuga auth operation-key <token>\`.`)}}function
|
|
37
|
-
`,{mode:384})}function
|
|
35
|
+
`,e),([r,n])=>[[r],n]),([r,n])=>[r,n],()=>[]))),([r,n])=>[r,n]),uE=(e,r=[])=>u(u(ku(e),([n,o])=>u(ZM(o),([i,a])=>[[n,i],a])),([n,o])=>uE(o,[...r,n]),()=>[r,e]),XM=e=>u(u(uE(e),([r,n])=>u(u(u(ku(n),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>u([[],n],([o,i])=>[o,i],()=>[])),([o,i])=>[[r,o],i])),([r,n])=>[fT(r),n]),ku=e=>u(u(WM(e),([r,n])=>u(u(zM(n),([o,i])=>[o,i],()=>u(YM(n),([o,i])=>[o,i],()=>u(VM(n),([o,i])=>[o,i],()=>u(QM(n),([o,i])=>[o,i],()=>[])))),([o,i])=>u(MT(i),([a,c])=>[[r,o,a],c]))),([r,n])=>[gT(r),n]),JM=e=>u(u(ku(e),([r,n])=>u(XM(n),([o,i])=>[[r,o],i])),([r,n])=>[yT(r),n]),mE=e=>u(u(JM(e),([r,n])=>[r,n],()=>u(rM(e),([r,n])=>[r,n],()=>u(J(e),([r,n])=>[r,n],()=>[]))),([r,n])=>[r,n]);function lE(e){let r=wu(`\`${e}\``);return s.IsEqual(r.length,2)?r[0]:H()}function Mi(e,r={}){return P("TemplateLiteral",[e],r)}function dE(e){return C({},Mi(e,{}))}function t0(e){let r=lE(e);return dE(r)}function fE(e,r={}){let n=s.IsString(e)?t0(e):dE(e);return g.Update(n,{},r)}function Ce(e){return b(e,"TemplateLiteral")}var L={};kt(L,{ExtendsFalse:()=>F,ExtendsTrue:()=>x,ExtendsUnion:()=>Mu,IsExtendsFalse:()=>r0,IsExtendsTrue:()=>yE,IsExtendsTrueLike:()=>Se,IsExtendsUnion:()=>gE});function Mu(e){return g.Create({"~kind":"ExtendsUnion"},{inferred:e})}function gE(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 yE(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 r0(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.IsEqual(e["~kind"],"ExtendsFalse")}function Se(e){return gE(e)||yE(e)}function Ec(e){let r=sE(e);return s.IsEqual(r.length,2)?r[0]:H()}function n0(e){return!0}function hE(e){let[r,...n]=e;return O(r)?o0(r)?hE(n):!1:!0}function TE(e){return s.IsEqual(e.length,0)?!1:hE(e)}function o0(e){return S(e)?TE(e.anyOf):X(e)?n0(e.const):!1}function _c(e){return TE(e)}function EE(e,r,n=[]){let[o,...i]=e;return s.IsString(o)?EE(i,r,[...n,`${o}${r}`]):n}function i0(e,r){return s.IsEqual(e.length,0)?[`${r}`]:EE(e,r)}function _E(e,r,n=[]){let[o,...i]=r;return O(o)?_E(e,i,[...n,...IE(e,o)]):n}function IE(e,r){return S(r)?_E(e,r.anyOf):X(r)?i0(e,r.const):H()}function bE(e,r){let[n,...o]=r;return O(n)?bE(IE(e,n),o):e}function a0(e){return e.map(r=>Y(r))}function s0(e){let r=bE([],e),n=a0(r);return q(n)}function c0(e){return s.IsEqual(e.length,0)?H():s.IsEqual(e.length,1)&&X(e[0])?e[0]:s0(e)}function rt(e){let r=Ec(e);return _c(r)?c0(r):It()}function p0(e){return s.IsString(e)||s.IsNumber(e)?Y(e):s.IsNull(e)?zr():Z()}function Ft(e){return e.map(n=>p0(n))}function ta(e){let r=Ft(e);return q(r)}function Un(e){return ta(e.enum)}function u0(e,r,n,o){let i=re(e,n,o);return Se(i)?x(g.Assign(g.Assign(e,i.inferred),{[r]:n})):F()}function m0(e,r){return x(e)}function l0(e,r,n){let o=ta(n);return re(e,r,o)}function SE(e,r,n){let[o,...i]=n;return O(o)?(()=>{let a=re(e,r,o);return Se(a)?SE(a.inferred,r,i):F()})():x(e)}function d0(e,r,n){let o=rt(n);return re(e,r,o)}function OE(e,r,n){let[o,...i]=n;return O(o)?(()=>{let a=re(e,r,o);return Se(a)?x(a.inferred):OE(e,r,i)})():F()}function K(e,r,n){return ct(n)?m0(e,r):Re(n)?l0(e,r,n.enum):xe(n)?u0(e,n.name,r,n.extends):w(n)?SE(e,r,n.allOf):Ce(n)?d0(e,r,n.pattern):S(n)?OE(e,r,n.anyOf):_t(n)?x(e):F()}function AE(e,r,n){return xe(n)?K(e,r,n):ct(n)?x(e):_t(n)?x(e):Mu(e)}function f0(e,r){let n=Sn(e),o=Sn(r);return n&&o||!n&&o?!0:!(n&&!o)}function xE(e,r,n,o){return te(o)?f0(r,o)?re(e,n,o.items):F():K(e,r,o)}function RE(e,r,n){return it(n)?re(e,r,n.iteratorItems):K(e,Zt(r),n)}function CE(e,r,n){return Ot(n)?x(e):K(e,r,n)}function PE(e,r,n){return ut(n)?x(e):K(e,r,n)}function g0(e,r,n,o,i){let a=xe(o)?r:o,c=xe(o)?o:r,m=Me(r),d=Me(o),f=re(e,a,c);return!m&&d?F():Se(f)?ra(f.inferred,n,i):F()}function y0(e,r,n,o){let[i,...a]=o;return O(i)?g0(e,r,n,i,a):Me(r)?x(e):F()}function h0(e,r,n){let[o,...i]=r;return O(o)?y0(e,o,i,n):x(e)}function ra(e,r,n){return h0(e,r,n)}function Ic(e,r,n){return xt(n)?x(e):re(e,r,n)}function UE(e,r,n,o){return De(o)?(()=>{let i=ra(e,r,o.parameters);return Se(i)?Ic(i.inferred,n,o.instanceType):F()})():F()}function wE(e,r,n){return re(e,Un(r),n)}function NE(e,r,n,o){return Ge(o)?(()=>{let i=ra(e,r,o.parameters);return Se(i)?Ic(i.inferred,n,o.returnType):F()})():F()}function LE(e,r,n){return Be(n)?x(e):_e(n)?x(e):K(e,r,n)}var na="equal",T0="disjoint",oa="left-inside",ia="right-inside";function aa(e,r){let n=[_t(e)?L.ExtendsFalse():nt({},e,r),_t(e)?L.ExtendsTrue({}):nt({},r,e)];return L.IsExtendsTrueLike(n[0])&&L.IsExtendsTrueLike(n[1])?na:L.IsExtendsTrueLike(n[0])&&L.IsExtendsFalse(n[1])?oa:L.IsExtendsFalse(n[0])&&L.IsExtendsTrueLike(n[1])?ia:T0}function E0(e){return S(e)?or(e.anyOf):[e]}function or(e){return e.reduce((r,n)=>[...r,...E0(n)],[])}function Du(e){return e.reduceRight((n,o,i)=>({[i]:o,...n}),{})}function vE(e){let r=Du(e.items);return N(r)}function _0(e,r){return On(e)?!!On(r):!1}function I0(e,r){return Me(e)?!!Me(r):!1}function b0(e,r){let n=_0(e,r),o=I0(e,r),i=Pe([e,r]),a=Vs(co(i));return n&&o?Et(Tt(a)):n&&!o?Et(a):!n&&o?Tt(a):a}function S0(e,r,n){return n in e?n in r?b0(e[n],r[n]):e[n]:n in r?r[n]:Z()}function O0(e,r){return[...new Set([...s.Keys(r),...s.Keys(e)])].reduce((o,i)=>({...o,[i]:S0(e,r,i)}),{})}function kE(e){return k(e)?e.properties:V(e)?Du(e.items):H()}function ME(e,r){let n=kE(e),o=kE(r),i=O0(n,o);return N(i)}function DE(e,r){let n=aa(e,r);return s.IsEqual(n,oa)?e:s.IsEqual(n,ia)||s.IsEqual(n,na)?r:Z()}function GE(e){return k(e)||V(e)}function $E(e){return w(e)?Pe(e.allOf):e}function A0(e,r){let n=$E(e),o=$E(r),i=GE(n),a=GE(o);return i&&a?ME(Wr(n),o):i&&!a?Wr(n):!i&&a?o:DE(Wr(n),o)}function jE(e,r,n=[]){let[o,...i]=r;return s.IsUndefined(o)?n.length===0?[e]:n:jE(e,i,[...n,A0(e,o)])}function qE(e,r,n=[]){let[o,...i]=e;return O(o)?qE(i,r,[...n,...sa([o],r)]):n}function sa(e,r=[]){let[n,...o]=e;return O(n)?S(n)?sa(o,qE(n.anyOf,r)):sa(o,jE(n,r)):r}function Pe(e){let r=sa(e);return Gu(r)}function yr(e){return Gu(e)}function Wr(e){return w(e)?Pe(e.allOf):S(e)?yr(e.anyOf):e}function wn(e){return s.IsEqual(e.length,1)?e[0]:s.IsEqual(e.length,0)?Z():q(e)}function x0(e,r){return r.filter(n=>aa(e,n)!==ia)}function R0(e,r){let n=r.some(o=>{let i=aa(e,o);return s.IsEqual(i,oa)||s.IsEqual(i,na)});return s.IsEqual(n,!1)}function C0(e,r){let n=Wr(e);return ct(n)?[n]:R0(n,r)?[...x0(n,r),n]:r}function $u(e,r=[]){let[n,...o]=e;return O(n)?k(n)?$u(o,[...r,n]):$u(o,C0(n,r)):r}function Gu(e){let r=$u(e),n=or(r);return n.length===0?Z():n.length===1?n[0]:q(n)}function P0(e,r,n,o){let i=_(e,r,n);return g.Update(Wr(i),{},o)}function BE(e,r,n,o){return P0(e,r,n,o)}function FE(e,r,n){let o=Pe(r);return re(e,o,n)}function HE(e,r,n){return at(n)?re(e,r,n.iteratorItems):K(e,Jt(r),n)}function bc(e,r,n){return r===n?x(e):F()}function U0(e,r,n){return X(n)?bc(e,r,n.const):Ot(n)?x(e):K(e,Y(r),n)}function w0(e,r,n){return X(n)?bc(e,r,n.const):ut(n)?x(e):K(e,Y(r),n)}function N0(e,r,n){return X(n)?bc(e,r,n.const):_e(n)?x(e):K(e,Y(r),n)}function L0(e,r,n){return X(n)?bc(e,r,n.const):Ne(n)?x(e):K(e,Y(r),n)}function KE(e,r,n){return s.IsBigInt(r.const)?U0(e,r.const,n):s.IsBoolean(r.const)?w0(e,r.const,n):s.IsNumber(r.const)?N0(e,r.const,n):s.IsString(r.const)?L0(e,r.const,n):H()}function zE(e,r,n){return xe(n)?K(e,r,n):x(e)}function YE(e,r,n){return er(n)?x(e):K(e,r,n)}function VE(e,r,n){return _e(n)?x(e):K(e,r,n)}function v0(e,r,n){return Me(r)?Me(n)?x(e):F():x(e)}function k0(e,r,n){return xe(n)&&fr(n.extends)?F():(()=>{let o=re(e,r,n);return Se(o)?v0(o.inferred,r,n):F()})()}function M0(e,r){return e.reduce((n,o)=>o in r?Se(r[o])?{...n,...r[o].inferred}:H():H(),{})}function D0(e,r,n){let o={};for(let c of s.Keys(n))o[c]=c in r?k0({},r[c],n[c]):Me(n[c])?xe(n[c])?x(g.Assign(e,{[n[c].name]:n[c].extends})):x(e):F();let i=s.Values(o).every(c=>Se(c)),a=i?M0(s.Keys(o),o):{};return i?x(a):F()}function G0(e,r,n){let o=D0(e,r,n);return Se(o)?x(g.Assign(e,o.inferred)):F()}function $0(e,r,n){return G0(e,r,n)}function QE(e,r,n){return k(n)?$0(e,r,n.properties):K(e,N(r),n)}function WE(e,r,n){return et(n)?re(e,r,n.item):K(e,rr(r),n)}function ZE(e,r,n){return Ne(n)?x(e):K(e,r,n)}function XE(e,r,n){return tr(n)?x(e):K(e,r,n)}function JE(e,r,n){let o=rt(r);return re(e,o,n)}function ju(e,r){return g.Create({"~kind":"Inferrable"},{name:e,type:r},{})}function ca(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 qu(e){return Yr(e)?xe(e.items)?te(e.items.extends)?ju(e.items.name,e.items.extends.items):_t(e.items.extends)?ju(e.items.name,e.items.extends):void 0:H():void 0}function Sc(e){return xe(e)?ju(e.name,e.extends):void 0}function Bu(e,r,n=[]){let[o,...i]=e;return O(o)?(()=>{let a=re({},o,r);return Se(a)?Bu(i,r,[...n,o]):void 0})():n}function e_(e,r,n,o){let i=Bu(n,o);return s.IsArray(i)?x(g.Assign(e,{[r]:Fe(i)})):F()}function Oc(e,r,n,o){let i=Bu(n,o);return s.IsArray(i)?x(g.Assign(e,{[r]:q(i)})):F()}function j0(e){return[...e].reverse()}function Fu(e,r){return r?j0(e):e}function q0(e){let r=e.length>0?e[0]:void 0,n=O(r)?qu(r):void 0;return O(n)}function B0(e,r,n,o,i,a){let c=re(e,n,i);return Se(c)?t_(c.inferred,r,o,a):F()}function F0(e,r,n,o,i){let a=qu(o);return ca(a)?e_(e,a.name,Fu(n,r),a.type):(()=>{let[c,...m]=n;return O(c)?B0(e,r,c,m,o,i):F()})()}function H0(e,r,n,o){let[i,...a]=o;return O(i)?F0(e,r,n,i,a):s.IsEqual(n.length,0)?x(e):F()}function t_(e,r,n,o){return H0(e,r,n,o)}function K0(e,r,n){let o=Ac(e,{callstack:[]},n),i=q0(o);return t_(e,i,Fu(r,i),Fu(o,i))}function r_(e,r,n){let o=Sc(n);return ca(o)?Oc(e,o.name,r,o.type):(()=>{let[i,...a]=r;return O(i)?(()=>{let c=re(e,i,n);return Se(c)?r_(c.inferred,a,n):F()})():x(e)})()}function n_(e,r,n){let o=Ac(e,{callstack:[]},r);return V(n)?K0(e,o,n.items):te(n)?r_(e,o,n.items):K(e,Fe(o),n)}function o_(e,r,n){return xt(n)?x(e):nr(n)?x(e):K(e,r,n)}function i_(e,r,n){let[o,...i]=n;return O(o)?(()=>{let a=re(e,r,o);return Se(a)?x(a.inferred):i_(e,r,i)})():F()}function Hu(e,r,n){let[o,...i]=r;return O(o)?(()=>{let a=i_(e,o,n);return Se(a)?Hu(a.inferred,i,n):F()})():x(e)}function a_(e,r,n){let o=Sc(n);return ca(o)?Oc(e,o.name,r,o.type):S(n)?Hu(e,r,n.anyOf):Hu(e,r,[n])}function s_(e,r,n){return xe(n)?K(e,r,n):ct(n)?x(e):_t(n)?x(e):F()}function c_(e,r,n){return xt(n)?x(e):K(e,r,n)}function re(e,r,n){return ct(r)?AE(e,r,n):te(r)?xE(e,r,r.items,n):it(r)?RE(e,r.iteratorItems,n):Ot(r)?CE(e,r,n):ut(r)?PE(e,r,n):De(r)?UE(e,r.parameters,r.instanceType,n):Re(r)?wE(e,r,n):Ge(r)?NE(e,r.parameters,r.returnType,n):Be(r)?LE(e,r,n):w(r)?FE(e,r.allOf,n):at(r)?HE(e,r.iteratorItems,n):X(r)?KE(e,r,n):fr(r)?zE(e,r,n):er(r)?YE(e,r,n):_e(r)?VE(e,r,n):k(r)?QE(e,r.properties,n):et(r)?WE(e,r.item,n):Ne(r)?ZE(e,r,n):tr(r)?XE(e,r,n):Ce(r)?JE(e,r.pattern,n):V(r)?n_(e,r.items,n):nr(r)?o_(e,r,n):S(r)?a_(e,r.anyOf,n):_t(r)?s_(e,r,n):xt(r)?c_(e,r,n):F()}function Io(e,r,n={}){return P("Interface",[e,r],n)}function Co(e){return O(e)&&s.HasPropertyKey(e,"action")&&s.IsEqual(e.action,"Interface")}function p_(e,r,n={}){return C({},Io(e,r,n))}function z0(e,r,n){return e.includes(n)?!0:Zr([...e,n],r,r[n])}function u_(e,r,n){let o=oc(n);return Nn(e,r,o)}function Nn(e,r,n){let[o,...i]=n;return O(o)?Zr(e,r,o)?!0:Nn(e,r,i):!1}function Zr(e,r,n){return ce(n)?z0(e,r,n.$ref):te(n)?Zr(e,r,n.items):it(n)?Zr(e,r,n.iteratorItems):De(n)?Nn(e,r,[...n.parameters,n.instanceType]):Ge(n)?Nn(e,r,[...n.parameters,n.returnType]):Co(n)?u_(e,r,n.parameters[1]):w(n)?Nn(e,r,n.allOf):at(n)?Zr(e,r,n.iteratorItems):k(n)?u_(e,r,n.properties):et(n)?Zr(e,r,n.item):S(n)?Nn(e,r,n.anyOf):V(n)?Nn(e,r,n.items):Ie(n)?Zr(e,r,tt(n)):!1}function xc(e,r,n){return Zr(e,r,n)}function Y0(e,r){return r.reduce((n,o)=>o in e?xc([o],e,e[o])?[...n,o]:n:H(),[])}function m_(e){let r=uy(e);return Y0(e,r)}function V0(e,r,n){return n.includes(r)?n:r in e?Xr(e,e[r],[...n,r]):H()}function l_(e,r,n){let o=oc(r);return Po(e,o,n)}function Po(e,r,n){return r.reduce((o,i)=>Xr(e,i,o),n)}function Xr(e,r,n){return ce(r)?V0(e,r.$ref,n):te(r)?Xr(e,r.items,n):it(r)?Xr(e,r.iteratorItems,n):De(r)?Po(e,[...r.parameters,r.instanceType],n):Ge(r)?Po(e,[...r.parameters,r.returnType],n):Co(r)?l_(e,r.parameters[1],n):w(r)?Po(e,r.allOf,n):at(r)?Xr(e,r.iteratorItems,n):k(r)?l_(e,r.properties,n):et(r)?Xr(e,r.item,n):S(r)?Po(e,r.anyOf,n):V(r)?Po(e,r.items,n):Ie(r)?Xr(e,tt(r),n):n}function d_(e,r,n){return Xr(e,n,[r])}function Q0(e){return uo()}function W0(e){return s.Keys(e).reduce((r,n)=>({...r,[n]:ir(e[n])}),{})}function pa(e){return e.reduce((r,n)=>[...r,ir(n)],[])}function ir(e){return ce(e)?Q0(e.$ref):te(e)?Bt(ir(e.items),Ws(e)):it(e)?Zt(ir(e.iteratorItems)):De(e)?qr(pa(e.parameters),ir(e.instanceType)):Ge(e)?Br(pa(e.parameters),ir(e.returnType)):w(e)?Ut(pa(e.allOf)):at(e)?Jt(ir(e.iteratorItems)):k(e)?N(W0(e.properties)):et(e)?rr(ir(e.item)):Ie(e)?ac(To(e),ir(tt(e))):S(e)?q(pa(e.anyOf)):V(e)?Fe(pa(e.items)):e}function Z0(e,r){return r in e?ir(e[r]):Xe()}function f_(e){return Z0(e.$defs,e.$ref)}function X0(e,r,n){let o=Rt(e,{callstack:[]},r),i=ua({},{callstack:[]},n);return Pe([...o,N(i)])}function J0(e,r){return s.Keys(e).filter(o=>r.includes(o)).reduce((o,i)=>{let a=e[i],c=Co(a)?X0(e,a.parameters[0],a.parameters[1]):a;return{...o,[i]:c}},{})}function g_(e,r,n){let o=d_(e,r,n),i=J0(e,o);return Xt(i,r)}function y_(e,r){return r in e?ce(e[r])?y_(e,e[r].$ref):e[r]:Z()}function ar(e,r){return y_(e,r)}function h_(e){return me(e)?f_(e):e}function nt(e,r,n){let o=h_(r),i=h_(n);return re(e,o,i)}function eD(e,r,n){if(xe(r)||Uo(r)||L.IsExtendsTrueLike(nt({},r,n)))return;let o={parameter:e,extends:n,received:r};throw new Error("Generic argument does not satify constraint",{cause:o})}function T_(e,r,n,o,i){let a=_(e,r,i);return eD(n,a,o),g.Assign(e,{[n]:a})}function tD(e,r,n,o,i){let a=_(e,r,n.extends),c=_(e,r,n.equals),[m,...d]=i;return O(m)?Ku(T_(e,r,n.name,a,m),r,o,d):Ku(T_(e,r,n.name,a,c),r,o,[])}function Ku(e,r,n,o){let[i,...a]=n;return O(i)?tD(e,r,i,a,o):e}function E_(e,r,n,o){return Ku(e,r,n,o)}function rD(e){return s.IsGreaterThan(e.length,0)?e[0]:""}function __(e,r,n,o){let i=Rt(e,r,o);return uc(n,i)}function nD(e,r,n,o){return __(e,r,we(n),o)}function oD(e,r,n,o,i,a){let c=Rt(e,r,a),m=E_(e,r,o,c),d=_(m,{callstack:[...r.callstack,n]},i);return _(e,r,d)}function Rc(e,r,n,o){let[i,a]=jg(e,n,o);return po(a)?s.IsEqual(rD(r.callstack),i)?nD(e,r,i,o):oD(e,r,i,a.parameters,a.expression,o):__(e,r,n,o)}function uc(e,r){return g.Create({"~kind":"Call"},{target:e,arguments:r},{})}function I_(e,r){return Rc({},{callstack:[]},e,r)}function Uo(e){return b(e,"Call")}function b_(e){return et(e)?b_(e.item):e}function iD(e,r,n,o){let i=_(e,r,n);return g.Update(b_(i),{},o)}function S_(e,r,n,o){return v(e,[n])?iD(e,r,n,o):ea(n,o)}function O_(e,r){return e(r)}function A_(e,r){return s.IsString(r)?Y(O_(e,r)):Y(r)}function x_(e,r){let n=rt(r);return hr(e,n)}function R_(e,r){let n=r.map(o=>hr(e,o));return q(n)}function hr(e,r){return X(r)?A_(e,r.const):Ce(r)?x_(e,r.pattern):S(r)?R_(e,r.anyOf):r}function Di(e,r={}){return P("Capitalize",[e],r)}function C_(e,r={}){return C({},Di(e,r))}function Gi(e,r={}){return P("Lowercase",[e],r)}function P_(e,r={}){return C({},Gi(e,r))}function $i(e,r={}){return P("Uncapitalize",[e],r)}function U_(e,r={}){return C({},$i(e,r))}function ji(e,r={}){return P("Uppercase",[e],r)}function w_(e,r={}){return C({},ji(e,r))}var aD=e=>e[0].toUpperCase()+e.slice(1),sD=e=>e.toLowerCase(),cD=e=>e[0].toLowerCase()+e.slice(1),pD=e=>e.toUpperCase();function uD(e,r,n,o){let i=_(e,r,n);return g.Update(hr(aD,i),{},o)}function N_(e,r,n,o){return v(e,[n])?uD(e,r,n,o):Di(n,o)}function mD(e,r,n,o){let i=_(e,r,n);return g.Update(hr(sD,i),{},o)}function L_(e,r,n,o){return v(e,[n])?mD(e,r,n,o):Gi(n,o)}function lD(e,r,n,o){let i=_(e,r,n);return g.Update(hr(cD,i),{},o)}function v_(e,r,n,o){return v(e,[n])?lD(e,r,n,o):$i(n,o)}function dD(e,r,n,o){let i=_(e,r,n);return g.Update(hr(pD,i),{},o)}function k_(e,r,n,o){return v(e,[n])?dD(e,r,n,o):ji(n,o)}function qi(e,r,n,o,i={}){return P("Conditional",[e,r,n,o],i)}function M_(e,r,n,o,i={}){return C({},qi(e,r,n,o,i))}function fD(e,r,n,o,i,a,c){let m=_(e,r,n),d=_(e,r,o),f=nt(e,m,d);return g.Update(L.IsExtendsUnion(f)?q([_(f.inferred,r,i),_(e,r,a)]):L.IsExtendsTrue(f)?_(f.inferred,r,i):_(e,r,a),{},c)}function D_(e,r,n,o,i,a,c){return v(e,[n,o])?fD(e,r,n,o,i,a,c):qi(n,o,i,a,c)}function Bi(e,r={}){return P("ConstructorParameters",[e],r)}function G_(e,r={}){return C({},Bi(e,r))}function gD(e){return De(e)?_({},{callstack:[]},Fe(e.parameters)):Z()}function yD(e,r,n,o){let i=_(e,r,n);return g.Update(gD(i),{},o)}function $_(e,r,n,o){return v(e,[n])?yD(e,r,n,o):Bi(n,o)}function Fi(e,r,n={}){return P("Exclude",[e,r],n)}function j_(e,r,n={}){return C({},Fi(e,r,n))}function q_(e,r){return e.reduce((n,o)=>[...n,...B_(o,r)],[])}function B_(e,r){let n=nt({},e,r);return L.IsExtendsTrueLike(n)?[]:[e]}function hD(e,r){let n=Re(e)?q_(Ft(e.enum),r):S(e)?q_(or(e.anyOf),r):B_(e,r);return yr(n)}function TD(e,r,n,o,i){let a=_(e,r,n),c=_(e,r,o);return g.Update(hD(a,c),{},i)}function Cc(e,r,n,o,i){return v(e,[n,o])?TD(e,r,n,o,i):Fi(n,o,i)}function Hi(e,r,n={}){return P("Extract",[e,r],n)}function F_(e,r,n={}){return C({},Hi(e,r,n))}function H_(e,r){return e.reduce((n,o)=>[...n,...K_(o,r)],[])}function K_(e,r){let n=nt({},e,r);return L.IsExtendsTrueLike(n)?[e]:[]}function ED(e,r){let n=Re(e)?H_(Ft(e.enum),r):S(e)?H_(or(e.anyOf),r):K_(e,r);return yr(n)}function _D(e,r,n,o,i){let a=_(e,r,n),c=_(e,r,o);return g.Update(ED(a,c),{},i)}function z_(e,r,n,o,i){return v(e,[n,o])?_D(e,r,n,o,i):Hi(n,o,i)}var ID=new RegExp("^(?:0|[1-9][0-9]*)$");function wo(e){let r=`${e}`;return ID.test(r)?parseInt(r):e}function bD(e){return Y(wo(e))}function Y_(e){return e.map(r=>V_(r))}function V_(e){return w(e)?Ut(Y_(e.allOf)):S(e)?q(Y_(e.anyOf)):X(e)?bD(e.const):e}function Q_(e,r){let n=V_(r),o=nt({},n,wt());return L.IsExtendsTrueLike(o)?e:Z()}function W_(e,r){let n=ar(e,r);return sr(n)}function Pc(e){return e.reduce((r,n)=>[...r,...sr(n)],[])}function Z_(e){let r=Ft(e);return Pc(r)}function X_(e){let r=Pe(e);return sr(r)}function J_(e){return[`${e}`]}function eI(e){let r=rt(e);return sr(r)}function sr(e){return me(e)?W_(e.$defs,e.$ref):Re(e)?Z_(e.enum):w(e)?X_(e.allOf):X(e)?J_(e.const):Ce(e)?eI(e.pattern):S(e)?Pc(e.anyOf):[]}function No(e){return sr(e)}function SD(e,r){return r in e?[e[r]]:[]}function OD(e,r){return r.reduce((n,o)=>[...n,...SD(e,o)],[])}function tI(e,r){let n=No(r),o=OD(e,n);return yr(o)}function AD(e){return Y(wo(e))}function rI(e){return e.map(r=>zu(r))}function zu(e){return w(e)?Ut(rI(e.allOf)):S(e)?q(rI(e.anyOf)):X(e)?AD(e.const):e}function xD(e,r){return e.reduceRight((n,o,i)=>{let a=nt({},Y(i),r);return L.IsExtendsTrueLike(a)?[o,...n]:n},[])}function RD(e,r){let n=zu(r),o=xD(e,n);return wn(o)}function CD(e){return wn(e)}function nI(e,r){return _e(r)||Be(r)?CD(e):RD(e,r)}function PD(e){return e.reduce((r,n)=>rc(n)?[...r,Y(n)]:r,[])}function Lo(e){let r=PD(e);return q(r)}function bo(e,r,n={}){return P("Index",[e,r],n)}function oI(e,r,n={}){let o=s.IsArray(r)?Lo(r):r;return C({},bo(e,o,n))}function iI(e,r){let n=ar(e,r);return Ht(n)}function UD(e,r){let n=s.Keys(e).filter(y=>!s.HasPropertyKey(r,y)),o=s.Keys(r).filter(y=>!s.HasPropertyKey(e,y)),i=s.Keys(e).filter(y=>s.HasPropertyKey(r,y)),a=n.reduce((y,E)=>({...y,[E]:e[E]}),{}),c=o.reduce((y,E)=>({...y,[E]:r[E]}),{}),m=i.reduce((y,E)=>({...y,[E]:Pe([e[E],r[E]])}),{}),d=g.Assign(a,c);return g.Assign(d,m)}function aI(e){return e.reduce((r,n)=>UD(r,Ht(n)),{})}function sI(e){let r=vE(Fe(e));return Ht(r)}function wD(e,r){return s.Keys(e).filter(i=>i in r).reduce((i,a)=>({...i,[a]:yr([e[a],r[a]])}),{})}function cI(e,r){let[n,...o]=e;return O(n)?cI(o,wD(r,Ht(n))):r}function pI(e){let[r,...n]=e;return O(r)?cI(n,Ht(r)):H()}function Ht(e){return me(e)?iI(e.$defs,e.$ref):w(e)?aI(e.allOf):S(e)?pI(e.anyOf):V(e)?sI(e.items):k(e)?e.properties:{}}function vo(e){let r=Ht(e);return N(r)}function ND(e){return me(e)||w(e)||S(e)?vo(e):e}function LD(e,r){let n=ND(e);return te(n)?Q_(n.items,r):k(n)?tI(n.properties,r):V(n)?nI(n.items,r):Z()}function vD(e,r,n,o,i){let a=_(e,r,n),c=_(e,r,o);return g.Update(LD(a,c),{},i)}function uI(e,r,n,o,i){return v(e,[n,o])?vD(e,r,n,o,i):bo(n,o,i)}function Ki(e,r={}){return P("InstanceType",[e],r)}function mI(e,r={}){return C({},Ki(e,r))}function kD(e){return De(e)?e.instanceType:Z()}function MD(e,r,n,o){let i=_(e,r,n);return g.Update(kD(i),{},o)}function lI(e,r,n,o={}){return v(e,[n])?MD(e,r,n,o):Ki(n,o)}function DD(e,r,n,o,i){let a=Rt(e,{callstack:[]},n),c=ua(e,{callstack:[]},o),m=Pe([...a,N(c)]);return g.Update(m,{},i)}function dI(e,r,n,o,i){return v(e,n)?DD(e,r,n,o,i):Io(n,o,i)}function So(e,r={}){return P("KeyOf",[e],r)}function fI(e,r={}){return C({},So(e,r))}function gI(){return q([wt(),It(),go()])}function yI(e){return wt()}function GD(e){return e.reduce((n,o)=>rc(o)?[...n,Y(wo(o))]:H(),[])}function hI(e){let r=s.Keys(e),n=GD(r);return wn(n)}function TI(e){return To(e)}function EI(e){let r=e.map((n,o)=>Y(o));return wn(r)}function $D(e){return me(e)||w(e)||S(e)?vo(e):e}function jD(e){let r=$D(e);return ct(r)?gI():te(r)?yI(r.items):k(r)?hI(r.properties):Ie(r)?TI(r):V(r)?EI(r.items):Z()}function qD(e,r,n,o){let i=_(e,r,n);return g.Update(jD(i),{},o)}function _I(e,r,n,o){return v(e,[n])?qD(e,r,n,o):So(n,o)}function BD(e){let r=rt(e);return Yu(r)}function II(e){return e.reduce((r,n)=>[...r,...Yu(n)],[])}function Yu(e){return Re(e)?II(Ft(e.enum)):fo(e)||lo(e)?[e]:Ce(e)?BD(e.pattern):S(e)?II(e.anyOf):[]}function bI(e){return Yu(e)}function _o(e,r,n,o,i={}){return P("Mapped",[e,r,n,o],i)}function SI(e,r,n,o,i={}){return C({},_o(e,r,n,o,i))}function FD(e,r,n,o,i){let a=g.Assign(e,{[n.name]:o}),c=_(a,r,i);return Ce(c)?rt(c.pattern):c}function HD(e,r,n,o,i){let a=g.Assign(e,{[n.name]:o});return _(a,r,i)}function KD(e,r,n,o,i,a){let c=HD(e,r,n,o,a),m=FD(e,r,n,o,i);return fo(m)||lo(m)?{[m.const]:c}:{}}function zD(e,r,n,o,i,a){return o.reduce((c,m)=>({...c,...KD(e,r,n,m,i,a)}),{})}function YD(e,r,n,o,i,a){let c=bI(o),m=zD(e,r,n,c,i,a);return N(m)}function VD(e,r,n,o,i,a,c){let m=_(e,r,o);return g.Update(YD(e,r,n,m,i,a),{},c)}function OI(e,r,n,o,i,a,c){return v(e,[o])?VD(e,r,n,o,i,a,c):_o(n,o,i,a,c)}function QD(e,r){return s.Keys(e).filter(o=>r.includes(o)).reduce((o,i)=>({...o,[i]:g_(e,i,e[i])}),{})}function WD(e,r){return s.Keys(e).filter(o=>!r.includes(o)).reduce((o,i)=>({...o,[i]:_(e,{callstack:[]},e[i])}),{})}function ZD(e,r){let n=m_(e),o=QD(e,n),i=WD(e,n),a={...o,...i};return g.Update(a,{},r)}function AI(e,r,n,o){let i=g.Assign(e,n);return ZD(i,o)}function zi(e,r={}){return P("NonNullable",[e],r)}function xI(e,r={}){return C({},zi(e,r))}function XD(e){let r=q([zr(),Eo()]);return Cc({},{callstack:[]},e,r,{})}function JD(e,r,n,o){let i=_(e,r,n);return g.Update(XD(i),{},o)}function RI(e,r,n,o){return v(e,[n])?JD(e,r,n,o):zi(n,o)}function Uc(e){let r=vo(e);return k(r)?r.properties:H()}function Yi(e,r,n={}){return P("Omit",[e,r],n)}function CI(e,r,n={}){let o=s.IsArray(r)?Lo(r):r;return C({},Yi(e,o,n))}function eG(e,r){return s.Keys(e).reduce((o,i)=>r.includes(i)?o:{...o,[i]:e[i]},{})}function tG(e,r){let n=Uc(e),o=No(r),i=eG(n,o);return N(i)}function rG(e,r,n,o,i){let a=_(e,r,n),c=_(e,r,o);return g.Update(tG(a,c),{},i)}function PI(e,r,n,o,i){return v(e,[n,o])?rG(e,r,n,o,i):Yi(n,o,i)}function Oo(e,r){return P("Options",[e,r],{})}function wc(e,r){return C({},Oo(e,r))}function nG(e,r,n,o){let i=_(e,r,n);return g.Update(i,{},o)}function UI(e,r,n,o){return v(e,[n])?nG(e,r,n,o):Oo(n,o)}function Vi(e,r={}){return P("Parameters",[e],r)}function wI(e,r={}){return C({},Vi(e,r))}function oG(e){return Ge(e)?_({},{callstack:[]},Fe(e.parameters)):Z()}function iG(e,r,n,o){let i=_(e,r,n);return g.Update(oG(i),{},o)}function NI(e,r,n,o){return v(e,[n])?iG(e,r,n,o):Vi(n,o)}function Qi(e,r={}){return P("Partial",[e],r)}function LI(e,r={}){return C({},Qi(e,r))}function vI(e,r){let n=ar(e,r),o=Jr(n);return Xt(g.Assign(e,{[r]:o}),r)}function kI(e){let r=e.map(n=>Jr(n));return Pe(r)}function MI(e){let r=e.map(n=>Jr(n));return q(r)}function DI(e){let r=s.Keys(e).reduce((o,i)=>({...o,[i]:Ys(e[i])}),{});return N(r)}function Jr(e){return me(e)?vI(e.$defs,e.$ref):w(e)?kI(e.allOf):S(e)?MI(e.anyOf):k(e)?DI(e.properties):N({})}function aG(e,r,n,o){let i=_(e,r,n);return g.Update(Jr(i),{},o)}function GI(e,r,n,o){return v(e,[n])?aG(e,r,n,o):Qi(n,o)}function Wi(e,r,n={}){return P("Pick",[e,r],n)}function $I(e,r,n={}){let o=s.IsArray(r)?Lo(r):r;return C({},Wi(e,o,n))}function sG(e,r){return s.Keys(e).reduce((o,i)=>r.includes(i)?g.Assign(o,{[i]:e[i]}):o,{})}function cG(e,r){let n=Uc(e),o=No(r),i=sG(n,o);return N(i)}function pG(e,r,n,o,i){let a=_(e,r,n),c=_(e,r,o);return g.Update(cG(a,c),{},i)}function jI(e,r,n,o,i){return v(e,[n,o])?pG(e,r,n,o,i):Wi(n,o,i)}function Zi(e,r={}){return P("ReadonlyType",[e],r)}function qI(e,r={}){return C({},Zi(e,r))}function BI(e){return jr(Bt(e))}function FI(e,r){let n=ar(e,r),o=en(n);return Xt(g.Assign(e,{[r]:o}),r)}function HI(e){let r=e.map(n=>en(n));return Pe(r)}function KI(e){let r=s.Keys(e).reduce((o,i)=>({...o,[i]:Qs(e[i])}),{});return N(r)}function zI(e){return jr(Fe(e))}function YI(e){let r=e.map(n=>en(n));return q(r)}function en(e){return te(e)?BI(e.items):me(e)?FI(e.$defs,e.$ref):w(e)?HI(e.allOf):k(e)?KI(e.properties):V(e)?zI(e.items):S(e)?YI(e.anyOf):e}function uG(e,r,n,o){let i=_(e,r,n);return g.Update(en(i),{},o)}function VI(e,r,n,o){return v(e,[n])?uG(e,r,n,o):Zi(n,o)}function QI(e){return bt(Dt,e)}function WI(e){return N({true:e,false:e})}function ZI(e,r){let n=ta(e);return tn(n,r)}function XI(e,r){return bt(yo,r)}function JI(e,r){let n=Pe(e);return tn(n,r)}function eb(e,r){return s.IsString(e)||s.IsNumber(e)?N({[e]:r}):s.IsEqual(e,!1)?N({false:r}):s.IsEqual(e,!0)?N({true:r}):N({})}function tb(e,r){return bt(ho,r)}function rb(e,r){return s.HasPropertyKey(e,"pattern")&&(s.IsString(e.pattern)||e.pattern instanceof RegExp)?bt(e.pattern.toString(),r):bt(Dt,r)}function nb(e,r){let n=Ec(e);return _c(n)?tn(rt(e),r):bt(e,r)}function mG(e){return e.some(r=>Ne(r)||_e(r)||Be(r))}function lG(e,r){return s.IsEqual(mG(e),!0)?bt(Dt,r):void 0}function dG(e,r){return e.reduce((n,o)=>X(o)&&(s.IsString(o.const)||s.IsNumber(o.const))?{...n,[o.const]:r}:n,{})}function fG(e,r){let n=dG(e,r);return N(n)}function ob(e,r){let n=or(e),o=lG(n,r);return O(o)?o:fG(n,r)}function tn(e,r){return ct(e)?QI(r):ut(e)?WI(r):Re(e)?ZI(e.enum,r):Be(e)?XI(e,r):w(e)?JI(e.allOf,r):X(e)?eb(e.const,r):_e(e)?tb(e,r):S(e)?ob(e.anyOf,r):Ne(e)?rb(e,r):Ce(e)?nb(e.pattern,r):N({})}function gG(e,r,n,o,i){let a=_(e,r,n),c=_(e,r,o);return g.Update(tn(a,c),{},i)}function ib(e,r,n,o,i){return v(e,[n])?gG(e,r,n,o,i):ki(n,o,i)}function ab(e,r,n){return n in e?xc([n],e,e[n])?we(n):_(e,r,e[n]):we(n)}function sb(e,r){let n=ar(e,r),o=rn(n);return Xt(g.Assign(e,{[r]:o}),r)}function cb(e){let r=e.map(n=>rn(n));return Pe(r)}function pb(e){let r=e.map(n=>rn(n));return q(r)}function ub(e){let r=s.Keys(e).reduce((o,i)=>({...o,[i]:co(e[i])}),{});return N(r)}function rn(e){return me(e)?sb(e.$defs,e.$ref):w(e)?cb(e.allOf):S(e)?pb(e.anyOf):k(e)?ub(e.properties):N({})}function Xi(e,r={}){return P("Required",[e],r)}function mb(e,r={}){return C({},Xi(e,r))}function yG(e,r,n,o){let i=_(e,r,n);return g.Update(rn(i),{},o)}function lb(e,r,n,o){return v(e,[n])?yG(e,r,n,o):Xi(n,o)}function Ji(e,r={}){return P("ReturnType",[e],r)}function db(e,r={}){return C({},Ji(e,r))}function hG(e){return Ge(e)?e.returnType:Z()}function TG(e,r,n,o){let i=_(e,r,n);return g.Update(hG(i),{},o)}function fb(e,r,n,o){return v(e,[n])?TG(e,r,n,o):Ji(n,o)}function gb(e){return g.Create({"~kind":"TemplateLiteral"},{type:"string",pattern:e},{})}function EG(e){return e.join("|")}function _G(e){return e.slice(1,e.length-1)}function IG(e,r,n){return nn(r,`${n}${e}`)}function bG(e,r){return nn(e,`${r}${oy}`)}function SG(e,r){return nn(e,`${r}${tc}`)}function OG(e,r){return nn(e,`${r}${nc}`)}function AG(e,r){return Qu(q([Y("false"),Y("true")]),e,r)}function xG(e,r){return nn(e,`${r}${ic}`)}function RG(e,r,n){return nn(r,`${n}${_G(e)}`)}function CG(e,r,n,o=[]){let i=Ft(e);return Vu(i,r,n)}function Vu(e,r,n,o=[]){let[i,...a]=e;return O(i)?Vu(a,r,n,[...o,Qu(i,[],"")]):nn(r,`${n}(${EG(o)})`)}function Qu(e,r,n){return Re(e)?CG(e.enum,r,n):Be(e)?SG(r,n):X(e)?IG(e.const,r,n):Ot(e)?bG(r,n):ut(e)?AG(r,n):_e(e)?OG(r,n):Ne(e)?xG(r,n):Ce(e)?RG(e.pattern,r,n):S(e)?Vu(e.anyOf,r,n):Gg}function nn(e,r){let[n,...o]=e;return O(n)?Qu(n,o,r):r}function PG(e){return`^${nn(e,"")}$`}function yb(e){let r=PG(e);return gb(r)}function UG(e,r,n,o){let i=Rt(e,r,n);return g.Update(yb(i),{},o)}function hb(e,r,n,o){return v(e,n)?UG(e,r,n,o):Mi(n,o)}function wG(e){return Yr(e)?V(e.items)?Wu(e.items.items):xe(e.items)?[e]:ce(e.items)?[e]:[Z()]:[e]}function Wu(e){return e.reduce((n,o)=>[...n,...wG(o)],[])}function NG(e,r){return r in e}function LG(e,r){return w(r)?v(e,r.allOf):S(r)?v(e,r.anyOf):ce(r)?NG(e,r.$ref):!0}function v(e,r){let[n,...o]=r;return O(n)?LG(e,n)?v(e,o):!1:!0}function ma(e,r,n){return Ng(e)?ma(e.type,"remove",n):Cg(e)?ma(e.type,r,"remove"):Ug(e)?ma(e.type,"add",n):xg(e)?ma(e.type,r,"add"):[e,r,n]}function vG(e,r){return s.IsEqual(e,"remove")?Vs(r):s.IsEqual(e,"add")?Et(r):r}function kG(e,r){return s.IsEqual(e,"remove")?co(r):s.IsEqual(e,"add")?Tt(r):r}function ua(e,r,n){return s.Keys(n).reduce((o,i)=>({...o,[i]:_(e,r,n[i])}),{})}function Ac(e,r,n){let o=Rt(e,r,n);return Wu(o)}function Rt(e,r,n){return n.map(o=>_(e,r,o))}function MG(e,r,n,o,i){return s.IsEqual(n,"Awaited")?S_(e,r,o[0],i):s.IsEqual(n,"Capitalize")?N_(e,r,o[0],i):s.IsEqual(n,"Conditional")?D_(e,r,o[0],o[1],o[2],o[3],i):s.IsEqual(n,"ConstructorParameters")?$_(e,r,o[0],i):s.IsEqual(n,"Evaluate")?BE(e,r,o[0],i):s.IsEqual(n,"Exclude")?Cc(e,r,o[0],o[1],i):s.IsEqual(n,"Extract")?z_(e,r,o[0],o[1],i):s.IsEqual(n,"Index")?uI(e,r,o[0],o[1],i):s.IsEqual(n,"InstanceType")?lI(e,r,o[0],i):s.IsEqual(n,"Interface")?dI(e,r,o[0],o[1],i):s.IsEqual(n,"KeyOf")?_I(e,r,o[0],i):s.IsEqual(n,"Lowercase")?L_(e,r,o[0],i):s.IsEqual(n,"Mapped")?OI(e,r,o[0],o[1],o[2],o[3],i):s.IsEqual(n,"Module")?AI(e,r,o[0],i):s.IsEqual(n,"NonNullable")?RI(e,r,o[0],i):s.IsEqual(n,"Pick")?jI(e,r,o[0],o[1],i):s.IsEqual(n,"Options")?UI(e,r,o[0],o[1]):s.IsEqual(n,"Parameters")?NI(e,r,o[0],i):s.IsEqual(n,"Partial")?GI(e,r,o[0],i):s.IsEqual(n,"Omit")?PI(e,r,o[0],o[1],i):s.IsEqual(n,"ReadonlyType")?VI(e,r,o[0],i):s.IsEqual(n,"Record")?ib(e,r,o[0],o[1],i):s.IsEqual(n,"Required")?lb(e,r,o[0],i):s.IsEqual(n,"ReturnType")?fb(e,r,o[0],i):s.IsEqual(n,"TemplateLiteral")?hb(e,r,o[0],i):s.IsEqual(n,"Uncapitalize")?v_(e,r,o[0],i):s.IsEqual(n,"Uppercase")?k_(e,r,o[0],i):P(n,o,i)}function _(e,r,n){let o=Sn(n),i=ma(n,On(n)?"add":"none",Me(n)?"add":"none"),a=Pt(i[0])?i[0].Clone():i[0],c=ce(a)?ab(e,r,a.$ref):te(a)?Bt(_(e,r,a.items),Ws(a)):it(a)?Zt(_(e,r,a.iteratorItems),vg(a)):Uo(a)?Rc(e,r,a.target,a.arguments):De(a)?qr(Rt(e,r,a.parameters),_(e,r,a.instanceType),Mg(a)):Lg(a)?MG(e,r,a.action,a.parameters,a.options):Ge(a)?Br(Rt(e,r,a.parameters),_(e,r,a.returnType),Dg(a)):w(a)?Ut(Rt(e,r,a.allOf),Hg(a)):at(a)?Jt(_(e,r,a.iteratorItems),ay(a)):k(a)?N(ua(e,r,a.properties),my(a)):et(a)?rr(_(e,r,a.item),dy(a)):Ie(a)?sc(At(a),_(e,r,tt(a))):Yr(a)?Cn(_(e,r,a.items)):V(a)?Fe(Ac(e,r,a.items),gy(a)):S(a)?q(Rt(e,r,a.anyOf),yy(a)):a,m=o?jr(c):c;return vG(i[1],kG(i[2],m))}function C(e,r){return _(e,{callstack:[]},r)}function ea(e,r={}){return P("Awaited",[e],r)}function Tb(e,r={}){return C({},ea(e,r))}function bu(e,r={}){return P("Evaluate",[e],r)}function Kt(e,r={}){return C({},bu(e,r))}function Su(e,r={}){return P("Module",[e],r)}function Eb(e,r={}){return C({},Su(e,r))}function _b(...e){let[r,n,o]=ie.Match(e,{2:(c,m)=>s.IsString(c)?[{},c,m]:[c,m,{}],3:(c,m,d)=>[c,m,d],1:c=>[{},c,{}]}),i=mE(n),a=s.IsArray(i)&&s.IsEqual(i.length,2)?_(r,{callstack:[]},i[0]):Z();return g.Update(a,{},o)}var t={};kt(t,{Any:()=>uo,Array:()=>Bt,AsyncIterator:()=>Zt,Awaited:()=>Tb,Base:()=>Zs,BigInt:()=>Li,Boolean:()=>ec,Call:()=>I_,Capitalize:()=>C_,Codec:()=>Xs,Conditional:()=>M_,Constructor:()=>qr,ConstructorParameters:()=>G_,Cyclic:()=>Xt,Decode:()=>ty,DecodeBuilder:()=>Ni,Encode:()=>ry,EncodeBuilder:()=>wi,Enum:()=>Fg,Evaluate:()=>Kt,Exclude:()=>j_,Extends:()=>nt,ExtendsResult:()=>L,Extract:()=>F_,Function:()=>Br,Generic:()=>Fr,Identifier:()=>vi,Immutable:()=>jr,Index:()=>oI,Infer:()=>Ui,InstanceType:()=>mI,Instantiate:()=>C,Integer:()=>xn,Interface:()=>p_,Intersect:()=>Ut,IsAny:()=>ct,IsArray:()=>te,IsAsyncIterator:()=>it,IsBase:()=>Pt,IsBigInt:()=>Ot,IsBoolean:()=>ut,IsCall:()=>Uo,IsCodec:()=>An,IsConstructor:()=>De,IsCyclic:()=>me,IsEnum:()=>Re,IsFunction:()=>Ge,IsGeneric:()=>po,IsIdentifier:()=>iy,IsImmutable:()=>Sn,IsInfer:()=>xe,IsInteger:()=>Be,IsIntersect:()=>w,IsIterator:()=>at,IsKind:()=>b,IsLiteral:()=>X,IsNever:()=>fr,IsNull:()=>er,IsNumber:()=>_e,IsObject:()=>k,IsOptional:()=>Me,IsParameter:()=>ly,IsPromise:()=>et,IsReadonly:()=>On,IsRecord:()=>Ie,IsRef:()=>ce,IsRefine:()=>Js,IsRest:()=>Yr,IsSchema:()=>O,IsString:()=>Ne,IsSymbol:()=>tr,IsTemplateLiteral:()=>Ce,IsThis:()=>fy,IsTuple:()=>V,IsUndefined:()=>nr,IsUnion:()=>S,IsUnknown:()=>_t,IsUnsafe:()=>Ty,IsVoid:()=>xt,Iterator:()=>Jt,KeyOf:()=>fI,Literal:()=>Y,Lowercase:()=>P_,Mapped:()=>SI,Module:()=>Eb,Never:()=>Z,NonNullable:()=>xI,Null:()=>zr,Number:()=>wt,Object:()=>N,Omit:()=>CI,Optional:()=>Ys,Options:()=>wc,Parameter:()=>Rn,Parameters:()=>wI,Partial:()=>LI,Pick:()=>$I,Promise:()=>rr,Readonly:()=>Qs,ReadonlyType:()=>qI,Record:()=>ac,RecordKey:()=>To,RecordKeyAsPattern:()=>At,RecordValue:()=>tt,Ref:()=>we,Refine:()=>ny,Required:()=>mb,Rest:()=>Cn,ReturnType:()=>db,Script:()=>_b,String:()=>It,Symbol:()=>go,TemplateLiteral:()=>fE,This:()=>cc,Tuple:()=>Fe,Uncapitalize:()=>U_,Undefined:()=>Eo,Union:()=>q,Unknown:()=>Xe,Unsafe:()=>hy,Uppercase:()=>w_,Void:()=>pc});var Ib="lowercase-email",Zu="iana-timezone",Xu="simple-time",Ju="simple-date-time";var DG=(e,r)=>RegExp(`^${e.source}(${r.source}${e.source})*$`),GG=/[a-zA-Z0-9-_]+/,$G=/\./,g_e=DG(GG,$G);var bb="lowercase-domain";var ko="kebab-case";var Sb="camel-case";var jG=new Set;function I(e,r,n={}){let o=r.map(i=>{let a=i;return a.$id?(jG.add(i),t.Ref(a.$id)):i});return t.Unsafe({...n,type:"object",discriminator:{propertyName:e},required:[e],oneOf:o})}function je(e,r){return t.Object({values:t.Array(e,{maxItems:r.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:t.Optional(t.Boolean({description:"If true, exclude rows matching these values instead of including them"}))},{description:r.description})}var Ab=1e3,Ob=100,fe={limit:t.Optional(t.Integer({minimum:1,maximum:Ab,description:"Maximum number of items to return in this page."})),offset:t.Optional(t.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."}))},He={...fe,limit:t.Optional(t.Integer({minimum:1,maximum:Ab,default:Ob,description:`Maximum number of items to return in this page. Omit to use the public API default of ${Ob}.`}))},qG=t.Object({totalCount:t.Integer({description:"Total number of items matching the query before `limit` and `offset` are applied."}),pageCount:t.Integer({description:"Total number of pages available for the requested `limit`."})},{description:"Counts describing the full result set that the returned page was taken from, for computing how many further pages remain."}),__e=t.Object({pagination:qG},{$id:"ResponseMetadata",description:"Metadata accompanying `data` on paginated operations, describing the full result set the page was taken from."});function T(e={}){return t.Unsafe({...e,type:"string"})}var Mo=250;function p({allowEmpty:e=!0,type:r="short",description:n,default:o}={}){let i=e?0:1,a={...n===void 0?{}:{description:n},...o===void 0?{}:{default:o}};switch(r){case"camel-case":return t.String({format:Sb,minLength:i,maxLength:Mo,...a});case"kebab-case":return t.String({format:ko,minLength:i,maxLength:Mo,...a});case"email":return t.String({format:Ib,minLength:i,maxLength:254,errorMessage:{format:"Must be a valid lowercase email address."},...a});case"lowercase-domain":return t.String({format:bb,minLength:i,maxLength:Mo,...a});case"tsuga-query":return t.String({format:"tsuga-query",minLength:i,maxLength:1e4,...a});case"tags-query":return t.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 t.String({format:"date-time",...a});case"uri":return t.String({format:"uri",...a});case"user-password":return t.String({format:"user-password",minLength:12,maxLength:Mo,...a});case"long":return t.String({minLength:i,maxLength:5e4,...a});case"short":return t.String({minLength:i,maxLength:Mo,...a});case"tsuga-formula":return t.String({format:"tsuga-formula",minLength:i,maxLength:Mo,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 t.String({format:"time",...a});case"readonly-sql-query":return t.String({format:"readonly-sql-query",minLength:i,maxLength:5e4,errorMessage:{format:"Must be a readonly SQL query - only SELECT statements are allowed."},...a});default:Ze(r)}}var la=["ingestion-api-key","operation-api-key","rum-public-token","dashboard","log-route","metric-route","monitor","notification-rule","notification-silence","slo"],Nc=t.Array(t.Enum(la,{description:"Tsuga-managed asset type."}),{description:"Tsuga-managed asset types covered by the policy. An empty array means all supported asset types."});var em=["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"],N_e=t.Enum(em),BG=["CLUSTER_AGGREGATION_STRUCTURE"],L_e=t.Object({code:t.Enum(em),message:t.String()}),xb=[...em,...BG,"ABORT_ERROR","BAD_REQUEST","DUPLICATE_KEY_VIOLATION","FOREIGN_KEY_VIOLATION","FST_ERR_VALIDATION","GROK_RULE_VALIDATION_ERROR","INVALID_INPUT","FORBIDDEN","MISSING_PERMISSION","PRIVILEGE_ESCALATION","RATE_LIMITED","RESERVED_TAG_POLICY_ERROR","RESOURCE_NOT_FOUND","INVALID_INVITATION","TAG_POLICY_ALREADY_EXISTS_ERROR","TAG_POLICY_VALIDATION_ERROR","UNAUTHORIZED","URL_NOT_FOUND"],Rb=["INTERNAL_ERROR","INVALID_QUERY_TO_CLUSTER"];var FG=["NETWORK_ERROR","RESPONSE_PARSE_ERROR"],HG=[...xb,...Rb,...FG],KG=t.Object({assetId:t.Optional(t.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:t.String({description:"Name of the asset that violated the policy. Set from submitted data or the existing asset row. Returned for every violation."}),assetType:t.Enum(la,{description:"Type of Tsuga asset validated by the policy. Set by the route that ran tag-policy validation. Returned for every violation."}),tagPolicyId:t.String({description:"Identifier of the active tag policy that was violated. Generated by Tsuga when the policy is created. Returned for every violation."}),tagKey:t.String({description:"Tag key required or constrained by the violated policy. Set by the tag policy. Returned for every violation."}),message:t.String({description:"Human-readable reason this policy failed for the asset. Generated by Tsuga's tag-policy validator. Returned for every violation."})},{description:"A single tag-policy violation, identifying the offending asset, the policy and tag key involved, and why validation failed."}),zG=I("type",[t.Object({type:t.Literal("invalid-syntax",{description:"Discriminator identifying a rule the grok parser could not parse at all."}),error:t.Object({offset:t.Integer({description:"Byte offset in the rule where parsing failed."}),detail:t.String({description:"Parser detail message."})},{description:"Position and parser message for the syntax failure."})},{$id:"GrokInvalidSyntax"}),t.Object({type:t.Literal("unknown-pattern",{description:"Discriminator identifying a rule that references a pattern name the grok engine does not provide."}),error:t.Object({offset:t.Integer({description:"Byte offset of the unknown pattern."}),unknownPattern:t.String({description:"The pattern name that is not supported."})},{description:"Position and name of the unsupported pattern."})},{$id:"GrokUnknownPattern"}),t.Object({type:t.Literal("invalid-filter",{description:"Discriminator identifying a rule whose filter is a known filter used incorrectly."}),error:t.Object({offset:t.Integer({description:"Byte offset of the invalid filter."}),invalidFilter:t.String({description:"The filter that is invalid."}),message:t.String({description:"Why the filter is invalid."})},{description:"Position, text, and reason for the invalid filter."})},{$id:"GrokInvalidFilter"}),t.Object({type:t.Literal("unknown-filter",{description:"Discriminator identifying a rule that references a filter name the grok engine does not implement."}),error:t.Object({offset:t.Integer({description:"Byte offset of the unknown filter."}),unknownFilter:t.String({description:"The filter name that is not implemented."}),message:t.String({description:"Details about the unsupported filter."})},{description:"Position and name of the unimplemented filter."})},{$id:"GrokUnknownFilter"})],{description:"Full structured detail of a grok rule that failed to compile, discriminated by `type`."}),YG=t.Object({rule:t.String({description:"The rule that failed to compile."}),ruleIndex:t.Integer({description:"0-based index of the failing rule in the submitted `rules` array."}),error:zG},{description:"A single grok rule that failed to compile, with its position in the submitted rules and the structured compile error."}),Cb=I("type",[t.Object({type:t.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:t.Array(KG,{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"}),t.Object({type:t.Literal("grok_rule_error",{description:"Discriminator identifying grok rule validation details. Set by Tsuga to `grok_rule_error`. Returned when the error code is `GROK_RULE_VALIDATION_ERROR`."}),ruleErrors:t.Array(YG,{description:"Grok rules that failed to compile, with full structured detail. One entry per invalid rule."})},{$id:"GrokRuleErrorDetails"})],{description:"Structured details for a client error. Set by Tsuga only for error types with machine-readable remediation data, and omitted for every other client error."}),v_e=t.Object({code:t.Optional(t.Enum(HG,{description:"Machine readable error code describing what went wrong"})),message:t.String({description:"Human readable explanation of the error"}),statusCode:t.Number({description:"HTTP status code that was returned"}),details:t.Optional(Cb)},{$id:"ErrorResponse",description:"Standard envelope for API errors"}),k_e=t.Object({code:t.Optional(t.Enum(xb,{description:"Machine readable error code describing what went wrong"})),message:t.String({description:"Human readable explanation of the error"}),statusCode:t.Number({description:"HTTP status code that was returned"}),details:t.Optional(Cb)},{$id:"ClientErrorResponse",description:"Standard envelope for client (4XX) API errors"}),M_e=t.Object({code:t.Optional(t.Enum(Rb,{description:"Machine readable error code describing what went wrong"})),message:t.String({description:"Human readable explanation of the error"}),statusCode:t.Number({description:"HTTP status code that was returned"})},{$id:"ServerErrorResponse",description:"Standard envelope for server (5XX) API errors"}),D_e=t.Object({requestId:t.String({description:"Identifier used to trace the lifecycle of this API request"}),error:t.Ref("ClientErrorResponse")},{$id:"ClientErrorEnvelope",description:"Standard envelope wrapping all client (4XX) error responses"}),G_e=t.Object({requestId:t.String({description:"Identifier used to trace the lifecycle of this API request"}),error:t.Ref("ServerErrorResponse")},{$id:"ServerErrorEnvelope",description:"Standard envelope wrapping all server (5XX) error responses"});function l({body:e,description:r,method:n,operationId:o,params:i,tags:a,query:c,paginated:m,response:d,url:f}){return i?{buildUrl:E=>f.replace(/:[a-zA-Z_]+/g,A=>E[A.slice(1)]),method:n,params:i,response:d,templateUrl:f,...e===void 0?{}:{body:e},...r===void 0?{}:{description:r},...o===void 0?{}:{operationId:o},...c===void 0?{}:{query:c},...m===void 0?{}:{paginated:m},...a===void 0?{}:{tags:a}}:{method:n,response:d,url:f,templateUrl:f,...e===void 0?{}:{body:e},...r===void 0?{}:{description:r},...o===void 0?{}:{operationId:o},...c===void 0?{}:{query:c},...m===void 0?{}:{paginated:m},...a===void 0?{}:{tags:a}}}function Pb(e,r){if(!r||typeof r!="object")return e;let n=new URLSearchParams;return Object.entries(r).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 R=t.Object({success:t.Literal(!0,{description:"Always `true` when the delete request completed and the resource was removed."})},{$id:"DeleteResponse",description:"Confirmation that the targeted resource was deleted.",example:{success:!0}});var tm="tsuga-cli";var Ln="/v0/oauth",Ub=l({description:"OAuth 2.1 authorization endpoint: validates the client and redirect URI, then redirects to the consent page",url:`${Ln}/authorize`,method:"GET",query:t.Partial(t.Object({response_type:t.String({description:"Must be `code`"}),client_id:t.String({description:"First-party client id or CIMD document URL"}),redirect_uri:t.String({description:"Client redirect URI"}),code_challenge:t.String({description:"PKCE code challenge"}),code_challenge_method:t.String({description:"Must be `S256`"}),state:t.String({description:"Opaque client state, echoed back"}),resource:t.String({description:"RFC 8707 resource indicator"})})),response:t.Object({},{description:"Never returned: this endpoint redirects (302) or renders an HTML error (400)"})}),wb=l({description:"OAuth 2.1 token endpoint: exchanges an authorization code (PKCE) or refresh token for a token pair",url:`${Ln}/token`,method:"POST",body:t.Partial(t.Object({grant_type:t.String({description:"`authorization_code` or `refresh_token`"}),code:t.String({description:"Authorization code being exchanged"}),code_verifier:t.String({description:"PKCE code verifier"}),redirect_uri:t.String({description:"Must match the redirect URI used on /authorize"}),client_id:t.String({description:"Client id, when sent by the client"}),refresh_token:t.String({description:"Refresh token, for `grant_type=refresh_token`"})})),response:t.Object({access_token:t.String(),token_type:t.Literal("Bearer"),expires_in:t.Number({description:"Access token lifetime in seconds"}),refresh_token:t.String()})}),eIe=l({description:"Resolve a signed authorization request handle for the consent page",url:`${Ln}/authorization-request`,method:"GET",query:t.Object({handle:t.String()}),response:t.Object({clientId:t.String(),clientName:t.String(),redirectUri:t.String()})}),tIe=l({description:"Approve or deny an OAuth authorization request from the consent page",url:`${Ln}/approve`,method:"POST",body:t.Object({handle:t.String({description:"The signed authorization request handle"}),approve:t.Boolean()}),response:t.Object({redirectTo:t.String({description:"The client's redirect URI carrying either the code or the denial"})})}),rIe=l({description:"Validate an OAuth access token (internal, for the MCP resource server)",url:`${Ln}/introspect`,method:"POST",body:t.Object({token:t.String()}),response:t.Object({active:t.Boolean(),userId:t.Optional(t.String()),orgId:t.Optional(t.String())})}),VG=["pending","active","revoked"],QG=t.Object({id:t.String(),createdAt:T(),clientId:t.String({description:"Client ID Metadata Document URL or first-party client id"}),clientName:t.String({description:"Display name derived from the client identity"}),userId:t.String(),status:t.Enum(VG),lastUsedAt:t.Optional(T())}),nIe=l({tags:["oauth"],description:"List OAuth grants: your own, or all users for admins",url:`${Ln}/grants`,method:"GET",query:t.Object({allUsers:t.Optional(t.Boolean({description:"Admins only: list grants of every user in the org"}))}),response:t.Array(QG)}),oIe=l({tags:["oauth"],description:"Delete an OAuth grant (own grant, or any grant for admins)",url:`${Ln}/grants/:id`,method:"DELETE",params:t.Object({id:t.String()}),response:R});function Nb(e,r){let n=new URL(Ub.url,e);return n.search=new URLSearchParams({response_type:"code",client_id:tm,redirect_uri:r.redirectUri,code_challenge:r.challenge,code_challenge_method:"S256",state:r.state}).toString(),n.href}function WG(e){if(!e)return{};try{let r=JSON.parse(e);return typeof r=="object"&&r!==null?r:{}}catch{return{}}}async function ZG(e,r){let n=await fetch(new URL(wb.url,e).href,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams(r).toString()}),o=await n.text(),i=WG(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*iu)}}async function Lb(e,r){return ZG(e,{grant_type:"authorization_code",client_id:tm,code:r.code,code_verifier:r.verifier,redirect_uri:r.redirectUri})}var Gt=require("node:fs"),nm=require("node:os"),kn=require("node:path");var kb=Ls(require("os"),1),da=Ls(require("path"),1),on=kb.default.homedir(),{env:vn}=process,vb=vn.XDG_DATA_HOME||(on?da.default.join(on,".local","share"):void 0),Lc=vn.XDG_CONFIG_HOME||(on?da.default.join(on,".config"):void 0),pIe=vn.XDG_STATE_HOME||(on?da.default.join(on,".local","state"):void 0),Mb=vn.XDG_CACHE_HOME||(on?da.default.join(on,".cache"):void 0),uIe=vn.XDG_RUNTIME_DIR||void 0,XG=(vn.XDG_DATA_DIRS||"/usr/local/share/:/usr/share/").split(":");vb&&XG.unshift(vb);var JG=(vn.XDG_CONFIG_DIRS||"/etc/xdg").split(":");Lc&&JG.unshift(Lc);var Db=(0,kn.join)(Lc??(0,kn.join)((0,nm.homedir)(),".config"),"tsuga"),fa=(0,kn.join)(Db,"config.json"),Gb=(0,kn.join)(Mb??(0,kn.join)((0,nm.homedir)(),".cache"),"tsuga"),rm=(0,kn.join)(Gb,"update-check.json"),ga="https://api.tsuga.com";function $b(e){return tg(e.credential)}function vc(){if(!(0,Gt.existsSync)(fa))return{};try{let e=JSON.parse((0,Gt.readFileSync)(fa,"utf-8")),{operationApiKey:r,userAuth:n,...o}=e;return!r&&!n?e:{...o,credentials:{...e.credentials??{},[ga]:{...r?{operationApiKey:r}:{},...n?{userAuth:n}:{},...e.credentials?.[ga]??{}}}}}catch{throw new Error(`Config file corrupted: ${fa}
|
|
36
|
+
Re-authenticate with \`tsuga auth login\` or \`tsuga auth operation-key <token>\`.`)}}function ya(){try{return vc()}catch{return{}}}function ha(e){(0,Gt.mkdirSync)(Db,{recursive:!0,mode:448}),(0,Gt.writeFileSync)(fa,`${JSON.stringify(e,null,2)}
|
|
37
|
+
`,{mode:384})}function om(e,r=Do()){return e.credentials?.[r]??{}}function im(e,r,n=Do()){return{...e,credentials:{...e.credentials??{},[n]:r}}}function Do(e){return(e?.trim()||process.env.TSUGA_API_URL?.trim()||ga).replace(/\/+$/,"")}function Go(e){let r=vc(),n=Do(e.apiUrl),o=om(r,n),i=eg({overrideKey:e.operationApiKey??process.env.TSUGA_OPERATION_API_KEY,operationApiKey:o.operationApiKey,userAuth:o.userAuth}),a=r.defaults??{},c=e.clusterId?.trim()||process.env.TSUGA_CLUSTER_ID?.trim()||a.cluster?.trim()||void 0;return{apiUrl:n,credential:i,clusterId:c,defaults:a}}function jb(){return om(vc()).userAuth}function qb(e){let r=ya();ha(im(r,{userAuth:e}))}function Bb(e){let r=ya();ha(im(r,{operationApiKey:e}))}function Fb(){let e=ya(),r=om(e);ha(im(e,r.operationApiKey?{operationApiKey:r.operationApiKey}:{}))}function Ta(){return fa}var Hb={from:"-30m",to:"now",query:"*","max-results":"100"};function Tr(e){return(vc().defaults??{})[e]??Hb[e]}function Kb(e,r){let n=ya();ha({...n,defaults:{...n.defaults??{},[e]:r}})}function zb(){let{defaults:e,...r}=ya();ha(r)}function Yb(e,r){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: ${xi(o.userAuth.accessToken)} (expires ${o.userAuth.accessExpiresAt})`);break;default:Ze(a)}}else n.push("Not authenticated. Run `tsuga auth login` or `tsuga auth operation-key <operation-api-key>`.");n.push(`Config: ${r}`),n.push(""),n.push("Defaults (custom overrides marked with *):");let i={...Hb,...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
|
|
40
|
-
`,{mode:384})}async function
|
|
41
|
-
`),process.exitCode=1;return}if(Ms({kind:"user-session",userAuth:r},new Date)){process.stderr.write("Your session expired. Run `tsuga auth login` to sign in again.\n"),process.exitCode=1;return}B(r.accessToken)}function $G(){let{credential:e}=Do({});if(!e){B("Not authenticated. Run `tsuga auth login` or `tsuga auth operation-key <key>`.");return}switch(e.kind){case"user-session":B(`Logged in as a user (token ${Ai(e.userAuth.accessToken)}, expires ${e.userAuth.accessExpiresAt}).`);return;case"operation-api-key":B("Authenticated with an operation API key.");return;default:We(e)}}function jG(){Db(),B("Local user session cleared.")}function Kb(e){let r=e.command("auth").description("Manage authentication: user login (OAuth) or operation API key");r.action(()=>r.help()),r.command("login").description("Log in as a user with a browser authorization flow and save the session").action(DG),r.command("logout").description("Clear the saved user session").action(jG),r.command("token").description("Print the saved user access token to stdout").action(GG),r.command("operation-key <operation-api-key>").description("Save an operation API key to the config file").action(n=>{Mb(n),B(`Operation API key saved to ${ha()}`)}),r.command("status").description("Show the current authentication method").action($G)}var qG=["allowed-domains","cluster-integration-config","custom-usage-tag","database","databricks-connection","explorer-saved-view","host","inventory","monitor-alert","monitor-debugging","oauth-grant","org","retention-policy","saml-config","sensitive-data-scanner-rule","service","service-target","team-remap-config","user-self","widget-share"],BG=["adaptive-notification-rule","audit-log","cloud-account","dashboard-folder","dashboard-report","dashboard","ingestion-api-key","investigation","log-route","metric-route","monitor","notification-integration","notification-rule","notification-silence","operation-api-key","quality-report","rum-public-token","slo","tag-policy","team-members","team","user-data","user-invitation","user-permissions"],FG=["log","metric","trace","rum"],HG=[...BG,...FG],cIe=[...qG,...HG];var kc=["admin","public_editor","public_viewer","teams_only"],Go=["admin","editor","viewer"];var kn="/v0/team-membership",nm="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.",om=t.Object({id:t.String({description:"Tsuga-generated team membership ID assigned when the membership is created."}),userId:t.String({description:"User ID that belongs to the team."}),teamId:t.String({description:"Team ID that contains the user."}),roleKey:t.Enum(Go,{description:nm})}),zb=t.Object({userId:p({allowEmpty:!1,description:"User ID to add to or update in the team."}),teamId:p({allowEmpty:!1,description:"Team ID receiving the membership change."}),roleKey:t.Enum(Go,{description:nm})}),KG=t.Object({userId:p({allowEmpty:!1,description:"User ID to remove from the team."}),teamId:p({allowEmpty:!1,description:"Team ID to remove the user from."})}),zG=t.Optional(t.Object({userId:t.Optional(p({allowEmpty:!1,description:"Restrict results to memberships for this user ID."})),teamId:t.Optional(p({allowEmpty:!1,description:"Restrict results to memberships for this team ID."}))})),pIe=d({tags:["access-control"],url:kn,method:"GET",query:zG,response:t.Array(om)}),uIe=d({tags:["access-control"],url:kn,method:"POST",body:zb,response:om}),mIe=d({tags:["access-control"],url:kn,method:"PUT",body:zb,response:om}),lIe=d({tags:["access-control"],url:kn,method:"DELETE",body:KG,response:R}),vc=500,Yb=t.Object({teamId:p({allowEmpty:!1,description:"Team ID receiving all requested memberships."}),members:t.Array(t.Object({userId:t.Optional(p({allowEmpty:!1,description:"Existing user ID to add to the team."})),userEmail:t.Optional(p({allowEmpty:!1,type:"email",description:"Existing user email to resolve and add to the team."})),roleKey:t.Enum(Go,{description:nm})},{oneOf:[{required:["userId"]},{required:["userEmail"]}]}),{minItems:1,maxItems:vc,description:"Users to add to the team. Each item must include either `userId` or `userEmail`, not both. Duplicate identifiers (including a `userId` and `userEmail` that resolve to the same user) are rejected. Items are processed independently: an unresolved user does not stop other items from being added."})},{description:"Bulk team-membership creation request. Provide one target team and the users to add by ID or email, with a role for each user."}),YG={teamId:"team-123-abc",members:[{userId:"user-123-abc",roleKey:"viewer"},{userEmail:"sam@example.com",roleKey:"editor"}]};Object.assign(Yb,{examples:[YG]});var Vb=t.Object({results:t.Array(t.Object({userId:t.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:t.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."}),VG={results:[{userId:"user-123-abc",status:"added"},{userId:"sam@example.com",status:"user_not_found"}]};Object.assign(Vb,{examples:[VG]});var dIe=d({tags:["access-control"],url:`${kn}/bulk-add`,method:"POST",body:Yb,response:Vb}),fIe=d({tags:["access-control"],url:`${kn}/bulk-update-user-roles`,method:"PUT",body:t.Object({userIds:t.Array(p({allowEmpty:!1}),{minItems:1,maxItems:vc}),teamId:p({allowEmpty:!1}),role:t.Enum(Go)}),response:t.Object({})}),Qb=t.Object({teamId:p({allowEmpty:!1,description:"Team ID to remove the requested users from."}),userIds:t.Optional(t.Array(p({allowEmpty:!1}),{minItems:1,maxItems:vc,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:t.Optional(t.Array(p({allowEmpty:!1,type:"email"}),{minItems:1,maxItems:vc,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."}),QG={teamId:"team-123-abc",userIds:["user-123-abc"]};Object.assign(Qb,{examples:[QG]});var Wb=t.Object({results:t.Array(t.Object({userId:t.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:t.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."}),WG={results:[{userId:"user-123-abc",status:"removed"},{userId:"missing@example.com",status:"user_not_found"}]};Object.assign(Wb,{examples:[WG]});var gIe=d({tags:["access-control"],url:`${kn}/bulk-remove`,method:"DELETE",body:Qb,response:Wb});var Mc="/v0/admin",Le=`${Mc}/clusters`,Xb=t.Object({helmParameters:t.Record(t.String(),t.Union([t.Number(),t.Boolean(),t.Null(),t.String()])),helmVersion:t.String()}),Zb=t.Record(t.String(),Xb),sm=["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"],cm=["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"],pm=["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"],Jb=["aws","gcp","azure"],Ta=["xs","s","m","l"],um=["1.0"],ZG=["tsuga-cluster","tsuga-telemetry","tsuga-deployer","tsuga-events"],Dc=t.Enum(ZG,{description:"Helm installation name identifying a chart component on the cluster."}),XG={id:t.String(),name:t.String(),createdAt:T(),clusterCertificateExpiresAt:T(),bridgeEndpoint:t.String(),deployerEndpoint:t.String(),targetConfiguration:Zb,appliedConfiguration:t.Optional(Zb),automaticallyDeployLatestVersion:t.Boolean(),automatedDeploymentDisabledBy:t.Optional(t.String()),automatedDeploymentDisabledReason:t.Optional(t.String()),automatedDeploymentDisabledAt:t.Optional(T()),soakTimeMin:t.Optional(t.Number()),clusterSize:t.Optional(t.Enum(Ta)),gitSyncByInstallation:t.Record(Dc,t.Boolean(),{description:"Per-installation git-sync state, keyed by installationName."})},im={...XG,orgId:t.String(),orgName:t.String()},bIe=d({tags:["admin"],method:"GET",url:Le,query:t.Object({orgId:t.Optional(p())}),response:t.Array(I("clusterType",[t.Object({...im,clusterType:t.Literal("aws"),clusterAccountId:t.String(),clusterBuilderRoleVersion:t.Optional(t.Enum(um)),clusterRegion:t.Enum(sm)}),t.Object({...im,clusterType:t.Literal("gcp"),clusterAccountId:t.String(),clusterRegion:t.Enum(cm)}),t.Object({...im,clusterType:t.Literal("azure"),clusterTenantId:t.String(),clusterSubscriptionId:t.String(),clusterRegion:t.Enum(pm)})]))}),SIe=d({tags:["admin"],method:"PUT",url:`${Le}/create`,body:I("clusterType",[t.Object({clusterType:t.Literal("aws"),orgId:p(),name:p(),clusterSize:t.Enum(Ta),clusterAccountId:t.String({minLength:12,maxLength:12}),clusterBuilderRoleVersion:t.Enum(um),clusterRegion:t.Enum(sm)}),t.Object({clusterType:t.Literal("gcp"),orgId:p(),name:p(),clusterSize:t.Enum(Ta),clusterAccountId:p(),clusterRegion:t.Enum(cm)}),t.Object({clusterType:t.Literal("azure"),orgId:p(),name:p(),clusterSize:t.Enum(Ta),clusterTenantId:p(),clusterSubscriptionId:p(),clusterRegion:t.Enum(pm)})]),response:t.Object({id:t.String(),bridgeEndpoint:t.String(),deployerEndpoint:t.String()})}),OIe=d({tags:["admin"],method:"DELETE",url:`${Le}/:id`,params:t.Object({id:p()}),body:t.Object({orgId:p()}),response:R}),AIe=d({tags:["admin"],method:"PUT",url:`${Le}/add-inbounder-key`,body:t.Object({orgId:p(),clusterId:p()}),response:t.Object({orgId:t.String(),clusterId:t.String(),inbounderAuthenticationKey:t.String()})}),xIe=d({tags:["admin"],method:"PUT",url:`${Le}/replace-all-inbounder-keys`,body:t.Object({orgId:p(),clusterId:p()}),response:t.Object({orgId:t.String(),clusterId:t.String(),inbounderAuthenticationKey:t.String()})}),RIe=d({tags:["admin"],method:"PUT",url:`${Le}/replace-inbounder-key`,body:t.Object({orgId:p(),clusterId:p(),inbounderAuthenticationKeyToReplace:p()}),response:t.Object({orgId:t.String(),clusterId:t.String(),inbounderAuthenticationKey:t.String()})}),CIe=d({tags:["admin"],method:"PUT",url:`${Le}/delete-inbounder-key`,body:t.Object({orgId:p(),clusterId:p(),inbounderAuthenticationKeyToDelete:p()}),response:t.Object({orgId:t.String(),clusterId:t.String(),isKeyDeleted:t.Boolean()})}),PIe=d({tags:["admin"],method:"PUT",url:`${Le}/rotate-deployer-key`,body:t.Object({orgId:p(),clusterId:p(),newKey:p()}),response:t.Object({orgId:t.String(),clusterId:t.String(),isKeyUpdated:t.Boolean()})}),UIe=d({tags:["admin"],method:"PUT",url:`${Le}/rotate-bridge-key`,body:t.Object({orgId:p(),clusterId:p(),newKey:p()}),response:t.Object({orgId:t.String(),clusterId:t.String(),isKeyUpdated:t.Boolean()})}),am={central:t.String(),ngrokBridgeDomain:t.String(),ngrokDeployerDomain:t.String(),clusterCertificateExpiresAt:T(),clusterName:t.String(),clusterSize:t.Optional(t.Enum(Ta)),secretBridgeAuthenticationKey:t.String(),secretDeployerAuthenticationKey:t.String(),secretOutbounderAuthenticationKey:t.String(),slackChannelEmail:t.String(),customerTier:t.String()},wIe=d({tags:["admin"],method:"POST",url:`${Le}/:id`,body:t.Object({orgId:p()}),params:t.Object({id:p()}),response:I("clusterType",[t.Object({...am,clusterType:t.Literal("aws"),clusterAccountId:t.String(),clusterBuilderRoleVersion:t.Optional(t.Enum(um)),clusterRegion:t.Enum(sm)}),t.Object({...am,clusterType:t.Literal("gcp"),clusterAccountId:t.String(),clusterRegion:t.Enum(cm)}),t.Object({...am,clusterType:t.Literal("azure"),clusterTenantId:t.String(),clusterSubscriptionId:t.String(),clusterRegion:t.Enum(pm)})])}),NIe=d({tags:["admin"],method:"POST",url:`${Le}/configuration`,body:t.Object({id:p({allowEmpty:!1}),orgId:p({allowEmpty:!1}),installationName:Dc,targetConfiguration:Xb,gitSyncEnabled:t.Boolean({description:"Persisted on upgrade: whether this chart's values are synced from git."})}),response:t.Object({status:t.String()})}),LIe=d({tags:["admin"],method:"GET",url:`${Le}/git-values`,query:t.Object({orgId:p({allowEmpty:!1}),clusterId:p({allowEmpty:!1}),installationName:Dc}),response:t.Object({valuesYaml:t.Optional(t.String({description:"Merged git values rendered as YAML. Absent when the cluster/chart has no resolvable values in the repository mirror."})),sha:t.Optional(t.String({description:"Abbreviated commit SHA of the mirrored repository. Absent if not yet successfully fetched (or sync disabled)."}))})}),vIe=d({tags:["admin"],method:"POST",url:`${Le}/git-sync`,body:t.Object({clusterId:p({allowEmpty:!1}),orgId:p({allowEmpty:!1}),installationName:Dc,gitSyncEnabled:t.Boolean({description:"Whether this chart syncs its Helm values from git."})}),response:t.Object({status:t.String()})}),kIe=d({tags:["admin"],method:"POST",url:`${Le}/automation`,body:t.Object({id:p(),orgId:p(),enableAutomatedDeployment:t.Boolean(),disabledReason:t.Optional(p())}),response:t.Object({status:t.String()})}),MIe=d({tags:["admin"],method:"POST",url:`${Le}/soak-time`,body:t.Object({id:p(),orgId:p(),soakTimeMin:t.Optional(t.Number())}),response:t.Object({status:t.String()})}),DIe=d({tags:["admin"],method:"POST",url:`${Le}/deploy`,body:t.Object({orgId:p(),clusterId:p(),chartName:p(),toVersion:p()}),response:t.Object({id:t.String()})}),JG=I("type",[t.Object({type:t.Literal("pending")}),t.Object({type:t.Literal("running")}),t.Object({type:t.Literal("cancelled")}),t.Object({type:t.Literal("timed_out")}),t.Object({type:t.Literal("success"),stateValue:t.Object({message:t.String()})}),t.Object({type:t.Literal("failure"),stateValue:t.Object({message:t.String()})})]),GIe=d({tags:["admin"],method:"GET",url:`${Le}/deploy`,query:t.Object({orgId:t.Optional(p()),clusterId:t.Optional(p())}),response:t.Array(t.Object({id:t.String(),orgId:t.String(),orgName:t.String(),clusterId:t.String(),clusterName:t.String(),fromVersion:t.Optional(t.String()),toVersion:t.String(),state:JG,updatedAt:T(),createdAt:T(),installationName:t.String(),chartName:t.String(),isAutomated:t.Boolean(),createdBy:t.Optional(t.String()),createdByName:t.Optional(t.String()),createdByEmail:t.Optional(t.String())}))}),e$=t.Object({installations:t.Array(t.Object({installationName:t.String(),parameters:t.Record(t.String(),t.Union([t.Number(),t.Boolean(),t.Null(),t.String()])),version:t.Union([t.String(),t.Null()]),resources:t.Array(t.Object({id:t.Object({kind:t.String(),name:t.String()}),status:t.String(),health:t.String(),rawDetails:t.Optional(t.Any()),liveManifest:t.Optional(t.String()),targetManifest:t.Optional(t.String())})),deployedAt:t.Optional(t.String()),syncStatus:t.Optional(t.String()),healthStatus:t.Optional(t.String())}))}),$Ie=d({tags:["admin"],method:"POST",url:`${Le}/status`,body:t.Object({orgId:t.Optional(p()),clusterId:t.Optional(p())}),response:t.Array(t.Object({orgId:t.String(),clusterId:t.String(),status:e$}))}),jIe=d({tags:["admin"],method:"POST",url:`${Le}/argocd-cert-info`,body:t.Object({orgId:p(),clusterId:p()}),response:t.Object({certificateExpiresAt:t.String()})}),t$=t.Object({kind:t.String(),name:t.String()}),r$=t.Object({id:t$,liveManifest:t.Optional(t.String()),targetManifest:t.Optional(t.String())}),qIe=d({tags:["admin"],method:"POST",url:`${Le}/resource-details`,body:t.Object({orgId:p(),clusterId:p(),installationName:p()}),response:t.Object({resources:t.Array(r$)})}),BIe=d({tags:["admin"],method:"GET",url:`${Le}/versions`,query:t.Object({chartName:t.Optional(p())}),response:t.Array(t.Object({id:t.String(),chartName:t.String(),locator:t.String(),version:t.String(),repositoryArn:t.String(),type:t.Optional(t.String()),commitHash:t.Optional(t.String()),lastPulledAt:t.Optional(T()),pushedAt:t.Optional(T())}))});var n$=t.Object({id:t.Object({name:t.String(),kind:t.String()}),previewManifest:t.Optional(t.String())}),FIe=d({tags:["admin"],method:"POST",url:`${Le}/versions/render`,body:t.Object({chartName:p(),version:p(),values:p({type:"long"}),installationName:p(),namespace:p()}),response:t.Array(n$)}),Tr=`${Mc}/orgs`,HIe=d({tags:["admin"],url:Tr,method:"GET",query:t.Object({onlyDeleted:t.Optional(t.Boolean())}),response:t.Array(t.Object({id:t.String(),name:t.String(),allowedDomains:t.Array(t.String()),createdAt:T(),updatedAt:T()}))}),KIe=d({tags:["admin"],url:Tr,method:"POST",body:t.Object({emailDomains:t.Array(p({type:"lowercase-domain"}),{maxItems:20}),name:p()}),response:t.Object({id:t.String(),name:t.String()})}),zIe=d({tags:["admin"],url:`${Tr}/:id`,method:"PUT",params:t.Object({id:p()}),body:t.Object({allowedDomains:t.Optional(t.Array(p({type:"lowercase-domain"}),{maxItems:20}))}),response:t.Object({id:t.String(),name:t.String(),allowedDomains:t.Array(t.String())})}),YIe=d({tags:["admin"],url:`${Tr}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),VIe=d({tags:["admin"],url:`${Tr}/:id/restore`,method:"POST",params:t.Object({id:p()}),response:t.Object({success:t.Boolean()})}),QIe=d({tags:["admin"],url:`${Tr}/:id/permanent-delete`,method:"DELETE",params:t.Object({id:p()}),response:t.Object({success:t.Boolean(),hasDeletedSecret:t.Boolean(),hasDeletedTenantDb:t.Boolean(),hasDeletedOrgRow:t.Boolean()})}),WIe=d({tags:["admin"],url:`${Tr}/synchronize-sds-rules`,method:"POST",response:t.Object({errorOrgs:t.Optional(t.Array(t.Object({id:t.String(),name:t.String()}))),synchronizedOrgsCount:t.Number()})}),o$=["custom_usage_tag","ingestion_api_key","inventory_resource","monitor","retention_policy","route","sensitive_data_scanner_rule","tag_policy","team"],i$=t.Enum(o$),ZIe=d({tags:["admin"],url:`${Tr}/refresh-assets`,method:"POST",body:t.Object({assetTypes:t.Array(i$,{minItems:1}),orgId:t.Optional(p({allowEmpty:!1}))}),response:t.Array(t.Object({orgId:t.String(),orgName:t.String(),results:t.Record(t.String(),t.Object({success:t.Boolean()}))}))}),XIe=d({tags:["admin"],url:`${Tr}/sudo`,method:"POST",body:t.Object({orgId:p()}),response:t.Object({sudoToken:t.String()})}),a$=`${Mc}/users`,JIe=d({tags:["admin"],url:`${a$}/invite`,method:"POST",body:t.Object({email:p({type:"email"}),orgId:p(),userRole:t.Enum(kc)}),response:t.Array(t.Object({inviteId:t.String(),email:t.String(),result:t.Union([t.Literal("success"),t.Literal("email-failed")])}))});var ebe=d({tags:["admin"],url:`${Mc}/billing-data`,method:"GET",query:t.Object({orgId:p(),maxDaysFetched:t.Optional(t.Number({minimum:1,maximum:365}))}),response:t.Object({dataPoints:t.Array(t.Object({date:t.String(),telemetryKind:t.Union([t.Literal("logs"),t.Literal("metrics"),t.Literal("rum"),t.Literal("traces")]),totalBytes:t.Number(),clusterId:t.String(),apiKeyId:t.String(),apiKeyName:t.String(),teamName:t.String()})),availableFilters:t.Object({clusters:t.Array(t.Object({id:t.String(),name:t.String()})),apiKeys:t.Array(t.Object({id:t.String(),name:t.String()})),teamNames:t.Array(t.String())})})});var eS=t.Object({id:t.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:t.String({description:"Cluster name stored in Tsuga. Usable as a display label when `friendlyName` is not set."}),friendlyName:t.Optional(t.String({description:"Human-readable display name for the cluster. Present when a friendly name is configured."})),clusterType:t.Enum(Jb,{description:"Cloud provider selected for the Tsuga cluster."}),clusterRegion:t.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`."}),s$={id:"abc-123-def",name:"production",friendlyName:"Production (US)",clusterType:"aws",clusterRegion:"us-east-1"};Object.assign(eS,{examples:[s$]});var tS=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:t.Array(eS)});function rS(e,r){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 r()(tS);W(o)})}function oS(e,r,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(r.join(" "),{cmds:i,flags:[...a,"--help"]});for(let c of e.commands)c.name().startsWith("__")||oS(c,[...r,c.name()],n,o)}function c$(e){let r=new Map,n=new Set;return oS(e,[],r,n),{rows:[...r].map(([i,{cmds:a,flags:c}])=>({key:i,cmds:[...new Set(a)].join(" "),flags:[...new Set(c)].join(" ")})),valueFlags:[...n].join(" ")}}function nS(e){return e.map(({key:r,cmds:n,flags:o})=>` ${JSON.stringify(r)}) cmds=${JSON.stringify(n)} flags=${JSON.stringify(o)} ;;`).join(`
|
|
42
|
-
`)}function
|
|
39
|
+
`}function Vb(){if((0,Gt.existsSync)(rm))try{return JSON.parse((0,Gt.readFileSync)(rm,"utf-8")).lastUpdateCheck}catch{return}}function Qb(e){(0,Gt.mkdirSync)(Gb,{recursive:!0,mode:448}),(0,Gt.writeFileSync)(rm,`${JSON.stringify({lastUpdateCheck:e})}
|
|
40
|
+
`,{mode:384})}async function e$(){let e=Do(),{verifier:r,challenge:n}=rg(),o=(0,Wb.randomBytes)(16).toString("base64url"),{code:i,redirectUri:a}=await dg({state:o,buildAuthorizeUrl:m=>Nb(e,{redirectUri:m,challenge:n,state:o})}),c=await Lb(e,{code:i,verifier:r,redirectUri:a});qb(Jf(c)),B(`Logged in. Session token ${xi(c.accessToken)} saved to ${Ta()}`)}function t$(){let e=Do(),r=jb();if(!r){let n=e===ga?"":` for ${e}`;process.stderr.write(`No user session${n}. Run \`tsuga auth login\`.
|
|
41
|
+
`),process.exitCode=1;return}if(Ds({kind:"user-session",userAuth:r},new Date)){process.stderr.write("Your session expired. Run `tsuga auth login` to sign in again.\n"),process.exitCode=1;return}B(r.accessToken)}function r$(){let{credential:e}=Go({});if(!e){B("Not authenticated. Run `tsuga auth login` or `tsuga auth operation-key <key>`.");return}switch(e.kind){case"user-session":B(`Logged in as a user (token ${xi(e.userAuth.accessToken)}, expires ${e.userAuth.accessExpiresAt}).`);return;case"operation-api-key":B("Authenticated with an operation API key.");return;default:Ze(e)}}function n$(){Fb(),B("Local user session cleared.")}function Zb(e){let r=e.command("auth").description("Manage authentication: user login (OAuth) or operation API key");r.action(()=>r.help()),r.command("login").description("Log in as a user with a browser authorization flow and save the session").action(e$),r.command("logout").description("Clear the saved user session").action(n$),r.command("token").description("Print the saved user access token to stdout").action(t$),r.command("operation-key <operation-api-key>").description("Save an operation API key to the config file").action(n=>{Bb(n),B(`Operation API key saved to ${Ta()}`)}),r.command("status").description("Show the current authentication method").action(r$)}var o$=["allowed-domains","cluster-integration-config","custom-usage-tag","database","databricks-connection","explorer-saved-view","host","inventory","monitor-alert","monitor-debugging","oauth-grant","org","retention-policy","saml-config","sensitive-data-scanner-rule","service","service-target","team-remap-config","user-self","widget-share"],i$=["adaptive-notification-rule","audit-log","cloud-account","dashboard-folder","dashboard-report","dashboard","ingestion-api-key","investigation","log-route","metric-route","monitor","notification-integration","notification-rule","notification-silence","operation-api-key","quality-report","rum-public-token","slo","tag-policy","team-members","team","user-data","user-invitation","user-permissions"],a$=["log","metric","trace","rum"],s$=[...i$,...a$],CIe=[...o$,...s$];var Mc=["admin","public_editor","public_viewer","teams_only"],$o=["admin","editor","viewer"];var Mn="/v0/team-membership",am="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.",sm=t.Object({id:t.String({description:"Tsuga-generated team membership ID assigned when the membership is created."}),userId:t.String({description:"User ID that belongs to the team."}),teamId:t.String({description:"Team ID that contains the user."}),roleKey:t.Enum($o,{description:am})}),Xb=t.Object({userId:p({allowEmpty:!1,description:"User ID to add to or update in the team."}),teamId:p({allowEmpty:!1,description:"Team ID receiving the membership change."}),roleKey:t.Enum($o,{description:am})}),c$=t.Object({userId:p({allowEmpty:!1,description:"User ID to remove from the team."}),teamId:p({allowEmpty:!1,description:"Team ID to remove the user from."})}),p$=t.Optional(t.Object({userId:t.Optional(p({allowEmpty:!1,description:"Restrict results to memberships for this user ID."})),teamId:t.Optional(p({allowEmpty:!1,description:"Restrict results to memberships for this team ID."}))})),PIe=l({tags:["access-control"],url:Mn,method:"GET",query:p$,response:t.Array(sm)}),UIe=l({tags:["access-control"],url:Mn,method:"POST",body:Xb,response:sm}),wIe=l({tags:["access-control"],url:Mn,method:"PUT",body:Xb,response:sm}),NIe=l({tags:["access-control"],url:Mn,method:"DELETE",body:c$,response:R}),kc=500,Jb=t.Object({teamId:p({allowEmpty:!1,description:"Team ID receiving all requested memberships."}),members:t.Array(t.Object({userId:t.Optional(p({allowEmpty:!1,description:"Existing user ID to add to the team."})),userEmail:t.Optional(p({allowEmpty:!1,type:"email",description:"Existing user email to resolve and add to the team."})),roleKey:t.Enum($o,{description:am})},{oneOf:[{required:["userId"]},{required:["userEmail"]}]}),{minItems:1,maxItems:kc,description:"Users to add to the team. Each item must include either `userId` or `userEmail`, not both. Duplicate identifiers (including a `userId` and `userEmail` that resolve to the same user) are rejected. Items are processed independently: an unresolved user does not stop other items from being added."})},{description:"Bulk team-membership creation request. Provide one target team and the users to add by ID or email, with a role for each user."}),u$={teamId:"team-123-abc",members:[{userId:"user-123-abc",roleKey:"viewer"},{userEmail:"sam@example.com",roleKey:"editor"}]};Object.assign(Jb,{examples:[u$]});var eS=t.Object({results:t.Array(t.Object({userId:t.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:t.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."}),m$={results:[{userId:"user-123-abc",status:"added"},{userId:"sam@example.com",status:"user_not_found"}]};Object.assign(eS,{examples:[m$]});var LIe=l({tags:["access-control"],url:`${Mn}/bulk-add`,method:"POST",body:Jb,response:eS}),vIe=l({tags:["access-control"],url:`${Mn}/bulk-update-user-roles`,method:"PUT",body:t.Object({userIds:t.Array(p({allowEmpty:!1}),{minItems:1,maxItems:kc}),teamId:p({allowEmpty:!1}),role:t.Enum($o)}),response:t.Object({})}),tS=t.Object({teamId:p({allowEmpty:!1,description:"Team ID to remove the requested users from."}),userIds:t.Optional(t.Array(p({allowEmpty:!1}),{minItems:1,maxItems:kc,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:t.Optional(t.Array(p({allowEmpty:!1,type:"email"}),{minItems:1,maxItems:kc,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."}),l$={teamId:"team-123-abc",userIds:["user-123-abc"]};Object.assign(tS,{examples:[l$]});var rS=t.Object({results:t.Array(t.Object({userId:t.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:t.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."}),d$={results:[{userId:"user-123-abc",status:"removed"},{userId:"missing@example.com",status:"user_not_found"}]};Object.assign(rS,{examples:[d$]});var kIe=l({tags:["access-control"],url:`${Mn}/bulk-remove`,method:"DELETE",body:tS,response:rS});var f$=["logs","metrics","traces","llm-obs","profiling","analytics","dashboards","ongoing-alerts","slo","monitor","notification-rules","notification-silences","notification-integrations","investigations","routes","sensitive-data-scanner","inventory","services","rum","sessions","host-catalog","kubernetes"],nS=t.Enum(f$,{description:"Stable nav item key within a main sidebar category."}),oS=t.Array(nS,{description:"Nav item keys shown in the primary sidebar for this category, in display order."}),iS=t.Optional(t.Array(nS,{description:"Nav item keys for this category that are folded away (e.g. View more). Omitted or empty means none."})),aS="Stable category id. Unknown or renamed ids are ignored by the client catalog.",sS="Sidebar categories in display order. Unknown or renamed ids are ignored by the client catalog.",cm=t.Object({categories:t.Array(t.Object({id:t.String({description:aS}),visible:oS,folded:iS}),{description:sS})}),cS=t.Object({categories:t.Array(t.Object({id:p({allowEmpty:!1,description:aS}),visible:oS,folded:iS}),{description:sS})});var Dc="/v0/org",g$=`${Dc}/current-user`,pS=`${Dc}/settings`,uS=`${Dc}/allowed-domains`,Gc=50,mS=t.Object({id:t.String(),name:t.String(),createdAt:T(),allowedDomains:t.Array(t.String(),{description:"Email domains whose users are allowed to join the account, via invitation or SSO/SAML just-in-time provisioning. Domains are stored in lowercase."}),enableLlmFeatures:t.Boolean(),allowEmailPasswordLogin:t.Boolean()}),lS=t.Object({allowedDomains:t.Array(p({allowEmpty:!1,type:"lowercase-domain",description:'A lowercase email domain (e.g. "acme.com").'}),{maxItems:Gc,description:"The new full list of email domains whose users are allowed to join the account via invitation or SSO/SAML just-in-time provisioning. Replaces the existing list; omitted domains are no longer allowed."})}),dS=t.Pick(mS,["allowedDomains"]),HIe=l({tags:["organization"],url:g$,method:"GET",response:mS}),KIe=l({tags:["organization"],url:pS,method:"GET",response:t.Object({enableLlmFeatures:t.Boolean(),allowEmailPasswordLogin:t.Boolean(),sidebarNavLayout:t.Optional(cm)})}),zIe=l({tags:["organization"],url:pS,method:"PUT",body:t.Object({enableLlmFeatures:t.Optional(t.Boolean()),allowEmailPasswordLogin:t.Optional(t.Boolean()),sidebarNavLayout:t.Optional(t.Union([cS,t.Null()]))}),response:t.Object({enableLlmFeatures:t.Boolean(),allowEmailPasswordLogin:t.Boolean(),sidebarNavLayout:t.Optional(cm)})}),YIe=l({tags:["organization"],url:Dc,method:"PUT",body:lS,response:t.Object({allowedDomains:t.Array(t.String())})}),VIe=l({tags:["organization"],url:uS,method:"GET",response:dS}),QIe=l({tags:["organization"],url:uS,method:"PUT",body:lS,response:dS});var $c="/v0/admin",Le=`${$c}/clusters`,gS=t.Object({helmParameters:t.Record(t.String(),t.Union([t.Number(),t.Boolean(),t.Null(),t.String()])),helmVersion:t.String()}),fS=t.Record(t.String(),gS),mm=["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"],lm=["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"],dm=["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"],yS=["aws","gcp","azure"],Ea=["xs","s","m","l"],fm=["1.0"],y$=["tsuga-cluster","tsuga-telemetry","tsuga-deployer","tsuga-events"],jc=t.Enum(y$,{description:"Helm installation name identifying a chart component on the cluster."}),h$={id:t.String(),name:t.String(),createdAt:T(),clusterCertificateExpiresAt:T(),bridgeEndpoint:t.String(),deployerEndpoint:t.String(),targetConfiguration:fS,appliedConfiguration:t.Optional(fS),automaticallyDeployLatestVersion:t.Boolean(),automatedDeploymentDisabledBy:t.Optional(t.String()),automatedDeploymentDisabledReason:t.Optional(t.String()),automatedDeploymentDisabledAt:t.Optional(T()),soakTimeMin:t.Optional(t.Number()),clusterSize:t.Optional(t.Enum(Ea)),gitSyncByInstallation:t.Record(jc,t.Boolean(),{description:"Per-installation git-sync state, keyed by installationName."})},pm={...h$,orgId:t.String(),orgName:t.String()},nbe=l({tags:["admin"],method:"GET",url:Le,query:t.Object({orgId:t.Optional(p())}),response:t.Array(I("clusterType",[t.Object({...pm,clusterType:t.Literal("aws"),clusterAccountId:t.String(),clusterBuilderRoleVersion:t.Optional(t.Enum(fm)),clusterRegion:t.Enum(mm)}),t.Object({...pm,clusterType:t.Literal("gcp"),clusterAccountId:t.String(),clusterRegion:t.Enum(lm)}),t.Object({...pm,clusterType:t.Literal("azure"),clusterTenantId:t.String(),clusterSubscriptionId:t.String(),clusterRegion:t.Enum(dm)})]))}),obe=l({tags:["admin"],method:"PUT",url:`${Le}/create`,body:I("clusterType",[t.Object({clusterType:t.Literal("aws"),orgId:p(),name:p(),clusterSize:t.Enum(Ea),clusterAccountId:t.String({minLength:12,maxLength:12}),clusterBuilderRoleVersion:t.Enum(fm),clusterRegion:t.Enum(mm)}),t.Object({clusterType:t.Literal("gcp"),orgId:p(),name:p(),clusterSize:t.Enum(Ea),clusterAccountId:p(),clusterRegion:t.Enum(lm)}),t.Object({clusterType:t.Literal("azure"),orgId:p(),name:p(),clusterSize:t.Enum(Ea),clusterTenantId:p(),clusterSubscriptionId:p(),clusterRegion:t.Enum(dm)})]),response:t.Object({id:t.String(),bridgeEndpoint:t.String(),deployerEndpoint:t.String()})}),ibe=l({tags:["admin"],method:"DELETE",url:`${Le}/:id`,params:t.Object({id:p()}),body:t.Object({orgId:p()}),response:R}),abe=l({tags:["admin"],method:"PUT",url:`${Le}/add-inbounder-key`,body:t.Object({orgId:p(),clusterId:p()}),response:t.Object({orgId:t.String(),clusterId:t.String(),inbounderAuthenticationKey:t.String()})}),sbe=l({tags:["admin"],method:"PUT",url:`${Le}/replace-all-inbounder-keys`,body:t.Object({orgId:p(),clusterId:p()}),response:t.Object({orgId:t.String(),clusterId:t.String(),inbounderAuthenticationKey:t.String()})}),cbe=l({tags:["admin"],method:"PUT",url:`${Le}/replace-inbounder-key`,body:t.Object({orgId:p(),clusterId:p(),inbounderAuthenticationKeyToReplace:p()}),response:t.Object({orgId:t.String(),clusterId:t.String(),inbounderAuthenticationKey:t.String()})}),pbe=l({tags:["admin"],method:"PUT",url:`${Le}/delete-inbounder-key`,body:t.Object({orgId:p(),clusterId:p(),inbounderAuthenticationKeyToDelete:p()}),response:t.Object({orgId:t.String(),clusterId:t.String(),isKeyDeleted:t.Boolean()})}),ube=l({tags:["admin"],method:"PUT",url:`${Le}/rotate-deployer-key`,body:t.Object({orgId:p(),clusterId:p(),newKey:p()}),response:t.Object({orgId:t.String(),clusterId:t.String(),isKeyUpdated:t.Boolean()})}),mbe=l({tags:["admin"],method:"PUT",url:`${Le}/rotate-bridge-key`,body:t.Object({orgId:p(),clusterId:p(),newKey:p()}),response:t.Object({orgId:t.String(),clusterId:t.String(),isKeyUpdated:t.Boolean()})}),um={central:t.String(),ngrokBridgeDomain:t.String(),ngrokDeployerDomain:t.String(),clusterCertificateExpiresAt:T(),clusterName:t.String(),clusterSize:t.Optional(t.Enum(Ea)),secretBridgeAuthenticationKey:t.String(),secretDeployerAuthenticationKey:t.String(),secretOutbounderAuthenticationKey:t.String(),slackChannelEmail:t.String(),customerTier:t.String()},lbe=l({tags:["admin"],method:"POST",url:`${Le}/:id`,body:t.Object({orgId:p()}),params:t.Object({id:p()}),response:I("clusterType",[t.Object({...um,clusterType:t.Literal("aws"),clusterAccountId:t.String(),clusterBuilderRoleVersion:t.Optional(t.Enum(fm)),clusterRegion:t.Enum(mm)}),t.Object({...um,clusterType:t.Literal("gcp"),clusterAccountId:t.String(),clusterRegion:t.Enum(lm)}),t.Object({...um,clusterType:t.Literal("azure"),clusterTenantId:t.String(),clusterSubscriptionId:t.String(),clusterRegion:t.Enum(dm)})])}),dbe=l({tags:["admin"],method:"POST",url:`${Le}/configuration`,body:t.Object({id:p({allowEmpty:!1}),orgId:p({allowEmpty:!1}),installationName:jc,targetConfiguration:gS,gitSyncEnabled:t.Boolean({description:"Persisted on upgrade: whether this chart's values are synced from git."})}),response:t.Object({status:t.String()})}),fbe=l({tags:["admin"],method:"GET",url:`${Le}/git-values`,query:t.Object({orgId:p({allowEmpty:!1}),clusterId:p({allowEmpty:!1}),installationName:jc}),response:t.Object({valuesYaml:t.Optional(t.String({description:"Merged git values rendered as YAML. Absent when the cluster/chart has no resolvable values in the repository mirror."})),sha:t.Optional(t.String({description:"Abbreviated commit SHA of the mirrored repository. Absent if not yet successfully fetched (or sync disabled)."}))})}),gbe=l({tags:["admin"],method:"POST",url:`${Le}/git-sync`,body:t.Object({clusterId:p({allowEmpty:!1}),orgId:p({allowEmpty:!1}),installationName:jc,gitSyncEnabled:t.Boolean({description:"Whether this chart syncs its Helm values from git."})}),response:t.Object({status:t.String()})}),ybe=l({tags:["admin"],method:"POST",url:`${Le}/automation`,body:t.Object({id:p(),orgId:p(),enableAutomatedDeployment:t.Boolean(),disabledReason:t.Optional(p())}),response:t.Object({status:t.String()})}),hbe=l({tags:["admin"],method:"POST",url:`${Le}/soak-time`,body:t.Object({id:p(),orgId:p(),soakTimeMin:t.Optional(t.Number())}),response:t.Object({status:t.String()})}),Tbe=l({tags:["admin"],method:"POST",url:`${Le}/deploy`,body:t.Object({orgId:p(),clusterId:p(),chartName:p(),toVersion:p()}),response:t.Object({id:t.String()})}),T$=I("type",[t.Object({type:t.Literal("pending")}),t.Object({type:t.Literal("running")}),t.Object({type:t.Literal("cancelled")}),t.Object({type:t.Literal("timed_out")}),t.Object({type:t.Literal("success"),stateValue:t.Object({message:t.String()})}),t.Object({type:t.Literal("failure"),stateValue:t.Object({message:t.String()})})]),Ebe=l({tags:["admin"],method:"GET",url:`${Le}/deploy`,query:t.Object({orgId:t.Optional(p()),clusterId:t.Optional(p())}),response:t.Array(t.Object({id:t.String(),orgId:t.String(),orgName:t.String(),clusterId:t.String(),clusterName:t.String(),fromVersion:t.Optional(t.String()),toVersion:t.String(),state:T$,updatedAt:T(),createdAt:T(),installationName:t.String(),chartName:t.String(),isAutomated:t.Boolean(),createdBy:t.Optional(t.String()),createdByName:t.Optional(t.String()),createdByEmail:t.Optional(t.String())}))}),E$=t.Object({installations:t.Array(t.Object({installationName:t.String(),parameters:t.Record(t.String(),t.Union([t.Number(),t.Boolean(),t.Null(),t.String()])),version:t.Union([t.String(),t.Null()]),resources:t.Array(t.Object({id:t.Object({kind:t.String(),name:t.String()}),status:t.String(),health:t.String(),rawDetails:t.Optional(t.Any()),liveManifest:t.Optional(t.String()),targetManifest:t.Optional(t.String())})),deployedAt:t.Optional(t.String()),syncStatus:t.Optional(t.String()),healthStatus:t.Optional(t.String())}))}),_be=l({tags:["admin"],method:"POST",url:`${Le}/status`,body:t.Object({orgId:t.Optional(p()),clusterId:t.Optional(p())}),response:t.Array(t.Object({orgId:t.String(),clusterId:t.String(),status:E$}))}),Ibe=l({tags:["admin"],method:"POST",url:`${Le}/argocd-cert-info`,body:t.Object({orgId:p(),clusterId:p()}),response:t.Object({certificateExpiresAt:t.String()})}),_$=t.Object({kind:t.String(),name:t.String()}),I$=t.Object({id:_$,liveManifest:t.Optional(t.String()),targetManifest:t.Optional(t.String())}),bbe=l({tags:["admin"],method:"POST",url:`${Le}/resource-details`,body:t.Object({orgId:p(),clusterId:p(),installationName:p()}),response:t.Object({resources:t.Array(I$)})}),Sbe=l({tags:["admin"],method:"GET",url:`${Le}/versions`,query:t.Object({chartName:t.Optional(p())}),response:t.Array(t.Object({id:t.String(),chartName:t.String(),locator:t.String(),version:t.String(),repositoryArn:t.String(),type:t.Optional(t.String()),commitHash:t.Optional(t.String()),author:t.Optional(t.String()),lastPulledAt:t.Optional(T()),pushedAt:t.Optional(T())}))});var b$=t.Object({id:t.Object({name:t.String(),kind:t.String()}),previewManifest:t.Optional(t.String())}),Obe=l({tags:["admin"],method:"POST",url:`${Le}/versions/render`,body:t.Object({chartName:p(),version:p(),values:p({type:"long"}),installationName:p(),namespace:p()}),response:t.Array(b$)}),Er=`${$c}/orgs`,Abe=l({tags:["admin"],url:Er,method:"GET",query:t.Object({onlyDeleted:t.Optional(t.Boolean())}),response:t.Array(t.Object({id:t.String(),name:t.String(),allowedDomains:t.Array(t.String()),createdAt:T(),updatedAt:T()}))}),xbe=l({tags:["admin"],url:Er,method:"POST",body:t.Object({allowedDomains:t.Array(p({type:"lowercase-domain"}),{maxItems:Gc}),name:p()}),response:t.Object({id:t.String(),name:t.String()})}),Rbe=l({tags:["admin"],url:`${Er}/:id`,method:"PUT",params:t.Object({id:p()}),body:t.Object({allowedDomains:t.Optional(t.Array(p({type:"lowercase-domain"}),{maxItems:Gc}))}),response:t.Object({id:t.String(),name:t.String(),allowedDomains:t.Array(t.String())})}),Cbe=l({tags:["admin"],url:`${Er}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),Pbe=l({tags:["admin"],url:`${Er}/:id/restore`,method:"POST",params:t.Object({id:p()}),response:t.Object({success:t.Boolean()})}),Ube=l({tags:["admin"],url:`${Er}/:id/permanent-delete`,method:"DELETE",params:t.Object({id:p()}),response:t.Object({success:t.Boolean(),hasDeletedSecret:t.Boolean(),hasDeletedTenantDb:t.Boolean(),hasDeletedOrgRow:t.Boolean()})}),wbe=l({tags:["admin"],url:`${Er}/synchronize-sds-rules`,method:"POST",response:t.Object({errorOrgs:t.Optional(t.Array(t.Object({id:t.String(),name:t.String()}))),synchronizedOrgsCount:t.Number()})}),S$=["custom_usage_tag","ingestion_api_key","inventory_resource","monitor","retention_policy","route","sensitive_data_scanner_rule","tag_policy","team"],O$=t.Enum(S$),Nbe=l({tags:["admin"],url:`${Er}/refresh-assets`,method:"POST",body:t.Object({assetTypes:t.Array(O$,{minItems:1}),orgId:t.Optional(p({allowEmpty:!1}))}),response:t.Array(t.Object({orgId:t.String(),orgName:t.String(),results:t.Record(t.String(),t.Object({success:t.Boolean()}))}))}),Lbe=l({tags:["admin"],url:`${Er}/sudo`,method:"POST",body:t.Object({orgId:p()}),response:t.Object({sudoToken:t.String()})}),A$=`${$c}/users`,vbe=l({tags:["admin"],url:`${A$}/invite`,method:"POST",body:t.Object({email:p({type:"email"}),orgId:p(),userRole:t.Enum(Mc)}),response:t.Array(t.Object({inviteId:t.String(),email:t.String(),result:t.Union([t.Literal("success"),t.Literal("email-failed")])}))});var kbe=l({tags:["admin"],url:`${$c}/billing-data`,method:"GET",query:t.Object({orgId:p(),maxDaysFetched:t.Optional(t.Number({minimum:1,maximum:365}))}),response:t.Object({dataPoints:t.Array(t.Object({date:t.String(),telemetryKind:t.Union([t.Literal("logs"),t.Literal("metrics"),t.Literal("rum"),t.Literal("traces")]),totalBytes:t.Number(),clusterId:t.String(),apiKeyId:t.String(),apiKeyName:t.String(),teamName:t.String()})),availableFilters:t.Object({clusters:t.Array(t.Object({id:t.String(),name:t.String()})),apiKeys:t.Array(t.Object({id:t.String(),name:t.String()})),teamNames:t.Array(t.String())})})});var hS=t.Object({id:t.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:t.String({description:"Cluster name stored in Tsuga. Usable as a display label when `friendlyName` is not set."}),friendlyName:t.Optional(t.String({description:"Human-readable display name for the cluster. Present when a friendly name is configured."})),clusterType:t.Enum(yS,{description:"Cloud provider selected for the Tsuga cluster."}),clusterRegion:t.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`."}),x$={id:"abc-123-def",name:"production",friendlyName:"Production (US)",clusterType:"aws",clusterRegion:"us-east-1"};Object.assign(hS,{examples:[x$]});var TS=l({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:t.Array(hS)});function ES(e,r){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 r()(TS);Q(o)})}function IS(e,r,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(r.join(" "),{cmds:i,flags:[...a,"--help"]});for(let c of e.commands)c.name().startsWith("__")||IS(c,[...r,c.name()],n,o)}function R$(e){let r=new Map,n=new Set;return IS(e,[],r,n),{rows:[...r].map(([i,{cmds:a,flags:c}])=>({key:i,cmds:[...new Set(a)].join(" "),flags:[...new Set(c)].join(" ")})),valueFlags:[...n].join(" ")}}function _S(e){return e.map(({key:r,cmds:n,flags:o})=>` ${JSON.stringify(r)}) cmds=${JSON.stringify(n)} flags=${JSON.stringify(o)} ;;`).join(`
|
|
42
|
+
`)}function C$(e,r){return`_tsuga_complete() {
|
|
43
43
|
local cur key cmds flags words i word prev
|
|
44
44
|
local valueflags="${r}"
|
|
45
45
|
local -a path
|
|
@@ -60,7 +60,7 @@ ${e}
|
|
|
60
60
|
COMPREPLY=( $(compgen -W "$words" -- "$cur") )
|
|
61
61
|
}
|
|
62
62
|
complete -F _tsuga_complete tsuga
|
|
63
|
-
`}function
|
|
63
|
+
`}function P$(e,r){return`#compdef tsuga
|
|
64
64
|
_tsuga_complete() {
|
|
65
65
|
local cur key cmds flags out i word prev
|
|
66
66
|
local valueflags="${r}"
|
|
@@ -82,10 +82,10 @@ ${e}
|
|
|
82
82
|
compadd -- \${=out}
|
|
83
83
|
}
|
|
84
84
|
compdef _tsuga_complete tsuga
|
|
85
|
-
`}function
|
|
86
|
-
set cmds ${
|
|
87
|
-
set flags ${
|
|
88
|
-
`)}function
|
|
85
|
+
`}function gm(e){return`'${e.replace(/\\/g,"\\\\").replace(/'/g,"\\'")}'`}function U$(e){return e.map(({key:r,cmds:n,flags:o})=>` case ${gm(r)}
|
|
86
|
+
set cmds ${gm(n)}
|
|
87
|
+
set flags ${gm(o)}`).join(`
|
|
88
|
+
`)}function w$(e,r){return`# Update with: tsuga completion fish > ~/.config/fish/completions/tsuga.fish
|
|
89
89
|
function __tsuga_complete
|
|
90
90
|
set -l valueflags -- ${r}
|
|
91
91
|
set -l tokens (commandline -xpc)
|
|
@@ -120,50 +120,50 @@ ${e}
|
|
|
120
120
|
end
|
|
121
121
|
end
|
|
122
122
|
complete -c tsuga -f -a '(__tsuga_complete)'
|
|
123
|
-
`}function
|
|
123
|
+
`}function bS(e){e.command("completion <shell>").description("Print a shell completion script (bash, zsh, or fish)").addHelpText("after",`
|
|
124
124
|
Usage:
|
|
125
125
|
bash: eval "$(tsuga completion bash)" # add to ~/.bashrc
|
|
126
126
|
zsh: eval "$(tsuga completion zsh)" # add to ~/.zshrc
|
|
127
|
-
fish: tsuga completion fish > ~/.config/fish/completions/tsuga.fish`).action(r=>{let{rows:n,valueFlags:o}=
|
|
128
|
-
...`};Object.assign(cS,{examples:[d$]});var pS=t.Object({kind:t.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:t.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:t.String({description:'Title of the result (e.g. "How to Add Resource Attributes" or "POST /v1/aggregation/multi-query/scalar")'}),subsection:t.Optional(t.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:t.Optional(t.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:t.Optional(t.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:t.Number({description:"Relevance score between 0 and 1 (higher is more relevant)"}),excerpt:t.String({description:"Short snippet of matching content"}),link:t.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"}),f$={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(pS,{examples:[f$]});var uS=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:sS,method:"GET",query:t.Object({path:p({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:cS}),mS=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:`${sS}/search`,method:"GET",query:t.Object({query:p({allowEmpty:!1,description:"Search text to match against documentation and API-reference content."})},{description:"Documentation search query."}),response:t.Array(pS)});function lS(e,r){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 r()(uS,{query:{path:o}});W(i)}),n.command("search <query>").description("Search documentation pages").action(async o=>{let i=await r()(mS,{query:{query:o}});W(i)})}var dS="__tsuga_cluster_id__",g$=t.Object({}),y$=t.Object({status:t.Literal("error"),message:t.String({description:"Why this cluster failed to answer the query."})});function $o(e=g$){let r=I("status",[t.Object({...e.properties,status:t.Literal("ok")}),y$]);return Object.assign(ac(Mt,r),{description:'Outcome per cluster, keyed by cluster ID. Only returned for multi-cluster requests. A cluster that failed reports `status: "error"`; the others still returned their results.'})}var Ea=t.Array(p({allowEmpty:!1}),{minItems:1,maxItems:5,uniqueItems:!0,description:"IDs of the clusters to query, without duplicates. Mutually exclusive with `clusterId`. Omit both to use the default cluster."});var fS=t.Object({type:t.Literal("number"),number:t.String()}),h$=t.Object({type:t.Literal("string"),string:t.String()}),T$=t.Object({type:t.Literal("timestamp"),timestamp:t.String()}),_a=I("type",[fS,h$,T$]),E$=t.Object({by:t.Record(t.String(),_a),computed:t.Record(t.String(),fS)}),_$=t.Object({type:t.Literal("buckets"),buckets:t.Array(E$),clusterResponses:t.Optional($o())}),I$=t.Object({type:t.Literal("distribution"),bounds:t.Array(t.Number()),buckets:t.Array(t.Object({timestamp:t.Number(),counts:t.Array(t.Number())})),percentiles:t.Optional(t.Array(t.Number()))}),Gc=I("type",[_$,I$]);var b$=["all","owning-team-and-public","owning-team-only"],on=t.Enum(b$,{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 yS=1456444800,hS=4927737600,S$=yS*1e3,O$=hS*1e3,$c=1704067200,lm=$c*1e3,TS={title:"TimeRange",description:"Inclusive time range for telemetry queries. Use Unix timestamps in seconds unless the field description says milliseconds.",examples:[{from:$c,to:$c}]},A$={title:"TimeRange",description:"Inclusive time range for telemetry queries using Unix timestamps in milliseconds.",examples:[{from:lm,to:lm}]},jc=e=>t.Integer({description:e,examples:[$c],minimum:yS,maximum:hS,format:"int64"}),gS=e=>t.Integer({description:e,examples:[lm],minimum:S$,maximum:O$,format:"int64"}),He=t.Object({from:t.Optional(jc("Start of the query window as a Unix timestamp in seconds")),to:t.Optional(jc("End of the query window as a Unix timestamp in seconds"))},TS),ut=t.Object({from:jc("Start of the query window as a Unix timestamp in seconds"),to:jc("End of the query window as a Unix timestamp in seconds")},TS),jo=t.Object({from:gS("Start of the query window as a Unix timestamp in milliseconds"),to:gS("End of the query window as a Unix timestamp in milliseconds")},A$);var C$="/v0/aggregation",P$=t.Union([t.Literal("a"),t.Literal("d"),t.Literal("q"),t.Literal("w"),t.Literal("t")]),dm=t.Object({parallelism:t.Number(),engine:P$,recordBatchCache:t.Optional(t.Boolean()),includeNullGroups:t.Optional(t.Boolean()),restartAwareGaugeSum:t.Optional(t.Boolean())}),fm=["logs","metrics","traces"];var IS={logs:"Logs",metrics:"Metrics",traces:"Spans"},U$=[...fm,"connections","log-patterns","spans","rum"];var Kbe={...IS,connections:"Connections","log-patterns":"Log Patterns",spans:"Spans",rum:"RUM events"},sr=[...fm,"rum"];var zbe={...IS,rum:"RUM events"};var Ybe=t.Enum(U$,{description:"Data source being queried"}),bS=t.Enum(fm,{description:"Telemetry source queried by this aggregation: `logs`, `metrics`, or `traces`."}),Kt=t.Enum(sr,{description:"Telemetry source queried by this aggregation: `logs`, `metrics`, `traces`, or `rum`."}),Mn=t.String({description:"Attribute containing the values to aggregate"}),Dn=p({description:"Attribute containing the values to aggregate"}),w$=I("type",[t.Object({type:t.Literal("count",{description:"Counts the total number of records"}),field:t.Optional(Mn)},{$id:"AggregateCount",title:"Count"}),t.Object({type:t.Literal("unique-count",{description:"Counts the distinct values of the field"}),field:Mn},{$id:"AggregateUniqueCount",title:"UniqueCount"}),t.Object({type:t.Literal("average",{description:"Calculates the average value of the selected field"}),field:Mn},{$id:"AggregateAverage",title:"Average"}),t.Object({type:t.Literal("max",{description:"Finds the largest value of the field"}),field:Mn},{$id:"AggregateMax",title:"Max"}),t.Object({type:t.Literal("min",{description:"Finds the smallest value of the field"}),field:Mn},{$id:"AggregateMin",title:"Min"}),t.Object({type:t.Literal("sum",{description:"Sums the values of the selected field"}),field:Mn},{$id:"AggregateSum",title:"Sum"}),t.Object({type:t.Literal("percentile",{description:"Calculates a percentile of the selected field"}),field:Mn,percentile:t.Number({description:"Percentile to compute for the selected field."})},{$id:"AggregatePercentile",title:"Percentile"})],{title:"Aggregate",description:"Aggregation operation for this query. Required for every query; `field` is required by all aggregate types except `count`."}),N$=I("type",[t.Object({type:t.Literal("count",{description:"Counts the total number of records"}),field:t.Optional(Dn)},{$id:"InputAggregateCount",title:"Count"}),t.Object({type:t.Literal("unique-count",{description:"Counts the distinct values of the field"}),field:Dn},{$id:"InputAggregateUniqueCount",title:"UniqueCount"}),t.Object({type:t.Literal("average",{description:"Calculates the average value of the selected field"}),field:Dn},{$id:"InputAggregateAverage",title:"Average"}),t.Object({type:t.Literal("max",{description:"Finds the largest value of the field"}),field:Dn},{$id:"InputAggregateMax",title:"Max"}),t.Object({type:t.Literal("min",{description:"Finds the smallest value of the field"}),field:Dn},{$id:"InputAggregateMin",title:"Min"}),t.Object({type:t.Literal("sum",{description:"Sums the values of the selected field"}),field:Dn},{$id:"InputAggregateSum",title:"Sum"}),t.Object({type:t.Literal("percentile",{description:"Calculates a percentile of the selected field"}),field:Dn,percentile:t.Number({description:"Percentile to compute for the selected field."})},{$id:"InputAggregatePercentile",title:"Percentile"})],{title:"InputAggregate",description:"Aggregation operation for this query. Required for every query; `field` is required by all aggregate types except `count`."}),SS=t.Object({type:t.Literal("per-second",{description:"Normalizes the metric to events per second"})},{$id:"FunctionPerSecond",title:"PerSecond"}),OS=t.Object({type:t.Literal("per-minute",{description:"Normalizes the metric to events per minute"})},{$id:"FunctionPerMinute",title:"PerMinute"}),AS=t.Object({type:t.Literal("per-hour",{description:"Normalizes the metric to events per hour"})},{$id:"FunctionPerHour",title:"PerHour"}),xS=t.Object({type:t.Literal("rate",{description:"Calculates the rate of change"})},{$id:"FunctionRate",title:"Rate"}),RS=t.Object({type:t.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"}),CS=t.Object({type:t.Literal("power",{description:"Raises values to a specified power"}),exponent:t.Integer({description:"The exponent to raise values to"})},{$id:"FunctionPower",title:"Power"}),PS=t.Object({type:t.Literal("sqrt",{description:"Applies a square root transformation to the values"})},{$id:"FunctionSqrt",title:"Sqrt"}),US=t.Object({type:t.Literal("last",{description:"Takes the last value of the metric for the selected time frame"})},{$id:"FunctionLast",title:"Last"}),L$=t.Object({type:t.Literal("rolling",{description:"Computes a rolling window aggregate"}),window:t.String({description:"Duration of the rolling window"})},{$id:"FunctionRolling",title:"Rolling"}),v$=t.Object({type:t.Literal("rolling",{description:"Computes a rolling window aggregate"}),window:p({allowEmpty:!1,description:"Duration of the rolling window"})},{$id:"InputFunctionRolling",title:"Rolling"}),k$=t.Object({type:t.Literal("log",{description:"Applies a logarithm transformation to the values"}),base:t.Integer({description:"The base of the logarithm"})},{$id:"FunctionLog",title:"Log"}),M$=t.Object({type:t.Literal("log",{description:"Applies a logarithm transformation to the values"}),base:t.Integer({description:"The base of the logarithm",minimum:2})},{$id:"InputFunctionLog",title:"Log"}),D$=t.Object({type:t.Literal("time-offset",{description:"Shifts a query's data backward by a specified duration for easy comparison over different periods of time."}),seconds:t.Integer({description:"Number of seconds to offset"})},{$id:"FunctionTimeOffset",title:"TimeOffset"}),G$=t.Object({type:t.Literal("time-offset",{description:"Shifts a query's data backward by a specified duration for easy comparison over different periods of time."}),seconds:t.Integer({description:"Number of seconds to offset",minimum:1})},{$id:"InputFunctionTimeOffset",title:"TimeOffset"}),$$=I("type",[SS,OS,AS,xS,RS,L$,k$,CS,PS,US,D$],{title:"Function",description:"Post-processing function applied to an aggregation query result after the aggregate is computed, selected by `type`."}),j$=I("type",[SS,OS,AS,xS,RS,v$,M$,CS,PS,US,G$],{title:"InputFunction",description:"Post-processing function applied to an aggregation query result after the aggregate is computed, selected by `type`."});var ES=t.Object({min:t.Number({description:"Lower bound of the distribution range."}),max:t.Number({description:"Upper bound of the distribution range."})}),q$=["linear","log"],qc=t.Enum(q$,{description:"Spacing of the bucket boundaries across the distribution range. `linear` splits the range into equal-width buckets; `log` widens each bucket logarithmically, giving finer resolution near the lower bound."}),_S=t.Integer({minimum:1}),B$=I("type",[t.Object({type:t.Literal("scalar")},{title:"Scalar",description:"Returns a single value"}),t.Object({type:t.Literal("timeseries"),aggregationWindow:p({description:'Time bucket size for aggregation (e.g. "10s", "60s", "1m")'})},{title:"Timeseries",description:"Returns a time series"}),t.Object({type:t.Literal("histogram"),by:t.Optional(p()),bucketCount:t.Optional(_S),bounds:t.Optional(ES),boundsScale:t.Optional(qc),percentiles:t.Optional(t.Array(t.Number({minimum:0,maximum:100,multipleOf:1}),{minItems:1}))},{title:"Histogram",description:"Returns a single distribution over the entire time range"}),t.Object({type:t.Literal("heatmap"),aggregationWindow:p({description:'Time bucket size for the heatmap (e.g. "10s", "60s", "1m")'}),by:t.Optional(p()),bucketCount:t.Optional(_S),bounds:t.Optional(ES)},{title:"Heatmap",description:"Returns a distribution per time window"})]),Bc=15,F$=["zero","null"],H$=t.Enum(F$,{description:"`zero` fills missing points with zero. `null` keeps missing points null."}),wS=t.Object({mode:t.Object({type:H$},{description:"How missing aggregation points should be filled."})},{description:"Missing-point fill behavior for aggregation results. Optional; omit to keep missing points null."}),NS=t.Union([t.Literal("avg"),t.Literal("sum"),t.Literal("min"),t.Literal("max"),t.Literal("last")],{description:"Per-series rollup applied within each time bucket before the cross-series aggregate. When omitted, a default is derived from the metric type."}),LS={aggregate:w$,functions:t.Optional(t.Array($$,{description:"Post-processing functions applied to aggregation results"})),fill:t.Optional(wS),timeAggregate:t.Optional(NS)},vS={aggregate:N$,functions:t.Optional(t.Array(j$,{maxItems:10,description:"Post-processing functions applied to aggregation results. Defaults to an empty array when omitted."})),fill:t.Optional(wS),timeAggregate:t.Optional(NS)},K$={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."},kS={maxItems:Bc,description:'Aggregations that may be combined together in the same query. Each item is referenced from `formula` as q1, q2, and so on, in submission order. For dataSource "metrics", each aggregate\'s `field` is the metric name, not an attribute; to count distinct values of an attribute use unique-count with field "<metricName>.context.<attribute>" (e.g. "system.cpu.utilization.context.host.name").'},MS=t.Array(t.Object({...LS,filter:t.Optional(t.String({description:"Filter to apply to the aggregation"}))},{title:"AggregationQuery"}),K$),Ia=t.Array(t.Object({...vS,filter:t.Optional(p({type:"tsuga-query",description:"Tsuga query filter to apply to the aggregation. Defaults to an empty string when omitted."}))},{title:"AggregationQuery"}),kS),Er=t.Array(t.Object({...LS,filter:t.String({description:"Filter to apply to the aggregation"})},{title:"MonitorAggregationQuery",description:"Single aggregation query evaluated by a monitor or SLO."}),{description:"Aggregation queries used by alerting and SLO evaluation. Each query is referenced from formulas as q1, q2, and so on."}),_r=t.Array(t.Object({...vS,filter:p({type:"tsuga-query",description:"Tsuga query filter applied to this alerting or SLO aggregation query. Required by the API; use the query language for the selected data source."})},{title:"MonitorAggregationQuery",description:"Single aggregation query evaluated by a monitor or SLO."}),{...kS,description:"Aggregation queries used by alerting and SLO evaluation. Each query is referenced from formulas as q1, q2, and so on."});var Fc=t.String({description:"Formula referencing submitted query outputs, such as `q1 + q2`. References must be within `q1` through `qN` for the submitted queries."}),Gn=p({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."}),z$=t.Object({fields:t.Array(t.String(),{description:"Telemetry attribute names used to group aggregation results."}),limit:t.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:t.Optional(t.Enum(["asc","desc"],{description:"Sort direction applied to groups: ascending or descending."})),replaceNullWith:t.Optional(t.String({description:"Value used to group documents that have no value for a grouped field."}))},{title:"AggregationGroupBy"}),Y$=t.Object({fields:t.Array(p(),{maxItems:1,description:"Telemetry attribute name to group aggregation results by. Currently limited to one field per grouping level."}),limit:t.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:t.Optional(t.Enum(["asc","desc"],{description:"Sort direction applied to groups: ascending or descending."})),replaceNullWith:t.Optional(p({allowEmpty:!1,description:"Value used to group documents that have no value for a grouped field."}))},{title:"AggregationGroupBy"}),DS=7;var qo=t.Array(z$,{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."}),Ir=t.Array(Y$,{maxItems:DS,description:"Nested grouping levels applied to aggregation results, outermost first (e.g. group by service, then by level within each service). Each level splits results further, so the response contains one result per unique combination of group values instead of one aggregated total. Defaults to an empty array (one ungrouped result) when omitted."});var Vbe=d({tags:["aggregation"],url:`${C$}/multi-query`,method:"POST",body:t.Object({timeRange:jo,queries:Ia,groupBy:t.Optional(Ir),returnType:B$,dataSource:Kt,formula:Gn,executionOptions:dm,triggeredBy:t.Optional(t.Literal("refresh")),shouldStreamResults:t.Optional(t.Boolean()),clusterId:t.Optional(p({allowEmpty:!1})),clusterIds:t.Optional(Ea),viewAs:t.Optional(t.Object({owner:p({allowEmpty:!1,description:"Team ID to fetch data as"}),permissions:on}))}),response:Gc});var V$=t.Union([t.Literal("scalar"),t.Literal("timeseries")]),Q$="/v0/promql",Hc=t.Object({query:p({type:"long",allowEmpty:!1,description:"PromQL expression to evaluate."}),timeRange:jo,step:p({allowEmpty:!1,description:"Evaluation step interval (e.g. `1m`, `5m`, `1h`). Must be a valid Prometheus duration string."}),returnType:t.Optional(V$),executionOptions:dm,shouldStreamResults:t.Optional(t.Boolean()),clusterId:t.Optional(p({allowEmpty:!1,description:"Cluster to target. Defaults to the first cluster created in the organization when omitted."}))}),W$={query:'rate({"otel.trace.span_processor.spans"}[5m])',timeRange:{from:17822015e5,to:17822034e5},step:"1m",executionOptions:{parallelism:1,engine:"q"},clusterId:"cluster-abc"};Object.assign(Hc,{examples:[W$]});var rSe=d({tags:["promql"],url:Q$,method:"POST",body:Hc,response:Gc});var GS=`/${"v1"}/aggregation`,$S=t.Object({id:t.String({description:"Result identifier. Query results use `q1`, `q2`, and so on; formula results use `formula`."}),group:t.Record(t.String(),t.Union([t.String(),t.Number()]),{description:"Group-by field values for this result. Empty when no group-by is requested."})}),jS=t.Object({results:t.Array(t.Object({...$S.properties,value:t.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."}),Z$={results:[{id:"q1",group:{host:"server-1"},value:123.45}]};Object.assign(jS,{examples:[Z$]});var Kc=t.Object({series:t.Array(t.Object({...$S.properties,points:t.Array(t.Object({timestamp:t.Integer({description:"Unix timestamp in milliseconds for this point, spaced by `aggregationWindow`."}),value:t.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."}),X$={series:[{id:"q1",group:{host:"server-1"},points:[{timestamp:16094592e5,value:123.45},{timestamp:160945926e4,value:456.78}]}]};Object.assign(Kc,{examples:[X$]});var J$=t.Omit(Ia.items,["fill"],{title:"AggregationQuery",description:"Aggregation query. Omit `filter` for an unfiltered query and omit `functions` when no post-processing is needed."}),e1=t.Optional(Ir),qS={timeRange:ut,queries:t.Array(J$,{maxItems:Bc,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 ${Bc} 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:e1,dataSource:bS,formula:t.Optional(Gn)},BS=t.Object({clusterId:t.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))}),FS=t.Object(qS,{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."}),t1={timeRange:{from:1782201500,to:1782203400},dataSource:"logs",queries:[{aggregate:{type:"count"},filter:"context.service.name:checkout"}],groupBy:[{fields:["level"],limit:5}]};Object.assign(FS,{examples:[t1]});var HS=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:`${GS}/multi-query/scalar`,method:"POST",body:FS,query:BS,response:jS}),KS=t.Object({...qS,aggregationWindow:p({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."}),r1={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(KS,{examples:[r1]});var zS=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:`${GS}/multi-query/timeseries`,method:"POST",body:KS,query:BS,response:Kc});var n1=`/${"v1"}/promql`,o1=t.Object({...t.Pick(Hc,["query","step"]).properties,timeRange:ut},{description:"PromQL range-query request. Send clusterId as a query parameter, not in this JSON body.",examples:[{query:'sum by ("context.service.name") (sum_over_time({"traces.span.metrics.calls", "span.kind"="SPAN_KIND_SERVER"}[5m]))',timeRange:{from:1782201500,to:1782203400},step:"1m"}]}),i1=t.Object({clusterId:t.Optional(p({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."}))}),YS=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. See [How to write PromQL queries](/documentation/visualize/guides/how-to-write-promql-queries) for query syntax and examples.",operationId:"queryPromql",tags:["public","promql"],url:n1,method:"POST",body:o1,query:i1,response:Kc});var VS=Ns(require("node:fs"));function Bo(e){if(e.file){let r=VS.default.readFileSync(e.file==="-"?0:e.file,"utf-8");return JSON.parse(r)}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 a1(e){return s.IsObject(e)&&s.HasPropertyKey(e,"check")&&s.HasPropertyKey(e,"errors")&&s.IsFunction(e.check)&&s.IsFunction(e.errors)}function gm(e){return s.HasPropertyKey(e,"~guard")&&a1(e["~guard"])}function ym(e){return s.HasPropertyKey(e,"~refine")&&s.IsArray(e["~refine"])&&s.Every(e["~refine"],0,r=>s.IsObject(r)&&s.HasPropertyKey(r,"refine")&&s.HasPropertyKey(r,"message")&&s.IsFunction(r.refine)&&s.IsString(r.message))}function br(e){return s.IsObject(e)&&!s.IsArray(e)}function zc(e){return s.IsBoolean(e)}function j(e){return br(e)||zc(e)}function hm(e){return s.HasPropertyKey(e,"additionalItems")&&j(e.additionalItems)}function Sr(e){return s.HasPropertyKey(e,"additionalProperties")&&j(e.additionalProperties)}function Tm(e){return s.HasPropertyKey(e,"allOf")&&s.IsArray(e.allOf)&&e.allOf.every(r=>j(r))}function ba(e){return s.HasPropertyKey(e,"$anchor")&&s.IsString(e.$anchor)}function Em(e){return s.HasPropertyKey(e,"anyOf")&&s.IsArray(e.anyOf)&&e.anyOf.every(r=>j(r))}function _m(e){return s.HasPropertyKey(e,"const")}function $n(e){return s.HasPropertyKey(e,"contains")&&j(e.contains)}function wt(e){return s.HasPropertyKey(e,"default")}function Im(e){return s.HasPropertyKey(e,"dependencies")&&s.IsObject(e.dependencies)&&Object.values(e.dependencies).every(r=>j(r)||s.IsArray(r)&&r.every(n=>s.IsString(n)))}function bm(e){return s.HasPropertyKey(e,"dependentRequired")&&s.IsObject(e.dependentRequired)&&Object.values(e.dependentRequired).every(r=>s.IsArray(r)&&r.every(n=>s.IsString(n)))}function Sm(e){return s.HasPropertyKey(e,"dependentSchemas")&&s.IsObject(e.dependentSchemas)&&Object.values(e.dependentSchemas).every(r=>j(r))}function Om(e){return s.HasPropertyKey(e,"$dynamicAnchor")&&s.IsString(e.$dynamicAnchor)}function Am(e){return s.HasPropertyKey(e,"else")&&j(e.else)}function xm(e){return s.HasPropertyKey(e,"enum")&&s.IsArray(e.enum)}function Rm(e){return s.HasPropertyKey(e,"exclusiveMaximum")&&(s.IsNumber(e.exclusiveMaximum)||s.IsBigInt(e.exclusiveMaximum))}function Or(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 jn(e){return s.HasPropertyKey(e,"$id")&&s.IsString(e.$id)}function Cm(e){return s.HasPropertyKey(e,"if")&&j(e.if)}function Fo(e){return s.HasPropertyKey(e,"items")&&(j(e.items)||s.IsArray(e.items)&&e.items.every(r=>j(r)))}function Pm(e){return Fo(e)&&s.IsArray(e.items)}function Um(e){return s.HasPropertyKey(e,"maximum")&&(s.IsNumber(e.maximum)||s.IsBigInt(e.maximum))}function wm(e){return s.HasPropertyKey(e,"maxContains")&&s.IsNumber(e.maxContains)}function Yc(e){return s.HasPropertyKey(e,"maxItems")&&s.IsNumber(e.maxItems)}function Nm(e){return s.HasPropertyKey(e,"maxLength")&&s.IsNumber(e.maxLength)}function Lm(e){return s.HasPropertyKey(e,"maxProperties")&&s.IsNumber(e.maxProperties)}function Ar(e){return s.HasPropertyKey(e,"minimum")&&(s.IsNumber(e.minimum)||s.IsBigInt(e.minimum))}function qn(e){return s.HasPropertyKey(e,"minContains")&&s.IsNumber(e.minContains)}function Ho(e){return s.HasPropertyKey(e,"minItems")&&s.IsNumber(e.minItems)}function Oa(e){return s.HasPropertyKey(e,"minLength")&&s.IsNumber(e.minLength)}function Aa(e){return s.HasPropertyKey(e,"minProperties")&&s.IsNumber(e.minProperties)}function vm(e){return s.HasPropertyKey(e,"multipleOf")&&(s.IsNumber(e.multipleOf)||s.IsBigInt(e.multipleOf))}function km(e){return s.HasPropertyKey(e,"not")&&j(e.not)}function Mm(e){return s.HasPropertyKey(e,"oneOf")&&s.IsArray(e.oneOf)&&e.oneOf.every(r=>j(r))}function xa(e){return s.HasPropertyKey(e,"pattern")&&(s.IsString(e.pattern)||e.pattern instanceof RegExp)}function Ra(e){return s.HasPropertyKey(e,"patternProperties")&&s.IsObject(e.patternProperties)&&Object.values(e.patternProperties).every(r=>j(r))}function Ko(e){return s.HasPropertyKey(e,"prefixItems")&&s.IsArray(e.prefixItems)&&e.prefixItems.every(r=>j(r))}function Ca(e){return s.HasPropertyKey(e,"properties")&&s.IsObject(e.properties)&&Object.values(e.properties).every(r=>j(r))}function Dm(e){return s.HasPropertyKey(e,"propertyNames")&&(s.IsObject(e.propertyNames)||j(e.propertyNames))}function s1(e){return s.HasPropertyKey(e,"$recursiveAnchor")&&s.IsBoolean(e.$recursiveAnchor)}function Vc(e){return s1(e)&&s.IsEqual(e.$recursiveAnchor,!0)}function Gm(e){return s.HasPropertyKey(e,"$recursiveRef")&&s.IsString(e.$recursiveRef)}function $m(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(r=>s.IsString(r))}function jm(e){return s.HasPropertyKey(e,"then")&&j(e.then)}function qm(e){return s.HasPropertyKey(e,"type")&&(s.IsString(e.type)||s.IsArray(e.type)&&e.type.every(r=>s.IsString(r)))}function zo(e){return s.HasPropertyKey(e,"uniqueItems")&&s.IsBoolean(e.uniqueItems)}function Qc(e){return s.HasPropertyKey(e,"unevaluatedItems")&&j(e.unevaluatedItems)}function Wc(e){return s.HasPropertyKey(e,"unevaluatedProperties")&&j(e.unevaluatedProperties)}var lt=class{constructor(){this.indices=new Set,this.keys=new Set}AddIndex(r){return this.indices.add(r),!0}AddKey(r){return this.keys.add(r),!0}GetIndices(){return this.indices}GetKeys(){return this.keys}Merge(r){for(let n of r)n.indices.forEach(o=>this.indices.add(o)),n.keys.forEach(o=>this.keys.add(o));return!0}},Pa=class extends lt{constructor(r){super(),this.callback=r}AddError(r){return this.callback(r),!1}},Ke=class extends Pa{constructor(){super(r=>this.errors.push(r)),this.errors=[]}AddError(r){return this.errors.push(r),!1}GetErrors(){return this.errors}};var c1="external_",p1=0,Fxe={identifier:`${c1}${p1}`,variables:[]};function QS(e,r,n,o){return n["~guard"].check(o)}function WS(e,r,n,o,i,a){return i["~guard"].check(a)||r.AddError({keyword:"~guard",schemaPath:n,instancePath:o,params:{errors:i["~guard"].errors(a)}})}function ZS(e,r,n,o){return s.Every(n["~refine"],0,(i,a)=>i.refine(o))}function XS(e,r,n,o,i,a){return s.EveryAll(i["~refine"],0,(c,m)=>c.refine(a)||r.AddError({keyword:"~refine",schemaPath:n,instancePath:o,params:{index:m,message:c.message}}))}function JS(e){return Fo(e)&&s.IsArray(e.items)}function eO(e,r,n,o){return JS(n)?o.every((a,c)=>s.IsLessThan(c,n.items.length)||G(e,r,n.additionalItems,a)&&r.AddIndex(c)):!0}function tO(e,r,n,o,i,a){return JS(i)?a.every((m,l)=>{let f=`${n}/additionalItems`,y=`${o}/${l}`;return s.IsLessThan(l,i.items.length)||Z(e,r,f,y,i.additionalItems,m)&&r.AddIndex(l)}):!0}function u1(e){return`^${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}$`}function rO(e){let r=[];return Ra(e)&&r.push(...s.Keys(e.patternProperties)),Ca(e)&&r.push(...s.Keys(e.properties).map(u1)),s.IsEqual(r.length,0)?"(?!)":`(${r.join("|")})`}function nO(e,r,n,o){let i=new RegExp(rO(n));return s.Every(s.Keys(o),0,(c,m)=>i.test(c)||G(e,r,n.additionalProperties,o[c])&&r.AddKey(c))}function oO(e,r,n,o,i,a){let c=new RegExp(rO(i)),m=[];return s.EveryAll(s.Keys(a),0,(f,y)=>{let E=`${n}/additionalProperties`,A=`${o}/${f}`,ye=new Ke,Ue=c.test(f)||Z(e,ye,E,A,i.additionalProperties,a[f])&&r.AddKey(f);return Ue||m.push(f),Ue})||r.AddError({keyword:"additionalProperties",schemaPath:n,instancePath:o,params:{additionalProperties:m}})}function iO(e,r,n,o){let i=n.allOf.reduce((a,c)=>{let m=new lt;return G(e,m,c,o)?[...a,m]:a},[]);return s.IsEqual(i.length,n.allOf.length)&&r.Merge(i)}function aO(e,r,n,o,i,a){let c=[],m=i.allOf.reduce((f,y,E)=>{let A=`${n}/allOf/${E}`,ye=new Ke,Ue=Z(e,ye,A,o,y,a);return Ue||c.push(ye),Ue?[...f,ye]:f},[]),l=s.IsEqual(m.length,i.allOf.length)&&r.Merge(m);return l||c.forEach(f=>f.GetErrors().forEach(y=>r.AddError(y))),l}function sO(e,r,n,o){let i=n.anyOf.reduce((a,c,m)=>{let l=new lt;return G(e,l,c,o)?[...a,l]:a},[]);return s.IsGreaterThan(i.length,0)&&r.Merge(i)}function cO(e,r,n,o,i,a){let c=[],m=i.anyOf.reduce((f,y,E)=>{let A=new Ke,ye=`${n}/anyOf/${E}`,Ue=Z(e,A,ye,o,y,a);return Ue||c.push(A),Ue?[...f,A]:f},[]),l=s.IsGreaterThan(m.length,0)&&r.Merge(m);return l||c.forEach(f=>f.GetErrors().forEach(y=>r.AddError(y))),l||r.AddError({keyword:"anyOf",schemaPath:n,instancePath:o,params:{}})}function Fm(e,r,n,o){return n}function pO(e,r,n,o,i,a){return Fm(e,r,i,a)||r.AddError({keyword:"boolean",schemaPath:n,instancePath:o,params:{}})}function Hm(e,r,n,o){return s.IsValueLike(n.const)?s.IsEqual(o,n.const):s.IsDeepEqual(o,n.const)}function uO(e,r,n,o,i,a){return Hm(e,r,i,a)||r.AddError({keyword:"const",schemaPath:n,instancePath:o,params:{allowedValue:i.const}})}function m1(e){return!(qn(e)&&s.IsEqual(e.minContains,0))}function Km(e,r,n,o){return m1(n)?!s.IsEqual(o.length,0)&&o.some(i=>G(e,r,n.contains,i)):!0}function mO(e,r,n,o,i,a){return Km(e,r,i,a)||r.AddError({keyword:"contains",schemaPath:n,instancePath:o,params:{minContains:1}})}function lO(e,r,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)):G(e,r,m,o)));return i||a}function dO(e,r,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(E=>s.HasPropertyKey(a,E)||r.AddError({keyword:"dependencies",schemaPath:n,instancePath:o,params:{property:l,dependencies:f}})):Z(e,r,y,o,f,a))});return c||m}function fO(e,r,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 gO(e,r,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)||r.AddError({keyword:"dependentRequired",schemaPath:n,instancePath:o,params:{property:l,dependencies:f}})));return c||m}function yO(e,r,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)||G(e,r,m,o));return i||a}function hO(e,r,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)||Z(e,r,y,o,f,a)});return c||m}function zm(e,r,n,o){return n.enum.some(i=>s.IsValueLike(i)?s.IsEqual(o,i):s.IsDeepEqual(o,i))}function TO(e,r,n,o,i,a){return zm(e,r,i,a)||r.AddError({keyword:"enum",schemaPath:n,instancePath:o,params:{allowedValues:i.enum}})}function Ym(e,r,n,o){return s.IsLessThan(o,n.exclusiveMaximum)}function EO(e,r,n,o,i,a){return Ym(e,r,i,a)||r.AddError({keyword:"exclusiveMaximum",schemaPath:n,instancePath:o,params:{comparison:"<",limit:i.exclusiveMaximum}})}function Vm(e,r,n,o){return s.IsGreaterThan(o,n.exclusiveMinimum)}function _O(e,r,n,o,i,a){return Vm(e,r,i,a)||r.AddError({keyword:"exclusiveMinimum",schemaPath:n,instancePath:o,params:{comparison:">",limit:i.exclusiveMinimum}})}var Vo={};vt(Vo,{Clear:()=>bO,Entries:()=>U1,Get:()=>L1,Has:()=>N1,IsDate:()=>Ua,IsDateTime:()=>Qm,IsDuration:()=>Wm,IsEmail:()=>Zm,IsHostname:()=>Xm,IsIPv4:()=>rl,IsIPv6:()=>nl,IsIdnEmail:()=>Jm,IsIdnHostname:()=>tl,IsIri:()=>il,IsIriReference:()=>ol,IsJsonPointer:()=>sl,IsJsonPointerUriFragment:()=>al,IsRegex:()=>cl,IsRelativeJsonPointer:()=>pl,IsTime:()=>wa,IsUri:()=>ll,IsUriReference:()=>ul,IsUriTemplate:()=>ml,IsUrl:()=>dl,IsUuid:()=>fl,Reset:()=>SO,Set:()=>w1,Test:()=>v1});var l1=[0,31,28,31,30,31,30,31,31,30,31,30,31],d1=/^(\d\d\d\d)-(\d\d)-(\d\d)$/;function f1(e){return e%4===0&&(e%100!==0||e%400===0)}function Ua(e){let r=d1.exec(e);if(!r)return!1;let n=+r[1],o=+r[2],i=+r[3];return o>=1&&o<=12&&i>=1&&i<=(o===2&&f1(n)?29:l1[o])}var g1=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(?:Z|([+-])(\d\d):(\d\d))?$/i;function wa(e,r=!0){let n=g1.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||r&&!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 Qm(e,r=!0){let n=e.split(/T/i);return n.length===2&&Ua(n[0])&&wa(n[1],r)}var y1=/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/;function Wm(e){return y1.test(e)}var h1=/^(?!.*\.\.)[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 Zm(e){return h1.test(e)}var T1=/^(?=.{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 Xm(e){return T1.test(e)}var E1=/^(?!.*\.\.)[\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 Jm(e){return E1.test(e)}function el(e){let r=e.codePointAt(0);return r===void 0?!1:r>=12352&&r<=12447||r>=12448&&r<=12543&&r!==12539||r>=19968&&r<=40959}function tl(e){if(e.length===0||e.includes(" "))return!1;let r=/[\u002E\u3002\uFF0E\uFF61]/g,n=e.normalize("NFC").replace(r,".");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),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(!el(y))return!1}else{let y=i.charAt(l-1),E=i.charAt(l+1);if(!el(y)||!el(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,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 _1=/^(?:(?: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 rl(e){return _1.test(e)}var I1=/^((([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 nl(e){return I1.test(e)}function IO(e){try{return new URL(e,"http://example.com"),!0}catch{return!1}}function ol(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 r=e.indexOf(":");return r>0&&/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e.substring(0,r))?IO(e):e.match(/^([a-zA-Z][a-zA-Z0-9+\-.]*)(\/\/)/)&&r===-1?!1:IO(e)}function il(e){try{return new URL(e),!0}catch{return!1}}var b1=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;function al(e){return b1.test(e)}var S1=/^(?:\/(?:[^~/]|~0|~1)*)*$/;function sl(e){return S1.test(e)}function cl(e){if(e.length===0)return!1;try{return new RegExp(e),!0}catch{return!1}}var O1=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function pl(e){return O1.test(e)}var A1=/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i;function ul(e){return A1.test(e)}var x1=/^(?:(?:[^\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 ml(e){return x1.test(e)}var R1=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i;function ll(e){return R1.test(e)}var C1=/^(?: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 dl(e){return C1.test(e)}var P1=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;function fl(e){return P1.test(e)}var ge=new Map;function bO(){ge.clear()}function U1(){return[...ge.entries()]}function w1(e,r){ge.set(e,r)}function N1(e){return ge.has(e)}function L1(e){return ge.get(e)}function v1(e,r){return ge.get(e)?.(r)??!0}function SO(){bO(),ge.set("date-time",Qm),ge.set("date",Ua),ge.set("duration",Wm),ge.set("email",Zm),ge.set("hostname",Xm),ge.set("idn-email",Jm),ge.set("idn-hostname",tl),ge.set("ipv4",rl),ge.set("ipv6",nl),ge.set("iri-reference",ol),ge.set("iri",il),ge.set("json-pointer-uri-fragment",al),ge.set("json-pointer",sl),ge.set("regex",cl),ge.set("relative-json-pointer",pl),ge.set("time",wa),ge.set("uri-reference",ul),ge.set("uri-template",ml),ge.set("uri",ll),ge.set("url",dl),ge.set("uuid",fl)}SO();function gl(e,r,n,o){return Vo.Test(n.format,o)}function OO(e,r,n,o,i,a){return gl(e,r,i,a)||r.AddError({keyword:"format",schemaPath:n,instancePath:o,params:{format:i.format}})}function AO(e,r,n,o){let i=jm(n)?n.then:!0,a=Am(n)?n.else:!0;return G(e,r,n.if,o)?G(e,r,i,o):G(e,r,a,o)}function xO(e,r,n,o,i,a){let c=jm(i)?i.then:!0,m=Am(i)?i.else:!0,l=new Ke,f=Z(e,l,`${n}/if`,o,i.if,a)?Z(e,l,`${n}/then`,o,c,a)||r.AddError({keyword:"if",schemaPath:n,instancePath:o,params:{failingKeyword:"then"}}):Z(e,r,`${n}/else`,o,m,a)||r.AddError({keyword:"if",schemaPath:n,instancePath:o,params:{failingKeyword:"else"}});return f&&r.Merge([l]),f}function k1(e,r,n,o){return s.Every(n.items,0,(i,a)=>s.IsLessEqualThan(o.length,a)||G(e,r,i,o[a])&&r.AddIndex(a))}function M1(e,r,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)||Z(e,r,l,f,c,a[m])&&r.AddIndex(m)})}function D1(e,r,n,o){let i=Ko(n)?n.prefixItems.length:0;return s.Every(o,i,(a,c)=>G(e,r,n.items,a)&&r.AddIndex(c))}function G1(e,r,n,o,i,a){let c=Ko(i)?i.prefixItems.length:0;return s.EveryAll(a,c,(m,l)=>{let f=`${n}/items`,y=`${o}/${l}`;return Z(e,r,f,y,i.items,m)&&r.AddIndex(l)})}function RO(e,r,n,o){return Pm(n)?k1(e,r,n,o):D1(e,r,n,o)}function CO(e,r,n,o,i,a){return Pm(i)?M1(e,r,n,o,i,a):G1(e,r,n,o,i,a)}function $1(e){return $n(e)}function yl(e,r,n,o){if(!$1(n))return!0;let i=o.reduce((a,c)=>G(e,r,n.contains,c)?++a:a,0);return s.IsLessEqualThan(i,n.maxContains)}function PO(e,r,n,o,i,a){let c=qn(i)?i.minContains:1;return yl(e,r,i,a)||r.AddError({keyword:"contains",schemaPath:n,instancePath:o,params:{minContains:c,maxContains:i.maxContains}})}function hl(e,r,n,o){return s.IsLessEqualThan(o,n.maximum)}function UO(e,r,n,o,i,a){return hl(e,r,i,a)||r.AddError({keyword:"maximum",schemaPath:n,instancePath:o,params:{comparison:"<=",limit:i.maximum}})}function Tl(e,r,n,o){return s.IsLessEqualThan(o.length,n.maxItems)}function wO(e,r,n,o,i,a){return Tl(e,r,i,a)||r.AddError({keyword:"maxItems",schemaPath:n,instancePath:o,params:{limit:i.maxItems}})}function El(e,r,n,o){return s.IsMaxLength(o,n.maxLength)}function NO(e,r,n,o,i,a){return El(e,r,i,a)||r.AddError({keyword:"maxLength",schemaPath:n,instancePath:o,params:{limit:i.maxLength}})}function _l(e,r,n,o){return s.IsLessEqualThan(s.Keys(o).length,n.maxProperties)}function LO(e,r,n,o,i,a){return _l(e,r,i,a)||r.AddError({keyword:"maxProperties",schemaPath:n,instancePath:o,params:{limit:i.maxProperties}})}function j1(e){return $n(e)}function Il(e,r,n,o){if(!j1(n))return!0;let i=o.reduce((a,c)=>G(e,r,n.contains,c)?++a:a,0);return s.IsGreaterEqualThan(i,n.minContains)}function vO(e,r,n,o,i,a){return Il(e,r,i,a)||r.AddError({keyword:"contains",schemaPath:n,instancePath:o,params:{minContains:i.minContains}})}function bl(e,r,n,o){return s.IsGreaterEqualThan(o,n.minimum)}function kO(e,r,n,o,i,a){return bl(e,r,i,a)||r.AddError({keyword:"minimum",schemaPath:n,instancePath:o,params:{comparison:">=",limit:i.minimum}})}function Sl(e,r,n,o){return s.IsGreaterEqualThan(o.length,n.minItems)}function MO(e,r,n,o,i,a){return Sl(e,r,i,a)||r.AddError({keyword:"minItems",schemaPath:n,instancePath:o,params:{limit:i.minItems}})}function Ol(e,r,n,o){return s.IsMinLength(o,n.minLength)}function DO(e,r,n,o,i,a){return Ol(e,r,i,a)||r.AddError({keyword:"minLength",schemaPath:n,instancePath:o,params:{limit:i.minLength}})}function Al(e,r,n,o){return s.IsGreaterEqualThan(s.Keys(o).length,n.minProperties)}function GO(e,r,n,o,i,a){return Al(e,r,i,a)||r.AddError({keyword:"minProperties",schemaPath:n,instancePath:o,params:{limit:i.minProperties}})}function xl(e,r,n,o){return s.IsMultipleOf(o,n.multipleOf)}function $O(e,r,n,o,i,a){return xl(e,r,i,a)||r.AddError({keyword:"multipleOf",schemaPath:n,instancePath:o,params:{multipleOf:i.multipleOf}})}function Rl(e,r,n,o){let i=new lt;return!G(e,i,n.not,o)&&r.Merge([i])}function jO(e,r,n,o,i,a){return Rl(e,r,i,a)||r.AddError({keyword:"not",schemaPath:n,instancePath:o,params:{}})}function qO(e,r,n,o){let i=n.oneOf.reduce((a,c)=>{let m=new lt;return G(e,m,c,o)?[...a,m]:a},[]);return s.IsEqual(i.length,1)&&r.Merge(i)}function BO(e,r,n,o,i,a){let c=[],m=[],l=i.oneOf.reduce((y,E,A)=>{let ye=new Ke,Ue=`${n}/oneOf/${A}`,Mr=Z(e,ye,Ue,o,E,a);return Mr&&m.push(A),Mr||c.push(ye),Mr?[...y,ye]:y},[]),f=s.IsEqual(l.length,1)&&r.Merge(l);return!f&&s.IsEqual(m.length,0)&&c.forEach(y=>y.GetErrors().forEach(E=>r.AddError(E))),f||r.AddError({keyword:"oneOf",schemaPath:n,instancePath:o,params:{passingSchemas:m}})}function Cl(e,r,n,o){return(s.IsString(n.pattern)?new RegExp(n.pattern):n.pattern).test(o)}function FO(e,r,n,o,i,a){return Cl(e,r,i,a)||r.AddError({keyword:"pattern",schemaPath:n,instancePath:o,params:{pattern:i.pattern}})}function HO(e,r,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)||G(e,r,a,l)&&r.AddKey(m))})}function KO(e,r,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,E])=>{let A=`${o}/${y}`;return!f.test(y)||Z(e,r,l,A,m,E)&&r.AddKey(y)})})}function zO(e,r,n,o){return s.IsEqual(o.length,0)||s.Every(n.prefixItems,0,(i,a)=>s.IsLessEqualThan(o.length,a)||G(e,r,i,o[a])&&r.AddIndex(a))}function YO(e,r,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)||Z(e,r,l,f,c,a[m])&&r.AddIndex(m)})}function Pl(e,r){return e.includes(r)||Rt.Get().exactOptionalPropertyTypes}function Ul(e,r){return s.IsUndefined(e[r])}function VO(e,r,n,o){let i=Bn(n)?n.required:[];return s.Every(s.Entries(n.properties),0,([c,m])=>{let l=!s.HasPropertyKey(o,c)||G(e,r,m,o[c])&&r.AddKey(c);return Pl(i,c)?l:Ul(o,c)||l})}function QO(e,r,n,o,i,a){let c=Bn(i)?i.required:[];return s.EveryAll(s.Entries(i.properties),0,([l,f])=>{let y=`${n}/properties/${l}`,E=`${o}/${l}`,A=()=>!s.HasPropertyKey(a,l)||Z(e,r,y,E,f,a[l])&&r.AddKey(l);return Pl(c,l)?A():Ul(a,l)||A()})}function WO(e,r,n,o){return s.Every(s.Keys(o),0,(i,a)=>G(e,r,n.propertyNames,i))}function ZO(e,r,n,o,i,a){let c=[];return s.EveryAll(s.Keys(a),0,(l,f)=>{let y=`${o}/${l}`,E=`${n}/propertyNames`,A=new Ke,ye=Z(e,A,E,y,i.propertyNames,l);return ye||c.push(l),ye})||r.AddError({keyword:"propertyNames",schemaPath:n,instancePath:o,params:{propertyNames:c}})}function XO(e,r,n,o){let i=e.RecursiveRef(n.$recursiveRef)??!1;return j(i)&&G(e,r,i,o)}function JO(e,r,n,o,i,a){let c=e.RecursiveRef(i.$recursiveRef)??!1;return j(c)&&Z(e,r,"#",o,c,a)}function rA(e,r,n,o){let i=e.Ref(n.$ref)??!1,a=new lt,c=j(i)&&G(e,a,i,o);return c&&r.Merge([a]),c}function nA(e,r,n,o,i,a){let c=e.Ref(i.$ref)??!1,m=new Ke,l=j(c)&&Z(e,m,"#",o,c,a);return l&&r.Merge([m]),l||m.GetErrors().forEach(f=>r.AddError(f)),l}function oA(e,r,n,o){return s.Every(n.required,0,i=>s.HasPropertyKey(o,i))}function iA(e,r,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})||r.AddError({keyword:"required",schemaPath:n,instancePath:o,params:{requiredProperties:c}})}function wl(e,r,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 aA(e,r,n,o,i){return n.some(a=>wl(e,r,a,o,i))}function sA(e,r,n,o){return s.IsArray(n.type)?aA(e,r,n.type,n,o):wl(e,r,n.type,n,o)}function cA(e,r,n,o,i,a){return(s.IsArray(i.type)?aA(e,r,i.type,i,a):wl(e,r,i.type,i,a))||r.AddError({keyword:"type",schemaPath:n,instancePath:o,params:{type:i.type}})}function pA(e,r,n,o){let i=r.GetIndices();return s.Every(o,0,(a,c)=>(i.has(c)||G(e,r,n.unevaluatedItems,a))&&r.AddIndex(c))}function uA(e,r,n,o,i,a){let c=r.GetIndices(),m=[];return s.EveryAll(a,0,(f,y)=>{let E=new Ke,A=(c.has(y)||Z(e,E,n,o,i.unevaluatedItems,f))&&r.AddIndex(y);return A||m.push(y),A})||r.AddError({keyword:"unevaluatedItems",schemaPath:n,instancePath:o,params:{unevaluatedItems:m}})}function mA(e,r,n,o){let i=r.GetKeys();return s.Every(s.Entries(o),0,([a,c])=>i.has(a)||G(e,r,n.unevaluatedProperties,c)&&r.AddKey(a))}function lA(e,r,n,o,i,a){let c=r.GetKeys(),m=[];return s.EveryAll(s.Entries(a),0,([f,y])=>{let E=new Ke,A=c.has(f)||Z(e,E,n,o,i.unevaluatedProperties,y)&&r.AddKey(f);return A||m.push(f),A})||r.AddError({keyword:"unevaluatedProperties",schemaPath:n,instancePath:o,params:{unevaluatedProperties:m}})}function dA(e){return!s.IsEqual(e.uniqueItems,!1)}function fA(e,r,n,o){if(!dA(n))return!0;let i=new Set(o.map(Hr.Hash)).size,a=o.length;return s.IsEqual(i,a)}function gA(e,r,n,o,i,a){if(!dA(i))return!0;let c=new Set,m=a.reduce((f,y,E)=>{let A=Hr.Hash(y);return c.has(A)?[...f,E]:(c.add(A),f)},[]);return s.IsEqual(m.length,0)||r.AddError({keyword:"uniqueItems",schemaPath:n,instancePath:o,params:{duplicateItems:m}})}function G(e,r,n,o){e.Push(n);let i=zc(n)?Fm(e,r,n,o):(!qm(n)||sA(e,r,n,o))&&(!(s.IsObject(o)&&!s.IsArray(o))||(!Bn(n)||oA(e,r,n,o))&&(!Sr(n)||nO(e,r,n,o))&&(!Im(n)||lO(e,r,n,o))&&(!bm(n)||fO(e,r,n,o))&&(!Sm(n)||yO(e,r,n,o))&&(!Ra(n)||HO(e,r,n,o))&&(!Ca(n)||VO(e,r,n,o))&&(!Dm(n)||WO(e,r,n,o))&&(!Aa(n)||Al(e,r,n,o))&&(!Lm(n)||_l(e,r,n,o)))&&(!s.IsArray(o)||(!hm(n)||eO(e,r,n,o))&&(!$n(n)||Km(e,r,n,o))&&(!Fo(n)||RO(e,r,n,o))&&(!wm(n)||yl(e,r,n,o))&&(!Yc(n)||Tl(e,r,n,o))&&(!qn(n)||Il(e,r,n,o))&&(!Ho(n)||Sl(e,r,n,o))&&(!Ko(n)||zO(e,r,n,o))&&(!zo(n)||fA(e,r,n,o)))&&(!s.IsString(o)||(!Sa(n)||gl(e,r,n,o))&&(!Nm(n)||El(e,r,n,o))&&(!Oa(n)||Ol(e,r,n,o))&&(!xa(n)||Cl(e,r,n,o)))&&(!(s.IsNumber(o)||s.IsBigInt(o))||(!Rm(n)||Ym(e,r,n,o))&&(!Or(n)||Vm(e,r,n,o))&&(!Um(n)||hl(e,r,n,o))&&(!Ar(n)||bl(e,r,n,o))&&(!vm(n)||xl(e,r,n,o)))&&(!Gm(n)||XO(e,r,n,o))&&(!$m(n)||rA(e,r,n,o))&&(!gm(n)||QS(e,r,n,o))&&(!_m(n)||Hm(e,r,n,o))&&(!xm(n)||zm(e,r,n,o))&&(!Cm(n)||AO(e,r,n,o))&&(!km(n)||Rl(e,r,n,o))&&(!Tm(n)||iO(e,r,n,o))&&(!Em(n)||sO(e,r,n,o))&&(!Mm(n)||qO(e,r,n,o))&&(!Qc(n)||!s.IsArray(o)||pA(e,r,n,o))&&(!Wc(n)||!s.IsObject(o)||mA(e,r,n,o))&&(!ym(n)||ZS(e,r,n,o));return e.Pop(n),i}function Z(e,r,n,o,i,a){e.Push(i);let c=zc(i)?pO(e,r,n,o,i,a):!!(+(!qm(i)||cA(e,r,n,o,i,a))&+(!(s.IsObject(a)&&!s.IsArray(a))||!!(+(!Bn(i)||iA(e,r,n,o,i,a))&+(!Sr(i)||oO(e,r,n,o,i,a))&+(!Im(i)||dO(e,r,n,o,i,a))&+(!bm(i)||gO(e,r,n,o,i,a))&+(!Sm(i)||hO(e,r,n,o,i,a))&+(!Ra(i)||KO(e,r,n,o,i,a))&+(!Ca(i)||QO(e,r,n,o,i,a))&+(!Dm(i)||ZO(e,r,n,o,i,a))&+(!Aa(i)||GO(e,r,n,o,i,a))&+(!Lm(i)||LO(e,r,n,o,i,a))))&+(!s.IsArray(a)||!!(+(!hm(i)||tO(e,r,n,o,i,a))&+(!$n(i)||mO(e,r,n,o,i,a))&+(!Fo(i)||CO(e,r,n,o,i,a))&+(!wm(i)||PO(e,r,n,o,i,a))&+(!Yc(i)||wO(e,r,n,o,i,a))&+(!qn(i)||vO(e,r,n,o,i,a))&+(!Ho(i)||MO(e,r,n,o,i,a))&+(!Ko(i)||YO(e,r,n,o,i,a))&+(!zo(i)||gA(e,r,n,o,i,a))))&+(!s.IsString(a)||!!(+(!Sa(i)||OO(e,r,n,o,i,a))&+(!Nm(i)||NO(e,r,n,o,i,a))&+(!Oa(i)||DO(e,r,n,o,i,a))&+(!xa(i)||FO(e,r,n,o,i,a))))&+(!(s.IsNumber(a)||s.IsBigInt(a))||!!(+(!Rm(i)||EO(e,r,n,o,i,a))&+(!Or(i)||_O(e,r,n,o,i,a))&+(!Um(i)||UO(e,r,n,o,i,a))&+(!Ar(i)||kO(e,r,n,o,i,a))&+(!vm(i)||$O(e,r,n,o,i,a))))&+(!Gm(i)||JO(e,r,n,o,i,a))&+(!$m(i)||nA(e,r,n,o,i,a))&+(!gm(i)||WS(e,r,n,o,i,a))&+(!_m(i)||uO(e,r,n,o,i,a))&+(!xm(i)||TO(e,r,n,o,i,a))&+(!Cm(i)||xO(e,r,n,o,i,a))&+(!km(i)||jO(e,r,n,o,i,a))&+(!Tm(i)||aO(e,r,n,o,i,a))&+(!Em(i)||cO(e,r,n,o,i,a))&+(!Mm(i)||BO(e,r,n,o,i,a))&+(!Qc(i)||!s.IsArray(a)||uA(e,r,n,o,i,a))&+(!Wc(i)||!s.IsObject(a)||lA(e,r,n,o,i,a)))&&(!ym(i)||XS(e,r,n,o,i,a));return e.Pop(i),c}var Hn={};vt(Hn,{Ref:()=>J1});var xr={};vt(xr,{Delete:()=>Y1,Get:()=>K1,Has:()=>H1,Indices:()=>Na,Set:()=>z1});function yA(e){if(e.length===0)throw Error("Cannot set root")}function hA(e){if(!s.IsObject(e))throw Error("Cannot set value")}function q1(e){return/^(0|[1-9]\d*)$/.test(e)}function TA(e){return[e.slice(0,e.length-1),e.slice(e.length-1)[0]]}function B1(e,r){return s.IsObject(r)&&s.HasPropertyKey(r,e)}function F1(e,r){return s.IsObject(r)?r[e]:void 0}function Nl(e,r){return e.reduce((n,o)=>F1(o,n),r)}function Na(e){if(s.IsEqual(e.length,0))return[];let r=e.split("/").map(n=>n.replace(/~1/g,"/").replace(/~0/g,"~"));return r.length>0&&r[0]===""?r.slice(1):r}function H1(e,r){let n=e;return Na(r).every(o=>B1(o,n)?(n=n[o],!0):!1)}function K1(e,r){let n=Na(r);return Nl(n,e)}function z1(e,r,n){let o=Na(r);yA(o);let[i,a]=TA(o),c=Nl(i,e);return hA(c),c[a]=n,e}function Y1(e,r){let n=Na(r);yA(n);let[o,i]=TA(n),a=Nl(o,e);return hA(a),s.IsArray(a)&&q1(i)?a.splice(+i,1):delete a[i],e}function V1(e,r,n){if(e.$id===n.hash)return e;let o=new URL(e.$id,r.href),i=new URL(n.href,r.href);if(s.IsEqual(o.pathname,i.pathname))return n.hash.startsWith("#")?EA(e,r,n):e}function Q1(e,r,n){let o=new URL(`#${e.$anchor}`,r.href),i=new URL(n.href,r.href);if(s.IsEqual(o.href,i.href))return e}function EA(e,r,n){return n.href.endsWith("#")?e:n.hash.startsWith("#")?xr.Get(e,decodeURIComponent(n.hash.slice(1))):void 0}function W1(e,r,n){if(jn(e)){let o=V1(e,r,n);if(!s.IsUndefined(o))return o}if(ba(e)){let o=Q1(e,r,n);if(!s.IsUndefined(o))return o}return EA(e,r,n)}function Z1(e,r,n){return e.reduce((o,i)=>{let a=Ll(i,r,n);return s.IsUndefined(a)?o:a},void 0)}function X1(e,r,n){return s.Keys(e).reduce((o,i)=>{let a=Ll(e[i],r,n);return s.IsUndefined(a)?o:a},void 0)}function Ll(e,r,n){if(r=br(e)&&jn(e)?new URL(e.$id,r.href):r,br(e)){let o=W1(e,r,n);if(!s.IsUndefined(o))return o}if(s.IsArray(e))return Z1(e,r,n);if(s.IsObject(e))return X1(e,r,n)}function J1(e,r){let n=new URL("http://unknown"),o=jn(e)?new URL(e.$id,n.href):n,i=new URL(r,o.href);return Ll(e,o,i)}var Kn=class{constructor(r,n){this.context=r,this.schema=n,this.ids=[],this.anchors=[],this.recursiveAnchors=[],this.dynamicAnchors=[]}BaseURL(){return this.ids.reduce((r,n)=>new URL(n.$id,r),new URL("http://unknown"))}Base(){return this.ids[this.ids.length-1]??this.schema}Push(r){br(r)&&(jn(r)&&this.ids.push(r),ba(r)&&this.anchors.push(r),Vc(r)&&this.recursiveAnchors.push(r),Om(r)&&this.dynamicAnchors.push(r))}Pop(r){br(r)&&(jn(r)&&this.ids.pop(),ba(r)&&this.anchors.pop(),Vc(r)&&this.recursiveAnchors.pop(),Om(r)&&this.dynamicAnchors.pop())}FromContext(r){return s.HasPropertyKey(this.context,r)?this.context[r]:void 0}FromRef(r){return r.startsWith("#")?Hn.Ref(this.Base(),r):Hn.Ref(this.schema,r)}Ref(r){return this.FromContext(r)??this.FromRef(r)}RecursiveRef(r){return Vc(this.Base())?Hn.Ref(this.recursiveAnchors[0],r):Hn.Ref(this.Base(),r)}};function _A(...e){let[r,n,o]=ae.Match(e,{3:(c,m,l)=>[c,m,l],2:(c,m)=>[{},c,m]}),i=new Kn(r,n),a=new lt;return G(i,a,n,o)}function IA(...e){let[r,n,o]=ae.Match(e,{3:(y,E,A)=>[y,E,A],2:(y,E)=>[{},y,E]}),i=Rt.Get(),a=Qg(),c=[],m=new Kn(r,n),l=new Pa(y=>{if(!s.IsGreaterEqualThan(c.length,i.maxErrors))return c.push({...y,message:a(y)})});return[Z(m,l,"#","",n,o),c]}function de(...e){let[r,n,o]=ae.Match(e,{3:(i,a,c)=>[i,a,c],2:(i,a)=>[{},i,a]});return _A(r,n,o)}function sn(...e){let[r,n,o]=ae.Match(e,{3:(c,m,l)=>[c,m,l],2:(c,m)=>[{},c,m]}),[i,a]=IA(r,n,o);return a}var cn=class extends Error{constructor(r,n,o){super(r),Object.defineProperty(this,"cause",{value:{source:r,errors:o,value:n},writable:!1,configurable:!1,enumerable:!1})}};function bA(e,r,n){return s.IsArray(n)?n.map(o=>Ye(e,r.items,o)):n}function SA(e,r,n){return r.Clean(n)}function OA(e,r,n){return Ye({...e,...r.$defs},we(r.$ref),n)}function tj(e){let r=s.HasPropertyKey(e,"unevaluatedProperties")?{additionalProperties:e.unevaluatedProperties}:{},n=Ht(e);return k(n)?Uc(n,r):n}function AA(e,r,n){let o=tj(r);return Ye(e,o,n)}function Zc(e){return s.HasPropertyKey(e,"additionalProperties")?e.additionalProperties:void 0}function xA(e,r,n){if(!s.IsObject(n)||s.IsArray(n))return n;let o=Zc(r);for(let i of s.Keys(n)){if(s.HasPropertyKey(r.properties,i)){n[i]=Ye(e,r.properties[i],n[i]);continue}if(s.IsBoolean(o)&&s.IsEqual(o,!0)||O(o)&&de(e,o,n[i])){n[i]=Ye(e,o,n[i]);continue}delete n[i]}return n}function RA(e,r,n){if(!s.IsObject(n))return n;let o=Zc(r),[i,a]=[new RegExp(Ot(r)),et(r)];for(let c of s.Keys(n)){if(i.test(c)){n[c]=Ye(e,a,n[c]);continue}if(s.IsBoolean(o)&&s.IsEqual(o,!0)||O(o)&&de(e,o,n[c])){n[c]=Ye(e,o,n[c]);continue}delete n[c]}return n}function CA(e,r,n){return s.HasPropertyKey(e,r.$ref)?Ye(e,e[r.$ref],n):n}function PA(e,r,n){if(!s.IsArray(n))return n;let o=Math.min(n.length,r.items.length);for(let i=0;i<o;i++)n[i]=Ye(e,r.items[i],n[i]);return s.IsGreaterThan(n.length,o)?n.slice(0,o):n}function rj(e){let r={};for(let n of Object.getOwnPropertyNames(e))r[n]=fe(e[n]);for(let n of Object.getOwnPropertySymbols(e))r[n]=fe(e[n]);return r}function nj(e){return s.IsClassInstance(e)?e:rj(e)}function oj(e){return e.map(r=>fe(r))}function ij(e){return e.slice()}function aj(e){return new Map(fe([...e.entries()]))}function sj(e){return new Set(fe([...e.values()]))}function fe(e){return at.IsTypeArray(e)?ij(e):at.IsMap(e)?aj(e):at.IsSet(e)?sj(e):s.IsArray(e)?oj(e):s.IsObject(e)?nj(e):e}function UA(e,r,n){for(let o of r.anyOf){let i=Ye(e,o,fe(n));if(de(e,o,i))return i}return n}function Ye(e,r,n){return re(r)?bA(e,r,n):Ct(r)?SA(e,r,n):le(r)?OA(e,r,n):w(r)?AA(e,r,n):k(r)?xA(e,r,n):Ie(r)?RA(e,r,n):pe(r)?CA(e,r,n):V(r)?PA(e,r,n):S(r)?UA(e,r,n):n}function Yn(...e){let[r,n,o]=ae.Match(e,{3:(i,a,c)=>[i,a,c],2:(i,a)=>[{},i,a]});return Ye(r,n,o)}function wA(e,r,n){return s.IsArray(n)?n.map(o=>ve(e,r.items,o)):n}function NA(e,r,n){return r.Convert(n)}var oe={};vt(oe,{Fail:()=>Vn,IsOk:()=>kl,Ok:()=>U,TryBigInt:()=>Ml,TryBoolean:()=>xj,TryNull:()=>Lj,TryNumber:()=>Bj,TryString:()=>Qj,TryUndefined:()=>rq});function kl(e){return s.IsObject(e)&&s.HasPropertyKey(e,"value")}function U(e){return{value:e}}function Vn(){}function cj(e){return U(e)}function pj(e){return s.IsEqual(e,!0)?U(BigInt(1)):U(BigInt(0))}function uj(e){return U(BigInt(Math.trunc(e)))}function mj(e){return U(BigInt(0))}var lj=/^-?(0|[1-9]\d*)n$/,dj=/^-?(0|[1-9]\d*)\.\d+$/,fj=/^-?(0|[1-9]\d*)$/;function gj(e){return lj.test(e)}function yj(e){return dj.test(e)}function hj(e){return fj.test(e)}function Tj(e){let r=e.toLowerCase();return gj(e)?U(BigInt(e.slice(0,e.length-1))):yj(e)?U(BigInt(e.split(".")[0])):hj(e)?U(BigInt(e)):s.IsEqual(r,"false")?U(BigInt(0)):s.IsEqual(r,"true")?U(BigInt(1)):void 0}function Ej(e){return U(BigInt(0))}function Ml(e){return s.IsBigInt(e)?cj(e):s.IsBoolean(e)?pj(e):s.IsNumber(e)?uj(e):s.IsNull(e)?mj(e):s.IsString(e)?Tj(e):s.IsUndefined(e)?Ej(e):void 0}function _j(e){return s.IsEqual(e,BigInt(0))?U(!1):s.IsEqual(e,BigInt(1))?U(!0):void 0}function Ij(e){return U(e)}function bj(e){return s.IsEqual(e,0)?U(!1):s.IsEqual(e,1)?U(!0):void 0}function Sj(e){return U(!1)}function Oj(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 Aj(e){return U(!1)}function xj(e){return s.IsBigInt(e)?_j(e):s.IsBoolean(e)?Ij(e):s.IsNumber(e)?bj(e):s.IsNull(e)?Sj(e):s.IsString(e)?Oj(e):s.IsUndefined(e)?Aj(e):void 0}function Rj(e){return s.IsEqual(e,BigInt(0))?U(null):void 0}function Cj(e){return s.IsEqual(e,!1)?U(null):void 0}function Pj(e){return s.IsEqual(e,0)?U(null):void 0}function Uj(e){return U(null)}function wj(e){let r=e.toLowerCase();return s.IsEqual(r,"undefined")||s.IsEqual(r,"null")||s.IsEqual(e,"")||s.IsEqual(e,"0")?U(null):void 0}function Nj(e){return U(null)}function Lj(e){return s.IsBigInt(e)?Rj(e):s.IsBoolean(e)?Cj(e):s.IsNumber(e)?Pj(e):s.IsNull(e)?Uj(e):s.IsString(e)?wj(e):s.IsUndefined(e)?Nj(e):void 0}var vj=BigInt(Number.MAX_SAFE_INTEGER),kj=BigInt(Number.MIN_SAFE_INTEGER);function Mj(e){return e<=vj&&e>=kj}function LA(e){return Mj(e)?U(Number(e)):void 0}function Dj(e){return e?U(1):U(0)}function Gj(e){return U(e)}function $j(e){return U(0)}function jj(e){let r=+e;if(s.IsNumber(r))return U(r);let n=e.toLowerCase();if(s.IsEqual(n,"false"))return U(0);if(s.IsEqual(n,"true"))return U(1);let o=Ml(e);return kl(o)?LA(o.value):void 0}function qj(e){return U(0)}function Bj(e){return s.IsBigInt(e)?LA(e):s.IsBoolean(e)?Dj(e):s.IsNumber(e)?Gj(e):s.IsNull(e)?$j(e):s.IsString(e)?jj(e):s.IsUndefined(e)?qj(e):void 0}function Fj(e){return U(e.toString())}function Hj(e){return U(e.toString())}function Kj(e){return U(e.toString())}function zj(e){return U("null")}function Yj(e){return U(e)}function Vj(e){return U("")}function Qj(e){return s.IsBigInt(e)?Fj(e):s.IsBoolean(e)?Hj(e):s.IsNumber(e)?Kj(e):s.IsNull(e)?zj(e):s.IsString(e)?Yj(e):s.IsUndefined(e)?Vj(e):void 0}function Wj(e){return s.IsEqual(e,BigInt(0))?U(void 0):void 0}function Zj(e){return s.IsEqual(e,!1)?U(void 0):void 0}function Xj(e){return s.IsEqual(e,0)?U(void 0):void 0}function Jj(e){return U(void 0)}function eq(e){let r=e.toLowerCase();return s.IsEqual(r,"undefined")||s.IsEqual(r,"null")||s.IsEqual(e,"")||s.IsEqual(e,"0")?U(void 0):void 0}function tq(e){return U(void 0)}function rq(e){return s.IsBigInt(e)?Wj(e):s.IsBoolean(e)?Zj(e):s.IsNumber(e)?Xj(e):s.IsNull(e)?Jj(e):s.IsString(e)?eq(e):s.IsUndefined(e)?tq(e):void 0}function vA(e,r,n){if(s.IsBigInt(n))return n;let o=oe.TryBigInt(n);return oe.IsOk(o)?o.value:n}function kA(e,r,n){if(s.IsBoolean(n))return n;let o=oe.TryBoolean(n);return oe.IsOk(o)?o.value:n}function MA(e,r,n){return ve({...e,...r.$defs},we(r.$ref),n)}function Xc(e,r,n){if(r.anyOf.some(c=>de(e,c,n)))return n;let a=r.anyOf.map(c=>ve(e,c,fe(n))).find(c=>de(e,r,c));return s.IsUndefined(a)?n:a}function DA(e,r,n){let o=Pn(r);return Xc(e,o,n)}function GA(e,r,n){if(s.IsInteger(n))return n;let o=oe.TryNumber(n);return oe.IsOk(o)?Math.trunc(o.value):n}function $A(e,r,n){let o=Ht(r);return ve(e,o,n)}function nq(e,r,n){let o=oe.TryBigInt(n);return oe.IsOk(o)&&s.IsEqual(r.const,o.value)?o.value:n}function oq(e,r,n){let o=oe.TryBoolean(n);return oe.IsOk(o)&&s.IsEqual(r.const,o.value)?o.value:n}function iq(e,r,n){let o=oe.TryNumber(n);return oe.IsOk(o)&&s.IsEqual(r.const,o.value)?o.value:n}function aq(e,r,n){let o=oe.TryString(n);return oe.IsOk(o)&&s.IsEqual(r.const,o.value)?o.value:n}function jA(e,r,n){return s.IsEqual(r.const,n)?n:ny(r)?nq(e,r,n):oy(r)?oq(e,r,n):mo(r)?iq(e,r,n):lo(r)?aq(e,r,n):H()}function qA(e,r,n){if(s.IsNull(n))return n;let o=oe.TryNull(n);return oe.IsOk(o)?o.value:n}function BA(e,r,n){if(s.IsNumber(n))return n;let o=oe.TryNumber(n);return oe.IsOk(o)?o.value:n}function Jc(e,r,n,o){let i=s.Keys(o);for(let[a,c]of r)for(let m of i)a.test(m)||(o[m]=ve(e,n,o[m]));return o}function La(e,r,n){return Me(e)&&s.IsUndefined(n[r])}function sq(e,r,n){let o=s.EntriesRegExp(r.properties),i=s.Keys(n);for(let[a,c]of o)for(let m of i)!a.test(m)||La(c,m,n)||(n[m]=ve(e,c,n[m]));return s.HasPropertyKey(r,"additionalProperties")&&s.IsObject(r.additionalProperties)?Jc(e,o,r.additionalProperties,n):n}function FA(e,r,n){return s.IsObjectNotArray(n)?sq(e,r,n):n}function cq(e,r,n){let o=s.EntriesRegExp(r.patternProperties),i=s.Keys(n);for(let[a,c]of o)for(let m of i)a.test(m)&&(n[m]=ve(e,c,n[m]));return s.HasPropertyKey(r,"additionalProperties")&&s.IsObject(r.additionalProperties)?Jc(e,o,r.additionalProperties,n):n}function HA(e,r,n){return s.IsObjectNotArray(n)?cq(e,r,n):n}function KA(e,r,n){return s.HasPropertyKey(e,r.$ref)?ve(e,e[r.$ref],n):n}function zA(e,r,n){if(s.IsString(n))return n;let o=oe.TryString(n);return oe.IsOk(o)?o.value:n}function YA(e,r,n){let o=tt(r.pattern);return ve(e,o,n)}function VA(e,r,n){if(!s.IsArray(n))return n;for(let o=0;o<Math.min(r.items.length,n.length);o++)n[o]=ve(e,r.items[o],n[o]);return n}function QA(e,r,n){if(s.IsUndefined(n))return n;let o=oe.TryUndefined(n);return oe.IsOk(o)?o.value:n}function WA(e,r,n){if(s.IsUndefined(n))return n;let o=oe.TryUndefined(n);return oe.IsOk(o)?void 0:n}function ve(e,r,n){return re(r)?wA(e,r,n):Ct(r)?NA(e,r,n):St(r)?vA(e,r,n):pt(r)?kA(e,r,n):le(r)?MA(e,r,n):Re(r)?DA(e,r,n):Be(r)?GA(e,r,n):w(r)?$A(e,r,n):J(r)?jA(e,r,n):Jt(r)?qA(e,r,n):_e(r)?BA(e,r,n):k(r)?FA(e,r,n):Ie(r)?HA(e,r,n):pe(r)?KA(e,r,n):Ne(r)?zA(e,r,n):Ce(r)?YA(e,r,n):V(r)?VA(e,r,n):rr(r)?QA(e,r,n):S(r)?Xc(e,r,n):At(r)?WA(e,r,n):n}function pn(...e){let[r,n,o]=ae.Match(e,{3:(i,a,c)=>[i,a,c],2:(i,a)=>[{},i,a]});return ve(r,n,o)}function ZA(e,r,n){if(!s.IsArray(n))return n;for(let o=0;o<n.length;o++)n[o]=qe(e,r.items,n[o]);return n}function XA(e,r,n){return r.Default(n)}function JA(e,r,n){return qe({...e,...r.$defs},we(r.$ref),n)}function ex(e,r){return s.IsUndefined(r)?s.IsFunction(e.default)?e.default():fe(e.default):r}function tx(e,r,n){let o=Ht(r);return qe(e,o,n)}function rx(e,r,n){if(!s.IsObject(n))return n;let o=s.Keys(r.properties);for(let i of o){let a=qe(e,r.properties[i],n[i]);s.IsUndefined(a)&&(Me(r.properties[i])||!s.HasPropertyKey(r.properties[i],"default"))||(n[i]=qe(e,r.properties[i],n[i]))}if(!Sr(r)||s.IsBoolean(r.additionalProperties))return n;for(let i of s.Keys(n))o.includes(i)||(n[i]=qe(e,r.additionalProperties,n[i]));return n}function nx(e,r,n){if(!s.IsObject(n))return n;let[o,i]=[new RegExp(Ot(r)),et(r)];for(let a of s.Keys(n))o.test(a)&&wt(i)&&(n[a]=qe(e,i,n[a]));if(!Sr(r))return n;for(let a of s.Keys(n))o.test(a)||(n[a]=qe(e,r.additionalProperties,n[a]));return n}function ox(e,r,n){return s.HasPropertyKey(e,r.$ref)?qe(e,e[r.$ref],n):n}function ix(e,r,n){if(!s.IsArray(n))return n;let[o,i]=[r.items,Math.max(r.items.length,n.length)];for(let a=0;a<i;a++)a<o.length&&(n[a]=qe(e,o[a],n[a]));return n}function ax(e,r,n){for(let o of r.anyOf){let i=qe(e,o,fe(n));if(de(e,o,i))return i}return n}function qe(e,r,n){let o=wt(r)?ex(r,n):n;return re(r)?ZA(e,r,o):Ct(r)?XA(e,r,o):le(r)?JA(e,r,o):w(r)?tx(e,r,o):k(r)?rx(e,r,o):Ie(r)?nx(e,r,o):pe(r)?ox(e,r,o):V(r)?ix(e,r,o):S(r)?ax(e,r,o):o}function Qn(...e){let[r,n,o]=ae.Match(e,{3:(i,a,c)=>[i,a,c],2:(i,a)=>[{},i,a]});return qe(r,n,o)}function Qo(e){return(...r)=>{let[n,o,i]=ae.Match(r,{3:(a,c,m)=>[a,c,m],2:(a,c)=>[{},a,c]});return e.reduce((a,c)=>c(n,o,a),i)}}function pq(e,r,n){return r["~codec"].decode(n)}function uq(e,r,n){return r["~codec"].encode(n)}function Oe(e,r,n,o){return On(n)?s.IsEqual(e,"Decode")?pq(r,n,o):uq(r,n,o):o}function mq(e,r,n,o){if(!s.IsArray(o))return H();for(let i=0;i<o.length;i++)o[i]=he(e,r,n.items,o[i]);return Oe(e,r,n,o)}function lq(e,r,n,o){let i=Oe(e,r,n,o);if(!s.IsArray(i))return i;for(let a=0;a<i.length;a++)i[a]=he(e,r,n.items,i[a]);return i}function sx(e,r,n,o){return s.IsEqual(e,"Decode")?mq(e,r,n,o):lq(e,r,n,o)}function cx(e,r,n,o){return o=he(e,{...r,...n.$defs},we(n.$ref),o),Oe(e,r,n,o)}function dq(e,r,n,o){for(let i of n.allOf)o=he(e,r,i,o);return Oe(e,r,n,o)}function fq(e,r,n,o){let i=Oe(e,r,n,o);for(let a of n.allOf)i=he(e,r,a,i);return i}function px(e,r,n,o){return s.IsEqual(e,"Decode")?dq(e,r,n,o):fq(e,r,n,o)}function gq(e,r,n,o){if(!s.IsObjectNotArray(o))return H();for(let i of s.Keys(n.properties))!s.HasPropertyKey(o,i)||La(n.properties[i],i,o)||(o[i]=he(e,r,n.properties[i],o[i]));return Oe(e,r,n,o)}function yq(e,r,n,o){let i=Oe(e,r,n,o);if(!s.IsObjectNotArray(i))return i;for(let a of s.Keys(n.properties))!s.HasPropertyKey(i,a)||La(n.properties[a],a,i)||(i[a]=he(e,r,n.properties[a],i[a]));return i}function ux(e,r,n,o){return s.IsEqual(e,"Decode")?gq(e,r,n,o):yq(e,r,n,o)}function hq(e,r,n,o){if(!s.IsObjectNotArray(o))return H();let i=new RegExp(Ot(n));for(let a of s.Keys(o))i.test(a)||H(),o[a]=he(e,r,et(n),o[a]);return Oe(e,r,n,o)}function Tq(e,r,n,o){let i=Oe(e,r,n,o);if(!s.IsObjectNotArray(i))return i;let a=new RegExp(Ot(n));for(let c of s.Keys(i))a.test(c)&&(i[c]=he(e,r,et(n),i[c]));return i}function mx(e,r,n,o){return s.IsEqual(e,"Decode")?hq(e,r,n,o):Tq(e,r,n,o)}function lx(e,r,n,o){return o=s.HasPropertyKey(r,n.$ref)?he(e,r,r[n.$ref],o):o,Oe(e,r,n,o)}function Eq(e,r,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,r,n.items[i],o[i]);return Oe(e,r,n,o)}function _q(e,r,n,o){let i=Oe(e,r,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,r,n.items[a],i[a]);return i}function dx(e,r,n,o){return s.IsEqual(e,"Decode")?Eq(e,r,n,o):_q(e,r,n,o)}function Iq(e,r,n,o){for(let i of n.anyOf){if(!de(r,i,o))continue;let a=he(e,r,i,o);return Oe(e,r,n,a)}return H()}function bq(e,r,n,o){let i=Oe(e,r,n,o);for(let a of n.anyOf){let c=he(e,r,a,fe(i));if(de(r,a,c))return c}return i}function fx(e,r,n,o){return s.IsEqual(e,"Decode")?Iq(e,r,n,o):bq(e,r,n,o)}function he(e,r,n,o){return re(n)?sx(e,r,n,o):le(n)?cx(e,r,n,o):w(n)?px(e,r,n,o):k(n)?ux(e,r,n,o):Ie(n)?mx(e,r,n,o):pe(n)?lx(e,r,n,o):V(n)?dx(e,r,n,o):S(n)?fx(e,r,n,o):Oe(e,r,n,o)}var Dl=class extends cn{constructor(r,n){super("Decode",r,n)}};function Sq(e,r,n){if(!de(e,r,n))throw new Dl(n,sn(e,r,n));return n}function Oq(e,r,n){return he("Decode",e,r,n)}var XGe=Qo([(e,r,n)=>fe(n),(e,r,n)=>Qn(e,r,n),(e,r,n)=>pn(e,r,n),(e,r,n)=>Yn(e,r,n),(e,r,n)=>Sq(e,r,n),(e,r,n)=>Oq(e,r,n)]);var Gl=class extends cn{constructor(r,n){super("Encode",r,n)}};function Aq(e,r,n){if(!de(e,r,n))throw new Gl(n,sn(e,r,n));return n}function xq(e,r,n){return he("Encode",e,r,n)}var u$e=Qo([(e,r,n)=>fe(n),(e,r,n)=>xq(e,r,n),(e,r,n)=>Qn(e,r,n),(e,r,n)=>pn(e,r,n),(e,r,n)=>Yn(e,r,n),(e,r,n)=>Aq(e,r,n)]);var Gt=class extends Error{constructor(r,n){super(n),this.type=r}};function gx(e,r){return s.IsFunction(r.default)?r.default(r):s.IsObject(r.default)?fe(r.default):r.default}function yx(e,r){if(zo(r)&&!wt(r))throw new Gt(r,"Arrays with uniqueItems constraints must specify a default annotation");let n=Ho(r)?r.minItems:0;return Array.from({length:n},()=>Te(e,r.items))}async function*Rq(){}function hx(e,r){return Rq()}function Tx(e,r){return r.Create()}function Ex(e,r){return Or(r)?BigInt(r.exclusiveMinimum)+BigInt(1):Ar(r)?BigInt(r.minimum):BigInt(0)}function _x(e,r){return!1}function Ix(e,r){let n=Te(e,r.instanceType);return class{constructor(){Object.assign(this,n)}}}function bx(e,r){return Te({...e,...r.$defs},we(r.$ref))}function Sx(e,r){return Te(e,Pn(r))}function Ox(e,r){let n=Te(e,r.returnType);return()=>n}function Ax(e,r){return Or(r)&&s.IsNumber(r.exclusiveMinimum)?r.exclusiveMinimum+1:Ar(r)?r.minimum:0}function xx(e,r){return Te(e,Ht(r))}function*Cq(){}function Rx(e,r){return Cq()}function Cx(e,r){return r.const}function Px(e,r){throw new Gt(r,"Cannot create TNever types")}function Ux(e,r){return null}function wx(e,r){return Or(r)&&s.IsNumber(r.exclusiveMinimum)?r.exclusiveMinimum+1:Ar(r)?r.minimum:0}function Nx(e,r){return(s.IsUndefined(r.required)?[]:r.required).reduce((o,i)=>({...o,[i]:Te(e,r.properties[i])}),{})}function Lx(e,r){return Promise.resolve(Te(e,r.item))}function vx(e,r){if(Aa(r)&&!wt(r))throw new Gt(r,"Record with the minProperties constraint must have a default annotation");return{}}function kx(e,r){return s.HasPropertyKey(e,r.$ref)?Te(e,e[r.$ref]):(()=>{throw new Gt(r,"Unable to deref Ref")})()}function Mx(e,r){if((xa(r)||Sa(r))&&!wt(r))throw Error("Strings with format or pattern constraints must specify default");let o=Oa(r)?r.minLength:0;return"".padEnd(o)}function Dx(e,r){return Symbol()}function Gx(e,r){let n=tt(r.pattern);if(Ne(n))throw new Gt(r,"Unable to create TemplateLiteral due to infinite type expansion");return Te(e,n)}function $x(e,r){return Array.from({length:r.minItems},(n,o)=>Te(e,r.items[o]))}function jx(e,r){if(s.IsEqual(r.anyOf.length,0))throw Error("Unable to create Union with no variants");return Te(e,r.anyOf[0])}function Te(e,r){return wt(r)?gx(e,r):re(r)?yx(e,r):ot(r)?hx(e,r):Ct(r)?Tx(e,r):St(r)?Ex(e,r):pt(r)?_x(e,r):De(r)?Ix(e,r):le(r)?bx(e,r):Re(r)?Sx(e,r):Ge(r)?Ox(e,r):Be(r)?Ax(e,r):w(r)?xx(e,r):it(r)?Rx(e,r):J(r)?Cx(e,r):dr(r)?Px(e,r):Jt(r)?Ux(e,r):_e(r)?wx(e,r):k(r)?Nx(e,r):Je(r)?Lx(e,r):Ie(r)?vx(e,r):pe(r)?kx(e,r):Ne(r)?Mx(e,r):er(r)?Dx(e,r):Ce(r)?Gx(e,r):V(r)?$x(e,r):rr(r)?void 0:S(r)?jx(e,r):At(r)?void 0:void 0}function cr(...e){let[r,n]=ae.Match(e,{2:(o,i)=>[o,i],1:o=>[{},o]});return Te(r,n)}var $l=class extends cn{constructor(r,n){super("Parse",r,n)}};function Pq(e,r,n){if(!de(e,r,n))throw new $l(n,sn(e,r,n));return n}var gqe=Qo([(e,r,n)=>fe(n),(e,r,n)=>Qn(e,r,n),(e,r,n)=>pn(e,r,n),(e,r,n)=>Yn(e,r,n),(e,r,n)=>Pq(e,r,n)]);var wq=N({type:Y("insert"),path:_t(),value:Ze()}),Nq=Object({type:Y("update"),path:_t(),value:Ze()}),Lq=N({type:Y("delete"),path:_t()}),bqe=q([wq,Nq,Lq]);function Wo(e){if(!e.body)throw new Error("This command does not accept a request body");let r=e.body;return r.examples?.length?r.examples[0]:cr(r)}function Wn(e,r,n,o,i){e.command(r).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){W(Wo(o));return}let c=Bo(a),m=await i()(o,{body:c});W(m)})}function Fx(e,r){let n=e.command("experimental").description("Experimental commands \u2014 unstable, subject to change without notice");Wn(n,"promql","Run a PromQL query (experimental)",YS,r)}var Dq=`/${"v1"}/feedback`,Hx=t.Object({id:t.String({description:"API request ID recorded with the feedback."})},{$id:"Feedback",description:"A recorded piece of feedback"}),Gq={id:"request-123-abc"};Object.assign(Hx,{examples:[Gq]});var Kx=t.Object({content:p({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."})}),$q={content:"The traces command times out for large services."};Object.assign(Kx,{examples:[$q]});var zx=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:Dq,method:"POST",body:Kx,response:Hx});function Yx(e,r){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 r()(zx,{body:{content:n.join(" ")}});W(o)})}var jq={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-route":{read:["public_viewer","public_editor","admin"],write:["admin","public_editor"]},metric:{read:["public_viewer","public_editor","admin"],write:[]},trace:{read:["public_viewer","public_editor","admin"],write:[]},rum:{read:["public_viewer","public_editor","admin"],write:[]},monitor:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"monitor-alert":{read:["public_viewer","public_editor","admin"],write:[]},"monitor-debugging":{read:["admin"],write:[]},"notification-integration":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"notification-rule":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"adaptive-notification-rule":{read:["public_viewer","public_editor","admin"],write:["admin"]},"notification-silence":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"saml-config":{read:["admin"],write:["admin"]},org:{read:["public_viewer","public_editor","admin"],write:["admin"]},"allowed-domains":{read:["public_viewer","public_editor","admin"],write:["admin"]},"quality-report":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"sensitive-data-scanner-rule":{read:["public_viewer","public_editor","admin"],write:["admin"]},slo:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"retention-policy":{read:["public_viewer","public_editor","admin"],write:["admin"]},"databricks-connection":{read:["public_viewer","public_editor","admin"],write:["admin"]},service:{read:["public_viewer","public_editor","admin"],write:[]},"service-target":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},host:{read:["public_viewer","public_editor","admin"],write:[]},database:{read:["public_viewer","public_editor","admin"],write:[]},"tag-policy":{read:["public_viewer","public_editor","admin"],write:["admin"]},team:{read:["public_viewer","public_editor","admin"],write:["admin"]},"team-members":{read:["public_viewer","public_editor","admin"],write:["admin"]},"team-remap-config":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-data":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-invitation":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-permissions":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-self":{read:["public_viewer","public_editor","admin"],write:["public_viewer","public_editor","admin"]},"oauth-grant":{read:[],write:[]}},qq={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:[]},"cloud-account":{read:["viewer","editor","admin"],write:[]},dashboard:{read:["viewer","editor","admin"],write:["editor","admin"]},"dashboard-folder":{read:["viewer","editor","admin"],write:["editor","admin"]},"dashboard-report":{read:["viewer","editor","admin"],write:["editor","admin"]},inventory:{read:["viewer","editor","admin"],write:[]},log:{read:["viewer","editor","admin"],write:[]},"log-route":{read:["viewer","editor","admin"],write:["editor","admin"]},"metric-route":{read:["viewer","editor","admin"],write:["editor","admin"]},metric:{read:["viewer","editor","admin"],write:[]},trace:{read:["viewer","editor","admin"],write:[]},rum:{read:["viewer","editor","admin"],write:[]},monitor:{read:["viewer","editor","admin"],write:["editor","admin"]},"monitor-alert":{read:["viewer","editor","admin"],write:[]},"monitor-debugging":{read:["admin"],write:[]},"notification-integration":{read:["viewer","editor","admin"],write:["editor","admin"]},"notification-rule":{read:["viewer","editor","admin"],write:["editor","admin"]},"adaptive-notification-rule":{read:["viewer","editor","admin"],write:[]},"notification-silence":{read:["viewer","editor","admin"],write:["editor","admin"]},"saml-config":{read:["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:[]},"databricks-connection":{read:[],write:[]},service:{read:["viewer","editor","admin"],write:[]},"service-target":{read:["viewer","editor","admin"],write:["editor","admin"]},host:{read:["viewer","editor","admin"],write:[]},database:{read:["viewer","editor","admin"],write:[]},"tag-policy":{read:[],write:[]},team:{read:["viewer","editor","admin"],write:["admin"]},"team-members":{read:["viewer","editor","admin"],write:["admin"]},"team-remap-config":{read:[],write:[]},"user-data":{read:["viewer","editor","admin"],write:["admin"]},"user-invitation":{read:["viewer","editor","admin"],write:["admin"]},"user-permissions":{read:["viewer","editor","admin"],write:[]},"user-self":{read:["viewer","editor","admin"],write:["viewer","editor","admin"]},"oauth-grant":{read:[],write:[]}},Bq={user:jq,team:qq};function ql(e){return Vx(e,"team")}function Bl(e){return Vx(e,"user")}function Vx(e,r){let n=[],o=Bq[r];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 _He={admin:{name:"Global admin",description:"Full control across the organization. Can view and modify everything, including private teams.",permissions:Bl("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:Bl("public_editor"),roleKey:"public_editor"},public_viewer:{name:"Public viewer",description:"Read-only access to public team data. Cannot make changes.",permissions:Bl("public_viewer"),roleKey:"public_viewer"},teams_only:{name:"Teams only",description:"Only access data and assets in their own teams.",permissions:[],roleKey:"teams_only"}},IHe={admin:{name:"Team admin",description:"Full team control, manage assets, members, and settings.",permissions:ql("admin"),roleKey:"admin"},editor:{name:"Team editor",description:"Can view and update most assets (like dashboards, monitors).",permissions:ql("editor"),roleKey:"editor"},viewer:{name:"Team viewer",description:"Can view all team data but cannot make changes.",permissions:ql("viewer"),roleKey:"viewer"}};var Fl=["red","orange","amber","yellow","green","emerald","teal","cyan","sky","blue","indigo","purple","pink"],Hl=["light","dark"];var Fq={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)"}},Qx=["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 RHe=Fq.light.red.background;var Wx=[{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-----
|
|
127
|
+
fish: tsuga completion fish > ~/.config/fish/completions/tsuga.fish`).action(r=>{let{rows:n,valueFlags:o}=R$(e);if(r==="bash")B(C$(_S(n),o));else if(r==="zsh")B(P$(_S(n),o));else if(r==="fish")B(w$(U$(n),o));else throw new Error(`Unsupported shell "${r}". Supported: bash, zsh, fish.`)})}function SS(e){let r=e.command("config").description("Show or manage configuration");r.action(()=>{let n=e.opts(),o=Go({operationApiKey:n.operationApiKey,clusterId:n.cluster});B(Yb(o,Ta()).trimEnd())}),r.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)=>{Kb(n,o),B(`Default set: ${n} = ${o}`)}),r.command("reset").description("Reset configuration values").command("defaults").description("Clear all custom defaults").action(()=>{zb(),B("Custom defaults cleared")})}var OS=`/${"v1"}/docs`,AS=t.Object({path:t.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:t.String({description:'Title of the page (e.g. "Send your first logs" or "POST /v1/aggregation/multi-query/scalar")'}),content:t.String({description:"Raw markdown content of the page"})},{$id:"DocPage",description:"A documentation or API-reference page with its raw markdown content"}),N$={path:"getting-started/send-your-first-logs",title:"Send your first logs",content:`# Send your first logs
|
|
128
|
+
...`};Object.assign(AS,{examples:[N$]});var xS=t.Object({kind:t.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:t.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:t.String({description:'Title of the result (e.g. "How to Add Resource Attributes" or "POST /v1/aggregation/multi-query/scalar")'}),subsection:t.Optional(t.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:t.Optional(t.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:t.Optional(t.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:t.Number({description:"Relevance score between 0 and 1 (higher is more relevant)"}),excerpt:t.String({description:"Short snippet of matching content"}),link:t.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"}),L$={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(xS,{examples:[L$]});var RS=l({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:OS,method:"GET",query:t.Object({path:p({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:AS}),CS=l({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:`${OS}/search`,method:"GET",query:t.Object({query:p({allowEmpty:!1,description:"Search text to match against documentation and API-reference content."})},{description:"Documentation search query."}),response:t.Array(xS)});function PS(e,r){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 r()(RS,{query:{path:o}});Q(i)}),n.command("search <query>").description("Search documentation pages").action(async o=>{let i=await r()(CS,{query:{query:o}});Q(i)})}var US="__tsuga_cluster_id__",v$=t.Object({}),k$=t.Object({status:t.Literal("error"),message:t.String({description:"Why this cluster failed to answer the query."})});function jo(e=v$){let r=I("status",[t.Object({...e.properties,status:t.Literal("ok")}),k$]);return Object.assign(sc(Dt,r),{description:'Outcome per cluster, keyed by cluster ID. A cluster that failed reports `status: "error"`.'})}var _a=t.Array(p({allowEmpty:!1}),{minItems:1,maxItems:5,uniqueItems:!0,description:"IDs of the clusters to query, without duplicates. Mutually exclusive with `clusterId`. Omit both to use the default cluster."});var wS=t.Object({type:t.Literal("number"),number:t.String()}),M$=t.Object({type:t.Literal("string"),string:t.String()}),D$=t.Object({type:t.Literal("timestamp"),timestamp:t.String()}),Ia=I("type",[wS,M$,D$]),G$=t.Object({by:t.Record(t.String(),Ia),computed:t.Record(t.String(),wS)}),$$=t.Object({type:t.Literal("buckets"),buckets:t.Array(G$),clusterResponses:t.Optional(jo())}),j$=t.Object({type:t.Literal("distribution"),bounds:t.Array(t.Number()),buckets:t.Array(t.Object({timestamp:t.Number(),counts:t.Array(t.Number())})),percentiles:t.Optional(t.Array(t.Number()))}),qc=I("type",[$$,j$]);var q$=["all","owning-team-and-public","owning-team-only"],an=t.Enum(q$,{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 LS=1456444800,vS=4927737600,B$=LS*1e3,F$=vS*1e3,Bc=1704067200,ym=Bc*1e3,kS={title:"TimeRange",description:"Inclusive time range for telemetry queries. Use Unix timestamps in seconds unless the field description says milliseconds.",examples:[{from:Bc,to:Bc}]},H$={title:"TimeRange",description:"Inclusive time range for telemetry queries using Unix timestamps in milliseconds.",examples:[{from:ym,to:ym}]},Fc=e=>t.Integer({description:e,examples:[Bc],minimum:LS,maximum:vS,format:"int64"}),NS=e=>t.Integer({description:e,examples:[ym],minimum:B$,maximum:F$,format:"int64"}),Ke=t.Object({from:t.Optional(Fc("Start of the query window as a Unix timestamp in seconds")),to:t.Optional(Fc("End of the query window as a Unix timestamp in seconds"))},kS),mt=t.Object({from:Fc("Start of the query window as a Unix timestamp in seconds"),to:Fc("End of the query window as a Unix timestamp in seconds")},kS),qo=t.Object({from:NS("Start of the query window as a Unix timestamp in milliseconds"),to:NS("End of the query window as a Unix timestamp in milliseconds")},H$);var Y$="/v0/aggregation",V$=t.Union([t.Literal("a"),t.Literal("d"),t.Literal("q"),t.Literal("w"),t.Literal("t")]),hm=t.Object({parallelism:t.Number(),engine:V$,recordBatchCache:t.Optional(t.Boolean()),includeNullGroups:t.Optional(t.Boolean()),restartAwareGaugeSum:t.Optional(t.Boolean())}),Tm=["logs","metrics","traces"];var GS={logs:"Logs",metrics:"Metrics",traces:"Spans"},Q$=[...Tm,"connections","log-patterns","spans","rum"];var xSe={...GS,connections:"Connections","log-patterns":"Log Patterns",spans:"Spans",rum:"RUM events"},cr=[...Tm,"rum"];var RSe={...GS,rum:"RUM events"};var CSe=t.Enum(Q$,{description:"Data source being queried"}),$S=t.Enum(Tm,{description:"Telemetry source queried by this aggregation: `logs`, `metrics`, or `traces`."}),zt=t.Enum(cr,{description:"Telemetry source queried by this aggregation: `logs`, `metrics`, `traces`, or `rum`."}),Dn=t.String({description:"Attribute containing the values to aggregate"}),Gn=p({description:"Attribute containing the values to aggregate"}),W$=I("type",[t.Object({type:t.Literal("count",{description:"Counts the total number of records"}),field:t.Optional(Dn)},{$id:"AggregateCount",title:"Count"}),t.Object({type:t.Literal("unique-count",{description:"Counts the distinct values of the field"}),field:Dn},{$id:"AggregateUniqueCount",title:"UniqueCount"}),t.Object({type:t.Literal("average",{description:"Calculates the average value of the selected field"}),field:Dn},{$id:"AggregateAverage",title:"Average"}),t.Object({type:t.Literal("max",{description:"Finds the largest value of the field"}),field:Dn},{$id:"AggregateMax",title:"Max"}),t.Object({type:t.Literal("min",{description:"Finds the smallest value of the field"}),field:Dn},{$id:"AggregateMin",title:"Min"}),t.Object({type:t.Literal("sum",{description:"Sums the values of the selected field"}),field:Dn},{$id:"AggregateSum",title:"Sum"}),t.Object({type:t.Literal("percentile",{description:"Calculates a percentile of the selected field"}),field:Dn,percentile:t.Number({description:"Percentile to compute for the selected field."})},{$id:"AggregatePercentile",title:"Percentile"})],{title:"Aggregate",description:"Aggregation operation for this query. Required for every query; `field` is required by all aggregate types except `count`."}),Z$=I("type",[t.Object({type:t.Literal("count",{description:"Counts the total number of records"}),field:t.Optional(Gn)},{$id:"InputAggregateCount",title:"Count"}),t.Object({type:t.Literal("unique-count",{description:"Counts the distinct values of the field"}),field:Gn},{$id:"InputAggregateUniqueCount",title:"UniqueCount"}),t.Object({type:t.Literal("average",{description:"Calculates the average value of the selected field"}),field:Gn},{$id:"InputAggregateAverage",title:"Average"}),t.Object({type:t.Literal("max",{description:"Finds the largest value of the field"}),field:Gn},{$id:"InputAggregateMax",title:"Max"}),t.Object({type:t.Literal("min",{description:"Finds the smallest value of the field"}),field:Gn},{$id:"InputAggregateMin",title:"Min"}),t.Object({type:t.Literal("sum",{description:"Sums the values of the selected field"}),field:Gn},{$id:"InputAggregateSum",title:"Sum"}),t.Object({type:t.Literal("percentile",{description:"Calculates a percentile of the selected field"}),field:Gn,percentile:t.Number({description:"Percentile to compute for the selected field."})},{$id:"InputAggregatePercentile",title:"Percentile"})],{title:"InputAggregate",description:"Aggregation operation for this query. Required for every query; `field` is required by all aggregate types except `count`."}),jS=t.Object({type:t.Literal("per-second",{description:"Normalizes the metric to events per second"})},{$id:"FunctionPerSecond",title:"PerSecond"}),qS=t.Object({type:t.Literal("per-minute",{description:"Normalizes the metric to events per minute"})},{$id:"FunctionPerMinute",title:"PerMinute"}),BS=t.Object({type:t.Literal("per-hour",{description:"Normalizes the metric to events per hour"})},{$id:"FunctionPerHour",title:"PerHour"}),FS=t.Object({type:t.Literal("rate",{description:"Calculates the rate of change"})},{$id:"FunctionRate",title:"Rate"}),HS=t.Object({type:t.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"}),KS=t.Object({type:t.Literal("power",{description:"Raises values to a specified power"}),exponent:t.Integer({description:"The exponent to raise values to"})},{$id:"FunctionPower",title:"Power"}),zS=t.Object({type:t.Literal("sqrt",{description:"Applies a square root transformation to the values"})},{$id:"FunctionSqrt",title:"Sqrt"}),YS=t.Object({type:t.Literal("last",{description:"Takes the last value of the metric for the selected time frame"})},{$id:"FunctionLast",title:"Last"}),X$=t.Object({type:t.Literal("rolling",{description:"Computes a rolling window aggregate"}),window:t.String({description:"Duration of the rolling window"})},{$id:"FunctionRolling",title:"Rolling"}),J$=t.Object({type:t.Literal("rolling",{description:"Computes a rolling window aggregate"}),window:p({allowEmpty:!1,description:"Duration of the rolling window"})},{$id:"InputFunctionRolling",title:"Rolling"}),e1=t.Object({type:t.Literal("log",{description:"Applies a logarithm transformation to the values"}),base:t.Integer({description:"The base of the logarithm"})},{$id:"FunctionLog",title:"Log"}),t1=t.Object({type:t.Literal("log",{description:"Applies a logarithm transformation to the values"}),base:t.Integer({description:"The base of the logarithm",minimum:2})},{$id:"InputFunctionLog",title:"Log"}),r1=t.Object({type:t.Literal("time-offset",{description:"Shifts a query's data backward by a specified duration for easy comparison over different periods of time."}),seconds:t.Integer({description:"Number of seconds to offset"})},{$id:"FunctionTimeOffset",title:"TimeOffset"}),n1=t.Object({type:t.Literal("time-offset",{description:"Shifts a query's data backward by a specified duration for easy comparison over different periods of time."}),seconds:t.Integer({description:"Number of seconds to offset",minimum:1})},{$id:"InputFunctionTimeOffset",title:"TimeOffset"}),o1=I("type",[jS,qS,BS,FS,HS,X$,e1,KS,zS,YS,r1],{title:"Function",description:"Post-processing function applied to an aggregation query result after the aggregate is computed, selected by `type`."}),i1=I("type",[jS,qS,BS,FS,HS,J$,t1,KS,zS,YS,n1],{title:"InputFunction",description:"Post-processing function applied to an aggregation query result after the aggregate is computed, selected by `type`."});var MS=t.Object({min:t.Number({description:"Lower bound of the distribution range."}),max:t.Number({description:"Upper bound of the distribution range."})}),a1=["linear","log"],Hc=t.Enum(a1,{description:"Spacing of the bucket boundaries across the distribution range. `linear` splits the range into equal-width buckets; `log` widens each bucket logarithmically, giving finer resolution near the lower bound."}),DS=t.Integer({minimum:1}),s1=I("type",[t.Object({type:t.Literal("scalar")},{title:"Scalar",description:"Returns a single value"}),t.Object({type:t.Literal("timeseries"),aggregationWindow:p({description:'Time bucket size for aggregation (e.g. "10s", "60s", "1m")'})},{title:"Timeseries",description:"Returns a time series"}),t.Object({type:t.Literal("histogram"),by:t.Optional(p()),bucketCount:t.Optional(DS),bounds:t.Optional(MS),boundsScale:t.Optional(Hc),percentiles:t.Optional(t.Array(t.Number({minimum:0,maximum:100,multipleOf:1}),{minItems:1}))},{title:"Histogram",description:"Returns a single distribution over the entire time range"}),t.Object({type:t.Literal("heatmap"),aggregationWindow:p({description:'Time bucket size for the heatmap (e.g. "10s", "60s", "1m")'}),by:t.Optional(p()),bucketCount:t.Optional(DS),bounds:t.Optional(MS)},{title:"Heatmap",description:"Returns a distribution per time window"})]),Kc=15,c1=["zero","null"],p1=t.Enum(c1,{description:"`zero` fills missing points with zero. `null` keeps missing points null."}),VS=t.Object({mode:t.Object({type:p1},{description:"How missing aggregation points should be filled."})},{description:"Missing-point fill behavior for aggregation results. Optional; omit to keep missing points null."}),QS=t.Union([t.Literal("avg"),t.Literal("sum"),t.Literal("min"),t.Literal("max"),t.Literal("last")],{description:"Per-series rollup applied within each time bucket before the cross-series aggregate. When omitted, a default is derived from the metric type."}),WS={aggregate:W$,functions:t.Optional(t.Array(o1,{description:"Post-processing functions applied to aggregation results"})),fill:t.Optional(VS),timeAggregate:t.Optional(QS)},ZS={aggregate:Z$,functions:t.Optional(t.Array(i1,{maxItems:10,description:"Post-processing functions applied to aggregation results. Defaults to an empty array when omitted."})),fill:t.Optional(VS),timeAggregate:t.Optional(QS)},u1={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."},XS={maxItems:Kc,description:'Aggregations that may be combined together in the same query. Each item is referenced from `formula` as q1, q2, and so on, in submission order. For dataSource "metrics", each aggregate\'s `field` is the metric name, not an attribute; to count distinct values of an attribute use unique-count with field "<metricName>.context.<attribute>" (e.g. "system.cpu.utilization.context.host.name").'},JS=t.Array(t.Object({...WS,filter:t.Optional(t.String({description:"Filter to apply to the aggregation"}))},{title:"AggregationQuery"}),u1),ba=t.Array(t.Object({...ZS,filter:t.Optional(p({type:"tsuga-query",description:"Tsuga query filter to apply to the aggregation. Defaults to an empty string when omitted."}))},{title:"AggregationQuery"}),XS),_r=t.Array(t.Object({...WS,filter:t.String({description:"Filter to apply to the aggregation"})},{title:"MonitorAggregationQuery",description:"Single aggregation query evaluated by a monitor or SLO."}),{description:"Aggregation queries used by alerting and SLO evaluation. Each query is referenced from formulas as q1, q2, and so on."}),Ir=t.Array(t.Object({...ZS,filter:p({type:"tsuga-query",description:"Tsuga query filter applied to this alerting or SLO aggregation query. Required by the API; use the query language for the selected data source."})},{title:"MonitorAggregationQuery",description:"Single aggregation query evaluated by a monitor or SLO."}),{...XS,description:"Aggregation queries used by alerting and SLO evaluation. Each query is referenced from formulas as q1, q2, and so on."});var zc=t.String({description:"Formula referencing submitted query outputs, such as `q1 + q2`. References must be within `q1` through `qN` for the submitted queries."}),$n=p({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."}),m1=t.Object({fields:t.Array(t.String(),{description:"Telemetry attribute names used to group aggregation results."}),limit:t.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:t.Optional(t.Enum(["asc","desc"],{description:"Sort direction applied to groups: ascending or descending."})),replaceNullWith:t.Optional(t.String({description:"Value used to group documents that have no value for a grouped field."}))},{title:"AggregationGroupBy"}),l1=t.Object({fields:t.Array(p(),{maxItems:1,description:"Telemetry attribute name to group aggregation results by. Currently limited to one field per grouping level."}),limit:t.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:t.Optional(t.Enum(["asc","desc"],{description:"Sort direction applied to groups: ascending or descending."})),replaceNullWith:t.Optional(p({allowEmpty:!1,description:"Value used to group documents that have no value for a grouped field."}))},{title:"AggregationGroupBy"}),eO=7;var Bo=t.Array(m1,{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."}),br=t.Array(l1,{maxItems:eO,description:"Nested grouping levels applied to aggregation results, outermost first (e.g. group by service, then by level within each service). Each level splits results further, so the response contains one result per unique combination of group values instead of one aggregated total. Defaults to an empty array (one ungrouped result) when omitted."});var PSe=l({tags:["aggregation"],url:`${Y$}/multi-query`,method:"POST",body:t.Object({timeRange:qo,queries:ba,groupBy:t.Optional(br),returnType:s1,dataSource:zt,formula:$n,executionOptions:hm,triggeredBy:t.Optional(t.Literal("refresh")),shouldStreamResults:t.Optional(t.Boolean()),clusterId:t.Optional(p({allowEmpty:!1})),clusterIds:t.Optional(_a),viewAs:t.Optional(t.Object({owner:p({allowEmpty:!1,description:"Team ID to fetch data as"}),permissions:an}))}),response:qc});var d1=t.Union([t.Literal("scalar"),t.Literal("timeseries")]),f1="/v0/promql",Yc=t.Object({query:p({type:"long",allowEmpty:!1,description:"PromQL expression to evaluate."}),timeRange:qo,step:p({allowEmpty:!1,description:"Evaluation step interval (e.g. `1m`, `5m`, `1h`). Must be a valid Prometheus duration string."}),returnType:t.Optional(d1),executionOptions:hm,shouldStreamResults:t.Optional(t.Boolean()),clusterId:t.Optional(p({allowEmpty:!1,description:"Cluster to target. Defaults to the first cluster created in the organization when omitted."}))}),g1={query:'rate({"otel.trace.span_processor.spans"}[5m])',timeRange:{from:17822015e5,to:17822034e5},step:"1m",executionOptions:{parallelism:1,engine:"q"},clusterId:"cluster-abc"};Object.assign(Yc,{examples:[g1]});var DSe=l({tags:["promql"],url:f1,method:"POST",body:Yc,response:qc});var tO=`/${"v1"}/aggregation`,rO=t.Object({id:t.String({description:"Result identifier. Query results use `q1`, `q2`, and so on; formula results use `formula`."}),group:t.Record(t.String(),t.Union([t.String(),t.Number()]),{description:"Group-by field values for this result. Empty when no group-by is requested."})}),nO=t.Object({results:t.Array(t.Object({...rO.properties,value:t.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."}),y1={results:[{id:"q1",group:{host:"server-1"},value:123.45}]};Object.assign(nO,{examples:[y1]});var Vc=t.Object({series:t.Array(t.Object({...rO.properties,points:t.Array(t.Object({timestamp:t.Integer({description:"Unix timestamp in milliseconds for this point, spaced by `aggregationWindow`."}),value:t.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."}),h1={series:[{id:"q1",group:{host:"server-1"},points:[{timestamp:16094592e5,value:123.45},{timestamp:160945926e4,value:456.78}]}]};Object.assign(Vc,{examples:[h1]});var T1=t.Omit(ba.items,["fill"],{title:"AggregationQuery",description:"Aggregation query. Omit `filter` for an unfiltered query and omit `functions` when no post-processing is needed."}),E1=t.Optional(br),oO={timeRange:mt,queries:t.Array(T1,{maxItems:Kc,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 ${Kc} 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:E1,dataSource:$S,formula:t.Optional($n)},iO=t.Object({clusterId:t.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))}),aO=t.Object(oO,{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."}),_1={timeRange:{from:1782201500,to:1782203400},dataSource:"logs",queries:[{aggregate:{type:"count"},filter:"context.service.name:checkout"}],groupBy:[{fields:["level"],limit:5}]};Object.assign(aO,{examples:[_1]});var sO=l({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:`${tO}/multi-query/scalar`,method:"POST",body:aO,query:iO,response:nO}),cO=t.Object({...oO,aggregationWindow:p({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."}),I1={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(cO,{examples:[I1]});var pO=l({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:`${tO}/multi-query/timeseries`,method:"POST",body:cO,query:iO,response:Vc});var b1=`/${"v1"}/promql`,S1=t.Object({...t.Pick(Yc,["query","step"]).properties,timeRange:mt},{description:"PromQL range-query request. Send clusterId as a query parameter, not in this JSON body.",examples:[{query:'sum by ("context.service.name") (sum_over_time({"traces.span.metrics.calls", "span.kind"="SPAN_KIND_SERVER"}[5m]))',timeRange:{from:1782201500,to:1782203400},step:"1m"}]}),O1=t.Object({clusterId:t.Optional(p({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."}))}),uO=l({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. See [How to write PromQL queries](/documentation/visualize/guides/how-to-write-promql-queries) for query syntax and examples.",operationId:"queryPromql",tags:["public","promql"],url:b1,method:"POST",body:S1,query:O1,response:Vc});var mO=Ls(require("node:fs"));function Fo(e){if(e.file){let r=mO.default.readFileSync(e.file==="-"?0:e.file,"utf-8");return JSON.parse(r)}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 A1(e){return s.IsObject(e)&&s.HasPropertyKey(e,"check")&&s.HasPropertyKey(e,"errors")&&s.IsFunction(e.check)&&s.IsFunction(e.errors)}function Em(e){return s.HasPropertyKey(e,"~guard")&&A1(e["~guard"])}function _m(e){return s.HasPropertyKey(e,"~refine")&&s.IsArray(e["~refine"])&&s.Every(e["~refine"],0,r=>s.IsObject(r)&&s.HasPropertyKey(r,"refine")&&s.HasPropertyKey(r,"message")&&s.IsFunction(r.refine)&&s.IsString(r.message))}function Sr(e){return s.IsObject(e)&&!s.IsArray(e)}function Qc(e){return s.IsBoolean(e)}function j(e){return Sr(e)||Qc(e)}function Im(e){return s.HasPropertyKey(e,"additionalItems")&&j(e.additionalItems)}function Or(e){return s.HasPropertyKey(e,"additionalProperties")&&j(e.additionalProperties)}function bm(e){return s.HasPropertyKey(e,"allOf")&&s.IsArray(e.allOf)&&e.allOf.every(r=>j(r))}function Sa(e){return s.HasPropertyKey(e,"$anchor")&&s.IsString(e.$anchor)}function Sm(e){return s.HasPropertyKey(e,"anyOf")&&s.IsArray(e.anyOf)&&e.anyOf.every(r=>j(r))}function Om(e){return s.HasPropertyKey(e,"const")}function jn(e){return s.HasPropertyKey(e,"contains")&&j(e.contains)}function Nt(e){return s.HasPropertyKey(e,"default")}function Am(e){return s.HasPropertyKey(e,"dependencies")&&s.IsObject(e.dependencies)&&Object.values(e.dependencies).every(r=>j(r)||s.IsArray(r)&&r.every(n=>s.IsString(n)))}function xm(e){return s.HasPropertyKey(e,"dependentRequired")&&s.IsObject(e.dependentRequired)&&Object.values(e.dependentRequired).every(r=>s.IsArray(r)&&r.every(n=>s.IsString(n)))}function Rm(e){return s.HasPropertyKey(e,"dependentSchemas")&&s.IsObject(e.dependentSchemas)&&Object.values(e.dependentSchemas).every(r=>j(r))}function Cm(e){return s.HasPropertyKey(e,"$dynamicAnchor")&&s.IsString(e.$dynamicAnchor)}function Pm(e){return s.HasPropertyKey(e,"else")&&j(e.else)}function Um(e){return s.HasPropertyKey(e,"enum")&&s.IsArray(e.enum)}function wm(e){return s.HasPropertyKey(e,"exclusiveMaximum")&&(s.IsNumber(e.exclusiveMaximum)||s.IsBigInt(e.exclusiveMaximum))}function Ar(e){return s.HasPropertyKey(e,"exclusiveMinimum")&&(s.IsNumber(e.exclusiveMinimum)||s.IsBigInt(e.exclusiveMinimum))}function Oa(e){return s.HasPropertyKey(e,"format")&&s.IsString(e.format)}function qn(e){return s.HasPropertyKey(e,"$id")&&s.IsString(e.$id)}function Nm(e){return s.HasPropertyKey(e,"if")&&j(e.if)}function Ho(e){return s.HasPropertyKey(e,"items")&&(j(e.items)||s.IsArray(e.items)&&e.items.every(r=>j(r)))}function Lm(e){return Ho(e)&&s.IsArray(e.items)}function vm(e){return s.HasPropertyKey(e,"maximum")&&(s.IsNumber(e.maximum)||s.IsBigInt(e.maximum))}function km(e){return s.HasPropertyKey(e,"maxContains")&&s.IsNumber(e.maxContains)}function Wc(e){return s.HasPropertyKey(e,"maxItems")&&s.IsNumber(e.maxItems)}function Mm(e){return s.HasPropertyKey(e,"maxLength")&&s.IsNumber(e.maxLength)}function Dm(e){return s.HasPropertyKey(e,"maxProperties")&&s.IsNumber(e.maxProperties)}function xr(e){return s.HasPropertyKey(e,"minimum")&&(s.IsNumber(e.minimum)||s.IsBigInt(e.minimum))}function Bn(e){return s.HasPropertyKey(e,"minContains")&&s.IsNumber(e.minContains)}function Ko(e){return s.HasPropertyKey(e,"minItems")&&s.IsNumber(e.minItems)}function Aa(e){return s.HasPropertyKey(e,"minLength")&&s.IsNumber(e.minLength)}function xa(e){return s.HasPropertyKey(e,"minProperties")&&s.IsNumber(e.minProperties)}function Gm(e){return s.HasPropertyKey(e,"multipleOf")&&(s.IsNumber(e.multipleOf)||s.IsBigInt(e.multipleOf))}function $m(e){return s.HasPropertyKey(e,"not")&&j(e.not)}function jm(e){return s.HasPropertyKey(e,"oneOf")&&s.IsArray(e.oneOf)&&e.oneOf.every(r=>j(r))}function Ra(e){return s.HasPropertyKey(e,"pattern")&&(s.IsString(e.pattern)||e.pattern instanceof RegExp)}function Ca(e){return s.HasPropertyKey(e,"patternProperties")&&s.IsObject(e.patternProperties)&&Object.values(e.patternProperties).every(r=>j(r))}function zo(e){return s.HasPropertyKey(e,"prefixItems")&&s.IsArray(e.prefixItems)&&e.prefixItems.every(r=>j(r))}function Pa(e){return s.HasPropertyKey(e,"properties")&&s.IsObject(e.properties)&&Object.values(e.properties).every(r=>j(r))}function qm(e){return s.HasPropertyKey(e,"propertyNames")&&(s.IsObject(e.propertyNames)||j(e.propertyNames))}function x1(e){return s.HasPropertyKey(e,"$recursiveAnchor")&&s.IsBoolean(e.$recursiveAnchor)}function Zc(e){return x1(e)&&s.IsEqual(e.$recursiveAnchor,!0)}function Bm(e){return s.HasPropertyKey(e,"$recursiveRef")&&s.IsString(e.$recursiveRef)}function Fm(e){return s.HasPropertyKey(e,"$ref")&&s.IsString(e.$ref)}function Fn(e){return s.HasPropertyKey(e,"required")&&s.IsArray(e.required)&&e.required.every(r=>s.IsString(r))}function Hm(e){return s.HasPropertyKey(e,"then")&&j(e.then)}function Km(e){return s.HasPropertyKey(e,"type")&&(s.IsString(e.type)||s.IsArray(e.type)&&e.type.every(r=>s.IsString(r)))}function Yo(e){return s.HasPropertyKey(e,"uniqueItems")&&s.IsBoolean(e.uniqueItems)}function Xc(e){return s.HasPropertyKey(e,"unevaluatedItems")&&j(e.unevaluatedItems)}function Jc(e){return s.HasPropertyKey(e,"unevaluatedProperties")&&j(e.unevaluatedProperties)}var dt=class{constructor(){this.indices=new Set,this.keys=new Set}AddIndex(r){return this.indices.add(r),!0}AddKey(r){return this.keys.add(r),!0}GetIndices(){return this.indices}GetKeys(){return this.keys}Merge(r){for(let n of r)n.indices.forEach(o=>this.indices.add(o)),n.keys.forEach(o=>this.keys.add(o));return!0}},Ua=class extends dt{constructor(r){super(),this.callback=r}AddError(r){return this.callback(r),!1}},ze=class extends Ua{constructor(){super(r=>this.errors.push(r)),this.errors=[]}AddError(r){return this.errors.push(r),!1}GetErrors(){return this.errors}};var R1="external_",C1=0,ORe={identifier:`${R1}${C1}`,variables:[]};function lO(e,r,n,o){return n["~guard"].check(o)}function dO(e,r,n,o,i,a){return i["~guard"].check(a)||r.AddError({keyword:"~guard",schemaPath:n,instancePath:o,params:{errors:i["~guard"].errors(a)}})}function fO(e,r,n,o){return s.Every(n["~refine"],0,(i,a)=>i.refine(o))}function gO(e,r,n,o,i,a){return s.EveryAll(i["~refine"],0,(c,m)=>c.refine(a)||r.AddError({keyword:"~refine",schemaPath:n,instancePath:o,params:{index:m,message:c.message}}))}function yO(e){return Ho(e)&&s.IsArray(e.items)}function hO(e,r,n,o){return yO(n)?o.every((a,c)=>s.IsLessThan(c,n.items.length)||G(e,r,n.additionalItems,a)&&r.AddIndex(c)):!0}function TO(e,r,n,o,i,a){return yO(i)?a.every((m,d)=>{let f=`${n}/additionalItems`,y=`${o}/${d}`;return s.IsLessThan(d,i.items.length)||W(e,r,f,y,i.additionalItems,m)&&r.AddIndex(d)}):!0}function P1(e){return`^${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}$`}function EO(e){let r=[];return Ca(e)&&r.push(...s.Keys(e.patternProperties)),Pa(e)&&r.push(...s.Keys(e.properties).map(P1)),s.IsEqual(r.length,0)?"(?!)":`(${r.join("|")})`}function _O(e,r,n,o){let i=new RegExp(EO(n));return s.Every(s.Keys(o),0,(c,m)=>i.test(c)||G(e,r,n.additionalProperties,o[c])&&r.AddKey(c))}function IO(e,r,n,o,i,a){let c=new RegExp(EO(i)),m=[];return s.EveryAll(s.Keys(a),0,(f,y)=>{let E=`${n}/additionalProperties`,A=`${o}/${f}`,ye=new ze,Ue=c.test(f)||W(e,ye,E,A,i.additionalProperties,a[f])&&r.AddKey(f);return Ue||m.push(f),Ue})||r.AddError({keyword:"additionalProperties",schemaPath:n,instancePath:o,params:{additionalProperties:m}})}function bO(e,r,n,o){let i=n.allOf.reduce((a,c)=>{let m=new dt;return G(e,m,c,o)?[...a,m]:a},[]);return s.IsEqual(i.length,n.allOf.length)&&r.Merge(i)}function SO(e,r,n,o,i,a){let c=[],m=i.allOf.reduce((f,y,E)=>{let A=`${n}/allOf/${E}`,ye=new ze,Ue=W(e,ye,A,o,y,a);return Ue||c.push(ye),Ue?[...f,ye]:f},[]),d=s.IsEqual(m.length,i.allOf.length)&&r.Merge(m);return d||c.forEach(f=>f.GetErrors().forEach(y=>r.AddError(y))),d}function OO(e,r,n,o){let i=n.anyOf.reduce((a,c,m)=>{let d=new dt;return G(e,d,c,o)?[...a,d]:a},[]);return s.IsGreaterThan(i.length,0)&&r.Merge(i)}function AO(e,r,n,o,i,a){let c=[],m=i.anyOf.reduce((f,y,E)=>{let A=new ze,ye=`${n}/anyOf/${E}`,Ue=W(e,A,ye,o,y,a);return Ue||c.push(A),Ue?[...f,A]:f},[]),d=s.IsGreaterThan(m.length,0)&&r.Merge(m);return d||c.forEach(f=>f.GetErrors().forEach(y=>r.AddError(y))),d||r.AddError({keyword:"anyOf",schemaPath:n,instancePath:o,params:{}})}function Ym(e,r,n,o){return n}function xO(e,r,n,o,i,a){return Ym(e,r,i,a)||r.AddError({keyword:"boolean",schemaPath:n,instancePath:o,params:{}})}function Vm(e,r,n,o){return s.IsValueLike(n.const)?s.IsEqual(o,n.const):s.IsDeepEqual(o,n.const)}function RO(e,r,n,o,i,a){return Vm(e,r,i,a)||r.AddError({keyword:"const",schemaPath:n,instancePath:o,params:{allowedValue:i.const}})}function U1(e){return!(Bn(e)&&s.IsEqual(e.minContains,0))}function Qm(e,r,n,o){return U1(n)?!s.IsEqual(o.length,0)&&o.some(i=>G(e,r,n.contains,i)):!0}function CO(e,r,n,o,i,a){return Qm(e,r,i,a)||r.AddError({keyword:"contains",schemaPath:n,instancePath:o,params:{minContains:1}})}function PO(e,r,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(d=>s.HasPropertyKey(o,d)):G(e,r,m,o)));return i||a}function UO(e,r,n,o,i,a){let c=s.IsEqual(s.Keys(a).length,0),m=s.EveryAll(s.Entries(i.dependencies),0,([d,f])=>{let y=`${n}/dependencies/${d}`;return!s.HasPropertyKey(a,d)||(s.IsArray(f)?f.every(E=>s.HasPropertyKey(a,E)||r.AddError({keyword:"dependencies",schemaPath:n,instancePath:o,params:{property:d,dependencies:f}})):W(e,r,y,o,f,a))});return c||m}function wO(e,r,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(d=>s.HasPropertyKey(o,d)));return i||a}function NO(e,r,n,o,i,a){let c=s.IsEqual(s.Keys(a).length,0),m=s.EveryAll(s.Entries(i.dependentRequired),0,([d,f])=>!s.HasPropertyKey(a,d)||s.EveryAll(f,0,y=>s.HasPropertyKey(a,y)||r.AddError({keyword:"dependentRequired",schemaPath:n,instancePath:o,params:{property:d,dependencies:f}})));return c||m}function LO(e,r,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)||G(e,r,m,o));return i||a}function vO(e,r,n,o,i,a){let c=s.IsEqual(s.Keys(a).length,0),m=s.EveryAll(s.Entries(i.dependentSchemas),0,([d,f])=>{let y=`${n}/dependentSchemas/${d}`;return!s.HasPropertyKey(a,d)||W(e,r,y,o,f,a)});return c||m}function Wm(e,r,n,o){return n.enum.some(i=>s.IsValueLike(i)?s.IsEqual(o,i):s.IsDeepEqual(o,i))}function kO(e,r,n,o,i,a){return Wm(e,r,i,a)||r.AddError({keyword:"enum",schemaPath:n,instancePath:o,params:{allowedValues:i.enum}})}function Zm(e,r,n,o){return s.IsLessThan(o,n.exclusiveMaximum)}function MO(e,r,n,o,i,a){return Zm(e,r,i,a)||r.AddError({keyword:"exclusiveMaximum",schemaPath:n,instancePath:o,params:{comparison:"<",limit:i.exclusiveMaximum}})}function Xm(e,r,n,o){return s.IsGreaterThan(o,n.exclusiveMinimum)}function DO(e,r,n,o,i,a){return Xm(e,r,i,a)||r.AddError({keyword:"exclusiveMinimum",schemaPath:n,instancePath:o,params:{comparison:">",limit:i.exclusiveMinimum}})}var Qo={};kt(Qo,{Clear:()=>$O,Entries:()=>Q1,Get:()=>X1,Has:()=>Z1,IsDate:()=>wa,IsDateTime:()=>Jm,IsDuration:()=>el,IsEmail:()=>tl,IsHostname:()=>rl,IsIPv4:()=>al,IsIPv6:()=>sl,IsIdnEmail:()=>nl,IsIdnHostname:()=>il,IsIri:()=>pl,IsIriReference:()=>cl,IsJsonPointer:()=>ml,IsJsonPointerUriFragment:()=>ul,IsRegex:()=>ll,IsRelativeJsonPointer:()=>dl,IsTime:()=>Na,IsUri:()=>yl,IsUriReference:()=>fl,IsUriTemplate:()=>gl,IsUrl:()=>hl,IsUuid:()=>Tl,Reset:()=>jO,Set:()=>W1,Test:()=>J1});var w1=[0,31,28,31,30,31,30,31,31,30,31,30,31],N1=/^(\d\d\d\d)-(\d\d)-(\d\d)$/;function L1(e){return e%4===0&&(e%100!==0||e%400===0)}function wa(e){let r=N1.exec(e);if(!r)return!1;let n=+r[1],o=+r[2],i=+r[3];return o>=1&&o<=12&&i>=1&&i<=(o===2&&L1(n)?29:w1[o])}var v1=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(?:Z|([+-])(\d\d):(\d\d))?$/i;function Na(e,r=!0){let n=v1.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),d=+(n[6]||0);if(m>23||d>59||r&&!n[4]&&e.toLowerCase().indexOf("z")===-1)return!1;if(o<=23&&i<=59&&a<60)return!0;let f=i-d*c,y=o-m*c-(f<0?1:0);return(y===23||y===-1)&&(f===59||f===-1)&&a<61}function Jm(e,r=!0){let n=e.split(/T/i);return n.length===2&&wa(n[0])&&Na(n[1],r)}var k1=/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/;function el(e){return k1.test(e)}var M1=/^(?!.*\.\.)[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 tl(e){return M1.test(e)}var D1=/^(?=.{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 rl(e){return D1.test(e)}var G1=/^(?!.*\.\.)[\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 nl(e){return G1.test(e)}function ol(e){let r=e.codePointAt(0);return r===void 0?!1:r>=12352&&r<=12447||r>=12448&&r<=12543&&r!==12539||r>=19968&&r<=40959}function il(e){if(e.length===0||e.includes(" "))return!1;let r=/[\u002E\u3002\uFF0E\uFF61]/g,n=e.normalize("NFC").replace(r,".");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 d=i.slice(4);if(d.length<2||d.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 d=0;d<i.length;d++){let f=i.charAt(d);if(f==="\xB7"){if(d===0||d===i.length-1)return!1;let y=i.charAt(d-1),E=i.charAt(d+1);if(!/^[lL]$/.test(y)||!/^[lL]$/.test(E))return!1}if(f==="\u30FB"){if(i.length===1)return!1;if(d===0){let y=i.charAt(d+1);if(!ol(y))return!1}else{let y=i.charAt(d-1),E=i.charAt(d+1);if(!ol(y)||!ol(E))return!1}}if(f==="\u0375"){if(d===i.length-1)return!1;let y=i.charAt(d+1);if(!/[\u0370-\u03FF]/.test(y))return!1}if(f==="\u05F3"||f==="\u05F4"){if(d===0)return!1;let y=i.charAt(d-1);if(!/[\u05D0-\u05EA]/.test(y))return!1}if(f==="\u200D"&&(d===0||i.charAt(d-1)!=="\u094D"))return!1}let c=!1,m=!1;for(let d=0;d<i.length;d++){let f=i.charAt(d);/[\u0660-\u0669]/.test(f)&&(c=!0),/[\u06F0-\u06F9]/.test(f)&&(m=!0)}if(c&&m)return!1}return!0}var $1=/^(?:(?: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 al(e){return $1.test(e)}var j1=/^((([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 sl(e){return j1.test(e)}function GO(e){try{return new URL(e,"http://example.com"),!0}catch{return!1}}function cl(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 r=e.indexOf(":");return r>0&&/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e.substring(0,r))?GO(e):e.match(/^([a-zA-Z][a-zA-Z0-9+\-.]*)(\/\/)/)&&r===-1?!1:GO(e)}function pl(e){try{return new URL(e),!0}catch{return!1}}var q1=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;function ul(e){return q1.test(e)}var B1=/^(?:\/(?:[^~/]|~0|~1)*)*$/;function ml(e){return B1.test(e)}function ll(e){if(e.length===0)return!1;try{return new RegExp(e),!0}catch{return!1}}var F1=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function dl(e){return F1.test(e)}var H1=/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i;function fl(e){return H1.test(e)}var K1=/^(?:(?:[^\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 gl(e){return K1.test(e)}var z1=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i;function yl(e){return z1.test(e)}var Y1=/^(?: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 hl(e){return Y1.test(e)}var V1=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;function Tl(e){return V1.test(e)}var ge=new Map;function $O(){ge.clear()}function Q1(){return[...ge.entries()]}function W1(e,r){ge.set(e,r)}function Z1(e){return ge.has(e)}function X1(e){return ge.get(e)}function J1(e,r){return ge.get(e)?.(r)??!0}function jO(){$O(),ge.set("date-time",Jm),ge.set("date",wa),ge.set("duration",el),ge.set("email",tl),ge.set("hostname",rl),ge.set("idn-email",nl),ge.set("idn-hostname",il),ge.set("ipv4",al),ge.set("ipv6",sl),ge.set("iri-reference",cl),ge.set("iri",pl),ge.set("json-pointer-uri-fragment",ul),ge.set("json-pointer",ml),ge.set("regex",ll),ge.set("relative-json-pointer",dl),ge.set("time",Na),ge.set("uri-reference",fl),ge.set("uri-template",gl),ge.set("uri",yl),ge.set("url",hl),ge.set("uuid",Tl)}jO();function El(e,r,n,o){return Qo.Test(n.format,o)}function qO(e,r,n,o,i,a){return El(e,r,i,a)||r.AddError({keyword:"format",schemaPath:n,instancePath:o,params:{format:i.format}})}function BO(e,r,n,o){let i=Hm(n)?n.then:!0,a=Pm(n)?n.else:!0;return G(e,r,n.if,o)?G(e,r,i,o):G(e,r,a,o)}function FO(e,r,n,o,i,a){let c=Hm(i)?i.then:!0,m=Pm(i)?i.else:!0,d=new ze,f=W(e,d,`${n}/if`,o,i.if,a)?W(e,d,`${n}/then`,o,c,a)||r.AddError({keyword:"if",schemaPath:n,instancePath:o,params:{failingKeyword:"then"}}):W(e,r,`${n}/else`,o,m,a)||r.AddError({keyword:"if",schemaPath:n,instancePath:o,params:{failingKeyword:"else"}});return f&&r.Merge([d]),f}function ej(e,r,n,o){return s.Every(n.items,0,(i,a)=>s.IsLessEqualThan(o.length,a)||G(e,r,i,o[a])&&r.AddIndex(a))}function tj(e,r,n,o,i,a){return s.EveryAll(i.items,0,(c,m)=>{let d=`${n}/items/${m}`,f=`${o}/${m}`;return s.IsLessEqualThan(a.length,m)||W(e,r,d,f,c,a[m])&&r.AddIndex(m)})}function rj(e,r,n,o){let i=zo(n)?n.prefixItems.length:0;return s.Every(o,i,(a,c)=>G(e,r,n.items,a)&&r.AddIndex(c))}function nj(e,r,n,o,i,a){let c=zo(i)?i.prefixItems.length:0;return s.EveryAll(a,c,(m,d)=>{let f=`${n}/items`,y=`${o}/${d}`;return W(e,r,f,y,i.items,m)&&r.AddIndex(d)})}function HO(e,r,n,o){return Lm(n)?ej(e,r,n,o):rj(e,r,n,o)}function KO(e,r,n,o,i,a){return Lm(i)?tj(e,r,n,o,i,a):nj(e,r,n,o,i,a)}function oj(e){return jn(e)}function _l(e,r,n,o){if(!oj(n))return!0;let i=o.reduce((a,c)=>G(e,r,n.contains,c)?++a:a,0);return s.IsLessEqualThan(i,n.maxContains)}function zO(e,r,n,o,i,a){let c=Bn(i)?i.minContains:1;return _l(e,r,i,a)||r.AddError({keyword:"contains",schemaPath:n,instancePath:o,params:{minContains:c,maxContains:i.maxContains}})}function Il(e,r,n,o){return s.IsLessEqualThan(o,n.maximum)}function YO(e,r,n,o,i,a){return Il(e,r,i,a)||r.AddError({keyword:"maximum",schemaPath:n,instancePath:o,params:{comparison:"<=",limit:i.maximum}})}function bl(e,r,n,o){return s.IsLessEqualThan(o.length,n.maxItems)}function VO(e,r,n,o,i,a){return bl(e,r,i,a)||r.AddError({keyword:"maxItems",schemaPath:n,instancePath:o,params:{limit:i.maxItems}})}function Sl(e,r,n,o){return s.IsMaxLength(o,n.maxLength)}function QO(e,r,n,o,i,a){return Sl(e,r,i,a)||r.AddError({keyword:"maxLength",schemaPath:n,instancePath:o,params:{limit:i.maxLength}})}function Ol(e,r,n,o){return s.IsLessEqualThan(s.Keys(o).length,n.maxProperties)}function WO(e,r,n,o,i,a){return Ol(e,r,i,a)||r.AddError({keyword:"maxProperties",schemaPath:n,instancePath:o,params:{limit:i.maxProperties}})}function ij(e){return jn(e)}function Al(e,r,n,o){if(!ij(n))return!0;let i=o.reduce((a,c)=>G(e,r,n.contains,c)?++a:a,0);return s.IsGreaterEqualThan(i,n.minContains)}function ZO(e,r,n,o,i,a){return Al(e,r,i,a)||r.AddError({keyword:"contains",schemaPath:n,instancePath:o,params:{minContains:i.minContains}})}function xl(e,r,n,o){return s.IsGreaterEqualThan(o,n.minimum)}function XO(e,r,n,o,i,a){return xl(e,r,i,a)||r.AddError({keyword:"minimum",schemaPath:n,instancePath:o,params:{comparison:">=",limit:i.minimum}})}function Rl(e,r,n,o){return s.IsGreaterEqualThan(o.length,n.minItems)}function JO(e,r,n,o,i,a){return Rl(e,r,i,a)||r.AddError({keyword:"minItems",schemaPath:n,instancePath:o,params:{limit:i.minItems}})}function Cl(e,r,n,o){return s.IsMinLength(o,n.minLength)}function eA(e,r,n,o,i,a){return Cl(e,r,i,a)||r.AddError({keyword:"minLength",schemaPath:n,instancePath:o,params:{limit:i.minLength}})}function Pl(e,r,n,o){return s.IsGreaterEqualThan(s.Keys(o).length,n.minProperties)}function tA(e,r,n,o,i,a){return Pl(e,r,i,a)||r.AddError({keyword:"minProperties",schemaPath:n,instancePath:o,params:{limit:i.minProperties}})}function Ul(e,r,n,o){return s.IsMultipleOf(o,n.multipleOf)}function rA(e,r,n,o,i,a){return Ul(e,r,i,a)||r.AddError({keyword:"multipleOf",schemaPath:n,instancePath:o,params:{multipleOf:i.multipleOf}})}function wl(e,r,n,o){let i=new dt;return!G(e,i,n.not,o)&&r.Merge([i])}function nA(e,r,n,o,i,a){return wl(e,r,i,a)||r.AddError({keyword:"not",schemaPath:n,instancePath:o,params:{}})}function oA(e,r,n,o){let i=n.oneOf.reduce((a,c)=>{let m=new dt;return G(e,m,c,o)?[...a,m]:a},[]);return s.IsEqual(i.length,1)&&r.Merge(i)}function iA(e,r,n,o,i,a){let c=[],m=[],d=i.oneOf.reduce((y,E,A)=>{let ye=new ze,Ue=`${n}/oneOf/${A}`,Dr=W(e,ye,Ue,o,E,a);return Dr&&m.push(A),Dr||c.push(ye),Dr?[...y,ye]:y},[]),f=s.IsEqual(d.length,1)&&r.Merge(d);return!f&&s.IsEqual(m.length,0)&&c.forEach(y=>y.GetErrors().forEach(E=>r.AddError(E))),f||r.AddError({keyword:"oneOf",schemaPath:n,instancePath:o,params:{passingSchemas:m}})}function Nl(e,r,n,o){return(s.IsString(n.pattern)?new RegExp(n.pattern):n.pattern).test(o)}function aA(e,r,n,o,i,a){return Nl(e,r,i,a)||r.AddError({keyword:"pattern",schemaPath:n,instancePath:o,params:{pattern:i.pattern}})}function sA(e,r,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,d])=>!c.test(m)||G(e,r,a,d)&&r.AddKey(m))})}function cA(e,r,n,o,i,a){return s.EveryAll(s.Entries(i.patternProperties),0,([c,m])=>{let d=`${n}/patternProperties/${c}`,f=new RegExp(c);return s.EveryAll(s.Entries(a),0,([y,E])=>{let A=`${o}/${y}`;return!f.test(y)||W(e,r,d,A,m,E)&&r.AddKey(y)})})}function pA(e,r,n,o){return s.IsEqual(o.length,0)||s.Every(n.prefixItems,0,(i,a)=>s.IsLessEqualThan(o.length,a)||G(e,r,i,o[a])&&r.AddIndex(a))}function uA(e,r,n,o,i,a){return s.IsEqual(a.length,0)||s.EveryAll(i.prefixItems,0,(c,m)=>{let d=`${n}/prefixItems/${m}`,f=`${o}/${m}`;return s.IsLessEqualThan(a.length,m)||W(e,r,d,f,c,a[m])&&r.AddIndex(m)})}function Ll(e,r){return e.includes(r)||Ct.Get().exactOptionalPropertyTypes}function vl(e,r){return s.IsUndefined(e[r])}function mA(e,r,n,o){let i=Fn(n)?n.required:[];return s.Every(s.Entries(n.properties),0,([c,m])=>{let d=!s.HasPropertyKey(o,c)||G(e,r,m,o[c])&&r.AddKey(c);return Ll(i,c)?d:vl(o,c)||d})}function lA(e,r,n,o,i,a){let c=Fn(i)?i.required:[];return s.EveryAll(s.Entries(i.properties),0,([d,f])=>{let y=`${n}/properties/${d}`,E=`${o}/${d}`,A=()=>!s.HasPropertyKey(a,d)||W(e,r,y,E,f,a[d])&&r.AddKey(d);return Ll(c,d)?A():vl(a,d)||A()})}function dA(e,r,n,o){return s.Every(s.Keys(o),0,(i,a)=>G(e,r,n.propertyNames,i))}function fA(e,r,n,o,i,a){let c=[];return s.EveryAll(s.Keys(a),0,(d,f)=>{let y=`${o}/${d}`,E=`${n}/propertyNames`,A=new ze,ye=W(e,A,E,y,i.propertyNames,d);return ye||c.push(d),ye})||r.AddError({keyword:"propertyNames",schemaPath:n,instancePath:o,params:{propertyNames:c}})}function gA(e,r,n,o){let i=e.RecursiveRef(n.$recursiveRef)??!1;return j(i)&&G(e,r,i,o)}function yA(e,r,n,o,i,a){let c=e.RecursiveRef(i.$recursiveRef)??!1;return j(c)&&W(e,r,"#",o,c,a)}function EA(e,r,n,o){let i=e.Ref(n.$ref)??!1,a=new dt,c=j(i)&&G(e,a,i,o);return c&&r.Merge([a]),c}function _A(e,r,n,o,i,a){let c=e.Ref(i.$ref)??!1,m=new ze,d=j(c)&&W(e,m,"#",o,c,a);return d&&r.Merge([m]),d||m.GetErrors().forEach(f=>r.AddError(f)),d}function IA(e,r,n,o){return s.Every(n.required,0,i=>s.HasPropertyKey(o,i))}function bA(e,r,n,o,i,a){let c=[];return s.EveryAll(i.required,0,d=>{let f=s.HasPropertyKey(a,d);return f||c.push(d),f})||r.AddError({keyword:"required",schemaPath:n,instancePath:o,params:{requiredProperties:c}})}function kl(e,r,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 SA(e,r,n,o,i){return n.some(a=>kl(e,r,a,o,i))}function OA(e,r,n,o){return s.IsArray(n.type)?SA(e,r,n.type,n,o):kl(e,r,n.type,n,o)}function AA(e,r,n,o,i,a){return(s.IsArray(i.type)?SA(e,r,i.type,i,a):kl(e,r,i.type,i,a))||r.AddError({keyword:"type",schemaPath:n,instancePath:o,params:{type:i.type}})}function xA(e,r,n,o){let i=r.GetIndices();return s.Every(o,0,(a,c)=>(i.has(c)||G(e,r,n.unevaluatedItems,a))&&r.AddIndex(c))}function RA(e,r,n,o,i,a){let c=r.GetIndices(),m=[];return s.EveryAll(a,0,(f,y)=>{let E=new ze,A=(c.has(y)||W(e,E,n,o,i.unevaluatedItems,f))&&r.AddIndex(y);return A||m.push(y),A})||r.AddError({keyword:"unevaluatedItems",schemaPath:n,instancePath:o,params:{unevaluatedItems:m}})}function CA(e,r,n,o){let i=r.GetKeys();return s.Every(s.Entries(o),0,([a,c])=>i.has(a)||G(e,r,n.unevaluatedProperties,c)&&r.AddKey(a))}function PA(e,r,n,o,i,a){let c=r.GetKeys(),m=[];return s.EveryAll(s.Entries(a),0,([f,y])=>{let E=new ze,A=c.has(f)||W(e,E,n,o,i.unevaluatedProperties,y)&&r.AddKey(f);return A||m.push(f),A})||r.AddError({keyword:"unevaluatedProperties",schemaPath:n,instancePath:o,params:{unevaluatedProperties:m}})}function UA(e){return!s.IsEqual(e.uniqueItems,!1)}function wA(e,r,n,o){if(!UA(n))return!0;let i=new Set(o.map(Kr.Hash)).size,a=o.length;return s.IsEqual(i,a)}function NA(e,r,n,o,i,a){if(!UA(i))return!0;let c=new Set,m=a.reduce((f,y,E)=>{let A=Kr.Hash(y);return c.has(A)?[...f,E]:(c.add(A),f)},[]);return s.IsEqual(m.length,0)||r.AddError({keyword:"uniqueItems",schemaPath:n,instancePath:o,params:{duplicateItems:m}})}function G(e,r,n,o){e.Push(n);let i=Qc(n)?Ym(e,r,n,o):(!Km(n)||OA(e,r,n,o))&&(!(s.IsObject(o)&&!s.IsArray(o))||(!Fn(n)||IA(e,r,n,o))&&(!Or(n)||_O(e,r,n,o))&&(!Am(n)||PO(e,r,n,o))&&(!xm(n)||wO(e,r,n,o))&&(!Rm(n)||LO(e,r,n,o))&&(!Ca(n)||sA(e,r,n,o))&&(!Pa(n)||mA(e,r,n,o))&&(!qm(n)||dA(e,r,n,o))&&(!xa(n)||Pl(e,r,n,o))&&(!Dm(n)||Ol(e,r,n,o)))&&(!s.IsArray(o)||(!Im(n)||hO(e,r,n,o))&&(!jn(n)||Qm(e,r,n,o))&&(!Ho(n)||HO(e,r,n,o))&&(!km(n)||_l(e,r,n,o))&&(!Wc(n)||bl(e,r,n,o))&&(!Bn(n)||Al(e,r,n,o))&&(!Ko(n)||Rl(e,r,n,o))&&(!zo(n)||pA(e,r,n,o))&&(!Yo(n)||wA(e,r,n,o)))&&(!s.IsString(o)||(!Oa(n)||El(e,r,n,o))&&(!Mm(n)||Sl(e,r,n,o))&&(!Aa(n)||Cl(e,r,n,o))&&(!Ra(n)||Nl(e,r,n,o)))&&(!(s.IsNumber(o)||s.IsBigInt(o))||(!wm(n)||Zm(e,r,n,o))&&(!Ar(n)||Xm(e,r,n,o))&&(!vm(n)||Il(e,r,n,o))&&(!xr(n)||xl(e,r,n,o))&&(!Gm(n)||Ul(e,r,n,o)))&&(!Bm(n)||gA(e,r,n,o))&&(!Fm(n)||EA(e,r,n,o))&&(!Em(n)||lO(e,r,n,o))&&(!Om(n)||Vm(e,r,n,o))&&(!Um(n)||Wm(e,r,n,o))&&(!Nm(n)||BO(e,r,n,o))&&(!$m(n)||wl(e,r,n,o))&&(!bm(n)||bO(e,r,n,o))&&(!Sm(n)||OO(e,r,n,o))&&(!jm(n)||oA(e,r,n,o))&&(!Xc(n)||!s.IsArray(o)||xA(e,r,n,o))&&(!Jc(n)||!s.IsObject(o)||CA(e,r,n,o))&&(!_m(n)||fO(e,r,n,o));return e.Pop(n),i}function W(e,r,n,o,i,a){e.Push(i);let c=Qc(i)?xO(e,r,n,o,i,a):!!(+(!Km(i)||AA(e,r,n,o,i,a))&+(!(s.IsObject(a)&&!s.IsArray(a))||!!(+(!Fn(i)||bA(e,r,n,o,i,a))&+(!Or(i)||IO(e,r,n,o,i,a))&+(!Am(i)||UO(e,r,n,o,i,a))&+(!xm(i)||NO(e,r,n,o,i,a))&+(!Rm(i)||vO(e,r,n,o,i,a))&+(!Ca(i)||cA(e,r,n,o,i,a))&+(!Pa(i)||lA(e,r,n,o,i,a))&+(!qm(i)||fA(e,r,n,o,i,a))&+(!xa(i)||tA(e,r,n,o,i,a))&+(!Dm(i)||WO(e,r,n,o,i,a))))&+(!s.IsArray(a)||!!(+(!Im(i)||TO(e,r,n,o,i,a))&+(!jn(i)||CO(e,r,n,o,i,a))&+(!Ho(i)||KO(e,r,n,o,i,a))&+(!km(i)||zO(e,r,n,o,i,a))&+(!Wc(i)||VO(e,r,n,o,i,a))&+(!Bn(i)||ZO(e,r,n,o,i,a))&+(!Ko(i)||JO(e,r,n,o,i,a))&+(!zo(i)||uA(e,r,n,o,i,a))&+(!Yo(i)||NA(e,r,n,o,i,a))))&+(!s.IsString(a)||!!(+(!Oa(i)||qO(e,r,n,o,i,a))&+(!Mm(i)||QO(e,r,n,o,i,a))&+(!Aa(i)||eA(e,r,n,o,i,a))&+(!Ra(i)||aA(e,r,n,o,i,a))))&+(!(s.IsNumber(a)||s.IsBigInt(a))||!!(+(!wm(i)||MO(e,r,n,o,i,a))&+(!Ar(i)||DO(e,r,n,o,i,a))&+(!vm(i)||YO(e,r,n,o,i,a))&+(!xr(i)||XO(e,r,n,o,i,a))&+(!Gm(i)||rA(e,r,n,o,i,a))))&+(!Bm(i)||yA(e,r,n,o,i,a))&+(!Fm(i)||_A(e,r,n,o,i,a))&+(!Em(i)||dO(e,r,n,o,i,a))&+(!Om(i)||RO(e,r,n,o,i,a))&+(!Um(i)||kO(e,r,n,o,i,a))&+(!Nm(i)||FO(e,r,n,o,i,a))&+(!$m(i)||nA(e,r,n,o,i,a))&+(!bm(i)||SO(e,r,n,o,i,a))&+(!Sm(i)||AO(e,r,n,o,i,a))&+(!jm(i)||iA(e,r,n,o,i,a))&+(!Xc(i)||!s.IsArray(a)||RA(e,r,n,o,i,a))&+(!Jc(i)||!s.IsObject(a)||PA(e,r,n,o,i,a)))&&(!_m(i)||gO(e,r,n,o,i,a));return e.Pop(i),c}var Kn={};kt(Kn,{Ref:()=>Tj});var Rr={};kt(Rr,{Delete:()=>lj,Get:()=>uj,Has:()=>pj,Indices:()=>La,Set:()=>mj});function LA(e){if(e.length===0)throw Error("Cannot set root")}function vA(e){if(!s.IsObject(e))throw Error("Cannot set value")}function aj(e){return/^(0|[1-9]\d*)$/.test(e)}function kA(e){return[e.slice(0,e.length-1),e.slice(e.length-1)[0]]}function sj(e,r){return s.IsObject(r)&&s.HasPropertyKey(r,e)}function cj(e,r){return s.IsObject(r)?r[e]:void 0}function Ml(e,r){return e.reduce((n,o)=>cj(o,n),r)}function La(e){if(s.IsEqual(e.length,0))return[];let r=e.split("/").map(n=>n.replace(/~1/g,"/").replace(/~0/g,"~"));return r.length>0&&r[0]===""?r.slice(1):r}function pj(e,r){let n=e;return La(r).every(o=>sj(o,n)?(n=n[o],!0):!1)}function uj(e,r){let n=La(r);return Ml(n,e)}function mj(e,r,n){let o=La(r);LA(o);let[i,a]=kA(o),c=Ml(i,e);return vA(c),c[a]=n,e}function lj(e,r){let n=La(r);LA(n);let[o,i]=kA(n),a=Ml(o,e);return vA(a),s.IsArray(a)&&aj(i)?a.splice(+i,1):delete a[i],e}function dj(e,r,n){if(e.$id===n.hash)return e;let o=new URL(e.$id,r.href),i=new URL(n.href,r.href);if(s.IsEqual(o.pathname,i.pathname))return n.hash.startsWith("#")?MA(e,r,n):e}function fj(e,r,n){let o=new URL(`#${e.$anchor}`,r.href),i=new URL(n.href,r.href);if(s.IsEqual(o.href,i.href))return e}function MA(e,r,n){return n.href.endsWith("#")?e:n.hash.startsWith("#")?Rr.Get(e,decodeURIComponent(n.hash.slice(1))):void 0}function gj(e,r,n){if(qn(e)){let o=dj(e,r,n);if(!s.IsUndefined(o))return o}if(Sa(e)){let o=fj(e,r,n);if(!s.IsUndefined(o))return o}return MA(e,r,n)}function yj(e,r,n){return e.reduce((o,i)=>{let a=Dl(i,r,n);return s.IsUndefined(a)?o:a},void 0)}function hj(e,r,n){return s.Keys(e).reduce((o,i)=>{let a=Dl(e[i],r,n);return s.IsUndefined(a)?o:a},void 0)}function Dl(e,r,n){if(r=Sr(e)&&qn(e)?new URL(e.$id,r.href):r,Sr(e)){let o=gj(e,r,n);if(!s.IsUndefined(o))return o}if(s.IsArray(e))return yj(e,r,n);if(s.IsObject(e))return hj(e,r,n)}function Tj(e,r){let n=new URL("http://unknown"),o=qn(e)?new URL(e.$id,n.href):n,i=new URL(r,o.href);return Dl(e,o,i)}var zn=class{constructor(r,n){this.context=r,this.schema=n,this.ids=[],this.anchors=[],this.recursiveAnchors=[],this.dynamicAnchors=[]}BaseURL(){return this.ids.reduce((r,n)=>new URL(n.$id,r),new URL("http://unknown"))}Base(){return this.ids[this.ids.length-1]??this.schema}Push(r){Sr(r)&&(qn(r)&&this.ids.push(r),Sa(r)&&this.anchors.push(r),Zc(r)&&this.recursiveAnchors.push(r),Cm(r)&&this.dynamicAnchors.push(r))}Pop(r){Sr(r)&&(qn(r)&&this.ids.pop(),Sa(r)&&this.anchors.pop(),Zc(r)&&this.recursiveAnchors.pop(),Cm(r)&&this.dynamicAnchors.pop())}FromContext(r){return s.HasPropertyKey(this.context,r)?this.context[r]:void 0}FromRef(r){return r.startsWith("#")?Kn.Ref(this.Base(),r):Kn.Ref(this.schema,r)}Ref(r){return this.FromContext(r)??this.FromRef(r)}RecursiveRef(r){return Zc(this.Base())?Kn.Ref(this.recursiveAnchors[0],r):Kn.Ref(this.Base(),r)}};function DA(...e){let[r,n,o]=ie.Match(e,{3:(c,m,d)=>[c,m,d],2:(c,m)=>[{},c,m]}),i=new zn(r,n),a=new dt;return G(i,a,n,o)}function GA(...e){let[r,n,o]=ie.Match(e,{3:(y,E,A)=>[y,E,A],2:(y,E)=>[{},y,E]}),i=Ct.Get(),a=Jg(),c=[],m=new zn(r,n),d=new Ua(y=>{if(!s.IsGreaterEqualThan(c.length,i.maxErrors))return c.push({...y,message:a(y)})});return[W(m,d,"#","",n,o),c]}function le(...e){let[r,n,o]=ie.Match(e,{3:(i,a,c)=>[i,a,c],2:(i,a)=>[{},i,a]});return DA(r,n,o)}function cn(...e){let[r,n,o]=ie.Match(e,{3:(c,m,d)=>[c,m,d],2:(c,m)=>[{},c,m]}),[i,a]=GA(r,n,o);return a}var pn=class extends Error{constructor(r,n,o){super(r),Object.defineProperty(this,"cause",{value:{source:r,errors:o,value:n},writable:!1,configurable:!1,enumerable:!1})}};function $A(e,r,n){return s.IsArray(n)?n.map(o=>Ve(e,r.items,o)):n}function jA(e,r,n){return r.Clean(n)}function qA(e,r,n){return Ve({...e,...r.$defs},we(r.$ref),n)}function _j(e){let r=s.HasPropertyKey(e,"unevaluatedProperties")?{additionalProperties:e.unevaluatedProperties}:{},n=Kt(e);return k(n)?wc(n,r):n}function BA(e,r,n){let o=_j(r);return Ve(e,o,n)}function ep(e){return s.HasPropertyKey(e,"additionalProperties")?e.additionalProperties:void 0}function FA(e,r,n){if(!s.IsObject(n)||s.IsArray(n))return n;let o=ep(r);for(let i of s.Keys(n)){if(s.HasPropertyKey(r.properties,i)){n[i]=Ve(e,r.properties[i],n[i]);continue}if(s.IsBoolean(o)&&s.IsEqual(o,!0)||O(o)&&le(e,o,n[i])){n[i]=Ve(e,o,n[i]);continue}delete n[i]}return n}function HA(e,r,n){if(!s.IsObject(n))return n;let o=ep(r),[i,a]=[new RegExp(At(r)),tt(r)];for(let c of s.Keys(n)){if(i.test(c)){n[c]=Ve(e,a,n[c]);continue}if(s.IsBoolean(o)&&s.IsEqual(o,!0)||O(o)&&le(e,o,n[c])){n[c]=Ve(e,o,n[c]);continue}delete n[c]}return n}function KA(e,r,n){return s.HasPropertyKey(e,r.$ref)?Ve(e,e[r.$ref],n):n}function zA(e,r,n){if(!s.IsArray(n))return n;let o=Math.min(n.length,r.items.length);for(let i=0;i<o;i++)n[i]=Ve(e,r.items[i],n[i]);return s.IsGreaterThan(n.length,o)?n.slice(0,o):n}function Ij(e){let r={};for(let n of Object.getOwnPropertyNames(e))r[n]=de(e[n]);for(let n of Object.getOwnPropertySymbols(e))r[n]=de(e[n]);return r}function bj(e){return s.IsClassInstance(e)?e:Ij(e)}function Sj(e){return e.map(r=>de(r))}function Oj(e){return e.slice()}function Aj(e){return new Map(de([...e.entries()]))}function xj(e){return new Set(de([...e.values()]))}function de(e){return st.IsTypeArray(e)?Oj(e):st.IsMap(e)?Aj(e):st.IsSet(e)?xj(e):s.IsArray(e)?Sj(e):s.IsObject(e)?bj(e):e}function YA(e,r,n){for(let o of r.anyOf){let i=Ve(e,o,de(n));if(le(e,o,i))return i}return n}function Ve(e,r,n){return te(r)?$A(e,r,n):Pt(r)?jA(e,r,n):me(r)?qA(e,r,n):w(r)?BA(e,r,n):k(r)?FA(e,r,n):Ie(r)?HA(e,r,n):ce(r)?KA(e,r,n):V(r)?zA(e,r,n):S(r)?YA(e,r,n):n}function Vn(...e){let[r,n,o]=ie.Match(e,{3:(i,a,c)=>[i,a,c],2:(i,a)=>[{},i,a]});return Ve(r,n,o)}function VA(e,r,n){return s.IsArray(n)?n.map(o=>ve(e,r.items,o)):n}function QA(e,r,n){return r.Convert(n)}var ne={};kt(ne,{Fail:()=>Qn,IsOk:()=>$l,Ok:()=>U,TryBigInt:()=>jl,TryBoolean:()=>Kj,TryNull:()=>Xj,TryNumber:()=>sq,TryString:()=>fq,TryUndefined:()=>Iq});function $l(e){return s.IsObject(e)&&s.HasPropertyKey(e,"value")}function U(e){return{value:e}}function Qn(){}function Rj(e){return U(e)}function Cj(e){return s.IsEqual(e,!0)?U(BigInt(1)):U(BigInt(0))}function Pj(e){return U(BigInt(Math.trunc(e)))}function Uj(e){return U(BigInt(0))}var wj=/^-?(0|[1-9]\d*)n$/,Nj=/^-?(0|[1-9]\d*)\.\d+$/,Lj=/^-?(0|[1-9]\d*)$/;function vj(e){return wj.test(e)}function kj(e){return Nj.test(e)}function Mj(e){return Lj.test(e)}function Dj(e){let r=e.toLowerCase();return vj(e)?U(BigInt(e.slice(0,e.length-1))):kj(e)?U(BigInt(e.split(".")[0])):Mj(e)?U(BigInt(e)):s.IsEqual(r,"false")?U(BigInt(0)):s.IsEqual(r,"true")?U(BigInt(1)):void 0}function Gj(e){return U(BigInt(0))}function jl(e){return s.IsBigInt(e)?Rj(e):s.IsBoolean(e)?Cj(e):s.IsNumber(e)?Pj(e):s.IsNull(e)?Uj(e):s.IsString(e)?Dj(e):s.IsUndefined(e)?Gj(e):void 0}function $j(e){return s.IsEqual(e,BigInt(0))?U(!1):s.IsEqual(e,BigInt(1))?U(!0):void 0}function jj(e){return U(e)}function qj(e){return s.IsEqual(e,0)?U(!1):s.IsEqual(e,1)?U(!0):void 0}function Bj(e){return U(!1)}function Fj(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 Hj(e){return U(!1)}function Kj(e){return s.IsBigInt(e)?$j(e):s.IsBoolean(e)?jj(e):s.IsNumber(e)?qj(e):s.IsNull(e)?Bj(e):s.IsString(e)?Fj(e):s.IsUndefined(e)?Hj(e):void 0}function zj(e){return s.IsEqual(e,BigInt(0))?U(null):void 0}function Yj(e){return s.IsEqual(e,!1)?U(null):void 0}function Vj(e){return s.IsEqual(e,0)?U(null):void 0}function Qj(e){return U(null)}function Wj(e){let r=e.toLowerCase();return s.IsEqual(r,"undefined")||s.IsEqual(r,"null")||s.IsEqual(e,"")||s.IsEqual(e,"0")?U(null):void 0}function Zj(e){return U(null)}function Xj(e){return s.IsBigInt(e)?zj(e):s.IsBoolean(e)?Yj(e):s.IsNumber(e)?Vj(e):s.IsNull(e)?Qj(e):s.IsString(e)?Wj(e):s.IsUndefined(e)?Zj(e):void 0}var Jj=BigInt(Number.MAX_SAFE_INTEGER),eq=BigInt(Number.MIN_SAFE_INTEGER);function tq(e){return e<=Jj&&e>=eq}function WA(e){return tq(e)?U(Number(e)):void 0}function rq(e){return e?U(1):U(0)}function nq(e){return U(e)}function oq(e){return U(0)}function iq(e){let r=+e;if(s.IsNumber(r))return U(r);let n=e.toLowerCase();if(s.IsEqual(n,"false"))return U(0);if(s.IsEqual(n,"true"))return U(1);let o=jl(e);return $l(o)?WA(o.value):void 0}function aq(e){return U(0)}function sq(e){return s.IsBigInt(e)?WA(e):s.IsBoolean(e)?rq(e):s.IsNumber(e)?nq(e):s.IsNull(e)?oq(e):s.IsString(e)?iq(e):s.IsUndefined(e)?aq(e):void 0}function cq(e){return U(e.toString())}function pq(e){return U(e.toString())}function uq(e){return U(e.toString())}function mq(e){return U("null")}function lq(e){return U(e)}function dq(e){return U("")}function fq(e){return s.IsBigInt(e)?cq(e):s.IsBoolean(e)?pq(e):s.IsNumber(e)?uq(e):s.IsNull(e)?mq(e):s.IsString(e)?lq(e):s.IsUndefined(e)?dq(e):void 0}function gq(e){return s.IsEqual(e,BigInt(0))?U(void 0):void 0}function yq(e){return s.IsEqual(e,!1)?U(void 0):void 0}function hq(e){return s.IsEqual(e,0)?U(void 0):void 0}function Tq(e){return U(void 0)}function Eq(e){let r=e.toLowerCase();return s.IsEqual(r,"undefined")||s.IsEqual(r,"null")||s.IsEqual(e,"")||s.IsEqual(e,"0")?U(void 0):void 0}function _q(e){return U(void 0)}function Iq(e){return s.IsBigInt(e)?gq(e):s.IsBoolean(e)?yq(e):s.IsNumber(e)?hq(e):s.IsNull(e)?Tq(e):s.IsString(e)?Eq(e):s.IsUndefined(e)?_q(e):void 0}function ZA(e,r,n){if(s.IsBigInt(n))return n;let o=ne.TryBigInt(n);return ne.IsOk(o)?o.value:n}function XA(e,r,n){if(s.IsBoolean(n))return n;let o=ne.TryBoolean(n);return ne.IsOk(o)?o.value:n}function JA(e,r,n){return ve({...e,...r.$defs},we(r.$ref),n)}function tp(e,r,n){if(r.anyOf.some(c=>le(e,c,n)))return n;let a=r.anyOf.map(c=>ve(e,c,de(n))).find(c=>le(e,r,c));return s.IsUndefined(a)?n:a}function ex(e,r,n){let o=Un(r);return tp(e,o,n)}function tx(e,r,n){if(s.IsInteger(n))return n;let o=ne.TryNumber(n);return ne.IsOk(o)?Math.trunc(o.value):n}function rx(e,r,n){let o=Kt(r);return ve(e,o,n)}function bq(e,r,n){let o=ne.TryBigInt(n);return ne.IsOk(o)&&s.IsEqual(r.const,o.value)?o.value:n}function Sq(e,r,n){let o=ne.TryBoolean(n);return ne.IsOk(o)&&s.IsEqual(r.const,o.value)?o.value:n}function Oq(e,r,n){let o=ne.TryNumber(n);return ne.IsOk(o)&&s.IsEqual(r.const,o.value)?o.value:n}function Aq(e,r,n){let o=ne.TryString(n);return ne.IsOk(o)&&s.IsEqual(r.const,o.value)?o.value:n}function nx(e,r,n){return s.IsEqual(r.const,n)?n:sy(r)?bq(e,r,n):cy(r)?Sq(e,r,n):lo(r)?Oq(e,r,n):fo(r)?Aq(e,r,n):H()}function ox(e,r,n){if(s.IsNull(n))return n;let o=ne.TryNull(n);return ne.IsOk(o)?o.value:n}function ix(e,r,n){if(s.IsNumber(n))return n;let o=ne.TryNumber(n);return ne.IsOk(o)?o.value:n}function rp(e,r,n,o){let i=s.Keys(o);for(let[a,c]of r)for(let m of i)a.test(m)||(o[m]=ve(e,n,o[m]));return o}function va(e,r,n){return Me(e)&&s.IsUndefined(n[r])}function xq(e,r,n){let o=s.EntriesRegExp(r.properties),i=s.Keys(n);for(let[a,c]of o)for(let m of i)!a.test(m)||va(c,m,n)||(n[m]=ve(e,c,n[m]));return s.HasPropertyKey(r,"additionalProperties")&&s.IsObject(r.additionalProperties)?rp(e,o,r.additionalProperties,n):n}function ax(e,r,n){return s.IsObjectNotArray(n)?xq(e,r,n):n}function Rq(e,r,n){let o=s.EntriesRegExp(r.patternProperties),i=s.Keys(n);for(let[a,c]of o)for(let m of i)a.test(m)&&(n[m]=ve(e,c,n[m]));return s.HasPropertyKey(r,"additionalProperties")&&s.IsObject(r.additionalProperties)?rp(e,o,r.additionalProperties,n):n}function sx(e,r,n){return s.IsObjectNotArray(n)?Rq(e,r,n):n}function cx(e,r,n){return s.HasPropertyKey(e,r.$ref)?ve(e,e[r.$ref],n):n}function px(e,r,n){if(s.IsString(n))return n;let o=ne.TryString(n);return ne.IsOk(o)?o.value:n}function ux(e,r,n){let o=rt(r.pattern);return ve(e,o,n)}function mx(e,r,n){if(!s.IsArray(n))return n;for(let o=0;o<Math.min(r.items.length,n.length);o++)n[o]=ve(e,r.items[o],n[o]);return n}function lx(e,r,n){if(s.IsUndefined(n))return n;let o=ne.TryUndefined(n);return ne.IsOk(o)?o.value:n}function dx(e,r,n){if(s.IsUndefined(n))return n;let o=ne.TryUndefined(n);return ne.IsOk(o)?void 0:n}function ve(e,r,n){return te(r)?VA(e,r,n):Pt(r)?QA(e,r,n):Ot(r)?ZA(e,r,n):ut(r)?XA(e,r,n):me(r)?JA(e,r,n):Re(r)?ex(e,r,n):Be(r)?tx(e,r,n):w(r)?rx(e,r,n):X(r)?nx(e,r,n):er(r)?ox(e,r,n):_e(r)?ix(e,r,n):k(r)?ax(e,r,n):Ie(r)?sx(e,r,n):ce(r)?cx(e,r,n):Ne(r)?px(e,r,n):Ce(r)?ux(e,r,n):V(r)?mx(e,r,n):nr(r)?lx(e,r,n):S(r)?tp(e,r,n):xt(r)?dx(e,r,n):n}function un(...e){let[r,n,o]=ie.Match(e,{3:(i,a,c)=>[i,a,c],2:(i,a)=>[{},i,a]});return ve(r,n,o)}function fx(e,r,n){if(!s.IsArray(n))return n;for(let o=0;o<n.length;o++)n[o]=qe(e,r.items,n[o]);return n}function gx(e,r,n){return r.Default(n)}function yx(e,r,n){return qe({...e,...r.$defs},we(r.$ref),n)}function hx(e,r){return s.IsUndefined(r)?s.IsFunction(e.default)?e.default():de(e.default):r}function Tx(e,r,n){let o=Kt(r);return qe(e,o,n)}function Ex(e,r,n){if(!s.IsObject(n))return n;let o=s.Keys(r.properties);for(let i of o){let a=qe(e,r.properties[i],n[i]);s.IsUndefined(a)&&(Me(r.properties[i])||!s.HasPropertyKey(r.properties[i],"default"))||(n[i]=qe(e,r.properties[i],n[i]))}if(!Or(r)||s.IsBoolean(r.additionalProperties))return n;for(let i of s.Keys(n))o.includes(i)||(n[i]=qe(e,r.additionalProperties,n[i]));return n}function _x(e,r,n){if(!s.IsObject(n))return n;let[o,i]=[new RegExp(At(r)),tt(r)];for(let a of s.Keys(n))o.test(a)&&Nt(i)&&(n[a]=qe(e,i,n[a]));if(!Or(r))return n;for(let a of s.Keys(n))o.test(a)||(n[a]=qe(e,r.additionalProperties,n[a]));return n}function Ix(e,r,n){return s.HasPropertyKey(e,r.$ref)?qe(e,e[r.$ref],n):n}function bx(e,r,n){if(!s.IsArray(n))return n;let[o,i]=[r.items,Math.max(r.items.length,n.length)];for(let a=0;a<i;a++)a<o.length&&(n[a]=qe(e,o[a],n[a]));return n}function Sx(e,r,n){for(let o of r.anyOf){let i=qe(e,o,de(n));if(le(e,o,i))return i}return n}function qe(e,r,n){let o=Nt(r)?hx(r,n):n;return te(r)?fx(e,r,o):Pt(r)?gx(e,r,o):me(r)?yx(e,r,o):w(r)?Tx(e,r,o):k(r)?Ex(e,r,o):Ie(r)?_x(e,r,o):ce(r)?Ix(e,r,o):V(r)?bx(e,r,o):S(r)?Sx(e,r,o):o}function Wn(...e){let[r,n,o]=ie.Match(e,{3:(i,a,c)=>[i,a,c],2:(i,a)=>[{},i,a]});return qe(r,n,o)}function Wo(e){return(...r)=>{let[n,o,i]=ie.Match(r,{3:(a,c,m)=>[a,c,m],2:(a,c)=>[{},a,c]});return e.reduce((a,c)=>c(n,o,a),i)}}function Cq(e,r,n){return r["~codec"].decode(n)}function Pq(e,r,n){return r["~codec"].encode(n)}function Oe(e,r,n,o){return An(n)?s.IsEqual(e,"Decode")?Cq(r,n,o):Pq(r,n,o):o}function Uq(e,r,n,o){if(!s.IsArray(o))return H();for(let i=0;i<o.length;i++)o[i]=he(e,r,n.items,o[i]);return Oe(e,r,n,o)}function wq(e,r,n,o){let i=Oe(e,r,n,o);if(!s.IsArray(i))return i;for(let a=0;a<i.length;a++)i[a]=he(e,r,n.items,i[a]);return i}function Ox(e,r,n,o){return s.IsEqual(e,"Decode")?Uq(e,r,n,o):wq(e,r,n,o)}function Ax(e,r,n,o){return o=he(e,{...r,...n.$defs},we(n.$ref),o),Oe(e,r,n,o)}function Nq(e,r,n,o){for(let i of n.allOf)o=he(e,r,i,o);return Oe(e,r,n,o)}function Lq(e,r,n,o){let i=Oe(e,r,n,o);for(let a of n.allOf)i=he(e,r,a,i);return i}function xx(e,r,n,o){return s.IsEqual(e,"Decode")?Nq(e,r,n,o):Lq(e,r,n,o)}function vq(e,r,n,o){if(!s.IsObjectNotArray(o))return H();for(let i of s.Keys(n.properties))!s.HasPropertyKey(o,i)||va(n.properties[i],i,o)||(o[i]=he(e,r,n.properties[i],o[i]));return Oe(e,r,n,o)}function kq(e,r,n,o){let i=Oe(e,r,n,o);if(!s.IsObjectNotArray(i))return i;for(let a of s.Keys(n.properties))!s.HasPropertyKey(i,a)||va(n.properties[a],a,i)||(i[a]=he(e,r,n.properties[a],i[a]));return i}function Rx(e,r,n,o){return s.IsEqual(e,"Decode")?vq(e,r,n,o):kq(e,r,n,o)}function Mq(e,r,n,o){if(!s.IsObjectNotArray(o))return H();let i=new RegExp(At(n));for(let a of s.Keys(o))i.test(a)||H(),o[a]=he(e,r,tt(n),o[a]);return Oe(e,r,n,o)}function Dq(e,r,n,o){let i=Oe(e,r,n,o);if(!s.IsObjectNotArray(i))return i;let a=new RegExp(At(n));for(let c of s.Keys(i))a.test(c)&&(i[c]=he(e,r,tt(n),i[c]));return i}function Cx(e,r,n,o){return s.IsEqual(e,"Decode")?Mq(e,r,n,o):Dq(e,r,n,o)}function Px(e,r,n,o){return o=s.HasPropertyKey(r,n.$ref)?he(e,r,r[n.$ref],o):o,Oe(e,r,n,o)}function Gq(e,r,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,r,n.items[i],o[i]);return Oe(e,r,n,o)}function $q(e,r,n,o){let i=Oe(e,r,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,r,n.items[a],i[a]);return i}function Ux(e,r,n,o){return s.IsEqual(e,"Decode")?Gq(e,r,n,o):$q(e,r,n,o)}function jq(e,r,n,o){for(let i of n.anyOf){if(!le(r,i,o))continue;let a=he(e,r,i,o);return Oe(e,r,n,a)}return H()}function qq(e,r,n,o){let i=Oe(e,r,n,o);for(let a of n.anyOf){let c=he(e,r,a,de(i));if(le(r,a,c))return c}return i}function wx(e,r,n,o){return s.IsEqual(e,"Decode")?jq(e,r,n,o):qq(e,r,n,o)}function he(e,r,n,o){return te(n)?Ox(e,r,n,o):me(n)?Ax(e,r,n,o):w(n)?xx(e,r,n,o):k(n)?Rx(e,r,n,o):Ie(n)?Cx(e,r,n,o):ce(n)?Px(e,r,n,o):V(n)?Ux(e,r,n,o):S(n)?wx(e,r,n,o):Oe(e,r,n,o)}var ql=class extends pn{constructor(r,n){super("Decode",r,n)}};function Bq(e,r,n){if(!le(e,r,n))throw new ql(n,cn(e,r,n));return n}function Fq(e,r,n){return he("Decode",e,r,n)}var L$e=Wo([(e,r,n)=>de(n),(e,r,n)=>Wn(e,r,n),(e,r,n)=>un(e,r,n),(e,r,n)=>Vn(e,r,n),(e,r,n)=>Bq(e,r,n),(e,r,n)=>Fq(e,r,n)]);var Bl=class extends pn{constructor(r,n){super("Encode",r,n)}};function Hq(e,r,n){if(!le(e,r,n))throw new Bl(n,cn(e,r,n));return n}function Kq(e,r,n){return he("Encode",e,r,n)}var K$e=Wo([(e,r,n)=>de(n),(e,r,n)=>Kq(e,r,n),(e,r,n)=>Wn(e,r,n),(e,r,n)=>un(e,r,n),(e,r,n)=>Vn(e,r,n),(e,r,n)=>Hq(e,r,n)]);var $t=class extends Error{constructor(r,n){super(n),this.type=r}};function Nx(e,r){return s.IsFunction(r.default)?r.default(r):s.IsObject(r.default)?de(r.default):r.default}function Lx(e,r){if(Yo(r)&&!Nt(r))throw new $t(r,"Arrays with uniqueItems constraints must specify a default annotation");let n=Ko(r)?r.minItems:0;return Array.from({length:n},()=>Te(e,r.items))}async function*zq(){}function vx(e,r){return zq()}function kx(e,r){return r.Create()}function Mx(e,r){return Ar(r)?BigInt(r.exclusiveMinimum)+BigInt(1):xr(r)?BigInt(r.minimum):BigInt(0)}function Dx(e,r){return!1}function Gx(e,r){let n=Te(e,r.instanceType);return class{constructor(){Object.assign(this,n)}}}function $x(e,r){return Te({...e,...r.$defs},we(r.$ref))}function jx(e,r){return Te(e,Un(r))}function qx(e,r){let n=Te(e,r.returnType);return()=>n}function Bx(e,r){return Ar(r)&&s.IsNumber(r.exclusiveMinimum)?r.exclusiveMinimum+1:xr(r)?r.minimum:0}function Fx(e,r){return Te(e,Kt(r))}function*Yq(){}function Hx(e,r){return Yq()}function Kx(e,r){return r.const}function zx(e,r){throw new $t(r,"Cannot create TNever types")}function Yx(e,r){return null}function Vx(e,r){return Ar(r)&&s.IsNumber(r.exclusiveMinimum)?r.exclusiveMinimum+1:xr(r)?r.minimum:0}function Qx(e,r){return(s.IsUndefined(r.required)?[]:r.required).reduce((o,i)=>({...o,[i]:Te(e,r.properties[i])}),{})}function Wx(e,r){return Promise.resolve(Te(e,r.item))}function Zx(e,r){if(xa(r)&&!Nt(r))throw new $t(r,"Record with the minProperties constraint must have a default annotation");return{}}function Xx(e,r){return s.HasPropertyKey(e,r.$ref)?Te(e,e[r.$ref]):(()=>{throw new $t(r,"Unable to deref Ref")})()}function Jx(e,r){if((Ra(r)||Oa(r))&&!Nt(r))throw Error("Strings with format or pattern constraints must specify default");let o=Aa(r)?r.minLength:0;return"".padEnd(o)}function eR(e,r){return Symbol()}function tR(e,r){let n=rt(r.pattern);if(Ne(n))throw new $t(r,"Unable to create TemplateLiteral due to infinite type expansion");return Te(e,n)}function rR(e,r){return Array.from({length:r.minItems},(n,o)=>Te(e,r.items[o]))}function nR(e,r){if(s.IsEqual(r.anyOf.length,0))throw Error("Unable to create Union with no variants");return Te(e,r.anyOf[0])}function Te(e,r){return Nt(r)?Nx(e,r):te(r)?Lx(e,r):it(r)?vx(e,r):Pt(r)?kx(e,r):Ot(r)?Mx(e,r):ut(r)?Dx(e,r):De(r)?Gx(e,r):me(r)?$x(e,r):Re(r)?jx(e,r):Ge(r)?qx(e,r):Be(r)?Bx(e,r):w(r)?Fx(e,r):at(r)?Hx(e,r):X(r)?Kx(e,r):fr(r)?zx(e,r):er(r)?Yx(e,r):_e(r)?Vx(e,r):k(r)?Qx(e,r):et(r)?Wx(e,r):Ie(r)?Zx(e,r):ce(r)?Xx(e,r):Ne(r)?Jx(e,r):tr(r)?eR(e,r):Ce(r)?tR(e,r):V(r)?rR(e,r):nr(r)?void 0:S(r)?nR(e,r):xt(r)?void 0:void 0}function pr(...e){let[r,n]=ie.Match(e,{2:(o,i)=>[o,i],1:o=>[{},o]});return Te(r,n)}var Fl=class extends pn{constructor(r,n){super("Parse",r,n)}};function Vq(e,r,n){if(!le(e,r,n))throw new Fl(n,cn(e,r,n));return n}var Wqe=Wo([(e,r,n)=>de(n),(e,r,n)=>Wn(e,r,n),(e,r,n)=>un(e,r,n),(e,r,n)=>Vn(e,r,n),(e,r,n)=>Vq(e,r,n)]);var Wq=N({type:Y("insert"),path:It(),value:Xe()}),Zq=Object({type:Y("update"),path:It(),value:Xe()}),Xq=N({type:Y("delete"),path:It()}),nBe=q([Wq,Zq,Xq]);function Zo(e){if(!e.body)throw new Error("This command does not accept a request body");let r=e.body;return r.examples?.length?r.examples[0]:pr(r)}function Zn(e,r,n,o,i){e.command(r).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){Q(Zo(o));return}let c=Fo(a),m=await i()(o,{body:c});Q(m)})}function aR(e,r){let n=e.command("experimental").description("Experimental commands \u2014 unstable, subject to change without notice");Zn(n,"promql","Run a PromQL query (experimental)",uO,r)}var rB=`/${"v1"}/feedback`,sR=t.Object({id:t.String({description:"API request ID recorded with the feedback."})},{$id:"Feedback",description:"A recorded piece of feedback"}),nB={id:"request-123-abc"};Object.assign(sR,{examples:[nB]});var cR=t.Object({content:p({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."})}),oB={content:"The traces command times out for large services."};Object.assign(cR,{examples:[oB]});var pR=l({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:rB,method:"POST",body:cR,response:sR});function uR(e,r){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 r()(pR,{body:{content:n.join(" ")}});Q(o)})}var iB={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-route":{read:["public_viewer","public_editor","admin"],write:["admin","public_editor"]},metric:{read:["public_viewer","public_editor","admin"],write:[]},trace:{read:["public_viewer","public_editor","admin"],write:[]},rum:{read:["public_viewer","public_editor","admin"],write:[]},monitor:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"monitor-alert":{read:["public_viewer","public_editor","admin"],write:[]},"monitor-debugging":{read:["admin"],write:[]},"notification-integration":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"notification-rule":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"adaptive-notification-rule":{read:["public_viewer","public_editor","admin"],write:["admin"]},"notification-silence":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"saml-config":{read:["admin"],write:["admin"]},org:{read:["public_viewer","public_editor","admin"],write:["admin"]},"allowed-domains":{read:["public_viewer","public_editor","admin"],write:["admin"]},"quality-report":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"sensitive-data-scanner-rule":{read:["public_viewer","public_editor","admin"],write:["admin"]},slo:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"retention-policy":{read:["public_viewer","public_editor","admin"],write:["admin"]},"databricks-connection":{read:["public_viewer","public_editor","admin"],write:["admin"]},service:{read:["public_viewer","public_editor","admin"],write:[]},"service-target":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},host:{read:["public_viewer","public_editor","admin"],write:[]},database:{read:["public_viewer","public_editor","admin"],write:[]},"tag-policy":{read:["public_viewer","public_editor","admin"],write:["admin"]},team:{read:["public_viewer","public_editor","admin"],write:["admin"]},"team-members":{read:["public_viewer","public_editor","admin"],write:["admin"]},"team-remap-config":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-data":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-invitation":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-permissions":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-self":{read:["public_viewer","public_editor","admin"],write:["public_viewer","public_editor","admin"]},"oauth-grant":{read:[],write:[]}},aB={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:[]},"cloud-account":{read:["viewer","editor","admin"],write:[]},dashboard:{read:["viewer","editor","admin"],write:["editor","admin"]},"dashboard-folder":{read:["viewer","editor","admin"],write:["editor","admin"]},"dashboard-report":{read:["viewer","editor","admin"],write:["editor","admin"]},inventory:{read:["viewer","editor","admin"],write:[]},log:{read:["viewer","editor","admin"],write:[]},"log-route":{read:["viewer","editor","admin"],write:["editor","admin"]},"metric-route":{read:["viewer","editor","admin"],write:["editor","admin"]},metric:{read:["viewer","editor","admin"],write:[]},trace:{read:["viewer","editor","admin"],write:[]},rum:{read:["viewer","editor","admin"],write:[]},monitor:{read:["viewer","editor","admin"],write:["editor","admin"]},"monitor-alert":{read:["viewer","editor","admin"],write:[]},"monitor-debugging":{read:["admin"],write:[]},"notification-integration":{read:["viewer","editor","admin"],write:["editor","admin"]},"notification-rule":{read:["viewer","editor","admin"],write:["editor","admin"]},"adaptive-notification-rule":{read:["viewer","editor","admin"],write:[]},"notification-silence":{read:["viewer","editor","admin"],write:["editor","admin"]},"saml-config":{read:[],write:[]},org:{read:["viewer","editor","admin"],write:[]},"allowed-domains":{read:["viewer","editor","admin"],write:[]},"quality-report":{read:["viewer","editor","admin"],write:["editor","admin"]},"sensitive-data-scanner-rule":{read:["viewer","editor","admin"],write:[]},slo:{read:["viewer","editor","admin"],write:["editor","admin"]},"retention-policy":{read:[],write:[]},"databricks-connection":{read:[],write:[]},service:{read:["viewer","editor","admin"],write:[]},"service-target":{read:["viewer","editor","admin"],write:["editor","admin"]},host:{read:["viewer","editor","admin"],write:[]},database:{read:["viewer","editor","admin"],write:[]},"tag-policy":{read:[],write:[]},team:{read:["viewer","editor","admin"],write:["admin"]},"team-members":{read:["viewer","editor","admin"],write:["admin"]},"team-remap-config":{read:[],write:[]},"user-data":{read:["viewer","editor","admin"],write:["admin"]},"user-invitation":{read:["viewer","editor","admin"],write:["admin"]},"user-permissions":{read:["viewer","editor","admin"],write:[]},"user-self":{read:["viewer","editor","admin"],write:["viewer","editor","admin"]},"oauth-grant":{read:[],write:[]}},sB={user:iB,team:aB};function Kl(e){return mR(e,"team")}function zl(e){return mR(e,"user")}function mR(e,r){let n=[],o=sB[r];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 tKe={admin:{name:"Global admin",description:"Full control across the organization. Can view and modify everything, including private teams.",permissions:zl("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:zl("public_editor"),roleKey:"public_editor"},public_viewer:{name:"Public viewer",description:"Read-only access to public team data. Cannot make changes.",permissions:zl("public_viewer"),roleKey:"public_viewer"},teams_only:{name:"Teams only",description:"Only access data and assets in their own teams.",permissions:[],roleKey:"teams_only"}},rKe={admin:{name:"Team admin",description:"Full team control, manage assets, members, and settings.",permissions:Kl("admin"),roleKey:"admin"},editor:{name:"Team editor",description:"Can view and update most assets (like dashboards, monitors).",permissions:Kl("editor"),roleKey:"editor"},viewer:{name:"Team viewer",description:"Can view all team data but cannot make changes.",permissions:Kl("viewer"),roleKey:"viewer"}};var Yl=["red","orange","amber","yellow","green","emerald","teal","cyan","sky","blue","indigo","purple","pink"],Vl=["light","dark"];var cB={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)"}},lR=["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 cKe=cB.light.red.background;var dR=[{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-----
|
|
129
129
|
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDAC4AWkdwKYSd8
|
|
130
130
|
Ks14IReLcYgADhoXk56ZzXI=
|
|
131
|
-
-----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}"}],Hq=Wx.map(e=>e.key);var kHe=new Set(Hq),MHe=Wx.map(e=>e.key);var M="context";var Zx="trace_id",zHe=`${M}.team`,YHe=`${M}.env`,VHe=`${M}.api_key_id`,ep=`${M}.service.name`,QHe=`${M}.service.version`,Kl=`${M}.span.kind`,zl=`${M}.span.name`,Yl=`${M}.status.code`,Xx=["SPAN_KIND_UNSPECIFIED","SPAN_KIND_INTERNAL","SPAN_KIND_SERVER","SPAN_KIND_CLIENT","SPAN_KIND_PRODUCER","SPAN_KIND_CONSUMER"];var va=`${M}.host.name`,Kq=`${M}.instance`,zq=`${M}.instanceid`,Yq=`${M}.instance_name`,WHe=`${M}.telemetry.sdk.language`,ZHe=`${M}.process.runtime.name`,XHe=`${M}.scope.name`,JHe=`${M}.cloud.provider`,eKe=`${M}.cloud.platform`,tKe=`${M}.aws.ecs.task.arn`,rKe=`${M}.k8s.cluster.name`,nKe=`${M}.k8s.cluster.uid`,oKe=`${M}.k8s.namespace.name`,Vq=`${M}.k8s.pod.name`,iKe=`${M}.k8s.pod.uid`,aKe=`${M}.k8s.container.name`,sKe=`${M}.k8s.node.name`,cKe=`${M}.k8s.node.uid`,Qq=`${M}.k8s.deployment.name`,pKe=`${M}.k8s.deployment.uid`,Wq=`${M}.k8s.replicaset.name`,uKe=`${M}.k8s.replicaset.uid`,Zq=`${M}.k8s.statefulset.name`,mKe=`${M}.k8s.statefulset.uid`,Xq=`${M}.k8s.daemonset.name`,lKe=`${M}.k8s.daemonset.uid`,dKe=`${M}.k8s.job.name`,fKe=`${M}.k8s.job.uid`,gKe=`${M}.k8s.cronjob.name`,yKe=`${M}.k8s.cronjob.uid`,Vl="status_code",Ql="span.name";var Wl="span.kind";var Jq="db.system.name",eB="db.system",tB="db.namespace",rB="db.name";var hKe=`span_attributes.${tB}`,TKe=`span_attributes.${rB}`,EKe=`span_attributes.${Jq}`,_Ke=`span_attributes.${eB}`;var IKe={name:"tsuga.internal.processing_tag_policy_violations_total",attributes:{tagPolicyId:`${M}.tag_policy_id`,dataSource:`${M}.data_source`}};var bKe={name:"tsuga.internal.event_size_bytes",attributes:{batchKind:`${M}.batch_kind`,batchKindMetricsFilter:`${M}.batch_kind:metrics`,sourceApiKeyId:`${M}.source_api_key_id`,sourceEnv:`${M}.source_env`,sourceTeam:`${M}.source_team`}};var Zl="__tsuga_metadata__",SKe=`${Zl}.signature`,OKe=`${Zl}.routes`,AKe=`${Zl}.trace_id_bucket`;var UKe={[Kl]:Wl,[Kl.replace(`${M}.`,"")]:Wl,[zl]:Ql,[zl.replace(`${M}.`,"")]:Ql,[Yl]:Vl,[Yl.replace(`${M}.`,"")]:Vl};function Jx(e){return e.replace(/ies$/,"y").replace(/s$/,"")}var eR=["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"],tR=["alert_queries","alert_thresholds","alert_values"],nB=[...eR,...tR],rR=["alert_event_name","alert_message"],r2e=[...nB,...rR],n2e=new Set([...eR,...rR]),o2e=new Set(tR);var oB="^\\S(.*\\S)?$",iB=128,aB=256,sB=t.Object({key:t.String({description:"Tag key attached to the resource. Consumers can use key/value tags for filtering, ownership context, and policy checks."}),value:t.String({description:"Tag value attached to the resource for this key. Tsuga returns the value exactly as stored."})},{title:"Tag"}),cB=t.Object({key:t.String({maxLength:iB,description:"Tag key to attach to the resource."}),value:t.String({maxLength:aB,pattern:oB,description:"Tag value to attach to the resource. Leading or trailing whitespace is rejected."})},{title:"Tag"}),zt=t.Array(sB,{title:"Tags",description:"Key/value tags applied to the resource. Use them to organize resources and to satisfy tag policies."}),Yt=t.Array(cB,{title:"Tags",maxItems:50,description:"Key/value tags to apply to the resource. Tag policies may require specific keys or values."}),ke=t.Optional(zt),Ve=t.Optional(Yt);var un="/v0/teams",rp=["public","private"],tp={NAME:"name",CREATED_AT:"createdAt",MEMBER_COUNT:"memberCount",VISIBILITY:"visibility"},pB=t.Enum([tp.NAME,tp.CREATED_AT,tp.MEMBER_COUNT,tp.VISIBILITY],{description:"Team field used for sorting list responses. Use `name`, `createdAt`, `memberCount`, or `visibility`."}),iR=t.Object({color:t.Enum(Fl,{description:"Color token used by Tsuga when rendering the team avatar."}),mode:t.Enum(Hl,{description:"Avatar rendering mode selected for the team."}),iconName:t.Enum(Qx,{description:"Icon name rendered inside the team avatar when icon mode is used."})}),Xl=t.Object({color:t.Enum(Fl),mode:t.Enum(Hl)}),nR=100,oR=250,Zo=t.Object({id:t.String({description:"Unique identifier of the team. Generated by Tsuga and stable for the team lifetime."}),name:t.String({description:"Human-readable team name displayed throughout Tsuga and used in team search."}),description:t.Optional(t.String({description:"Optional free-text description of the team."})),visibility:t.Enum(rp,{description:"`public` makes team-owned resources discoverable according to access controls. `private` restricts discovery to team members and authorized users."}),tags:ke,createdAt:T({description:"Timestamp when Tsuga created the team."}),updatedAt:T({description:"Timestamp when Tsuga last updated the team metadata."}),memberCount:t.Optional(t.Number({description:"Number of members currently in the team"})),avatar:t.Optional(iR)}),np=t.Object({name:t.String({minLength:1,maxLength:nR,format:vo,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 ${nR} characters.`}),description:t.Optional(t.String({maxLength:oR,description:`Optional team description. Maximum length is ${oR} characters.`})),visibility:t.Enum(rp,{description:"`public` makes team-owned resources discoverable according to access controls. `private` restricts discovery to team members and authorized users."}),tags:Ve,avatar:t.Optional(iR)}),uB=t.Object({id:t.String(),name:t.String(),email:t.String(),role:t.Enum(Go),joinedTeamAt:T(),orgRole:t.Enum(kc),avatar:t.Optional(Xl)}),J2e=d({tags:["teams"],url:un,method:"GET",paginated:!0,response:t.Array(Zo),query:t.Object({...Q,includeMemberCount:t.Optional(t.Boolean()),searchQuery:t.Optional(p({description:"Substring matched against team names and descriptions."})),visibility:t.Optional(t.Enum(rp,{description:"Restrict results to teams with this visibility."})),myTeamsOnly:t.Optional(t.Boolean({description:"If true, return only teams that include the authenticated user."})),sortBy:t.Optional(pB),sortDirection:t.Optional(t.Enum(["asc","desc"],{description:"Sort direction: ascending or descending."}))})}),eze=d({tags:["teams"],url:`${un}/:id`,method:"GET",params:t.Object({id:p()}),response:Zo}),tze=d({tags:["teams"],url:`${un}/:id/members`,method:"GET",params:t.Object({id:p()}),response:t.Array(uB)}),rze=d({tags:["teams"],url:`${un}/:id/assets`,method:"GET",params:t.Object({id:p()}),response:t.Object({apiKeyCount:t.Number(),logRouteCount:t.Number(),monitorCount:t.Number(),notificationRuleCount:t.Number(),dashboardCount:t.Number()})}),nze=d({tags:["teams"],url:un,method:"POST",body:np,response:Zo}),oze=d({tags:["teams"],url:`${un}/:id`,method:"PUT",params:t.Object({id:p()}),body:np,response:Zo}),ize=d({tags:["teams"],url:`${un}/bulk-update`,method:"POST",body:t.Object({teamIds:t.Array(p(),{maxItems:100}),config:t.Object({visibility:t.Enum(rp)})}),response:t.Object({})}),aze=d({tags:["teams"],url:`${un}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R});var mB=t.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=I("type",[t.Object({type:t.Literal("user",{description:"The resource was created or updated by a user."}),id:t.String({description:"Unique identifier of the user actor."}),name:t.String({description:"Display name of the user actor at the time of response."}),avatar:t.Optional(Xl)}),t.Object({type:t.Literal("operation-api-key",{description:"The resource was created or updated by an operation API key."}),id:t.String({description:"Unique identifier of the operation API key actor."}),name:t.String({description:"Display name of the operation API key actor."}),source:t.Optional(mB)})],{description:"User or operation API key responsible for creating or updating a resource. Returned by Tsuga for audit context."});var ft="/v0/monitors",Xo=["alert","resolve","keep_last_status","consider_zero"],Jo=["alert","resolve","keep_last_status"];var sR=["no_aggregation","all","any","each","proportion"],cR=["greater_than","less_than","equal","not_equal","greater_than_or_equal","less_than_or_equal"];var lB=t.Object({formula:t.String({description:"Formula result to compare against the threshold, usually `q1` or a formula alias."}),operator:t.Enum(cR,{description:"Comparison operator used to evaluate the threshold condition."}),threshold:t.Number({description:"Numeric threshold value used by the comparison."})}),dB=t.Object({formula:p({type:"tsuga-formula",description:"Formula result to compare against the threshold, usually `q1` or a formula alias."}),operator:t.Enum(cR,{description:"Comparison operator used to evaluate the threshold condition."}),threshold:t.Number({description:"Numeric threshold value used by the comparison."})}),fB=5,Jl=t.Array(lB,{description:"Threshold conditions evaluated against query and formula results. All listed conditions must match for a non-grouped threshold monitor to alert."}),ed=t.Array(dB,{minItems:1,maxItems:fB,description:"Threshold conditions evaluated against query and formula results. All listed conditions must match for a non-grouped threshold monitor to alert."}),td=t.Object({formula:t.String({description:"Formula result analyzed for anomalous behavior, usually `q1` or a formula alias."}),conditionType:t.Enum(["rate","error","cpu","general","to_be_set"],{description:"Anomaly model type Tsuga uses to classify expected behavior: `rate` flags downward anomalies (e.g. count rates), `error` and `cpu` flag upward anomalies (e.g. error counts/rates, CPU usage), `general` flags both directions, and `to_be_set` is a placeholder Tsuga replaces by inferring the model type from the monitor query when the monitor is created or updated."})},{description:"Anomaly detection condition evaluated by this monitor. The `formula` result is compared against behavior learned from historical query results, and the monitor alerts on deviations in the direction implied by `conditionType`."}),rd=t.Object({formula:p({type:"tsuga-formula",description:"Formula result analyzed for anomalous behavior, usually `q1` or a formula alias."}),conditionType:t.Enum(["rate","error","cpu","general","to_be_set"],{description:"Anomaly model type used to classify expected behavior: `rate` flags downward anomalies (e.g. count rates), `error` and `cpu` flag upward anomalies (e.g. error counts/rates, CPU usage), and `general` flags both directions. Use `to_be_set` to let Tsuga infer the model type from the monitor query during create or update."})},{description:"Anomaly detection condition evaluated by this monitor. The `formula` result is compared against behavior learned from historical query results, and the monitor alerts on deviations in the direction implied by `conditionType`."}),dt=[1,2,3,4,5];var op={timeframe:t.Number({description:"Lookback window, in minutes, that each query-backed threshold monitor evaluation aggregates over. Always a whole number, at least 1."}),groupByFields:t.Array(t.Object({fields:t.Array(t.String(),{description:"Attribute names the monitor splits results by, evaluating each resulting group independently. Empty means the monitor evaluates a single ungrouped series."}),limit:t.Number({description:"Configured limit for this group by. Currently ignored; monitor evaluation applies a fixed limit of 100 groups per field."}),sortOrder:t.Optional(t.Enum(["asc","desc"],{description:"Sort direction applied to groups: ascending or descending."})),replaceNullWith:t.Optional(t.String({description:"Value used to group documents that have no value for a grouped field."}))}),{description:"Monitor group by configuration. The `limit` setting is currently ignored; evaluation applies a fixed limit of 100 groups per field."}),aggregationAlertLogic:t.Optional(t.Enum(sR,{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:t.Optional(t.Integer({description:"Percentage threshold used when `aggregationAlertLogic` is `proportion`."}))},ip={timeframe:t.Integer({minimum:1,description:"Lookback window, in minutes, that each query-backed threshold monitor evaluation aggregates over."}),groupByFields:t.Array(t.Object({fields:t.Array(p(),{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:t.Number({description:"Configured limit for this group by. Currently ignored; monitor evaluation applies a fixed limit of 100 groups per field."}),sortOrder:t.Optional(t.Enum(["asc","desc"],{description:"Sort direction applied to groups: ascending or descending."})),replaceNullWith:t.Optional(p({allowEmpty:!1,description:"Value used to group documents that have no value for a grouped field."}))}),{maxItems:1,description:"Monitor group by configuration. The `limit` setting is currently ignored; evaluation applies a fixed limit of 100 groups per field."}),aggregationAlertLogic:t.Optional(t.Enum(sR,{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:t.Optional(t.Integer({minimum:1,maximum:99,description:"Percentage threshold used when `aggregationAlertLogic` is `proportion`."}))},nd={...op,timeframe:t.Number({description:"Lookback window, in minutes, that each anomaly monitor evaluation aggregates over. Always a whole number from 5 through 1440."})},od={...ip,timeframe:t.Integer({minimum:5,maximum:1440,description:"Lookback window, in minutes, that each anomaly monitor evaluation aggregates over."})},pR=t.Object({type:t.Literal("metric",{description:"Threshold monitor over metric aggregations."}),conditions:Jl,noDataBehavior:t.Enum(Xo,{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."}),...op,queries:Er},{$id:"MonitorConfigurationMetric"}),uR=t.Object({type:t.Literal("metric",{description:"Threshold monitor over metric aggregations."}),conditions:ed,noDataBehavior:t.Enum(Xo,{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."}),...ip,queries:_r},{$id:"InputMonitorConfigurationMetric"}),mR=t.Object({type:t.Literal("log",{description:"Threshold monitor over log aggregations."}),conditions:Jl,noDataBehavior:t.Enum(Xo,{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."}),...op,queries:Er},{$id:"MonitorConfigurationLog"}),lR=t.Object({type:t.Literal("log",{description:"Threshold monitor over log aggregations."}),conditions:ed,noDataBehavior:t.Enum(Xo,{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."}),...ip,queries:_r},{$id:"InputMonitorConfigurationLog"}),dR=t.Object({type:t.Literal("trace",{description:"Threshold monitor over trace aggregations."}),conditions:Jl,noDataBehavior:t.Enum(Xo,{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."}),...op,queries:Er},{$id:"MonitorConfigurationTrace"}),gB=t.Object({type:t.Literal("trace",{description:"Threshold monitor over trace aggregations."}),conditions:ed,noDataBehavior:t.Enum(Xo,{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."}),...ip,queries:_r},{$id:"InputMonitorConfigurationTrace"}),fR=t.Object({type:t.Literal("anomaly-log",{description:"Anomaly monitor over log aggregations."}),condition:td,noDataBehavior:t.Enum(Jo,{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."}),...nd,queries:Er},{$id:"MonitorConfigurationAnomalyLog"}),gR=t.Object({type:t.Literal("anomaly-log",{description:"Anomaly monitor over log aggregations."}),condition:rd,noDataBehavior:t.Enum(Jo,{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."}),...od,queries:_r},{$id:"InputMonitorConfigurationAnomalyLog"}),yR=t.Object({type:t.Literal("anomaly-metric",{description:"Anomaly monitor over metric aggregations."}),condition:td,noDataBehavior:t.Enum(Jo,{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."}),...nd,queries:Er},{$id:"MonitorConfigurationAnomalyMetric"}),hR=t.Object({type:t.Literal("anomaly-metric",{description:"Anomaly monitor over metric aggregations."}),condition:rd,noDataBehavior:t.Enum(Jo,{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."}),...od,queries:_r},{$id:"InputMonitorConfigurationAnomalyMetric"}),TR=t.Object({type:t.Literal("anomaly-trace",{description:"Anomaly monitor over trace aggregations. Use this configuration when Tsuga should learn historical trace query behavior and alert on unusual movement in trace-derived values."}),condition:td,noDataBehavior:t.Enum(Jo,{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."}),...nd,queries:Er},{$id:"MonitorConfigurationAnomalyTrace"}),yB=t.Object({type:t.Literal("anomaly-trace",{description:"Anomaly monitor over trace aggregations. Set this value to create or update an anomaly monitor that learns historical trace query behavior and alerts on unusual movement in trace-derived values."}),condition:rd,noDataBehavior:t.Enum(Jo,{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."}),...od,queries:_r},{$id:"InputMonitorConfigurationAnomalyTrace"}),ER=t.Object({type:t.Literal("certificate-expiry",{description:"Monitor that alerts before discovered certificates expire."}),warnBeforeInDays:t.Integer({description:"Number of days before certificate expiry when the monitor should warn."}),cloudAccounts:t.Optional(t.Array(t.String(),{description:"Cloud account IDs whose certificates are checked. Omitted means certificates from all cloud accounts are checked."})),aggregationAlertLogic:t.Literal("each",{description:"Certificate expiry monitors alert independently for each certificate."}),noDataBehavior:t.Literal("resolve",{description:"Certificate expiry monitors resolve when matching certificate data disappears."})},{$id:"MonitorConfigurationCertificateExpiry"}),hB=t.Object({type:t.Literal("certificate-expiry",{description:"Monitor that alerts before discovered certificates expire."}),warnBeforeInDays:t.Integer({minimum:1,maximum:365,description:"Number of days before certificate expiry when the monitor should warn. Valid values are 1 through 365."}),cloudAccounts:t.Optional(t.Array(t.String(),{minItems:1,description:"Cloud account IDs whose certificates are checked. Omit to check certificates from all cloud accounts."})),aggregationAlertLogic:t.Literal("each",{description:"Certificate expiry monitors alert independently for each certificate."}),noDataBehavior:t.Literal("resolve",{description:"Certificate expiry monitors resolve when matching certificate data disappears."})},{$id:"InputMonitorConfigurationCertificateExpiry"}),TB=t.Object({type:t.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:t.Literal("each",{description:"Fixed aggregation logic for log error pattern monitors. Each new pattern is evaluated as its own alert group."}),noDataBehavior:t.Literal("keep_last_status",{description:"Fixed no-data behavior for log error pattern monitors. Pattern state is kept until inactive pattern groups expire."}),filter:t.Object({teamIds:t.Array(t.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:t.String({description:"Environment whose logs are searched for new error patterns."}),service:t.Optional(t.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"}),EB=t.Object({type:t.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:t.Literal("each",{description:"Fixed aggregation logic for log error pattern monitors. Each new pattern is evaluated as its own alert group."}),noDataBehavior:t.Literal("keep_last_status",{description:"Fixed no-data behavior for log error pattern monitors. Pattern state is kept until inactive pattern groups expire."}),filter:t.Object({teamIds:t.Array(p(),{description:"Team IDs whose logs are searched for new error patterns. Tsuga resolves these team IDs to team names when exporting monitor assets."}),env:p({description:"Environment whose logs are searched for new error patterns."}),service:t.Optional(p({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"}),_B=I("type",[pR,mR,dR,fR,yR,TB,TR,ER],{description:"Monitor evaluation configuration. The `type` discriminator determines which telemetry source, condition shape, and evaluation rules Tsuga uses."}),IB=I("type",[uR,lR,gB,gR,hR,yB,EB,hB],{description:"Monitor evaluation configuration. The `type` discriminator determines which telemetry source, condition shape, and evaluation rules Tsuga uses."});var Cr=t.Object({id:t.String({description:"Tsuga-generated monitor ID assigned when the monitor is created."}),name:t.String({description:"Display name of the monitor and alert source."}),owner:t.String({description:"Team ID that owns and manages the monitor."}),message:t.Optional(t.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:_B,priority:t.Enum(dt,{description:"Monitor priority from 1 through 5, where 1 is highest priority."}),permissions:on,dashboardId:t.Optional(t.String({description:"ID of the dashboard linked to this monitor for context when investigating alerts. Caller-supplied. Omitted when no dashboard is linked."})),pauseUntil:t.Optional(T({description:"Timestamp until which the monitor is snoozed."})),creator:t.Optional(ue),updater:t.Optional(ue),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:t.Array(t.String(),{description:"Cluster IDs where the monitor is deployed. Empty means all eligible clusters."})},{title:"Monitor"}),bB=I("type",[pR,mR,dR,fR,yR,TR,ER]),xze=t.Object({...Cr.properties,configuration:bB},{title:"Monitor"}),Rze=t.Object({...Cr.properties,configuration:I("type",[uR,lR,gR,hR])},{title:"Monitor"}),ka=t.Object({name:p({description:"Display name of the monitor and alert source."}),message:t.Optional(p({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:IB,priority:t.Enum(dt,{description:"Monitor priority from 1 through 5, where 1 is highest priority."}),owner:p({allowEmpty:!1,description:"Team ID that owns and manages the monitor."}),dashboardId:t.Optional(t.Union([t.Null(),p({allowEmpty:!1})],{description:"ID of the dashboard to link to this monitor for context when investigating alerts. On create: omit or send `null` to leave the monitor unlinked. On update: omit to skip updating this field, send `null` to clear an existing link."})),pauseUntil:t.Optional(p({allowEmpty:!1,type:"date-time",description:"ISO timestamp until which the monitor should be snoozed."})),permissions:on,clusterIds:t.Optional(t.Array(p({allowEmpty:!1}),{description:"Cluster IDs where the monitor should be deployed. Empty or omitted means all eligible clusters for cluster-deployed monitor types."}))}),aR=["threshold","certificate-expiry","anomaly-detection","log-error-pattern"],mn={PRIORITY:"priority",TYPE:"type",NAME:"name",OWNER:"owner",TAGS:"tags",CLUSTER_IDS:"clusterIds",PAUSE_UNTIL:"pauseUntil",ASSET_UPDATED_AT:"assetUpdatedAt"};var id=t.Object({owners:je(p({allowEmpty:!1}),{description:"Restrict results to monitors owned by any of these team IDs",maxItems:50}),searchQuery:t.Object({value:p({allowEmpty:!1,description:"Case-insensitive substring matched against monitor ID, monitor name, query filters, and aggregate fields. Wildcard characters are treated literally."}),exclude:t.Optional(t.Boolean({description:"If true, exclude monitors matching this value instead of including them"}))},{description:"Search query filter for monitors."}),tags:je(Yt.items,{description:"Restrict results to monitors that have at least one of the listed key/value tags",maxItems:50}),priorities:je(t.Enum(dt),{description:"Restrict results to monitors with one of these priorities",maxItems:dt.length}),types:je(t.Enum(aR),{description:"Restrict results to monitors with these types",maxItems:aR.length}),activity:t.Enum(["active","snoozed"],{description:"Restrict results by activity status: active monitors or currently snoozed monitors"}),clusterIds:je(p({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"}),ad=t.Partial(t.Object({...Q,filters:t.Partial(id),sort:t.Object({by:t.Enum([mn.PRIORITY,mn.TYPE,mn.NAME,mn.OWNER,mn.TAGS,mn.CLUSTER_IDS,mn.PAUSE_UNTIL,mn.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:t.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."})})),Cze=d({tags:["monitors"],url:`${ft}/query`,method:"POST",paginated:!0,response:t.Array(Cr),body:ad}),Pze=d({tags:["monitors"],url:`${ft}/tags/query`,method:"POST",body:t.Object({filters:t.Optional(t.Partial(t.Omit(id,["tags"])))}),response:zt}),Uze=d({tags:["monitors"],url:`${ft}/counts/query`,method:"POST",body:t.Object({filters:t.Optional(t.Partial(t.Omit(id,["activity"])))}),response:t.Object({all:t.Integer({description:"Total number of monitors matching the filters that the user can read."}),active:t.Integer({description:"Number of matching readable monitors that are not currently snoozed."}),snoozed:t.Integer({description:"Number of matching readable monitors that are currently snoozed."})})}),wze=d({tags:["monitors"],url:`${ft}/:id`,method:"GET",params:t.Object({id:p()}),response:Cr}),Nze=d({tags:["monitors"],url:ft,method:"POST",body:ka,response:Cr}),Lze=d({tags:["monitors"],url:`${ft}/:id`,method:"PUT",params:t.Object({id:p()}),body:ka,response:Cr}),vze=d({tags:["monitors"],url:`${ft}/bulk-update`,method:"PUT",body:t.Object({monitorIds:t.Array(p({allowEmpty:!1}),{minItems:1}),owner:p({allowEmpty:!1})}),response:t.Object({})}),kze=d({tags:["monitors"],url:`${ft}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),Mze=d({tags:["monitors"],url:`${ft}/bulk-delete`,method:"DELETE",body:t.Object({ids:t.Array(p())}),response:t.Object({})}),Dze=d({tags:["monitors"],url:`${ft}/:id/snooze`,method:"POST",params:t.Object({id:p()}),body:t.Object({pauseUntil:p({allowEmpty:!1,type:"date-time"})}),response:Cr}),Gze=d({tags:["monitors"],url:`${ft}/bulk-snooze`,method:"POST",body:t.Object({monitorIds:t.Array(p()),pauseUntil:p({allowEmpty:!1,type:"date-time"})}),response:t.Object({})}),SB=["alert","alert_consider_zero","alert_no_data","keep_last_status_alert"],OB=["ok","ok_consider_zero","ok_no_data","keep_last_status_ok"],AB=[...SB,...OB],Zn=t.Enum(AB),xB=I("type",[t.Object({type:t.Literal("each"),subStates:t.Record(t.String(),t.Object({stateValue:t.Union([Zn,t.Null()]),lastChangedAt:T()}))}),t.Object({type:t.Literal("no_aggregation"),stateValue:t.Optional(Zn)}),t.Object({type:t.Literal("any"),stateValue:t.Optional(Zn)}),t.Object({type:t.Literal("all"),stateValue:t.Optional(Zn)}),t.Object({type:t.Literal("proportion"),stateValue:t.Optional(Zn)})]),RB=t.Object({monitorId:t.String(),currentState:xB,lastChangedAt:t.Optional(T())}),$ze=d({tags:["monitors"],url:`${ft}/states/:id`,method:"GET",params:t.Object({id:p()}),response:RB}),jze=d({tags:["monitors"],url:`${ft}/:id/transitions`,method:"GET",params:t.Object({id:p()}),query:t.Object({from:t.Number(),to:t.Number()}),response:t.Array(t.Object({id:t.String(),createdAt:T(),fromState:t.Optional(Zn),toState:t.Optional(Zn),dimension:t.Optional(t.String())}))}),CB=["unprocessed","processed","failed-to-process"],qze=d({tags:["monitors"],url:`${ft}/:id/results`,method:"GET",params:t.Object({id:p()}),query:t.Object({from:t.Number(),to:t.Number()}),response:t.Object({isTruncated:t.Boolean(),results:t.Array(t.Object({id:t.String(),evaluationAt:T(),formulaResult:t.Object({groups:t.Array(t.Object({groupKey:t.Record(t.String(),_a),results:t.Array(t.Union([t.Number(),t.Null()])),conditionMet:t.Enum(["true","false","nan-no-data"])}))}),createdAt:T(),status:t.Enum(CB)}))})});var Pr="/v0/slos",PB=[7,30,90],UB=["good","bad"],SR=t.Enum(UB,{description:"How to treat SLO with no data: good (count as meeting the SLO), bad (count as breaching it)"}),wB=["good","bad","ignore"],OR=t.Enum(wB,{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)"}),_R=30,IR=1440,AR=["greater_than","less_than","greater_than_or_equal","less_than_or_equal"],NB=["healthy","breached","no_data"],ap=t.Enum(NB,{description:"SLO status: healthy (meeting the target), breached (breaching it), or no_data (not evaluated yet)"}),bR={sli:t.Optional(t.Number({description:"Service level indicator for the latest evaluation; absent when there is no data"})),errorBudget:t.Optional(t.Number({description:"Remaining error budget at the latest evaluation; negative when exhausted, absent when there is no data"})),status:ap},LB=t.Object({overall:t.Object(bR,{description:"Latest overall evaluation for the cluster"}),perGroup:t.Array(t.Object({groupKey:t.Record(t.String(),_a,{description:"Group-by field values identifying this group, keyed by field name. Present only when the SLO configuration sets `groupByFields`."}),...bR}),{description:"Latest evaluation for each group produced by the SLO configuration's `groupByFields`. Empty when the SLO is not grouped."})},{title:"SloClusterResults"}),xR=t.Record(t.String(),LB,{description:"Latest evaluation results keyed by cluster ID."}),sd=t.Object({queries:Er,formula:Fc},{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."}),cd=t.Object({queries:_r,formula:Gn},{title:"SloQueryFormula",description:"Aggregation queries combined by a formula to produce the SLO signal. Formulas reference queries as q1, q2, and so on."}),vB=t.Object({type:t.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:t.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"}),kB=t.Object({type:t.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:t.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 MB=t.Object({type:t.Literal("threshold",{description:"Alert configuration kind. Set to `threshold` for alerts that fire when the SLO indicator falls below a percentage threshold."}),threshold:t.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"}),DB=t.Object({type:t.Literal("threshold",{description:"Alert configuration kind. Set to `threshold` for alerts that fire when the SLO indicator falls below a percentage threshold."}),threshold:t.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"}),GB=I("type",[vB,MB],{description:"Alert trigger configuration: burn-rate or threshold"}),RR=I("type",[kB,DB],{description:"Alert trigger configuration: burn-rate or threshold"}),pd=t.Enum(dt,{description:"Alert priority (1 is highest, 5 is lowest)"}),ud=t.Object({id:t.String({description:"Tsuga-generated SLO alert ID assigned when the alert is created."}),sloId:t.String({description:"Parent SLO ID for this alert."}),priority:pd,configuration:GB,createdAt:T({description:"Timestamp when Tsuga created the alert."}),updatedAt:T({description:"Timestamp when Tsuga last updated the alert."}),assetUpdatedAt:T({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})},{title:"SloAlert"}),$B=t.Object({priority:pd,configuration:RR}),jB=t.Object({id:t.Optional(p({allowEmpty:!1,description:"Identifier of an existing alert to update. Omit to create a new alert on this SLO."})),priority:pd,configuration:RR}),qB=I("type",[t.Object({type:t.Literal("event",{description:"Configuration kind. Set to `event` for SLOs that compute SLI from good and total query formulas over the rolling timeframe."}),dataSource:Kt,goodQuery:sd,totalQuery:sd,groupByFields:t.Optional(qo),noDataBehavior:SR},{title:"EventSloConfiguration"}),t.Object({type:t.Literal("time",{description:"Configuration kind. Set to `time` for SLOs that evaluate a query against a threshold in fixed-size time slices."}),dataSource:Kt,query:sd,sliceSizeMinutes:t.Integer({description:"Length of each time-SLO evaluation slice in minutes. Required for `type: time`."}),threshold:t.Object({operator:t.Enum(AR,{description:"Comparison operator between the query value and the threshold"}),value:t.Number({description:"Threshold value compared against the query signal"})},{description:"Threshold comparison applied to each time-SLO evaluation slice"}),groupByFields:t.Optional(qo),noDataBehavior:OR},{title:"TimeSliceSloConfiguration"})],{description:"SLI configuration for this SLO. Use `event` for good/total event-ratio SLOs or `time` for thresholded time-slice SLOs."}),BB=I("type",[t.Object({type:t.Literal("event",{description:"Configuration kind. Set to `event` for SLOs that compute SLI from good and total query formulas over the rolling timeframe."}),dataSource:Kt,goodQuery:cd,totalQuery:cd,groupByFields:t.Optional(Ir),noDataBehavior:SR},{title:"EventSloConfiguration"}),t.Object({type:t.Literal("time",{description:"Configuration kind. Set to `time` for SLOs that evaluate a query against a threshold in fixed-size time slices."}),dataSource:Kt,query:cd,sliceSizeMinutes:t.Integer({minimum:_R,maximum:IR,description:`Length of each time-SLO evaluation slice in minutes. Required for \`type: time\`. Valid input is ${_R} through ${IR}.`}),threshold:t.Object({operator:t.Enum(AR,{description:"Comparison operator between the query value and the threshold"}),value:t.Number({description:"Threshold value compared against the query signal"})},{description:"Threshold comparison applied to each time-SLO evaluation slice"}),groupByFields:t.Optional(Ir),noDataBehavior:OR},{title:"TimeSliceSloConfiguration"})],{description:"SLI configuration for this SLO. Use `event` for good/total event-ratio SLOs or `time` for thresholded time-slice SLOs."}),FB=t.Number({exclusiveMinimum:0,exclusiveMaximum:100,description:"Target percentage (0 < target < 100, e.g. 99.9)"}),CR=t.Enum(PB,{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."}),HB=t.Array(t.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."}),KB=t.Array(p({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."}),ei=t.Object({id:t.String({description:"Tsuga-generated SLO ID assigned when the SLO is created."}),name:t.String({description:"Display name of the SLO, set by the caller."}),description:t.Optional(t.String({description:"Free-form, caller-provided description of what the SLO measures. Absent when not set."})),tags:ke,configuration:qB,target:t.Number({description:"Target percentage (0 < target < 100, e.g. 99.9)"}),timeframeDays:CR,owner:t.String({description:"Team ID that owns the SLO"}),permissions:on,clusterIds:HB,creator:t.Optional(ue),updater:t.Optional(ue),alerts:t.Array(ud,{description:"Alerts attached to this SLO"}),createdAt:T({description:"Timestamp when Tsuga created the SLO."}),updatedAt:T({description:"Timestamp when Tsuga last updated the SLO."}),assetUpdatedAt:T({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})},{title:"Slo"}),zB=t.Object({...ei.properties,results:xR},{title:"SloWithResults"}),sp=t.Object({name:p({allowEmpty:!1,description:"Display name of the SLO."}),description:t.Optional(p({type:"long",description:"Free-form, caller-provided description of what the SLO measures. Optional."})),tags:Ve,configuration:BB,target:FB,timeframeDays:CR,owner:p({allowEmpty:!1,description:"Team ID that owns the SLO"}),permissions:on,clusterIds:t.Optional(KB),alerts:t.Array($B,{description:"Alerts to create on this SLO. Send an empty array for none."})}),md=t.Object({...t.Omit(sp,["alerts"]).properties,alerts:t.Array(jB,{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."})}),PR=t.Object({owners:je(p({allowEmpty:!1}),{description:"Restrict results to SLOs owned by any of these team IDs",maxItems:50}),searchQuery:t.Object({value:p({allowEmpty:!1,description:"Substring matched case-insensitively against the SLO name or SLO ID."}),exclude:t.Optional(t.Boolean({description:"If true, exclude SLOs matching this value instead of including them"}))},{description:"Text filter for SLO names or IDs. Optional; `exclude: true` removes matching SLOs."}),tags:je(Yt.items,{description:"Restrict results to SLOs that have at least one of the listed key/value tags",maxItems:50}),clusterIds:je(p({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:je(ap,{description:"Restrict results to SLOs whose status is one of these values",maxItems:3})},{description:"Optional filters applied to narrow the returned SLOs"}),ld=t.Partial(t.Object({...Q,filters:t.Partial(PR),sort:t.Object({by:t.Enum(["name","owner","tags","updatedAt","sli","errorBudget","status"],{description:"Field to sort by"}),direction:t.Enum(["asc","desc"],{description:"Sort direction: ascending or descending"})},{description:"Optional sorting applied to the returned SLOs"})})),Jze=d({tags:["slos"],url:`${Pr}/query`,method:"POST",paginated:!0,response:t.Array(zB),body:ld}),e9e=d({tags:["slos"],url:`${Pr}/tags/query`,method:"POST",body:t.Object({filters:t.Optional(t.Partial(t.Omit(PR,["tags","statuses"])))}),response:zt}),t9e=d({tags:["slos"],url:`${Pr}/:id`,method:"GET",params:t.Object({id:p()}),response:ei}),r9e=d({tags:["slos"],url:`${Pr}/:id/results`,method:"GET",params:t.Object({id:p()}),response:xR}),n9e=d({tags:["slos"],url:Pr,method:"POST",body:sp,response:ei}),o9e=d({tags:["slos"],url:`${Pr}/:id`,method:"PUT",params:t.Object({id:p()}),body:md,response:ei}),i9e=d({tags:["slos"],url:`${Pr}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),a9e=d({tags:["slos"],url:`${Pr}/bulk-delete`,method:"DELETE",body:t.Object({ids:t.Array(p())}),response:t.Object({})}),s9e=d({tags:["slos"],url:`${Pr}/bulk-update`,method:"PUT",body:t.Object({sloIds:t.Array(p()),owner:p({allowEmpty:!1})}),response:t.Object({})});var ti="/v0/notifications",Jn=`${ti}/rules`,UR=`${ti}/slack/setup`,Ma=`${ti}/integrations`,Xn=["triggered","resolved","no-data"],YB=["sent","stale","pending","rate-limited","failed","silenced"],VB=t.Optional(t.Object({maxMessages:t.Integer({description:"Maximum number of notifications this target can send during the rate-limiting window."}),minutes:t.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."})),dd=t.Object({maxMessages:t.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:t.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."}),QB=t.Optional(dd),WB=t.Optional(t.Object({mode:t.Literal("each",{description:"Renotification mode. `each` sends repeat notifications for each matching monitor alert that remains in a configured state."}),renotificationStates:t.Array(t.Enum(["alert","alert_no_data"]),{description:"Monitor alert states that trigger repeat notifications while the target remains configured for renotification."}),renotifyIntervalMinutes:t.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."})),ZB=t.Optional(t.Object({mode:t.Literal("each",{description:"Renotification mode. `each` sends repeat notifications for each matching monitor alert that remains in a configured state."}),renotificationStates:t.Array(t.Enum(["alert","alert_no_data"]),{description:"Monitor alert states that trigger repeat notifications while the target remains configured for renotification."}),renotifyIntervalMinutes:t.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."})),Da=t.Object({id:t.String({description:"Identifier of the notification target within this rule, used with the rule ID for per-target delivery state such as rate limiting."}),rateLimit:VB,renotifyConfig:WB,config:I("type",[t.Object({type:t.Literal("slack",{description:"Slack target backed by a configured Slack integration."}),channel:t.String({description:"Slack channel ID that receives the notification"}),integrationId:t.String({description:"Slack workspace ID that receives the notification"}),integrationName:t.String({description:"Human readable name of the Slack integration"})},{$id:"RuleTargetConfigSlack"}),t.Object({type:t.Literal("incident-io",{description:"incident.io target backed by a configured incident.io integration."}),integrationId:t.String({description:"Identifier of the incident.io integration to use"}),integrationName:t.String({description:"Human readable name of the incident.io integration"})},{$id:"RuleTargetConfigIncidentIo"}),t.Object({type:t.Literal("email",{description:"Email target that sends directly to the listed addresses and does not require an integration."}),addresses:t.Array(t.String(),{description:"Email addresses that will receive the alert"})},{$id:"RuleTargetConfigEmail"}),t.Object({type:t.Literal("grafana-irm",{description:"Grafana IRM target backed by a configured Grafana IRM integration."}),integrationId:t.String({description:"Identifier of the Grafana IRM integration to use"}),integrationName:t.String({description:"Human readable name of the Grafana IRM integration"})},{$id:"RuleTargetConfigGrafanaIrm"}),t.Object({type:t.Literal("pagerduty",{description:"PagerDuty target backed by a configured PagerDuty integration."}),integrationId:t.String({description:"Identifier of the PagerDuty integration to use"}),integrationName:t.String({description:"Human readable name of the PagerDuty integration"})},{$id:"RuleTargetConfigPagerDuty"}),t.Object({type:t.Literal("microsoft-teams",{description:"Microsoft Teams target backed by a configured Microsoft Teams integration."}),integrationId:t.String({description:"Identifier of the Microsoft Teams integration to use"}),integrationName:t.String({description:"Human readable name of the Microsoft Teams integration"})},{$id:"RuleTargetConfigMicrosoftTeams"}),t.Object({type:t.Literal("webhook",{description:"Webhook target backed by a configured webhook integration."}),integrationId:t.String({description:"Identifier of the webhook integration to use"}),integrationName:t.String({description:"Human readable name of the webhook integration"})},{$id:"RuleTargetConfigWebhook"}),t.Object({type:t.Literal("servicenow",{description:"ServiceNow target backed by a configured ServiceNow integration."}),integrationId:t.String({description:"Identifier of the ServiceNow integration to use"}),integrationName:t.String({description:"Human readable name of the ServiceNow integration"})},{$id:"RuleTargetConfigServiceNow"}),t.Object({type:t.Literal("google-chat",{description:"Google Chat target backed by a configured Google Chat integration."}),integrationId:t.String({description:"Identifier of the Google Chat integration to use"}),integrationName:t.String({description:"Human readable name of the Google Chat integration"})},{$id:"RuleTargetConfigGoogleChat"}),t.Object({type:t.Literal("squadcast",{description:"Squadcast target backed by a configured Squadcast integration."}),integrationId:t.String({description:"Identifier of the Squadcast integration to use"}),integrationName:t.String({description:"Human readable name of the Squadcast integration"})},{$id:"RuleTargetConfigSquadcast"}),t.Object({type:t.Literal("jira",{description:"Jira target backed by a configured Jira integration."}),integrationId:t.String({description:"Identifier of the Jira integration to use"}),integrationName:t.String({description:"Human readable name of the Jira integration"}),projectKey:t.String({description:'Key of the Jira project that alert issues are filed into, like "OPS".'}),issueType:t.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`."})}),ri=t.Object({id:p({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:QB,config:I("type",[t.Object({type:t.Literal("slack",{description:"Slack target backed by a configured Slack integration."}),channel:p({allowEmpty:!1,description:"Slack channel ID that receives the notification"}),integrationId:p({allowEmpty:!1,description:"Slack workspace ID that receives the notification"})},{$id:"RuleTargetInputSlack"}),t.Object({type:t.Literal("incident-io",{description:"incident.io target backed by a configured incident.io integration."}),integrationId:p({allowEmpty:!1,description:"Identifier of the incident.io integration to use"})},{$id:"RuleTargetInputIncidentIo"}),t.Object({type:t.Literal("pagerduty",{description:"PagerDuty target backed by a configured PagerDuty integration."}),integrationId:p({allowEmpty:!1,description:"Identifier of the PagerDuty integration to use"})},{$id:"RuleTargetInputPagerDuty"}),t.Object({type:t.Literal("email",{description:"Email target that sends directly to the listed addresses and does not require an integration."}),addresses:t.Array(p({type:"email"}),{minItems:1,maxItems:20,description:"Email addresses that will receive the alert"})},{$id:"RuleTargetInputEmail"}),t.Object({type:t.Literal("grafana-irm",{description:"Grafana IRM target backed by a configured Grafana IRM integration."}),integrationId:p({allowEmpty:!1,description:"Identifier of the Grafana IRM integration to use"})},{$id:"RuleTargetInputGrafanaIrm"}),t.Object({type:t.Literal("microsoft-teams",{description:"Microsoft Teams target backed by a configured Microsoft Teams integration."}),integrationId:p({allowEmpty:!1,description:"Identifier of the Microsoft Teams integration to use"})},{$id:"RuleTargetInputMicrosoftTeams"}),t.Object({type:t.Literal("webhook",{description:"Webhook target backed by a configured webhook integration."}),integrationId:p({allowEmpty:!1,description:"Identifier of the webhook integration to use"})},{$id:"RuleTargetInputWebhook"}),t.Object({type:t.Literal("servicenow",{description:"ServiceNow target backed by a configured ServiceNow integration."}),integrationId:p({allowEmpty:!1,description:"Identifier of the ServiceNow integration to use"})},{$id:"RuleTargetInputServiceNow"}),t.Object({type:t.Literal("google-chat",{description:"Google Chat target backed by a configured Google Chat integration."}),integrationId:p({allowEmpty:!1,description:"Identifier of the Google Chat integration to use"})},{$id:"RuleTargetInputGoogleChat"}),t.Object({type:t.Literal("squadcast",{description:"Squadcast target backed by a configured Squadcast integration."}),integrationId:p({allowEmpty:!1,description:"Identifier of the Squadcast integration to use"})},{$id:"RuleTargetInputSquadcast"}),t.Object({type:t.Literal("jira",{description:"Jira target backed by a configured Jira integration."}),integrationId:p({allowEmpty:!1,description:"Identifier of the Jira integration to use"}),projectKey:p({allowEmpty:!1,description:'Key of the Jira project that alert issues are filed into, like "OPS".'}),issueType:p({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:ZB}),fd=I("type",[t.Object({type:t.Literal("specific-teams",{description:"Match alert transitions associated with the listed teams. The caller must be allowed to access every listed team."}),teams:t.Array(t.String(),{description:"Team IDs selected by this filter."})},{title:"SpecificTeams"}),t.Object({type:t.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"}),t.Object({type:t.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."}),gd=I("type",[t.Object({type:t.Literal("specific-teams",{description:"Match alert transitions associated with the listed teams. The caller must be allowed to access every listed team."}),teams:t.Array(p(),{minItems:1,maxItems:100,description:"Team IDs selected by this filter."})},{title:"SpecificTeams"}),t.Object({type:t.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"}),t.Object({type:t.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."}),ni=t.Object({id:t.String({description:"Tsuga-generated notification rule ID assigned when the rule is created."}),name:t.String({description:"Display name of the notification rule."}),queryString:t.Optional(t.String({description:"Optional query that narrows which alert transitions trigger the rule. Matches on the monitor transition group key and the monitor tags, e.g. `env:prod service:api`. Omit or leave empty to match regardless of tags."})),teamsFilter:fd,prioritiesFilter:t.Array(t.Enum(dt),{description:"Monitor priorities that must match for this rule to fire. An empty array matches every priority."}),transitionTypesFilter:t.Array(t.Enum(Xn),{description:"Alert state transitions that must match for this rule to fire. An empty array matches every transition type."}),clusterIdsFilter:t.Array(t.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:t.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:t.Boolean({description:"Whether the rule currently sends notifications when its filters match."}),tags:ke,targets:t.Array(Da,{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:t.Optional(ue),updater:t.Optional(ue)}),Ga=t.Object({name:p({description:"Display name of the notification rule."}),queryString:t.Optional(p({type:"tags-query",description:"Optional query that narrows which alert transitions trigger the rule. Matches on the monitor transition group key and the monitor tags, e.g. `env:prod service:api`. Omit or leave empty to match regardless of tags."})),teamsFilter:gd,prioritiesFilter:t.Array(t.Enum(dt),{maxItems:dt.length,description:"Monitor priorities that must match for this rule to fire. An empty array matches every priority."}),transitionTypesFilter:t.Array(t.Enum(Xn),{maxItems:Xn.length,description:"Alert state transitions that must match for this rule to fire. An empty array matches every transition type."}),clusterIdsFilter:t.Optional(t.Array(p({allowEmpty:!1}),{description:"Cluster IDs that must match for this rule to fire. Omit it, or leave it empty, to match every cluster."})),owner:p({allowEmpty:!1,description:"Team ID that owns and manages the rule"}),tags:Ve,isActive:t.Boolean({description:"Set to true for the rule to send notifications when its filters match."}),targets:t.Array(ri,{minItems:1,description:"Destinations that receive a notification whenever this rule matches an alert transition. This list replaces the existing targets on update."})}),cp=t.Object({id:t.String({description:"Unique identifier of the adaptive notification rule. Generated by Tsuga."}),name:t.String({description:"Display name of the adaptive notification rule."}),owner:t.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:t.Boolean({description:"Whether the rule currently sends notifications when one of its monitors fires."}),tags:ke,monitorIds:t.Array(t.String(),{description:"Monitors this rule reacts to."}),fallbackTarget:Da,creator:t.Optional(ue),updater:t.Optional(ue)}),wR=t.Object({name:p({description:"Display name of the adaptive notification rule."}),owner:p({allowEmpty:!1,description:"Team ID that owns and manages the rule"}),tags:Ve,isActive:t.Boolean({description:"Set to true for the rule to send notifications when one of its monitors fires."}),monitorIds:t.Array(p({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:ri}),y9e=d({tags:["notification-rules"],url:Jn,method:"GET",paginated:!0,query:t.Object(Q),response:t.Array(ni)}),h9e=d({tags:["notification-rules"],url:`${Jn}/:id`,params:t.Object({id:p()}),method:"GET",response:ni}),T9e=d({tags:["notification-rules"],url:Jn,method:"POST",body:Ga,response:ni}),E9e=d({tags:["notification-rules"],url:`${Jn}/:id`,method:"PUT",params:t.Object({id:p()}),body:Ga,response:ni}),_9e=d({tags:["notification-rules"],url:`${Jn}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),$a=`${ti}/adaptive-rules`,I9e=d({tags:["notification-rules"],url:$a,method:"GET",paginated:!0,query:t.Object(Q),response:t.Array(cp)}),b9e=d({tags:["notification-rules"],url:`${$a}/:id`,params:t.Object({id:p()}),method:"GET",response:cp}),S9e=d({tags:["notification-rules"],url:$a,method:"POST",body:wR,response:cp}),O9e=d({tags:["notification-rules"],url:`${$a}/:id`,method:"PUT",params:t.Object({id:p()}),body:wR,response:cp}),A9e=d({tags:["notification-rules"],url:`${$a}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),x9e=d({tags:["notification-integrations"],url:`${UR}/start`,method:"POST",response:t.Object({redirectUrl:t.String()})}),XB=["google-chat","grafana-irm","incident-io","jira","microsoft-teams","pagerduty","servicenow","slack","squadcast","webhook"],JB=t.Object({id:t.String(),name:t.String(),type:t.Enum(XB),createdAt:T(),ruleCount:t.Number(),creator:t.Optional(ue)}),R9e=d({tags:["notification-integrations"],url:`${Jn}/integrations`,method:"GET",paginated:!0,query:t.Object(Q),response:t.Array(JB)}),C9e=d({tags:["notification-integrations"],url:`${UR}/callback`,method:"GET",query:t.Object({code:p()}),response:t.Object({success:t.Boolean()})}),yd=["POST","PUT"],eF=t.Record(t.String(),t.String()),tF=t.Record(t.String(),t.Unknown()),rF=t.Record(t.String(),t.Union([t.String(),t.Number(),t.Boolean(),t.Null(),t.Array(t.Union([t.String(),t.Number(),t.Boolean()]))])),nF=I("type",[t.Object({type:t.Literal("json"),value:tF}),t.Object({type:t.Literal("form"),value:rF})]),oF=t.Object({ok:t.String(),alert:t.String()}),hd=t.Object({id:t.String(),name:t.String(),setting:I("type",[t.Object({type:t.Literal("incident-io"),alertSourceConfigId:t.String(),tokenLastChars:t.String()}),t.Object({type:t.Literal("grafana-irm"),urlLastChars:t.String()}),t.Object({type:t.Literal("pagerduty"),integrationKeyLastChars:t.String()}),t.Object({type:t.Literal("microsoft-teams"),webhookUrlLastChars:t.String()}),t.Object({type:t.Literal("webhook"),urlLastChars:t.String(),method:t.Enum(yd),authentication:I("type",[t.Object({type:t.Literal("bearer"),tokenLastChars:t.String()}),t.Object({type:t.Literal("basic"),username:t.String(),passwordLastChars:t.String()}),t.Object({type:t.Literal("custom-header"),key:t.String(),valueLastChars:t.String()}),t.Object({type:t.Literal("none")})]),customHeaders:t.Optional(eF),payloadTemplate:nF,eventNameMapping:t.Optional(oF)}),t.Object({type:t.Literal("servicenow"),instanceName:t.String(),username:t.String(),passwordLastChars:t.String()}),t.Object({type:t.Literal("google-chat"),webhookUrlLastChars:t.String()}),t.Object({type:t.Literal("squadcast"),webhookUrlLastChars:t.String()}),t.Object({type:t.Literal("jira"),siteUrl:t.String(),email:t.String(),apiTokenLastChars:t.String()})]),tags:ke}),iF=t.Object({type:t.Literal("webhook"),url:p({type:"uri"}),method:t.Enum(yd),authentication:I("type",[t.Object({type:t.Literal("bearer"),token:p({allowEmpty:!1})}),t.Object({type:t.Literal("basic"),username:p({allowEmpty:!1}),password:p({allowEmpty:!1})}),t.Object({type:t.Literal("custom-header"),key:p({allowEmpty:!1}),value:p({allowEmpty:!1})}),t.Object({type:t.Literal("none")})]),customHeaders:t.Record(p({allowEmpty:!1}),p()),payloadTemplate:I("type",[t.Object({type:t.Literal("json"),value:t.Record(p({allowEmpty:!1}),t.Unknown())}),t.Object({type:t.Literal("form"),value:t.Record(p({allowEmpty:!1}),t.Union([t.String(),t.Number(),t.Boolean(),t.Null(),t.Array(t.Union([t.String(),t.Number(),t.Boolean()]))]))})]),eventNameMapping:t.Optional(t.Object({ok:p({allowEmpty:!1}),alert:p({allowEmpty:!1})}))}),NR=t.Object({type:t.Literal("incident-io"),alertSourceConfigId:p(),token:p()}),LR=t.Object({type:t.Literal("grafana-irm"),url:p({type:"uri"})}),vR=t.Object({type:t.Literal("pagerduty"),integrationKey:p()}),kR=t.Object({type:t.Literal("microsoft-teams"),webhookUrl:p({type:"uri"})}),aF=t.Object({type:t.Literal("servicenow"),instanceName:p({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:p({allowEmpty:!1}),password:p({allowEmpty:!1})}),sF=t.Object({type:t.Literal("google-chat"),webhookUrl:p({type:"uri"})}),cF=t.Object({type:t.Literal("squadcast"),webhookUrl:p({type:"uri"})}),pF=t.Object({type:t.Literal("jira"),siteUrl:p({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:p({type:"email",allowEmpty:!1,description:"Atlassian account email used together with the API token for Basic authentication."}),apiToken:p({allowEmpty:!1,description:"Atlassian API token minted for the account, used as the Basic auth password."})}),uF=t.Object({name:p(),setting:I("type",[NR,LR,vR,kR,iF,aF,sF,cF,pF]),tags:Ve}),mF=t.Object({type:t.Literal("webhook"),url:t.Optional(p({type:"uri"})),method:t.Optional(t.Enum(yd)),authentication:t.Optional(I("type",[t.Object({type:t.Literal("bearer"),token:t.Optional(p({allowEmpty:!1}))}),t.Object({type:t.Literal("basic"),username:t.Optional(p({allowEmpty:!1})),password:t.Optional(p({allowEmpty:!1}))}),t.Object({type:t.Literal("custom-header"),key:t.Optional(p({allowEmpty:!1})),value:t.Optional(p({allowEmpty:!1}))}),t.Object({type:t.Literal("none")})])),customHeaders:t.Optional(t.Record(p({allowEmpty:!1}),p())),payloadTemplate:t.Optional(I("type",[t.Object({type:t.Literal("json"),value:t.Record(p({allowEmpty:!1}),t.Unknown())}),t.Object({type:t.Literal("form"),value:t.Record(p({allowEmpty:!1}),t.Union([t.String(),t.Number(),t.Boolean(),t.Null(),t.Array(t.Union([t.String(),t.Number(),t.Boolean()]))]))})])),eventNameMapping:t.Optional(t.Object({ok:t.Optional(p({allowEmpty:!1})),alert:t.Optional(p({allowEmpty:!1}))}))}),lF=t.Object({type:t.Literal("servicenow"),instanceName:t.Optional(p({allowEmpty:!1})),username:t.Optional(p({allowEmpty:!1})),password:t.Optional(p({allowEmpty:!1}))}),dF=t.Object({type:t.Literal("jira"),siteUrl:t.Optional(p({type:"uri",allowEmpty:!1})),email:t.Optional(p({allowEmpty:!1})),apiToken:t.Optional(p({allowEmpty:!1}))}),fF=t.Object({type:t.Literal("google-chat"),webhookUrl:p({type:"uri"})}),gF=t.Object({type:t.Literal("squadcast"),webhookUrl:p({type:"uri"})}),yF=t.Object({name:t.Optional(p()),setting:t.Optional(I("type",[NR,LR,vR,kR,mF,lF,fF,gF,dF]))}),P9e=d({tags:["notification-integrations"],url:Ma,method:"POST",body:uF,response:hd}),U9e=d({tags:["notification-integrations"],url:`${Ma}/:id`,method:"GET",params:t.Object({id:p()}),response:hd}),w9e=d({tags:["notification-integrations"],url:`${Ma}/:id`,method:"PUT",params:t.Object({id:p()}),body:yF,response:hd}),N9e=d({tags:["notification-integrations"],url:`${Ma}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),hF=I("status",[t.Object({status:t.Literal("ok",{description:"Tsuga reached Jira and listed the projects the credentials can file into."}),projects:t.Array(t.Object({key:t.String({description:'Jira project key, like "OPS".'}),name:t.String({description:"Human readable Jira project name."}),issueTypes:t.Array(t.String(),{description:"Issue type names available when creating an issue in this project."}),statuses:t.Array(t.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"}),t.Object({status:t.Literal("error",{description:"Tsuga could not load Jira metadata with the stored credentials."}),message:t.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."}),L9e=d({tags:["notification-integrations"],url:`${Ma}/:id/jira-metadata`,method:"GET",params:t.Object({id:p()}),response:hF}),v9e=d({tags:["notification-rules"],url:`${ft}/:id/notifications`,method:"GET",params:t.Object({id:p()}),query:t.Optional(t.Object({from:t.Optional(t.Number()),to:t.Optional(t.Number())})),response:t.Object({notifications:t.Array(t.Object({id:t.String(),monitorId:t.String(),monitorResultId:t.String(),ruleId:t.Optional(t.String()),targetId:t.Optional(t.String()),status:t.Enum(YB),tryCount:t.Number(),nextTryAt:T(),createdAt:T(),updatedAt:T(),sentAt:t.Optional(T())})),isTruncated:t.Boolean()})}),TF=["slack","incident-io","pagerduty","email","grafana-irm","microsoft-teams","webhook","servicenow","google-chat","squadcast","jira"],k9e=d({tags:["notification-rules"],url:`${Jn}/test`,method:"POST",body:t.Object({notificationRule:Ga,targetIds:t.Optional(t.Array(p({allowEmpty:!1}),{description:"Target IDs to test specific targets",minItems:1,maxItems:10}))}),response:t.Union([t.Object({success:t.Literal(!1),overallMessage:t.String({description:"Message when there is an overall error"})}),t.Object({success:t.Boolean(),results:t.Array(t.Object({targetId:t.String({description:"The ID of the target that was tested"}),targetType:t.Enum(TF,{description:"The type of the target (e.g., slack, webhook)"}),status:t.Enum(["success","failure"],{description:"Whether the test notification was sent successfully"}),message:t.Optional(t.String({description:"Message if the notification failed for this specific target"}))}))})])});var Nt="/v0/service-catalog";var EF=t.Object({team:t.String({description:"Team name observed on telemetry for this service."}),lastSeenAt:T({description:"Most recent time this team was observed for the service."})},{description:"A team name observed on telemetry for this service, with the last time it was seen."}),_F=t.Object({ingestionApiKey:t.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."})},{description:"An ingestion API key observed on telemetry for this service, with the last time it was seen."}),IF=t.Object({version:t.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:t.Optional(t.Boolean({description:"Whether Tsuga detected this version as associated with faulty behavior."})),faultyLatency:t.Optional(t.Boolean({description:"Whether the faulty behavior Tsuga detected for this version is a latency degradation. Only set by faulty deployment detection when it reports on latency; absent when the detection did not evaluate latency."})),detectionTriggered:t.Optional(t.Boolean({description:"Whether faulty deployment detection has already been triggered for this version. Set when the detection job is launched to avoid re-triggering it. Absent on versions predating this field."}))},{description:"A service version observed in telemetry, with first and last seen timestamps and faulty deployment detection results."}),bF=t.Object({language:t.String({description:"Programming language observed for this service."}),lastSeenAt:T({description:"Most recent time this language was observed."})},{description:"A programming language observed for this service, with the last time it was seen."}),SF=t.Object({runtime:t.String({description:"Runtime observed for this service."}),lastSeenAt:T({description:"Most recent time this runtime was observed."})},{description:"A runtime observed for this service, with the last time it was seen."}),MR=t.Object({protocol:t.String({description:"Observed API protocol (e.g. 'http', 'grpc', 'graphql')"}),lastSeenAt:T({description:"Most recent observation timestamp"})},{description:"An API protocol observed for this service, with the last time it was seen."}),OF=t.Object({framework:t.String({description:"Observed application framework (e.g. 'express', 'fastify', 'django', 'rails')"}),lastSeenAt:T({description:"Most recent observation timestamp"})},{description:"An application framework detected from OpenTelemetry instrumentation scope, with the last time it was seen."}),AF=t.Object({platform:t.String({description:"Observed cloud or orchestration platform (e.g. 'aws_eks', 'kubernetes')"}),lastSeenAt:T({description:"Most recent observation timestamp"})},{description:"A cloud or orchestration platform this service runs on, with the last time it was seen."}),xF=t.Object({provider:t.String({description:"Observed cloud provider (e.g. 'aws', 'gcp', 'azure')"}),lastSeenAt:T({description:"Most recent observation timestamp"})},{description:"A cloud provider this service runs on, with the last time it was seen."}),ja=t.Object({id:t.String({description:"Unique identifier of this service. Use it with service detail and graph endpoints."}),serviceName:t.String({description:"OpenTelemetry service name observed in telemetry."}),serviceNamespace:t.Optional(t.String({description:"OpenTelemetry service namespace observed in telemetry."})),env:t.Optional(t.String({description:"Environment value observed for this service."})),teams:t.Array(EF,{description:"Team names observed on telemetry for this service and when each was last seen."}),ingestionApiKeys:t.Array(_F,{description:"Ingestion API keys observed on telemetry for this service and when each was last seen."}),versions:t.Array(IF,{description:"Service version values observed in telemetry, including first and last seen timestamps."}),languages:t.Array(bF,{description:"Programming languages observed for this service."}),runtimes:t.Array(SF,{description:"Runtime values observed for this service."}),serverProtocols:t.Array(MR,{description:"API protocols this service exposes (from server-kind spans)"}),clientProtocols:t.Array(MR,{description:"API protocols this service calls out over (from client-kind spans)"}),frameworks:t.Array(OF,{description:"Application frameworks detected from OTel instrumentation scope"}),cloudPlatforms:t.Array(AF,{description:"Cloud platforms this service is running on"}),cloudProviders:t.Array(xF,{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:t.Array(t.String(),{description:"Telemetry sources that contributed evidence for this service entry."}),additionalUserFields:t.Optional(t.Unsafe({type:"object",additionalProperties:!0,description:"Additional user-defined service metadata, when configured."})),logsCount24h:t.Number({description:"Number of logs observed for this service in the last 24 hours."}),errorLogsCount24h:t.Number({description:"Number of error logs observed for this service in the last 24 hours."}),tracesCount24h:t.Number({description:"Number of traces observed for this service in the last 24 hours."}),errorTracesCount24h:t.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."})}),z9e=d({tags:["service-catalog"],query:t.Object({...Q,clusterId:t.Optional(p())}),method:"GET",paginated:!0,url:`${Nt}/services`,response:t.Array(ja)}),RF=t.Object({spanKind:t.Enum(Xx),count:t.Number()}),DR=t.Object({...ja.properties,spanKindCounts:t.Array(RF),envs:t.Object({primaryEnv:t.String(),allEnvs:t.Array(t.String())})}),Y9e=d({tags:["service-catalog"],query:t.Object({...Q,clusterId:t.Optional(p()),env:t.Optional(p())}),method:"GET",paginated:!0,url:`${Nt}/v2/services`,response:t.Array(DR)}),V9e=d({tags:["service-catalog"],query:t.Object({serviceName:p({allowEmpty:!1}),serviceNamespace:t.Optional(p({allowEmpty:!1})),env:p({allowEmpty:!1}),clusterId:t.Optional(p())}),method:"GET",url:`${Nt}/v2/service`,response:DR}),Q9e=d({tags:["service-catalog"],method:"GET",url:`${Nt}/services/:serviceId`,params:t.Object({serviceId:p()}),response:ja}),Td=t.Object({id:t.String({description:"Tsuga-generated identifier of this service target, unique across all services. Used with delivery state such as rate limiting and re-notification."}),serviceId:t.String({description:"Identifier of the service catalog entry this target is attached to."}),config:Da.properties.config,rateLimit:Da.properties.rateLimit,createdAt:T({description:"Timestamp when user created this service target."}),updatedAt:T({description:"Timestamp when user last updated this service target."})}),CF=t.Object({config:ri.properties.config,rateLimit:ri.properties.rateLimit}),PF=t.Object({config:ri.properties.config,rateLimit:t.Union([dd,t.Null()])}),W9e=d({tags:["service-catalog"],method:"GET",url:`${Nt}/services/:serviceId/targets`,params:t.Object({serviceId:p()}),response:t.Array(Td)}),Z9e=d({tags:["service-catalog"],method:"POST",url:`${Nt}/services/:serviceId/targets`,params:t.Object({serviceId:p()}),body:CF,response:Td}),X9e=d({tags:["service-catalog"],method:"PUT",url:`${Nt}/services/:serviceId/targets/:targetId`,params:t.Object({serviceId:p(),targetId:p()}),body:PF,response:Td}),J9e=d({tags:["service-catalog"],method:"DELETE",url:`${Nt}/services/:serviceId/targets/:targetId`,params:t.Object({serviceId:p(),targetId:p()}),response:R}),UF=["otel_kube","otel_host_kube","otel_host","prometheus","aws_ec2","gcp_compute_engine"];var GR=t.Object({id:t.String(),hostName:t.String(),env:t.Optional(t.String()),cpuUtilizationAverage:t.Number(),hostType:t.Enum(UF),teams:t.Array(t.String()),tags:t.Array(t.String()),firstSeenAt:T(),lastSeenAt:T(),clusterId:t.String()}),e3e=d({tags:["service-catalog"],method:"GET",url:`${Nt}/hosts`,response:t.Array(GR)}),t3e=d({tags:["service-catalog"],method:"GET",url:`${Nt}/hosts/:hostId`,params:t.Object({hostId:p()}),response:GR}),wF=["http","rpc","messaging","genai","object_store"],$R={name:t.String({description:"Service or inferred dependency name shown in the graph."}),env:t.Optional(t.String({description:"Environment observed from spans."}))},Ed=t.Object({...$R,nodeType:t.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:t.Union([t.String(),t.Null()],{description:"Service ID, or null when multiple namespaces match the observed service name."}),namespace:t.Union([t.String(),t.Null()],{description:"Service namespace, or null when multiple namespaces match the observed service name."}),errorRate:t.Optional(t.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:t.Number({description:"Number of entry requests on this service where at least one entry span had error status."}),entryRequestCount:t.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."})}),jR={...$R,endpoint:t.Optional(t.String({description:"Inferred service endpoint address"})),resourceName:t.Optional(t.String({description:"Inferred resource name, e.g. table or queue name"}))},_d=t.Object({...jR,nodeType:t.Literal("inferred_db",{description:"Discriminator for this node variant. Always `inferred_db` for a database dependency detected from client-span attributes that could not be matched to a service catalog entry."}),serviceType:t.Literal("db",{description:"Inferred dependency type. Always `db` for this node variant."}),databaseName:t.Optional(t.String({description:"Database name from span_attributes db.namespace (falling back to legacy db.name). Matches the database catalog `name`."})),databaseSystem:t.String({description:"Database system from span_attributes db.system.name (falling back to legacy db.system). Matches the database catalog `databaseSystem`."})}),Id=t.Object({...jR,nodeType:t.Literal("inferred",{description:"Discriminator for this node variant. Always `inferred` for a non-database dependency detected from client-span attributes (e.g. a queue or external HTTP call) that could not be matched to a service catalog entry. Database dependencies use the `inferred_db` variant."}),serviceType:t.Enum(wF,{description:"Inferred dependency type from span metadata: http, rpc, messaging, genai, or object_store."})}),NF=I("nodeType",[Ed,_d,Id]),bd=t.Object({from:t.Object({env:t.Optional(t.String({description:"Environment of the source node"})),name:t.String({description:"Name of the source node"})},{description:"Reference to the caller node, i.e. the service or dependency that issued the request."}),to:t.Object({env:t.Optional(t.String({description:"Environment of the target node"})),name:t.String({description:"Name of the target node"}),databaseSystem:t.Optional(t.String({description:"Database system of the target when it is an inferred database node (`inferred_db`). Together with `name` and `env` it identifies the target node, distinguishing a database from a same-named service or a same-named database on another system."}))},{description:"Reference to the callee node, i.e. the service or dependency that received the request."}),count:t.Number({description:"Number of cross-service transitions observed on this directed edge in the graph query window."}),errorRate:t.Optional(t.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:t.Number({description:"Number of client spans with error status observed on this edge"}),clientSpanCount:t.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."}),r3e=d({tags:["service-catalog"],url:`${Nt}/services/:serviceId/graph`,method:"GET",params:t.Object({serviceId:p()}),query:t.Object({...He.properties,query:t.Optional(p({type:"tsuga-query"}))}),response:t.Object({clusterId:t.String(),nodes:t.Array(NF),edges:t.Array(bd)})}),LF=t.Object({monitors:t.Array(t.Object({id:t.String({description:"Identifier of the monitor"}),name:t.String({description:"Display name of the monitor"}),owner:t.String({description:"Team ID that owns the monitor"}),priority:t.Enum(dt,{description:"Priority of the monitor"})})),slos:t.Array(t.Object({id:t.String({description:"Identifier of the SLO"}),name:t.String({description:"Display name of the SLO"}),owner:t.String({description:"Team ID that owns the SLO"}),statusCount:t.Partial(t.Record(ap,t.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"})}))}),n3e=d({tags:["service-catalog"],method:"GET",url:`${Nt}/services/:serviceId/related-resources`,params:t.Object({serviceId:p()}),response:LF}),o3e=d({tags:["service-catalog"],method:"GET",url:`${Nt}/services/by-api-keys`,response:t.Record(t.String(),t.Array(t.Object({serviceName:t.String(),serviceNamespace:t.Optional(t.String())})))});var Sd=`/${"v1"}/services`,Od=t.Pick(ja,["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)."}),vF={id:"123-456-abc",serviceName:"api-gateway",serviceNamespace:"platform",env:"production",teams:[{team:"platform",lastSeenAt:"2024-01-15T12:34:56.000Z"}],versions:[{version:"1.2.3",firstSeenAt:"2024-01-01T08:00:00.000Z",lastSeenAt:"2024-01-15T12:34:56.000Z",faulty:!0,faultyLatency:!0}],languages:[{language:"go",lastSeenAt:"2024-01-15T12:34:56.000Z"}],runtimes:[{runtime:"go",lastSeenAt:"2024-01-15T12:34:56.000Z"}],serverProtocols:[{protocol:"http",lastSeenAt:"2024-01-15T12:34:56.000Z"}],clientProtocols:[{protocol:"grpc",lastSeenAt:"2024-01-15T12:34:56.000Z"}],frameworks:[{framework:"gin",lastSeenAt:"2024-01-15T12:34:56.000Z"}],cloudPlatforms:[{platform:"aws_eks",lastSeenAt:"2024-01-15T12:34:56.000Z"},{platform:"kubernetes",lastSeenAt:"2024-01-15T12:34:56.000Z"}],cloudProviders:[{provider:"aws",lastSeenAt:"2024-01-15T12:34:56.000Z"}],lastSeenAt:"2024-01-15T12:34:56.000Z",firstSeenAt:"2024-01-01T08:00:00.000Z",sources:["logs","metrics","traces"],logsCount24h:12e3,errorLogsCount24h:42,tracesCount24h:8500,errorTracesCount24h:17};Object.assign(Od,{examples:[vF]});var qR=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:Sd,method:"GET",paginated:!0,query:t.Object({...Q,clusterId:t.Optional(p({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:t.Array(Od)}),BR=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:`${Sd}/:serviceId`,method:"GET",params:t.Object({serviceId:p({allowEmpty:!1,description:"Identifier of the service to retrieve. Use the `id` returned by service list responses."})}),response:Od}),kF=t.Pick(Ed,["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."}),MF=t.Pick(Id,["name","env","nodeType","serviceType","endpoint","resourceName"],{$id:"InferredServiceGraphNode",description:"Dependency node detected from client-span attributes (e.g. a queue or external HTTP call) that could not be matched to a service catalog entry. Database dependencies use the `inferred_db` variant."}),DF=t.Pick(_d,["name","env","nodeType","serviceType","endpoint","resourceName"],{$id:"InferredDbServiceGraphNode",description:"Database dependency node detected from client-span attributes that could not be matched to a service catalog entry."}),GF=I("nodeType",[kF,DF,MF]),$F=t.Pick(bd,["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."}),jF=t.Optional(t.Integer({...He.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."})),qF=t.Optional(t.Integer({...He.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."})),BF=p({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."}),FR=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:`${Sd}/:serviceId/graph`,method:"GET",params:t.Object({serviceId:p({allowEmpty:!1,description:"Identifier of the service to use as the graph root. Use the `id` returned by service list or get responses."})}),query:t.Object({from:jF,to:qF,query:t.Optional(BF)},{description:"Service graph query. Use time range and optional span query filters."}),response:t.Object({clusterId:t.String({description:"Cluster ID the graph was built from"}),nodes:t.Array(GF,{description:"Observed and inferred nodes included in the service dependency graph."}),edges:t.Array($F,{description:"Directed dependency edges between graph nodes."})})});function HR(e,r){let n=r??hr(e);return n===void 0?void 0:$s(n)}function Ad(e){let r=hr(e);return r===void 0?"":` (default: ${r})`}function KR(e,r){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${Ad("from")}`).option("--to <timestamp>",`End of time range${Ad("to")}`).option("--query <query>",`Search query${Ad("query")}`).action(async(o,i)=>{let a={},c=HR("from",i.from),m=HR("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 r()(FR,{params:{serviceId:o},query:a});W(l)})}var FF=`/${"v1"}/grok`,HF=25,KF=100,zR=t.Object({rules:t.Array(p({allowEmpty:!1,type:"long",description:"Grok parsing rule to preview against each sample. The rule uses the same Grok syntax as the log route **Grok parser** processor, for example `pod:%{DATA:namespace}/%{DATA:name}`."}),{minItems:1,maxItems:HF,description:"Ordered Grok parsing rules to preview. For each sample, Tsuga tries the rules in order and returns the first successful match, matching route Grok processor semantics."}),samples:t.Array(p({allowEmpty:!1,type:"long",description:"Raw log line to parse with the provided Grok rules. The value is parsed as preview input only; this endpoint does not ingest or store the sample."}),{minItems:1,maxItems:KF,description:"Sample log lines to run against the rules. Results are returned in the same order as this array."})},{description:"Grok rules and sample log lines to preview extraction before saving a route processor. The endpoint uses the same parser as the route builder preview and does not create or update routes."}),zF={rules:['pod:%{DATA:pod_namespace}/%{DATA:pod_name}\\] "%{DATA:request}" HTTP/%{POSINT:status}'],samples:['[conn-id:abc pod:tsuga-events/tsuga-events-searcher-0] "/token" HTTP/200']};Object.assign(zR,{examples:[zF]});var YR=t.Object({results:t.Array(t.Object({sample:t.String({description:"Echo of the submitted log line, so results can be matched to the samples in the request."}),matched:t.Boolean({description:"Whether any submitted rule matched this sample. `true` means `extracted` contains the captured fields; `false` means no rule matched."}),extracted:t.Union([t.Record(t.String(),t.Unknown()),t.Null()],{description:"Fields extracted from the first matching Grok rule when `matched` is `true`; dotted capture names are expanded into nested objects. `null` when no rule matched."})}),{description:"Preview result for each submitted sample, in the same order as the request `samples` array."})},{description:"Grok extraction preview results from applying the ordered rules to each submitted sample."}),YF={results:[{sample:'[conn-id:abc pod:tsuga-events/tsuga-events-searcher-0] "/token" HTTP/200',matched:!0,extracted:{pod_namespace:"tsuga-events",pod_name:"tsuga-events-searcher-0",request:"/token",status:"200"}}]};Object.assign(YR,{examples:[YF]});var VR=d({url:`${FF}/parse`,method:"POST",operationId:"parseGrok",tags:["public","grok"],body:zR,response:YR,description:"Parses sample log lines with Grok rules and returns extracted fields, using the same Grok engine as the log route processor. Use this endpoint to author and test route Grok rules before saving them. The operation requires public API read access to log routes. A rule that fails to compile returns a 400 response with error code `GROK_RULE_VALIDATION_ERROR` and structured details in `error.details.ruleErrors`."});function QR(e,r){let n=e.command("grok").description("Test and preview grok parsing rules");Wn(n,"parse","Parse sample log lines with grok rules and return the extracted fields",VR,r)}var WR=require("node:child_process"),ZR=require("node:fs"),XR=require("node:os"),mp=require("node:path");var eo=require("node:fs");function qa(e,r){let n=`${e}.tmp.${process.pid}`;(0,eo.writeFileSync)(n,r),(0,eo.renameSync)(n,e)}function Ba(e){try{return(0,eo.readFileSync)(e,"utf8")}catch(r){if(r.code==="ENOENT")return;throw r}}function Fa(e,r){if(r===void 0)return;let n=`${e}.bak.${new Date().toISOString().replaceAll(":","-")}`;return(0,eo.writeFileSync)(n,r),n}function to(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var xd="tsuga-dev/agent-plugins",pp="tsuga";function up(e,r){B(` $ ${e} ${r.join(" ")}`);try{(0,WR.execFileSync)(e,r,{stdio:["ignore","inherit","inherit"]})}catch(n){let o=n.status??1;throw new Error(`${e} ${r.join(" ")} exited ${o}`,{cause:n})}}function VF(e,r){B("Claude Code \u2192 installing Tsuga plugin"),up("claude",["plugin","marketplace","add",xd]),up("claude",["plugin","install",`tsuga@${pp}`]),r.autoUpdate&&QF(e)}function QF(e){let r=(0,mp.join)(e,".claude","settings.json");B(`Claude Code \u2192 ${r} (autoUpdate)`),(0,ZR.mkdirSync)((0,mp.dirname)(r),{recursive:!0});let n=Ba(r),o=JSON.parse(n??"{}");if(!to(o))throw new Error(`${r} must contain a JSON object`);let i=o.extraKnownMarketplaces??{};if(!to(i))throw new Error(`${r} "extraKnownMarketplaces" must be a JSON object`);let a=i[pp],c=to(a)?a:{};o.extraKnownMarketplaces={...i,[pp]:{source:{source:"github",repo:xd},...c,autoUpdate:!0}};let m=Fa(r,n);qa(r,`${JSON.stringify(o,null,2)}
|
|
132
|
-
`),B(m===void 0?" created":` patched (backup: ${m})`)}function WF(){B("Codex \u2192 installing Tsuga plugin"),up("codex",["plugin","marketplace","add",xd]),up("codex",["plugin","add",`tsuga@${pp}`])}function JR(e){let r=e.command("install").description("Install Tsuga components into local LLM CLIs").command("plugin").description("Install Tsuga plugins");r.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=>{VF((0,XR.homedir)(),n),B("Restart your claude session to load the new plugins.")}),r.command("codex").description("Install the Tsuga plugin into Codex").action(()=>{WF(),B("Restart your codex session to load the new plugins.")})}var Vt="/v0/kubernetes-explorer",ZF="^[a-z0-9.-]+$",XF="^[A-Za-z0-9._-]+$",eC=256,tC=t.Optional(p({allowEmpty:!1,description:"Tsuga cluster ID to target. Tsuga assigns it when a cluster is connected to the organization. Optional for single-cluster organizations and required for organizations with multiple clusters to scope the request to one cluster."}));var pr=e=>t.Optional(t.Array(p({allowEmpty:!1}),{description:e})),rC={clusterId:tC,search:t.Optional(t.String({pattern:ZF,minLength:1,maxLength:eC,description:"Substring matched against the resource name. Kubernetes names are lowercase RFC 1123, so only lowercase letters, digits, `.` and `-` are accepted; uppercase and other characters are rejected. Wildcard and other query-syntax characters are treated literally."}))},nC={clusterId:tC,search:t.Optional(t.String({pattern:XF,minLength:1,maxLength:eC,description:"Substring matched against the Kubernetes cluster name. Unlike Kubernetes resource names this is a collector-assigned identifier, so uppercase letters, digits, `.`, `-` and `_` are accepted. Wildcard and other query-syntax characters are treated literally."}))},oC=t.Object(rC),iC=t.Object(nC),Ha={...rC,includeInternalNamespaces:t.Optional(t.Boolean({description:"When false or omitted, resources in internal namespaces (kube-system, kube-public, kube-node-lease, local-path-storage, gke-managed-*) are excluded."})),clusters:pr("Restrict results to these Kubernetes cluster names."),namespaces:pr("Restrict results to these namespaces."),teams:pr("Restrict results to these team names."),envs:pr("Restrict results to these environments."),...Q},aC=["Pending","Running","Succeeded","Failed","Unknown","CrashLoopBackOff","Error"],JF={...Ha,nodes:pr("Restrict results to pods scheduled on these nodes."),deployments:pr("Restrict results to pods owned by these Deployments."),statefulsets:pr("Restrict results to pods owned by these StatefulSets."),daemonsets:pr("Restrict results to pods owned by these DaemonSets."),podStatus:t.Optional(t.Array(t.Enum(aC),{description:"Restrict results to pods whose resolved status matches any of these values. Includes the five Kubernetes phases plus Tsuga-derived CrashLoopBackOff and Error. Applied after stitching pod phase and container status reason telemetry, because phase is not a filterable metric attribute."}))},oi=t.Enum(["asc","desc"],{description:"Sort direction. Defaults to ascending."}),eH=["deployment","statefulset","daemonset"],sC=t.Object({kind:t.Enum(eH,{description:"Kind of Kubernetes workload associated with the pod. Derived from workload attributes in pod telemetry."}),name:t.String({description:"Name of the workload associated with the pod. Derived from workload attributes in pod telemetry."})},{description:"Kubernetes workload controller that owns the pod. Present when workload attributes are observed in pod telemetry."}),cC=t.Object({podName:t.String({description:"Name of the Kubernetes pod. Set when the pod is created."}),namespace:t.Optional(t.String({description:"Kubernetes namespace that contains the pod. Present when namespace telemetry is observed."})),cluster:t.Optional(t.String({description:"Kubernetes cluster name that reported the pod. Present when cluster telemetry is observed."})),team:t.Optional(t.String({description:"Team metadata associated with the pod. Present when a team label or mapping is observed."})),env:t.Optional(t.String({description:"Environment metadata associated with the pod, such as production or staging. Present when an environment label or mapping is observed."})),node:t.Optional(t.String({description:"Kubernetes node currently or most recently running the pod. Present when node telemetry is observed."})),phase:t.Enum(aC,{description:"Current or most recently observed pod status. From pod status and container state telemetry. Values include the Kubernetes phases Pending, Running, Succeeded, Failed, and Unknown, plus Tsuga-derived CrashLoopBackOff and Error values."}),readyContainers:t.Integer({description:"Number of containers in the pod that are currently ready. From container readiness telemetry. Zero or greater."}),totalContainers:t.Integer({description:"Number of observed containers for the pod based on container readiness telemetry. Zero or greater."}),restarts:t.Integer({description:"Total restart count across containers in the pod. From container restart telemetry. Zero or greater."}),createdAt:t.Optional(T({description:"Timestamp from pod start time telemetry for the selected pod instance. Present when pod start time telemetry is observed."}))}),Rd=t.Object({...cC.properties,workload:t.Optional(sC),cpuUsageMilli:t.Optional(t.Number({description:"Recent pod CPU usage in millicores. Present when CPU usage telemetry is observed."})),cpuLimitMilli:t.Optional(t.Number({description:"Configured pod CPU limit in millicores, summed across observed containers. Present when a CPU limit is configured and observed."})),memoryUsageBytes:t.Optional(t.Number({description:"Recent pod memory usage in bytes. Present when memory usage telemetry is observed."})),memoryLimitBytes:t.Optional(t.Number({description:"Configured pod memory limit in bytes, summed across observed containers. Present when a memory limit is configured and observed."})),cpuUtilization:t.Optional(t.Number({description:"Recent CPU usage divided by the configured CPU limit. Present when both usage and limit are observed."})),memoryUtilization:t.Optional(t.Number({description:"Recent memory usage divided by the configured memory limit. Present when both usage and limit are observed."}))}),tH=["podName","namespace","cluster","team","env","node","phase","restarts","cpuUtilization","memoryUtilization","createdAt"],L3e=d({tags:["kubernetes-explorer"],method:"GET",url:`${Vt}/pods`,query:t.Object({...JF,sortBy:t.Optional(t.Enum(tH,{description:"Field to sort pods by."})),sortDirection:t.Optional(oi)}),paginated:!0,response:t.Array(Rd)}),Cd=t.Object({cluster:t.String({description:"Kubernetes cluster name from cluster telemetry."}),teams:t.Optional(t.Array(t.String(),{description:"Team metadata values observed on pods in non-default Kubernetes namespaces on the cluster. Present when team labels or mappings are observed."})),envs:t.Optional(t.Array(t.String(),{description:"Environment metadata values observed on pods in non-default Kubernetes namespaces on the cluster. Present when environment labels or mappings are observed."})),cpuUsageMilli:t.Optional(t.Number({description:"Aggregate recent CPU usage for observed pods in the cluster, excluding default Kubernetes namespaces, in millicores. Present when CPU usage telemetry is observed."})),memoryUsageBytes:t.Optional(t.Number({description:"Aggregate recent memory usage for observed pods in the cluster, excluding default Kubernetes namespaces, in bytes. Present when memory usage telemetry is observed."})),readyNodes:t.Optional(t.Integer({description:"Number of Kubernetes nodes in the cluster that are ready. Present when node readiness telemetry is observed."})),podPhaseCounts:t.Optional(t.Object({Pending:t.Integer({description:"Number of observed pods currently in the Pending phase."}),Running:t.Integer({description:"Number of observed pods currently in the Running phase."}),Succeeded:t.Integer({description:"Number of observed pods currently in the Succeeded phase."}),Failed:t.Integer({description:"Number of observed pods currently in the Failed phase."}),Unknown:t.Integer({description:"Number of observed pods currently in the Unknown phase."})},{description:"Counts of observed pods by Kubernetes phase, excluding default Kubernetes namespaces. Present when pod phase telemetry is observed."}))}),rH=["cluster","teams","envs","cpuUsageMilli","memoryUsageBytes","readyNodes"],v3e=d({tags:["kubernetes-explorer"],method:"GET",url:`${Vt}/clusters`,query:t.Object({...nC,teams:pr("Restrict to clusters that host workloads from these team names."),envs:pr("Restrict to clusters that host workloads in these environments."),sortBy:t.Optional(t.Enum(rH,{description:"Field to sort clusters by."})),sortDirection:t.Optional(oi),...Q}),paginated:!0,response:t.Array(Cd)}),Pd=t.Object({namespace:t.String({description:"Kubernetes namespace name from namespace telemetry. Includes namespaces with no observed pods when namespace telemetry is observed."}),cluster:t.Optional(t.String({description:"Kubernetes cluster name that contains the namespace. Present when cluster telemetry is observed."})),teams:t.Optional(t.Array(t.String(),{description:"Team metadata values observed in workloads in the namespace. Present when team labels or mappings are observed."})),envs:t.Optional(t.Array(t.String(),{description:"Environment metadata values observed in workloads in the namespace. Present when environment labels or mappings are observed."})),pods:t.Optional(t.Integer({description:"Number of observed pods in the namespace. Present when pod telemetry is observed."})),cpuUsageMilli:t.Optional(t.Number({description:"Aggregate recent CPU usage for observed pods in the namespace, in millicores. Present when CPU usage telemetry is observed."})),memoryUsageBytes:t.Optional(t.Number({description:"Aggregate recent memory usage for observed pods in the namespace, in bytes. Present when memory usage telemetry is observed."}))}),nH=["namespace","cluster","teams","envs","pods","cpuUsageMilli","memoryUsageBytes"],k3e=d({tags:["kubernetes-explorer"],method:"GET",url:`${Vt}/namespaces`,query:t.Object({...Ha,sortBy:t.Optional(t.Enum(nH,{description:"Field to sort namespaces by."})),sortDirection:t.Optional(oi)}),paginated:!0,response:t.Array(Pd)}),Ud=t.Object({deployment:t.String({description:"Kubernetes Deployment name from workload telemetry."}),namespace:t.Optional(t.String({description:"Kubernetes namespace that contains the Deployment. Present when namespace telemetry is observed."})),cluster:t.Optional(t.String({description:"Kubernetes cluster name that contains the Deployment. Present when cluster telemetry is observed."})),team:t.Optional(t.String({description:"Team metadata associated with the Deployment. Present when a team label or mapping is observed."})),env:t.Optional(t.String({description:"Environment metadata associated with the Deployment. Present when an environment label or mapping is observed."})),pods:t.Optional(t.Integer({description:"Number of observed pods associated with the Deployment. Present when pod telemetry and workload attributes are observed."})),availableReplicas:t.Optional(t.Integer({description:"Number of available Deployment replicas from Deployment status telemetry. Present when deployment status is observed."})),desiredReplicas:t.Optional(t.Integer({description:"Desired replica count configured for the Deployment. Present when Deployment spec telemetry is observed."})),cpuUsageMilli:t.Optional(t.Number({description:"Recent aggregate CPU usage for observed Deployment pods, in millicores. Present when CPU usage telemetry is observed."})),memoryUsageBytes:t.Optional(t.Number({description:"Recent aggregate memory usage for observed Deployment pods, in bytes. Present when memory usage telemetry is observed."}))}),oH=["deployment","namespace","cluster","team","env","pods","availableReplicas","cpuUsageMilli","memoryUsageBytes"],M3e=d({tags:["kubernetes-explorer"],method:"GET",url:`${Vt}/deployments`,query:t.Object({...Ha,sortBy:t.Optional(t.Enum(oH,{description:"Field to sort deployments by."})),sortDirection:t.Optional(oi)}),paginated:!0,response:t.Array(Ud)}),wd=t.Object({statefulSet:t.String({description:"Kubernetes StatefulSet name from workload telemetry."}),namespace:t.Optional(t.String({description:"Kubernetes namespace that contains the StatefulSet. Present when namespace telemetry is observed."})),cluster:t.Optional(t.String({description:"Kubernetes cluster name that contains the StatefulSet. Present when cluster telemetry is observed."})),team:t.Optional(t.String({description:"Team metadata associated with the StatefulSet. Present when a team label or mapping is observed."})),env:t.Optional(t.String({description:"Environment metadata associated with the StatefulSet. Present when an environment label or mapping is observed."})),pods:t.Optional(t.Integer({description:"Number of observed pods associated with the StatefulSet. Present when pod telemetry and workload attributes are observed."})),readyReplicas:t.Optional(t.Integer({description:"Number of ready StatefulSet replicas from StatefulSet status telemetry. Present when StatefulSet status is observed."})),desiredReplicas:t.Optional(t.Integer({description:"Desired replica count configured for the StatefulSet. Present when StatefulSet spec telemetry is observed."})),cpuUsageMilli:t.Optional(t.Number({description:"Recent aggregate CPU usage for observed StatefulSet pods, in millicores. Present when CPU usage telemetry is observed."})),memoryUsageBytes:t.Optional(t.Number({description:"Recent aggregate memory usage for observed StatefulSet pods, in bytes. Present when memory usage telemetry is observed."}))}),iH=["statefulSet","namespace","cluster","team","env","pods","cpuUsageMilli","memoryUsageBytes"],D3e=d({tags:["kubernetes-explorer"],method:"GET",url:`${Vt}/statefulsets`,query:t.Object({...Ha,sortBy:t.Optional(t.Enum(iH,{description:"Field to sort StatefulSets by."})),sortDirection:t.Optional(oi)}),paginated:!0,response:t.Array(wd)}),Nd=t.Object({daemonSet:t.String({description:"Kubernetes DaemonSet name from workload telemetry."}),namespace:t.Optional(t.String({description:"Kubernetes namespace that contains the DaemonSet. Present when namespace telemetry is observed."})),cluster:t.Optional(t.String({description:"Kubernetes cluster name that contains the DaemonSet. Present when cluster telemetry is observed."})),team:t.Optional(t.String({description:"Team metadata associated with the DaemonSet. Present when a team label or mapping is observed."})),env:t.Optional(t.String({description:"Environment metadata associated with the DaemonSet. Present when an environment label or mapping is observed."})),pods:t.Optional(t.Integer({description:"Number of observed pods associated with the DaemonSet. Present when pod telemetry and workload attributes are observed."})),readyNodes:t.Optional(t.Integer({description:"Number of eligible nodes with a ready DaemonSet pod. Present when DaemonSet status telemetry is observed."})),desiredNodes:t.Optional(t.Integer({description:"Number of eligible nodes where the DaemonSet should run a pod. Present when DaemonSet status telemetry is observed."})),cpuUsageMilli:t.Optional(t.Number({description:"Recent aggregate CPU usage for observed DaemonSet pods, in millicores. Present when CPU usage telemetry is observed."})),memoryUsageBytes:t.Optional(t.Number({description:"Recent aggregate memory usage for observed DaemonSet pods, in bytes. Present when memory usage telemetry is observed."}))}),aH=["daemonSet","namespace","cluster","team","env","pods","readyNodes","cpuUsageMilli","memoryUsageBytes"],G3e=d({tags:["kubernetes-explorer"],method:"GET",url:`${Vt}/daemonsets`,query:t.Object({...Ha,sortBy:t.Optional(t.Enum(aH,{description:"Field to sort DaemonSets by."})),sortDirection:t.Optional(oi)}),paginated:!0,response:t.Array(Nd)}),Ld=t.Object({overview:t.Object({...cC.properties,workload:t.Optional(sC)},{description:"Pod identity, status, and owning workload, derived from recent pod metrics."}),healthMetrics:t.Object({cpu:t.Object({usage:t.String({description:"Metric name callers can use to query pod CPU usage. This is not the current CPU value."}),limit:t.String({description:"Metric name callers can use to query configured container CPU limits for the pod. This is not the current CPU limit value."}),request:t.String({description:"Metric name callers can use to query configured container CPU requests for the pod. This is not the current CPU request value."})},{description:"Metric names for pod CPU usage and for configured container CPU limits and requests."}),memory:t.Object({usage:t.String({description:"Metric name callers can use to query pod memory usage. This is not the current memory value."}),limit:t.String({description:"Metric name callers can use to query configured container memory limits for the pod. This is not the current memory limit value."}),request:t.String({description:"Metric name callers can use to query configured container memory requests for the pod. This is not the current memory request value."})},{description:"Metric names for pod memory usage and for configured container memory limits and requests."})},{description:"Metric names callers can use to query pod CPU and memory telemetry. These are fixed metric identifiers, not current values."}),searchFilters:t.Object({logs:t.String({description:"TQL log search filter scoped to this pod. Built from cluster, namespace, and pod identifiers."}),traces:t.String({description:"TQL trace search filter scoped to this pod. Built from cluster, namespace, and pod identifiers."})},{description:"TQL filters scoped to this pod, ready to use as the query for log and trace search."})}),pC=t.Object({clusterId:t.Optional(p({allowEmpty:!1})),k8sCluster:p({allowEmpty:!1}),k8sNamespace:p({allowEmpty:!1}),podName:p({allowEmpty:!1})}),$3e=d({tags:["kubernetes-explorer"],method:"GET",url:`${Vt}/pod-details`,query:pC,response:Ld}),vd=t.Object({configuration:t.Optional(t.Object({spec:t.Record(t.String(),t.Unknown(),{description:"Kubernetes PodSpec from the latest observed pod manifest. Fields outside `object.spec` are stripped."}),lastObservedAt:T({description:"Timestamp when Tsuga last observed the pod manifest used for configuration."})},{description:"Pod configuration from the latest observed pod manifest. Present when a pod manifest log is found for the pod."})),labels:t.Record(t.String(),t.String(),{description:"Kubernetes labels on the pod from the latest observed pod manifest. Key-value strings."}),annotations:t.Record(t.String(),t.String(),{description:"Kubernetes annotations on the pod from the latest observed pod manifest. Key-value strings."}),deletedAt:t.Optional(T({description:"Timestamp when Tsuga last observed the pod deletion event. Present when the latest observed pod event is deleted."}))}),j3e=d({tags:["kubernetes-explorer"],method:"GET",url:`${Vt}/pod-manifest`,query:pC,response:vd}),kd=t.Object({podName:t.String({description:"Name of a pod instance associated with the workload. Resolved from recent pod usage telemetry and workload attributes."}),podUid:t.Optional(t.String({description:"Kubernetes UID for the pod replica. Present when UID telemetry is observed."})),cpuUsageMilli:t.Optional(t.Number({description:"Recent CPU usage for the pod replica, in millicores. Present when CPU usage telemetry is observed."})),memoryUsageBytes:t.Optional(t.Number({description:"Recent memory usage for the pod replica, in bytes. Present when memory usage telemetry is observed."}))},{description:"A single pod instance with recent CPU or memory telemetry for the workload, resolved from pod usage telemetry and workload attributes."}),Md=t.Object({overview:t.Object({deploymentName:t.String({description:"Kubernetes Deployment name for this detail response."}),namespace:t.Optional(t.String({description:"Kubernetes namespace for this detail response. Present when any deployment signal is found."})),cluster:t.Optional(t.String({description:"Kubernetes cluster name for this detail response. Present when any deployment signal is found."})),team:t.Optional(t.String({description:"Team metadata from the Deployment available-replica metric. Present when the metric includes team metadata."})),env:t.Optional(t.String({description:"Environment metadata from the Deployment available-replica metric. Present when the metric includes environment metadata."})),availableReplicas:t.Optional(t.Integer({description:"Number of available Deployment replicas from Deployment status telemetry. Present when deployment status is observed."})),desiredReplicas:t.Optional(t.Integer({description:"Desired replica count configured for the Deployment. Present when Deployment spec telemetry is observed."})),latestRevisionAt:t.Optional(T({description:"Latest ReplicaSet metadata.creationTimestamp observed for the Deployment. Present when ReplicaSet object telemetry is observed."}))}),podReplicas:t.Array(kd,{description:"Pod instances with recent CPU or memory telemetry for the Deployment. Tsuga builds this list from pod usage telemetry and workload attributes. Empty when no matching pod usage telemetry is observed."}),revisions:t.Array(t.Object({replicaSetName:t.String({description:"ReplicaSet name for a Deployment revision from workload telemetry."}),revision:t.Integer({description:"Deployment revision number from ReplicaSet annotations. Integer greater than or equal to zero."}),firstSeen:t.Optional(T({description:"ReplicaSet metadata.creationTimestamp from the latest observed ReplicaSet object. Present when creation time is observed."})),observedGeneration:t.Optional(t.Integer({description:"Latest generation observed for the ReplicaSet revision. Present when generation telemetry is observed."})),readyReplicas:t.Optional(t.Integer({description:"Number of ready replicas for the ReplicaSet revision. Present when ReplicaSet status telemetry is observed."})),replicas:t.Optional(t.Integer({description:"Total replica count for the ReplicaSet revision. Present when ReplicaSet status telemetry is observed."})),logsSearchFilter:t.String({description:"TQL log search filter scoped to this ReplicaSet revision. Built from cluster, namespace, and ReplicaSet identifiers."})}),{description:"Deployment rollout revisions from recent ReplicaSet object telemetry. Includes the latest observed event per ReplicaSet, excludes ReplicaSets whose latest observed spec.replicas is 0, and returns up to 8 revisions sorted by revision number descending."})}),q3e=d({tags:["kubernetes-explorer"],method:"GET",url:`${Vt}/deployment-details`,query:t.Object({clusterId:t.Optional(p({allowEmpty:!1})),k8sCluster:p({allowEmpty:!1}),k8sNamespace:p({allowEmpty:!1}),deploymentName:p({allowEmpty:!1})}),response:Md}),sH=t.Object({overview:t.Object({statefulSetName:t.String(),namespace:t.Optional(t.String()),cluster:t.Optional(t.String()),team:t.Optional(t.String()),env:t.Optional(t.String()),readyReplicas:t.Optional(t.Integer()),desiredReplicas:t.Optional(t.Integer()),latestRevisionAt:t.Optional(T())}),podReplicas:t.Array(kd,{description:"Pod instances with recent CPU or memory telemetry for the StatefulSet. Tsuga builds this list from pod usage telemetry and workload attributes. Empty when no matching pod usage telemetry is observed."}),revisions:t.Array(t.Object({revisionName:t.String(),firstSeen:t.Optional(T())}))}),B3e=d({tags:["kubernetes-explorer"],method:"GET",url:`${Vt}/statefulset-details`,query:t.Object({clusterId:t.Optional(p({allowEmpty:!1})),k8sCluster:p({allowEmpty:!1}),k8sNamespace:p({allowEmpty:!1}),statefulSetName:p({allowEmpty:!1})}),response:sH}),cH=t.Object({overview:t.Object({daemonSetName:t.String(),namespace:t.Optional(t.String()),cluster:t.Optional(t.String()),team:t.Optional(t.String()),env:t.Optional(t.String()),readyNodes:t.Optional(t.Integer()),desiredNodes:t.Optional(t.Integer()),latestRevisionAt:t.Optional(T())}),podReplicas:t.Array(kd,{description:"Pod instances with recent CPU or memory telemetry for the DaemonSet. Tsuga builds this list from pod usage telemetry and workload attributes. Empty when no matching pod usage telemetry is observed."}),revisions:t.Array(t.Object({observedGeneration:t.Integer(),firstSeen:t.Optional(T())}))}),F3e=d({tags:["kubernetes-explorer"],method:"GET",url:`${Vt}/daemonset-details`,query:t.Object({clusterId:t.Optional(p({allowEmpty:!1})),k8sCluster:p({allowEmpty:!1}),k8sNamespace:p({allowEmpty:!1}),daemonSetName:p({allowEmpty:!1})}),response:cH});var Ur=`/${"v1"}/kubernetes-explorer`,uC=t.Pick(Rd,["podName","namespace","cluster","team","env","node","phase","readyContainers","totalContainers","restarts","createdAt","workload","cpuUsageMilli","cpuLimitMilli","memoryUsageBytes","memoryLimitBytes","cpuUtilization","memoryUtilization"],{description:"A Kubernetes pod with its current phase, owning workload, and resource usage."}),pH={podName:"api-gateway-7d9f8c6b5-2xk4p",namespace:"production",cluster:"prod-us-east",team:"platform",env:"production",node:"ip-10-0-1-23.ec2.internal",phase:"Running",readyContainers:1,totalContainers:1,restarts:0,createdAt:"2024-01-15T12:34:56.000Z",workload:{kind:"deployment",name:"api-gateway"},cpuUsageMilli:125,cpuLimitMilli:500,memoryUsageBytes:134217728,memoryLimitBytes:536870912,cpuUtilization:.25,memoryUtilization:.25};Object.assign(uC,{examples:[pH]});var mC=t.Pick(Cd,["cluster","teams","envs","cpuUsageMilli","memoryUsageBytes","readyNodes","podPhaseCounts"],{description:"A Kubernetes cluster with aggregate resource usage, node readiness, and pod phase counts."}),uH={cluster:"prod-us-east",teams:["platform","payments"],envs:["production"],cpuUsageMilli:4200,memoryUsageBytes:8589934592,readyNodes:6,podPhaseCounts:{Pending:1,Running:42,Succeeded:3,Failed:0,Unknown:0}};Object.assign(mC,{examples:[uH]});var lC=t.Pick(Pd,["namespace","cluster","teams","envs","pods","cpuUsageMilli","memoryUsageBytes"],{description:"A Kubernetes namespace with pod count and aggregate resource usage."}),mH={namespace:"production",cluster:"prod-us-east",teams:["platform"],envs:["production"],pods:24,cpuUsageMilli:1800,memoryUsageBytes:3221225472};Object.assign(lC,{examples:[mH]});var dC=t.Pick(Ud,["deployment","namespace","cluster","team","env","pods","availableReplicas","desiredReplicas","cpuUsageMilli","memoryUsageBytes"],{description:"A Kubernetes deployment with replica counts and aggregate resource usage."}),lH={deployment:"api-gateway",namespace:"production",cluster:"prod-us-east",team:"platform",env:"production",pods:3,availableReplicas:3,desiredReplicas:3,cpuUsageMilli:375,memoryUsageBytes:402653184};Object.assign(dC,{examples:[lH]});var fC=t.Pick(wd,["statefulSet","namespace","cluster","team","env","pods","readyReplicas","desiredReplicas","cpuUsageMilli","memoryUsageBytes"],{description:"A Kubernetes StatefulSet with replica counts and aggregate resource usage."}),dH={statefulSet:"postgres",namespace:"production",cluster:"prod-us-east",team:"platform",env:"production",pods:3,readyReplicas:3,desiredReplicas:3,cpuUsageMilli:900,memoryUsageBytes:2147483648};Object.assign(fC,{examples:[dH]});var gC=t.Pick(Nd,["daemonSet","namespace","cluster","team","env","pods","readyNodes","desiredNodes","cpuUsageMilli","memoryUsageBytes"],{description:"A Kubernetes DaemonSet with eligible-node readiness and aggregate resource usage."}),fH={daemonSet:"otel-collector",namespace:"observability",cluster:"prod-us-east",team:"platform",env:"production",pods:6,readyNodes:6,desiredNodes:6,cpuUsageMilli:300,memoryUsageBytes:805306368};Object.assign(gC,{examples:[fH]});var yC=t.Pick(Ld,["overview","healthMetrics","searchFilters"],{description:"Metrics-derived information for a single Kubernetes pod: status, owning workload, CPU/memory metric identifiers, and log/trace filters."}),gH={overview:{podName:"api-gateway-7d9f8c6b5-2xk4p",namespace:"production",cluster:"prod-us-east",team:"platform",env:"production",node:"ip-10-0-1-23.ec2.internal",phase:"Running",readyContainers:1,totalContainers:1,restarts:0,createdAt:"2024-01-15T12:34:56.000Z",workload:{kind:"deployment",name:"api-gateway"}},healthMetrics:{cpu:{usage:"k8s.pod.cpu.usage",limit:"k8s.container.cpu_limit",request:"k8s.container.cpu_request"},memory:{usage:"k8s.pod.memory.usage",limit:"k8s.container.memory_limit",request:"k8s.container.memory_request"}},searchFilters:{logs:'context.k8s.cluster.name:"prod-us-east" AND context.k8s.namespace.name:"production" AND context.k8s.pod.name:"api-gateway-7d9f8c6b5-2xk4p"',traces:'context.k8s.cluster.name:"prod-us-east" AND context.k8s.namespace.name:"production" AND context.k8s.pod.name:"api-gateway-7d9f8c6b5-2xk4p"'}};Object.assign(yC,{examples:[gH]});var hC=t.Pick(vd,["configuration","labels","annotations","deletedAt"],{description:"Manifest-derived details for a single Kubernetes pod: the pod manifest spec, labels, and annotations from the pod's most recently observed manifest."}),yH={configuration:{spec:{restartPolicy:"Always",serviceAccountName:"api-gateway"},lastObservedAt:"2024-01-15T12:30:00.000Z"},labels:{app:"api-gateway","pod-template-hash":"7d9f8c6b5"},annotations:{"prometheus.io/scrape":"true"}};Object.assign(hC,{examples:[yH]});var TC=t.Pick(Md,["overview","podReplicas","revisions"],{description:"Detailed information for a single Kubernetes deployment: replica status, backing pods, and rollout revisions."}),hH={overview:{deploymentName:"api-gateway",namespace:"production",cluster:"prod-us-east",team:"platform",env:"production",availableReplicas:3,desiredReplicas:3,latestRevisionAt:"2024-01-15T12:00:00.000Z"},podReplicas:[{podName:"api-gateway-7d9f8c6b5-2xk4p",podUid:"a1b2c3d4-e5f6-7890-abcd-ef1234567890",cpuUsageMilli:125,memoryUsageBytes:134217728}],revisions:[{replicaSetName:"api-gateway-7d9f8c6b5",revision:7,firstSeen:"2024-01-15T12:00:00.000Z",observedGeneration:7,readyReplicas:3,replicas:3,logsSearchFilter:'context.k8s.cluster.name:"prod-us-east" context.k8s.namespace.name:"production" context.k8s.replicaset.name:"api-gateway-7d9f8c6b5"'}]};Object.assign(TC,{examples:[hH]});var EC=t.Object({clusterId:t.Optional(p({allowEmpty:!1,description:"Tsuga cluster ID to target. Tsuga assigns it when a cluster is connected to the organization. Optional for single-cluster organizations and required for organizations with multiple clusters to scope the request to one cluster."}))}),Ka=t.Pick(oC,["clusterId","search"]),TH=t.Pick(iC,["clusterId","search"]),_C=d({description:"Lists Kubernetes pods observed across the organization with their current phase, owning workload, and resource usage.",operationId:"listKubernetesPods",tags:["public","kubernetes-explorer"],method:"GET",url:`${Ur}/pods`,query:Ka,response:t.Array(uC)}),IC=d({description:"Lists Kubernetes clusters observed across the organization with aggregate resource usage, node readiness, and pod phase counts.",operationId:"listKubernetesClusters",tags:["public","kubernetes-explorer"],method:"GET",url:`${Ur}/clusters`,query:TH,response:t.Array(mC)}),bC=d({description:"Lists Kubernetes namespaces observed across the organization with pod counts and aggregate resource usage.",operationId:"listKubernetesNamespaces",tags:["public","kubernetes-explorer"],method:"GET",url:`${Ur}/namespaces`,query:Ka,response:t.Array(lC)}),SC=d({description:"Lists Kubernetes deployments observed across the organization with replica counts and aggregate resource usage.",operationId:"listKubernetesDeployments",tags:["public","kubernetes-explorer"],method:"GET",url:`${Ur}/deployments`,query:Ka,response:t.Array(dC)}),OC=d({description:"Lists Kubernetes StatefulSets observed across the organization with replica counts and aggregate resource usage.",operationId:"listKubernetesStatefulSets",tags:["public","kubernetes-explorer"],method:"GET",url:`${Ur}/statefulsets`,query:Ka,response:t.Array(fC)}),AC=d({description:"Lists Kubernetes DaemonSets observed across the organization with eligible-node readiness and aggregate resource usage.",operationId:"listKubernetesDaemonSets",tags:["public","kubernetes-explorer"],method:"GET",url:`${Ur}/daemonsets`,query:Ka,response:t.Array(gC)}),xC=t.Object({...EC.properties,k8sCluster:p({allowEmpty:!1,description:"Kubernetes cluster name that contains the pod. From cluster telemetry. Required to identify the pod because pod names are only unique within a namespace and cluster."}),k8sNamespace:p({allowEmpty:!1,description:"Kubernetes namespace that contains the pod. From pod metadata. Required to identify the pod because pod names are only unique within a namespace and cluster."}),podName:p({allowEmpty:!1,description:"Kubernetes pod name to retrieve. Set when the pod is created. Required to fetch pod details for the selected cluster and namespace."})}),RC=d({description:"Retrieves metrics-derived information for a single Kubernetes pod: status, owning workload, CPU/memory metric identifiers, and ready-to-use log and trace filters. Manifest configuration, labels, and annotations are served by the pod-manifest endpoint.",operationId:"getKubernetesPodDetails",tags:["public","kubernetes-explorer"],method:"GET",url:`${Ur}/pod-details`,query:xC,response:yC}),CC=d({description:"Retrieves the manifest-derived details for a single Kubernetes pod: the pod manifest spec, labels, and annotations from the pod's most recently observed manifest.",operationId:"getKubernetesPodManifest",tags:["public","kubernetes-explorer"],method:"GET",url:`${Ur}/pod-manifest`,query:xC,response:hC}),PC=d({description:"Retrieves detailed information for a single Kubernetes deployment: replica status, backing pods, and rollout revisions with ready-to-use log filters.",operationId:"getKubernetesDeploymentDetails",tags:["public","kubernetes-explorer"],method:"GET",url:`${Ur}/deployment-details`,query:t.Object({...EC.properties,k8sCluster:p({allowEmpty:!1,description:"Kubernetes cluster name that contains the Deployment. From cluster telemetry. Required to identify the Deployment because names are only unique within a namespace and cluster."}),k8sNamespace:p({allowEmpty:!1,description:"Kubernetes namespace that contains the Deployment. From workload metadata. Required to identify the Deployment because names are only unique within a namespace and cluster."}),deploymentName:p({allowEmpty:!1,description:"Kubernetes Deployment name to retrieve. From workload telemetry. Required to fetch deployment details for the selected cluster and namespace."})}),response:TC});var EH="clusterId";function UC(e,r,n){let o=r.query.properties??{},i=Object.keys(o).filter(a=>a!==EH);for(let a of i){let c=a.replace(/([A-Z])/g,"-$1").toLowerCase(),m=o[a]?.description??"";n?e.requiredOption(`--${c} <value>`,m):e.option(`--${c} <value>`,m)}return i}function ii(e,r,n,o){let i=e.command(r).description(n.description??`List Kubernetes ${r}`),a=UC(i,n,!1);i.action(async c=>{let m={};for(let l of a)c[l]!==void 0&&(m[l]=c[l]);W(Object.keys(m).length>0?await o()(n,{query:m}):await o()(n))})}function Dd(e,r,n,o){let i=e.command(r).description(n.description??`Get Kubernetes ${r}`),a=UC(i,n,!0);i.action(async c=>{let m={};for(let l of a)m[l]=c[l];W(await o()(n,{query:m}))})}function wC(e,r){let n=e.command("kubernetes").description("Explore Kubernetes resources observed across the organization");ii(n,"pods",_C,r),ii(n,"clusters",IC,r),ii(n,"namespaces",bC,r),ii(n,"deployments",SC,r),ii(n,"statefulsets",OC,r),ii(n,"daemonsets",AC,r),Dd(n,"pod-details",RC,r),Dd(n,"pod-manifest",CC,r),Dd(n,"deployment-details",PC,r)}var wr="/v0/dashboards",LC=["white","gray.100","amber.200","lime.200","emerald.200","cyan.200","blue.200","violet.200","fuchsia.200","pink.200","red.200"],_H=["bar","distribution","gauge","heatmap","list","pie","query-value","table","timeseries","top-list"],u4e=[..._H,"note"];var IH=["ns","us","ms","s","m","h","days"];var bH=["B","KB","MB","GB","TB","PB"];var SH=20;var vC=t.Object({type:t.Literal("cpu",{description:"Normalizes values as CPU usage"})},{$id:"DataNormalizerCpu",title:"CPU"}),kC=t.Object({type:t.Literal("duration",{description:"Normalizes values as durations using standard time units"}),unit:t.Enum(IH,{description:"Time unit used to present the normalized values"})},{$id:"DataNormalizerDuration",title:"Duration"}),MC=t.Object({type:t.Literal("data",{description:"Normalizes values as data sizes using byte units"}),unit:t.Enum(bH,{description:"Data size unit used to present the normalized values"})},{$id:"DataNormalizerData",title:"Data"}),DC=t.Object({type:t.Literal("percent",{description:"Formats numeric values as percentages. Use it when the raw value is already on a 0-100 scale, for example `25` to display `25%`."})},{$id:"DataNormalizerPercent",title:"Percent"}),GC=t.Object({type:t.Literal("percent-fraction",{description:"Formats numeric values as percentages. Use it when the raw value is a 0-1 fraction; Tsuga multiplies the value by 100 for display, for example `0.2` to display `20%`."})},{$id:"DataNormalizerPercentFraction",title:"Percent Fraction"}),$C=t.Object({type:t.Literal("date",{description:"Formats values as calendar dates"})},{$id:"DataNormalizerDate",title:"Date"}),jC=t.Object({type:t.Literal("level",{description:"Displays values using their log level name"})},{$id:"DataNormalizerLevel",title:"Level"}),qC=t.Object({type:t.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"}),OH=t.Object({type:t.Literal("custom",{description:"Normalizes values using a custom unit label"}),unit:t.String({description:"Text label describing the custom unit"})},{$id:"DataNormalizerCustom",title:"Custom"}),AH=t.Object({type:t.Literal("custom",{description:"Normalizes values using a custom unit label"}),unit:t.String({description:"Text label describing the custom unit",maxLength:SH})},{$id:"InputDataNormalizerCustom",title:"Custom"}),gt=I("type",[kC,MC,DC,GC,$C,jC,vC,qC,OH],{title:"Normalizer",description:"Display-value formatter for widget values or list/table columns."}),yt=I("type",[kC,MC,DC,GC,$C,jC,vC,qC,AH],{title:"Normalizer",description:"Display-value formatter for widget values or list/table columns."}),Gd=t.Object({attribute:t.String({description:"Attribute (log field or database row column) displayed as a column in the list"}),normalizer:t.Optional(gt)},{title:"WidgetListColumn",description:"List column pairing a displayed attribute with the formatting applied to its values."}),$d=t.Object({attribute:t.String({description:"Attribute (log field or database row column) displayed as a column in the list"}),normalizer:t.Optional(yt)},{title:"WidgetListColumn",description:"List column pairing a displayed attribute with the formatting applied to its values."}),ai=["background","no-background"],xH=["table","legend-only","no-legend"];var RH=["greater_than","less_than","equal","not_equal","greater_than_or_equal","less_than_or_equal"],BC=["alert","warning","success"],ur=t.Object({operator:t.Enum(RH,{description:"Comparator used to evaluate the metric value"}),value:t.Number({description:"Threshold value used when evaluating the operator"}),color:t.Enum(BC,{description:"Color applied when the condition is met"})},{title:"ConditionalFormatting",description:"Color rule evaluated against the displayed value. The first matching rule in the array is applied."}),CH=t.Object({value:t.Number({description:"Y-axis value where the threshold marker is placed"}),level:t.Enum(BC,{description:"Level applied to the threshold marker"})},{title:"ThresholdMarker",description:"Marker line drawn across the chart at a fixed value, colored by its level."}),PH=["sec","min","hour","day"],dn=t.Object({time:t.Number({description:"Numeric count of `metric` units in each bucket. Required when `timeBucket` is present."}),metric:t.Enum(PH,{description:"Unit used to measure the bucket width"})},{description:"Time bucket width for time-based chart widgets. Optional; when present, `time` and `metric` together define the bucket width."});var ln=t.Enum(["flex-start","center","flex-end"],{description:"Flex alignment keyword used for widget layout"}),si=t.Object({formula:t.Optional(t.String({description:"Optional alias for formula (only used for display in the UI)"})),queries:t.Optional(t.Record(t.String(),t.String({description:'Display name for this query series in the legend, keyed by the zero-based query index as a string ("0" = first query, "1" = second, and so on). This differs from `formula`, which references queries as "q1", "q2". Omit to fall back to an auto-generated label like "Count on <filter>".'}),{description:"Display names for individual query series, keyed by the zero-based query index as a string."}))},{description:"Display names used for the formula series and the individual query series instead of auto-generated labels."}),ci=t.Object({formula:t.Optional(p({type:"short",description:"Optional alias for formula (only used for display in the UI)"})),queries:t.Optional(t.Record(t.String(),p({type:"short",description:'Display name for this query series in the legend, keyed by the zero-based query index as a string ("0" = first query, "1" = second, and so on). This differs from `formula`, which references queries as "q1", "q2". Omit to fall back to an auto-generated label like "Count on <filter>".'}),{description:"Display names for individual query series, keyed by the zero-based query index as a string."}))},{description:"Display names used for the formula series and the individual query series instead of auto-generated labels."}),dp={source:Kt,queries:MS,formula:t.Optional(Fc),aliases:t.Optional(si),visibleSeries:t.Optional(t.Array(t.Boolean(),{description:"Flags indicating whether each query or formula series is visible"}))},fp={source:Kt,queries:Ia,formula:t.Optional(Gn),aliases:t.Optional(ci),visibleSeries:t.Optional(t.Array(t.Boolean(),{description:"Flags indicating whether each query or formula series is visible"}))},pi={...dp,groupBy:t.Optional(qo)},ui={...fp,groupBy:t.Optional(Ir)},Ae=t.Enum(xH,{description:"Controls whether and how the widget displays legend or series details (e.g. table, legend-only, or no legend)"}),me=t.Optional(t.Union([t.Number(),t.Literal("max")],{description:"Display precision for numeric labels, tooltips, tables, and scalar values. Use a number of decimal places to round displayed values, or `max` to display the full submitted precision."})),$t=t.Optional(t.Array(CH,{description:"Threshold markers displayed on the chart"})),UH=t.Object({name:t.String({description:"Display name of the table column"}),...dp,source:Kt,normalizer:t.Optional(gt),precision:me},{title:"TableColumn",description:"Table column backed by its own aggregation. `defaultSorting` and `columnSizes` reference it as `col-<index>`, using its zero-based position in `columns`."}),wH=t.Object({name:p({description:"Display name of the table column"}),...fp,source:Kt,normalizer:t.Optional(yt),precision:me},{title:"TableColumn",description:"Table column backed by its own aggregation. `defaultSorting` and `columnSizes` reference it as `col-<index>`, using its zero-based position in `columns`."}),NH=t.Array(t.Object({id:t.String({description:"ID of the column to sort by"}),desc:t.Boolean({description:"Whether the sort is descending"})},{title:"TableDefaultSorting"}),{description:"Default sorting applied to a table widget. Column IDs are `label` for the grouping column and `col-<index>` for each entry in `columns`. Users can still change sorting by selecting columns in the rendered table."}),LH=t.Array(t.Object({id:p({description:"ID of the column to sort by"}),desc:t.Boolean({description:"Whether the sort is descending"})},{title:"TableDefaultSorting"}),{description:"Default sorting applied to a table widget. Column IDs are `label` for the grouping column and `col-<index>` for each entry in `columns`. Users can still change sorting by selecting columns in the rendered table."}),jd=t.Array(t.Object({id:t.String({description:"Column attribute used for the default list sort. It matches an attribute in `listColumns` or a built-in list column for the selected list source."}),desc:t.Boolean({description:"Sort direction for the default list sort. `true` sorts descending; `false` sorts ascending."})},{title:"ListDefaultSorting"}),{description:"Default sorting applied to a list widget. Applies to log, span, or connection list widgets. Users can still change sorting by selecting columns in the rendered list."}),qd=t.Array(t.Object({id:p({description:"Column attribute used for the default list sort. Set this to an attribute in `listColumns` or a built-in list column for the selected list source."}),desc:t.Boolean({description:"Sort direction for the default list sort. Set `true` for descending order or `false` for ascending order."})},{title:"ListDefaultSorting"}),{description:"Default sorting applied to a list widget. Optional on create or update for log, span, or connection list widgets. Users can still change sorting by selecting columns in the rendered list."}),FC=["horizontal","vertical"],vH=t.Object({type:t.Literal("list",{description:"Displays matching logs in a tabular list"}),query:t.String({description:"Query that selects logs for the list"}),listColumns:t.Optional(t.Array(Gd,{description:"Custom columns to display for each log"})),listColumnsSize:t.Optional(t.Record(t.String(),t.Number({description:"List column width by column id"}),{description:"List column widths in pixels, keyed by the `attribute` of the matching `listColumns` entry. Columns without an entry keep their default width."})),isCellWrapped:t.Optional(t.Boolean({description:"Whether list widget cell text wraps instead of truncating. Applies to list widgets."})),defaultSorting:t.Optional(jd)},{$id:"GraphVisualizationList",title:"List"}),kH=t.Object({type:t.Literal("list",{description:"Displays matching logs in a tabular list"}),query:p({type:"tsuga-query",description:"Query that selects logs for the list"}),listColumns:t.Optional(t.Array($d,{description:"Custom columns to display for each log"})),listColumnsSize:t.Optional(t.Record(t.String(),t.Number({description:"List column width by column id"}),{description:"List column widths in pixels, keyed by the `attribute` of the matching `listColumns` entry. Columns without an entry keep their default width."})),isCellWrapped:t.Optional(t.Boolean({description:"Whether list widget cell text wraps instead of truncating. Applies to list widgets. Optional; omit or set false to use truncated cells."})),defaultSorting:t.Optional(qd)},{$id:"InputGraphVisualizationList",title:"List"}),lp=I("type",[t.Object({type:t.Literal("auto",{description:"Automatically choose this axis bound"})}),t.Object({type:t.Literal("number",{description:"Use a fixed numeric axis bound"}),value:t.Number({description:"Fixed numeric axis bound value"})})],{description:"Axis bound mode: automatic or fixed numeric value"}),mi=t.Object({min:lp,max:lp,scale:I("type",[t.Object({type:t.Literal("pow",{description:"Power scale"}),exponent:t.Number({description:"Exponent used by the power scale"})}),t.Object({type:t.Enum(["linear","log","sqrt"],{description:"Built-in axis scale"})})],{description:"Y-axis scale mode"}),alwaysIncludeZero:t.Boolean({description:"Whether the rendered Y axis should always include zero"})},{description:"Y-axis bounds and scale configuration for chart widgets."}),li=t.Object({min:lp,max:lp,scale:I("type",[t.Object({type:t.Literal("pow",{description:"Power scale"}),exponent:t.Number({minimum:0,description:"Exponent used by the power scale"})}),t.Object({type:t.Enum(["linear","log","sqrt"],{description:"Built-in axis scale"})})],{description:"Y-axis scale mode"}),alwaysIncludeZero:t.Boolean({description:"Whether the rendered Y axis should always include zero"})},{description:"Y-axis bounds and scale configuration for chart widgets. Optional on create or update."}),MH=t.Array(t.Integer({description:"Marker value expressed as a percentage between 0 and 100"}),{description:"Percentile markers displayed on top of the distribution chart"}),DH=t.Array(t.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 GH=t.Object({type:t.Literal("timeseries-connection",{description:"Displays the database rows-based aggregation as a time series chart"}),connectionId:t.String({description:"The ID of the connection to use to query the datastore."}),queries:t.Array(t.String({description:"The read-only SQL query to execute against the connection."})),legendMode:t.Optional(Ae),thresholds:$t,yAxisSettings:t.Optional(mi)},{$id:"GraphVisualizationTimeseriesConnection",title:"TimeseriesConnection"}),$H=t.Object({type:t.Literal("timeseries-connection",{description:"Displays the database rows-based aggregation as a time series chart"}),connectionId:p({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:t.Array(p({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:t.Optional(Ae),thresholds:$t,yAxisSettings:t.Optional(li)},{$id:"InputGraphVisualizationTimeseriesConnection",title:"TimeseriesConnection"}),jH=t.Object({type:t.Literal("list-connection",{description:"Displays database rows as a tabular list"}),connectionId:t.String({description:"The ID of the connection to use to query the datastore."}),query:t.String({description:"The read-only SQL query to execute against the connection."}),listColumns:t.Optional(t.Array(Gd,{description:"Custom columns to display for each database row"})),listColumnsSize:t.Optional(t.Record(t.String(),t.Number({description:"List column width by column id"}),{description:"List column widths in pixels, keyed by the `attribute` of the matching `listColumns` entry. Columns without an entry keep their default width."})),isCellWrapped:t.Optional(t.Boolean({description:"Whether list widget cell text wraps instead of truncating. Applies to connection list widgets."})),defaultSorting:t.Optional(jd)},{$id:"GraphVisualizationListConnection",title:"ListConnection"}),qH=t.Object({type:t.Literal("list-connection",{description:"Displays database rows as a tabular list"}),connectionId:p({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),query:p({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),listColumns:t.Optional(t.Array($d,{description:"Custom columns to display for each database row"})),listColumnsSize:t.Optional(t.Record(t.String(),t.Number({description:"List column width by column id"}),{description:"List column widths in pixels, keyed by the `attribute` of the matching `listColumns` entry. Columns without an entry keep their default width."})),isCellWrapped:t.Optional(t.Boolean({description:"Whether list widget cell text wraps instead of truncating. Applies to connection list widgets. Optional; omit or set false to use truncated cells."})),defaultSorting:t.Optional(qd)},{$id:"InputGraphVisualizationListConnection",title:"ListConnection"}),BH=t.Object({type:t.Literal("top-list-connection",{description:"Displays the database rows-based aggregation as a ranked top list"}),connectionId:t.String({description:"The ID of the connection to use to query the datastore."}),queries:t.Array(t.String({description:"The read-only SQL query to execute against the connection."}))},{$id:"GraphVisualizationTopListConnection",title:"TopListConnection"}),FH=t.Object({type:t.Literal("top-list-connection",{description:"Displays the database rows-based aggregation as a ranked top list"}),connectionId:p({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:t.Array(p({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1})},{$id:"InputGraphVisualizationTopListConnection",title:"TopListConnection"}),HH=t.Object({type:t.Literal("pie-connection",{description:"Displays the database rows-based aggregation as a pie chart"}),connectionId:t.String({description:"The ID of the connection to use to query the datastore."}),queries:t.Array(t.String({description:"The read-only SQL query to execute against the connection."})),legendMode:t.Optional(Ae)},{$id:"GraphVisualizationPieConnection",title:"PieConnection"}),KH=t.Object({type:t.Literal("pie-connection",{description:"Displays the database rows-based aggregation as a pie chart"}),connectionId:p({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:t.Array(p({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:t.Optional(Ae)},{$id:"InputGraphVisualizationPieConnection",title:"PieConnection"}),zH=t.Object({type:t.Literal("bar-connection",{description:"Displays the database rows-based aggregation as a bar chart"}),connectionId:t.String({description:"The ID of the connection to use to query the datastore."}),queries:t.Array(t.String({description:"The read-only SQL query to execute against the connection."})),legendMode:t.Optional(Ae),thresholds:$t,yAxisSettings:t.Optional(mi)},{$id:"GraphVisualizationBarConnection",title:"BarConnection"}),YH=t.Object({type:t.Literal("bar-connection",{description:"Displays the database rows-based aggregation as a bar chart"}),connectionId:p({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:t.Array(p({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:t.Optional(Ae),thresholds:$t,yAxisSettings:t.Optional(li)},{$id:"InputGraphVisualizationBarConnection",title:"BarConnection"}),VH=t.Object({type:t.Literal("query-value-connection",{description:"Displays a single value computed by a SQL query against a database connection"}),connectionId:t.String({description:"The ID of the connection to use to query the datastore."}),queries:t.Array(t.String({description:"The read-only SQL query to execute against the connection."})),backgroundMode:t.Optional(t.Enum(ai,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:t.Optional(t.Array(ur,{description:"Conditional formatting rules applied to the displayed value"})),precision:me,normalizer:t.Optional(gt),legendMode:t.Optional(Ae)},{$id:"GraphVisualizationQueryValueConnection",title:"QueryValueConnection"}),QH=t.Object({type:t.Literal("query-value-connection",{description:"Displays a single value computed by a SQL query against a database connection"}),connectionId:p({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:t.Array(p({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),backgroundMode:t.Optional(t.Enum(ai,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:t.Optional(t.Array(ur,{description:"Conditional formatting rules applied to the displayed value"})),precision:me,normalizer:t.Optional(yt),legendMode:t.Optional(Ae)},{$id:"InputGraphVisualizationQueryValueConnection",title:"QueryValueConnection"}),WH=t.Object({type:t.Literal("list-log-patterns",{description:"Displays log patterns clustered from logs matching the query"}),query:t.String({description:"Tsuga query that selects logs to cluster into patterns"}),layout:t.Optional(t.Enum(FC,{description:"Layout used to render log patterns"}))},{$id:"GraphVisualizationListLogPatterns",title:"ListLogPatterns"}),ZH=t.Object({type:t.Literal("list-log-patterns",{description:"Displays log patterns clustered from logs matching the query"}),query:p({type:"tsuga-query",description:"Tsuga query that selects logs to cluster into patterns"}),layout:t.Optional(t.Enum(FC,{description:"Layout used to render log patterns"}))},{$id:"InputGraphVisualizationListLogPatterns",title:"ListLogPatterns"}),XH=t.Object({type:t.Literal("list-spans",{description:"Displays matching trace spans in a tabular list"}),query:t.String({description:"Query that selects trace spans for the list"}),listColumns:t.Optional(t.Array(Gd,{description:"Custom columns to display for each span"})),listColumnsSize:t.Optional(t.Record(t.String(),t.Number({description:"List column width by column id"}),{description:"List column widths in pixels, keyed by the `attribute` of the matching `listColumns` entry. Columns without an entry keep their default width."})),isCellWrapped:t.Optional(t.Boolean({description:"Whether list widget cell text wraps instead of truncating. Applies to span list widgets."})),defaultSorting:t.Optional(jd)},{$id:"GraphVisualizationListSpans",title:"ListSpans"}),JH=t.Object({type:t.Literal("list-spans",{description:"Displays matching trace spans in a tabular list"}),query:p({type:"tsuga-query",description:"Query that selects trace spans for the list"}),listColumns:t.Optional(t.Array($d,{description:"Custom columns to display for each span"})),listColumnsSize:t.Optional(t.Record(t.String(),t.Number({description:"List column width by column id"}),{description:"List column widths in pixels, keyed by the `attribute` of the matching `listColumns` entry. Columns without an entry keep their default width."})),isCellWrapped:t.Optional(t.Boolean({description:"Whether list widget cell text wraps instead of truncating. Applies to span list widgets. Optional; omit or set false to use truncated cells."})),defaultSorting:t.Optional(qd)},{$id:"InputGraphVisualizationListSpans",title:"ListSpans"}),za=t.Array(t.String({description:"Raw PromQL expression for this widget, returned exactly as stored."}),{description:"PromQL expressions configured for this widget. PromQL-backed widgets require at least one query."}),Ya=t.Array(p({allowEmpty:!1,type:"long",description:"Raw PromQL expression for this widget."}),{minItems:1,description:"PromQL expressions configured for this widget."}),eK=t.Object({type:t.Literal("timeseries-promql",{description:"Displays PromQL metrics query-based aggregation as a time series chart"}),queries:za,aliases:t.Optional(si),timeBucket:t.Optional(dn),normalizer:t.Optional(gt),precision:me,legendMode:t.Optional(Ae),thresholds:$t,yAxisSettings:t.Optional(mi),smoothing:t.Optional(t.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"}))},{$id:"GraphVisualizationTimeseriesPromql",title:"TimeseriesPromql"}),tK=t.Object({type:t.Literal("timeseries-promql",{description:"Displays PromQL metrics query-based aggregation as a time series chart"}),queries:Ya,aliases:t.Optional(ci),timeBucket:t.Optional(dn),normalizer:t.Optional(yt),precision:me,legendMode:t.Optional(Ae),thresholds:$t,yAxisSettings:t.Optional(li),smoothing:t.Optional(t.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"}))},{$id:"InputGraphVisualizationTimeseriesPromql",title:"TimeseriesPromql"}),rK=t.Object({type:t.Literal("query-value-promql",{description:"Configures a PromQL metrics query-based aggregation as a single value"}),queries:za,aliases:t.Optional(si),backgroundMode:t.Optional(t.Enum(ai,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:t.Optional(t.Array(ur,{description:"Conditional formatting rules applied to the displayed value"})),precision:me,normalizer:t.Optional(gt),legendMode:t.Optional(Ae)},{$id:"GraphVisualizationQueryValuePromql",title:"QueryValuePromql"}),nK=t.Object({type:t.Literal("query-value-promql",{description:"Configures a PromQL metrics query-based aggregation as a single value"}),queries:Ya,aliases:t.Optional(ci),backgroundMode:t.Optional(t.Enum(ai,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:t.Optional(t.Array(ur,{description:"Conditional formatting rules applied to the displayed value"})),precision:me,normalizer:t.Optional(yt),legendMode:t.Optional(Ae)},{$id:"InputGraphVisualizationQueryValuePromql",title:"QueryValuePromql"}),oK=t.Object({type:t.Literal("top-list-promql",{description:"Displays PromQL metrics query-based aggregation as a ranked top list"}),queries:za,aliases:t.Optional(si),normalizer:t.Optional(gt),precision:me,conditions:t.Optional(t.Array(ur,{description:"Conditional formatting rules applied to the displayed value"}))},{$id:"GraphVisualizationTopListPromql",title:"TopListPromql"}),iK=t.Object({type:t.Literal("top-list-promql",{description:"Displays PromQL metrics query-based aggregation as a ranked top list"}),queries:Ya,aliases:t.Optional(ci),normalizer:t.Optional(yt),precision:me,conditions:t.Optional(t.Array(ur,{description:"Conditional formatting rules applied to the displayed value"}))},{$id:"InputGraphVisualizationTopListPromql",title:"TopListPromql"}),aK=t.Object({type:t.Literal("pie-promql",{description:"Displays PromQL metrics query-based aggregation as a pie chart"}),queries:za,aliases:t.Optional(si),normalizer:t.Optional(gt),precision:me,legendMode:t.Optional(Ae)},{$id:"GraphVisualizationPiePromql",title:"PiePromql"}),sK=t.Object({type:t.Literal("pie-promql",{description:"Displays PromQL metrics query-based aggregation as a pie chart"}),queries:Ya,aliases:t.Optional(ci),normalizer:t.Optional(yt),precision:me,legendMode:t.Optional(Ae)},{$id:"InputGraphVisualizationPiePromql",title:"PiePromql"}),cK=t.Object({type:t.Literal("bar-promql",{description:"Displays PromQL metrics query-based aggregation as a bar chart"}),queries:za,aliases:t.Optional(si),timeBucket:t.Optional(dn),precision:me,normalizer:t.Optional(gt),thresholds:$t,legendMode:t.Optional(Ae),yAxisSettings:t.Optional(mi)},{$id:"GraphVisualizationBarPromql",title:"BarPromql"}),pK=t.Object({type:t.Literal("bar-promql",{description:"Displays PromQL metrics query-based aggregation as a bar chart"}),queries:Ya,aliases:t.Optional(ci),timeBucket:t.Optional(dn),precision:me,normalizer:t.Optional(yt),thresholds:$t,legendMode:t.Optional(Ae),yAxisSettings:t.Optional(li)},{$id:"InputGraphVisualizationBarPromql",title:"BarPromql"}),uK=t.Object({type:t.Literal("timeseries",{description:"Displays the aggregation as a time series chart"}),...pi,timeBucket:t.Optional(dn),normalizer:t.Optional(gt),precision:me,legendMode:t.Optional(Ae),thresholds:$t,yAxisSettings:t.Optional(mi),smoothing:t.Optional(t.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"}))},{$id:"GraphVisualizationTimeseries",title:"Timeseries"}),mK=t.Object({type:t.Literal("timeseries",{description:"Displays the aggregation as a time series chart"}),...ui,timeBucket:t.Optional(dn),normalizer:t.Optional(yt),precision:me,legendMode:t.Optional(Ae),thresholds:$t,yAxisSettings:t.Optional(li),smoothing:t.Optional(t.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"}))},{$id:"InputGraphVisualizationTimeseries",title:"Timeseries"}),lK=t.Object({type:t.Literal("top-list",{description:"Displays the aggregation as a ranked list of top results"}),...pi,normalizer:t.Optional(gt),precision:me,conditions:t.Optional(t.Array(ur,{description:"Conditional formatting rules applied to the displayed value"}))},{$id:"GraphVisualizationTopList",title:"TopList"}),dK=t.Object({type:t.Literal("top-list",{description:"Displays the aggregation as a ranked list of top results"}),...ui,normalizer:t.Optional(yt),precision:me,conditions:t.Optional(t.Array(ur,{description:"Conditional formatting rules applied to the displayed value"}))},{$id:"InputGraphVisualizationTopList",title:"TopList"}),fK=t.Object({type:t.Literal("pie",{description:"Displays the aggregation as a pie chart"}),...pi,normalizer:t.Optional(gt),precision:me,legendMode:t.Optional(Ae)},{$id:"GraphVisualizationPie",title:"Pie"}),gK=t.Object({type:t.Literal("pie",{description:"Displays the aggregation as a pie chart"}),...ui,normalizer:t.Optional(yt),precision:me,legendMode:t.Optional(Ae)},{$id:"InputGraphVisualizationPie",title:"Pie"}),yK=t.Object({type:t.Literal("query-value",{description:"Displays the aggregation as a single value"}),...dp,backgroundMode:t.Optional(t.Enum(ai,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:t.Optional(t.Array(ur,{description:"Conditional formatting rules applied to the displayed value"})),precision:me,normalizer:t.Optional(gt),legendMode:t.Optional(Ae)},{$id:"GraphVisualizationQueryValue",title:"QueryValue"}),hK=t.Object({type:t.Literal("query-value",{description:"Displays the aggregation as a single value"}),...fp,backgroundMode:t.Optional(t.Enum(ai,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:t.Optional(t.Array(ur,{description:"Conditional formatting rules applied to the displayed value"})),precision:me,normalizer:t.Optional(yt),legendMode:t.Optional(Ae)},{$id:"InputGraphVisualizationQueryValue",title:"QueryValue"}),TK=t.Object({type:t.Literal("bar",{description:"Displays the aggregation as a bar chart"}),...pi,timeBucket:t.Optional(dn),precision:me,normalizer:t.Optional(gt),thresholds:$t,legendMode:t.Optional(Ae),yAxisSettings:t.Optional(mi)},{$id:"GraphVisualizationBar",title:"Bar"}),EK=t.Object({type:t.Literal("bar",{description:"Displays the aggregation as a bar chart"}),...ui,timeBucket:t.Optional(dn),precision:me,normalizer:t.Optional(yt),thresholds:$t,legendMode:t.Optional(Ae),yAxisSettings:t.Optional(li)},{$id:"InputGraphVisualizationBar",title:"Bar"}),_K=t.Object({type:t.Literal("distribution",{description:"Displays the aggregation as a distribution chart"}),...pi,precision:me,normalizer:t.Optional(gt),percentileMarkers:t.Optional(MH),boundsScale:t.Optional(qc)},{$id:"GraphVisualizationDistribution",title:"Distribution"}),IK=t.Object({type:t.Literal("distribution",{description:"Displays the aggregation as a distribution chart"}),...ui,precision:me,normalizer:t.Optional(yt),percentileMarkers:t.Optional(DH),boundsScale:t.Optional(qc)},{$id:"InputGraphVisualizationDistribution",title:"Distribution"}),HC=["red","pink","violet","blue","cyan","green","yellow","orange"],KC=t.Enum(HC,{description:"Color palette used to render the heatmap intensity gradient"}),bK=t.Object({type:t.Literal("heatmap",{description:"Displays the aggregation as a heatmap chart"}),...pi,precision:me,normalizer:t.Optional(gt),palette:t.Optional(KC)},{$id:"GraphVisualizationHeatmap",title:"Heatmap"}),SK=t.Object({type:t.Literal("heatmap",{description:"Displays the aggregation as a heatmap chart"}),...ui,precision:me,normalizer:t.Optional(yt),palette:t.Optional(KC)},{$id:"InputGraphVisualizationHeatmap",title:"Heatmap"}),zC=t.Object({from:t.Number({description:"Lower bound of the Gauge color threshold; runs up to the next threshold or the max"}),color:t.Enum(HC,{description:"Color applied to the band starting at this value"})},{title:"GaugeColorThreshold",description:"Color band of the gauge range. Bands are ordered by `from`, so entries may be listed in any order."}),OK=t.Object({type:t.Literal("gauge",{description:"Displays the aggregation as a gauge"}),...dp,max:t.Optional(t.Number({description:"Gauge maximum value"})),colorThresholds:t.Optional(t.Array(zC,{description:"Color thresholds inside the gauge range"})),precision:me,normalizer:t.Optional(gt)},{$id:"GraphVisualizationGauge",title:"Gauge"}),AK=t.Object({type:t.Literal("gauge",{description:"Displays the aggregation as a gauge"}),...fp,max:t.Optional(t.Number({description:"Gauge maximum value"})),colorThresholds:t.Optional(t.Array(zC,{description:"Color thresholds inside the gauge range"})),precision:me,normalizer:t.Optional(yt)},{$id:"InputGraphVisualizationGauge",title:"Gauge"}),xK=t.Object({type:t.Literal("table",{description:"Displays the aggregation as a table with multi-level grouping"}),columns:t.Array(UH,{description:"Each column defines an independent aggregation displayed as a table column"}),groupBy:t.Optional(qo),defaultSorting:t.Optional(NH),columnSizes:t.Optional(t.Record(t.String(),t.Number({description:"Column width by column id"}),{description:"Table column widths in pixels, keyed by column id: `label` for the grouping column and `col-<index>` for each entry in `columns`. Columns without an entry keep their default width."}))},{$id:"GraphVisualizationTable",title:"Table"}),RK=t.Object({type:t.Literal("table",{description:"Displays the aggregation as a table with multi-level grouping"}),columns:t.Array(wH,{minItems:1,description:"Each column defines an independent aggregation displayed as a table column"}),groupBy:t.Optional(Ir),defaultSorting:t.Optional(LH),columnSizes:t.Optional(t.Record(t.String(),t.Number({description:"Column width by column id"}),{description:"Table column widths in pixels, keyed by column id: `label` for the grouping column and `col-<index>` for each entry in `columns`. Columns without an entry keep their default width."}))},{$id:"InputGraphVisualizationTable",title:"Table"}),CK=t.Object({type:t.Literal("note",{description:"Displays static text on the dashboard"}),note:t.Optional(t.String({description:"Markdown-compatible text shown in the note"})),noteColor:t.Optional(t.Enum(LC,{description:"Background color used to render the note"})),noteAlign:t.Optional(ln),noteJustifyContent:t.Optional(ln)},{$id:"GraphVisualizationNote",title:"Note"}),PK=t.Object({type:t.Literal("note",{description:"Displays static text on the dashboard"}),note:t.Optional(p({type:"long",description:"Markdown-compatible text shown in the note"})),noteColor:t.Optional(t.Enum(LC,{description:"Background color used to render the note"})),noteAlign:t.Optional(ln),noteJustifyContent:t.Optional(ln)},{$id:"InputGraphVisualizationNote",title:"Note"}),UK=I("type",[GH,jH,BH,HH,zH,VH,eK,rK,oK,aK,cK,uK,lK,fK,yK,OK,TK,_K,bK,xK,vH,CK,WH,XH],{description:"Widget visualization configuration. The `type` discriminator selects the widget kind and its required fields."}),wK=I("type",[$H,qH,FH,KH,YH,QH,tK,nK,iK,sK,pK,mK,dK,gK,hK,AK,EK,IK,SK,RK,kH,PK,ZH,JH],{description:"Widget visualization configuration. The `type` discriminator selects the widget kind and its required fields."}),gp=t.Object({id:t.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:t.Optional(t.String({description:"Display name of the graph widget."})),description:t.Optional(t.String({description:"Optional text shown with the graph widget."})),descriptionAlign:t.Optional(ln),descriptionJustifyContent:t.Optional(ln),visualization:UK,layout:t.Optional(t.Object({x:t.Number({description:"Column position of the widget on the 12-column dashboard grid. 0 is the leftmost column; increasing values move right."}),y:t.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:t.Number({description:"Width of the widget in grid columns, out of the 12-column grid."}),h:t.Number({description:"Height of the widget in grid rows, where each row is 50 pixels tall."})},{description:"Grid position and size of the widget. Optional; when provided, width and height must meet the minimum size for the widget type."}))},{title:"Graph",description:"Single dashboard widget, combining its identity, its visualization configuration, and its position on the dashboard grid."}),yp=t.Object({id:p({description:"Unique identifier of the graph widget inside the dashboard. Assign it when the graph is created; use it to target the graph in later update requests."}),name:t.Optional(p({description:"Display name of the graph widget."})),description:t.Optional(t.String({minLength:1,maxLength:800,description:"Text shown with the graph widget."})),descriptionAlign:t.Optional(ln),descriptionJustifyContent:t.Optional(ln),visualization:wK,layout:t.Optional(t.Object({x:t.Number({description:"Column position of the widget on the 12-column dashboard grid. 0 is the leftmost column; increasing values move right."}),y:t.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:t.Number({description:"Width of the widget in grid columns, out of the 12-column grid."}),h:t.Number({description:"Height of the widget in grid rows, where each row is 50 pixels tall."})},{description:"Grid position and size of the widget. Optional; when provided, width and height must meet the minimum size for the widget type."}))},{title:"Graph",description:"Single dashboard widget, combining its identity, its visualization configuration, and its position on the dashboard grid."}),NC=10,NK=t.Array(t.Object({key:t.String({description:"Dashboard-wide filter key, usually a telemetry attribute name."}),values:t.Array(t.String({description:"Filter value."}),{description:"Allowed values for this dashboard-wide filter."}),exclude:t.Optional(t.Boolean({description:"If true, widgets exclude telemetry whose value matches this filter instead of including it (is-not)."}))}),{description:"Dashboard-wide filters applied to every widget on the dashboard."}),LK=t.Array(t.Object({key:p({description:"Dashboard-wide filter key, usually a telemetry attribute name."}),values:t.Array(p({description:"Filter value."}),{description:"Allowed values for this dashboard-wide filter."}),exclude:t.Optional(t.Boolean({description:"If true, widgets exclude telemetry whose value matches this filter instead of including it (is-not)."}))}),{maxItems:NC,description:`Dashboard-wide filters applied to every widget on the dashboard. Up to ${NC} filters are allowed.`}),di=t.Object({id:t.String({description:"Tsuga-generated dashboard ID assigned when the dashboard is created."}),name:t.String({description:"Display name of the dashboard. Set by the caller on create or update."}),owner:t.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:t.Array(gp,{description:"Ordered widgets that compose the dashboard"}),filters:t.Optional(NK),createdAt:T({description:"Timestamp when Tsuga created the dashboard."}),updatedAt:T({description:"Timestamp when Tsuga last updated the dashboard."}),creator:t.Optional(ue),updater:t.Optional(ue),tags:ke,timePreset:t.Optional(t.Enum(ou,{description:"Relative time preset used when opening the dashboard."})),folderId:t.Optional(t.String({description:"Folder that contains the dashboard. Set from the dashboard's saved folder relationship. Returned when the dashboard is in a folder; omitted when it is not."}))}),hp=t.Object({name:p({description:"Display name of the dashboard."}),owner:p({allowEmpty:!1,description:"ID of the team that owns the dashboard. Required and used for dashboard access control."}),graphs:t.Array(yp,{description:"Ordered widgets that compose the dashboard"}),filters:t.Optional(LK),tags:Ve,timePreset:t.Optional(t.Enum(ou,{description:"Relative time preset used when opening the dashboard. Optional; create defaults to `past-30-minutes` when omitted, and update omission preserves the current value."})),folderId:t.Optional(t.Union([t.Null(),p({allowEmpty:!1})],{description:"Folder that should contain the dashboard. Optional; omit on update to keep the current folder, pass null to clear the folder, or pass a readable dashboard-folder ID to move it."}))}),Qt={IS_FAVORITE:"isFavorite",OWNER:"owner",TAGS:"tags",WIDGET_COUNT:"widgetCount",UPDATED_AT:"updatedAt",NAME:"name"},YC=[Qt.OWNER,Qt.TAGS,Qt.WIDGET_COUNT,Qt.UPDATED_AT,Qt.NAME],Tp=t.Partial(t.Object({owners:je(p({allowEmpty:!1}),{description:"Restrict results to dashboards owned by any of these team IDs",maxItems:50}),searchQuery:t.Object({value:p({allowEmpty:!1,description:"Substring matched case-insensitively against dashboard names or dashboard IDs. Omit the whole `searchQuery` filter to skip text filtering."}),exclude:t.Optional(t.Boolean({description:"If true, exclude dashboards matching this value instead of including them"}))},{description:"Text filter for dashboard names or IDs. Optional; `exclude: true` returns dashboards whose name and ID do not match the substring."}),tags:je(Yt.items,{description:"Restrict results to dashboards that have at least one of the listed key/value tags",maxItems:50}),folderId:t.Union([t.Null(),p({allowEmpty:!1})],{description:"Folder filter for dashboard query results. Optional; pass a folder ID to return dashboards in that folder, or null to return only dashboards that are not in any folder."})},{description:"Optional filters applied to narrow the returned dashboards"})),vK=t.Partial(t.Object({...Q,filters:Tp,sort:t.Object({by:t.Enum([Qt.IS_FAVORITE,Qt.OWNER,Qt.TAGS,Qt.WIDGET_COUNT,Qt.UPDATED_AT,Qt.NAME],{description:"Field to sort the returned dashboards by"}),direction:t.Enum(["asc","desc"],{description:"Sort direction: ascending or descending"})},{description:"Optional sorting applied to the returned dashboards"})})),m4e=d({tags:["dashboards"],url:`${wr}/query`,method:"POST",paginated:!0,response:t.Array(di),body:vK}),l4e=d({tags:["dashboards"],url:`${wr}/tags/query`,method:"POST",body:t.Object({filters:t.Optional(t.Omit(Tp,["tags"]))}),response:zt}),d4e=d({tags:["dashboards"],url:`${wr}/:id`,method:"GET",params:t.Object({id:p()}),response:di}),f4e=d({tags:["dashboards"],url:wr,method:"POST",body:hp,response:di}),g4e=d({tags:["dashboards"],url:`${wr}/:id`,method:"PUT",params:t.Object({id:p()}),body:t.Partial(hp),response:di}),y4e=d({tags:["dashboards"],url:`${wr}/bulk-update`,method:"PUT",body:t.Object({dashboardIds:t.Array(p(),{description:"Dashboard IDs to update. At least one dashboard ID is required."}),owner:t.Optional(p({allowEmpty:!1,description:"Owning team ID to apply to every dashboard. Optional when folderId is provided; omit to keep the current owner."})),folderId:t.Optional(t.Union([t.Null(),p({allowEmpty:!1})],{description:"Folder that should contain every dashboard. Optional when owner is provided; omit to keep the current folder, pass null to clear the folder, or pass a dashboard-folder ID to move dashboards."}))}),response:t.Object({})}),h4e=d({tags:["dashboards"],url:`${wr}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),T4e=d({tags:["dashboards"],url:`${wr}/:id/graphs/:graphId`,method:"PUT",params:t.Object({id:p({allowEmpty:!1}),graphId:p({allowEmpty:!1})}),body:t.Omit(yp,["id"]),response:gp}),E4e=d({tags:["dashboards"],url:`${wr}/bulk-delete`,method:"DELETE",body:t.Object({ids:t.Array(p())}),response:t.Object({})});var fi=`/${"v1"}/dashboards`,Va=t.Pick(di,["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)."}),kK={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(Va,{examples:[kK]});var MK=t.Object({by:t.Enum([...YC],{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:t.Enum(["asc","desc"],{description:"Sort direction: ascending or descending"})},{description:"Optional sorting applied to the returned dashboards"}),VC=t.Object({...Q,filters:t.Optional(t.Pick(Tp,["owners","searchQuery","tags","folderId"])),sort:t.Optional(MK)},{description:"Dashboard query request. Use filters, sorting, limit, and offset to page through visible dashboards."}),DK={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(VC,{examples:[DK]});var QC=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:`${fi}/query`,method:"POST",paginated:!0,body:VC,response:t.Array(Va)}),WC=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:`${fi}/:id`,method:"GET",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the saved dashboard to retrieve. Use the `id` returned by dashboard query, create, or update responses."})}),response:Va}),Bd=t.Pick(hp,["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."}),GK={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(Bd,{examples:[GK]});var $K=t.Omit(yp,["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."}),ZC=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:fi,method:"POST",body:Bd,response:Va}),XC=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:`${fi}/:id`,method:"PUT",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the saved dashboard to update. Use the `id` returned by dashboard query, get, or create responses."})}),body:t.Partial(Bd),response:Va}),jK=t.Object({id:p({allowEmpty:!1,description:"Identifier of the saved dashboard to delete. Use the `id` returned by dashboard query, get, create, or update responses."})}),JC=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:`${fi}/:id`,method:"DELETE",params:jK,response:R}),R4e=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:`${fi}/:id/graphs/:graphId`,method:"PUT",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the dashboard that contains the graph to update. Use the `id` returned by dashboard responses."}),graphId:p({allowEmpty:!1,description:"Identifier of the graph to update within the dashboard. Use graph IDs from the dashboard response."})}),body:$K,response:gp});var eP=100,tP=3,gi=t.Object({id:t.String({description:"Tsuga-generated ingestion API key ID assigned when the key is created."}),name:t.String({description:"Human-readable key name. Names must be kebab-case when creating or updating keys."}),keyLastCharacters:t.String({description:"Last visible characters of the secret key. Use this to identify a key without exposing the full secret."}),owner:t.String({description:"Team ID that owns and manages the ingestion API key."}),tags:zt,teamOverrideFields:t.Optional(t.Array(t.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:t.Optional(ue),updater:t.Optional(ue),assetUpdatedAt:T({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})}),Qa=t.Object({name:t.String({format:vo,minLength:1,maxLength:eP,description:`Kebab-case name for the ingestion API key. Maximum length is ${eP} characters.`}),owner:p({allowEmpty:!1,description:"Team ID that will own and manage the ingestion API key."}),tags:Yt,teamOverrideFields:t.Union([t.Array(p({allowEmpty:!1}),{minItems:1,maxItems:tP,description:`Array form. Up to ${tP} fields are allowed.`}),t.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."})}),Wa="/v0/ingestion-api-keys",M4e=d({tags:["ingestion-api-keys"],url:Wa,method:"POST",body:Qa,response:t.Intersect([gi,t.Object({key:t.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."})})])}),D4e=d({tags:["ingestion-api-keys"],url:Wa,method:"GET",paginated:!0,query:t.Object(Q),response:t.Array(gi)}),G4e=d({tags:["ingestion-api-keys"],url:`${Wa}/:id`,method:"GET",params:t.Object({id:p({allowEmpty:!1})}),response:gi}),$4e=d({tags:["ingestion-api-keys"],url:`${Wa}/:id`,method:"PUT",params:t.Object({id:p({allowEmpty:!1})}),body:Qa,response:gi}),j4e=d({tags:["ingestion-api-keys"],url:`${Wa}/:id`,method:"DELETE",params:t.Object({id:p({allowEmpty:!1})}),response:R});var Za=`/${"v1"}/ingestion-api-keys`,Xa=t.Pick(gi,["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)."}),rP={id:"123-456-abc",name:"production-logs-ingestion",keyLastCharacters:"x7Qm",owner:"team-123-abc",tags:[{key:"env",value:"production"}],teamOverrideFields:["service"]};Object.assign(Xa,{examples:[rP]});var nP=t.Pick(Qa,["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."}),oP=t.Pick(Qa,["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."}),iP={name:"production-logs-ingestion",owner:"team-123-abc",tags:[{key:"env",value:"production"}],teamOverrideFields:["service"]};Object.assign(nP,{examples:[iP]});Object.assign(oP,{examples:[iP]});var qK={...rP,key:"tsuga_in:v1:abc123xyx7Qm"},aP=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:Za,method:"GET",paginated:!0,query:t.Object(Q),response:t.Array(Xa)}),V4e=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:`${Za}/:id`,method:"GET",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the ingestion API key to retrieve. Use the `id` returned by ingestion API key list or create responses."})}),response:Xa}),BK=t.Intersect([t.Pick(Xa,["id","name","keyLastCharacters","owner","tags","teamOverrideFields"]),t.Object({key:t.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:qK}),sP=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:Za,method:"POST",body:nP,response:BK}),cP=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:`${Za}/:id`,method:"PUT",params:t.Object({id:p({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:oP,response:Xa}),pP=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:`${Za}/:id`,method:"DELETE",params:t.Object({id:p({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:R});var FK={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"]}},[X4e,Kd,Ja]=HK(FK);function HK(e){let r=[],n=[],o=[],i=Object.keys(e);for(let a of i){r.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[Fd(r),Fd(n),Fd(o)]}function Fd(e){if(e.length===0)throw new Error("Array must have at least one element.");return e}var Hd=t.Enum(["HTTP","HTTPS","TCP","UDP","GENEVE","TLS","TLS_QUIC","TCP_UDP","TCP_QUIC","QUIC"]),KK=t.Object({versioningStatus:t.Optional(t.Enum(["Enabled","Disabled","Suspended","Not configured"]))}),zK=t.Object({domainName:t.Optional(t.String()),origins:t.Optional(t.Array(t.String()))}),YK=t.Object({allocatedStorageGib:t.Optional(t.Number()),encryptedAtRest:t.Optional(t.Boolean()),engine:t.Optional(t.String()),dynamoDbItemCount:t.Optional(t.Number()),dynamoDbActualSizeGib:t.Optional(t.Number())}),VK=t.Object({version:t.Optional(t.String()),virtualNetworkId:t.Optional(t.String()),subnets:t.Optional(t.Array(t.String()))}),QK=t.Object({artifactRegistryFormat:t.Optional(t.Enum(["FORMAT_UNSPECIFIED","DOCKER","MAVEN","NPM","APT","YUM","PYTHON","KFP","GO","GENERIC"])),uri:t.Optional(t.String()),tagMutability:t.Optional(t.Enum(["MUTABLE","IMMUTABLE"])),scanOnPush:t.Optional(t.Boolean()),encryptionType:t.Optional(t.String())}),WK=t.Object({status:t.Optional(t.String()),activeServices:t.Optional(t.Number()),pendingTasks:t.Optional(t.Number()),runningTasks:t.Optional(t.Number()),registeredContainerInstances:t.Optional(t.Number()),capacityProviders:t.Optional(t.Array(t.String()))}),ZK=t.Object({status:t.Optional(t.String()),desiredStatus:t.Optional(t.String()),healthStatus:t.Optional(t.String()),availabilityZone:t.Optional(t.String()),startedAt:t.Optional(T())}),XK=t.Object({isEncrypted:t.Optional(t.Boolean()),ownerId:t.Optional(t.String()),state:t.Optional(t.Enum(["creating","available","deleting","deleted","error","updating"]))}),JK=t.Object({type:t.Optional(t.String()),osType:t.Optional(t.String()),subnetIds:t.Optional(t.Array(t.String())),nbContainers:t.Optional(t.Number())}),e2=t.Object({digest:t.String(),imageTags:t.Array(t.String()),imageSizeBytes:t.Optional(t.Number()),imagePushedAt:t.Optional(T()),mediaType:t.Optional(t.String()),repositoryName:t.String(),repositoryId:t.Optional(t.String()),scanStatus:t.Optional(t.String())}),t2=t.Object({url:t.Optional(t.String()),maxMessageSizeBytes:t.Optional(t.Number()),messageRetentionHours:t.Optional(t.Number())}),r2=t.Object({runtime:t.Optional(t.String()),memoryAllocationMib:t.Optional(t.Number()),timeoutMs:t.Optional(t.Number()),codeSha256:t.Optional(t.String())}),n2=t.Object({kind:t.Optional(t.String())}),o2=t.Object({instanceId:t.String(),architecture:t.Optional(t.String()),instanceType:t.Optional(t.String()),operatingSystem:t.Optional(t.String()),memoryMib:t.Optional(t.Number()),vCpus:t.Optional(t.Number()),vpcId:t.Optional(t.String()),k8sClusterId:t.Optional(t.String())}),i2=t.Object({id:t.Optional(t.String()),ipCidrBlocks:t.Array(t.String())}),a2=t.Object({protocol:t.Optional(Hd),port:t.Optional(t.Number()),instanceProtocol:t.Optional(Hd),instancePort:t.Optional(t.Number())}),s2=t.Object({protocol:t.Optional(t.String()),ports:t.Optional(t.Array(t.String())),portRange:t.Optional(t.String()),allPorts:t.Optional(t.Boolean())}),c2=t.Object({name:t.String(),ip:t.Optional(t.String()),type:t.Enum(["public","private"])}),p2=t.Object({type:t.String(),name:t.String()}),u2=t.Object({frontendIp:t.Optional(c2),backendIpPools:t.Array(p2)}),m2=t.Object({targetId:t.String(),targetPort:t.Optional(t.Number()),targetType:t.Optional(t.Enum(["instance","ip","lambda","alb"])),healthState:t.Optional(t.String()),healthReason:t.Optional(t.String()),healthDescription:t.Optional(t.String()),availabilityZone:t.Optional(t.String())}),l2=t.Object({protocol:t.Optional(Hd),port:t.Optional(t.Number()),type:t.Optional(t.Enum(["alb","lambda","instance","ip"])),name:t.Optional(t.String()),targetGroupArn:t.Optional(t.String()),virtualNetworkId:t.Optional(t.String()),healthCheckProtocol:t.Optional(t.String()),healthCheckPort:t.Optional(t.String()),healthCheckPath:t.Optional(t.String()),healthCheckIntervalSeconds:t.Optional(t.Number()),healthCheckTimeoutSeconds:t.Optional(t.Number()),healthyThresholdCount:t.Optional(t.Number()),unhealthyThresholdCount:t.Optional(t.Number()),targets:t.Optional(t.Array(m2)),targetCount:t.Optional(t.Number()),healthyTargetCount:t.Optional(t.Number()),loadBalancerArns:t.Optional(t.Array(t.String()))}),d2=t.Object({first:t.Optional(t.String()),last:t.Optional(t.String()),scope:t.Optional(t.Number())}),f2=t.Object({type:t.Optional(t.String()),name:t.Optional(t.String()),alwaysServe:t.Optional(t.Boolean()),subnets:t.Optional(t.Array(t.Union([t.Number(),d2]))),target:t.Optional(t.String()),weight:t.Optional(t.Number()),priority:t.Optional(t.Number()),status:t.Optional(t.String())}),g2=t.Object({instanceId:t.Optional(t.String()),state:t.Optional(t.String()),reasonCode:t.Optional(t.String()),description:t.Optional(t.String())}),y2=t.Object({loadBalancerType:t.Optional(t.String()),dnsName:t.Optional(t.String()),virtualNetworkId:t.Optional(t.String()),subnetIds:t.Array(t.String()),scheme:t.Optional(t.String()),listeners:t.Optional(t.Union([t.Array(a2),t.Array(s2)])),targets:t.Optional(t.Union([t.Array(t.String()),t.Array(g2),t.Array(f2)])),azureLoadBalancingRules:t.Optional(t.Array(u2))}),h2=t.Object({domainName:t.Optional(t.String()),expiresAt:t.Optional(T()),inUseBy:t.Optional(t.Array(t.String())),renewalEligibility:t.Optional(t.String()),revokedAt:t.Optional(T()),status:t.Optional(t.String()),type:t.Optional(t.String())}),T2=t.Object({state:t.Optional(t.Enum(["creating","available","deleting","deleted","error","in-use"])),volumeType:t.Optional(t.Enum(["gp2","gp3","io1","io2","st1","sc1","standard"]))}),E2=t.Object({osType:t.Optional(t.Enum(["Windows","Linux"]))}),_2=t.Object({state:t.Optional(t.String()),volumeType:t.Optional(t.String())}),I2=t.Intersect([t.Object({isEncrypted:t.Optional(t.Boolean()),sizeGib:t.Optional(t.Number())}),t.Union([T2,_2,E2])]),b2=t.Object({instanceCount:t.Optional(t.Number()),hostnames:t.Optional(t.Array(t.String())),runtime:t.Optional(t.String())}),Ep=t.Union([t.Object({category:t.Literal("application"),resourceType:t.Literal("webService"),attributes:t.Optional(b2)}),t.Object({category:t.Literal("data"),resourceType:t.Literal("bucket"),attributes:t.Optional(KK)}),t.Object({category:t.Literal("data"),resourceType:t.Literal("messagingService"),attributes:t.Optional(t2)}),t.Object({category:t.Literal("data"),resourceType:t.Literal("fileSystem"),attributes:t.Optional(XK)}),t.Object({category:t.Literal("data"),resourceType:t.Literal("contentDeliveryNetwork"),attributes:t.Optional(zK)}),t.Object({category:t.Literal("data"),resourceType:t.Literal("database"),attributes:t.Optional(YK)}),t.Object({category:t.Literal("data"),resourceType:t.Literal("storageAccount"),attributes:t.Optional(n2)}),t.Object({category:t.Literal("data"),resourceType:t.Literal("volume"),attributes:t.Optional(I2)}),t.Object({category:t.Literal("compute"),resourceType:t.Literal("virtualMachine"),attributes:t.Optional(o2)}),t.Object({category:t.Literal("compute"),resourceType:t.Literal("serverless"),attributes:t.Optional(r2)}),t.Object({category:t.Literal("container"),resourceType:t.Literal("kubernetesCluster"),attributes:t.Optional(VK)}),t.Object({category:t.Literal("container"),resourceType:t.Literal("containerRepository"),attributes:t.Optional(QK)}),t.Object({category:t.Literal("container"),resourceType:t.Literal("containerCluster"),attributes:t.Optional(WK)}),t.Object({category:t.Literal("container"),resourceType:t.Literal("containerServiceTask"),attributes:t.Optional(ZK)}),t.Object({category:t.Literal("container"),resourceType:t.Literal("containerService"),attributes:t.Optional(JK)}),t.Object({category:t.Literal("container"),resourceType:t.Literal("containerImage"),attributes:t.Optional(e2)}),t.Object({category:t.Literal("network"),resourceType:t.Literal("virtualNetwork"),attributes:t.Optional(i2)}),t.Object({category:t.Literal("network"),resourceType:t.Literal("loadBalancer"),attributes:y2}),t.Object({category:t.Literal("network"),resourceType:t.Literal("targetGroup"),attributes:t.Optional(l2)}),t.Object({category:t.Literal("network"),resourceType:t.Literal("certificate"),attributes:t.Optional(h2)})],{description:"Normalized public inventory category, resource type, and category-specific attributes. Attribute shape depends on the category and resourceType combination."});var ro="/v0/inventory",es=["aws","gcp","azure"],uP=["scan_in_progress","success","failure","partial"],Yd=t.Object({id:t.String({description:"Identifier of the inventory resource. Generated by Tsuga."}),cloudPlatform:t.Enum(es,{description:"Cloud platform where Tsuga discovered this resource."}),cloudAccount:t.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:t.Optional(t.String({description:"Cloud region where Tsuga discovered this resource, when the resource is regional."})),fullyQualifiedResourceId:t.String({description:"Cloud-native unique identifier for this resource, such as an AWS ARN, GCP resource name, or Azure resource ID."}),displayName:t.String({description:"Human-readable resource name shown in Tsuga. Derived from cloud provider metadata when available."}),nativeResourceType:t.String({description:"Cloud-native resource type reported by the inventory integration, for example `aws_ec2_instance` or `gcp_bucket`."}),resourceCreatedAt:t.Optional(T({description:"Timestamp when the resource was created in the cloud, when known."})),resourceUpdatedAt:t.Optional(T({description:"Timestamp when the resource was last updated in the cloud, when known."})),resourceLastSeenAt:T({description:"Timestamp when Tsuga last observed this resource during an inventory scan."}),tags:ke,nativeAttributes:t.Optional(t.Unsafe({type:"object",additionalProperties:!0})),covered:t.Optional(t.Boolean({description:"Whether the resource is covered by the configured infrastructure-as-code identifiers"}))}),yi={DISPLAY_NAME:"displayName",CLOUD_ACCOUNT:"cloudAccount",NATIVE_RESOURCE_TYPE:"nativeResourceType",CLOUD_REGION:"cloudRegion",RESOURCE_TYPE:"resourceType",RESOURCE_CREATED_AT:"resourceCreatedAt"},mP=t.Object({cloudPlatforms:je(t.Enum(es),{description:"Restrict results to resources discovered on any of these cloud platforms",maxItems:es.length}),cloudAccounts:je(p({allowEmpty:!1}),{description:"Restrict results to resources in any of these cloud accounts",maxItems:500}),cloudRegions:je(p({allowEmpty:!1}),{description:"Restrict results to resources in any of these cloud regions",maxItems:500}),nativeResourceTypes:je(t.Enum(Ja),{description:"Restrict results to resources of any of these cloud-native resource types",maxItems:Ja.length}),resourceTypes:je(t.Enum(Kd),{description:"Restrict results to resources of any of these normalized resource types",maxItems:Kd.length}),tags:je(Yt.items,{description:"Restrict results to resources that have at least one of the listed key/value tags",maxItems:50}),isIacManaged:t.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:t.Object({value:p({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:t.Optional(t.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"}),Vd=t.Partial(t.Object({...Q,filters:t.Partial(mP,{description:"Filters applied to narrow the returned resources."}),sort:t.Object({by:t.Enum([yi.DISPLAY_NAME,yi.CLOUD_ACCOUNT,yi.NATIVE_RESOURCE_TYPE,yi.CLOUD_REGION,yi.RESOURCE_TYPE,yi.RESOURCE_CREATED_AT],{description:"Field to sort the returned resources by"}),direction:t.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."})})),aYe=d({tags:["inventory"],method:"POST",url:`${ro}/resources/query`,paginated:!0,body:Vd,response:t.Array(t.Intersect([Yd,Ep]))}),S2=["resourceType","cloudAccount","isIacManaged"],sYe=d({tags:["inventory"],method:"POST",url:`${ro}/resources/counts`,body:t.Object({filters:t.Optional(t.Partial(mP)),groupBy:t.Enum(S2,{description:"Dimension to group the resource counts by."})}),response:t.Array(t.Object({value:t.String({description:'The group value the count belongs to: a resource type, a cloud account id, or "true"/"false" for IaC coverage.'}),count:t.Integer({description:"Number of resources in this group matching the requested filters."})}))}),cYe=d({tags:["inventory"],method:"GET",url:`${ro}/resources/filter-options`,response:t.Object({cloudRegions:t.Array(t.String(),{description:"Distinct cloud regions present across the tenant's resources."}),nativeResourceTypes:t.Array(t.String(),{description:"Distinct cloud-native resource types present across the tenant's resources."}),tags:zt})}),pYe=I("type",[t.Object({type:t.Literal("aws",{description:"Discriminator identifying AWS connection settings."}),accountId:t.String({description:"AWS account ID that Tsuga scans."}),externalId:t.String({description:"External ID Tsuga passes when assuming the cross-account IAM role."}),roleArn:t.String({description:"ARN of the IAM role Tsuga assumes to read inventory in the account."})}),t.Object({type:t.Literal("gcp",{description:"Discriminator identifying GCP connection settings."}),projectId:t.String({description:"GCP project ID that Tsuga scans."}),serviceAccountId:t.String({description:"Service account Tsuga impersonates to read inventory."}),workloadIdentityProvider:t.String({description:"Workload identity provider resource name used for federated authentication."})}),t.Object({type:t.Literal("azure",{description:"Discriminator identifying Azure connection settings."}),clientId:t.String({description:"Client ID of the Azure application Tsuga authenticates as."}),subscriptionId:t.String({description:"Azure subscription ID that Tsuga scans."}),tenantId:t.String({description:"Azure tenant ID that owns the subscription."})})]),O2="^[0-9]{12}$",A2="^arn:aws[a-z-]*:iam::[0-9]{12}:role/.+$",x2="^[a-z][a-z0-9-]{4,28}[a-z0-9]$",R2="^[^@\\s]+@[^@\\s]+\\.iam\\.gserviceaccount\\.com$",C2="^//iam\\.googleapis\\.com/projects/[0-9]+/locations/global/workloadIdentityPools/[^/]+/providers/[^/]+$",zd="^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$",P2=t.Object({type:t.Literal("aws",{description:"Discriminator identifying AWS connection settings."}),accountId:t.String({pattern:O2,description:"AWS account ID that Tsuga scans.",errorMessage:{pattern:"Must be a 12-digit AWS account ID."}}),externalId:p({allowEmpty:!1,description:"External ID Tsuga passes when assuming the cross-account IAM role."}),roleArn:t.String({pattern:A2,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"}),U2=t.Object({type:t.Literal("gcp",{description:"Discriminator identifying GCP connection settings."}),projectId:t.String({pattern:x2,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:t.String({pattern:R2,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:t.String({pattern:C2,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"}),w2=t.Object({type:t.Literal("azure",{description:"Discriminator identifying Azure connection settings."}),clientId:t.String({pattern:zd,minLength:1,description:"Client ID of the Azure application Tsuga authenticates as (GUID).",errorMessage:{pattern:"Must be a GUID."}}),subscriptionId:t.String({pattern:zd,minLength:1,description:"Azure subscription ID that Tsuga scans (GUID).",errorMessage:{pattern:"Must be a GUID."}}),tenantId:t.String({pattern:zd,minLength:1,description:"Azure tenant ID that owns the subscription (GUID).",errorMessage:{pattern:"Must be a GUID."}})},{$id:"AzureConnectionSettings"}),lP=I("type",[P2,U2,w2],{description:"Credentials Tsuga uses to scan the account, in the provider-specific shape selected by `type`. Credentials are stored as provided and are not validated at creation time; failures surface through `lastScanStatus`."}),hi=t.Object({id:t.String({description:"Identifier of the cloud account. Generated by Tsuga."}),cloudType:t.Enum(es,{description:"Cloud provider of the account."}),cloudAccountId:t.String({description:"Cloud-native account identifier: an AWS account ID, GCP project ID, or Azure subscription ID."}),accountFriendlyName:t.Optional(t.String({description:"Human-readable name for the account shown in Tsuga."})),organizationId:t.Optional(t.String({description:"Cloud organization identifier, when known."})),createdBy:t.Optional(t.String({description:"Identifier of the user who created the account, when created by a user."})),createdAt:T({description:"Timestamp when the account was registered in Tsuga."}),lastScanStartedAt:t.Optional(T({description:"Timestamp when the most recent inventory scan started."})),lastScanFinishedAt:t.Optional(T({description:"Timestamp when the most recent inventory scan finished."})),lastScanStatus:t.Optional(t.Enum(uP,{description:"Status of the most recent inventory scan."}))}),Qd=t.Object({cloudType:t.Enum(es,{description:"Cloud provider of the account."}),cloudAccountId:p({allowEmpty:!1,description:"Cloud-native account identifier: an AWS account ID, GCP project ID, or Azure subscription ID."}),accountFriendlyName:t.Optional(p({description:"Human-readable name for the account shown in Tsuga."})),organizationId:t.Optional(p({description:"Cloud organization identifier, when known."})),connectionSettings:lP,lastScanStatus:t.Optional(t.Enum(uP,{description:"Status of the most recent inventory scan."}))}),no=`${ro}/cloud-accounts`,uYe=d({tags:["inventory"],url:no,method:"GET",response:t.Array(hi)}),mYe=d({tags:["inventory"],url:`${no}/:id`,method:"GET",params:t.Object({id:p()}),response:hi}),lYe=d({tags:["inventory"],url:no,method:"POST",body:Qd,response:hi}),Wd=t.Object({accountFriendlyName:p({description:"Human-readable name for the account shown in Tsuga."})}),dYe=d({tags:["inventory"],url:`${no}/:id`,method:"PUT",params:t.Object({id:p()}),body:Wd,response:hi}),fYe=d({tags:["inventory"],url:`${no}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),gYe=d({tags:["inventory"],url:`${ro}/trigger-scan`,method:"POST",body:t.Object({}),response:t.Object({success:t.Literal(!0)})}),yYe=d({tags:["inventory"],url:`${no}/azure/onboarding`,method:"POST",body:t.Object({tenantId:p()}),response:t.Object({subjectId:t.String(),audience:t.String()})}),hYe=d({tags:["inventory"],method:"POST",url:`${no}/validate/:type`,params:t.Object({type:p()}),body:t.Object({data:lP,id:t.Optional(p())}),response:t.Object({areAccountSettingsValid:t.Boolean(),message:t.Optional(t.String())})}),dP=`${ro}/settings`,TYe=d({tags:["inventory"],url:dP,method:"GET",response:t.Object({settings:t.Optional(t.Object({id:t.String(),infrastructureIdentifiers:t.Array(t.Object({name:t.String(),value:t.Optional(t.String())}))}))})}),N2=50,EYe=d({tags:["inventory"],url:dP,method:"POST",body:t.Object({infrastructureIdentifiers:t.Array(t.Object({name:p({allowEmpty:!1}),value:t.Optional(p({allowEmpty:!1}))}),{maxItems:N2})}),response:t.Object({})}),_Ye=d({tags:["inventory"],url:`${ro}/iac-tags-proposal`,method:"GET",response:t.Array(t.Object({name:t.String(),value:t.Optional(t.String())}))});var fP=`/${"v1"}/inventory`,L2=t.Omit(Yd,["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)."}),gP=t.Intersect([L2,Ep],{$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)."}),v2={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(gP,{examples:[v2]});var yP=d({description:"Queries cloud resources discovered by inventory scans, with optional filters, sorting, and pagination. Use this endpoint to build infrastructure inventories across connected cloud accounts.",operationId:"queryInventoryResources",tags:["inventory"],url:`${fP}/resources/query`,method:"POST",paginated:!0,body:Vd,response:t.Array(gP)}),ts=`${fP}/cloud-accounts`,rs=t.Pick(hi,["id","cloudType","cloudAccountId","accountFriendlyName"],{$id:"CloudAccount"}),k2={id:"123-456-abc",cloudType:"aws",cloudAccountId:"123456789012",accountFriendlyName:"Production AWS"};Object.assign(rs,{examples:[k2]});var hP=t.Pick(Qd,["cloudType","cloudAccountId","accountFriendlyName","connectionSettings"]),M2={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(hP,{examples:[M2]});var D2=t.Pick(Wd,["accountFriendlyName"]),PYe=d({description:"Lists cloud accounts connected to Tsuga that the authenticated operation key can read.",operationId:"listCloudAccounts",tags:["inventory"],url:ts,method:"GET",response:t.Array(rs)}),UYe=d({description:"Retrieves one cloud account by ID.",operationId:"getCloudAccount",tags:["inventory"],url:`${ts}/:id`,method:"GET",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the cloud account to retrieve. Use the `id` returned by the cloud account list or create operations."})}),response:rs}),wYe=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:ts,method:"POST",body:hP,response:rs}),NYe=d({description:"Updates the friendly name of a cloud account by ID.",operationId:"updateCloudAccount",tags:["inventory"],url:`${ts}/:id`,method:"PUT",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the cloud account to update. Use the `id` returned by the cloud account list or create operations."})}),body:D2,response:rs}),LYe=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:`${ts}/:id`,method:"DELETE",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the cloud account to delete. Use the `id` returned by the cloud account list or create operations."})}),response:R});var ns="/v0/investigations",G2=["dashboard","monitor","service","slo","log-route"],$2=t.Object({type:t.String({description:'Kind of linked asset, e.g. "dashboard"'}),id:t.String({description:"Identifier of the linked asset"})}),j2=t.Object({type:t.Enum(G2,{description:"Kind of linked asset"}),id:p({allowEmpty:!1,description:"Identifier of the linked asset"})}),Nr=t.Object({id:t.String({description:"Identifier of the investigation"}),name:t.String({description:"Human readable name shown for the investigation"}),slug:t.Optional(t.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:t.Optional(t.String({description:"Markdown content capturing the investigation notes and findings"})),tags:ke,owner:t.String({description:"Team ID owning the investigation"}),env:t.Optional(t.String({description:'Environment the investigation relates to, e.g. "prod"'})),linkedAssets:t.Array($2,{description:"Assets (dashboards, monitors, \u2026) referenced by this investigation"}),creator:t.Optional(ue),updater:t.Optional(ue),createdAt:T({description:"Timestamp the investigation was created at."}),updatedAt:T({description:"Timestamp the investigation was last updated at."})},{title:"Investigation"}),_p=t.Object({name:p({allowEmpty:!1,description:"Human readable name shown for the investigation"}),slug:p({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:t.Optional(p({type:"long",description:"Markdown content capturing the investigation notes and findings"})),tags:Ve,owner:p({allowEmpty:!1,description:"Team ID owning the investigation"}),env:t.Optional(p({allowEmpty:!0,description:"Environment the investigation relates to"})),linkedAssets:t.Optional(t.Array(j2,{maxItems:100,description:"Assets (dashboards, monitors, \u2026) referenced by this investigation"}))}),Zd=t.Object(t.Omit(_p,["slug"]).properties),qYe=d({tags:["investigations"],url:ns,method:"GET",paginated:!0,query:t.Object(Q),response:t.Array(Nr)}),BYe=d({tags:["investigations"],url:`${ns}/:id`,params:t.Object({id:p()}),method:"GET",response:Nr}),FYe=d({tags:["investigations"],url:ns,method:"POST",body:_p,response:Nr}),HYe=d({tags:["investigations"],url:`${ns}/:id`,method:"PUT",body:Zd,params:t.Object({id:p()}),response:Nr}),KYe=d({tags:["investigations"],url:`${ns}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R});var os=`/${"v1"}/investigations`,TP=d({description:"Retrieve all investigations",tags:["private"],url:os,method:"GET",paginated:!0,query:t.Object(Q),response:t.Array(Nr)}),EP=d({description:"Retrieve an investigation by its id",tags:["private"],url:`${os}/:id`,method:"GET",params:t.Object({id:p({allowEmpty:!1})}),response:Nr}),_P=d({description:"Create a new investigation",tags:["private"],url:os,method:"POST",body:_p,response:Nr}),IP=d({description:"Update an investigation by its id",tags:["private"],url:`${os}/:id`,method:"PUT",body:Zd,params:t.Object({id:p({allowEmpty:!1})}),response:Nr}),bP=d({description:"Delete an investigation by its id",tags:["private"],url:`${os}/:id`,method:"DELETE",params:t.Object({id:p({allowEmpty:!1})}),response:R});var is=`/${"v1"}/monitors`,as=t.Pick(Cr,["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)."}),OP={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:[]},AP={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:[]},xP={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:[]},RP={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:[]},q2={id:"123-456-abc",...OP},B2={id:"234-567-bcd",...AP},F2={id:"345-678-cde",...xP},H2={id:"456-789-def",...RP};Object.assign(as,{examples:[q2,B2,F2,H2]});var SP=t.Pick(ad,["filters","sort","limit","offset"]),CP=t.Object({...SP.properties,filters:SP.properties.filters},{description:"Monitor query request. Use filters, sorting, limit, and offset to page through visible monitors."}),K2={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(CP,{examples:[K2]});var PP=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:`${is}/query`,method:"POST",paginated:!0,body:CP,response:t.Array(as)}),UP=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:`${is}/:id`,method:"GET",params:t.Object({id:p({allowEmpty:!1,description:"Monitor ID returned by monitor query, create, or update operations."})}),response:as}),wP=["name","message","tags","configuration","priority","owner","dashboardId","permissions","clusterIds"],NP=t.Pick(ka,wP,{$id:"CreateMonitorRequest",description:"Monitor creation request. Provide ownership, data access, alert configuration, priority, tags, and optional dashboard or cluster scope."}),LP=t.Pick(ka,wP,{$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."}),vP=OP,kP=AP,MP=xP,DP=RP;Object.assign(NP,{examples:[vP,kP,MP,DP]});Object.assign(LP,{examples:[vP,kP,MP,DP]});var GP=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:is,method:"POST",body:NP,response:as}),$P=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:`${is}/:id`,method:"PUT",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the saved monitor to update. Use the `id` returned by monitor query or create responses."})}),body:LP,response:as}),z2=t.Object({id:p({allowEmpty:!1,description:"Identifier of the saved monitor to delete. Use the `id` returned by monitor query, create, or update responses."})}),jP=d({description:"Deletes a monitor by ID. Deleting a monitor stops future evaluations and alert transitions for that monitor.",operationId:"deleteMonitor",tags:["monitors"],url:`${is}/:id`,method:"DELETE",params:z2,response:R});var ss=`/${"v1"}/notification-rules`,cs=t.Pick(ni,["id","name","queryString","teamsFilter","prioritiesFilter","transitionTypesFilter","clusterIdsFilter","owner","isActive","tags","targets"],{$id:"Rule",description:"Notification rule that matches alert transitions and routes notifications to one or more targets. See [Rules](/documentation/alert/notifications/rules)."}),qP={name:"Critical Alerts",queryString:"env:prod service:api",teamsFilter:{type:"all-public-teams"},prioritiesFilter:[1,2],transitionTypesFilter:["triggered","resolved"],clusterIdsFilter:[],owner:"team-123-abc",isActive:!0,tags:[{key:"channel",value:"alerts"}],targets:[{id:"789-abc-def",rateLimit:{maxMessages:10,minutes:5},renotifyConfig:{mode:"each",renotificationStates:["alert"],renotifyIntervalMinutes:30},config:{type:"email",addresses:["oncall@example.com"]}}]},Y2={id:"123-456-abc",...qP};Object.assign(cs,{examples:[Y2]});var BP=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:ss,method:"GET",paginated:!0,query:t.Object(Q),response:t.Array(cs)}),FP=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:`${ss}/:id`,method:"GET",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the notification rule to retrieve. Use the `id` returned by notification rule list or create responses."})}),response:cs}),Xd=t.Pick(Ga,["name","queryString","teamsFilter","prioritiesFilter","transitionTypesFilter","clusterIdsFilter","owner","tags","isActive","targets"],{description:"Notification rule create or update request. Provide matching filters, owner, tags, active state, and delivery targets."}),V2=qP;Object.assign(Xd,{examples:[V2]});var HP=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:ss,method:"POST",body:Xd,response:cs}),KP=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:`${ss}/:id`,method:"PUT",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the notification rule to update. Use the `id` returned by notification rule list, get, or create responses."})}),body:Xd,response:cs}),Q2=t.Object({id:p({allowEmpty:!1,description:"Identifier of the notification rule to delete. Use the `id` returned by notification rule list, get, create, or update responses."})}),zP=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:`${ss}/:id`,method:"DELETE",params:Q2,response:R});var Ti=`${ti}/silences`,YP=t.Union([t.Literal("monday"),t.Literal("tuesday"),t.Literal("wednesday"),t.Literal("thursday"),t.Literal("friday"),t.Literal("saturday"),t.Literal("sunday")]),W2=t.Partial(t.Record(YP,t.Array(t.Object({startTime:t.String({format:Qu,description:"Local start time for this recurring silence window on this day, using the schedule time zone."}),endTime:t.String({format:Qu,description:"Local end time for this recurring silence window on this day. It must be after `startTime`, and ranges on the same day cannot overlap."})},{title:"SilenceTimeRange"}),{minItems:1,description:"Silence windows for this day. Each window uses the schedule time zone, and windows on the same day cannot overlap."})),{description:"Recurring silence windows keyed by day of week, evaluated in the schedule `timeZone` or in UTC when it is omitted. At least one day must be listed, and a day with no entry is never silenced. Each window covers `startTime` up to but not including `endTime`."}),Z2=t.Partial(t.Record(YP,t.Array(t.Object({startTime:t.String({description:"Local start time for this recurring silence window on this day, using the schedule time zone."}),endTime:t.String({description:"Local end time for this recurring silence window on this day. It must be after `startTime`, and ranges on the same day cannot overlap."})},{title:"SilenceTimeRange"}),{description:"Silence windows for this day. Each window uses the schedule time zone, and windows on the same day cannot overlap."})),{description:"Recurring silence windows keyed by day of week, evaluated in the schedule `timeZone` or in UTC when it is omitted. A day with no entry is never silenced. Each window covers `startTime` up to but not including `endTime`."}),Ip='IANA timezone identifier (e.g. "America/New_York"). Defaults to UTC if omitted.',VP="One-time silence schedule with specific start and end times",QP="Recurring weekly silence schedule",X2=I("type",[t.Object({type:t.Literal("one-time",{description:"Silence active once between the configured start and end times."}),startTime:t.String({format:Wu,description:"Local start date and time for the one-time silence, interpreted in `timeZone` when provided."}),endTime:t.String({format:Wu,description:"Local end date and time for the one-time silence. It must be after `startTime` and in the future."}),timeZone:t.Optional(t.String({format:Vu,description:Ip}))},{$id:"InputSilenceScheduleOneTime",description:VP}),t.Object({type:t.Literal("recurring",{description:"Silence active on a recurring weekly schedule."}),weeklySchedule:W2,timeZone:t.Optional(t.String({format:Vu,description:Ip}))},{$id:"InputSilenceScheduleRecurring",description:QP})],{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."}),J2=I("type",[t.Object({type:t.Literal("one-time",{description:"Silence active once between the configured start and end times."}),startTime:t.String({description:"Local start date and time for the one-time silence, interpreted in `timeZone` when provided."}),endTime:t.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:t.Optional(t.String({description:Ip}))},{$id:"OutputSilenceScheduleOneTime",description:VP}),t.Object({type:t.Literal("recurring",{description:"Silence active on a recurring weekly schedule."}),weeklySchedule:Z2,timeZone:t.Optional(t.String({description:Ip}))},{$id:"OutputSilenceScheduleRecurring",description:QP})],{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."}),bp=t.Object({name:p({description:"Display name of the silence"}),reason:p({allowEmpty:!1,type:"long",description:"Free-text explanation of why notifications are being silenced, shown to other operators reviewing active silences."}),owner:p({allowEmpty:!1,description:"Team ID that owns and manages the silence"}),tags:Ve,isActive:t.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:X2,notificationRuleIds:t.Optional(t.Array(p(),{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:t.Optional(p({type:"tags-query",description:"Query string to filter which alerts this silence applies to"})),teamsFilter:gd,prioritiesFilter:t.Array(t.Enum(dt),{maxItems:dt.length,description:"Monitor priorities that must match for this silence to apply. An empty array matches every priority."}),transitionTypesFilter:t.Array(t.Enum(Xn),{maxItems:Xn.length,description:"Alert state transitions that must match for this silence to apply. An empty array matches every transition type."})}),Ei=t.Object({id:t.String({description:"Tsuga-generated notification silence ID assigned when the silence is created."}),name:t.String({description:"Display name of the silence"}),reason:t.String({description:"Free-text explanation of why notifications are being silenced, shown to other operators reviewing active silences."}),owner:t.String({description:"Team ID that owns and manages the silence"}),tags:ke,isActive:t.Boolean({description:"Whether the silence suppresses matching notifications while its schedule is active. When false, the silence is kept but never suppresses anything."}),schedule:J2,notificationRuleIds:t.Optional(t.Array(t.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:t.Optional(t.String({description:"Query string filtering which alerts this silence applies to"})),teamsFilter:fd,prioritiesFilter:t.Array(t.Enum(dt),{description:"Monitor priorities that must match for this silence to apply. An empty array matches every priority."}),transitionTypesFilter:t.Array(t.Enum(Xn),{description:"Alert state transitions that must match for this silence to apply. An empty array matches every transition type."}),createdAt:T(),updatedAt:T(),creator:t.Optional(ue),updater:t.Optional(ue)}),SVe=d({tags:["notification-silences"],url:Ti,method:"GET",response:t.Array(Ei)}),OVe=d({tags:["notification-silences"],url:`${Ti}/:id`,params:t.Object({id:p()}),method:"GET",response:Ei}),AVe=d({tags:["notification-silences"],url:Ti,method:"POST",body:bp,response:Ei}),xVe=d({tags:["notification-silences"],url:`${Ti}/:id`,method:"PUT",params:t.Object({id:p()}),body:bp,response:Ei}),RVe=d({tags:["notification-silences"],url:`${Ti}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),CVe=d({tags:["notification-silences"],url:`${Ti}/bulk-delete`,method:"DELETE",body:t.Object({ids:t.Array(p())}),response:t.Object({})});var ps=`/${"v1"}/notification-silences`,us=t.Pick(Ei,["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)."}),ez={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"]},tz={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(us,{examples:[ez,tz]});var WP=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:ps,method:"GET",response:t.Array(us)}),ZP=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:`${ps}/:id`,method:"GET",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the notification silence to retrieve. Use the `id` returned by notification silence list or create responses."})}),response:us}),Jd=t.Pick(bp,["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."}),rz={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"]},nz={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(Jd,{examples:[rz,nz]});var XP=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:ps,method:"POST",body:Jd,response:us}),JP=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:`${ps}/:id`,method:"PUT",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the notification silence to update. Use the `id` returned by notification silence list, get, or create responses."})}),body:Jd,response:us}),oz=t.Object({id:p({allowEmpty:!1,description:"Identifier of the notification silence to delete. Use the `id` returned by notification silence list, get, create, or update responses."})}),eU=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:`${ps}/:id`,method:"DELETE",params:oz,response:R});var iz={critical:3,important:2,normal:1},ie=e=>({label:e,weight:iz[e]}),az={"unrouted-logs":{key:"unrouted-logs",title:"Logs with no matching route",summary:"Any log that reaches processing without a matched route is flagged.",rationale:"Close gaps by ensuring each event flows through a governed route.",objectType:"route",category:"observability-assets",impact: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:"route",category:"observability-assets",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:"route",category:"observability-assets",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:`${ep} present`,summary:`Logs and spans must populate ${ep} with a non-empty value.`,rationale:"Core identifier used to correlate telemetry across services.",objectType:"resource",category:"telemetry-hygiene",impact:ie("critical"),recommendation:`Populate ${ep} 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:`${va} presence`,summary:`Logs and spans must populate ${va} with a non-empty value.`,rationale:"Core identifier used to correlate telemetry across services.",objectType:"resource",category:"telemetry-hygiene",impact:ie("important"),recommendation:`Populate ${va} 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:"telemetry-hygiene",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:"dashboard",category:"observability-assets",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:"monitor",category:"observability-assets",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:"telemetry-adoption",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:"dashboard",category:"observability-assets",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:"dashboard",category:"telemetry-adoption",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:"monitor",category:"observability-assets",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:"monitor",category:"observability-assets",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:"monitor",category:"observability-assets",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:"monitor",category:"observability-assets",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:"monitor",category:"observability-assets",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:"dashboard",category:"observability-assets",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:"api-key",category:"observability-assets",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:"api-key",category:"observability-assets",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 ${Zx} 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"}},sz=new Set(["azure_container_registry","azure_container_registry_image","azure_app_service_certificate","azure_virtual_network"]),cz=Ja.filter(e=>e.startsWith("azure_")&&!sz.has(e)),tU={"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:cz,metricPrefixes:["azure_"]}},pz=Object.fromEntries(Object.keys(tU).map(e=>{let{label:r,source:n}=tU[e];return[e,{key:e,title:`${r} metrics collected`,summary:`${r} 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 ${r} metrics are ingested.`,scope:"global"}]})),uz={...az,...pz},rU=Object.values(uz);var nU=["passed","failed","ignored"],mz=t.Enum(nU,{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."}),lz=["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"],tf=["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",...lz],dz=t.Enum(tf),fz=["log","metric","resource","span","api-key","dashboard","monitor","route"],gz=["collection-coverage","telemetry-hygiene","observability-assets","telemetry-adoption"],yz=["critical","important","normal"],hz=["team","global"],rf=t.Object({key:t.Enum(tf),title:t.String(),summary:t.String(),rationale:t.String(),objectType:t.Enum(fz),category:t.Enum(gz),impact:t.Object({label:t.Enum(yz),weight:t.Number()}),recommendation:t.String(),scope:t.Optional(t.Enum(hz))}),oU=t.Object({type:t.String({description:"Tsuga asset kind referenced by this example (e.g. `monitor`)"}),label:t.String({description:"Human-readable summary of the example"}),link:t.Object({to:t.String({description:"In-app route the example deep-links to"}),search:t.Optional(t.Unknown({description:"Search-query payload for the deep link"})),params:t.Optional(t.Unknown({description:"Route params for the deep link"}))},{description:"In-app deep link to inspect the example"})}),ef=t.Intersect([rf,t.Object({status:mz,normalizedScore:t.Number(),details:t.Optional(t.Record(t.String(),t.Unknown())),recommendation:t.Optional(t.String()),examples:t.Optional(t.Array(oU))})]),Tz=t.Object({generatedAt:t.String(),overallScore:t.Optional(t.Number()),rules:t.Array(rf),teamResults:t.Array(t.Object({teamId:t.String(),teamName:t.String(),teamWeight:t.Number(),score:t.Number(),weightedScore:t.Number(),totalWeight:t.Number(),ruleResults:t.Array(ef)})),globalResults:t.Optional(t.Object({score:t.Optional(t.Number()),ruleResults:t.Array(ef)}))}),nf=t.Object({id:t.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:t.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:t.Enum(tf,{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:t.Optional(t.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:t.Enum(nU,{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:t.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:t.Number({description:"Impact weight of this rule, captured at report-generation time. Set by Tsuga from the rule's impact label: 1 for normal, 2 for important, 3 for critical. Used with score to compute reportOverallScore."}),reportOverallScore:t.Number({description:"Aggregate score for this row's report group. Calculated by Tsuga from non-ignored rows in the same team or global cluster-wide report. Returned on every row in that group with the same value."}),reportTotalWeight:t.Number({description:"Sum of non-ignored rule weights for this row's report group. Calculated by Tsuga when the report is generated. Returned on every row in that group with the same value."}),recommendation:t.Optional(t.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:t.Optional(t.Array(oU,{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:t.String({description:"ISO timestamp the row was generated at"})}),HVe=d({tags:["quality-reports"],url:"/v0/quality-reports",method:"POST",response:Tz}),of=t.Optional(p({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."})),KVe=d({tags:["quality-reports"],url:"/v0/quality-reports/latest",method:"GET",query:t.Object({clusterId:of,team:t.Optional(p({allowEmpty:!1}))}),response:t.Array(nf,{description:"Latest persisted rule evaluation rows for the cluster"})}),zVe=d({tags:["quality-reports"],url:"/v0/quality-reports/preview",method:"POST",body:t.Object({ruleKey:dz,teamId:t.Optional(p({allowEmpty:!1})),lookbackMinutes:t.Optional(t.Integer({minimum:1,maximum:60})),clusterId:t.Optional(p({allowEmpty:!1}))}),response:t.Object({rule:rf,result:ef,teamId:t.Optional(t.String()),teamName:t.Optional(t.String())})}),YVe=new Map(rU.map(e=>[e.key,e]));var Ez=`/${"v1"}/quality-reports`,iU=t.Pick(nf,["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)."}),_z={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(iU,{examples:[_z]});var Iz=t.Object({clusterId:of,team:t.Optional(p({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."}),aU=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:`${Ez}/latest`,method:"GET",query:Iz,response:t.Array(iU)});var ms="/v0/admin-center";var mr=`${ms}/retention-policies`,sU=3650,bz=t.Integer({description:"Number of days Tsuga retains matching telemetry."}),cU=t.Integer({minimum:1,maximum:sU,description:`Number of days Tsuga should retain matching telemetry. Valid values are 1 through ${sU}.`}),Lr=t.Object({id:t.String({description:"Unique identifier of the retention policy. Generated by Tsuga."}),env:t.Optional(t.String({description:"Environment tag value this policy applies to. Omitted policies apply across environments unless a more specific policy exists."})),teamId:t.Optional(t.String({description:"Team ID this policy applies to. Omitted policies apply globally unless a team-specific policy exists."})),dataSource:t.Enum(sr,{description:"Telemetry signal retained by this policy: logs, metrics, traces or rum."}),durationDays:bz,isEnabled:t.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."})}),Sp=t.Object({env:t.Optional(p({description:"Environment tag value this policy applies to. Omit for a policy that is not environment-specific."})),teamId:t.Optional(p({description:"Team ID this policy applies to. Omit for a policy that is not team-specific."})),dataSource:t.Enum(sr,{description:"Telemetry signal retained by this policy: logs, metrics, traces or rum."}),durationDays:cU,isEnabled:t.Boolean({description:"Set to true for the policy to participate in retention resolution."})}),pU=t.Array(t.Object({env:p(),dataSource:t.Enum(sr),durationDays:t.Union([cU,t.Null()]),isEnabled:t.Boolean()})),uU=t.Object({inserted:t.Array(Lr),updated:t.Array(Lr),deleted:t.Array(Lr)}),c5e=d({tags:["retention-policies"],url:mr,method:"POST",body:Sp,response:Lr}),p5e=d({tags:["retention-policies"],url:mr,method:"GET",response:t.Array(Lr)}),u5e=d({tags:["retention-policies"],url:`${mr}/:id`,method:"GET",params:t.Object({id:p()}),response:Lr}),m5e=d({tags:["retention-policies"],url:`${mr}/:id`,method:"PUT",params:t.Object({id:p()}),body:Sp,response:Lr}),l5e=d({tags:["retention-policies"],url:`${mr}/bulk-update`,method:"POST",body:pU,response:uU}),d5e=d({tags:["retention-policies"],url:`${mr}/bulk-update-for-team`,method:"POST",body:t.Object({teamId:p(),policies:pU}),response:uU}),f5e=d({tags:["retention-policies"],url:`${mr}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),ls=["past-24-hours","past-7-days","past-30-days"],g5e=d({tags:["retention-policies"],url:`${mr}/requested-history-percentile/:teamId`,method:"POST",params:t.Object({teamId:p()}),body:t.Object({percentile:t.Number({minimum:0,maximum:1}),observationWindow:t.Enum(ls),dataSource:t.Enum(sr)}),response:t.Object({percentile:t.Number(),observationWindow:t.Enum(ls),dataSource:t.Enum(sr),teamId:t.String(),requestedHistoryDays:t.Number()})}),Sz=["1-day","3-days","7-days","1-month","6-months","more-than-6-months"];var Oz=t.Array(t.Object({bucket:t.Enum(Sz),count:t.Number()})),y5e=d({tags:["retention-policies"],url:`${mr}/requested-history-histogram/:teamId`,method:"POST",params:t.Object({teamId:p()}),body:t.Object({observationWindow:t.Enum(ls),dataSource:t.Enum(sr)}),response:t.Object({observationWindow:t.Enum(ls),dataSource:t.Enum(sr),teamId:t.String(),histogram:Oz})}),h5e=d({tags:["retention-policies"],url:`${mr}/top-teams-with-retention-surplus`,method:"POST",body:t.Object({dataSource:t.Enum(sr),observationWindow:t.Enum(ls),percentile:t.Number({minimum:0,maximum:1}),topN:t.Optional(t.Number({minimum:1,maximum:20}))}),response:t.Array(t.Object({teamId:t.String(),retentionSurplusDays:t.Number()}))});var ds=`/${"v1"}/retention-policies`,fs=t.Pick(Lr,["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)."}),Az={id:"123-456-abc",env:"production",teamId:"team-123-abc",dataSource:"logs",durationDays:30,isEnabled:!0};Object.assign(fs,{examples:[Az]});var mU=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:ds,method:"GET",response:t.Array(fs)}),lU=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:`${ds}/:id`,method:"GET",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the retention policy to retrieve. Use the `id` returned by retention policy list or create responses."})}),response:fs}),af=t.Pick(Sp,["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."}),xz={env:"production",teamId:"team-123-abc",dataSource:"logs",durationDays:30,isEnabled:!0};Object.assign(af,{examples:[xz]});var dU=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:ds,method:"POST",body:af,response:fs}),fU=d({description:"Replaces an existing retention policy by ID, including signal, scope fields, duration, and enabled state.",operationId:"updateRetentionPolicy",tags:["retention-policies"],url:`${ds}/:id`,method:"PUT",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the retention policy to update. Use the `id` returned by retention policy list, get, or create responses."})}),body:af,response:fs}),gU=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:`${ds}/:id`,method:"DELETE",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the retention policy to delete. Use the `id` returned by retention policy list, create, or update responses."})}),response:R});var yU=15,Op={id:t.String({description:"Unique identifier of the processor within the route. Used to preserve processor identity during updates."}),description:t.Optional(t.String({description:"Optional user-provided processor note."})),tags:ke,updatedAt:t.Optional(T({description:"Timestamp when Tsuga last updated the processor."}))},Ap={id:p({allowEmpty:!1,description:"Unique identifier of the processor within the route. Preserve it across updates for existing processors."}),description:t.Optional(p({type:"long",description:"Optional processor note."})),tags:Ve,updatedAt:t.Optional(T({description:"Backend-maintained timestamp for this processor. Omit this field on create and update requests; Tsuga sets or preserves it based on processor changes."}))},hU={...Op,type:t.Literal("creator",{description:"Create processor. It writes a new attribute from a format string, formula, or category rule."})},TU={...Ap,type:t.Literal("creator",{description:"Create processor. It writes a new attribute from a format string, formula, or category rule."})},Rz=I("subtype",[t.Object({targetAttribute:t.String({description:"Attribute that will receive the formatted value"}),formatString:t.String({description:"Template string used to build the target attribute value"}),overrideTarget:t.Optional(t.Boolean({description:"Whether to overwrite the target attribute when it already exists. If omitted, route processing treats this as true."})),subtype:t.Literal("format-string",{description:"Builds a string from literal text and existing attribute values."}),replaceMissingByEmpty:t.Optional(t.Boolean({description:"Whether missing referenced attributes render as empty strings. If omitted, route processing treats this as true."}))},{$id:"ProcessorParamsCreatorFormatString"}),t.Object({targetAttribute:t.String({description:"Attribute that will receive the computed value"}),formula:t.String({description:"Mathematical formula evaluated to populate the target attribute"}),overrideTarget:t.Optional(t.Boolean({description:"Whether to overwrite the target attribute when it already exists. If omitted, route processing treats this as true."})),subtype:t.Literal("math-formula",{description:"Evaluates a mathematical expression and writes the numeric result."}),replaceMissingBy0:t.Optional(t.Boolean({description:"Whether missing referenced attributes evaluate as zero. If omitted, route processing treats this as true."}))},{$id:"ProcessorParamsCreatorMathFormula"}),t.Object({targetAttribute:t.String({description:"Attribute that will receive the category value"}),clauses:t.Array(t.Object({query:t.String({description:"Query that selects logs for this category clause. Clauses are evaluated in order."}),value:t.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:t.Optional(t.String({description:"String category value used when no clause matches. If omitted and no clause matches, no category value is written."})),subtype:t.Literal("category",{description:"Assigns the first matching category value from ordered query clauses, with an optional default."})},{$id:"ProcessorParamsCreatorCategory"})],{description:"Create processor configuration. The `subtype` discriminator selects how the value written to `targetAttribute` is built and which fields are required."}),Cz=I("subtype",[t.Object({targetAttribute:p({allowEmpty:!1,description:"Attribute that will receive the formatted value"}),formatString:p({allowEmpty:!1,type:"long",description:"Template string used to build the target attribute value"}),overrideTarget:t.Optional(t.Boolean({description:"Set to true to overwrite an existing target attribute value (defaults to true)"})),subtype:t.Literal("format-string",{description:"Builds a string from literal text and existing attribute values."}),replaceMissingByEmpty:t.Optional(t.Boolean({description:"Set to true for missing referenced attributes to render as empty strings. Defaults to true."}))},{$id:"InputProcessorParamsCreatorFormatString"}),t.Object({targetAttribute:p({allowEmpty:!1,description:"Attribute that will receive the computed value"}),formula:p({allowEmpty:!1,type:"long",description:"Mathematical formula evaluated to populate the target attribute"}),overrideTarget:t.Optional(t.Boolean({description:"Set to true to overwrite an existing target attribute value (defaults to true)"})),subtype:t.Literal("math-formula",{description:"Evaluates a mathematical expression and writes the numeric result."}),replaceMissingBy0:t.Optional(t.Boolean({description:"Set to true for missing referenced attributes to evaluate as zero. Defaults to true."}))},{$id:"InputProcessorParamsCreatorMathFormula"}),t.Object({targetAttribute:p({allowEmpty:!1,description:"Attribute that will receive the category value"}),clauses:t.Array(t.Object({query:p({allowEmpty:!1,type:"tsuga-query",description:"Query that selects logs for this category clause. Clauses are evaluated in order."}),value:p({allowEmpty:!1,description:"String category value assigned when this clause matches."})}),{minItems:1,maxItems:yU,description:"Conditions evaluated in order to determine the category value. The first matching clause wins."}),defaultValue:t.Optional(p({description:"String category value used when no clause matches. If omitted and no clause matches, no category value is written."})),subtype:t.Literal("category",{description:"Assigns the first matching category value from ordered query clauses, with an optional default."})},{$id:"InputProcessorParamsCreatorCategory"})],{description:"Create processor configuration. The `subtype` discriminator selects how the value written to `targetAttribute` is built and which fields are required."}),Pz=t.Object({...hU,params:Rz}),Uz=t.Object({...TU,params:Cz}),EU={...Op,type:t.Literal("mapper",{description:"Map processor. It moves, copies, or normalizes existing log attributes."})},_U={...Ap,type:t.Literal("mapper",{description:"Map processor. It moves, copies, or normalizes existing log attributes."})},wz=I("subtype",[t.Object({attributes:t.Array(t.Object({originAttribute:t.String({description:"Attribute name to map to the target attribute"}),keepOrigin:t.Optional(t.Boolean({description:"Whether the source attribute is preserved after mapping. If omitted, route processing treats this as false."})),overrideTarget:t.Optional(t.Boolean({description:"Whether to overwrite the target attribute when it already exists. If omitted, route processing treats this as true."})),targetAttribute:t.String({description:"Attribute name that will receive the mapped value"})}),{description:"Mappings that map individual attributes to new targets"}),subtype:t.Literal("map-attributes",{description:"Copies or moves one or more source attributes to target attributes."})},{$id:"ProcessorParamsMapperMapAttributes"}),t.Object({attributeName:t.String({description:"Attribute whose value will determine the log level"}),subtype:t.Literal("map-level",{description:"Normalizes a severity or status attribute into Tsuga log levels."})},{$id:"ProcessorParamsMapperMapLevel"}),t.Object({attributeName:t.String({description:"Attribute whose value will determine the log timestamp"}),subtype:t.Literal("map-timestamp",{description:"Uses an event-time attribute as the log timestamp."})},{$id:"ProcessorParamsMapperMapTimestamp"})],{description:"Map processor configuration. The `subtype` discriminator selects whether existing attributes are copied or moved to new names, or used to set the log level or timestamp."}),Nz=I("subtype",[t.Object({attributes:t.Array(t.Object({originAttribute:p({allowEmpty:!1,description:"Attribute name to map to the target attribute"}),keepOrigin:t.Optional(t.Boolean({description:"Preserve the source attribute after mapping (defaults to false)"})),overrideTarget:t.Optional(t.Boolean({description:"Overwrite the target attribute when it already exists (defaults to true)"})),targetAttribute:p({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:t.Literal("map-attributes",{description:"Copies or moves one or more source attributes to target attributes."})},{$id:"InputProcessorParamsMapperMapAttributes"}),t.Object({attributeName:p({allowEmpty:!1,description:"Attribute whose value will determine the log level"}),subtype:t.Literal("map-level",{description:"Normalizes a severity or status attribute into Tsuga log levels."})},{$id:"InputProcessorParamsMapperMapLevel"}),t.Object({attributeName:p({allowEmpty:!1,description:"Attribute whose value will determine the log timestamp"}),subtype:t.Literal("map-timestamp",{description:"Uses an event-time attribute as the log timestamp."})},{$id:"InputProcessorParamsMapperMapTimestamp"})],{description:"Map processor configuration. The `subtype` discriminator selects whether existing attributes are copied or moved to new names, or used to set the log level or timestamp."}),Lz=t.Object({..._U,params:Nz}),vz=t.Object({...EU,params:wz}),IU={...Op,type:t.Literal("parse-attribute",{description:"Parse processor. It extracts structured fields from a text attribute."})},bU={...Ap,type:t.Literal("parse-attribute",{description:"Parse processor. It extracts structured fields from a text attribute."})},SU=5,kz=I("subtype",[t.Object({attributeName:t.String({description:"Attribute whose value will be parsed with Grok rules"}),rules:t.Array(t.String({description:"Grok rule applied to parse text. Route processing sends rules as engine patterns."}),{description:"Ordered Grok rules evaluated until one matches."}),samples:t.Optional(t.Array(t.String(),{description:"Example log lines for validating the Grok rules. Samples are not sent to the ingestion engine."})),subtype:t.Literal("grok",{description:"Extracts fields from unstructured text using ordered Grok rules."})}),t.Object({sourceAttribute:t.String({description:"Attribute containing the URL to parse"}),subtype:t.Literal("url",{description:"Parses a URL attribute and writes URL detail fields."})}),t.Object({sourceAttribute:t.String({description:"Attribute containing the user agent string to parse"}),subtype:t.Literal("user-agent",{description:"Parses a user-agent string and writes browser, operating system, and device details."})}),t.Object({sourceAttribute:t.String({description:"Attribute containing the key/value string segment to parse"}),targetAttribute:t.String({description:"Target map attribute where extracted key/value pairs will be written"}),keyValueSplitter:t.String({description:"Delimiter separating keys from values in the source string"}),pairsSplitter:t.String({description:"Delimiter separating each key/value pair in the source string."}),acceptStandaloneKey:t.Boolean({description:"Whether keys without explicit values are accepted by the parser."}),subtype:t.Literal("key-value",{description:"Parses delimited key/value text into attributes."})})],{description:"Parse processor configuration. The `subtype` discriminator selects which parser reads the source text attribute and which fields it extracts."}),Mz=I("subtype",[t.Object({attributeName:p({allowEmpty:!1,description:"Attribute whose value will be parsed with Grok rules"}),rules:t.Array(p({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:t.Optional(t.Array(p({type:"long"}),{maxItems:SU,description:"Example log lines for validating the Grok rules. Samples are not sent to the ingestion engine."})),subtype:t.Literal("grok",{description:"Extracts fields from unstructured text using ordered Grok rules."})}),t.Object({sourceAttribute:p({allowEmpty:!1,description:"Attribute containing the URL to parse"}),subtype:t.Literal("url",{description:"Parses a URL attribute and writes URL detail fields."})}),t.Object({sourceAttribute:p({allowEmpty:!1,description:"Attribute containing the user agent string to parse"}),subtype:t.Literal("user-agent",{description:"Parses a user-agent string and writes browser, operating system, and device details."})}),t.Object({sourceAttribute:p({allowEmpty:!1,description:"Attribute containing the key/value string segment to parse"}),targetAttribute:p({description:"Target map attribute where extracted key/value pairs will be written"}),keyValueSplitter:p({allowEmpty:!1,description:"Delimiter separating keys from values in the source string"}),pairsSplitter:p({allowEmpty:!0,description:"Delimiter separating each key/value pair in the source string."}),acceptStandaloneKey:t.Boolean({description:"Set to true to accept keys without explicit values."}),subtype:t.Literal("key-value",{description:"Parses delimited key/value text into attributes."})})],{description:"Parse processor configuration. The `subtype` discriminator selects which parser reads the source text attribute and which fields it extracts."}),Dz=t.Object({...IU,params:kz}),Gz=t.Object({...bU,params:Mz}),$z=t.Object({...TU,params:I("subtype",[t.Object({targetAttribute:p({allowEmpty:!1,description:"Attribute that will receive the formatted value"}),formatString:p({allowEmpty:!1,type:"long",description:"Template string used to build the target attribute value"}),overrideTarget:t.Optional(t.Boolean({description:"Set to true to overwrite an existing target attribute value (defaults to true)"})),subtype:t.Literal("format-string"),replaceMissingByEmpty:t.Optional(t.Boolean({description:"Set to true for missing referenced attributes to render as empty strings. Defaults to true."}))}),t.Object({targetAttribute:p({allowEmpty:!1,description:"Attribute that will receive the category value"}),clauses:t.Array(t.Object({query:p({allowEmpty:!1,type:"tsuga-query",description:"Query that selects logs for this category clause. Clauses are evaluated in order."}),value:p({allowEmpty:!1,description:"String category value assigned when this clause matches."})}),{minItems:1,maxItems:yU,description:"Conditions evaluated in order to determine the category value. The first matching clause wins."}),defaultValue:t.Optional(p({description:"String category value used when no clause matches."})),subtype:t.Literal("category")})])}),jz=t.Object({..._U,params:t.Object({attributes:t.Array(t.Object({originAttribute:p({allowEmpty:!1,description:"Attribute name to map to the target attribute"}),keepOrigin:t.Optional(t.Boolean({description:"Preserve the source attribute after mapping (defaults to false)"})),overrideTarget:t.Optional(t.Boolean({description:"Overwrite the target attribute when it already exists (defaults to true)"})),targetAttribute:p({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:t.Literal("map-attributes")})}),qz=t.Object({...bU,params:t.Object({attributeName:p({allowEmpty:!1,description:"Attribute whose value will be parsed with Grok rules"}),rules:t.Array(p({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:t.Optional(t.Array(p({type:"long"}),{maxItems:SU,description:"Example log lines for validating the Grok rules."})),subtype:t.Literal("grok")})}),U5e=I("type",[jz,qz,$z]),Bz=t.Object({...hU,params:I("subtype",[t.Object({targetAttribute:t.String({description:"Attribute that will receive the formatted value"}),formatString:t.String({description:"Template string used to build the target attribute value"}),overrideTarget:t.Optional(t.Boolean({description:"Whether to overwrite the target attribute when it already exists."})),subtype:t.Literal("format-string"),replaceMissingByEmpty:t.Optional(t.Boolean({description:"Whether missing referenced attributes render as empty strings."}))}),t.Object({targetAttribute:t.String({description:"Attribute that will receive the category value"}),clauses:t.Array(t.Object({query:t.String({description:"Query that selects logs for this category clause."}),value:t.String({description:"String category value assigned when this clause matches."})}),{description:"Conditions evaluated in order to determine the category value."}),defaultValue:t.Optional(t.String({description:"String category value used when no clause matches."})),subtype:t.Literal("category")})])}),Fz=t.Object({...EU,params:t.Object({attributes:t.Array(t.Object({originAttribute:t.String({description:"Attribute name to map to the target attribute"}),keepOrigin:t.Optional(t.Boolean({description:"Whether the source attribute is preserved after mapping."})),overrideTarget:t.Optional(t.Boolean({description:"Whether to overwrite the target attribute when it already exists."})),targetAttribute:t.String({description:"Attribute name that will receive the mapped value"})}),{description:"Mappings that map individual attributes to new targets"}),subtype:t.Literal("map-attributes")})}),Hz=t.Object({...IU,params:t.Object({attributeName:t.String({description:"Attribute whose value will be parsed with Grok rules"}),rules:t.Array(t.String({description:"Grok rule applied to parse text."}),{description:"Ordered Grok rules evaluated until one matches."}),samples:t.Optional(t.Array(t.String(),{description:"Example log lines for validating the Grok rules."})),subtype:t.Literal("grok")})}),w5e=I("type",[Fz,Hz,Bz]),Kz=11,OU=t.Cyclic({OutputProcessor:t.Union([vz,Dz,Pz,t.Object({...Op,params:t.Object({items:t.Array(t.Object({query:t.String({description:"Query that determines whether logs enter this branch"}),processors:t.Array(t.Ref("OutputProcessor"),{description:"Processors executed when the branch query matches"})}),{description:"Conditional branches evaluated in order before falling back to the default"})}),type:t.Literal("split",{description:"Split processor. It sends each log through the first matching conditional branch."})})])},"OutputProcessor",{description:"Processing step executed sequentially on route logs"}),AU=t.Cyclic({InputProcessor:t.Union([Lz,Gz,Uz,t.Object({...Ap,params:t.Object({items:t.Array(t.Object({query:p({type:"tsuga-query",description:"Query that determines whether logs enter this branch"}),processors:t.Array(t.Ref("InputProcessor"),{maxItems:50,description:"Processors executed when the branch query matches"})}),{minItems:2,maxItems:Kz,description:"Conditional branches evaluated in order before falling back to the default"})}),type:t.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 zz="/v0/logs",fn=`${zz}/routes`,gn=t.Object({id:t.String({description:"Tsuga-generated log route ID assigned when the route is created."}),name:t.String({description:"Human-readable route name shown in Tsuga."}),description:t.Optional(t.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:t.Boolean({description:"Whether this route is active for newly ingested logs. Disabled routes remain saved but do not process logs."}),query:t.String({description:"Tsuga query that selects which newly ingested logs enter the route processor chain."}),rank:t.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:t.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:t.Array(OU,{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:t.Optional(ue),updater:t.Optional(ue),updatedAt:T({description:"Timestamp when Tsuga last updated the route."}),createdAt:T({description:"Timestamp when Tsuga created the route."}),assetUpdatedAt:T({description:"Timestamp when Tsuga last changed route behavior. This can differ from `updatedAt` when only metadata such as `description` or `tags` changed."})},{title:"Route"}),gs=t.Object({name:p({allowEmpty:!1,description:"Human-readable route name shown in Tsuga."}),description:t.Optional(p({type:"long",description:"Optional free-text note about the route's purpose. This metadata is not evaluated when matching or processing logs."})),isEnabled:t.Boolean({description:"Set to true for the route to process newly ingested matching logs. Set to false to save it without running it."}),query:p({type:"tsuga-query",description:"Tsuga query that selects which newly ingested logs enter the route processor chain."}),tags:Ve,owner:p({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:t.Array(AU,{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."})});var j5e=d({tags:["routes"],url:fn,method:"GET",paginated:!0,query:t.Object(Q),response:t.Array(gn)}),q5e=d({tags:["routes"],url:`${fn}/:id`,params:t.Object({id:p()}),method:"GET",response:gn}),B5e=d({tags:["routes"],url:fn,method:"POST",body:gs,response:gn}),F5e=d({tags:["routes"],url:`${fn}/:id`,method:"PUT",body:gs,params:t.Object({id:p()}),response:gn}),H5e=d({tags:["routes"],url:`${fn}/:id/clone`,method:"POST",params:t.Object({id:p()}),body:gs,response:gn}),K5e=d({tags:["routes"],url:`${fn}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),z5e=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:`${fn}/:id/modify-ranking`,method:"PUT",params:t.Object({id:p()}),body:t.Object({rank:t.Integer({minimum:1,description:"Target rank for the route, from 1 to the total number of routes. Requests outside that range are rejected."})}),response:t.Object({})}),Y5e=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:`${fn}/:id/enable`,method:"PUT",params:t.Object({id:p()}),body:t.Object({enable:t.Boolean({description:"Set to true to enable the route, or false to disable it."})}),response:gn});var ys=`/${"v1"}/routes`,xU={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}"]}}]},RU={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}}]},hs=t.Pick(gn,["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)."}),Yz={id:"123-456-abc",...xU},Vz={id:"456-789-def",...RU};Object.assign(hs,{examples:[Yz,Vz]});var CU=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:ys,method:"GET",paginated:!0,query:t.Object(Q),response:t.Array(hs)}),PU=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:`${ys}/:id`,method:"GET",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the log route to retrieve. Use the `id` returned by route list or create responses."})}),response:hs}),sf=t.Pick(gs,["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."}),Qz=xU,Wz=RU;Object.assign(sf,{examples:[Qz,Wz]});var UU=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:ys,method:"POST",body:sf,response:hs}),wU=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:`${ys}/:id`,method:"PUT",body:sf,params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the log route to update. Use the `id` returned by route list, get, or create responses."})}),response:hs}),NU=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:`${ys}/:id`,method:"DELETE",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the log route to delete. Use the `id` returned by route list, create, or update responses."})}),response:R});var Ts=`/${"v1"}/slos`,Zz=t.Pick(ud,["id","sloId","priority","configuration"],{$id:"SloAlert",description:"Alert attached to an SLO, triggered on a burn-rate multiplier or an SLO target threshold"}),Es=t.Object({...t.Pick(ei,["id","name","description","tags","configuration","target","timeframeDays","owner","permissions","clusterIds"]).properties,alerts:t.Array(Zz,{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"}),Xz={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(Es,{examples:[Xz]});var LU=t.Pick(ld,["filters","sort","limit","offset"]),vU=t.Object({...LU.properties,filters:LU.properties.filters},{description:"SLO query request. Use filters, sorting, limit, and offset to page through visible SLOs."}),Jz={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(vU,{examples:[Jz]});var kU=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:`${Ts}/query`,method:"POST",paginated:!0,body:vU,response:t.Array(Es)}),MU=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:`${Ts}/:id`,method:"GET",params:t.Object({id:p({allowEmpty:!1,description:"SLO ID returned by SLO query, create, or update operations."})}),response:Es}),DU=["name","description","tags","configuration","target","timeframeDays","owner","permissions","clusterIds","alerts"],GU=t.Pick(sp,DU,{$id:"CreateSloRequest",description:"SLO creation request. Provide ownership, data access, SLI configuration, target, timeframe, optional cluster scope, and the alerts to create."}),$U=t.Pick(md,DU,{$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."}),jU={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(GU,{examples:[jU]});Object.assign($U,{examples:[jU]});var qU=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:Ts,method:"POST",body:GU,response:Es}),BU=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:`${Ts}/:id`,method:"PUT",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the SLO to update. Use the `id` returned by SLO query or create."})}),body:$U,response:Es}),FU=d({description:"Deletes an SLO by ID. Deleting an SLO stops future evaluations and removes its attached alerts.",operationId:"deleteSlo",tags:["slos"],url:`${Ts}/:id`,method:"DELETE",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the SLO to delete. Use the `id` returned by SLO query or create."})}),response:R});var oo=`${ms}/tag-policies`;var e9=["logs","metrics","traces"],cf=t.Array(t.Enum(e9,{description:"Telemetry signal covered by a data tag policy."}),{description:"Telemetry signals covered by the policy. An empty array means logs, metrics, and traces."}),t9=t.Union([wc,cf]),r9=t.Object({teamIds:t.Array(t.String(),{description:"Team IDs used by this policy scope."}),mode:t.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."}),n9=I("type",[t.Object({type:t.Literal("telemetry",{description:"Policy applies to telemetry data points during ingestion or evaluation."}),assetTypes:cf,shouldInsertWarning:t.Boolean({description:"When true, Tsuga annotates non-compliant telemetry with tag policy warnings instead of only measuring violations."}),dropSample:t.Optional(t.Number({description:"Percentage of non-compliant telemetry datapoints to drop. Omitted means no sampling drop is configured."}))},{title:"TelemetryTagPolicy"}),t.Object({type:t.Literal("tsuga_asset",{description:"Policy applies to Tsuga-managed resources such as dashboards, routes, and keys."}),assetTypes:wc},{title:"TsugaAssetTagPolicy"})]),o9=I("type",[t.Object({type:t.Literal("telemetry",{description:"Policy applies to telemetry data points during ingestion or evaluation."}),assetTypes:cf,shouldInsertWarning:t.Boolean({description:"When true, Tsuga annotates non-compliant telemetry with tag policy warnings instead of only measuring violations."}),dropSample:t.Optional(t.Number({minimum:0,maximum:100,description:"Percentage of non-compliant telemetry datapoints to drop. Valid values are 0 through 100."}))},{title:"TelemetryTagPolicy"}),t.Object({type:t.Literal("tsuga_asset",{description:"Policy applies to Tsuga-managed resources such as dashboards, routes, and keys."}),assetTypes:wc},{title:"TsugaAssetTagPolicy"})]),HU="Policy surface and enforcement behavior. Use `telemetry` for telemetry data or `tsuga_asset` for Tsuga-managed resources.",i9=t.Unsafe({...n9,description:HU}),a9=t.Unsafe({...o9,description:HU}),_i=t.Object({id:t.String({description:"Tsuga-generated tag policy ID assigned when the policy is created."}),name:t.String({description:"Human-readable tag policy name."}),description:t.Optional(t.String({description:"Optional user-provided policy description."})),isActive:t.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:t.String({description:"Tag key enforced by this policy."}),allowedTagValues:t.Array(t.String(),{description:"Allowed values for `tagKey`. An empty array means any value is accepted when the tag exists."}),isRequired:t.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:t.Optional(r9),configuration:i9,creator:t.Optional(ue),updater:t.Optional(ue),owner:t.Optional(t.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 _s=t.Object({name:p({description:"Human-readable tag policy name."}),description:t.Optional(p({description:"Optional policy description."})),isActive:t.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:p({allowEmpty:!1,description:"Tag key enforced by this policy. Tsuga trims surrounding whitespace before storing the policy."}),allowedTagValues:t.Array(p({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:t.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:t.Optional(t.Object({teamIds:t.Array(p(),{minItems:1,maxItems:100,description:"Team IDs used by this policy scope."}),mode:t.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:a9,owner:p({allowEmpty:!1,description:"Team ID that will own and manage the policy."})}),y6e=d({tags:["tag-policies"],url:oo,method:"GET",query:t.Object({teamIds:t.Optional(t.Array(p(),{maxItems:100})),assetTypes:t.Optional(t9),searchQuery:t.Optional(p())}),response:t.Array(_i)}),h6e=d({tags:["tag-policies"],url:`${oo}/:id`,method:"GET",params:t.Object({id:p()}),response:_i}),T6e=d({tags:["tag-policies"],url:oo,method:"POST",body:_s,response:_i}),E6e=d({tags:["tag-policies"],url:`${oo}/:id`,method:"PUT",params:t.Object({id:p()}),body:_s,response:_i}),_6e=d({tags:["tag-policies"],url:`${oo}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),I6e=d({tags:["tag-policies"],url:`${ms}/applicable-tag-rules`,method:"GET",query:t.Object({assetType:t.Enum(ma),teamId:p()}),response:t.Array(t.Object({tagKey:t.String(),allowedTagValues:t.Array(t.String()),isRequired:t.Boolean(),tagPolicyId:t.String()}))}),KU=t.Object({total:t.Number(),totalNonCompliant:t.Number(),idsNonCompliant:t.Array(t.String())}),zU=t.Union([t.Literal("ingestion-api-key"),t.Literal("operation-api-key"),t.Literal("rum-public-token"),t.Literal("dashboard"),t.Literal("log-route"),t.Literal("metric-route"),t.Literal("monitor"),t.Literal("notification-rule"),t.Literal("notification-silence"),t.Literal("slo")]),s9=t.Object({total:t.Number(),totalNonCompliant:t.Number(),byAssetType:t.Record(zU,KU)}),c9=t.Omit(KU,["total"]),p9=t.Object({totalNonCompliant:t.Number(),byAssetType:t.Record(zU,c9)}),YU=t.Object({totals:s9,byTeam:t.Record(t.String(),p9)}),b6e=d({tags:["tag-policies"],url:`${oo}/:id/stats`,method:"GET",params:t.Object({id:p()}),response:YU}),S6e=d({tags:["tag-policies"],url:`${oo}/new-policy-stats`,method:"POST",body:_s,response:YU});var Is=`/${"v1"}/tag-policies`,VU={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"},QU={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"},u9={id:"123-456-abc",...VU},m9={id:"456-789-def",...QU},bs=t.Pick(_i,["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)."}),l9=u9,d9=m9;Object.assign(bs,{examples:[l9,d9]});var pf=t.Pick(_s,["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."}),f9=VU,g9=QU;Object.assign(pf,{examples:[f9,g9]});var WU=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:t.Array(bs)}),ZU=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:t.Object({id:p({allowEmpty:!1,description:"Identifier of the tag policy to retrieve. Use the `id` returned by tag policy list or create responses."})}),response:bs}),XU=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:pf,response:bs}),JU=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:t.Object({id:p({allowEmpty:!1,description:"Identifier of the tag policy to update. Use the `id` returned by tag policy list, get, or create responses."})}),body:pf,response:bs}),ew=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:t.Object({id:p({allowEmpty:!1,description:"Identifier of the tag policy to delete. Use the `id` returned by tag policy list, create, or update responses."})}),response:R});var Ss=`/${"v1"}/teams`,Os=t.Pick(Zo,["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)."}),y9={id:"team-123-abc",name:"platform-engineering",visibility:"public",tags:[{key:"department",value:"engineering"}]};Object.assign(Os,{examples:[y9]});var tw=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:t.Object(Q),response:t.Array(Os)}),rw=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:t.Object({id:p({allowEmpty:!1,description:"Identifier of the team to retrieve. Use the `id` returned by team list or create responses."})}),response:Os}),uf=t.Pick(np,["name","description","visibility","tags"],{description:"Team create or update request. Provide the team name, optional description, visibility, and tags."}),h9={name:"platform-engineering",visibility:"public",tags:[{key:"department",value:"engineering"}]};Object.assign(uf,{examples:[h9]});var nw=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:uf,response:Os}),ow=d({description:"Replaces a team definition by ID, including name, description, visibility, and tags.",operationId:"updateTeam",tags:["teams"],url:`${Ss}/:id`,method:"PUT",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the team to update. Use the `id` returned by team list, get, or create responses."})}),body:uf,response:Os}),iw=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:t.Object({id:p({allowEmpty:!1,description:"Identifier of the team to delete. Use the `id` returned by team list, create, or update responses."})}),response:R});function mf(e){let r=e.params;if(r?.properties){let n=Object.keys(r.properties);if(n.length===1&&n[0])return n[0]}return"id"}function aw(e,r,n){let o=e.command(r.commandName).description(r.description),i=Jx(r.commandName).replace(/-/g," "),a=o.command("list").description(`List all ${r.commandName}`);if(r.listOptions)for(let c of r.listOptions)a.option(c.flag,c.description);if(r.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){W(Wo(r.endpoints.list));return}let m=await n()(r.endpoints.list,{body:c.data?Bo({data:c.data}):{}});W(m)}):a.action(async c=>{let m={};if(r.listOptions)for(let f of r.listOptions){let y=c[f.queryParam];y!==void 0&&(m[f.queryParam]=y)}let l=await n()(r.endpoints.list,Object.keys(m).length>0?{query:m}:void 0);W(l)}),r.endpoints.get){let c=r.endpoints.get,m=mf(c);o.command("get <id>").description(`Get a ${i} by ID`).action(async l=>{let f=await n()(c,{params:{[m]:l}});W(f)})}if(r.endpoints.create){let c=r.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){W(Wo(c));return}let l=Bo(m),f=await n()(c,{body:l});W(f)})}if(r.endpoints.update){let c=r.endpoints.update,m=mf(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){W(Wo(c));return}let y=Bo(f),E=await n()(c,{params:{[m]:l},body:y});W(E)})}if(r.endpoints.delete){let c=r.endpoints.delete,m=mf(c);o.command("delete <id>").description(`Delete a ${i} by ID`).action(async l=>{let f=await n()(c,{params:{[m]:l}});W(f)})}}var T9=[{commandName:"cloud-resources",description:"List cloud resources discovered by inventory scans",endpoints:{list:yP},enableListBody:!0},{commandName:"dashboards",description:"Manage dashboards",endpoints:{list:QC,get:WC,create:ZC,update:XC,delete:JC},enableListBody:!0},{commandName:"ingestion-api-keys",description:"Manage ingestion API keys",endpoints:{list:aP,create:sP,update:cP,delete:pP}},{commandName:"investigations",description:"Manage investigations (beta)",endpoints:{list:TP,get:EP,create:_P,update:IP,delete:bP}},{commandName:"monitors",description:"Manage monitors",endpoints:{list:PP,get:UP,create:GP,update:$P,delete:jP},enableListBody:!0},{commandName:"notification-rules",description:"Manage notification rules",endpoints:{list:BP,get:FP,create:HP,update:KP,delete:zP}},{commandName:"notification-silences",description:"Manage notification silences",endpoints:{list:WP,get:ZP,create:XP,update:JP,delete:eU}},{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:aU},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:mU,get:lU,create:dU,update:fU,delete:gU}},{commandName:"routes",description:"Manage routes",endpoints:{list:CU,get:PU,create:UU,update:wU,delete:NU}},{commandName:"services",description:"Manage services",endpoints:{list:qR,get:BR}},{commandName:"slos",description:"Manage SLOs",endpoints:{list:kU,get:MU,create:qU,update:BU,delete:FU},enableListBody:!0},{commandName:"tag-policies",description:"Manage tag policies",endpoints:{list:WU,get:ZU,create:XU,update:JU,delete:ew}},{commandName:"teams",description:"Manage teams",endpoints:{list:tw,get:rw,create:nw,update:ow,delete:iw}}];function sw(e,r){for(let n of T9)aw(e,n,r)}var cw=require("node:child_process");var xp="@tsuga/cli@latest";function E9(){B(`Updating ${xp}`),B(` $ npm install -g ${xp}`);try{(0,cw.execFileSync)("npm",["install","-g",xp],{stdio:["ignore","inherit","inherit"]})}catch(e){let r=e.status??1;throw new Error(`npm install -g ${xp} exited ${r}`,{cause:e})}B("Updated. Run `tsuga --version` to confirm the new version.")}function pw(e){e.command("self-update").description("Update the Tsuga CLI to the latest version via npm").action(()=>{E9()})}var Tf=require("node:fs"),hf=require("node:os"),bi=require("node:path");function _9(e,r){let n=e.slice(0,r).split(/\r\n|\n|\r/g);return[n.length,n.pop().length+1]}function I9(e,r,n){let o=e.split(/\r\n|\n|\r/g),i="",a=(Math.log10(r+1)|0)+1;for(let c=r-1;c<=r+1;c++){let m=o[c-1];m&&(i+=c.toString().padEnd(a," "),i+=": ",i+=m,i+=`
|
|
131
|
+
-----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}"}],pB=dR.map(e=>e.key);var yKe=new Set(pB),hKe=dR.map(e=>e.key);var M="context";var fR="trace_id",RKe=`${M}.team`,CKe=`${M}.env`,PKe=`${M}.api_key_id`,np=`${M}.service.name`,UKe=`${M}.service.version`,Ql=`${M}.span.kind`,Wl=`${M}.span.name`,Zl=`${M}.status.code`,gR=["SPAN_KIND_UNSPECIFIED","SPAN_KIND_INTERNAL","SPAN_KIND_SERVER","SPAN_KIND_CLIENT","SPAN_KIND_PRODUCER","SPAN_KIND_CONSUMER"];var ka=`${M}.host.name`,uB=`${M}.instance`,mB=`${M}.instanceid`,lB=`${M}.instance_name`,wKe=`${M}.telemetry.sdk.language`,NKe=`${M}.process.runtime.name`,LKe=`${M}.scope.name`,vKe=`${M}.cloud.provider`,kKe=`${M}.cloud.platform`,MKe=`${M}.aws.ecs.task.arn`,DKe=`${M}.k8s.cluster.name`,GKe=`${M}.k8s.cluster.uid`,$Ke=`${M}.k8s.namespace.name`,dB=`${M}.k8s.pod.name`,jKe=`${M}.k8s.pod.uid`,qKe=`${M}.k8s.container.name`,BKe=`${M}.k8s.node.name`,FKe=`${M}.k8s.node.uid`,fB=`${M}.k8s.deployment.name`,HKe=`${M}.k8s.deployment.uid`,gB=`${M}.k8s.replicaset.name`,KKe=`${M}.k8s.replicaset.uid`,yB=`${M}.k8s.statefulset.name`,zKe=`${M}.k8s.statefulset.uid`,hB=`${M}.k8s.daemonset.name`,YKe=`${M}.k8s.daemonset.uid`,VKe=`${M}.k8s.job.name`,QKe=`${M}.k8s.job.uid`,WKe=`${M}.k8s.cronjob.name`,ZKe=`${M}.k8s.cronjob.uid`,Xl="status_code",Jl="span.name";var ed="span.kind";var TB="db.system.name",EB="db.system",_B="db.namespace",IB="db.name";var XKe=`span_attributes.${_B}`,JKe=`span_attributes.${IB}`,e2e=`span_attributes.${TB}`,t2e=`span_attributes.${EB}`;var r2e={name:"tsuga.internal.processing_tag_policy_violations_total",attributes:{tagPolicyId:`${M}.tag_policy_id`,dataSource:`${M}.data_source`}};var n2e={name:"tsuga.internal.event_size_bytes",attributes:{batchKind:`${M}.batch_kind`,batchKindMetricsFilter:`${M}.batch_kind:metrics`,sourceApiKeyId:`${M}.source_api_key_id`,sourceEnv:`${M}.source_env`,sourceTeam:`${M}.source_team`}};var td="__tsuga_metadata__",o2e=`${td}.signature`,i2e=`${td}.routes`,a2e=`${td}.trace_id_bucket`;var m2e={[Ql]:ed,[Ql.replace(`${M}.`,"")]:ed,[Wl]:Jl,[Wl.replace(`${M}.`,"")]:Jl,[Zl]:Xl,[Zl.replace(`${M}.`,"")]:Xl};function yR(e){return e.replace(/ies$/,"y").replace(/s$/,"")}var hR=["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"],TR=["alert_queries","alert_thresholds","alert_values"],bB=[...hR,...TR],ER=["alert_event_name","alert_message"],D2e=[...bB,...ER],G2e=new Set([...hR,...ER]),$2e=new Set(TR);var SB="^\\S(.*\\S)?$",OB=128,AB=256,xB=t.Object({key:t.String({description:"Tag key attached to the resource. Consumers can use key/value tags for filtering, ownership context, and policy checks."}),value:t.String({description:"Tag value attached to the resource for this key. Tsuga returns the value exactly as stored."})},{title:"Tag"}),RB=t.Object({key:t.String({maxLength:OB,description:"Tag key to attach to the resource."}),value:t.String({maxLength:AB,pattern:SB,description:"Tag value to attach to the resource. Leading or trailing whitespace is rejected."})},{title:"Tag"}),Yt=t.Array(xB,{title:"Tags",description:"Key/value tags applied to the resource. Use them to organize resources and to satisfy tag policies."}),Vt=t.Array(RB,{title:"Tags",maxItems:50,description:"Key/value tags to apply to the resource. Tag policies may require specific keys or values."}),ke=t.Optional(Yt),Qe=t.Optional(Vt);var mn="/v0/teams",ip=["public","private"],op={NAME:"name",CREATED_AT:"createdAt",MEMBER_COUNT:"memberCount",VISIBILITY:"visibility"},CB=t.Enum([op.NAME,op.CREATED_AT,op.MEMBER_COUNT,op.VISIBILITY],{description:"Team field used for sorting list responses. Use `name`, `createdAt`, `memberCount`, or `visibility`."}),bR=t.Object({color:t.Enum(Yl,{description:"Color token used by Tsuga when rendering the team avatar."}),mode:t.Enum(Vl,{description:"Avatar rendering mode selected for the team."}),iconName:t.Enum(lR,{description:"Icon name rendered inside the team avatar when icon mode is used."})}),rd=t.Object({color:t.Enum(Yl),mode:t.Enum(Vl)}),_R=100,IR=250,Xo=t.Object({id:t.String({description:"Unique identifier of the team. Generated by Tsuga and stable for the team lifetime."}),name:t.String({description:"Human-readable team name displayed throughout Tsuga and used in team search."}),description:t.Optional(t.String({description:"Optional free-text description of the team."})),visibility:t.Enum(ip,{description:"`public` makes team-owned resources discoverable according to access controls. `private` restricts discovery to team members and authorized users."}),tags:ke,createdAt:T({description:"Timestamp when Tsuga created the team."}),updatedAt:T({description:"Timestamp when Tsuga last updated the team metadata."}),memberCount:t.Optional(t.Number({description:"Number of members currently in the team"})),avatar:t.Optional(bR)}),ap=t.Object({name:t.String({minLength:1,maxLength:_R,format:ko,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 ${_R} characters.`}),description:t.Optional(t.String({maxLength:IR,description:`Optional team description. Maximum length is ${IR} characters.`})),visibility:t.Enum(ip,{description:"`public` makes team-owned resources discoverable according to access controls. `private` restricts discovery to team members and authorized users."}),tags:Qe,avatar:t.Optional(bR)}),PB=t.Object({id:t.String(),name:t.String(),email:t.String(),role:t.Enum($o),joinedTeamAt:T(),orgRole:t.Enum(Mc),avatar:t.Optional(rd)}),vze=l({tags:["teams"],url:mn,method:"GET",paginated:!0,response:t.Array(Xo),query:t.Object({...fe,includeMemberCount:t.Optional(t.Boolean()),searchQuery:t.Optional(p({description:"Substring matched against team names and descriptions."})),visibility:t.Optional(t.Enum(ip,{description:"Restrict results to teams with this visibility."})),myTeamsOnly:t.Optional(t.Boolean({description:"If true, return only teams that include the authenticated user."})),sortBy:t.Optional(CB),sortDirection:t.Optional(t.Enum(["asc","desc"],{description:"Sort direction: ascending or descending."}))})}),kze=l({tags:["teams"],url:`${mn}/:id`,method:"GET",params:t.Object({id:p()}),response:Xo}),Mze=l({tags:["teams"],url:`${mn}/:id/members`,method:"GET",params:t.Object({id:p()}),response:t.Array(PB)}),Dze=l({tags:["teams"],url:`${mn}/:id/assets`,method:"GET",params:t.Object({id:p()}),response:t.Object({apiKeyCount:t.Number(),logRouteCount:t.Number(),monitorCount:t.Number(),notificationRuleCount:t.Number(),dashboardCount:t.Number()})}),Gze=l({tags:["teams"],url:mn,method:"POST",body:ap,response:Xo}),$ze=l({tags:["teams"],url:`${mn}/:id`,method:"PUT",params:t.Object({id:p()}),body:ap,response:Xo}),jze=l({tags:["teams"],url:`${mn}/bulk-update`,method:"POST",body:t.Object({teamIds:t.Array(p(),{maxItems:100}),config:t.Object({visibility:t.Enum(ip)})}),response:t.Object({})}),qze=l({tags:["teams"],url:`${mn}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R});var UB=t.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."}),pe=I("type",[t.Object({type:t.Literal("user",{description:"The resource was created or updated by a user."}),id:t.String({description:"Unique identifier of the user actor."}),name:t.String({description:"Display name of the user actor at the time of response."}),avatar:t.Optional(rd)}),t.Object({type:t.Literal("operation-api-key",{description:"The resource was created or updated by an operation API key."}),id:t.String({description:"Unique identifier of the operation API key actor."}),name:t.String({description:"Display name of the operation API key actor."}),source:t.Optional(UB)})],{description:"User or operation API key responsible for creating or updating a resource. Returned by Tsuga for audit context."});var gt="/v0/monitors",Jo=["alert","resolve","keep_last_status","consider_zero"],ei=["alert","resolve","keep_last_status"];var OR=["no_aggregation","all","any","each","proportion"],AR=["greater_than","less_than","equal","not_equal","greater_than_or_equal","less_than_or_equal"];var wB=t.Object({formula:t.String({description:"Formula result to compare against the threshold, usually `q1` or a formula alias."}),operator:t.Enum(AR,{description:"Comparison operator used to evaluate the threshold condition."}),threshold:t.Number({description:"Numeric threshold value used by the comparison."})}),NB=t.Object({formula:p({type:"tsuga-formula",description:"Formula result to compare against the threshold, usually `q1` or a formula alias."}),operator:t.Enum(AR,{description:"Comparison operator used to evaluate the threshold condition."}),threshold:t.Number({description:"Numeric threshold value used by the comparison."})}),LB=5,nd=t.Array(wB,{description:"Threshold conditions evaluated against query and formula results. All listed conditions must match for a non-grouped threshold monitor to alert."}),od=t.Array(NB,{minItems:1,maxItems:LB,description:"Threshold conditions evaluated against query and formula results. All listed conditions must match for a non-grouped threshold monitor to alert."}),id=t.Object({formula:t.String({description:"Formula result analyzed for anomalous behavior, usually `q1` or a formula alias."}),conditionType:t.Enum(["rate","error","cpu","general","to_be_set"],{description:"Anomaly model type Tsuga uses to classify expected behavior: `rate` flags downward anomalies (e.g. count rates), `error` and `cpu` flag upward anomalies (e.g. error counts/rates, CPU usage), `general` flags both directions, and `to_be_set` is a placeholder Tsuga replaces by inferring the model type from the monitor query when the monitor is created or updated."})},{description:"Anomaly detection condition evaluated by this monitor. The `formula` result is compared against behavior learned from historical query results, and the monitor alerts on deviations in the direction implied by `conditionType`."}),ad=t.Object({formula:p({type:"tsuga-formula",description:"Formula result analyzed for anomalous behavior, usually `q1` or a formula alias."}),conditionType:t.Enum(["rate","error","cpu","general","to_be_set"],{description:"Anomaly model type used to classify expected behavior: `rate` flags downward anomalies (e.g. count rates), `error` and `cpu` flag upward anomalies (e.g. error counts/rates, CPU usage), and `general` flags both directions. Use `to_be_set` to let Tsuga infer the model type from the monitor query during create or update."})},{description:"Anomaly detection condition evaluated by this monitor. The `formula` result is compared against behavior learned from historical query results, and the monitor alerts on deviations in the direction implied by `conditionType`."}),ft=[1,2,3,4,5];var sp={timeframe:t.Number({description:"Lookback window, in minutes, that each query-backed threshold monitor evaluation aggregates over. Always a whole number, at least 1."}),groupByFields:t.Array(t.Object({fields:t.Array(t.String(),{description:"Attribute names the monitor splits results by, evaluating each resulting group independently. Empty means the monitor evaluates a single ungrouped series."}),limit:t.Number({description:"Configured limit for this group by. Currently ignored; monitor evaluation applies a fixed limit of 100 groups per field."}),sortOrder:t.Optional(t.Enum(["asc","desc"],{description:"Sort direction applied to groups: ascending or descending."})),replaceNullWith:t.Optional(t.String({description:"Value used to group documents that have no value for a grouped field."}))}),{description:"Monitor group by configuration. The `limit` setting is currently ignored; evaluation applies a fixed limit of 100 groups per field."}),aggregationAlertLogic:t.Optional(t.Enum(OR,{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:t.Optional(t.Integer({description:"Percentage threshold used when `aggregationAlertLogic` is `proportion`."}))},cp={timeframe:t.Integer({minimum:1,description:"Lookback window, in minutes, that each query-backed threshold monitor evaluation aggregates over."}),groupByFields:t.Array(t.Object({fields:t.Array(p(),{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:t.Number({description:"Configured limit for this group by. Currently ignored; monitor evaluation applies a fixed limit of 100 groups per field."}),sortOrder:t.Optional(t.Enum(["asc","desc"],{description:"Sort direction applied to groups: ascending or descending."})),replaceNullWith:t.Optional(p({allowEmpty:!1,description:"Value used to group documents that have no value for a grouped field."}))}),{maxItems:1,description:"Monitor group by configuration. The `limit` setting is currently ignored; evaluation applies a fixed limit of 100 groups per field."}),aggregationAlertLogic:t.Optional(t.Enum(OR,{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:t.Optional(t.Integer({minimum:1,maximum:99,description:"Percentage threshold used when `aggregationAlertLogic` is `proportion`."}))},sd={...sp,timeframe:t.Number({description:"Lookback window, in minutes, that each anomaly monitor evaluation aggregates over. Always a whole number from 5 through 1440."})},cd={...cp,timeframe:t.Integer({minimum:5,maximum:1440,description:"Lookback window, in minutes, that each anomaly monitor evaluation aggregates over."})},xR=t.Object({type:t.Literal("metric",{description:"Threshold monitor over metric aggregations."}),conditions:nd,noDataBehavior:t.Enum(Jo,{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."}),...sp,queries:_r},{$id:"MonitorConfigurationMetric"}),RR=t.Object({type:t.Literal("metric",{description:"Threshold monitor over metric aggregations."}),conditions:od,noDataBehavior:t.Enum(Jo,{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."}),...cp,queries:Ir},{$id:"InputMonitorConfigurationMetric"}),CR=t.Object({type:t.Literal("log",{description:"Threshold monitor over log aggregations."}),conditions:nd,noDataBehavior:t.Enum(Jo,{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."}),...sp,queries:_r},{$id:"MonitorConfigurationLog"}),PR=t.Object({type:t.Literal("log",{description:"Threshold monitor over log aggregations."}),conditions:od,noDataBehavior:t.Enum(Jo,{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."}),...cp,queries:Ir},{$id:"InputMonitorConfigurationLog"}),UR=t.Object({type:t.Literal("trace",{description:"Threshold monitor over trace aggregations."}),conditions:nd,noDataBehavior:t.Enum(Jo,{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."}),...sp,queries:_r},{$id:"MonitorConfigurationTrace"}),vB=t.Object({type:t.Literal("trace",{description:"Threshold monitor over trace aggregations."}),conditions:od,noDataBehavior:t.Enum(Jo,{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."}),...cp,queries:Ir},{$id:"InputMonitorConfigurationTrace"}),wR=t.Object({type:t.Literal("anomaly-log",{description:"Anomaly monitor over log aggregations."}),condition:id,noDataBehavior:t.Enum(ei,{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."}),...sd,queries:_r},{$id:"MonitorConfigurationAnomalyLog"}),NR=t.Object({type:t.Literal("anomaly-log",{description:"Anomaly monitor over log aggregations."}),condition:ad,noDataBehavior:t.Enum(ei,{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."}),...cd,queries:Ir},{$id:"InputMonitorConfigurationAnomalyLog"}),LR=t.Object({type:t.Literal("anomaly-metric",{description:"Anomaly monitor over metric aggregations."}),condition:id,noDataBehavior:t.Enum(ei,{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."}),...sd,queries:_r},{$id:"MonitorConfigurationAnomalyMetric"}),vR=t.Object({type:t.Literal("anomaly-metric",{description:"Anomaly monitor over metric aggregations."}),condition:ad,noDataBehavior:t.Enum(ei,{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."}),...cd,queries:Ir},{$id:"InputMonitorConfigurationAnomalyMetric"}),kR=t.Object({type:t.Literal("anomaly-trace",{description:"Anomaly monitor over trace aggregations. Use this configuration when Tsuga should learn historical trace query behavior and alert on unusual movement in trace-derived values."}),condition:id,noDataBehavior:t.Enum(ei,{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."}),...sd,queries:_r},{$id:"MonitorConfigurationAnomalyTrace"}),kB=t.Object({type:t.Literal("anomaly-trace",{description:"Anomaly monitor over trace aggregations. Set this value to create or update an anomaly monitor that learns historical trace query behavior and alerts on unusual movement in trace-derived values."}),condition:ad,noDataBehavior:t.Enum(ei,{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."}),...cd,queries:Ir},{$id:"InputMonitorConfigurationAnomalyTrace"}),MR=t.Object({type:t.Literal("certificate-expiry",{description:"Monitor that alerts before discovered certificates expire."}),warnBeforeInDays:t.Integer({description:"Number of days before certificate expiry when the monitor should warn."}),cloudAccounts:t.Optional(t.Array(t.String(),{description:"Cloud account IDs whose certificates are checked. Omitted means certificates from all cloud accounts are checked."})),aggregationAlertLogic:t.Literal("each",{description:"Certificate expiry monitors alert independently for each certificate."}),noDataBehavior:t.Literal("resolve",{description:"Certificate expiry monitors resolve when matching certificate data disappears."})},{$id:"MonitorConfigurationCertificateExpiry"}),MB=t.Object({type:t.Literal("certificate-expiry",{description:"Monitor that alerts before discovered certificates expire."}),warnBeforeInDays:t.Integer({minimum:1,maximum:365,description:"Number of days before certificate expiry when the monitor should warn. Valid values are 1 through 365."}),cloudAccounts:t.Optional(t.Array(t.String(),{minItems:1,description:"Cloud account IDs whose certificates are checked. Omit to check certificates from all cloud accounts."})),aggregationAlertLogic:t.Literal("each",{description:"Certificate expiry monitors alert independently for each certificate."}),noDataBehavior:t.Literal("resolve",{description:"Certificate expiry monitors resolve when matching certificate data disappears."})},{$id:"InputMonitorConfigurationCertificateExpiry"}),DB=t.Object({type:t.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:t.Literal("each",{description:"Fixed aggregation logic for log error pattern monitors. Each new pattern is evaluated as its own alert group."}),noDataBehavior:t.Literal("keep_last_status",{description:"Fixed no-data behavior for log error pattern monitors. Pattern state is kept until inactive pattern groups expire."}),filter:t.Object({teamIds:t.Array(t.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:t.String({description:"Environment whose logs are searched for new error patterns."}),service:t.Optional(t.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"}),GB=t.Object({type:t.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:t.Literal("each",{description:"Fixed aggregation logic for log error pattern monitors. Each new pattern is evaluated as its own alert group."}),noDataBehavior:t.Literal("keep_last_status",{description:"Fixed no-data behavior for log error pattern monitors. Pattern state is kept until inactive pattern groups expire."}),filter:t.Object({teamIds:t.Array(p(),{description:"Team IDs whose logs are searched for new error patterns. Tsuga resolves these team IDs to team names when exporting monitor assets."}),env:p({description:"Environment whose logs are searched for new error patterns."}),service:t.Optional(p({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"}),$B=I("type",[xR,CR,UR,wR,LR,DB,kR,MR],{description:"Monitor evaluation configuration. The `type` discriminator determines which telemetry source, condition shape, and evaluation rules Tsuga uses."}),jB=I("type",[RR,PR,vB,NR,vR,kB,GB,MB],{description:"Monitor evaluation configuration. The `type` discriminator determines which telemetry source, condition shape, and evaluation rules Tsuga uses."});var Pr=t.Object({id:t.String({description:"Tsuga-generated monitor ID assigned when the monitor is created."}),name:t.String({description:"Display name of the monitor and alert source."}),owner:t.String({description:"Team ID that owns and manages the monitor."}),message:t.Optional(t.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:$B,priority:t.Enum(ft,{description:"Monitor priority from 1 through 5, where 1 is highest priority."}),permissions:an,dashboardId:t.Optional(t.String({description:"ID of the dashboard linked to this monitor for context when investigating alerts. Caller-supplied. Omitted when no dashboard is linked."})),pauseUntil:t.Optional(T({description:"Timestamp until which the monitor is snoozed."})),creator:t.Optional(pe),updater:t.Optional(pe),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:t.Array(t.String(),{description:"Cluster IDs where the monitor is deployed. Empty means all eligible clusters."})},{title:"Monitor"}),qB=I("type",[xR,CR,UR,wR,LR,kR,MR]),s9e=t.Object({...Pr.properties,configuration:qB},{title:"Monitor"}),c9e=t.Object({...Pr.properties,configuration:I("type",[RR,PR,NR,vR])},{title:"Monitor"}),Ma=t.Object({name:p({description:"Display name of the monitor and alert source."}),message:t.Optional(p({type:"long",description:"Message included in notifications triggered by this monitor. Optional on create. On update, omitting it keeps the existing message."})),tags:Qe,configuration:jB,priority:t.Enum(ft,{description:"Monitor priority from 1 through 5, where 1 is highest priority."}),owner:p({allowEmpty:!1,description:"Team ID that owns and manages the monitor."}),dashboardId:t.Optional(t.Union([t.Null(),p({allowEmpty:!1})],{description:"ID of the dashboard to link to this monitor for context when investigating alerts. On create: omit or send `null` to leave the monitor unlinked. On update: omit to skip updating this field, send `null` to clear an existing link."})),pauseUntil:t.Optional(p({allowEmpty:!1,type:"date-time",description:"ISO timestamp until which the monitor should be snoozed."})),permissions:an,clusterIds:t.Optional(t.Array(p({allowEmpty:!1}),{description:"Cluster IDs where the monitor should be deployed. Empty or omitted means all eligible clusters for cluster-deployed monitor types."}))}),SR=["threshold","certificate-expiry","anomaly-detection","log-error-pattern"],ln={PRIORITY:"priority",TYPE:"type",NAME:"name",OWNER:"owner",TAGS:"tags",CLUSTER_IDS:"clusterIds",PAUSE_UNTIL:"pauseUntil",ASSET_UPDATED_AT:"assetUpdatedAt"};var pd=t.Object({owners:je(p({allowEmpty:!1}),{description:"Restrict results to monitors owned by any of these team IDs",maxItems:50}),searchQuery:t.Object({value:p({allowEmpty:!1,description:"Case-insensitive substring matched against monitor ID, monitor name, query filters, and aggregate fields. Wildcard characters are treated literally."}),exclude:t.Optional(t.Boolean({description:"If true, exclude monitors matching this value instead of including them"}))},{description:"Search query filter for monitors."}),tags:je(Vt.items,{description:"Restrict results to monitors that have at least one of the listed key/value tags",maxItems:50}),priorities:je(t.Enum(ft),{description:"Restrict results to monitors with one of these priorities",maxItems:ft.length}),types:je(t.Enum(SR),{description:"Restrict results to monitors with these types",maxItems:SR.length}),activity:t.Enum(["active","snoozed"],{description:"Restrict results by activity status: active monitors or currently snoozed monitors"}),clusterIds:je(p({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"}),ud=t.Partial(t.Object({...fe,filters:t.Partial(pd),sort:t.Object({by:t.Enum([ln.PRIORITY,ln.TYPE,ln.NAME,ln.OWNER,ln.TAGS,ln.CLUSTER_IDS,ln.PAUSE_UNTIL,ln.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:t.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."})})),p9e=l({tags:["monitors"],url:`${gt}/query`,method:"POST",paginated:!0,response:t.Array(Pr),body:ud}),u9e=l({tags:["monitors"],url:`${gt}/tags/query`,method:"POST",body:t.Object({filters:t.Optional(t.Partial(t.Omit(pd,["tags"])))}),response:Yt}),m9e=l({tags:["monitors"],url:`${gt}/counts/query`,method:"POST",body:t.Object({filters:t.Optional(t.Partial(t.Omit(pd,["activity"])))}),response:t.Object({all:t.Integer({description:"Total number of monitors matching the filters that the user can read."}),active:t.Integer({description:"Number of matching readable monitors that are not currently snoozed."}),snoozed:t.Integer({description:"Number of matching readable monitors that are currently snoozed."})})}),l9e=l({tags:["monitors"],url:`${gt}/:id`,method:"GET",params:t.Object({id:p()}),response:Pr}),d9e=l({tags:["monitors"],url:gt,method:"POST",body:Ma,response:Pr}),f9e=l({tags:["monitors"],url:`${gt}/:id`,method:"PUT",params:t.Object({id:p()}),body:Ma,response:Pr}),g9e=l({tags:["monitors"],url:`${gt}/bulk-update`,method:"PUT",body:t.Object({monitorIds:t.Array(p({allowEmpty:!1}),{minItems:1}),owner:p({allowEmpty:!1})}),response:t.Object({})}),y9e=l({tags:["monitors"],url:`${gt}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),h9e=l({tags:["monitors"],url:`${gt}/bulk-delete`,method:"DELETE",body:t.Object({ids:t.Array(p())}),response:t.Object({})}),T9e=l({tags:["monitors"],url:`${gt}/:id/snooze`,method:"POST",params:t.Object({id:p()}),body:t.Object({pauseUntil:p({allowEmpty:!1,type:"date-time"})}),response:Pr}),E9e=l({tags:["monitors"],url:`${gt}/bulk-snooze`,method:"POST",body:t.Object({monitorIds:t.Array(p()),pauseUntil:p({allowEmpty:!1,type:"date-time"})}),response:t.Object({})}),BB=["alert","alert_consider_zero","alert_no_data","keep_last_status_alert"],FB=["ok","ok_consider_zero","ok_no_data","keep_last_status_ok"],HB=[...BB,...FB],Xn=t.Enum(HB),KB=I("type",[t.Object({type:t.Literal("each"),subStates:t.Record(t.String(),t.Object({stateValue:t.Union([Xn,t.Null()]),lastChangedAt:T()}))}),t.Object({type:t.Literal("no_aggregation"),stateValue:t.Optional(Xn)}),t.Object({type:t.Literal("any"),stateValue:t.Optional(Xn)}),t.Object({type:t.Literal("all"),stateValue:t.Optional(Xn)}),t.Object({type:t.Literal("proportion"),stateValue:t.Optional(Xn)})]),zB=t.Object({monitorId:t.String(),currentState:KB,lastChangedAt:t.Optional(T())}),_9e=l({tags:["monitors"],url:`${gt}/states/:id`,method:"GET",params:t.Object({id:p()}),response:zB}),I9e=l({tags:["monitors"],url:`${gt}/:id/transitions`,method:"GET",params:t.Object({id:p()}),query:t.Object({from:t.Number(),to:t.Number()}),response:t.Array(t.Object({id:t.String(),createdAt:T(),fromState:t.Optional(Xn),toState:t.Optional(Xn),dimension:t.Optional(t.String())}))}),YB=["unprocessed","processed","failed-to-process"],b9e=l({tags:["monitors"],url:`${gt}/:id/results`,method:"GET",params:t.Object({id:p()}),query:t.Object({from:t.Number(),to:t.Number()}),response:t.Object({isTruncated:t.Boolean(),results:t.Array(t.Object({id:t.String(),evaluationAt:T(),formulaResult:t.Object({groups:t.Array(t.Object({groupKey:t.Record(t.String(),Ia),results:t.Array(t.Union([t.Number(),t.Null()])),conditionMet:t.Enum(["true","false","nan-no-data"])}))}),createdAt:T(),status:t.Enum(YB)}))})});var Ur="/v0/slos",VB=[7,30,90],QB=["good","bad"],jR=t.Enum(QB,{description:"How to treat SLO with no data: good (count as meeting the SLO), bad (count as breaching it)"}),WB=["good","bad","ignore"],qR=t.Enum(WB,{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)"}),DR=30,GR=1440,BR=["greater_than","less_than","greater_than_or_equal","less_than_or_equal"],ZB=["healthy","breached","no_data"],pp=t.Enum(ZB,{description:"SLO status: healthy (meeting the target), breached (breaching it), or no_data (not evaluated yet)"}),$R={sli:t.Optional(t.Number({description:"Service level indicator for the latest evaluation; absent when there is no data"})),errorBudget:t.Optional(t.Number({description:"Remaining error budget at the latest evaluation; negative when exhausted, absent when there is no data"})),status:pp},XB=t.Object({overall:t.Object($R,{description:"Latest overall evaluation for the cluster"}),perGroup:t.Array(t.Object({groupKey:t.Record(t.String(),Ia,{description:"Group-by field values identifying this group, keyed by field name. Present only when the SLO configuration sets `groupByFields`."}),...$R}),{description:"Latest evaluation for each group produced by the SLO configuration's `groupByFields`. Empty when the SLO is not grouped."})},{title:"SloClusterResults"}),FR=t.Record(t.String(),XB,{description:"Latest evaluation results keyed by cluster ID."}),md=t.Object({queries:_r,formula:zc},{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."}),ld=t.Object({queries:Ir,formula:$n},{title:"SloQueryFormula",description:"Aggregation queries combined by a formula to produce the SLO signal. Formulas reference queries as q1, q2, and so on."}),JB=t.Object({type:t.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:t.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"}),eF=t.Object({type:t.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:t.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 tF=t.Object({type:t.Literal("threshold",{description:"Alert configuration kind. Set to `threshold` for alerts that fire when the SLO indicator falls below a percentage threshold."}),threshold:t.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"}),rF=t.Object({type:t.Literal("threshold",{description:"Alert configuration kind. Set to `threshold` for alerts that fire when the SLO indicator falls below a percentage threshold."}),threshold:t.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"}),nF=I("type",[JB,tF],{description:"Alert trigger configuration: burn-rate or threshold"}),HR=I("type",[eF,rF],{description:"Alert trigger configuration: burn-rate or threshold"}),dd=t.Enum(ft,{description:"Alert priority (1 is highest, 5 is lowest)"}),fd=t.Object({id:t.String({description:"Tsuga-generated SLO alert ID assigned when the alert is created."}),sloId:t.String({description:"Parent SLO ID for this alert."}),priority:dd,configuration:nF,createdAt:T({description:"Timestamp when Tsuga created the alert."}),updatedAt:T({description:"Timestamp when Tsuga last updated the alert."}),assetUpdatedAt:T({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})},{title:"SloAlert"}),oF=t.Object({priority:dd,configuration:HR}),iF=t.Object({id:t.Optional(p({allowEmpty:!1,description:"Identifier of an existing alert to update. Omit to create a new alert on this SLO."})),priority:dd,configuration:HR}),aF=I("type",[t.Object({type:t.Literal("event",{description:"Configuration kind. Set to `event` for SLOs that compute SLI from good and total query formulas over the rolling timeframe."}),dataSource:zt,goodQuery:md,totalQuery:md,groupByFields:t.Optional(Bo),noDataBehavior:jR},{title:"EventSloConfiguration"}),t.Object({type:t.Literal("time",{description:"Configuration kind. Set to `time` for SLOs that evaluate a query against a threshold in fixed-size time slices."}),dataSource:zt,query:md,sliceSizeMinutes:t.Integer({description:"Length of each time-SLO evaluation slice in minutes. Required for `type: time`."}),threshold:t.Object({operator:t.Enum(BR,{description:"Comparison operator between the query value and the threshold"}),value:t.Number({description:"Threshold value compared against the query signal"})},{description:"Threshold comparison applied to each time-SLO evaluation slice"}),groupByFields:t.Optional(Bo),noDataBehavior:qR},{title:"TimeSliceSloConfiguration"})],{description:"SLI configuration for this SLO. Use `event` for good/total event-ratio SLOs or `time` for thresholded time-slice SLOs."}),sF=I("type",[t.Object({type:t.Literal("event",{description:"Configuration kind. Set to `event` for SLOs that compute SLI from good and total query formulas over the rolling timeframe."}),dataSource:zt,goodQuery:ld,totalQuery:ld,groupByFields:t.Optional(br),noDataBehavior:jR},{title:"EventSloConfiguration"}),t.Object({type:t.Literal("time",{description:"Configuration kind. Set to `time` for SLOs that evaluate a query against a threshold in fixed-size time slices."}),dataSource:zt,query:ld,sliceSizeMinutes:t.Integer({minimum:DR,maximum:GR,description:`Length of each time-SLO evaluation slice in minutes. Required for \`type: time\`. Valid input is ${DR} through ${GR}.`}),threshold:t.Object({operator:t.Enum(BR,{description:"Comparison operator between the query value and the threshold"}),value:t.Number({description:"Threshold value compared against the query signal"})},{description:"Threshold comparison applied to each time-SLO evaluation slice"}),groupByFields:t.Optional(br),noDataBehavior:qR},{title:"TimeSliceSloConfiguration"})],{description:"SLI configuration for this SLO. Use `event` for good/total event-ratio SLOs or `time` for thresholded time-slice SLOs."}),cF=t.Number({exclusiveMinimum:0,exclusiveMaximum:100,description:"Target percentage (0 < target < 100, e.g. 99.9)"}),KR=t.Enum(VB,{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."}),pF=t.Array(t.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."}),uF=t.Array(p({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."}),ti=t.Object({id:t.String({description:"Tsuga-generated SLO ID assigned when the SLO is created."}),name:t.String({description:"Display name of the SLO, set by the caller."}),description:t.Optional(t.String({description:"Free-form, caller-provided description of what the SLO measures. Absent when not set."})),tags:ke,configuration:aF,target:t.Number({description:"Target percentage (0 < target < 100, e.g. 99.9)"}),timeframeDays:KR,owner:t.String({description:"Team ID that owns the SLO"}),permissions:an,clusterIds:pF,creator:t.Optional(pe),updater:t.Optional(pe),alerts:t.Array(fd,{description:"Alerts attached to this SLO"}),createdAt:T({description:"Timestamp when Tsuga created the SLO."}),updatedAt:T({description:"Timestamp when Tsuga last updated the SLO."}),assetUpdatedAt:T({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})},{title:"Slo"}),mF=t.Object({...ti.properties,results:FR},{title:"SloWithResults"}),up=t.Object({name:p({allowEmpty:!1,description:"Display name of the SLO."}),description:t.Optional(p({type:"long",description:"Free-form, caller-provided description of what the SLO measures. Optional."})),tags:Qe,configuration:sF,target:cF,timeframeDays:KR,owner:p({allowEmpty:!1,description:"Team ID that owns the SLO"}),permissions:an,clusterIds:t.Optional(uF),alerts:t.Array(oF,{description:"Alerts to create on this SLO. Send an empty array for none."})}),gd=t.Object({...t.Omit(up,["alerts"]).properties,alerts:t.Array(iF,{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."})}),zR=t.Object({owners:je(p({allowEmpty:!1}),{description:"Restrict results to SLOs owned by any of these team IDs",maxItems:50}),searchQuery:t.Object({value:p({allowEmpty:!1,description:"Substring matched case-insensitively against the SLO name or SLO ID."}),exclude:t.Optional(t.Boolean({description:"If true, exclude SLOs matching this value instead of including them"}))},{description:"Text filter for SLO names or IDs. Optional; `exclude: true` removes matching SLOs."}),tags:je(Vt.items,{description:"Restrict results to SLOs that have at least one of the listed key/value tags",maxItems:50}),clusterIds:je(p({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:je(pp,{description:"Restrict results to SLOs whose status is one of these values",maxItems:3})},{description:"Optional filters applied to narrow the returned SLOs"}),yd=t.Partial(t.Object({...fe,filters:t.Partial(zR),sort:t.Object({by:t.Enum(["name","owner","tags","updatedAt","sli","errorBudget","status"],{description:"Field to sort by"}),direction:t.Enum(["asc","desc"],{description:"Sort direction: ascending or descending"})},{description:"Optional sorting applied to the returned SLOs"})})),v9e=l({tags:["slos"],url:`${Ur}/query`,method:"POST",paginated:!0,response:t.Array(mF),body:yd}),k9e=l({tags:["slos"],url:`${Ur}/tags/query`,method:"POST",body:t.Object({filters:t.Optional(t.Partial(t.Omit(zR,["tags","statuses"])))}),response:Yt}),M9e=l({tags:["slos"],url:`${Ur}/:id`,method:"GET",params:t.Object({id:p()}),response:ti}),D9e=l({tags:["slos"],url:`${Ur}/:id/results`,method:"GET",params:t.Object({id:p()}),response:FR}),G9e=l({tags:["slos"],url:Ur,method:"POST",body:up,response:ti}),$9e=l({tags:["slos"],url:`${Ur}/:id`,method:"PUT",params:t.Object({id:p()}),body:gd,response:ti}),j9e=l({tags:["slos"],url:`${Ur}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),q9e=l({tags:["slos"],url:`${Ur}/bulk-delete`,method:"DELETE",body:t.Object({ids:t.Array(p())}),response:t.Object({})}),B9e=l({tags:["slos"],url:`${Ur}/bulk-update`,method:"PUT",body:t.Object({sloIds:t.Array(p()),owner:p({allowEmpty:!1})}),response:t.Object({})});var ri="/v0/notifications",eo=`${ri}/rules`,YR=`${ri}/slack/setup`,Da=`${ri}/integrations`,Jn=["triggered","resolved","no-data"],lF=["sent","stale","pending","rate-limited","failed","silenced"],dF=t.Optional(t.Object({maxMessages:t.Integer({description:"Maximum number of notifications this target can send during the rate-limiting window."}),minutes:t.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."})),hd=t.Object({maxMessages:t.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:t.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."}),fF=t.Optional(hd),gF=t.Optional(t.Object({mode:t.Literal("each",{description:"Renotification mode. `each` sends repeat notifications for each matching monitor alert that remains in a configured state."}),renotificationStates:t.Array(t.Enum(["alert","alert_no_data"]),{description:"Monitor alert states that trigger repeat notifications while the target remains configured for renotification."}),renotifyIntervalMinutes:t.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."})),yF=t.Optional(t.Object({mode:t.Literal("each",{description:"Renotification mode. `each` sends repeat notifications for each matching monitor alert that remains in a configured state."}),renotificationStates:t.Array(t.Enum(["alert","alert_no_data"]),{description:"Monitor alert states that trigger repeat notifications while the target remains configured for renotification."}),renotifyIntervalMinutes:t.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."})),Ga=t.Object({id:t.String({description:"Identifier of the notification target within this rule, used with the rule ID for per-target delivery state such as rate limiting."}),rateLimit:dF,renotifyConfig:gF,config:I("type",[t.Object({type:t.Literal("slack",{description:"Slack target backed by a configured Slack integration."}),channel:t.String({description:"Slack channel ID that receives the notification"}),integrationId:t.String({description:"Slack workspace ID that receives the notification"}),integrationName:t.String({description:"Human readable name of the Slack integration"})},{$id:"RuleTargetConfigSlack"}),t.Object({type:t.Literal("incident-io",{description:"incident.io target backed by a configured incident.io integration."}),integrationId:t.String({description:"Identifier of the incident.io integration to use"}),integrationName:t.String({description:"Human readable name of the incident.io integration"})},{$id:"RuleTargetConfigIncidentIo"}),t.Object({type:t.Literal("email",{description:"Email target that sends directly to the listed addresses and does not require an integration."}),addresses:t.Array(t.String(),{description:"Email addresses that will receive the alert"})},{$id:"RuleTargetConfigEmail"}),t.Object({type:t.Literal("grafana-irm",{description:"Grafana IRM target backed by a configured Grafana IRM integration."}),integrationId:t.String({description:"Identifier of the Grafana IRM integration to use"}),integrationName:t.String({description:"Human readable name of the Grafana IRM integration"})},{$id:"RuleTargetConfigGrafanaIrm"}),t.Object({type:t.Literal("pagerduty",{description:"PagerDuty target backed by a configured PagerDuty integration."}),integrationId:t.String({description:"Identifier of the PagerDuty integration to use"}),integrationName:t.String({description:"Human readable name of the PagerDuty integration"})},{$id:"RuleTargetConfigPagerDuty"}),t.Object({type:t.Literal("microsoft-teams",{description:"Microsoft Teams target backed by a configured Microsoft Teams integration."}),integrationId:t.String({description:"Identifier of the Microsoft Teams integration to use"}),integrationName:t.String({description:"Human readable name of the Microsoft Teams integration"})},{$id:"RuleTargetConfigMicrosoftTeams"}),t.Object({type:t.Literal("webhook",{description:"Webhook target backed by a configured webhook integration."}),integrationId:t.String({description:"Identifier of the webhook integration to use"}),integrationName:t.String({description:"Human readable name of the webhook integration"})},{$id:"RuleTargetConfigWebhook"}),t.Object({type:t.Literal("servicenow",{description:"ServiceNow target backed by a configured ServiceNow integration."}),integrationId:t.String({description:"Identifier of the ServiceNow integration to use"}),integrationName:t.String({description:"Human readable name of the ServiceNow integration"})},{$id:"RuleTargetConfigServiceNow"}),t.Object({type:t.Literal("google-chat",{description:"Google Chat target backed by a configured Google Chat integration."}),integrationId:t.String({description:"Identifier of the Google Chat integration to use"}),integrationName:t.String({description:"Human readable name of the Google Chat integration"})},{$id:"RuleTargetConfigGoogleChat"}),t.Object({type:t.Literal("squadcast",{description:"Squadcast target backed by a configured Squadcast integration."}),integrationId:t.String({description:"Identifier of the Squadcast integration to use"}),integrationName:t.String({description:"Human readable name of the Squadcast integration"})},{$id:"RuleTargetConfigSquadcast"}),t.Object({type:t.Literal("jira",{description:"Jira target backed by a configured Jira integration."}),integrationId:t.String({description:"Identifier of the Jira integration to use"}),integrationName:t.String({description:"Human readable name of the Jira integration"}),projectKey:t.String({description:'Key of the Jira project that alert issues are filed into, like "OPS".'}),issueType:t.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`."})}),ni=t.Object({id:p({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:fF,config:I("type",[t.Object({type:t.Literal("slack",{description:"Slack target backed by a configured Slack integration."}),channel:p({allowEmpty:!1,description:"Slack channel ID that receives the notification"}),integrationId:p({allowEmpty:!1,description:"Slack workspace ID that receives the notification"})},{$id:"RuleTargetInputSlack"}),t.Object({type:t.Literal("incident-io",{description:"incident.io target backed by a configured incident.io integration."}),integrationId:p({allowEmpty:!1,description:"Identifier of the incident.io integration to use"})},{$id:"RuleTargetInputIncidentIo"}),t.Object({type:t.Literal("pagerduty",{description:"PagerDuty target backed by a configured PagerDuty integration."}),integrationId:p({allowEmpty:!1,description:"Identifier of the PagerDuty integration to use"})},{$id:"RuleTargetInputPagerDuty"}),t.Object({type:t.Literal("email",{description:"Email target that sends directly to the listed addresses and does not require an integration."}),addresses:t.Array(p({type:"email"}),{minItems:1,maxItems:20,description:"Email addresses that will receive the alert"})},{$id:"RuleTargetInputEmail"}),t.Object({type:t.Literal("grafana-irm",{description:"Grafana IRM target backed by a configured Grafana IRM integration."}),integrationId:p({allowEmpty:!1,description:"Identifier of the Grafana IRM integration to use"})},{$id:"RuleTargetInputGrafanaIrm"}),t.Object({type:t.Literal("microsoft-teams",{description:"Microsoft Teams target backed by a configured Microsoft Teams integration."}),integrationId:p({allowEmpty:!1,description:"Identifier of the Microsoft Teams integration to use"})},{$id:"RuleTargetInputMicrosoftTeams"}),t.Object({type:t.Literal("webhook",{description:"Webhook target backed by a configured webhook integration."}),integrationId:p({allowEmpty:!1,description:"Identifier of the webhook integration to use"})},{$id:"RuleTargetInputWebhook"}),t.Object({type:t.Literal("servicenow",{description:"ServiceNow target backed by a configured ServiceNow integration."}),integrationId:p({allowEmpty:!1,description:"Identifier of the ServiceNow integration to use"})},{$id:"RuleTargetInputServiceNow"}),t.Object({type:t.Literal("google-chat",{description:"Google Chat target backed by a configured Google Chat integration."}),integrationId:p({allowEmpty:!1,description:"Identifier of the Google Chat integration to use"})},{$id:"RuleTargetInputGoogleChat"}),t.Object({type:t.Literal("squadcast",{description:"Squadcast target backed by a configured Squadcast integration."}),integrationId:p({allowEmpty:!1,description:"Identifier of the Squadcast integration to use"})},{$id:"RuleTargetInputSquadcast"}),t.Object({type:t.Literal("jira",{description:"Jira target backed by a configured Jira integration."}),integrationId:p({allowEmpty:!1,description:"Identifier of the Jira integration to use"}),projectKey:p({allowEmpty:!1,description:'Key of the Jira project that alert issues are filed into, like "OPS".'}),issueType:p({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:yF}),Td=I("type",[t.Object({type:t.Literal("specific-teams",{description:"Match alert transitions associated with the listed teams. The caller must be allowed to access every listed team."}),teams:t.Array(t.String(),{description:"Team IDs selected by this filter."})},{title:"SpecificTeams"}),t.Object({type:t.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"}),t.Object({type:t.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."}),Ed=I("type",[t.Object({type:t.Literal("specific-teams",{description:"Match alert transitions associated with the listed teams. The caller must be allowed to access every listed team."}),teams:t.Array(p(),{minItems:1,maxItems:100,description:"Team IDs selected by this filter."})},{title:"SpecificTeams"}),t.Object({type:t.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"}),t.Object({type:t.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."}),oi=t.Object({id:t.String({description:"Tsuga-generated notification rule ID assigned when the rule is created."}),name:t.String({description:"Display name of the notification rule."}),queryString:t.Optional(t.String({description:"Optional query that narrows which alert transitions trigger the rule. Matches on the monitor transition group key and the monitor tags, e.g. `env:prod service:api`. Omit or leave empty to match regardless of tags."})),teamsFilter:Td,prioritiesFilter:t.Array(t.Enum(ft),{description:"Monitor priorities that must match for this rule to fire. An empty array matches every priority."}),transitionTypesFilter:t.Array(t.Enum(Jn),{description:"Alert state transitions that must match for this rule to fire. An empty array matches every transition type."}),clusterIdsFilter:t.Array(t.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:t.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:t.Boolean({description:"Whether the rule currently sends notifications when its filters match."}),tags:ke,targets:t.Array(Ga,{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:t.Optional(pe),updater:t.Optional(pe)}),$a=t.Object({name:p({description:"Display name of the notification rule."}),queryString:t.Optional(p({type:"tags-query",description:"Optional query that narrows which alert transitions trigger the rule. Matches on the monitor transition group key and the monitor tags, e.g. `env:prod service:api`. Omit or leave empty to match regardless of tags."})),teamsFilter:Ed,prioritiesFilter:t.Array(t.Enum(ft),{maxItems:ft.length,description:"Monitor priorities that must match for this rule to fire. An empty array matches every priority."}),transitionTypesFilter:t.Array(t.Enum(Jn),{maxItems:Jn.length,description:"Alert state transitions that must match for this rule to fire. An empty array matches every transition type."}),clusterIdsFilter:t.Optional(t.Array(p({allowEmpty:!1}),{description:"Cluster IDs that must match for this rule to fire. Omit it, or leave it empty, to match every cluster."})),owner:p({allowEmpty:!1,description:"Team ID that owns and manages the rule"}),tags:Qe,isActive:t.Boolean({description:"Set to true for the rule to send notifications when its filters match."}),targets:t.Array(ni,{minItems:1,description:"Destinations that receive a notification whenever this rule matches an alert transition. This list replaces the existing targets on update."})}),mp=t.Object({id:t.String({description:"Unique identifier of the adaptive notification rule. Generated by Tsuga."}),name:t.String({description:"Display name of the adaptive notification rule."}),owner:t.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:t.Boolean({description:"Whether the rule currently sends notifications when one of its monitors fires."}),tags:ke,monitorIds:t.Array(t.String(),{description:"Monitors this rule reacts to."}),fallbackTarget:Ga,creator:t.Optional(pe),updater:t.Optional(pe)}),VR=t.Object({name:p({description:"Display name of the adaptive notification rule."}),owner:p({allowEmpty:!1,description:"Team ID that owns and manages the rule"}),tags:Qe,isActive:t.Boolean({description:"Set to true for the rule to send notifications when one of its monitors fires."}),monitorIds:t.Array(p({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:ni}),Z9e=l({tags:["notification-rules"],url:eo,method:"GET",paginated:!0,query:t.Object(fe),response:t.Array(oi)}),X9e=l({tags:["notification-rules"],url:`${eo}/:id`,params:t.Object({id:p()}),method:"GET",response:oi}),J9e=l({tags:["notification-rules"],url:eo,method:"POST",body:$a,response:oi}),eYe=l({tags:["notification-rules"],url:`${eo}/:id`,method:"PUT",params:t.Object({id:p()}),body:$a,response:oi}),tYe=l({tags:["notification-rules"],url:`${eo}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),ja=`${ri}/adaptive-rules`,rYe=l({tags:["notification-rules"],url:ja,method:"GET",paginated:!0,query:t.Object(fe),response:t.Array(mp)}),nYe=l({tags:["notification-rules"],url:`${ja}/:id`,params:t.Object({id:p()}),method:"GET",response:mp}),oYe=l({tags:["notification-rules"],url:ja,method:"POST",body:VR,response:mp}),iYe=l({tags:["notification-rules"],url:`${ja}/:id`,method:"PUT",params:t.Object({id:p()}),body:VR,response:mp}),aYe=l({tags:["notification-rules"],url:`${ja}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),sYe=l({tags:["notification-integrations"],url:`${YR}/start`,method:"POST",response:t.Object({redirectUrl:t.String()})}),hF=["google-chat","grafana-irm","incident-io","jira","microsoft-teams","pagerduty","servicenow","slack","squadcast","webhook"],TF=t.Object({id:t.String(),name:t.String(),type:t.Enum(hF),createdAt:T(),ruleCount:t.Number(),creator:t.Optional(pe)}),cYe=l({tags:["notification-integrations"],url:`${eo}/integrations`,method:"GET",paginated:!0,query:t.Object(fe),response:t.Array(TF)}),pYe=l({tags:["notification-integrations"],url:`${YR}/callback`,method:"GET",query:t.Object({code:p()}),response:t.Object({success:t.Boolean()})}),_d=["POST","PUT"],EF=t.Record(t.String(),t.String()),_F=t.Record(t.String(),t.Unknown()),IF=t.Record(t.String(),t.Union([t.String(),t.Number(),t.Boolean(),t.Null(),t.Array(t.Union([t.String(),t.Number(),t.Boolean()]))])),bF=I("type",[t.Object({type:t.Literal("json"),value:_F}),t.Object({type:t.Literal("form"),value:IF})]),SF=t.Object({ok:t.String(),alert:t.String()}),Id=t.Object({id:t.String(),name:t.String(),setting:I("type",[t.Object({type:t.Literal("incident-io"),alertSourceConfigId:t.String(),tokenLastChars:t.String()}),t.Object({type:t.Literal("grafana-irm"),urlLastChars:t.String()}),t.Object({type:t.Literal("pagerduty"),integrationKeyLastChars:t.String()}),t.Object({type:t.Literal("microsoft-teams"),webhookUrlLastChars:t.String()}),t.Object({type:t.Literal("webhook"),urlLastChars:t.String(),method:t.Enum(_d),authentication:I("type",[t.Object({type:t.Literal("bearer"),tokenLastChars:t.String()}),t.Object({type:t.Literal("basic"),username:t.String(),passwordLastChars:t.String()}),t.Object({type:t.Literal("custom-header"),key:t.String(),valueLastChars:t.String()}),t.Object({type:t.Literal("none")})]),customHeaders:t.Optional(EF),payloadTemplate:bF,eventNameMapping:t.Optional(SF)}),t.Object({type:t.Literal("servicenow"),instanceName:t.String(),username:t.String(),passwordLastChars:t.String()}),t.Object({type:t.Literal("google-chat"),webhookUrlLastChars:t.String()}),t.Object({type:t.Literal("squadcast"),webhookUrlLastChars:t.String()}),t.Object({type:t.Literal("jira"),siteUrl:t.String(),email:t.String(),apiTokenLastChars:t.String()})]),tags:ke}),OF=t.Object({type:t.Literal("webhook"),url:p({type:"uri"}),method:t.Enum(_d),authentication:I("type",[t.Object({type:t.Literal("bearer"),token:p({allowEmpty:!1})}),t.Object({type:t.Literal("basic"),username:p({allowEmpty:!1}),password:p({allowEmpty:!1})}),t.Object({type:t.Literal("custom-header"),key:p({allowEmpty:!1}),value:p({allowEmpty:!1})}),t.Object({type:t.Literal("none")})]),customHeaders:t.Record(p({allowEmpty:!1}),p()),payloadTemplate:I("type",[t.Object({type:t.Literal("json"),value:t.Record(p({allowEmpty:!1}),t.Unknown())}),t.Object({type:t.Literal("form"),value:t.Record(p({allowEmpty:!1}),t.Union([t.String(),t.Number(),t.Boolean(),t.Null(),t.Array(t.Union([t.String(),t.Number(),t.Boolean()]))]))})]),eventNameMapping:t.Optional(t.Object({ok:p({allowEmpty:!1}),alert:p({allowEmpty:!1})}))}),QR=t.Object({type:t.Literal("incident-io"),alertSourceConfigId:p(),token:p()}),WR=t.Object({type:t.Literal("grafana-irm"),url:p({type:"uri"})}),ZR=t.Object({type:t.Literal("pagerduty"),integrationKey:p()}),XR=t.Object({type:t.Literal("microsoft-teams"),webhookUrl:p({type:"uri"})}),AF=t.Object({type:t.Literal("servicenow"),instanceName:p({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:p({allowEmpty:!1}),password:p({allowEmpty:!1})}),xF=t.Object({type:t.Literal("google-chat"),webhookUrl:p({type:"uri"})}),RF=t.Object({type:t.Literal("squadcast"),webhookUrl:p({type:"uri"})}),CF=t.Object({type:t.Literal("jira"),siteUrl:p({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:p({type:"email",allowEmpty:!1,description:"Atlassian account email used together with the API token for Basic authentication."}),apiToken:p({allowEmpty:!1,description:"Atlassian API token minted for the account, used as the Basic auth password."})}),PF=t.Object({name:p(),setting:I("type",[QR,WR,ZR,XR,OF,AF,xF,RF,CF]),tags:Qe}),UF=t.Object({type:t.Literal("webhook"),url:t.Optional(p({type:"uri"})),method:t.Optional(t.Enum(_d)),authentication:t.Optional(I("type",[t.Object({type:t.Literal("bearer"),token:t.Optional(p({allowEmpty:!1}))}),t.Object({type:t.Literal("basic"),username:t.Optional(p({allowEmpty:!1})),password:t.Optional(p({allowEmpty:!1}))}),t.Object({type:t.Literal("custom-header"),key:t.Optional(p({allowEmpty:!1})),value:t.Optional(p({allowEmpty:!1}))}),t.Object({type:t.Literal("none")})])),customHeaders:t.Optional(t.Record(p({allowEmpty:!1}),p())),payloadTemplate:t.Optional(I("type",[t.Object({type:t.Literal("json"),value:t.Record(p({allowEmpty:!1}),t.Unknown())}),t.Object({type:t.Literal("form"),value:t.Record(p({allowEmpty:!1}),t.Union([t.String(),t.Number(),t.Boolean(),t.Null(),t.Array(t.Union([t.String(),t.Number(),t.Boolean()]))]))})])),eventNameMapping:t.Optional(t.Object({ok:t.Optional(p({allowEmpty:!1})),alert:t.Optional(p({allowEmpty:!1}))}))}),wF=t.Object({type:t.Literal("servicenow"),instanceName:t.Optional(p({allowEmpty:!1})),username:t.Optional(p({allowEmpty:!1})),password:t.Optional(p({allowEmpty:!1}))}),NF=t.Object({type:t.Literal("jira"),siteUrl:t.Optional(p({type:"uri",allowEmpty:!1})),email:t.Optional(p({allowEmpty:!1})),apiToken:t.Optional(p({allowEmpty:!1}))}),LF=t.Object({type:t.Literal("google-chat"),webhookUrl:p({type:"uri"})}),vF=t.Object({type:t.Literal("squadcast"),webhookUrl:p({type:"uri"})}),kF=t.Object({name:t.Optional(p()),setting:t.Optional(I("type",[QR,WR,ZR,XR,UF,wF,LF,vF,NF]))}),uYe=l({tags:["notification-integrations"],url:Da,method:"POST",body:PF,response:Id}),mYe=l({tags:["notification-integrations"],url:`${Da}/:id`,method:"GET",params:t.Object({id:p()}),response:Id}),lYe=l({tags:["notification-integrations"],url:`${Da}/:id`,method:"PUT",params:t.Object({id:p()}),body:kF,response:Id}),dYe=l({tags:["notification-integrations"],url:`${Da}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),MF=I("status",[t.Object({status:t.Literal("ok",{description:"Tsuga reached Jira and listed the projects the credentials can file into."}),projects:t.Array(t.Object({key:t.String({description:'Jira project key, like "OPS".'}),name:t.String({description:"Human readable Jira project name."}),issueTypes:t.Array(t.String(),{description:"Issue type names available when creating an issue in this project."}),statuses:t.Array(t.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"}),t.Object({status:t.Literal("error",{description:"Tsuga could not load Jira metadata with the stored credentials."}),message:t.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."}),fYe=l({tags:["notification-integrations"],url:`${Da}/:id/jira-metadata`,method:"GET",params:t.Object({id:p()}),response:MF}),gYe=l({tags:["notification-rules"],url:`${gt}/:id/notifications`,method:"GET",params:t.Object({id:p()}),query:t.Optional(t.Object({from:t.Optional(t.Number()),to:t.Optional(t.Number())})),response:t.Object({notifications:t.Array(t.Object({id:t.String(),monitorId:t.String(),monitorResultId:t.String(),ruleId:t.Optional(t.String()),targetId:t.Optional(t.String()),status:t.Enum(lF),tryCount:t.Number(),nextTryAt:T(),createdAt:T(),updatedAt:T(),sentAt:t.Optional(T())})),isTruncated:t.Boolean()})}),DF=["slack","incident-io","pagerduty","email","grafana-irm","microsoft-teams","webhook","servicenow","google-chat","squadcast","jira"],yYe=l({tags:["notification-rules"],url:`${eo}/test`,method:"POST",body:t.Object({notificationRule:$a,targetIds:t.Optional(t.Array(p({allowEmpty:!1}),{description:"Target IDs to test specific targets",minItems:1,maxItems:10}))}),response:t.Union([t.Object({success:t.Literal(!1),overallMessage:t.String({description:"Message when there is an overall error"})}),t.Object({success:t.Boolean(),results:t.Array(t.Object({targetId:t.String({description:"The ID of the target that was tested"}),targetType:t.Enum(DF,{description:"The type of the target (e.g., slack, webhook)"}),status:t.Enum(["success","failure"],{description:"Whether the test notification was sent successfully"}),message:t.Optional(t.String({description:"Message if the notification failed for this specific target"}))}))})])});var Lt="/v0/service-catalog";var GF=t.Object({team:t.String({description:"Team name observed on telemetry for this service."}),lastSeenAt:T({description:"Most recent time this team was observed for the service."})},{description:"A team name observed on telemetry for this service, with the last time it was seen."}),$F=t.Object({ingestionApiKey:t.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."})},{description:"An ingestion API key observed on telemetry for this service, with the last time it was seen."}),jF=t.Object({version:t.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:t.Optional(t.Boolean({description:"Whether Tsuga detected this version as associated with faulty behavior."})),faultyLatency:t.Optional(t.Boolean({description:"Whether the faulty behavior Tsuga detected for this version is a latency degradation. Only set by faulty deployment detection when it reports on latency; absent when the detection did not evaluate latency."})),detectionTriggered:t.Optional(t.Boolean({description:"Whether faulty deployment detection has already been triggered for this version. Set when the detection job is launched to avoid re-triggering it. Absent on versions predating this field."}))},{description:"A service version observed in telemetry, with first and last seen timestamps and faulty deployment detection results."}),qF=t.Object({language:t.String({description:"Programming language observed for this service."}),lastSeenAt:T({description:"Most recent time this language was observed."})},{description:"A programming language observed for this service, with the last time it was seen."}),BF=t.Object({runtime:t.String({description:"Runtime observed for this service."}),lastSeenAt:T({description:"Most recent time this runtime was observed."})},{description:"A runtime observed for this service, with the last time it was seen."}),JR=t.Object({protocol:t.String({description:"Observed API protocol (e.g. 'http', 'grpc', 'graphql')"}),lastSeenAt:T({description:"Most recent observation timestamp"})},{description:"An API protocol observed for this service, with the last time it was seen."}),FF=t.Object({framework:t.String({description:"Observed application framework (e.g. 'express', 'fastify', 'django', 'rails')"}),lastSeenAt:T({description:"Most recent observation timestamp"})},{description:"An application framework detected from OpenTelemetry instrumentation scope, with the last time it was seen."}),HF=t.Object({platform:t.String({description:"Observed cloud or orchestration platform (e.g. 'aws_eks', 'kubernetes')"}),lastSeenAt:T({description:"Most recent observation timestamp"})},{description:"A cloud or orchestration platform this service runs on, with the last time it was seen."}),KF=t.Object({provider:t.String({description:"Observed cloud provider (e.g. 'aws', 'gcp', 'azure')"}),lastSeenAt:T({description:"Most recent observation timestamp"})},{description:"A cloud provider this service runs on, with the last time it was seen."}),qa=t.Object({id:t.String({description:"Unique identifier of this service. Use it with service detail and graph endpoints."}),serviceName:t.String({description:"OpenTelemetry service name observed in telemetry."}),serviceNamespace:t.Optional(t.String({description:"OpenTelemetry service namespace observed in telemetry."})),env:t.Optional(t.String({description:"Environment value observed for this service."})),teams:t.Array(GF,{description:"Team names observed on telemetry for this service and when each was last seen."}),ingestionApiKeys:t.Array($F,{description:"Ingestion API keys observed on telemetry for this service and when each was last seen."}),versions:t.Array(jF,{description:"Service version values observed in telemetry, including first and last seen timestamps."}),languages:t.Array(qF,{description:"Programming languages observed for this service."}),runtimes:t.Array(BF,{description:"Runtime values observed for this service."}),serverProtocols:t.Array(JR,{description:"API protocols this service exposes (from server-kind spans)"}),clientProtocols:t.Array(JR,{description:"API protocols this service calls out over (from client-kind spans)"}),frameworks:t.Array(FF,{description:"Application frameworks detected from OTel instrumentation scope"}),cloudPlatforms:t.Array(HF,{description:"Cloud platforms this service is running on"}),cloudProviders:t.Array(KF,{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:t.Array(t.String(),{description:"Telemetry sources that contributed evidence for this service entry."}),additionalUserFields:t.Optional(t.Unsafe({type:"object",additionalProperties:!0,description:"Additional user-defined service metadata, when configured."})),logsCount24h:t.Number({description:"Number of logs observed for this service in the last 24 hours."}),errorLogsCount24h:t.Number({description:"Number of error logs observed for this service in the last 24 hours."}),tracesCount24h:t.Number({description:"Number of traces observed for this service in the last 24 hours."}),errorTracesCount24h:t.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."})}),RYe=l({tags:["service-catalog"],query:t.Object({...fe,clusterId:t.Optional(p())}),method:"GET",paginated:!0,url:`${Lt}/services`,response:t.Array(qa)}),zF=t.Object({spanKind:t.Enum(gR),count:t.Number()}),eC=t.Object({...qa.properties,spanKindCounts:t.Array(zF),envs:t.Object({primaryEnv:t.String(),allEnvs:t.Array(t.String())})}),CYe=l({tags:["service-catalog"],query:t.Object({...fe,clusterId:t.Optional(p()),env:t.Optional(p())}),method:"GET",paginated:!0,url:`${Lt}/v2/services`,response:t.Array(eC)}),PYe=l({tags:["service-catalog"],query:t.Object({serviceName:p({allowEmpty:!1}),serviceNamespace:t.Optional(p({allowEmpty:!1})),env:p({allowEmpty:!1}),clusterId:t.Optional(p())}),method:"GET",url:`${Lt}/v2/service`,response:eC}),UYe=l({tags:["service-catalog"],method:"GET",url:`${Lt}/services/:serviceId`,params:t.Object({serviceId:p()}),response:qa}),bd=t.Object({id:t.String({description:"Tsuga-generated identifier of this service target, unique across all services. Used with delivery state such as rate limiting and re-notification."}),serviceId:t.String({description:"Identifier of the service catalog entry this target is attached to."}),config:Ga.properties.config,rateLimit:Ga.properties.rateLimit,createdAt:T({description:"Timestamp when user created this service target."}),updatedAt:T({description:"Timestamp when user last updated this service target."})}),YF=t.Object({config:ni.properties.config,rateLimit:ni.properties.rateLimit}),VF=t.Object({config:ni.properties.config,rateLimit:t.Union([hd,t.Null()])}),wYe=l({tags:["service-catalog"],method:"GET",url:`${Lt}/services/:serviceId/targets`,params:t.Object({serviceId:p()}),response:t.Array(bd)}),NYe=l({tags:["service-catalog"],method:"POST",url:`${Lt}/services/:serviceId/targets`,params:t.Object({serviceId:p()}),body:YF,response:bd}),LYe=l({tags:["service-catalog"],method:"PUT",url:`${Lt}/services/:serviceId/targets/:targetId`,params:t.Object({serviceId:p(),targetId:p()}),body:VF,response:bd}),vYe=l({tags:["service-catalog"],method:"DELETE",url:`${Lt}/services/:serviceId/targets/:targetId`,params:t.Object({serviceId:p(),targetId:p()}),response:R}),QF=["otel_kube","otel_host_kube","otel_host","prometheus","aws_ec2","gcp_compute_engine"];var tC=t.Object({id:t.String(),hostName:t.String(),env:t.Optional(t.String()),cpuUtilizationAverage:t.Number(),hostType:t.Enum(QF),teams:t.Array(t.String()),tags:t.Array(t.String()),firstSeenAt:T(),lastSeenAt:T(),clusterId:t.String()}),kYe=l({tags:["service-catalog"],method:"GET",url:`${Lt}/hosts`,response:t.Array(tC)}),MYe=l({tags:["service-catalog"],method:"GET",url:`${Lt}/hosts/:hostId`,params:t.Object({hostId:p()}),response:tC}),WF=["http","rpc","messaging","genai","object_store"],rC={name:t.String({description:"Service or inferred dependency name shown in the graph."}),env:t.Optional(t.String({description:"Environment observed from spans."}))},Sd=t.Object({...rC,nodeType:t.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:t.Union([t.String(),t.Null()],{description:"Service ID, or null when multiple namespaces match the observed service name."}),namespace:t.Union([t.String(),t.Null()],{description:"Service namespace, or null when multiple namespaces match the observed service name."}),errorRate:t.Optional(t.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:t.Number({description:"Number of entry requests on this service where at least one entry span had error status."}),entryRequestCount:t.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."})}),nC={...rC,endpoint:t.Optional(t.String({description:"Inferred service endpoint address"})),resourceName:t.Optional(t.String({description:"Inferred resource name, e.g. table or queue name"}))},Od=t.Object({...nC,nodeType:t.Literal("inferred_db",{description:"Discriminator for this node variant. Always `inferred_db` for a database dependency detected from client-span attributes that could not be matched to a service catalog entry."}),serviceType:t.Literal("db",{description:"Inferred dependency type. Always `db` for this node variant."}),databaseName:t.Optional(t.String({description:"Database name from span_attributes db.namespace (falling back to legacy db.name). Matches the database catalog `name`."})),databaseSystem:t.String({description:"Database system from span_attributes db.system.name (falling back to legacy db.system). Matches the database catalog `databaseSystem`."})}),Ad=t.Object({...nC,nodeType:t.Literal("inferred",{description:"Discriminator for this node variant. Always `inferred` for a non-database dependency detected from client-span attributes (e.g. a queue or external HTTP call) that could not be matched to a service catalog entry. Database dependencies use the `inferred_db` variant."}),serviceType:t.Enum(WF,{description:"Inferred dependency type from span metadata: http, rpc, messaging, genai, or object_store."})}),ZF=I("nodeType",[Sd,Od,Ad]),xd=t.Object({from:t.Object({env:t.Optional(t.String({description:"Environment of the source node"})),name:t.String({description:"Name of the source node"})},{description:"Reference to the caller node, i.e. the service or dependency that issued the request."}),to:t.Object({env:t.Optional(t.String({description:"Environment of the target node"})),name:t.String({description:"Name of the target node"}),databaseSystem:t.Optional(t.String({description:"Database system of the target when it is an inferred database node (`inferred_db`). Together with `name` and `env` it identifies the target node, distinguishing a database from a same-named service or a same-named database on another system."}))},{description:"Reference to the callee node, i.e. the service or dependency that received the request."}),count:t.Number({description:"Number of cross-service transitions observed on this directed edge in the graph query window."}),errorRate:t.Optional(t.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:t.Number({description:"Number of client spans with error status observed on this edge"}),clientSpanCount:t.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."}),DYe=l({tags:["service-catalog"],url:`${Lt}/services/:serviceId/graph`,method:"GET",params:t.Object({serviceId:p()}),query:t.Object({...Ke.properties,query:t.Optional(p({type:"tsuga-query"}))}),response:t.Object({clusterId:t.String(),nodes:t.Array(ZF),edges:t.Array(xd)})}),XF=t.Object({monitors:t.Array(t.Object({id:t.String({description:"Identifier of the monitor"}),name:t.String({description:"Display name of the monitor"}),owner:t.String({description:"Team ID that owns the monitor"}),priority:t.Enum(ft,{description:"Priority of the monitor"})})),slos:t.Array(t.Object({id:t.String({description:"Identifier of the SLO"}),name:t.String({description:"Display name of the SLO"}),owner:t.String({description:"Team ID that owns the SLO"}),statusCount:t.Partial(t.Record(pp,t.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"})}))}),GYe=l({tags:["service-catalog"],method:"GET",url:`${Lt}/services/:serviceId/related-resources`,params:t.Object({serviceId:p()}),response:XF}),$Ye=l({tags:["service-catalog"],method:"GET",url:`${Lt}/services/by-api-keys`,response:t.Record(t.String(),t.Array(t.Object({serviceName:t.String(),serviceNamespace:t.Optional(t.String())})))});var Rd=`/${"v1"}/services`,Cd=t.Pick(qa,["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)."}),JF={id:"123-456-abc",serviceName:"api-gateway",serviceNamespace:"platform",env:"production",teams:[{team:"platform",lastSeenAt:"2024-01-15T12:34:56.000Z"}],versions:[{version:"1.2.3",firstSeenAt:"2024-01-01T08:00:00.000Z",lastSeenAt:"2024-01-15T12:34:56.000Z",faulty:!0,faultyLatency:!0}],languages:[{language:"go",lastSeenAt:"2024-01-15T12:34:56.000Z"}],runtimes:[{runtime:"go",lastSeenAt:"2024-01-15T12:34:56.000Z"}],serverProtocols:[{protocol:"http",lastSeenAt:"2024-01-15T12:34:56.000Z"}],clientProtocols:[{protocol:"grpc",lastSeenAt:"2024-01-15T12:34:56.000Z"}],frameworks:[{framework:"gin",lastSeenAt:"2024-01-15T12:34:56.000Z"}],cloudPlatforms:[{platform:"aws_eks",lastSeenAt:"2024-01-15T12:34:56.000Z"},{platform:"kubernetes",lastSeenAt:"2024-01-15T12:34:56.000Z"}],cloudProviders:[{provider:"aws",lastSeenAt:"2024-01-15T12:34:56.000Z"}],lastSeenAt:"2024-01-15T12:34:56.000Z",firstSeenAt:"2024-01-01T08:00:00.000Z",sources:["logs","metrics","traces"],logsCount24h:12e3,errorLogsCount24h:42,tracesCount24h:8500,errorTracesCount24h:17};Object.assign(Cd,{examples:[JF]});var oC=l({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:Rd,method:"GET",paginated:!0,query:t.Object({...He,clusterId:t.Optional(p({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:t.Array(Cd)}),iC=l({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:`${Rd}/:serviceId`,method:"GET",params:t.Object({serviceId:p({allowEmpty:!1,description:"Identifier of the service to retrieve. Use the `id` returned by service list responses."})}),response:Cd}),eH=t.Pick(Sd,["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."}),tH=t.Pick(Ad,["name","env","nodeType","serviceType","endpoint","resourceName"],{$id:"InferredServiceGraphNode",description:"Dependency node detected from client-span attributes (e.g. a queue or external HTTP call) that could not be matched to a service catalog entry. Database dependencies use the `inferred_db` variant."}),rH=t.Pick(Od,["name","env","nodeType","serviceType","endpoint","resourceName"],{$id:"InferredDbServiceGraphNode",description:"Database dependency node detected from client-span attributes that could not be matched to a service catalog entry."}),nH=I("nodeType",[eH,rH,tH]),oH=t.Pick(xd,["from","to","count","errorRate","errorCount","clientSpanCount"],{$id:"ServiceGraphEdge",description:"Directed dependency edge from a caller node (`from`) to a callee node (`to`), with call-volume and error counts observed over the query window."}),iH=t.Optional(t.Integer({...Ke.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."})),aH=t.Optional(t.Integer({...Ke.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."})),sH=p({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."}),aC=l({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:`${Rd}/:serviceId/graph`,method:"GET",params:t.Object({serviceId:p({allowEmpty:!1,description:"Identifier of the service to use as the graph root. Use the `id` returned by service list or get responses."})}),query:t.Object({from:iH,to:aH,query:t.Optional(sH)},{description:"Service graph query. Use time range and optional span query filters."}),response:t.Object({clusterId:t.String({description:"Cluster ID the graph was built from"}),nodes:t.Array(nH,{description:"Observed and inferred nodes included in the service dependency graph."}),edges:t.Array(oH,{description:"Directed dependency edges between graph nodes."})})});function sC(e,r){let n=r??Tr(e);return n===void 0?void 0:js(n)}function Pd(e){let r=Tr(e);return r===void 0?"":` (default: ${r})`}function cC(e,r){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${Pd("from")}`).option("--to <timestamp>",`End of time range${Pd("to")}`).option("--query <query>",`Search query${Pd("query")}`).action(async(o,i)=>{let a={},c=sC("from",i.from),m=sC("to",i.to);c!==void 0&&(a.from=c),m!==void 0&&(a.to=m),i.query!==void 0&&(a.query=i.query);let d=await r()(aC,{params:{serviceId:o},query:a});Q(d)})}var cH=`/${"v1"}/grok`,pH=25,uH=100,pC=t.Object({rules:t.Array(p({allowEmpty:!1,type:"long",description:"Grok parsing rule to preview against each sample. The rule uses the same Grok syntax as the log route **Grok parser** processor, for example `pod:%{DATA:namespace}/%{DATA:name}`."}),{minItems:1,maxItems:pH,description:"Ordered Grok parsing rules to preview. For each sample, Tsuga tries the rules in order and returns the first successful match, matching route Grok processor semantics."}),samples:t.Array(p({allowEmpty:!1,type:"long",description:"Raw log line to parse with the provided Grok rules. The value is parsed as preview input only; this endpoint does not ingest or store the sample."}),{minItems:1,maxItems:uH,description:"Sample log lines to run against the rules. Results are returned in the same order as this array."})},{description:"Grok rules and sample log lines to preview extraction before saving a route processor. The endpoint uses the same parser as the route builder preview and does not create or update routes."}),mH={rules:['pod:%{DATA:pod_namespace}/%{DATA:pod_name}\\] "%{DATA:request}" HTTP/%{POSINT:status}'],samples:['[conn-id:abc pod:tsuga-events/tsuga-events-searcher-0] "/token" HTTP/200']};Object.assign(pC,{examples:[mH]});var uC=t.Object({results:t.Array(t.Object({sample:t.String({description:"Echo of the submitted log line, so results can be matched to the samples in the request."}),matched:t.Boolean({description:"Whether any submitted rule matched this sample. `true` means `extracted` contains the captured fields; `false` means no rule matched."}),extracted:t.Union([t.Record(t.String(),t.Unknown()),t.Null()],{description:"Fields extracted from the first matching Grok rule when `matched` is `true`; dotted capture names are expanded into nested objects. `null` when no rule matched."})}),{description:"Preview result for each submitted sample, in the same order as the request `samples` array."})},{description:"Grok extraction preview results from applying the ordered rules to each submitted sample."}),lH={results:[{sample:'[conn-id:abc pod:tsuga-events/tsuga-events-searcher-0] "/token" HTTP/200',matched:!0,extracted:{pod_namespace:"tsuga-events",pod_name:"tsuga-events-searcher-0",request:"/token",status:"200"}}]};Object.assign(uC,{examples:[lH]});var mC=l({url:`${cH}/parse`,method:"POST",operationId:"parseGrok",tags:["public","grok"],body:pC,response:uC,description:"Parses sample log lines with Grok rules and returns extracted fields, using the same Grok engine as the log route processor. Use this endpoint to author and test route Grok rules before saving them. The operation requires public API read access to log routes. A rule that fails to compile returns a 400 response with error code `GROK_RULE_VALIDATION_ERROR` and structured details in `error.details.ruleErrors`."});function lC(e,r){let n=e.command("grok").description("Test and preview grok parsing rules");Zn(n,"parse","Parse sample log lines with grok rules and return the extracted fields",mC,r)}var dC=require("node:child_process"),fC=require("node:fs"),gC=require("node:os"),fp=require("node:path");var to=require("node:fs");function Ba(e,r){let n=`${e}.tmp.${process.pid}`;(0,to.writeFileSync)(n,r),(0,to.renameSync)(n,e)}function Fa(e){try{return(0,to.readFileSync)(e,"utf8")}catch(r){if(r.code==="ENOENT")return;throw r}}function Ha(e,r){if(r===void 0)return;let n=`${e}.bak.${new Date().toISOString().replaceAll(":","-")}`;return(0,to.writeFileSync)(n,r),n}function ro(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var Ud="tsuga-dev/agent-plugins",lp="tsuga";function dp(e,r){B(` $ ${e} ${r.join(" ")}`);try{(0,dC.execFileSync)(e,r,{stdio:["ignore","inherit","inherit"]})}catch(n){let o=n.status??1;throw new Error(`${e} ${r.join(" ")} exited ${o}`,{cause:n})}}function dH(e,r){B("Claude Code \u2192 installing Tsuga plugin"),dp("claude",["plugin","marketplace","add",Ud]),dp("claude",["plugin","install",`tsuga@${lp}`]),r.autoUpdate&&fH(e)}function fH(e){let r=(0,fp.join)(e,".claude","settings.json");B(`Claude Code \u2192 ${r} (autoUpdate)`),(0,fC.mkdirSync)((0,fp.dirname)(r),{recursive:!0});let n=Fa(r),o=JSON.parse(n??"{}");if(!ro(o))throw new Error(`${r} must contain a JSON object`);let i=o.extraKnownMarketplaces??{};if(!ro(i))throw new Error(`${r} "extraKnownMarketplaces" must be a JSON object`);let a=i[lp],c=ro(a)?a:{};o.extraKnownMarketplaces={...i,[lp]:{source:{source:"github",repo:Ud},...c,autoUpdate:!0}};let m=Ha(r,n);Ba(r,`${JSON.stringify(o,null,2)}
|
|
132
|
+
`),B(m===void 0?" created":` patched (backup: ${m})`)}function gH(){B("Codex \u2192 installing Tsuga plugin"),dp("codex",["plugin","marketplace","add",Ud]),dp("codex",["plugin","add",`tsuga@${lp}`])}function yC(e){let r=e.command("install").description("Install Tsuga components into local LLM CLIs").command("plugin").description("Install Tsuga plugins");r.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=>{dH((0,gC.homedir)(),n),B("Restart your claude session to load the new plugins.")}),r.command("codex").description("Install the Tsuga plugin into Codex").action(()=>{gH(),B("Restart your codex session to load the new plugins.")})}var Qt="/v0/kubernetes-explorer",yH="^[a-z0-9.-]+$",hH="^[A-Za-z0-9._-]+$",hC=256,TC=t.Optional(p({allowEmpty:!1,description:"Tsuga cluster ID to target. Tsuga assigns it when a cluster is connected to the organization. Optional for single-cluster organizations and required for organizations with multiple clusters to scope the request to one cluster."}));var ur=e=>t.Optional(t.Array(p({allowEmpty:!1}),{description:e})),EC={clusterId:TC,search:t.Optional(t.String({pattern:yH,minLength:1,maxLength:hC,description:"Substring matched against the resource name. Kubernetes names are lowercase RFC 1123, so only lowercase letters, digits, `.` and `-` are accepted; uppercase and other characters are rejected. Wildcard and other query-syntax characters are treated literally."}))},_C={clusterId:TC,search:t.Optional(t.String({pattern:hH,minLength:1,maxLength:hC,description:"Substring matched against the Kubernetes cluster name. Unlike Kubernetes resource names this is a collector-assigned identifier, so uppercase letters, digits, `.`, `-` and `_` are accepted. Wildcard and other query-syntax characters are treated literally."}))},IC=t.Object(EC),bC=t.Object(_C),Ka={...EC,includeInternalNamespaces:t.Optional(t.Boolean({description:"When false or omitted, resources in internal namespaces (kube-system, kube-public, kube-node-lease, local-path-storage, gke-managed-*) are excluded."})),clusters:ur("Restrict results to these Kubernetes cluster names."),namespaces:ur("Restrict results to these namespaces."),teams:ur("Restrict results to these team names."),envs:ur("Restrict results to these environments."),...fe},SC=["Pending","Running","Succeeded","Failed","Unknown","CrashLoopBackOff","Error"],TH={...Ka,nodes:ur("Restrict results to pods scheduled on these nodes."),deployments:ur("Restrict results to pods owned by these Deployments."),statefulsets:ur("Restrict results to pods owned by these StatefulSets."),daemonsets:ur("Restrict results to pods owned by these DaemonSets."),podStatus:t.Optional(t.Array(t.Enum(SC),{description:"Restrict results to pods whose resolved status matches any of these values. Includes the five Kubernetes phases plus Tsuga-derived CrashLoopBackOff and Error. Applied after stitching pod phase and container status reason telemetry, because phase is not a filterable metric attribute."}))},ii=t.Enum(["asc","desc"],{description:"Sort direction. Defaults to ascending."}),EH=["deployment","statefulset","daemonset"],OC=t.Object({kind:t.Enum(EH,{description:"Kind of Kubernetes workload associated with the pod. Derived from workload attributes in pod telemetry."}),name:t.String({description:"Name of the workload associated with the pod. Derived from workload attributes in pod telemetry."})},{description:"Kubernetes workload controller that owns the pod. Present when workload attributes are observed in pod telemetry."}),AC=t.Object({podName:t.String({description:"Name of the Kubernetes pod. Set when the pod is created."}),namespace:t.Optional(t.String({description:"Kubernetes namespace that contains the pod. Present when namespace telemetry is observed."})),cluster:t.Optional(t.String({description:"Kubernetes cluster name that reported the pod. Present when cluster telemetry is observed."})),team:t.Optional(t.String({description:"Team metadata associated with the pod. Present when a team label or mapping is observed."})),env:t.Optional(t.String({description:"Environment metadata associated with the pod, such as production or staging. Present when an environment label or mapping is observed."})),node:t.Optional(t.String({description:"Kubernetes node currently or most recently running the pod. Present when node telemetry is observed."})),phase:t.Enum(SC,{description:"Current or most recently observed pod status. From pod status and container state telemetry. Values include the Kubernetes phases Pending, Running, Succeeded, Failed, and Unknown, plus Tsuga-derived CrashLoopBackOff and Error values."}),readyContainers:t.Integer({description:"Number of containers in the pod that are currently ready. From container readiness telemetry. Zero or greater."}),totalContainers:t.Integer({description:"Number of observed containers for the pod based on container readiness telemetry. Zero or greater."}),restarts:t.Integer({description:"Total restart count across containers in the pod. From container restart telemetry. Zero or greater."}),createdAt:t.Optional(T({description:"Timestamp from pod start time telemetry for the selected pod instance. Present when pod start time telemetry is observed."}))}),wd=t.Object({...AC.properties,workload:t.Optional(OC),cpuUsageMilli:t.Optional(t.Number({description:"Recent pod CPU usage in millicores. Present when CPU usage telemetry is observed."})),cpuLimitMilli:t.Optional(t.Number({description:"Configured pod CPU limit in millicores, summed across observed containers. Present when a CPU limit is configured and observed."})),cpuRequestMilli:t.Optional(t.Number({description:"Configured pod CPU request in millicores, summed across observed containers. Present when a CPU request is configured and observed."})),memoryUsageBytes:t.Optional(t.Number({description:"Recent pod memory usage in bytes. Present when memory usage telemetry is observed."})),memoryLimitBytes:t.Optional(t.Number({description:"Configured pod memory limit in bytes, summed across observed containers. Present when a memory limit is configured and observed."})),memoryRequestBytes:t.Optional(t.Number({description:"Configured pod memory request in bytes, summed across observed containers. Present when a memory request is configured and observed."})),cpuUtilization:t.Optional(t.Number({description:"Recent CPU usage divided by the configured CPU limit. Present when both usage and limit are observed."})),memoryUtilization:t.Optional(t.Number({description:"Recent memory usage divided by the configured memory limit. Present when both usage and limit are observed."})),cpuRequestUtilization:t.Optional(t.Number({description:"Recent CPU usage divided by the configured CPU request. Present when both usage and request are observed."})),memoryRequestUtilization:t.Optional(t.Number({description:"Recent memory usage divided by the configured memory request. Present when both usage and request are observed."}))}),_H=["podName","namespace","cluster","team","env","node","phase","restarts","cpuUsageMilli","cpuUtilization","cpuRequestUtilization","memoryUsageBytes","memoryUtilization","memoryRequestUtilization","createdAt"],f3e=l({tags:["kubernetes-explorer"],method:"GET",url:`${Qt}/pods`,query:t.Object({...TH,sortBy:t.Optional(t.Enum(_H,{description:"Field to sort pods by."})),sortDirection:t.Optional(ii)}),paginated:!0,response:t.Array(wd)}),Nd=t.Object({cluster:t.String({description:"Kubernetes cluster name from cluster telemetry."}),teams:t.Optional(t.Array(t.String(),{description:"Team metadata values observed on pods in non-default Kubernetes namespaces on the cluster. Present when team labels or mappings are observed."})),envs:t.Optional(t.Array(t.String(),{description:"Environment metadata values observed on pods in non-default Kubernetes namespaces on the cluster. Present when environment labels or mappings are observed."})),cpuUsageMilli:t.Optional(t.Number({description:"Aggregate recent CPU usage for observed pods in the cluster, excluding default Kubernetes namespaces, in millicores. Present when CPU usage telemetry is observed."})),memoryUsageBytes:t.Optional(t.Number({description:"Aggregate recent memory usage for observed pods in the cluster, excluding default Kubernetes namespaces, in bytes. Present when memory usage telemetry is observed."})),readyNodes:t.Optional(t.Integer({description:"Number of Kubernetes nodes in the cluster that are ready. Present when node readiness telemetry is observed."})),podPhaseCounts:t.Optional(t.Object({Pending:t.Integer({description:"Number of observed pods currently in the Pending phase."}),Running:t.Integer({description:"Number of observed pods currently in the Running phase."}),Succeeded:t.Integer({description:"Number of observed pods currently in the Succeeded phase."}),Failed:t.Integer({description:"Number of observed pods currently in the Failed phase."}),Unknown:t.Integer({description:"Number of observed pods currently in the Unknown phase."})},{description:"Counts of observed pods by Kubernetes phase, excluding default Kubernetes namespaces. Present when pod phase telemetry is observed."}))}),IH=["cluster","teams","envs","cpuUsageMilli","memoryUsageBytes","readyNodes"],g3e=l({tags:["kubernetes-explorer"],method:"GET",url:`${Qt}/clusters`,query:t.Object({..._C,teams:ur("Restrict to clusters that host workloads from these team names."),envs:ur("Restrict to clusters that host workloads in these environments."),sortBy:t.Optional(t.Enum(IH,{description:"Field to sort clusters by."})),sortDirection:t.Optional(ii),...fe}),paginated:!0,response:t.Array(Nd)}),Ld=t.Object({namespace:t.String({description:"Kubernetes namespace name from namespace telemetry. Includes namespaces with no observed pods when namespace telemetry is observed."}),cluster:t.Optional(t.String({description:"Kubernetes cluster name that contains the namespace. Present when cluster telemetry is observed."})),teams:t.Optional(t.Array(t.String(),{description:"Team metadata values observed in workloads in the namespace. Present when team labels or mappings are observed."})),envs:t.Optional(t.Array(t.String(),{description:"Environment metadata values observed in workloads in the namespace. Present when environment labels or mappings are observed."})),pods:t.Optional(t.Integer({description:"Number of observed pods in the namespace. Present when pod telemetry is observed."})),cpuUsageMilli:t.Optional(t.Number({description:"Aggregate recent CPU usage for observed pods in the namespace, in millicores. Present when CPU usage telemetry is observed."})),memoryUsageBytes:t.Optional(t.Number({description:"Aggregate recent memory usage for observed pods in the namespace, in bytes. Present when memory usage telemetry is observed."}))}),bH=["namespace","cluster","teams","envs","pods","cpuUsageMilli","memoryUsageBytes"],y3e=l({tags:["kubernetes-explorer"],method:"GET",url:`${Qt}/namespaces`,query:t.Object({...Ka,sortBy:t.Optional(t.Enum(bH,{description:"Field to sort namespaces by."})),sortDirection:t.Optional(ii)}),paginated:!0,response:t.Array(Ld)}),vd=t.Object({deployment:t.String({description:"Kubernetes Deployment name from workload telemetry."}),namespace:t.Optional(t.String({description:"Kubernetes namespace that contains the Deployment. Present when namespace telemetry is observed."})),cluster:t.Optional(t.String({description:"Kubernetes cluster name that contains the Deployment. Present when cluster telemetry is observed."})),team:t.Optional(t.String({description:"Team metadata associated with the Deployment. Present when a team label or mapping is observed."})),env:t.Optional(t.String({description:"Environment metadata associated with the Deployment. Present when an environment label or mapping is observed."})),pods:t.Optional(t.Integer({description:"Number of observed pods associated with the Deployment. Present when pod telemetry and workload attributes are observed."})),availableReplicas:t.Optional(t.Integer({description:"Number of available Deployment replicas from Deployment status telemetry. Present when deployment status is observed."})),desiredReplicas:t.Optional(t.Integer({description:"Desired replica count configured for the Deployment. Present when Deployment spec telemetry is observed."})),cpuUsageMilli:t.Optional(t.Number({description:"Recent aggregate CPU usage for observed Deployment pods, in millicores. Present when CPU usage telemetry is observed."})),memoryUsageBytes:t.Optional(t.Number({description:"Recent aggregate memory usage for observed Deployment pods, in bytes. Present when memory usage telemetry is observed."}))}),SH=["deployment","namespace","cluster","team","env","pods","availableReplicas","cpuUsageMilli","memoryUsageBytes"],h3e=l({tags:["kubernetes-explorer"],method:"GET",url:`${Qt}/deployments`,query:t.Object({...Ka,sortBy:t.Optional(t.Enum(SH,{description:"Field to sort deployments by."})),sortDirection:t.Optional(ii)}),paginated:!0,response:t.Array(vd)}),kd=t.Object({statefulSet:t.String({description:"Kubernetes StatefulSet name from workload telemetry."}),namespace:t.Optional(t.String({description:"Kubernetes namespace that contains the StatefulSet. Present when namespace telemetry is observed."})),cluster:t.Optional(t.String({description:"Kubernetes cluster name that contains the StatefulSet. Present when cluster telemetry is observed."})),team:t.Optional(t.String({description:"Team metadata associated with the StatefulSet. Present when a team label or mapping is observed."})),env:t.Optional(t.String({description:"Environment metadata associated with the StatefulSet. Present when an environment label or mapping is observed."})),pods:t.Optional(t.Integer({description:"Number of observed pods associated with the StatefulSet. Present when pod telemetry and workload attributes are observed."})),readyReplicas:t.Optional(t.Integer({description:"Number of ready StatefulSet replicas from StatefulSet status telemetry. Present when StatefulSet status is observed."})),desiredReplicas:t.Optional(t.Integer({description:"Desired replica count configured for the StatefulSet. Present when StatefulSet spec telemetry is observed."})),cpuUsageMilli:t.Optional(t.Number({description:"Recent aggregate CPU usage for observed StatefulSet pods, in millicores. Present when CPU usage telemetry is observed."})),memoryUsageBytes:t.Optional(t.Number({description:"Recent aggregate memory usage for observed StatefulSet pods, in bytes. Present when memory usage telemetry is observed."}))}),OH=["statefulSet","namespace","cluster","team","env","pods","cpuUsageMilli","memoryUsageBytes"],T3e=l({tags:["kubernetes-explorer"],method:"GET",url:`${Qt}/statefulsets`,query:t.Object({...Ka,sortBy:t.Optional(t.Enum(OH,{description:"Field to sort StatefulSets by."})),sortDirection:t.Optional(ii)}),paginated:!0,response:t.Array(kd)}),Md=t.Object({daemonSet:t.String({description:"Kubernetes DaemonSet name from workload telemetry."}),namespace:t.Optional(t.String({description:"Kubernetes namespace that contains the DaemonSet. Present when namespace telemetry is observed."})),cluster:t.Optional(t.String({description:"Kubernetes cluster name that contains the DaemonSet. Present when cluster telemetry is observed."})),team:t.Optional(t.String({description:"Team metadata associated with the DaemonSet. Present when a team label or mapping is observed."})),env:t.Optional(t.String({description:"Environment metadata associated with the DaemonSet. Present when an environment label or mapping is observed."})),pods:t.Optional(t.Integer({description:"Number of observed pods associated with the DaemonSet. Present when pod telemetry and workload attributes are observed."})),readyNodes:t.Optional(t.Integer({description:"Number of eligible nodes with a ready DaemonSet pod. Present when DaemonSet status telemetry is observed."})),desiredNodes:t.Optional(t.Integer({description:"Number of eligible nodes where the DaemonSet should run a pod. Present when DaemonSet status telemetry is observed."})),cpuUsageMilli:t.Optional(t.Number({description:"Recent aggregate CPU usage for observed DaemonSet pods, in millicores. Present when CPU usage telemetry is observed."})),memoryUsageBytes:t.Optional(t.Number({description:"Recent aggregate memory usage for observed DaemonSet pods, in bytes. Present when memory usage telemetry is observed."}))}),AH=["daemonSet","namespace","cluster","team","env","pods","readyNodes","cpuUsageMilli","memoryUsageBytes"],E3e=l({tags:["kubernetes-explorer"],method:"GET",url:`${Qt}/daemonsets`,query:t.Object({...Ka,sortBy:t.Optional(t.Enum(AH,{description:"Field to sort DaemonSets by."})),sortDirection:t.Optional(ii)}),paginated:!0,response:t.Array(Md)}),Dd=t.Object({overview:t.Object({...AC.properties,workload:t.Optional(OC)},{description:"Pod identity, status, and owning workload, derived from recent pod metrics."}),healthMetrics:t.Object({cpu:t.Object({usage:t.String({description:"Metric name callers can use to query pod CPU usage. This is not the current CPU value."}),limit:t.String({description:"Metric name callers can use to query configured container CPU limits for the pod. This is not the current CPU limit value."}),request:t.String({description:"Metric name callers can use to query configured container CPU requests for the pod. This is not the current CPU request value."})},{description:"Metric names for pod CPU usage and for configured container CPU limits and requests."}),memory:t.Object({usage:t.String({description:"Metric name callers can use to query pod memory usage. This is not the current memory value."}),limit:t.String({description:"Metric name callers can use to query configured container memory limits for the pod. This is not the current memory limit value."}),request:t.String({description:"Metric name callers can use to query configured container memory requests for the pod. This is not the current memory request value."})},{description:"Metric names for pod memory usage and for configured container memory limits and requests."})},{description:"Metric names callers can use to query pod CPU and memory telemetry. These are fixed metric identifiers, not current values."}),searchFilters:t.Object({logs:t.String({description:"TQL log search filter scoped to this pod. Built from cluster, namespace, and pod identifiers."}),traces:t.String({description:"TQL trace search filter scoped to this pod. Built from cluster, namespace, and pod identifiers."})},{description:"TQL filters scoped to this pod, ready to use as the query for log and trace search."})}),xC=t.Object({clusterId:t.Optional(p({allowEmpty:!1})),k8sCluster:p({allowEmpty:!1}),k8sNamespace:p({allowEmpty:!1}),podName:p({allowEmpty:!1})}),_3e=l({tags:["kubernetes-explorer"],method:"GET",url:`${Qt}/pod-details`,query:xC,response:Dd}),Gd=t.Object({configuration:t.Optional(t.Object({spec:t.Record(t.String(),t.Unknown(),{description:"Kubernetes PodSpec from the latest observed pod manifest. Fields outside `object.spec` are stripped."}),lastObservedAt:T({description:"Timestamp when Tsuga last observed the pod manifest used for configuration."})},{description:"Pod configuration from the latest observed pod manifest. Present when a pod manifest log is found for the pod."})),labels:t.Record(t.String(),t.String(),{description:"Kubernetes labels on the pod from the latest observed pod manifest. Key-value strings."}),annotations:t.Record(t.String(),t.String(),{description:"Kubernetes annotations on the pod from the latest observed pod manifest. Key-value strings."}),deletedAt:t.Optional(T({description:"Timestamp when Tsuga last observed the pod deletion event. Present when the latest observed pod event is deleted."}))}),I3e=l({tags:["kubernetes-explorer"],method:"GET",url:`${Qt}/pod-manifest`,query:xC,response:Gd}),$d=t.Object({podName:t.String({description:"Name of a pod instance associated with the workload. Resolved from recent pod usage telemetry and workload attributes."}),podUid:t.Optional(t.String({description:"Kubernetes UID for the pod replica. Present when UID telemetry is observed."})),cpuUsageMilli:t.Optional(t.Number({description:"Recent CPU usage for the pod replica, in millicores. Present when CPU usage telemetry is observed."})),memoryUsageBytes:t.Optional(t.Number({description:"Recent memory usage for the pod replica, in bytes. Present when memory usage telemetry is observed."}))},{description:"A single pod instance with recent CPU or memory telemetry for the workload, resolved from pod usage telemetry and workload attributes."}),jd=t.Object({overview:t.Object({deploymentName:t.String({description:"Kubernetes Deployment name for this detail response."}),namespace:t.Optional(t.String({description:"Kubernetes namespace for this detail response. Present when any deployment signal is found."})),cluster:t.Optional(t.String({description:"Kubernetes cluster name for this detail response. Present when any deployment signal is found."})),team:t.Optional(t.String({description:"Team metadata from the Deployment available-replica metric. Present when the metric includes team metadata."})),env:t.Optional(t.String({description:"Environment metadata from the Deployment available-replica metric. Present when the metric includes environment metadata."})),availableReplicas:t.Optional(t.Integer({description:"Number of available Deployment replicas from Deployment status telemetry. Present when deployment status is observed."})),desiredReplicas:t.Optional(t.Integer({description:"Desired replica count configured for the Deployment. Present when Deployment spec telemetry is observed."})),latestRevisionAt:t.Optional(T({description:"Latest ReplicaSet metadata.creationTimestamp observed for the Deployment. Present when ReplicaSet object telemetry is observed."}))}),podReplicas:t.Array($d,{description:"Pod instances with recent CPU or memory telemetry for the Deployment. Tsuga builds this list from pod usage telemetry and workload attributes. Empty when no matching pod usage telemetry is observed."}),revisions:t.Array(t.Object({replicaSetName:t.String({description:"ReplicaSet name for a Deployment revision from workload telemetry."}),revision:t.Integer({description:"Deployment revision number from ReplicaSet annotations. Integer greater than or equal to zero."}),firstSeen:t.Optional(T({description:"ReplicaSet metadata.creationTimestamp from the latest observed ReplicaSet object. Present when creation time is observed."})),observedGeneration:t.Optional(t.Integer({description:"Latest generation observed for the ReplicaSet revision. Present when generation telemetry is observed."})),readyReplicas:t.Optional(t.Integer({description:"Number of ready replicas for the ReplicaSet revision. Present when ReplicaSet status telemetry is observed."})),replicas:t.Optional(t.Integer({description:"Total replica count for the ReplicaSet revision. Present when ReplicaSet status telemetry is observed."})),logsSearchFilter:t.String({description:"TQL log search filter scoped to this ReplicaSet revision. Built from cluster, namespace, and ReplicaSet identifiers."})}),{description:"Deployment rollout revisions from recent ReplicaSet object telemetry. Includes the latest observed event per ReplicaSet, excludes ReplicaSets whose latest observed spec.replicas is 0, and returns up to 8 revisions sorted by revision number descending."})}),b3e=l({tags:["kubernetes-explorer"],method:"GET",url:`${Qt}/deployment-details`,query:t.Object({clusterId:t.Optional(p({allowEmpty:!1})),k8sCluster:p({allowEmpty:!1}),k8sNamespace:p({allowEmpty:!1}),deploymentName:p({allowEmpty:!1})}),response:jd}),xH=t.Object({overview:t.Object({statefulSetName:t.String(),namespace:t.Optional(t.String()),cluster:t.Optional(t.String()),team:t.Optional(t.String()),env:t.Optional(t.String()),readyReplicas:t.Optional(t.Integer()),desiredReplicas:t.Optional(t.Integer()),latestRevisionAt:t.Optional(T())}),podReplicas:t.Array($d,{description:"Pod instances with recent CPU or memory telemetry for the StatefulSet. Tsuga builds this list from pod usage telemetry and workload attributes. Empty when no matching pod usage telemetry is observed."}),revisions:t.Array(t.Object({revisionName:t.String(),firstSeen:t.Optional(T())}))}),S3e=l({tags:["kubernetes-explorer"],method:"GET",url:`${Qt}/statefulset-details`,query:t.Object({clusterId:t.Optional(p({allowEmpty:!1})),k8sCluster:p({allowEmpty:!1}),k8sNamespace:p({allowEmpty:!1}),statefulSetName:p({allowEmpty:!1})}),response:xH}),RH=t.Object({overview:t.Object({daemonSetName:t.String(),namespace:t.Optional(t.String()),cluster:t.Optional(t.String()),team:t.Optional(t.String()),env:t.Optional(t.String()),readyNodes:t.Optional(t.Integer()),desiredNodes:t.Optional(t.Integer()),latestRevisionAt:t.Optional(T())}),podReplicas:t.Array($d,{description:"Pod instances with recent CPU or memory telemetry for the DaemonSet. Tsuga builds this list from pod usage telemetry and workload attributes. Empty when no matching pod usage telemetry is observed."}),revisions:t.Array(t.Object({observedGeneration:t.Integer(),firstSeen:t.Optional(T())}))}),O3e=l({tags:["kubernetes-explorer"],method:"GET",url:`${Qt}/daemonset-details`,query:t.Object({clusterId:t.Optional(p({allowEmpty:!1})),k8sCluster:p({allowEmpty:!1}),k8sNamespace:p({allowEmpty:!1}),daemonSetName:p({allowEmpty:!1})}),response:RH});var wr=`/${"v1"}/kubernetes-explorer`,RC=t.Pick(wd,["podName","namespace","cluster","team","env","node","phase","readyContainers","totalContainers","restarts","createdAt","workload","cpuUsageMilli","cpuLimitMilli","memoryUsageBytes","memoryLimitBytes","cpuUtilization","memoryUtilization"],{description:"A Kubernetes pod with its current phase, owning workload, and resource usage."}),CH={podName:"api-gateway-7d9f8c6b5-2xk4p",namespace:"production",cluster:"prod-us-east",team:"platform",env:"production",node:"ip-10-0-1-23.ec2.internal",phase:"Running",readyContainers:1,totalContainers:1,restarts:0,createdAt:"2024-01-15T12:34:56.000Z",workload:{kind:"deployment",name:"api-gateway"},cpuUsageMilli:125,cpuLimitMilli:500,memoryUsageBytes:134217728,memoryLimitBytes:536870912,cpuUtilization:.25,memoryUtilization:.25};Object.assign(RC,{examples:[CH]});var CC=t.Pick(Nd,["cluster","teams","envs","cpuUsageMilli","memoryUsageBytes","readyNodes","podPhaseCounts"],{description:"A Kubernetes cluster with aggregate resource usage, node readiness, and pod phase counts."}),PH={cluster:"prod-us-east",teams:["platform","payments"],envs:["production"],cpuUsageMilli:4200,memoryUsageBytes:8589934592,readyNodes:6,podPhaseCounts:{Pending:1,Running:42,Succeeded:3,Failed:0,Unknown:0}};Object.assign(CC,{examples:[PH]});var PC=t.Pick(Ld,["namespace","cluster","teams","envs","pods","cpuUsageMilli","memoryUsageBytes"],{description:"A Kubernetes namespace with pod count and aggregate resource usage."}),UH={namespace:"production",cluster:"prod-us-east",teams:["platform"],envs:["production"],pods:24,cpuUsageMilli:1800,memoryUsageBytes:3221225472};Object.assign(PC,{examples:[UH]});var UC=t.Pick(vd,["deployment","namespace","cluster","team","env","pods","availableReplicas","desiredReplicas","cpuUsageMilli","memoryUsageBytes"],{description:"A Kubernetes deployment with replica counts and aggregate resource usage."}),wH={deployment:"api-gateway",namespace:"production",cluster:"prod-us-east",team:"platform",env:"production",pods:3,availableReplicas:3,desiredReplicas:3,cpuUsageMilli:375,memoryUsageBytes:402653184};Object.assign(UC,{examples:[wH]});var wC=t.Pick(kd,["statefulSet","namespace","cluster","team","env","pods","readyReplicas","desiredReplicas","cpuUsageMilli","memoryUsageBytes"],{description:"A Kubernetes StatefulSet with replica counts and aggregate resource usage."}),NH={statefulSet:"postgres",namespace:"production",cluster:"prod-us-east",team:"platform",env:"production",pods:3,readyReplicas:3,desiredReplicas:3,cpuUsageMilli:900,memoryUsageBytes:2147483648};Object.assign(wC,{examples:[NH]});var NC=t.Pick(Md,["daemonSet","namespace","cluster","team","env","pods","readyNodes","desiredNodes","cpuUsageMilli","memoryUsageBytes"],{description:"A Kubernetes DaemonSet with eligible-node readiness and aggregate resource usage."}),LH={daemonSet:"otel-collector",namespace:"observability",cluster:"prod-us-east",team:"platform",env:"production",pods:6,readyNodes:6,desiredNodes:6,cpuUsageMilli:300,memoryUsageBytes:805306368};Object.assign(NC,{examples:[LH]});var LC=t.Pick(Dd,["overview","healthMetrics","searchFilters"],{description:"Metrics-derived information for a single Kubernetes pod: status, owning workload, CPU/memory metric identifiers, and log/trace filters."}),vH={overview:{podName:"api-gateway-7d9f8c6b5-2xk4p",namespace:"production",cluster:"prod-us-east",team:"platform",env:"production",node:"ip-10-0-1-23.ec2.internal",phase:"Running",readyContainers:1,totalContainers:1,restarts:0,createdAt:"2024-01-15T12:34:56.000Z",workload:{kind:"deployment",name:"api-gateway"}},healthMetrics:{cpu:{usage:"k8s.pod.cpu.usage",limit:"k8s.container.cpu_limit",request:"k8s.container.cpu_request"},memory:{usage:"k8s.pod.memory.usage",limit:"k8s.container.memory_limit",request:"k8s.container.memory_request"}},searchFilters:{logs:'context.k8s.cluster.name:"prod-us-east" AND context.k8s.namespace.name:"production" AND context.k8s.pod.name:"api-gateway-7d9f8c6b5-2xk4p"',traces:'context.k8s.cluster.name:"prod-us-east" AND context.k8s.namespace.name:"production" AND context.k8s.pod.name:"api-gateway-7d9f8c6b5-2xk4p"'}};Object.assign(LC,{examples:[vH]});var vC=t.Pick(Gd,["configuration","labels","annotations","deletedAt"],{description:"Manifest-derived details for a single Kubernetes pod: the pod manifest spec, labels, and annotations from the pod's most recently observed manifest."}),kH={configuration:{spec:{restartPolicy:"Always",serviceAccountName:"api-gateway"},lastObservedAt:"2024-01-15T12:30:00.000Z"},labels:{app:"api-gateway","pod-template-hash":"7d9f8c6b5"},annotations:{"prometheus.io/scrape":"true"}};Object.assign(vC,{examples:[kH]});var kC=t.Pick(jd,["overview","podReplicas","revisions"],{description:"Detailed information for a single Kubernetes deployment: replica status, backing pods, and rollout revisions."}),MH={overview:{deploymentName:"api-gateway",namespace:"production",cluster:"prod-us-east",team:"platform",env:"production",availableReplicas:3,desiredReplicas:3,latestRevisionAt:"2024-01-15T12:00:00.000Z"},podReplicas:[{podName:"api-gateway-7d9f8c6b5-2xk4p",podUid:"a1b2c3d4-e5f6-7890-abcd-ef1234567890",cpuUsageMilli:125,memoryUsageBytes:134217728}],revisions:[{replicaSetName:"api-gateway-7d9f8c6b5",revision:7,firstSeen:"2024-01-15T12:00:00.000Z",observedGeneration:7,readyReplicas:3,replicas:3,logsSearchFilter:'context.k8s.cluster.name:"prod-us-east" context.k8s.namespace.name:"production" context.k8s.replicaset.name:"api-gateway-7d9f8c6b5"'}]};Object.assign(kC,{examples:[MH]});var MC=t.Object({clusterId:t.Optional(p({allowEmpty:!1,description:"Tsuga cluster ID to target. Tsuga assigns it when a cluster is connected to the organization. Optional for single-cluster organizations and required for organizations with multiple clusters to scope the request to one cluster."}))}),za=t.Pick(IC,["clusterId","search"]),DH=t.Pick(bC,["clusterId","search"]),DC=l({description:"Lists Kubernetes pods observed across the organization with their current phase, owning workload, and resource usage.",operationId:"listKubernetesPods",tags:["public","kubernetes-explorer"],method:"GET",url:`${wr}/pods`,query:za,response:t.Array(RC)}),GC=l({description:"Lists Kubernetes clusters observed across the organization with aggregate resource usage, node readiness, and pod phase counts.",operationId:"listKubernetesClusters",tags:["public","kubernetes-explorer"],method:"GET",url:`${wr}/clusters`,query:DH,response:t.Array(CC)}),$C=l({description:"Lists Kubernetes namespaces observed across the organization with pod counts and aggregate resource usage.",operationId:"listKubernetesNamespaces",tags:["public","kubernetes-explorer"],method:"GET",url:`${wr}/namespaces`,query:za,response:t.Array(PC)}),jC=l({description:"Lists Kubernetes deployments observed across the organization with replica counts and aggregate resource usage.",operationId:"listKubernetesDeployments",tags:["public","kubernetes-explorer"],method:"GET",url:`${wr}/deployments`,query:za,response:t.Array(UC)}),qC=l({description:"Lists Kubernetes StatefulSets observed across the organization with replica counts and aggregate resource usage.",operationId:"listKubernetesStatefulSets",tags:["public","kubernetes-explorer"],method:"GET",url:`${wr}/statefulsets`,query:za,response:t.Array(wC)}),BC=l({description:"Lists Kubernetes DaemonSets observed across the organization with eligible-node readiness and aggregate resource usage.",operationId:"listKubernetesDaemonSets",tags:["public","kubernetes-explorer"],method:"GET",url:`${wr}/daemonsets`,query:za,response:t.Array(NC)}),FC=t.Object({...MC.properties,k8sCluster:p({allowEmpty:!1,description:"Kubernetes cluster name that contains the pod. From cluster telemetry. Required to identify the pod because pod names are only unique within a namespace and cluster."}),k8sNamespace:p({allowEmpty:!1,description:"Kubernetes namespace that contains the pod. From pod metadata. Required to identify the pod because pod names are only unique within a namespace and cluster."}),podName:p({allowEmpty:!1,description:"Kubernetes pod name to retrieve. Set when the pod is created. Required to fetch pod details for the selected cluster and namespace."})}),HC=l({description:"Retrieves metrics-derived information for a single Kubernetes pod: status, owning workload, CPU/memory metric identifiers, and ready-to-use log and trace filters. Manifest configuration, labels, and annotations are served by the pod-manifest endpoint.",operationId:"getKubernetesPodDetails",tags:["public","kubernetes-explorer"],method:"GET",url:`${wr}/pod-details`,query:FC,response:LC}),KC=l({description:"Retrieves the manifest-derived details for a single Kubernetes pod: the pod manifest spec, labels, and annotations from the pod's most recently observed manifest.",operationId:"getKubernetesPodManifest",tags:["public","kubernetes-explorer"],method:"GET",url:`${wr}/pod-manifest`,query:FC,response:vC}),zC=l({description:"Retrieves detailed information for a single Kubernetes deployment: replica status, backing pods, and rollout revisions with ready-to-use log filters.",operationId:"getKubernetesDeploymentDetails",tags:["public","kubernetes-explorer"],method:"GET",url:`${wr}/deployment-details`,query:t.Object({...MC.properties,k8sCluster:p({allowEmpty:!1,description:"Kubernetes cluster name that contains the Deployment. From cluster telemetry. Required to identify the Deployment because names are only unique within a namespace and cluster."}),k8sNamespace:p({allowEmpty:!1,description:"Kubernetes namespace that contains the Deployment. From workload metadata. Required to identify the Deployment because names are only unique within a namespace and cluster."}),deploymentName:p({allowEmpty:!1,description:"Kubernetes Deployment name to retrieve. From workload telemetry. Required to fetch deployment details for the selected cluster and namespace."})}),response:kC});var GH="clusterId";function YC(e,r,n){let o=r.query.properties??{},i=Object.keys(o).filter(a=>a!==GH);for(let a of i){let c=a.replace(/([A-Z])/g,"-$1").toLowerCase(),m=o[a]?.description??"";n?e.requiredOption(`--${c} <value>`,m):e.option(`--${c} <value>`,m)}return i}function ai(e,r,n,o){let i=e.command(r).description(n.description??`List Kubernetes ${r}`),a=YC(i,n,!1);i.action(async c=>{let m={};for(let d of a)c[d]!==void 0&&(m[d]=c[d]);Q(Object.keys(m).length>0?await o()(n,{query:m}):await o()(n))})}function qd(e,r,n,o){let i=e.command(r).description(n.description??`Get Kubernetes ${r}`),a=YC(i,n,!0);i.action(async c=>{let m={};for(let d of a)m[d]=c[d];Q(await o()(n,{query:m}))})}function VC(e,r){let n=e.command("kubernetes").description("Explore Kubernetes resources observed across the organization");ai(n,"pods",DC,r),ai(n,"clusters",GC,r),ai(n,"namespaces",$C,r),ai(n,"deployments",jC,r),ai(n,"statefulsets",qC,r),ai(n,"daemonsets",BC,r),qd(n,"pod-details",HC,r),qd(n,"pod-manifest",KC,r),qd(n,"deployment-details",zC,r)}var Nr="/v0/dashboards",WC=["white","gray.100","amber.200","lime.200","emerald.200","cyan.200","blue.200","violet.200","fuchsia.200","pink.200","red.200"],$H=["bar","distribution","gauge","heatmap","list","pie","query-value","table","timeseries","top-list"],K3e=[...$H,"note"];var jH=["ns","us","ms","s","m","h","days"];var qH=["B","KB","MB","GB","TB","PB"];var BH=20;var ZC=t.Object({type:t.Literal("cpu",{description:"Normalizes values as CPU usage"})},{$id:"DataNormalizerCpu",title:"CPU"}),XC=t.Object({type:t.Literal("duration",{description:"Normalizes values as durations using standard time units"}),unit:t.Enum(jH,{description:"Time unit used to present the normalized values"})},{$id:"DataNormalizerDuration",title:"Duration"}),JC=t.Object({type:t.Literal("data",{description:"Normalizes values as data sizes using byte units"}),unit:t.Enum(qH,{description:"Data size unit used to present the normalized values"})},{$id:"DataNormalizerData",title:"Data"}),eP=t.Object({type:t.Literal("percent",{description:"Formats numeric values as percentages. Use it when the raw value is already on a 0-100 scale, for example `25` to display `25%`."})},{$id:"DataNormalizerPercent",title:"Percent"}),tP=t.Object({type:t.Literal("percent-fraction",{description:"Formats numeric values as percentages. Use it when the raw value is a 0-1 fraction; Tsuga multiplies the value by 100 for display, for example `0.2` to display `20%`."})},{$id:"DataNormalizerPercentFraction",title:"Percent Fraction"}),rP=t.Object({type:t.Literal("date",{description:"Formats values as calendar dates"})},{$id:"DataNormalizerDate",title:"Date"}),nP=t.Object({type:t.Literal("level",{description:"Displays values using their log level name"})},{$id:"DataNormalizerLevel",title:"Level"}),oP=t.Object({type:t.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"}),FH=t.Object({type:t.Literal("custom",{description:"Normalizes values using a custom unit label"}),unit:t.String({description:"Text label describing the custom unit"})},{$id:"DataNormalizerCustom",title:"Custom"}),HH=t.Object({type:t.Literal("custom",{description:"Normalizes values using a custom unit label"}),unit:t.String({description:"Text label describing the custom unit. Must not be empty.",minLength:1,maxLength:BH})},{$id:"InputDataNormalizerCustom",title:"Custom"}),yt=I("type",[XC,JC,eP,tP,rP,nP,ZC,oP,FH],{title:"Normalizer",description:"Display-value formatter for widget values or list/table columns."}),ht=I("type",[XC,JC,eP,tP,rP,nP,ZC,oP,HH],{title:"Normalizer",description:"Display-value formatter for widget values or list/table columns."}),Bd=t.Object({attribute:t.String({description:"Attribute (log field or database row column) displayed as a column in the list"}),normalizer:t.Optional(yt)},{title:"WidgetListColumn",description:"List column pairing a displayed attribute with the formatting applied to its values."}),Fd=t.Object({attribute:t.String({description:"Attribute (log field or database row column) displayed as a column in the list"}),normalizer:t.Optional(ht)},{title:"WidgetListColumn",description:"List column pairing a displayed attribute with the formatting applied to its values."}),si=["background","no-background"],KH=["table","legend-only","no-legend"];var zH=["greater_than","less_than","equal","not_equal","greater_than_or_equal","less_than_or_equal"],iP=["alert","warning","success"],mr=t.Object({operator:t.Enum(zH,{description:"Comparator used to evaluate the metric value"}),value:t.Number({description:"Threshold value used when evaluating the operator"}),color:t.Enum(iP,{description:"Color applied when the condition is met"})},{title:"ConditionalFormatting",description:"Color rule evaluated against the displayed value. The first matching rule in the array is applied."}),YH=t.Object({value:t.Number({description:"Y-axis value where the threshold marker is placed"}),level:t.Enum(iP,{description:"Level applied to the threshold marker"})},{title:"ThresholdMarker",description:"Marker line drawn across the chart at a fixed value, colored by its level."}),VH=["sec","min","hour","day"],fn=t.Object({time:t.Number({description:"Numeric count of `metric` units in each bucket. Required when `timeBucket` is present."}),metric:t.Enum(VH,{description:"Unit used to measure the bucket width"})},{description:"Time bucket width for time-based chart widgets. Optional; when present, `time` and `metric` together define the bucket width."});var dn=t.Enum(["flex-start","center","flex-end"],{description:"Flex alignment keyword used for widget layout"}),ci=t.Object({formula:t.Optional(t.String({description:"Optional alias for formula (only used for display in the UI)"})),queries:t.Optional(t.Record(t.String(),t.String({description:'Display name for this query series in the legend, keyed by the zero-based query index as a string ("0" = first query, "1" = second, and so on). This differs from `formula`, which references queries as "q1", "q2". Omit to fall back to an auto-generated label like "Count on <filter>".'}),{description:"Display names for individual query series, keyed by the zero-based query index as a string."}))},{description:"Display names used for the formula series and the individual query series instead of auto-generated labels."}),pi=t.Object({formula:t.Optional(p({type:"short",description:"Optional alias for formula (only used for display in the UI)"})),queries:t.Optional(t.Record(t.String(),p({type:"short",description:'Display name for this query series in the legend, keyed by the zero-based query index as a string ("0" = first query, "1" = second, and so on). This differs from `formula`, which references queries as "q1", "q2". Omit to fall back to an auto-generated label like "Count on <filter>".'}),{description:"Display names for individual query series, keyed by the zero-based query index as a string."}))},{description:"Display names used for the formula series and the individual query series instead of auto-generated labels."}),yp={source:zt,queries:JS,formula:t.Optional(zc),aliases:t.Optional(ci),visibleSeries:t.Optional(t.Array(t.Boolean(),{description:"Flags indicating whether each query or formula series is visible"}))},hp={source:zt,queries:ba,formula:t.Optional($n),aliases:t.Optional(pi),visibleSeries:t.Optional(t.Array(t.Boolean(),{description:"Flags indicating whether each query or formula series is visible"}))},ui={...yp,groupBy:t.Optional(Bo)},mi={...hp,groupBy:t.Optional(br)},Ae=t.Enum(KH,{description:"Controls whether and how the widget displays legend or series details (e.g. table, legend-only, or no legend)"}),ue=t.Optional(t.Union([t.Number(),t.Literal("max")],{description:"Display precision for numeric labels, tooltips, tables, and scalar values. Use a number of decimal places to round displayed values, or `max` to display the full submitted precision."})),jt=t.Optional(t.Array(YH,{description:"Threshold markers displayed on the chart"})),QH=t.Object({name:t.String({description:"Display name of the table column"}),...yp,source:zt,normalizer:t.Optional(yt),precision:ue},{title:"TableColumn",description:"Table column backed by its own aggregation. `defaultSorting` and `columnSizes` reference it as `col-<index>`, using its zero-based position in `columns`."}),WH=t.Object({name:p({description:"Display name of the table column"}),...hp,source:zt,normalizer:t.Optional(ht),precision:ue},{title:"TableColumn",description:"Table column backed by its own aggregation. `defaultSorting` and `columnSizes` reference it as `col-<index>`, using its zero-based position in `columns`."}),ZH=t.Array(t.Object({id:t.String({description:"ID of the column to sort by"}),desc:t.Boolean({description:"Whether the sort is descending"})},{title:"TableDefaultSorting"}),{description:"Default sorting applied to a table widget. Column IDs are `label` for the grouping column and `col-<index>` for each entry in `columns`. Users can still change sorting by selecting columns in the rendered table."}),XH=t.Array(t.Object({id:p({description:"ID of the column to sort by"}),desc:t.Boolean({description:"Whether the sort is descending"})},{title:"TableDefaultSorting"}),{description:"Default sorting applied to a table widget. Column IDs are `label` for the grouping column and `col-<index>` for each entry in `columns`. Users can still change sorting by selecting columns in the rendered table."}),Hd=t.Array(t.Object({id:t.String({description:"Column attribute used for the default list sort. It matches an attribute in `listColumns` or a built-in list column for the selected list source."}),desc:t.Boolean({description:"Sort direction for the default list sort. `true` sorts descending; `false` sorts ascending."})},{title:"ListDefaultSorting"}),{description:"Default sorting applied to a list widget. Applies to log, span, or connection list widgets. Users can still change sorting by selecting columns in the rendered list."}),Kd=t.Array(t.Object({id:p({description:"Column attribute used for the default list sort. Set this to an attribute in `listColumns` or a built-in list column for the selected list source."}),desc:t.Boolean({description:"Sort direction for the default list sort. Set `true` for descending order or `false` for ascending order."})},{title:"ListDefaultSorting"}),{description:"Default sorting applied to a list widget. Optional on create or update for log, span, or connection list widgets. Users can still change sorting by selecting columns in the rendered list."}),aP=["horizontal","vertical"],JH=t.Object({type:t.Literal("list",{description:"Displays matching logs in a tabular list"}),query:t.String({description:"Query that selects logs for the list"}),listColumns:t.Optional(t.Array(Bd,{description:"Custom columns to display for each log"})),listColumnsSize:t.Optional(t.Record(t.String(),t.Number({description:"List column width by column id"}),{description:"List column widths in pixels, keyed by the `attribute` of the matching `listColumns` entry. Columns without an entry keep their default width."})),isCellWrapped:t.Optional(t.Boolean({description:"Whether list widget cell text wraps instead of truncating. Applies to list widgets."})),defaultSorting:t.Optional(Hd)},{$id:"GraphVisualizationList",title:"List"}),eK=t.Object({type:t.Literal("list",{description:"Displays matching logs in a tabular list"}),query:p({type:"tsuga-query",description:"Query that selects logs for the list"}),listColumns:t.Optional(t.Array(Fd,{description:"Custom columns to display for each log"})),listColumnsSize:t.Optional(t.Record(t.String(),t.Number({description:"List column width by column id"}),{description:"List column widths in pixels, keyed by the `attribute` of the matching `listColumns` entry. Columns without an entry keep their default width."})),isCellWrapped:t.Optional(t.Boolean({description:"Whether list widget cell text wraps instead of truncating. Applies to list widgets. Optional; omit or set false to use truncated cells."})),defaultSorting:t.Optional(Kd)},{$id:"InputGraphVisualizationList",title:"List"}),gp=I("type",[t.Object({type:t.Literal("auto",{description:"Automatically choose this axis bound"})}),t.Object({type:t.Literal("number",{description:"Use a fixed numeric axis bound"}),value:t.Number({description:"Fixed numeric axis bound value"})})],{description:"Axis bound mode: automatic or fixed numeric value"}),li=t.Object({min:gp,max:gp,scale:I("type",[t.Object({type:t.Literal("pow",{description:"Power scale"}),exponent:t.Number({description:"Exponent used by the power scale"})}),t.Object({type:t.Enum(["linear","log","sqrt"],{description:"Built-in axis scale"})})],{description:"Y-axis scale mode"}),alwaysIncludeZero:t.Boolean({description:"Whether the rendered Y axis should always include zero"})},{description:"Y-axis bounds and scale configuration for chart widgets."}),di=t.Object({min:gp,max:gp,scale:I("type",[t.Object({type:t.Literal("pow",{description:"Power scale"}),exponent:t.Number({minimum:0,description:"Exponent used by the power scale"})}),t.Object({type:t.Enum(["linear","log","sqrt"],{description:"Built-in axis scale"})})],{description:"Y-axis scale mode"}),alwaysIncludeZero:t.Boolean({description:"Whether the rendered Y axis should always include zero"})},{description:"Y-axis bounds and scale configuration for chart widgets. Optional on create or update."}),tK=t.Array(t.Integer({description:"Marker value expressed as a percentage between 0 and 100"}),{description:"Percentile markers displayed on top of the distribution chart"}),rK=t.Array(t.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 nK=t.Object({type:t.Literal("timeseries-connection",{description:"Displays the database rows-based aggregation as a time series chart"}),connectionId:t.String({description:"The ID of the connection to use to query the datastore."}),queries:t.Array(t.String({description:"The read-only SQL query to execute against the connection."})),legendMode:t.Optional(Ae),thresholds:jt,yAxisSettings:t.Optional(li)},{$id:"GraphVisualizationTimeseriesConnection",title:"TimeseriesConnection"}),oK=t.Object({type:t.Literal("timeseries-connection",{description:"Displays the database rows-based aggregation as a time series chart"}),connectionId:p({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:t.Array(p({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:t.Optional(Ae),thresholds:jt,yAxisSettings:t.Optional(di)},{$id:"InputGraphVisualizationTimeseriesConnection",title:"TimeseriesConnection"}),iK=t.Object({type:t.Literal("list-connection",{description:"Displays database rows as a tabular list"}),connectionId:t.String({description:"The ID of the connection to use to query the datastore."}),query:t.String({description:"The read-only SQL query to execute against the connection."}),listColumns:t.Optional(t.Array(Bd,{description:"Custom columns to display for each database row"})),listColumnsSize:t.Optional(t.Record(t.String(),t.Number({description:"List column width by column id"}),{description:"List column widths in pixels, keyed by the `attribute` of the matching `listColumns` entry. Columns without an entry keep their default width."})),isCellWrapped:t.Optional(t.Boolean({description:"Whether list widget cell text wraps instead of truncating. Applies to connection list widgets."})),defaultSorting:t.Optional(Hd)},{$id:"GraphVisualizationListConnection",title:"ListConnection"}),aK=t.Object({type:t.Literal("list-connection",{description:"Displays database rows as a tabular list"}),connectionId:p({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),query:p({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),listColumns:t.Optional(t.Array(Fd,{description:"Custom columns to display for each database row"})),listColumnsSize:t.Optional(t.Record(t.String(),t.Number({description:"List column width by column id"}),{description:"List column widths in pixels, keyed by the `attribute` of the matching `listColumns` entry. Columns without an entry keep their default width."})),isCellWrapped:t.Optional(t.Boolean({description:"Whether list widget cell text wraps instead of truncating. Applies to connection list widgets. Optional; omit or set false to use truncated cells."})),defaultSorting:t.Optional(Kd)},{$id:"InputGraphVisualizationListConnection",title:"ListConnection"}),sK=t.Object({type:t.Literal("top-list-connection",{description:"Displays the database rows-based aggregation as a ranked top list"}),connectionId:t.String({description:"The ID of the connection to use to query the datastore."}),queries:t.Array(t.String({description:"The read-only SQL query to execute against the connection."}))},{$id:"GraphVisualizationTopListConnection",title:"TopListConnection"}),cK=t.Object({type:t.Literal("top-list-connection",{description:"Displays the database rows-based aggregation as a ranked top list"}),connectionId:p({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:t.Array(p({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1})},{$id:"InputGraphVisualizationTopListConnection",title:"TopListConnection"}),pK=t.Object({type:t.Literal("pie-connection",{description:"Displays the database rows-based aggregation as a pie chart"}),connectionId:t.String({description:"The ID of the connection to use to query the datastore."}),queries:t.Array(t.String({description:"The read-only SQL query to execute against the connection."})),legendMode:t.Optional(Ae)},{$id:"GraphVisualizationPieConnection",title:"PieConnection"}),uK=t.Object({type:t.Literal("pie-connection",{description:"Displays the database rows-based aggregation as a pie chart"}),connectionId:p({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:t.Array(p({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:t.Optional(Ae)},{$id:"InputGraphVisualizationPieConnection",title:"PieConnection"}),mK=t.Object({type:t.Literal("bar-connection",{description:"Displays the database rows-based aggregation as a bar chart"}),connectionId:t.String({description:"The ID of the connection to use to query the datastore."}),queries:t.Array(t.String({description:"The read-only SQL query to execute against the connection."})),legendMode:t.Optional(Ae),thresholds:jt,yAxisSettings:t.Optional(li)},{$id:"GraphVisualizationBarConnection",title:"BarConnection"}),lK=t.Object({type:t.Literal("bar-connection",{description:"Displays the database rows-based aggregation as a bar chart"}),connectionId:p({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:t.Array(p({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:t.Optional(Ae),thresholds:jt,yAxisSettings:t.Optional(di)},{$id:"InputGraphVisualizationBarConnection",title:"BarConnection"}),dK=t.Object({type:t.Literal("query-value-connection",{description:"Displays a single value computed by a SQL query against a database connection"}),connectionId:t.String({description:"The ID of the connection to use to query the datastore."}),queries:t.Array(t.String({description:"The read-only SQL query to execute against the connection."})),backgroundMode:t.Optional(t.Enum(si,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:t.Optional(t.Array(mr,{description:"Conditional formatting rules applied to the displayed value"})),precision:ue,normalizer:t.Optional(yt),legendMode:t.Optional(Ae)},{$id:"GraphVisualizationQueryValueConnection",title:"QueryValueConnection"}),fK=t.Object({type:t.Literal("query-value-connection",{description:"Displays a single value computed by a SQL query against a database connection"}),connectionId:p({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:t.Array(p({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),backgroundMode:t.Optional(t.Enum(si,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:t.Optional(t.Array(mr,{description:"Conditional formatting rules applied to the displayed value"})),precision:ue,normalizer:t.Optional(ht),legendMode:t.Optional(Ae)},{$id:"InputGraphVisualizationQueryValueConnection",title:"QueryValueConnection"}),gK=t.Object({type:t.Literal("list-log-patterns",{description:"Displays log patterns clustered from logs matching the query"}),query:t.String({description:"Tsuga query that selects logs to cluster into patterns"}),layout:t.Optional(t.Enum(aP,{description:"Layout used to render log patterns"}))},{$id:"GraphVisualizationListLogPatterns",title:"ListLogPatterns"}),yK=t.Object({type:t.Literal("list-log-patterns",{description:"Displays log patterns clustered from logs matching the query"}),query:p({type:"tsuga-query",description:"Tsuga query that selects logs to cluster into patterns"}),layout:t.Optional(t.Enum(aP,{description:"Layout used to render log patterns"}))},{$id:"InputGraphVisualizationListLogPatterns",title:"ListLogPatterns"}),hK=t.Object({type:t.Literal("list-spans",{description:"Displays matching trace spans in a tabular list"}),query:t.String({description:"Query that selects trace spans for the list"}),listColumns:t.Optional(t.Array(Bd,{description:"Custom columns to display for each span"})),listColumnsSize:t.Optional(t.Record(t.String(),t.Number({description:"List column width by column id"}),{description:"List column widths in pixels, keyed by the `attribute` of the matching `listColumns` entry. Columns without an entry keep their default width."})),isCellWrapped:t.Optional(t.Boolean({description:"Whether list widget cell text wraps instead of truncating. Applies to span list widgets."})),defaultSorting:t.Optional(Hd)},{$id:"GraphVisualizationListSpans",title:"ListSpans"}),TK=t.Object({type:t.Literal("list-spans",{description:"Displays matching trace spans in a tabular list"}),query:p({type:"tsuga-query",description:"Query that selects trace spans for the list"}),listColumns:t.Optional(t.Array(Fd,{description:"Custom columns to display for each span"})),listColumnsSize:t.Optional(t.Record(t.String(),t.Number({description:"List column width by column id"}),{description:"List column widths in pixels, keyed by the `attribute` of the matching `listColumns` entry. Columns without an entry keep their default width."})),isCellWrapped:t.Optional(t.Boolean({description:"Whether list widget cell text wraps instead of truncating. Applies to span list widgets. Optional; omit or set false to use truncated cells."})),defaultSorting:t.Optional(Kd)},{$id:"InputGraphVisualizationListSpans",title:"ListSpans"}),Ya=t.Array(t.String({description:"Raw PromQL expression for this widget, returned exactly as stored."}),{description:"PromQL expressions configured for this widget. PromQL-backed widgets require at least one query."}),Va=t.Array(p({allowEmpty:!1,type:"long",description:"Raw PromQL expression for this widget."}),{minItems:1,description:"PromQL expressions configured for this widget."}),EK=t.Object({type:t.Literal("timeseries-promql",{description:"Displays PromQL metrics query-based aggregation as a time series chart"}),queries:Ya,aliases:t.Optional(ci),timeBucket:t.Optional(fn),normalizer:t.Optional(yt),precision:ue,legendMode:t.Optional(Ae),thresholds:jt,yAxisSettings:t.Optional(li),smoothing:t.Optional(t.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"}))},{$id:"GraphVisualizationTimeseriesPromql",title:"TimeseriesPromql"}),_K=t.Object({type:t.Literal("timeseries-promql",{description:"Displays PromQL metrics query-based aggregation as a time series chart"}),queries:Va,aliases:t.Optional(pi),timeBucket:t.Optional(fn),normalizer:t.Optional(ht),precision:ue,legendMode:t.Optional(Ae),thresholds:jt,yAxisSettings:t.Optional(di),smoothing:t.Optional(t.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"}))},{$id:"InputGraphVisualizationTimeseriesPromql",title:"TimeseriesPromql"}),IK=t.Object({type:t.Literal("query-value-promql",{description:"Configures a PromQL metrics query-based aggregation as a single value"}),queries:Ya,aliases:t.Optional(ci),backgroundMode:t.Optional(t.Enum(si,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:t.Optional(t.Array(mr,{description:"Conditional formatting rules applied to the displayed value"})),precision:ue,normalizer:t.Optional(yt),legendMode:t.Optional(Ae)},{$id:"GraphVisualizationQueryValuePromql",title:"QueryValuePromql"}),bK=t.Object({type:t.Literal("query-value-promql",{description:"Configures a PromQL metrics query-based aggregation as a single value"}),queries:Va,aliases:t.Optional(pi),backgroundMode:t.Optional(t.Enum(si,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:t.Optional(t.Array(mr,{description:"Conditional formatting rules applied to the displayed value"})),precision:ue,normalizer:t.Optional(ht),legendMode:t.Optional(Ae)},{$id:"InputGraphVisualizationQueryValuePromql",title:"QueryValuePromql"}),SK=t.Object({type:t.Literal("top-list-promql",{description:"Displays PromQL metrics query-based aggregation as a ranked top list"}),queries:Ya,aliases:t.Optional(ci),normalizer:t.Optional(yt),precision:ue,conditions:t.Optional(t.Array(mr,{description:"Conditional formatting rules applied to the displayed value"}))},{$id:"GraphVisualizationTopListPromql",title:"TopListPromql"}),OK=t.Object({type:t.Literal("top-list-promql",{description:"Displays PromQL metrics query-based aggregation as a ranked top list"}),queries:Va,aliases:t.Optional(pi),normalizer:t.Optional(ht),precision:ue,conditions:t.Optional(t.Array(mr,{description:"Conditional formatting rules applied to the displayed value"}))},{$id:"InputGraphVisualizationTopListPromql",title:"TopListPromql"}),AK=t.Object({type:t.Literal("pie-promql",{description:"Displays PromQL metrics query-based aggregation as a pie chart"}),queries:Ya,aliases:t.Optional(ci),normalizer:t.Optional(yt),precision:ue,legendMode:t.Optional(Ae)},{$id:"GraphVisualizationPiePromql",title:"PiePromql"}),xK=t.Object({type:t.Literal("pie-promql",{description:"Displays PromQL metrics query-based aggregation as a pie chart"}),queries:Va,aliases:t.Optional(pi),normalizer:t.Optional(ht),precision:ue,legendMode:t.Optional(Ae)},{$id:"InputGraphVisualizationPiePromql",title:"PiePromql"}),RK=t.Object({type:t.Literal("bar-promql",{description:"Displays PromQL metrics query-based aggregation as a bar chart"}),queries:Ya,aliases:t.Optional(ci),timeBucket:t.Optional(fn),precision:ue,normalizer:t.Optional(yt),thresholds:jt,legendMode:t.Optional(Ae),yAxisSettings:t.Optional(li)},{$id:"GraphVisualizationBarPromql",title:"BarPromql"}),CK=t.Object({type:t.Literal("bar-promql",{description:"Displays PromQL metrics query-based aggregation as a bar chart"}),queries:Va,aliases:t.Optional(pi),timeBucket:t.Optional(fn),precision:ue,normalizer:t.Optional(ht),thresholds:jt,legendMode:t.Optional(Ae),yAxisSettings:t.Optional(di)},{$id:"InputGraphVisualizationBarPromql",title:"BarPromql"}),PK=t.Object({type:t.Literal("timeseries",{description:"Displays the aggregation as a time series chart"}),...ui,timeBucket:t.Optional(fn),normalizer:t.Optional(yt),precision:ue,legendMode:t.Optional(Ae),thresholds:jt,yAxisSettings:t.Optional(li),smoothing:t.Optional(t.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"}))},{$id:"GraphVisualizationTimeseries",title:"Timeseries"}),UK=t.Object({type:t.Literal("timeseries",{description:"Displays the aggregation as a time series chart"}),...mi,timeBucket:t.Optional(fn),normalizer:t.Optional(ht),precision:ue,legendMode:t.Optional(Ae),thresholds:jt,yAxisSettings:t.Optional(di),smoothing:t.Optional(t.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"}))},{$id:"InputGraphVisualizationTimeseries",title:"Timeseries"}),wK=t.Object({type:t.Literal("top-list",{description:"Displays the aggregation as a ranked list of top results"}),...ui,normalizer:t.Optional(yt),precision:ue,conditions:t.Optional(t.Array(mr,{description:"Conditional formatting rules applied to the displayed value"}))},{$id:"GraphVisualizationTopList",title:"TopList"}),NK=t.Object({type:t.Literal("top-list",{description:"Displays the aggregation as a ranked list of top results"}),...mi,normalizer:t.Optional(ht),precision:ue,conditions:t.Optional(t.Array(mr,{description:"Conditional formatting rules applied to the displayed value"}))},{$id:"InputGraphVisualizationTopList",title:"TopList"}),LK=t.Object({type:t.Literal("pie",{description:"Displays the aggregation as a pie chart"}),...ui,normalizer:t.Optional(yt),precision:ue,legendMode:t.Optional(Ae)},{$id:"GraphVisualizationPie",title:"Pie"}),vK=t.Object({type:t.Literal("pie",{description:"Displays the aggregation as a pie chart"}),...mi,normalizer:t.Optional(ht),precision:ue,legendMode:t.Optional(Ae)},{$id:"InputGraphVisualizationPie",title:"Pie"}),kK=t.Object({type:t.Literal("query-value",{description:"Displays the aggregation as a single value"}),...yp,backgroundMode:t.Optional(t.Enum(si,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:t.Optional(t.Array(mr,{description:"Conditional formatting rules applied to the displayed value"})),precision:ue,normalizer:t.Optional(yt),legendMode:t.Optional(Ae)},{$id:"GraphVisualizationQueryValue",title:"QueryValue"}),MK=t.Object({type:t.Literal("query-value",{description:"Displays the aggregation as a single value"}),...hp,backgroundMode:t.Optional(t.Enum(si,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:t.Optional(t.Array(mr,{description:"Conditional formatting rules applied to the displayed value"})),precision:ue,normalizer:t.Optional(ht),legendMode:t.Optional(Ae)},{$id:"InputGraphVisualizationQueryValue",title:"QueryValue"}),DK=t.Object({type:t.Literal("bar",{description:"Displays the aggregation as a bar chart"}),...ui,timeBucket:t.Optional(fn),precision:ue,normalizer:t.Optional(yt),thresholds:jt,legendMode:t.Optional(Ae),yAxisSettings:t.Optional(li)},{$id:"GraphVisualizationBar",title:"Bar"}),GK=t.Object({type:t.Literal("bar",{description:"Displays the aggregation as a bar chart"}),...mi,timeBucket:t.Optional(fn),precision:ue,normalizer:t.Optional(ht),thresholds:jt,legendMode:t.Optional(Ae),yAxisSettings:t.Optional(di)},{$id:"InputGraphVisualizationBar",title:"Bar"}),$K=t.Object({type:t.Literal("distribution",{description:"Displays the aggregation as a distribution chart"}),...ui,precision:ue,normalizer:t.Optional(yt),percentileMarkers:t.Optional(tK),boundsScale:t.Optional(Hc)},{$id:"GraphVisualizationDistribution",title:"Distribution"}),jK=t.Object({type:t.Literal("distribution",{description:"Displays the aggregation as a distribution chart"}),...mi,precision:ue,normalizer:t.Optional(ht),percentileMarkers:t.Optional(rK),boundsScale:t.Optional(Hc)},{$id:"InputGraphVisualizationDistribution",title:"Distribution"}),sP=["red","pink","violet","blue","cyan","green","yellow","orange"],cP=t.Enum(sP,{description:"Color palette used to render the heatmap intensity gradient"}),qK=t.Object({type:t.Literal("heatmap",{description:"Displays the aggregation as a heatmap chart"}),...ui,precision:ue,normalizer:t.Optional(yt),palette:t.Optional(cP)},{$id:"GraphVisualizationHeatmap",title:"Heatmap"}),BK=t.Object({type:t.Literal("heatmap",{description:"Displays the aggregation as a heatmap chart"}),...mi,precision:ue,normalizer:t.Optional(ht),palette:t.Optional(cP)},{$id:"InputGraphVisualizationHeatmap",title:"Heatmap"}),pP=t.Object({from:t.Number({description:"Lower bound of the Gauge color threshold; runs up to the next threshold or the max"}),color:t.Enum(sP,{description:"Color applied to the band starting at this value"})},{title:"GaugeColorThreshold",description:"Color band of the gauge range. Bands are ordered by `from`, so entries may be listed in any order."}),FK=t.Object({type:t.Literal("gauge",{description:"Displays the aggregation as a gauge"}),...yp,max:t.Optional(t.Number({description:"Gauge maximum value"})),colorThresholds:t.Optional(t.Array(pP,{description:"Color thresholds inside the gauge range"})),precision:ue,normalizer:t.Optional(yt)},{$id:"GraphVisualizationGauge",title:"Gauge"}),HK=t.Object({type:t.Literal("gauge",{description:"Displays the aggregation as a gauge"}),...hp,max:t.Optional(t.Number({description:"Gauge maximum value"})),colorThresholds:t.Optional(t.Array(pP,{description:"Color thresholds inside the gauge range"})),precision:ue,normalizer:t.Optional(ht)},{$id:"InputGraphVisualizationGauge",title:"Gauge"}),KK=t.Object({type:t.Literal("table",{description:"Displays the aggregation as a table with multi-level grouping"}),columns:t.Array(QH,{description:"Each column defines an independent aggregation displayed as a table column"}),groupBy:t.Optional(Bo),defaultSorting:t.Optional(ZH),columnSizes:t.Optional(t.Record(t.String(),t.Number({description:"Column width by column id"}),{description:"Table column widths in pixels, keyed by column id: `label` for the grouping column and `col-<index>` for each entry in `columns`. Columns without an entry keep their default width."}))},{$id:"GraphVisualizationTable",title:"Table"}),zK=t.Object({type:t.Literal("table",{description:"Displays the aggregation as a table with multi-level grouping"}),columns:t.Array(WH,{minItems:1,description:"Each column defines an independent aggregation displayed as a table column"}),groupBy:t.Optional(br),defaultSorting:t.Optional(XH),columnSizes:t.Optional(t.Record(t.String(),t.Number({description:"Column width by column id"}),{description:"Table column widths in pixels, keyed by column id: `label` for the grouping column and `col-<index>` for each entry in `columns`. Columns without an entry keep their default width."}))},{$id:"InputGraphVisualizationTable",title:"Table"}),YK=t.Object({type:t.Literal("note",{description:"Displays static text on the dashboard"}),note:t.Optional(t.String({description:"Markdown-compatible text shown in the note"})),noteColor:t.Optional(t.Enum(WC,{description:"Background color used to render the note"})),noteAlign:t.Optional(dn),noteJustifyContent:t.Optional(dn)},{$id:"GraphVisualizationNote",title:"Note"}),VK=t.Object({type:t.Literal("note",{description:"Displays static text on the dashboard"}),note:t.Optional(p({type:"long",description:"Markdown-compatible text shown in the note"})),noteColor:t.Optional(t.Enum(WC,{description:"Background color used to render the note"})),noteAlign:t.Optional(dn),noteJustifyContent:t.Optional(dn)},{$id:"InputGraphVisualizationNote",title:"Note"}),QK=I("type",[nK,iK,sK,pK,mK,dK,EK,IK,SK,AK,RK,PK,wK,LK,kK,FK,DK,$K,qK,KK,JH,YK,gK,hK],{description:"Widget visualization configuration. The `type` discriminator selects the widget kind and its required fields."}),WK=I("type",[oK,aK,cK,uK,lK,fK,_K,bK,OK,xK,CK,UK,NK,vK,MK,HK,GK,jK,BK,zK,eK,VK,yK,TK],{description:"Widget visualization configuration. The `type` discriminator selects the widget kind and its required fields."}),Tp=t.Object({id:t.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:t.Optional(t.String({description:"Display name of the graph widget."})),description:t.Optional(t.String({description:"Optional text shown with the graph widget."})),descriptionAlign:t.Optional(dn),descriptionJustifyContent:t.Optional(dn),visualization:QK,layout:t.Optional(t.Object({x:t.Number({description:"Column position of the widget on the 12-column dashboard grid. 0 is the leftmost column; increasing values move right."}),y:t.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:t.Number({description:"Width of the widget in grid columns, out of the 12-column grid."}),h:t.Number({description:"Height of the widget in grid rows, where each row is 50 pixels tall."})},{description:"Grid position and size of the widget. Optional; when provided, width and height must meet the minimum size for the widget type."}))},{title:"Graph",description:"Single dashboard widget, combining its identity, its visualization configuration, and its position on the dashboard grid."}),Ep=t.Object({id:p({description:"Unique identifier of the graph widget inside the dashboard. Assign it when the graph is created; use it to target the graph in later update requests."}),name:t.Optional(p({description:"Display name of the graph widget."})),description:t.Optional(t.String({minLength:1,maxLength:800,description:"Text shown with the graph widget."})),descriptionAlign:t.Optional(dn),descriptionJustifyContent:t.Optional(dn),visualization:WK,layout:t.Optional(t.Object({x:t.Number({description:"Column position of the widget on the 12-column dashboard grid. 0 is the leftmost column; increasing values move right."}),y:t.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:t.Number({description:"Width of the widget in grid columns, out of the 12-column grid."}),h:t.Number({description:"Height of the widget in grid rows, where each row is 50 pixels tall."})},{description:"Grid position and size of the widget. Optional; when provided, width and height must meet the minimum size for the widget type."}))},{title:"Graph",description:"Single dashboard widget, combining its identity, its visualization configuration, and its position on the dashboard grid."}),QC=10,ZK=t.Array(t.Object({key:t.String({description:"Dashboard-wide filter key, usually a telemetry attribute name."}),values:t.Array(t.String({description:"Filter value."}),{description:"Allowed values for this dashboard-wide filter."}),exclude:t.Optional(t.Boolean({description:"If true, widgets exclude telemetry whose value matches this filter instead of including it (is-not)."}))}),{description:"Dashboard-wide filters applied to every widget on the dashboard."}),XK=t.Array(t.Object({key:p({description:"Dashboard-wide filter key, usually a telemetry attribute name."}),values:t.Array(p({description:"Filter value."}),{description:"Allowed values for this dashboard-wide filter."}),exclude:t.Optional(t.Boolean({description:"If true, widgets exclude telemetry whose value matches this filter instead of including it (is-not)."}))}),{maxItems:QC,description:`Dashboard-wide filters applied to every widget on the dashboard. Up to ${QC} filters are allowed.`}),fi=t.Object({id:t.String({description:"Tsuga-generated dashboard ID assigned when the dashboard is created."}),name:t.String({description:"Display name of the dashboard. Set by the caller on create or update."}),owner:t.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:t.Array(Tp,{description:"Ordered widgets that compose the dashboard"}),filters:t.Optional(ZK),createdAt:T({description:"Timestamp when Tsuga created the dashboard."}),updatedAt:T({description:"Timestamp when Tsuga last updated the dashboard."}),creator:t.Optional(pe),updater:t.Optional(pe),tags:ke,timePreset:t.Optional(t.Enum(su,{description:"Relative time preset used when opening the dashboard."})),folderId:t.Optional(t.String({description:"Folder that contains the dashboard. Set from the dashboard's saved folder relationship. Returned when the dashboard is in a folder; omitted when it is not."}))}),_p=t.Object({name:p({description:"Display name of the dashboard."}),owner:p({allowEmpty:!1,description:"ID of the team that owns the dashboard. Required and used for dashboard access control."}),graphs:t.Array(Ep,{description:"Ordered widgets that compose the dashboard"}),filters:t.Optional(XK),tags:Qe,timePreset:t.Optional(t.Enum(su,{description:"Relative time preset used when opening the dashboard. Optional; create defaults to `past-30-minutes` when omitted, and update omission preserves the current value."})),folderId:t.Optional(t.Union([t.Null(),p({allowEmpty:!1})],{description:"Folder that should contain the dashboard. Optional; omit on update to keep the current folder, pass null to clear the folder, or pass a readable dashboard-folder ID to move it."}))}),Wt={IS_FAVORITE:"isFavorite",OWNER:"owner",TAGS:"tags",WIDGET_COUNT:"widgetCount",UPDATED_AT:"updatedAt",NAME:"name"},uP=[Wt.OWNER,Wt.TAGS,Wt.WIDGET_COUNT,Wt.UPDATED_AT,Wt.NAME],Ip=t.Partial(t.Object({owners:je(p({allowEmpty:!1}),{description:"Restrict results to dashboards owned by any of these team IDs",maxItems:50}),searchQuery:t.Object({value:p({allowEmpty:!1,description:"Substring matched case-insensitively against dashboard names or dashboard IDs. Omit the whole `searchQuery` filter to skip text filtering."}),exclude:t.Optional(t.Boolean({description:"If true, exclude dashboards matching this value instead of including them"}))},{description:"Text filter for dashboard names or IDs. Optional; `exclude: true` returns dashboards whose name and ID do not match the substring."}),tags:je(Vt.items,{description:"Restrict results to dashboards that have at least one of the listed key/value tags",maxItems:50}),folderId:t.Union([t.Null(),p({allowEmpty:!1})],{description:"Folder filter for dashboard query results. Optional; pass a folder ID to return dashboards in that folder, or null to return only dashboards that are not in any folder."})},{description:"Optional filters applied to narrow the returned dashboards"})),JK=t.Partial(t.Object({...fe,filters:Ip,sort:t.Object({by:t.Enum([Wt.IS_FAVORITE,Wt.OWNER,Wt.TAGS,Wt.WIDGET_COUNT,Wt.UPDATED_AT,Wt.NAME],{description:"Field to sort the returned dashboards by"}),direction:t.Enum(["asc","desc"],{description:"Sort direction: ascending or descending"})},{description:"Optional sorting applied to the returned dashboards"})})),z3e=l({tags:["dashboards"],url:`${Nr}/query`,method:"POST",paginated:!0,response:t.Array(fi),body:JK}),Y3e=l({tags:["dashboards"],url:`${Nr}/tags/query`,method:"POST",body:t.Object({filters:t.Optional(t.Omit(Ip,["tags"]))}),response:Yt}),V3e=l({tags:["dashboards"],url:`${Nr}/:id`,method:"GET",params:t.Object({id:p()}),response:fi}),Q3e=l({tags:["dashboards"],url:Nr,method:"POST",body:_p,response:fi}),W3e=l({tags:["dashboards"],url:`${Nr}/:id`,method:"PUT",params:t.Object({id:p()}),body:t.Partial(_p),response:fi}),Z3e=l({tags:["dashboards"],url:`${Nr}/bulk-update`,method:"PUT",body:t.Object({dashboardIds:t.Array(p(),{description:"Dashboard IDs to update. At least one dashboard ID is required."}),owner:t.Optional(p({allowEmpty:!1,description:"Owning team ID to apply to every dashboard. Optional when folderId is provided; omit to keep the current owner."})),folderId:t.Optional(t.Union([t.Null(),p({allowEmpty:!1})],{description:"Folder that should contain every dashboard. Optional when owner is provided; omit to keep the current folder, pass null to clear the folder, or pass a dashboard-folder ID to move dashboards."}))}),response:t.Object({})}),X3e=l({tags:["dashboards"],url:`${Nr}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),J3e=l({tags:["dashboards"],url:`${Nr}/:id/graphs/:graphId`,method:"PUT",params:t.Object({id:p({allowEmpty:!1}),graphId:p({allowEmpty:!1})}),body:t.Omit(Ep,["id"]),response:Tp}),e4e=l({tags:["dashboards"],url:`${Nr}/bulk-delete`,method:"DELETE",body:t.Object({ids:t.Array(p())}),response:t.Object({})});var gi=`/${"v1"}/dashboards`,Qa=t.Pick(fi,["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)."}),e2={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(Qa,{examples:[e2]});var t2=t.Object({by:t.Enum([...uP],{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:t.Enum(["asc","desc"],{description:"Sort direction: ascending or descending"})},{description:"Optional sorting applied to the returned dashboards"}),mP=t.Object({...He,filters:t.Optional(t.Pick(Ip,["owners","searchQuery","tags","folderId"])),sort:t.Optional(t2)},{description:"Dashboard query request. Use filters, sorting, limit, and offset to page through visible dashboards."}),r2={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(mP,{examples:[r2]});var lP=l({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:`${gi}/query`,method:"POST",paginated:!0,body:mP,response:t.Array(Qa)}),dP=l({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:`${gi}/:id`,method:"GET",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the saved dashboard to retrieve. Use the `id` returned by dashboard query, create, or update responses."})}),response:Qa}),zd=t.Pick(_p,["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."}),n2={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(zd,{examples:[n2]});var o2=t.Omit(Ep,["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."}),fP=l({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:gi,method:"POST",body:zd,response:Qa}),gP=l({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:`${gi}/:id`,method:"PUT",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the saved dashboard to update. Use the `id` returned by dashboard query, get, or create responses."})}),body:t.Partial(zd),response:Qa}),i2=t.Object({id:p({allowEmpty:!1,description:"Identifier of the saved dashboard to delete. Use the `id` returned by dashboard query, get, create, or update responses."})}),yP=l({description:"Deletes a dashboard by ID. Use only after confirming no users or automation still rely on the dashboard.",operationId:"deleteDashboard",tags:["dashboards"],url:`${gi}/:id`,method:"DELETE",params:i2,response:R}),c4e=l({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:`${gi}/:id/graphs/:graphId`,method:"PUT",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the dashboard that contains the graph to update. Use the `id` returned by dashboard responses."}),graphId:p({allowEmpty:!1,description:"Identifier of the graph to update within the dashboard. Use graph IDs from the dashboard response."})}),body:o2,response:Tp});var hP=100,TP=3,yi=t.Object({id:t.String({description:"Tsuga-generated ingestion API key ID assigned when the key is created."}),name:t.String({description:"Human-readable key name. Names must be kebab-case when creating or updating keys."}),keyLastCharacters:t.String({description:"Last visible characters of the secret key. Use this to identify a key without exposing the full secret."}),owner:t.String({description:"Team ID that owns and manages the ingestion API key."}),tags:Yt,teamOverrideFields:t.Optional(t.Array(t.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:t.Optional(pe),updater:t.Optional(pe),assetUpdatedAt:T({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})}),Wa=t.Object({name:t.String({format:ko,minLength:1,maxLength:hP,description:`Kebab-case name for the ingestion API key. Maximum length is ${hP} characters.`}),owner:p({allowEmpty:!1,description:"Team ID that will own and manage the ingestion API key."}),tags:Vt,teamOverrideFields:t.Union([t.Array(p({allowEmpty:!1}),{minItems:1,maxItems:TP,description:`Array form. Up to ${TP} fields are allowed.`}),t.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."})}),Za="/v0/ingestion-api-keys",h4e=l({tags:["ingestion-api-keys"],url:Za,method:"POST",body:Wa,response:t.Intersect([yi,t.Object({key:t.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."})})])}),T4e=l({tags:["ingestion-api-keys"],url:Za,method:"GET",paginated:!0,query:t.Object(fe),response:t.Array(yi)}),E4e=l({tags:["ingestion-api-keys"],url:`${Za}/:id`,method:"GET",params:t.Object({id:p({allowEmpty:!1})}),response:yi}),_4e=l({tags:["ingestion-api-keys"],url:`${Za}/:id`,method:"PUT",params:t.Object({id:p({allowEmpty:!1})}),body:Wa,response:yi}),I4e=l({tags:["ingestion-api-keys"],url:`${Za}/:id`,method:"DELETE",params:t.Object({id:p({allowEmpty:!1})}),response:R});var Xa=`/${"v1"}/ingestion-api-keys`,Ja=t.Pick(yi,["id","name","owner","tags","teamOverrideFields","keyLastCharacters"],{$id:"IngestionApiKey",description:"API key used to send telemetry data to Tsuga. The full key secret is returned only when the key is created. See [API keys](/documentation/account-and-settings/api-keys)."}),EP={id:"123-456-abc",name:"production-logs-ingestion",keyLastCharacters:"x7Qm",owner:"team-123-abc",tags:[{key:"env",value:"production"}],teamOverrideFields:["service"]};Object.assign(Ja,{examples:[EP]});var _P=t.Pick(Wa,["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."}),IP=t.Pick(Wa,["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."}),bP={name:"production-logs-ingestion",owner:"team-123-abc",tags:[{key:"env",value:"production"}],teamOverrideFields:["service"]};Object.assign(_P,{examples:[bP]});Object.assign(IP,{examples:[bP]});var a2={...EP,key:"tsuga_in:v1:abc123xyx7Qm"},SP=l({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:Xa,method:"GET",paginated:!0,query:t.Object(He),response:t.Array(Ja)}),P4e=l({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:`${Xa}/:id`,method:"GET",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the ingestion API key to retrieve. Use the `id` returned by ingestion API key list or create responses."})}),response:Ja}),s2=t.Intersect([t.Pick(Ja,["id","name","keyLastCharacters","owner","tags","teamOverrideFields"]),t.Object({key:t.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:a2}),OP=l({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:Xa,method:"POST",body:_P,response:s2}),AP=l({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:`${Xa}/:id`,method:"PUT",params:t.Object({id:p({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:IP,response:Ja}),xP=l({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:`${Xa}/:id`,method:"DELETE",params:t.Object({id:p({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:R});var c2={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"]}},[L4e,Qd,es]=p2(c2);function p2(e){let r=[],n=[],o=[],i=Object.keys(e);for(let a of i){r.push(a);let c=e[a];for(let m in c){n.push(m);let d=c[m];Array.isArray(d)&&o.push(...d)}}return[Yd(r),Yd(n),Yd(o)]}function Yd(e){if(e.length===0)throw new Error("Array must have at least one element.");return e}var Vd=t.Enum(["HTTP","HTTPS","TCP","UDP","GENEVE","TLS","TLS_QUIC","TCP_UDP","TCP_QUIC","QUIC"]),u2=t.Object({versioningStatus:t.Optional(t.Enum(["Enabled","Disabled","Suspended","Not configured"]))}),m2=t.Object({domainName:t.Optional(t.String()),origins:t.Optional(t.Array(t.String()))}),l2=t.Object({allocatedStorageGib:t.Optional(t.Number()),encryptedAtRest:t.Optional(t.Boolean()),engine:t.Optional(t.String()),dynamoDbItemCount:t.Optional(t.Number()),dynamoDbActualSizeGib:t.Optional(t.Number())}),d2=t.Object({version:t.Optional(t.String()),virtualNetworkId:t.Optional(t.String()),subnets:t.Optional(t.Array(t.String()))}),f2=t.Object({artifactRegistryFormat:t.Optional(t.Enum(["FORMAT_UNSPECIFIED","DOCKER","MAVEN","NPM","APT","YUM","PYTHON","KFP","GO","GENERIC"])),uri:t.Optional(t.String()),tagMutability:t.Optional(t.Enum(["MUTABLE","IMMUTABLE"])),scanOnPush:t.Optional(t.Boolean()),encryptionType:t.Optional(t.String())}),g2=t.Object({status:t.Optional(t.String()),activeServices:t.Optional(t.Number()),pendingTasks:t.Optional(t.Number()),runningTasks:t.Optional(t.Number()),registeredContainerInstances:t.Optional(t.Number()),capacityProviders:t.Optional(t.Array(t.String()))}),y2=t.Object({status:t.Optional(t.String()),desiredStatus:t.Optional(t.String()),healthStatus:t.Optional(t.String()),availabilityZone:t.Optional(t.String()),startedAt:t.Optional(T())}),h2=t.Object({isEncrypted:t.Optional(t.Boolean()),ownerId:t.Optional(t.String()),state:t.Optional(t.Enum(["creating","available","deleting","deleted","error","updating"]))}),T2=t.Object({type:t.Optional(t.String()),osType:t.Optional(t.String()),subnetIds:t.Optional(t.Array(t.String())),nbContainers:t.Optional(t.Number())}),E2=t.Object({digest:t.String(),imageTags:t.Array(t.String()),imageSizeBytes:t.Optional(t.Number()),imagePushedAt:t.Optional(T()),mediaType:t.Optional(t.String()),repositoryName:t.String(),repositoryId:t.Optional(t.String()),scanStatus:t.Optional(t.String())}),_2=t.Object({url:t.Optional(t.String()),maxMessageSizeBytes:t.Optional(t.Number()),messageRetentionHours:t.Optional(t.Number())}),I2=t.Object({runtime:t.Optional(t.String()),memoryAllocationMib:t.Optional(t.Number()),timeoutMs:t.Optional(t.Number()),codeSha256:t.Optional(t.String())}),b2=t.Object({kind:t.Optional(t.String())}),S2=t.Object({instanceId:t.String(),architecture:t.Optional(t.String()),instanceType:t.Optional(t.String()),operatingSystem:t.Optional(t.String()),memoryMib:t.Optional(t.Number()),vCpus:t.Optional(t.Number()),vpcId:t.Optional(t.String()),k8sClusterId:t.Optional(t.String())}),O2=t.Object({id:t.Optional(t.String()),ipCidrBlocks:t.Array(t.String())}),A2=t.Object({protocol:t.Optional(Vd),port:t.Optional(t.Number()),instanceProtocol:t.Optional(Vd),instancePort:t.Optional(t.Number())}),x2=t.Object({protocol:t.Optional(t.String()),ports:t.Optional(t.Array(t.String())),portRange:t.Optional(t.String()),allPorts:t.Optional(t.Boolean())}),R2=t.Object({name:t.String(),ip:t.Optional(t.String()),type:t.Enum(["public","private"])}),C2=t.Object({type:t.String(),name:t.String()}),P2=t.Object({frontendIp:t.Optional(R2),backendIpPools:t.Array(C2)}),U2=t.Object({targetId:t.String(),targetPort:t.Optional(t.Number()),targetType:t.Optional(t.Enum(["instance","ip","lambda","alb"])),healthState:t.Optional(t.String()),healthReason:t.Optional(t.String()),healthDescription:t.Optional(t.String()),availabilityZone:t.Optional(t.String())}),w2=t.Object({protocol:t.Optional(Vd),port:t.Optional(t.Number()),type:t.Optional(t.Enum(["alb","lambda","instance","ip"])),name:t.Optional(t.String()),targetGroupArn:t.Optional(t.String()),virtualNetworkId:t.Optional(t.String()),healthCheckProtocol:t.Optional(t.String()),healthCheckPort:t.Optional(t.String()),healthCheckPath:t.Optional(t.String()),healthCheckIntervalSeconds:t.Optional(t.Number()),healthCheckTimeoutSeconds:t.Optional(t.Number()),healthyThresholdCount:t.Optional(t.Number()),unhealthyThresholdCount:t.Optional(t.Number()),targets:t.Optional(t.Array(U2)),targetCount:t.Optional(t.Number()),healthyTargetCount:t.Optional(t.Number()),loadBalancerArns:t.Optional(t.Array(t.String()))}),N2=t.Object({first:t.Optional(t.String()),last:t.Optional(t.String()),scope:t.Optional(t.Number())}),L2=t.Object({type:t.Optional(t.String()),name:t.Optional(t.String()),alwaysServe:t.Optional(t.Boolean()),subnets:t.Optional(t.Array(t.Union([t.Number(),N2]))),target:t.Optional(t.String()),weight:t.Optional(t.Number()),priority:t.Optional(t.Number()),status:t.Optional(t.String())}),v2=t.Object({instanceId:t.Optional(t.String()),state:t.Optional(t.String()),reasonCode:t.Optional(t.String()),description:t.Optional(t.String())}),k2=t.Object({loadBalancerType:t.Optional(t.String()),dnsName:t.Optional(t.String()),virtualNetworkId:t.Optional(t.String()),subnetIds:t.Array(t.String()),scheme:t.Optional(t.String()),listeners:t.Optional(t.Union([t.Array(A2),t.Array(x2)])),targets:t.Optional(t.Union([t.Array(t.String()),t.Array(v2),t.Array(L2)])),azureLoadBalancingRules:t.Optional(t.Array(P2))}),M2=t.Object({domainName:t.Optional(t.String()),expiresAt:t.Optional(T()),inUseBy:t.Optional(t.Array(t.String())),renewalEligibility:t.Optional(t.String()),revokedAt:t.Optional(T()),status:t.Optional(t.String()),type:t.Optional(t.String())}),D2=t.Object({state:t.Optional(t.Enum(["creating","available","deleting","deleted","error","in-use"])),volumeType:t.Optional(t.Enum(["gp2","gp3","io1","io2","st1","sc1","standard"]))}),G2=t.Object({osType:t.Optional(t.Enum(["Windows","Linux"]))}),$2=t.Object({state:t.Optional(t.String()),volumeType:t.Optional(t.String())}),j2=t.Intersect([t.Object({isEncrypted:t.Optional(t.Boolean()),sizeGib:t.Optional(t.Number())}),t.Union([D2,$2,G2])]),q2=t.Object({instanceCount:t.Optional(t.Number()),hostnames:t.Optional(t.Array(t.String())),runtime:t.Optional(t.String())}),bp=t.Union([t.Object({category:t.Literal("application"),resourceType:t.Literal("webService"),attributes:t.Optional(q2)}),t.Object({category:t.Literal("data"),resourceType:t.Literal("bucket"),attributes:t.Optional(u2)}),t.Object({category:t.Literal("data"),resourceType:t.Literal("messagingService"),attributes:t.Optional(_2)}),t.Object({category:t.Literal("data"),resourceType:t.Literal("fileSystem"),attributes:t.Optional(h2)}),t.Object({category:t.Literal("data"),resourceType:t.Literal("contentDeliveryNetwork"),attributes:t.Optional(m2)}),t.Object({category:t.Literal("data"),resourceType:t.Literal("database"),attributes:t.Optional(l2)}),t.Object({category:t.Literal("data"),resourceType:t.Literal("storageAccount"),attributes:t.Optional(b2)}),t.Object({category:t.Literal("data"),resourceType:t.Literal("volume"),attributes:t.Optional(j2)}),t.Object({category:t.Literal("compute"),resourceType:t.Literal("virtualMachine"),attributes:t.Optional(S2)}),t.Object({category:t.Literal("compute"),resourceType:t.Literal("serverless"),attributes:t.Optional(I2)}),t.Object({category:t.Literal("container"),resourceType:t.Literal("kubernetesCluster"),attributes:t.Optional(d2)}),t.Object({category:t.Literal("container"),resourceType:t.Literal("containerRepository"),attributes:t.Optional(f2)}),t.Object({category:t.Literal("container"),resourceType:t.Literal("containerCluster"),attributes:t.Optional(g2)}),t.Object({category:t.Literal("container"),resourceType:t.Literal("containerServiceTask"),attributes:t.Optional(y2)}),t.Object({category:t.Literal("container"),resourceType:t.Literal("containerService"),attributes:t.Optional(T2)}),t.Object({category:t.Literal("container"),resourceType:t.Literal("containerImage"),attributes:t.Optional(E2)}),t.Object({category:t.Literal("network"),resourceType:t.Literal("virtualNetwork"),attributes:t.Optional(O2)}),t.Object({category:t.Literal("network"),resourceType:t.Literal("loadBalancer"),attributes:k2}),t.Object({category:t.Literal("network"),resourceType:t.Literal("targetGroup"),attributes:t.Optional(w2)}),t.Object({category:t.Literal("network"),resourceType:t.Literal("certificate"),attributes:t.Optional(M2)})],{description:"Normalized public inventory category, resource type, and category-specific attributes. Attribute shape depends on the category and resourceType combination."});var no="/v0/inventory",ts=["aws","gcp","azure"],RP=["scan_in_progress","success","failure","partial"],Zd=t.Object({id:t.String({description:"Identifier of the inventory resource. Generated by Tsuga."}),cloudPlatform:t.Enum(ts,{description:"Cloud platform where Tsuga discovered this resource."}),cloudAccount:t.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:t.Optional(t.String({description:"Cloud region where Tsuga discovered this resource, when the resource is regional."})),fullyQualifiedResourceId:t.String({description:"Cloud-native unique identifier for this resource, such as an AWS ARN, GCP resource name, or Azure resource ID."}),displayName:t.String({description:"Human-readable resource name shown in Tsuga. Derived from cloud provider metadata when available."}),nativeResourceType:t.String({description:"Cloud-native resource type reported by the inventory integration, for example `aws_ec2_instance` or `gcp_bucket`."}),resourceCreatedAt:t.Optional(T({description:"Timestamp when the resource was created in the cloud, when known."})),resourceUpdatedAt:t.Optional(T({description:"Timestamp when the resource was last updated in the cloud, when known."})),resourceLastSeenAt:T({description:"Timestamp when Tsuga last observed this resource during an inventory scan."}),tags:ke,nativeAttributes:t.Optional(t.Unsafe({type:"object",additionalProperties:!0})),covered:t.Optional(t.Boolean({description:"Whether the resource is covered by the configured infrastructure-as-code identifiers"}))}),hi={DISPLAY_NAME:"displayName",CLOUD_ACCOUNT:"cloudAccount",NATIVE_RESOURCE_TYPE:"nativeResourceType",CLOUD_REGION:"cloudRegion",RESOURCE_TYPE:"resourceType",RESOURCE_CREATED_AT:"resourceCreatedAt"},CP=t.Object({cloudPlatforms:je(t.Enum(ts),{description:"Restrict results to resources discovered on any of these cloud platforms",maxItems:ts.length}),cloudAccounts:je(p({allowEmpty:!1}),{description:"Restrict results to resources in any of these cloud accounts",maxItems:500}),cloudRegions:je(p({allowEmpty:!1}),{description:"Restrict results to resources in any of these cloud regions",maxItems:500}),nativeResourceTypes:je(t.Enum(es),{description:"Restrict results to resources of any of these cloud-native resource types",maxItems:es.length}),resourceTypes:je(t.Enum(Qd),{description:"Restrict results to resources of any of these normalized resource types",maxItems:Qd.length}),tags:je(Vt.items,{description:"Restrict results to resources that have at least one of the listed key/value tags",maxItems:50}),isIacManaged:t.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:t.Object({value:p({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:t.Optional(t.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"}),Xd=t.Partial(t.Object({...fe,filters:t.Partial(CP,{description:"Filters applied to narrow the returned resources."}),sort:t.Object({by:t.Enum([hi.DISPLAY_NAME,hi.CLOUD_ACCOUNT,hi.NATIVE_RESOURCE_TYPE,hi.CLOUD_REGION,hi.RESOURCE_TYPE,hi.RESOURCE_CREATED_AT],{description:"Field to sort the returned resources by"}),direction:t.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."})})),q4e=l({tags:["inventory"],method:"POST",url:`${no}/resources/query`,paginated:!0,body:Xd,response:t.Array(t.Intersect([Zd,bp]))}),B2=["resourceType","cloudAccount","isIacManaged"],B4e=l({tags:["inventory"],method:"POST",url:`${no}/resources/counts`,body:t.Object({filters:t.Optional(t.Partial(CP)),groupBy:t.Enum(B2,{description:"Dimension to group the resource counts by."})}),response:t.Array(t.Object({value:t.String({description:'The group value the count belongs to: a resource type, a cloud account id, or "true"/"false" for IaC coverage.'}),count:t.Integer({description:"Number of resources in this group matching the requested filters."})}))}),F4e=l({tags:["inventory"],method:"GET",url:`${no}/resources/filter-options`,response:t.Object({cloudRegions:t.Array(t.String(),{description:"Distinct cloud regions present across the tenant's resources."}),nativeResourceTypes:t.Array(t.String(),{description:"Distinct cloud-native resource types present across the tenant's resources."}),tags:Yt})}),H4e=I("type",[t.Object({type:t.Literal("aws",{description:"Discriminator identifying AWS connection settings."}),accountId:t.String({description:"AWS account ID that Tsuga scans."}),externalId:t.String({description:"External ID Tsuga passes when assuming the cross-account IAM role."}),roleArn:t.String({description:"ARN of the IAM role Tsuga assumes to read inventory in the account."})}),t.Object({type:t.Literal("gcp",{description:"Discriminator identifying GCP connection settings."}),projectId:t.String({description:"GCP project ID that Tsuga scans."}),serviceAccountId:t.String({description:"Service account Tsuga impersonates to read inventory."}),workloadIdentityProvider:t.String({description:"Workload identity provider resource name used for federated authentication."})}),t.Object({type:t.Literal("azure",{description:"Discriminator identifying Azure connection settings."}),clientId:t.String({description:"Client ID of the Azure application Tsuga authenticates as."}),subscriptionId:t.String({description:"Azure subscription ID that Tsuga scans."}),tenantId:t.String({description:"Azure tenant ID that owns the subscription."})})]),F2="^[0-9]{12}$",H2="^arn:aws[a-z-]*:iam::[0-9]{12}:role/.+$",K2="^[a-z][a-z0-9-]{4,28}[a-z0-9]$",z2="^[^@\\s]+@[^@\\s]+\\.iam\\.gserviceaccount\\.com$",Y2="^//iam\\.googleapis\\.com/projects/[0-9]+/locations/global/workloadIdentityPools/[^/]+/providers/[^/]+$",Wd="^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$",V2=t.Object({type:t.Literal("aws",{description:"Discriminator identifying AWS connection settings."}),accountId:t.String({pattern:F2,description:"AWS account ID that Tsuga scans.",errorMessage:{pattern:"Must be a 12-digit AWS account ID."}}),externalId:p({allowEmpty:!1,description:"External ID Tsuga passes when assuming the cross-account IAM role."}),roleArn:t.String({pattern:H2,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"}),Q2=t.Object({type:t.Literal("gcp",{description:"Discriminator identifying GCP connection settings."}),projectId:t.String({pattern:K2,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:t.String({pattern:z2,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:t.String({pattern:Y2,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"}),W2=t.Object({type:t.Literal("azure",{description:"Discriminator identifying Azure connection settings."}),clientId:t.String({pattern:Wd,minLength:1,description:"Client ID of the Azure application Tsuga authenticates as (GUID).",errorMessage:{pattern:"Must be a GUID."}}),subscriptionId:t.String({pattern:Wd,minLength:1,description:"Azure subscription ID that Tsuga scans (GUID).",errorMessage:{pattern:"Must be a GUID."}}),tenantId:t.String({pattern:Wd,minLength:1,description:"Azure tenant ID that owns the subscription (GUID).",errorMessage:{pattern:"Must be a GUID."}})},{$id:"AzureConnectionSettings"}),PP=I("type",[V2,Q2,W2],{description:"Credentials Tsuga uses to scan the account, in the provider-specific shape selected by `type`. Credentials are stored as provided and are not validated at creation time; failures surface through `lastScanStatus`."}),Ti=t.Object({id:t.String({description:"Identifier of the cloud account. Generated by Tsuga."}),cloudType:t.Enum(ts,{description:"Cloud provider of the account."}),cloudAccountId:t.String({description:"Cloud-native account identifier: an AWS account ID, GCP project ID, or Azure subscription ID."}),accountFriendlyName:t.Optional(t.String({description:"Human-readable name for the account shown in Tsuga."})),organizationId:t.Optional(t.String({description:"Cloud organization identifier, when known."})),createdBy:t.Optional(t.String({description:"Identifier of the user who created the account, when created by a user."})),createdAt:T({description:"Timestamp when the account was registered in Tsuga."}),lastScanStartedAt:t.Optional(T({description:"Timestamp when the most recent inventory scan started."})),lastScanFinishedAt:t.Optional(T({description:"Timestamp when the most recent inventory scan finished."})),lastScanStatus:t.Optional(t.Enum(RP,{description:"Status of the most recent inventory scan."}))}),Jd=t.Object({cloudType:t.Enum(ts,{description:"Cloud provider of the account."}),cloudAccountId:p({allowEmpty:!1,description:"Cloud-native account identifier: an AWS account ID, GCP project ID, or Azure subscription ID."}),accountFriendlyName:t.Optional(p({description:"Human-readable name for the account shown in Tsuga."})),organizationId:t.Optional(p({description:"Cloud organization identifier, when known."})),connectionSettings:PP,lastScanStatus:t.Optional(t.Enum(RP,{description:"Status of the most recent inventory scan."}))}),oo=`${no}/cloud-accounts`,K4e=l({tags:["inventory"],url:oo,method:"GET",response:t.Array(Ti)}),z4e=l({tags:["inventory"],url:`${oo}/:id`,method:"GET",params:t.Object({id:p()}),response:Ti}),Y4e=l({tags:["inventory"],url:oo,method:"POST",body:Jd,response:Ti}),ef=t.Object({accountFriendlyName:p({description:"Human-readable name for the account shown in Tsuga."})}),V4e=l({tags:["inventory"],url:`${oo}/:id`,method:"PUT",params:t.Object({id:p()}),body:ef,response:Ti}),Q4e=l({tags:["inventory"],url:`${oo}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),W4e=l({tags:["inventory"],url:`${no}/trigger-scan`,method:"POST",body:t.Object({}),response:t.Object({success:t.Literal(!0)})}),Z4e=l({tags:["inventory"],url:`${oo}/azure/onboarding`,method:"POST",body:t.Object({tenantId:p()}),response:t.Object({subjectId:t.String(),audience:t.String()})}),X4e=l({tags:["inventory"],method:"POST",url:`${oo}/validate/:type`,params:t.Object({type:p()}),body:t.Object({data:PP,id:t.Optional(p())}),response:t.Object({areAccountSettingsValid:t.Boolean(),message:t.Optional(t.String())})}),UP=`${no}/settings`,J4e=l({tags:["inventory"],url:UP,method:"GET",response:t.Object({settings:t.Optional(t.Object({id:t.String(),infrastructureIdentifiers:t.Array(t.Object({name:t.String(),value:t.Optional(t.String())}))}))})}),Z2=50,eVe=l({tags:["inventory"],url:UP,method:"POST",body:t.Object({infrastructureIdentifiers:t.Array(t.Object({name:p({allowEmpty:!1}),value:t.Optional(p({allowEmpty:!1}))}),{maxItems:Z2})}),response:t.Object({})}),tVe=l({tags:["inventory"],url:`${no}/iac-tags-proposal`,method:"GET",response:t.Array(t.Object({name:t.String(),value:t.Optional(t.String())}))});var wP=`/${"v1"}/inventory`,X2=t.Omit(Zd,["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)."}),NP=t.Intersect([X2,bp],{$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)."}),J2={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(NP,{examples:[J2]});var ez=t.Object({...Xd.properties,...He},{description:"Inventory resource query request. Use filters, sorting, limit, and offset to page through discovered resources."}),LP=l({description:"Queries cloud resources discovered by inventory scans, with optional filters, sorting, and pagination. Use this endpoint to build infrastructure inventories across connected cloud accounts.",operationId:"queryInventoryResources",tags:["inventory"],url:`${wP}/resources/query`,method:"POST",paginated:!0,body:ez,response:t.Array(NP)}),rs=`${wP}/cloud-accounts`,ns=t.Pick(Ti,["id","cloudType","cloudAccountId","accountFriendlyName"],{$id:"CloudAccount"}),tz={id:"123-456-abc",cloudType:"aws",cloudAccountId:"123456789012",accountFriendlyName:"Production AWS"};Object.assign(ns,{examples:[tz]});var vP=t.Pick(Jd,["cloudType","cloudAccountId","accountFriendlyName","connectionSettings"]),rz={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(vP,{examples:[rz]});var nz=t.Pick(ef,["accountFriendlyName"]),uVe=l({description:"Lists cloud accounts connected to Tsuga that the authenticated operation key can read.",operationId:"listCloudAccounts",tags:["inventory"],url:rs,method:"GET",response:t.Array(ns)}),mVe=l({description:"Retrieves one cloud account by ID.",operationId:"getCloudAccount",tags:["inventory"],url:`${rs}/:id`,method:"GET",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the cloud account to retrieve. Use the `id` returned by the cloud account list or create operations."})}),response:ns}),lVe=l({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:rs,method:"POST",body:vP,response:ns}),dVe=l({description:"Updates the friendly name of a cloud account by ID.",operationId:"updateCloudAccount",tags:["inventory"],url:`${rs}/:id`,method:"PUT",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the cloud account to update. Use the `id` returned by the cloud account list or create operations."})}),body:nz,response:ns}),fVe=l({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:`${rs}/:id`,method:"DELETE",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the cloud account to delete. Use the `id` returned by the cloud account list or create operations."})}),response:R});var os="/v0/investigations",oz=["dashboard","monitor","service","slo","log-route"],iz=t.Object({type:t.String({description:'Kind of linked asset, e.g. "dashboard"'}),id:t.String({description:"Identifier of the linked asset"})}),az=t.Object({type:t.Enum(oz,{description:"Kind of linked asset"}),id:p({allowEmpty:!1,description:"Identifier of the linked asset"})}),Lr=t.Object({id:t.String({description:"Identifier of the investigation"}),name:t.String({description:"Human readable name shown for the investigation"}),slug:t.Optional(t.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:t.Optional(t.String({description:"Markdown content capturing the investigation notes and findings"})),tags:ke,owner:t.String({description:"Team ID owning the investigation"}),env:t.Optional(t.String({description:'Environment the investigation relates to, e.g. "prod"'})),linkedAssets:t.Array(iz,{description:"Assets (dashboards, monitors, \u2026) referenced by this investigation"}),creator:t.Optional(pe),updater:t.Optional(pe),createdAt:T({description:"Timestamp the investigation was created at."}),updatedAt:T({description:"Timestamp the investigation was last updated at."})},{title:"Investigation"}),Sp=t.Object({name:p({allowEmpty:!1,description:"Human readable name shown for the investigation"}),slug:p({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:t.Optional(p({type:"long",description:"Markdown content capturing the investigation notes and findings"})),tags:Qe,owner:p({allowEmpty:!1,description:"Team ID owning the investigation"}),env:t.Optional(p({allowEmpty:!0,description:"Environment the investigation relates to"})),linkedAssets:t.Optional(t.Array(az,{maxItems:100,description:"Assets (dashboards, monitors, \u2026) referenced by this investigation"}))}),tf=t.Object(t.Omit(Sp,["slug"]).properties),bVe=l({tags:["investigations"],url:os,method:"GET",paginated:!0,query:t.Object(fe),response:t.Array(Lr)}),SVe=l({tags:["investigations"],url:`${os}/:id`,params:t.Object({id:p()}),method:"GET",response:Lr}),OVe=l({tags:["investigations"],url:os,method:"POST",body:Sp,response:Lr}),AVe=l({tags:["investigations"],url:`${os}/:id`,method:"PUT",body:tf,params:t.Object({id:p()}),response:Lr}),xVe=l({tags:["investigations"],url:`${os}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R});var is=`/${"v1"}/investigations`,kP=l({description:"Retrieve all investigations",tags:["private"],url:is,method:"GET",paginated:!0,query:t.Object(He),response:t.Array(Lr)}),MP=l({description:"Retrieve an investigation by its id",tags:["private"],url:`${is}/:id`,method:"GET",params:t.Object({id:p({allowEmpty:!1})}),response:Lr}),DP=l({description:"Create a new investigation",tags:["private"],url:is,method:"POST",body:Sp,response:Lr}),GP=l({description:"Update an investigation by its id",tags:["private"],url:`${is}/:id`,method:"PUT",body:tf,params:t.Object({id:p({allowEmpty:!1})}),response:Lr}),$P=l({description:"Delete an investigation by its id",tags:["private"],url:`${is}/:id`,method:"DELETE",params:t.Object({id:p({allowEmpty:!1})}),response:R});var jP=15,Op={id:t.String({description:"Unique identifier of the processor within the route. Used to preserve processor identity during updates."}),description:t.Optional(t.String({description:"Optional user-provided processor note."})),tags:ke,updatedAt:t.Optional(T({description:"Timestamp when Tsuga last updated the processor."}))},Ap={id:p({allowEmpty:!1,description:"Unique identifier of the processor within the route. Preserve it across updates for existing processors."}),description:t.Optional(p({type:"long",description:"Optional processor note."})),tags:Qe,updatedAt:t.Optional(T({description:"Backend-maintained timestamp for this processor. Omit this field on create and update requests; Tsuga sets or preserves it based on processor changes."}))},qP={...Op,type:t.Literal("creator",{description:"Create processor. It writes a new attribute from a format string, formula, or category rule."})},BP={...Ap,type:t.Literal("creator",{description:"Create processor. It writes a new attribute from a format string, formula, or category rule."})},sz=I("subtype",[t.Object({targetAttribute:t.String({description:"Attribute that will receive the formatted value"}),formatString:t.String({description:"Template string used to build the target attribute value"}),overrideTarget:t.Optional(t.Boolean({description:"Whether to overwrite the target attribute when it already exists. If omitted, route processing treats this as true."})),subtype:t.Literal("format-string",{description:"Builds a string from literal text and existing attribute values."}),replaceMissingByEmpty:t.Optional(t.Boolean({description:"Whether missing referenced attributes render as empty strings. If omitted, route processing treats this as true."}))},{$id:"ProcessorParamsCreatorFormatString"}),t.Object({targetAttribute:t.String({description:"Attribute that will receive the computed value"}),formula:t.String({description:"Mathematical formula evaluated to populate the target attribute"}),overrideTarget:t.Optional(t.Boolean({description:"Whether to overwrite the target attribute when it already exists. If omitted, route processing treats this as true."})),subtype:t.Literal("math-formula",{description:"Evaluates a mathematical expression and writes the numeric result."}),replaceMissingBy0:t.Optional(t.Boolean({description:"Whether missing referenced attributes evaluate as zero. If omitted, route processing treats this as true."}))},{$id:"ProcessorParamsCreatorMathFormula"}),t.Object({targetAttribute:t.String({description:"Attribute that will receive the category value"}),clauses:t.Array(t.Object({query:t.String({description:"Query that selects logs for this category clause. Clauses are evaluated in order."}),value:t.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:t.Optional(t.String({description:"String category value used when no clause matches. If omitted and no clause matches, no category value is written."})),subtype:t.Literal("category",{description:"Assigns the first matching category value from ordered query clauses, with an optional default."})},{$id:"ProcessorParamsCreatorCategory"})],{description:"Create processor configuration. The `subtype` discriminator selects how the value written to `targetAttribute` is built and which fields are required."}),cz=I("subtype",[t.Object({targetAttribute:p({allowEmpty:!1,description:"Attribute that will receive the formatted value"}),formatString:p({allowEmpty:!1,type:"long",description:"Template string used to build the target attribute value"}),overrideTarget:t.Optional(t.Boolean({description:"Set to true to overwrite an existing target attribute value (defaults to true)"})),subtype:t.Literal("format-string",{description:"Builds a string from literal text and existing attribute values."}),replaceMissingByEmpty:t.Optional(t.Boolean({description:"Set to true for missing referenced attributes to render as empty strings. Defaults to true."}))},{$id:"InputProcessorParamsCreatorFormatString"}),t.Object({targetAttribute:p({allowEmpty:!1,description:"Attribute that will receive the computed value"}),formula:p({allowEmpty:!1,type:"long",description:"Mathematical formula evaluated to populate the target attribute"}),overrideTarget:t.Optional(t.Boolean({description:"Set to true to overwrite an existing target attribute value (defaults to true)"})),subtype:t.Literal("math-formula",{description:"Evaluates a mathematical expression and writes the numeric result."}),replaceMissingBy0:t.Optional(t.Boolean({description:"Set to true for missing referenced attributes to evaluate as zero. Defaults to true."}))},{$id:"InputProcessorParamsCreatorMathFormula"}),t.Object({targetAttribute:p({allowEmpty:!1,description:"Attribute that will receive the category value"}),clauses:t.Array(t.Object({query:p({allowEmpty:!1,type:"tsuga-query",description:"Query that selects logs for this category clause. Clauses are evaluated in order."}),value:p({allowEmpty:!1,description:"String category value assigned when this clause matches."})}),{minItems:1,maxItems:jP,description:"Conditions evaluated in order to determine the category value. The first matching clause wins."}),defaultValue:t.Optional(p({description:"String category value used when no clause matches. If omitted and no clause matches, no category value is written."})),subtype:t.Literal("category",{description:"Assigns the first matching category value from ordered query clauses, with an optional default."})},{$id:"InputProcessorParamsCreatorCategory"})],{description:"Create processor configuration. The `subtype` discriminator selects how the value written to `targetAttribute` is built and which fields are required."}),pz=t.Object({...qP,params:sz}),uz=t.Object({...BP,params:cz}),FP={...Op,type:t.Literal("mapper",{description:"Map processor. It moves, copies, or normalizes existing log attributes."})},HP={...Ap,type:t.Literal("mapper",{description:"Map processor. It moves, copies, or normalizes existing log attributes."})},mz=I("subtype",[t.Object({attributes:t.Array(t.Object({originAttribute:t.String({description:"Attribute name to map to the target attribute"}),keepOrigin:t.Optional(t.Boolean({description:"Whether the source attribute is preserved after mapping. If omitted, route processing treats this as false."})),overrideTarget:t.Optional(t.Boolean({description:"Whether to overwrite the target attribute when it already exists. If omitted, route processing treats this as true."})),targetAttribute:t.String({description:"Attribute name that will receive the mapped value"})}),{description:"Mappings that map individual attributes to new targets"}),subtype:t.Literal("map-attributes",{description:"Copies or moves one or more source attributes to target attributes."})},{$id:"ProcessorParamsMapperMapAttributes"}),t.Object({attributeName:t.String({description:"Attribute whose value will determine the log level"}),subtype:t.Literal("map-level",{description:"Normalizes a severity or status attribute into Tsuga log levels."})},{$id:"ProcessorParamsMapperMapLevel"}),t.Object({attributeName:t.String({description:"Attribute whose value will determine the log timestamp"}),subtype:t.Literal("map-timestamp",{description:"Uses an event-time attribute as the log timestamp."})},{$id:"ProcessorParamsMapperMapTimestamp"})],{description:"Map processor configuration. The `subtype` discriminator selects whether existing attributes are copied or moved to new names, or used to set the log level or timestamp."}),lz=I("subtype",[t.Object({attributes:t.Array(t.Object({originAttribute:p({allowEmpty:!1,description:"Attribute name to map to the target attribute"}),keepOrigin:t.Optional(t.Boolean({description:"Preserve the source attribute after mapping (defaults to false)"})),overrideTarget:t.Optional(t.Boolean({description:"Overwrite the target attribute when it already exists (defaults to true)"})),targetAttribute:p({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:t.Literal("map-attributes",{description:"Copies or moves one or more source attributes to target attributes."})},{$id:"InputProcessorParamsMapperMapAttributes"}),t.Object({attributeName:p({allowEmpty:!1,description:"Attribute whose value will determine the log level"}),subtype:t.Literal("map-level",{description:"Normalizes a severity or status attribute into Tsuga log levels."})},{$id:"InputProcessorParamsMapperMapLevel"}),t.Object({attributeName:p({allowEmpty:!1,description:"Attribute whose value will determine the log timestamp"}),subtype:t.Literal("map-timestamp",{description:"Uses an event-time attribute as the log timestamp."})},{$id:"InputProcessorParamsMapperMapTimestamp"})],{description:"Map processor configuration. The `subtype` discriminator selects whether existing attributes are copied or moved to new names, or used to set the log level or timestamp."}),dz=t.Object({...HP,params:lz}),fz=t.Object({...FP,params:mz}),KP={...Op,type:t.Literal("parse-attribute",{description:"Parse processor. It extracts structured fields from a text attribute."})},zP={...Ap,type:t.Literal("parse-attribute",{description:"Parse processor. It extracts structured fields from a text attribute."})},YP=5,gz=I("subtype",[t.Object({attributeName:t.String({description:"Attribute whose value will be parsed with Grok rules"}),rules:t.Array(t.String({description:"Grok rule applied to parse text. Route processing sends rules as engine patterns."}),{description:"Ordered Grok rules evaluated until one matches."}),samples:t.Optional(t.Array(t.String(),{description:"Example log lines for validating the Grok rules. Samples are not sent to the ingestion engine."})),subtype:t.Literal("grok",{description:"Extracts fields from unstructured text using ordered Grok rules."})}),t.Object({sourceAttribute:t.String({description:"Attribute containing the URL to parse"}),subtype:t.Literal("url",{description:"Parses a URL attribute and writes URL detail fields."})}),t.Object({sourceAttribute:t.String({description:"Attribute containing the user agent string to parse"}),subtype:t.Literal("user-agent",{description:"Parses a user-agent string and writes browser, operating system, and device details."})}),t.Object({sourceAttribute:t.String({description:"Attribute containing the key/value string segment to parse"}),targetAttribute:t.String({description:"Target map attribute where extracted key/value pairs will be written"}),keyValueSplitter:t.String({description:"Delimiter separating keys from values in the source string"}),pairsSplitter:t.String({description:"Delimiter separating each key/value pair in the source string."}),acceptStandaloneKey:t.Boolean({description:"Whether keys without explicit values are accepted by the parser."}),subtype:t.Literal("key-value",{description:"Parses delimited key/value text into attributes."})})],{description:"Parse processor configuration. The `subtype` discriminator selects which parser reads the source text attribute and which fields it extracts."}),yz=I("subtype",[t.Object({attributeName:p({allowEmpty:!1,description:"Attribute whose value will be parsed with Grok rules"}),rules:t.Array(p({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:t.Optional(t.Array(p({type:"long"}),{maxItems:YP,description:"Example log lines for validating the Grok rules. Samples are not sent to the ingestion engine."})),subtype:t.Literal("grok",{description:"Extracts fields from unstructured text using ordered Grok rules."})}),t.Object({sourceAttribute:p({allowEmpty:!1,description:"Attribute containing the URL to parse"}),subtype:t.Literal("url",{description:"Parses a URL attribute and writes URL detail fields."})}),t.Object({sourceAttribute:p({allowEmpty:!1,description:"Attribute containing the user agent string to parse"}),subtype:t.Literal("user-agent",{description:"Parses a user-agent string and writes browser, operating system, and device details."})}),t.Object({sourceAttribute:p({allowEmpty:!1,description:"Attribute containing the key/value string segment to parse"}),targetAttribute:p({description:"Target map attribute where extracted key/value pairs will be written"}),keyValueSplitter:p({allowEmpty:!1,description:"Delimiter separating keys from values in the source string"}),pairsSplitter:p({allowEmpty:!0,description:"Delimiter separating each key/value pair in the source string."}),acceptStandaloneKey:t.Boolean({description:"Set to true to accept keys without explicit values."}),subtype:t.Literal("key-value",{description:"Parses delimited key/value text into attributes."})})],{description:"Parse processor configuration. The `subtype` discriminator selects which parser reads the source text attribute and which fields it extracts."}),hz=t.Object({...KP,params:gz}),Tz=t.Object({...zP,params:yz}),Ez=t.Object({...BP,params:I("subtype",[t.Object({targetAttribute:p({allowEmpty:!1,description:"Attribute that will receive the formatted value"}),formatString:p({allowEmpty:!1,type:"long",description:"Template string used to build the target attribute value"}),overrideTarget:t.Optional(t.Boolean({description:"Set to true to overwrite an existing target attribute value (defaults to true)"})),subtype:t.Literal("format-string"),replaceMissingByEmpty:t.Optional(t.Boolean({description:"Set to true for missing referenced attributes to render as empty strings. Defaults to true."}))}),t.Object({targetAttribute:p({allowEmpty:!1,description:"Attribute that will receive the category value"}),clauses:t.Array(t.Object({query:p({allowEmpty:!1,type:"tsuga-query",description:"Query that selects logs for this category clause. Clauses are evaluated in order."}),value:p({allowEmpty:!1,description:"String category value assigned when this clause matches."})}),{minItems:1,maxItems:jP,description:"Conditions evaluated in order to determine the category value. The first matching clause wins."}),defaultValue:t.Optional(p({description:"String category value used when no clause matches."})),subtype:t.Literal("category")})])}),_z=t.Object({...HP,params:t.Object({attributes:t.Array(t.Object({originAttribute:p({allowEmpty:!1,description:"Attribute name to map to the target attribute"}),keepOrigin:t.Optional(t.Boolean({description:"Preserve the source attribute after mapping (defaults to false)"})),overrideTarget:t.Optional(t.Boolean({description:"Overwrite the target attribute when it already exists (defaults to true)"})),targetAttribute:p({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:t.Literal("map-attributes")})}),Iz=t.Object({...zP,params:t.Object({attributeName:p({allowEmpty:!1,description:"Attribute whose value will be parsed with Grok rules"}),rules:t.Array(p({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:t.Optional(t.Array(p({type:"long"}),{maxItems:YP,description:"Example log lines for validating the Grok rules."})),subtype:t.Literal("grok")})}),$Ve=I("type",[_z,Iz,Ez]),bz=t.Object({...qP,params:I("subtype",[t.Object({targetAttribute:t.String({description:"Attribute that will receive the formatted value"}),formatString:t.String({description:"Template string used to build the target attribute value"}),overrideTarget:t.Optional(t.Boolean({description:"Whether to overwrite the target attribute when it already exists."})),subtype:t.Literal("format-string"),replaceMissingByEmpty:t.Optional(t.Boolean({description:"Whether missing referenced attributes render as empty strings."}))}),t.Object({targetAttribute:t.String({description:"Attribute that will receive the category value"}),clauses:t.Array(t.Object({query:t.String({description:"Query that selects logs for this category clause."}),value:t.String({description:"String category value assigned when this clause matches."})}),{description:"Conditions evaluated in order to determine the category value."}),defaultValue:t.Optional(t.String({description:"String category value used when no clause matches."})),subtype:t.Literal("category")})])}),Sz=t.Object({...FP,params:t.Object({attributes:t.Array(t.Object({originAttribute:t.String({description:"Attribute name to map to the target attribute"}),keepOrigin:t.Optional(t.Boolean({description:"Whether the source attribute is preserved after mapping."})),overrideTarget:t.Optional(t.Boolean({description:"Whether to overwrite the target attribute when it already exists."})),targetAttribute:t.String({description:"Attribute name that will receive the mapped value"})}),{description:"Mappings that map individual attributes to new targets"}),subtype:t.Literal("map-attributes")})}),Oz=t.Object({...KP,params:t.Object({attributeName:t.String({description:"Attribute whose value will be parsed with Grok rules"}),rules:t.Array(t.String({description:"Grok rule applied to parse text."}),{description:"Ordered Grok rules evaluated until one matches."}),samples:t.Optional(t.Array(t.String(),{description:"Example log lines for validating the Grok rules."})),subtype:t.Literal("grok")})}),jVe=I("type",[Sz,Oz,bz]),Az=11,VP=t.Cyclic({OutputProcessor:t.Union([fz,hz,pz,t.Object({...Op,params:t.Object({items:t.Array(t.Object({query:t.String({description:"Query that determines whether logs enter this branch"}),processors:t.Array(t.Ref("OutputProcessor"),{description:"Processors executed when the branch query matches"})}),{description:"Conditional branches evaluated in order before falling back to the default"})}),type:t.Literal("split",{description:"Split processor. It sends each log through the first matching conditional branch."})})])},"OutputProcessor",{description:"Processing step executed sequentially on route logs"}),QP=t.Cyclic({InputProcessor:t.Union([dz,Tz,uz,t.Object({...Ap,params:t.Object({items:t.Array(t.Object({query:p({type:"tsuga-query",description:"Query that determines whether logs enter this branch"}),processors:t.Array(t.Ref("InputProcessor"),{maxItems:50,description:"Processors executed when the branch query matches"})}),{minItems:2,maxItems:Az,description:"Conditional branches evaluated in order before falling back to the default"})}),type:t.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 xz="/v0/logs",gn=`${xz}/routes`,yn=t.Object({id:t.String({description:"Tsuga-generated log route ID assigned when the route is created."}),name:t.String({description:"Human-readable route name shown in Tsuga."}),description:t.Optional(t.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:t.Boolean({description:"Whether this route is active for newly ingested logs. Disabled routes remain saved but do not process logs."}),query:t.String({description:"Tsuga query that selects which newly ingested logs enter the route processor chain."}),rank:t.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:t.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:t.Array(VP,{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:t.Optional(pe),updater:t.Optional(pe),updatedAt:T({description:"Timestamp when Tsuga last updated the route."}),createdAt:T({description:"Timestamp when Tsuga created the route."}),assetUpdatedAt:T({description:"Timestamp when Tsuga last changed route behavior. This can differ from `updatedAt` when only metadata such as `description` or `tags` changed."})},{title:"LogRoute"}),as=t.Object({name:p({allowEmpty:!1,description:"Human-readable log route name shown in Tsuga."}),description:t.Optional(p({type:"long",description:"Optional free-text note about the log route's purpose. This metadata is not evaluated when matching or processing logs."})),isEnabled:t.Boolean({description:"Set to true for the log route to process newly ingested matching logs. Set to false to save it without running it."}),query:p({type:"tsuga-query",description:"Tsuga query that selects which newly ingested logs enter the log route processor chain."}),tags:Qe,owner:p({allowEmpty:!1,description:"ID of the team that will own the log route, determining which team members can view and manage it and which tag policies apply. Only an org admin or an admin of this team may change the `query` field or delete the log route."}),processors:t.Array(QP,{maxItems:50,description:"Processors applied in array order to logs that match the log route, each transforming the output of the previous one. Up to 50 are accepted. A `split` processor forks the chain into branches and cannot be followed by another processor at the same level."})});var QVe=l({tags:["routes"],url:gn,method:"GET",paginated:!0,query:t.Object(fe),response:t.Array(yn)}),WVe=l({tags:["routes"],url:`${gn}/:id`,params:t.Object({id:p()}),method:"GET",response:yn}),ZVe=l({tags:["routes"],url:gn,method:"POST",body:as,response:yn}),XVe=l({tags:["routes"],url:`${gn}/:id`,method:"PUT",body:as,params:t.Object({id:p()}),response:yn}),JVe=l({tags:["routes"],url:`${gn}/:id/clone`,method:"POST",params:t.Object({id:p()}),body:as,response:yn}),e5e=l({tags:["routes"],url:`${gn}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),t5e=l({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:`${gn}/:id/modify-ranking`,method:"PUT",params:t.Object({id:p()}),body:t.Object({rank:t.Integer({minimum:1,description:"Target rank for the route, from 1 to the total number of routes. Requests outside that range are rejected."})}),response:t.Object({})}),r5e=l({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:`${gn}/:id/enable`,method:"PUT",params:t.Object({id:p()}),body:t.Object({enable:t.Boolean({description:"Set to true to enable the route, or false to disable it."})}),response:yn});var ss=`/${"v1"}/routes`,WP={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}"]}}]},ZP={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}}]},cs=t.Pick(yn,["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)."}),Rz={id:"123-456-abc",...WP},Cz={id:"456-789-def",...ZP};Object.assign(cs,{examples:[Rz,Cz]});var XP=l({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:ss,method:"GET",paginated:!0,query:t.Object(He),response:t.Array(cs)}),JP=l({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:`${ss}/:id`,method:"GET",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the log route to retrieve. Use the `id` returned by route list or create responses."})}),response:cs}),rf=t.Pick(as,["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."}),Pz=WP,Uz=ZP;Object.assign(rf,{examples:[Pz,Uz]});var eU=l({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:ss,method:"POST",body:rf,response:cs}),tU=l({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:`${ss}/:id`,method:"PUT",body:rf,params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the log route to update. Use the `id` returned by route list, get, or create responses."})}),response:cs}),rU=l({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:`${ss}/:id`,method:"DELETE",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the log route to delete. Use the `id` returned by route list, create, or update responses."})}),response:R});var ps=`/${"v1"}/monitors`,us=t.Pick(Pr,["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)."}),oU={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:[]},iU={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:[]},aU={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:[]},sU={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:[]},wz={id:"123-456-abc",...oU},Nz={id:"234-567-bcd",...iU},Lz={id:"345-678-cde",...aU},vz={id:"456-789-def",...sU};Object.assign(us,{examples:[wz,Nz,Lz,vz]});var nU=t.Pick(ud,["filters","sort","limit","offset"]),cU=t.Object({...nU.properties,...He,filters:nU.properties.filters},{description:"Monitor query request. Use filters, sorting, limit, and offset to page through visible monitors."}),kz={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(cU,{examples:[kz]});var pU=l({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:`${ps}/query`,method:"POST",paginated:!0,body:cU,response:t.Array(us)}),uU=l({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:`${ps}/:id`,method:"GET",params:t.Object({id:p({allowEmpty:!1,description:"Monitor ID returned by monitor query, create, or update operations."})}),response:us}),mU=["name","message","tags","configuration","priority","owner","dashboardId","permissions","clusterIds"],lU=t.Pick(Ma,mU,{$id:"CreateMonitorRequest",description:"Monitor creation request. Provide ownership, data access, alert configuration, priority, tags, and optional dashboard or cluster scope."}),dU=t.Pick(Ma,mU,{$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."}),fU=oU,gU=iU,yU=aU,hU=sU;Object.assign(lU,{examples:[fU,gU,yU,hU]});Object.assign(dU,{examples:[fU,gU,yU,hU]});var TU=l({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:ps,method:"POST",body:lU,response:us}),EU=l({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:`${ps}/:id`,method:"PUT",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the saved monitor to update. Use the `id` returned by monitor query or create responses."})}),body:dU,response:us}),Mz=t.Object({id:p({allowEmpty:!1,description:"Identifier of the saved monitor to delete. Use the `id` returned by monitor query, create, or update responses."})}),_U=l({description:"Deletes a monitor by ID. Deleting a monitor stops future evaluations and alert transitions for that monitor.",operationId:"deleteMonitor",tags:["monitors"],url:`${ps}/:id`,method:"DELETE",params:Mz,response:R});var ms=`/${"v1"}/notification-rules`,ls=t.Pick(oi,["id","name","queryString","teamsFilter","prioritiesFilter","transitionTypesFilter","clusterIdsFilter","owner","isActive","tags","targets"],{$id:"Rule",description:"Notification rule that matches alert transitions and routes notifications to one or more targets. See [Rules](/documentation/alert/notifications/rules)."}),IU={name:"Critical Alerts",queryString:"env:prod service:api",teamsFilter:{type:"all-public-teams"},prioritiesFilter:[1,2],transitionTypesFilter:["triggered","resolved"],clusterIdsFilter:[],owner:"team-123-abc",isActive:!0,tags:[{key:"channel",value:"alerts"}],targets:[{id:"789-abc-def",rateLimit:{maxMessages:10,minutes:5},renotifyConfig:{mode:"each",renotificationStates:["alert"],renotifyIntervalMinutes:30},config:{type:"email",addresses:["oncall@example.com"]}}]},Dz={id:"123-456-abc",...IU};Object.assign(ls,{examples:[Dz]});var bU=l({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:ms,method:"GET",paginated:!0,query:t.Object(He),response:t.Array(ls)}),SU=l({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:`${ms}/:id`,method:"GET",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the notification rule to retrieve. Use the `id` returned by notification rule list or create responses."})}),response:ls}),nf=t.Pick($a,["name","queryString","teamsFilter","prioritiesFilter","transitionTypesFilter","clusterIdsFilter","owner","tags","isActive","targets"],{description:"Notification rule create or update request. Provide matching filters, owner, tags, active state, and delivery targets."}),Gz=IU;Object.assign(nf,{examples:[Gz]});var OU=l({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:ms,method:"POST",body:nf,response:ls}),AU=l({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:`${ms}/:id`,method:"PUT",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the notification rule to update. Use the `id` returned by notification rule list, get, or create responses."})}),body:nf,response:ls}),$z=t.Object({id:p({allowEmpty:!1,description:"Identifier of the notification rule to delete. Use the `id` returned by notification rule list, get, create, or update responses."})}),xU=l({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:`${ms}/:id`,method:"DELETE",params:$z,response:R});var Ei=`${ri}/silences`,RU=t.Union([t.Literal("monday"),t.Literal("tuesday"),t.Literal("wednesday"),t.Literal("thursday"),t.Literal("friday"),t.Literal("saturday"),t.Literal("sunday")]),jz=t.Partial(t.Record(RU,t.Array(t.Object({startTime:t.String({format:Xu,description:"Local start time for this recurring silence window on this day, using the schedule time zone."}),endTime:t.String({format:Xu,description:"Local end time for this recurring silence window on this day. It must be after `startTime`, and ranges on the same day cannot overlap."})},{title:"SilenceTimeRange"}),{minItems:1,description:"Silence windows for this day. Each window uses the schedule time zone, and windows on the same day cannot overlap."})),{description:"Recurring silence windows keyed by day of week, evaluated in the schedule `timeZone` or in UTC when it is omitted. At least one day must be listed, and a day with no entry is never silenced. Each window covers `startTime` up to but not including `endTime`."}),qz=t.Partial(t.Record(RU,t.Array(t.Object({startTime:t.String({description:"Local start time for this recurring silence window on this day, using the schedule time zone."}),endTime:t.String({description:"Local end time for this recurring silence window on this day. It must be after `startTime`, and ranges on the same day cannot overlap."})},{title:"SilenceTimeRange"}),{description:"Silence windows for this day. Each window uses the schedule time zone, and windows on the same day cannot overlap."})),{description:"Recurring silence windows keyed by day of week, evaluated in the schedule `timeZone` or in UTC when it is omitted. A day with no entry is never silenced. Each window covers `startTime` up to but not including `endTime`."}),xp='IANA timezone identifier (e.g. "America/New_York"). Defaults to UTC if omitted.',CU="One-time silence schedule with specific start and end times",PU="Recurring weekly silence schedule",Bz=I("type",[t.Object({type:t.Literal("one-time",{description:"Silence active once between the configured start and end times."}),startTime:t.String({format:Ju,description:"Local start date and time for the one-time silence, interpreted in `timeZone` when provided."}),endTime:t.String({format:Ju,description:"Local end date and time for the one-time silence. It must be after `startTime` and in the future."}),timeZone:t.Optional(t.String({format:Zu,description:xp}))},{$id:"InputSilenceScheduleOneTime",description:CU}),t.Object({type:t.Literal("recurring",{description:"Silence active on a recurring weekly schedule."}),weeklySchedule:jz,timeZone:t.Optional(t.String({format:Zu,description:xp}))},{$id:"InputSilenceScheduleRecurring",description:PU})],{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."}),Fz=I("type",[t.Object({type:t.Literal("one-time",{description:"Silence active once between the configured start and end times."}),startTime:t.String({description:"Local start date and time for the one-time silence, interpreted in `timeZone` when provided."}),endTime:t.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:t.Optional(t.String({description:xp}))},{$id:"OutputSilenceScheduleOneTime",description:CU}),t.Object({type:t.Literal("recurring",{description:"Silence active on a recurring weekly schedule."}),weeklySchedule:qz,timeZone:t.Optional(t.String({description:xp}))},{$id:"OutputSilenceScheduleRecurring",description:PU})],{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."}),Rp=t.Object({name:p({description:"Display name of the silence"}),reason:p({allowEmpty:!1,type:"long",description:"Free-text explanation of why notifications are being silenced, shown to other operators reviewing active silences."}),owner:p({allowEmpty:!1,description:"Team ID that owns and manages the silence"}),tags:Qe,isActive:t.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:Bz,notificationRuleIds:t.Optional(t.Array(p(),{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:t.Optional(p({type:"tags-query",description:"Query string to filter which alerts this silence applies to"})),teamsFilter:Ed,prioritiesFilter:t.Array(t.Enum(ft),{maxItems:ft.length,description:"Monitor priorities that must match for this silence to apply. An empty array matches every priority."}),transitionTypesFilter:t.Array(t.Enum(Jn),{maxItems:Jn.length,description:"Alert state transitions that must match for this silence to apply. An empty array matches every transition type."})}),_i=t.Object({id:t.String({description:"Tsuga-generated notification silence ID assigned when the silence is created."}),name:t.String({description:"Display name of the silence"}),reason:t.String({description:"Free-text explanation of why notifications are being silenced, shown to other operators reviewing active silences."}),owner:t.String({description:"Team ID that owns and manages the silence"}),tags:ke,isActive:t.Boolean({description:"Whether the silence suppresses matching notifications while its schedule is active. When false, the silence is kept but never suppresses anything."}),schedule:Fz,notificationRuleIds:t.Optional(t.Array(t.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:t.Optional(t.String({description:"Query string filtering which alerts this silence applies to"})),teamsFilter:Td,prioritiesFilter:t.Array(t.Enum(ft),{description:"Monitor priorities that must match for this silence to apply. An empty array matches every priority."}),transitionTypesFilter:t.Array(t.Enum(Jn),{description:"Alert state transitions that must match for this silence to apply. An empty array matches every transition type."}),createdAt:T(),updatedAt:T(),creator:t.Optional(pe),updater:t.Optional(pe)}),v5e=l({tags:["notification-silences"],url:Ei,method:"GET",response:t.Array(_i)}),k5e=l({tags:["notification-silences"],url:`${Ei}/:id`,params:t.Object({id:p()}),method:"GET",response:_i}),M5e=l({tags:["notification-silences"],url:Ei,method:"POST",body:Rp,response:_i}),D5e=l({tags:["notification-silences"],url:`${Ei}/:id`,method:"PUT",params:t.Object({id:p()}),body:Rp,response:_i}),G5e=l({tags:["notification-silences"],url:`${Ei}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),$5e=l({tags:["notification-silences"],url:`${Ei}/bulk-delete`,method:"DELETE",body:t.Object({ids:t.Array(p())}),response:t.Object({})});var ds=`/${"v1"}/notification-silences`,fs=t.Pick(_i,["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)."}),Hz={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"]},Kz={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(fs,{examples:[Hz,Kz]});var UU=l({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:ds,method:"GET",response:t.Array(fs)}),wU=l({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:`${ds}/:id`,method:"GET",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the notification silence to retrieve. Use the `id` returned by notification silence list or create responses."})}),response:fs}),of=t.Pick(Rp,["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."}),zz={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"]},Yz={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(of,{examples:[zz,Yz]});var NU=l({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:ds,method:"POST",body:of,response:fs}),LU=l({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:`${ds}/:id`,method:"PUT",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the notification silence to update. Use the `id` returned by notification silence list, get, or create responses."})}),body:of,response:fs}),Vz=t.Object({id:p({allowEmpty:!1,description:"Identifier of the notification silence to delete. Use the `id` returned by notification silence list, get, create, or update responses."})}),vU=l({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:`${ds}/:id`,method:"DELETE",params:Vz,response:R});var Qz={critical:3,important:2,normal:1},oe=e=>({label:e,weight:Qz[e]}),Wz={"unrouted-logs":{key:"unrouted-logs",title:"Logs with no matching route",summary:"Any log that reaches processing without a matched route is flagged.",rationale:"Close gaps by ensuring each event flows through a governed route.",objectType:"route",category:"observability-assets",impact:oe("important"),recommendation:"Ensure each team maintains a route that captures all of its logs exactly once."},"no-over-routed-logs":{key:"no-over-routed-logs",title:"No logs matching 3+ routes",summary:"Detects logs that match 3 or more processing routes during the lookback window.",rationale:"A log usually only needs one or two routes. Matching many routes typically means the route queries overlap unintentionally, multiplying the processing and storage cost without adding observability value.",objectType:"route",category:"observability-assets",impact:oe("important"),recommendation:"Review the route queries owned by this team for overlap. Tighten the filter on each route so a given log matches the minimum number of routes needed (usually one)."},"team-has-route":{key:"team-has-route",title:"\u22651 route per team",summary:"Each team owns at least one active route that filters on its team name.",rationale:"Provides clear governance boundaries for routing and enrichment.",objectType:"route",category:"observability-assets",impact:oe("important"),recommendation:"Ensure every team manages a dedicated route scoped to its context.team value."},"service-name-present":{key:"service-name-present",title:`${np} present`,summary:`Logs and spans must populate ${np} with a non-empty value.`,rationale:"Core identifier used to correlate telemetry across services.",objectType:"resource",category:"telemetry-hygiene",impact:oe("critical"),recommendation:`Populate ${np} 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:oe("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:oe("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:`${ka} presence`,summary:`Logs and spans must populate ${ka} with a non-empty value.`,rationale:"Core identifier used to correlate telemetry across services.",objectType:"resource",category:"telemetry-hygiene",impact:oe("important"),recommendation:`Populate ${ka} 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:oe("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:oe("normal"),recommendation:"Consolidate duplicate attributes at the source to reduce storage costs."},"no-debug-logs-in-prod":{key:"no-debug-logs-in-prod",title:"No DEBUG logs in production",summary:"Detects DEBUG-level logs emitted in production environments.",rationale:"DEBUG logs in production increase costs and risk exposing sensitive data.",objectType:"log",category:"telemetry-hygiene",impact:oe("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:oe("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:oe("important"),recommendation:"Map these logs to ERROR in the level mapper, or fix the source logging so errors and exceptions are emitted at the right severity."},"no-empty-dashboards":{key:"no-empty-dashboards",title:"No empty dashboards",summary:"Flags dashboards with 1 or fewer widgets.",rationale:"Empty or near-empty dashboards add clutter and make it harder to find useful dashboards.",objectType:"dashboard",category:"observability-assets",impact:oe("normal"),recommendation:"Add meaningful widgets to dashboards or remove empty ones to reduce clutter."},"monitor-has-notification":{key:"monitor-has-notification",title:"No monitors without notification",summary:"Every monitor has at least one active notification destination configured.",rationale:"A monitor without notifications is effectively silent - it detects issues but nobody is alerted.",objectType:"monitor",category:"observability-assets",impact:oe("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:oe("important"),recommendation:"Fix clock synchronization or timestamp generation for services emitting future-dated logs - they break dashboards and alerting."},"metric-usage":{key:"metric-usage",title:"Metric usage",summary:"Percentage of ingested metrics that are referenced by a dashboard or monitor, or were queried in the last 30 days.",rationale:"Metrics that are never visualized, alerted on, or queried add ingestion cost and cardinality without providing value.",objectType:"metric",category:"telemetry-adoption",impact:oe("important"),recommendation:"Stop emitting metrics that are never referenced or queried to reduce ingestion cost and cardinality.",scope:"global"},"no-stale-dashboards":{key:"no-stale-dashboards",title:"No stale dashboards",summary:"Flags dashboards that have not been edited in over 180 days.",rationale:"Stale dashboards may contain outdated queries or irrelevant data, making it harder for teams to find useful, up-to-date information.",objectType:"dashboard",category:"observability-assets",impact:oe("normal"),recommendation:"Review and update dashboards that haven't been edited in 180+ days, or archive them if no longer relevant."},"no-unused-dashboards":{key:"no-unused-dashboards",title:"No unused dashboards",summary:"Flags dashboards with zero views in the last 60 days.",rationale:"Dashboards that nobody views add clutter and may confuse team members looking for relevant information.",objectType:"dashboard",category:"telemetry-adoption",impact:oe("important"),recommendation:"Archive or delete dashboards that nobody has viewed in the last 60 days to reduce noise."},"no-orphan-monitors":{key:"no-orphan-monitors",title:"No monitors without dashboards",summary:"Every monitor should be linked to at least one dashboard.",rationale:"Monitors without a linked dashboard make it harder for teams to investigate alerts \u2014 responders need a dashboard to quickly understand the context and scope of an issue.",objectType:"monitor",category:"observability-assets",impact:oe("important"),recommendation:"Link monitors to relevant dashboards so teams can quickly investigate when alerts fire."},"no-flapping-monitors":{key:"no-flapping-monitors",title:"No flappy monitors",summary:"P1/P2 monitors should not have any group (or the monitor itself) trigger 7+ alerts within 7 days.",rationale:"Monitors that constantly flip between alert and OK cause alert fatigue. Teams start ignoring notifications, increasing the risk of missing real incidents.",objectType:"monitor",category:"observability-assets",impact:oe("important"),recommendation:"Tune thresholds, add hysteresis, or adjust evaluation windows to reduce flapping."},"no-noisy-group-monitors":{key:"no-noisy-group-monitors",title:"No noisy group-by monitors",summary:"P1/P2 group-by monitors should not have 5+ groups triggering alerts simultaneously on 2+ occasions within 7 days.",rationale:"When a group-by monitor triggers alerts for many groups at once repeatedly, the signal gets lost in noise. Responders cannot prioritize and the monitor effectively becomes useless.",objectType:"monitor",category:"observability-assets",impact:oe("important"),recommendation:"Narrow the group-by scope, raise thresholds, or split into more targeted monitors."},"no-long-alert-monitors":{key:"no-long-alert-monitors",title:"No monitors stuck in alert",summary:"P1/P2 monitors should not remain in alert state for more than 15 days.",rationale:"A high-priority monitor stuck in alert for weeks signals an unresolved issue or a misconfigured threshold. Either way, the alert loses meaning and contributes to alert fatigue.",objectType:"monitor",category:"observability-assets",impact:oe("important"),recommendation:"Investigate and resolve the underlying issue, adjust the threshold, or acknowledge and close the alert."},"no-redundant-monitors":{key:"no-redundant-monitors",title:"No redundant monitors",summary:"P1/P2 monitors should not always trigger at the same time as another monitor (3+ co-triggers within 7 days).",rationale:"A monitor that always fires alongside another monitor is redundant. It adds noise without providing additional signal, making it harder for responders to identify the root cause.",objectType:"monitor",category:"observability-assets",impact:oe("important"),recommendation:"Investigate whether the redundant monitor can be removed or consolidated with the one it always co-triggers with."},"no-absent-log-fields":{key:"no-absent-log-fields",title:"No absent log fields",summary:"Dashboards and monitors should reference log fields that still appear in recent logs (last 24 hours).",rationale:"References to log fields that no longer exist silently break dashboards and monitors, eroding trust in observability.",objectType:"dashboard",category:"observability-assets",impact:oe("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:oe("important"),recommendation:"Make sure every Kubernetes workload emits k8s.cluster.name, k8s.namespace.name, k8s.pod.name, k8s.pod.uid, k8s.container.name, k8s.node.name and one workload-ownership attribute (for example via the OpenTelemetry Collector k8s_attributes processor)."},"k8s-recommended-metrics":{key:"k8s-recommended-metrics",title:"Kubernetes recommended cluster metrics",summary:"All recommended Kubernetes cluster metrics are collected.",rationale:"These metrics are the primary signals for faulty-deployment detection; without k8s.container.status.reason and the usage/limit pairs, container crash loops and resource starvation cannot be diagnosed.",objectType:"metric",category:"collection-coverage",impact:oe("important"),recommendation:"Enable the OpenTelemetry Collector k8s_cluster receiver (for example via the Tsuga Helm chart) so the required Kubernetes metrics are emitted.",scope:"global"},"k8s-recommended-change-events":{key:"k8s-recommended-change-events",title:"Kubernetes recommended change events",summary:"Change events are collected for the Kubernetes object kinds recommended for rollback suggestions.",rationale:"Faulty-deployment detection needs the history of ReplicaSet, Deployment, Pod and Node changes to identify failing revisions and propose rollbacks.",objectType:"log",category:"collection-coverage",impact:oe("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:oe("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:oe("important"),recommendation:"Use the attribute remapper in your routes to rename attributes to their standard equivalents."},"no-unused-operation-api-keys":{key:"no-unused-operation-api-keys",title:"No unused operation API keys",summary:"Flags operation API keys with no activity in the last 180 days.",rationale:"Long-idle operation credentials add risk if leaked and clutter the inventory. Tracking last-used activity makes it easy to rotate or delete the unused ones.",objectType:"api-key",category:"observability-assets",impact:oe("important"),recommendation:"Rotate or delete operation API keys that have not been used in the last 180 days."},"no-unused-ingestion-api-keys":{key:"no-unused-ingestion-api-keys",title:"No unused ingestion API keys",summary:"Flags ingestion API keys with no telemetry in the last 30 days across any cluster.",rationale:"Dormant ingestion credentials add risk if leaked and clutter the inventory. Tracking key activity makes it easy to rotate or delete the unused ones.",objectType:"api-key",category:"observability-assets",impact:oe("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 ${fR} 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:oe("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:oe("important"),recommendation:"Configure the matching OpenTelemetry server-metrics receiver for each detected database technology (for example postgresqlreceiver, mysqlreceiver, mongodbreceiver, redisreceiver).",scope:"global"}},Zz=new Set(["azure_container_registry","azure_container_registry_image","azure_app_service_certificate","azure_virtual_network"]),Xz=es.filter(e=>e.startsWith("azure_")&&!Zz.has(e)),kU={"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:Xz,metricPrefixes:["azure_"]}},Jz=Object.fromEntries(Object.keys(kU).map(e=>{let{label:r,source:n}=kU[e];return[e,{key:e,title:`${r} metrics collected`,summary:`${r} 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:oe("important"),recommendation:`Enable the ${n} metrics integration so ${r} metrics are ingested.`,scope:"global"}]})),e9={...Wz,...Jz},MU=Object.values(e9);var DU=["passed","failed","ignored"],t9=t.Enum(DU,{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."}),r9=["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"],sf=["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",...r9],n9=t.Enum(sf),o9=["log","metric","resource","span","api-key","dashboard","monitor","route"],i9=["collection-coverage","telemetry-hygiene","observability-assets","telemetry-adoption"],a9=["critical","important","normal"],s9=["team","global"],cf=t.Object({key:t.Enum(sf),title:t.String(),summary:t.String(),rationale:t.String(),objectType:t.Enum(o9),category:t.Enum(i9),impact:t.Object({label:t.Enum(a9),weight:t.Number()}),recommendation:t.String(),scope:t.Optional(t.Enum(s9))}),GU=t.Object({type:t.String({description:"Tsuga asset kind referenced by this example (e.g. `monitor`)"}),label:t.String({description:"Human-readable summary of the example"}),link:t.Object({to:t.String({description:"In-app route the example deep-links to"}),search:t.Optional(t.Unknown({description:"Search-query payload for the deep link"})),params:t.Optional(t.Unknown({description:"Route params for the deep link"}))},{description:"In-app deep link to inspect the example"})}),af=t.Intersect([cf,t.Object({status:t9,normalizedScore:t.Number(),details:t.Optional(t.Record(t.String(),t.Unknown())),recommendation:t.Optional(t.String()),examples:t.Optional(t.Array(GU))})]),c9=t.Object({generatedAt:t.String(),overallScore:t.Optional(t.Number()),rules:t.Array(cf),teamResults:t.Array(t.Object({teamId:t.String(),teamName:t.String(),teamWeight:t.Number(),score:t.Number(),weightedScore:t.Number(),totalWeight:t.Number(),ruleResults:t.Array(af)})),globalResults:t.Optional(t.Object({score:t.Optional(t.Number()),ruleResults:t.Array(af)}))}),pf=t.Object({id:t.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:t.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:t.Enum(sf,{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:t.Optional(t.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:t.Enum(DU,{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:t.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:t.Number({description:"Impact weight of this rule, captured at report-generation time. Set by Tsuga from the rule's impact label: 1 for normal, 2 for important, 3 for critical. Used with score to compute reportOverallScore."}),reportOverallScore:t.Number({description:"Aggregate score for this row's report group. Calculated by Tsuga from non-ignored rows in the same team or global cluster-wide report. Returned on every row in that group with the same value."}),reportTotalWeight:t.Number({description:"Sum of non-ignored rule weights for this row's report group. Calculated by Tsuga when the report is generated. Returned on every row in that group with the same value."}),recommendation:t.Optional(t.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:t.Optional(t.Array(GU,{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:t.String({description:"ISO timestamp the row was generated at"})}),t6e=l({tags:["quality-reports"],url:"/v0/quality-reports",method:"POST",response:c9}),uf=t.Optional(p({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."})),r6e=l({tags:["quality-reports"],url:"/v0/quality-reports/latest",method:"GET",query:t.Object({clusterId:uf,team:t.Optional(p({allowEmpty:!1}))}),response:t.Array(pf,{description:"Latest persisted rule evaluation rows for the cluster"})}),n6e=l({tags:["quality-reports"],url:"/v0/quality-reports/preview",method:"POST",body:t.Object({ruleKey:n9,teamId:t.Optional(p({allowEmpty:!1})),lookbackMinutes:t.Optional(t.Integer({minimum:1,maximum:60})),clusterId:t.Optional(p({allowEmpty:!1}))}),response:t.Object({rule:cf,result:af,teamId:t.Optional(t.String()),teamName:t.Optional(t.String())})}),o6e=new Map(MU.map(e=>[e.key,e]));var p9=`/${"v1"}/quality-reports`,$U=t.Pick(pf,["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)."}),u9={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($U,{examples:[u9]});var m9=t.Object({clusterId:uf,team:t.Optional(p({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."}),jU=l({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:`${p9}/latest`,method:"GET",query:m9,response:t.Array($U)});var gs="/v0/admin-center";var lr=`${gs}/retention-policies`,qU=3650,l9=t.Integer({description:"Number of days Tsuga retains matching telemetry."}),BU=t.Integer({minimum:1,maximum:qU,description:`Number of days Tsuga should retain matching telemetry. Valid values are 1 through ${qU}.`}),vr=t.Object({id:t.String({description:"Unique identifier of the retention policy. Generated by Tsuga."}),env:t.Optional(t.String({description:"Environment tag value this policy applies to. Omitted policies apply across environments unless a more specific policy exists."})),teamId:t.Optional(t.String({description:"Team ID this policy applies to. Omitted policies apply globally unless a team-specific policy exists."})),dataSource:t.Enum(cr,{description:"Telemetry signal retained by this policy: logs, metrics, traces or rum."}),durationDays:l9,isEnabled:t.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."})}),Cp=t.Object({env:t.Optional(p({description:"Environment tag value this policy applies to. Omit for a policy that is not environment-specific."})),teamId:t.Optional(p({description:"Team ID this policy applies to. Omit for a policy that is not team-specific."})),dataSource:t.Enum(cr,{description:"Telemetry signal retained by this policy: logs, metrics, traces or rum."}),durationDays:BU,isEnabled:t.Boolean({description:"Set to true for the policy to participate in retention resolution."})}),FU=t.Array(t.Object({env:p(),dataSource:t.Enum(cr),durationDays:t.Union([BU,t.Null()]),isEnabled:t.Boolean()})),HU=t.Object({inserted:t.Array(vr),updated:t.Array(vr),deleted:t.Array(vr)}),E6e=l({tags:["retention-policies"],url:lr,method:"POST",body:Cp,response:vr}),_6e=l({tags:["retention-policies"],url:lr,method:"GET",response:t.Array(vr)}),I6e=l({tags:["retention-policies"],url:`${lr}/:id`,method:"GET",params:t.Object({id:p()}),response:vr}),b6e=l({tags:["retention-policies"],url:`${lr}/:id`,method:"PUT",params:t.Object({id:p()}),body:Cp,response:vr}),S6e=l({tags:["retention-policies"],url:`${lr}/bulk-update`,method:"POST",body:FU,response:HU}),O6e=l({tags:["retention-policies"],url:`${lr}/bulk-update-for-team`,method:"POST",body:t.Object({teamId:p(),policies:FU}),response:HU}),A6e=l({tags:["retention-policies"],url:`${lr}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),ys=["past-24-hours","past-7-days","past-30-days"],x6e=l({tags:["retention-policies"],url:`${lr}/requested-history-percentile/:teamId`,method:"POST",params:t.Object({teamId:p()}),body:t.Object({percentile:t.Number({minimum:0,maximum:1}),observationWindow:t.Enum(ys),dataSource:t.Enum(cr)}),response:t.Object({percentile:t.Number(),observationWindow:t.Enum(ys),dataSource:t.Enum(cr),teamId:t.String(),requestedHistoryDays:t.Number()})}),d9=["1-day","3-days","7-days","1-month","6-months","more-than-6-months"];var f9=t.Array(t.Object({bucket:t.Enum(d9),count:t.Number()})),R6e=l({tags:["retention-policies"],url:`${lr}/requested-history-histogram/:teamId`,method:"POST",params:t.Object({teamId:p()}),body:t.Object({observationWindow:t.Enum(ys),dataSource:t.Enum(cr)}),response:t.Object({observationWindow:t.Enum(ys),dataSource:t.Enum(cr),teamId:t.String(),histogram:f9})}),C6e=l({tags:["retention-policies"],url:`${lr}/top-teams-with-retention-surplus`,method:"POST",body:t.Object({dataSource:t.Enum(cr),observationWindow:t.Enum(ys),percentile:t.Number({minimum:0,maximum:1}),topN:t.Optional(t.Number({minimum:1,maximum:20}))}),response:t.Array(t.Object({teamId:t.String(),retentionSurplusDays:t.Number()}))});var hs=`/${"v1"}/retention-policies`,Ts=t.Pick(vr,["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)."}),g9={id:"123-456-abc",env:"production",teamId:"team-123-abc",dataSource:"logs",durationDays:30,isEnabled:!0};Object.assign(Ts,{examples:[g9]});var KU=l({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:hs,method:"GET",response:t.Array(Ts)}),zU=l({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:`${hs}/:id`,method:"GET",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the retention policy to retrieve. Use the `id` returned by retention policy list or create responses."})}),response:Ts}),mf=t.Pick(Cp,["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."}),y9={env:"production",teamId:"team-123-abc",dataSource:"logs",durationDays:30,isEnabled:!0};Object.assign(mf,{examples:[y9]});var YU=l({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:hs,method:"POST",body:mf,response:Ts}),VU=l({description:"Replaces an existing retention policy by ID, including signal, scope fields, duration, and enabled state.",operationId:"updateRetentionPolicy",tags:["retention-policies"],url:`${hs}/:id`,method:"PUT",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the retention policy to update. Use the `id` returned by retention policy list, get, or create responses."})}),body:mf,response:Ts}),QU=l({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:`${hs}/:id`,method:"DELETE",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the retention policy to delete. Use the `id` returned by retention policy list, create, or update responses."})}),response:R});var Es=`/${"v1"}/slos`,h9=t.Pick(fd,["id","sloId","priority","configuration"],{$id:"SloAlert",description:"Alert attached to an SLO, triggered on a burn-rate multiplier or an SLO target threshold"}),_s=t.Object({...t.Pick(ti,["id","name","description","tags","configuration","target","timeframeDays","owner","permissions","clusterIds"]).properties,alerts:t.Array(h9,{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"}),T9={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(_s,{examples:[T9]});var WU=t.Pick(yd,["filters","sort","limit","offset"]),ZU=t.Object({...WU.properties,...He,filters:WU.properties.filters},{description:"SLO query request. Use filters, sorting, limit, and offset to page through visible SLOs."}),E9={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(ZU,{examples:[E9]});var XU=l({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:`${Es}/query`,method:"POST",paginated:!0,body:ZU,response:t.Array(_s)}),JU=l({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:`${Es}/:id`,method:"GET",params:t.Object({id:p({allowEmpty:!1,description:"SLO ID returned by SLO query, create, or update operations."})}),response:_s}),ew=["name","description","tags","configuration","target","timeframeDays","owner","permissions","clusterIds","alerts"],tw=t.Pick(up,ew,{$id:"CreateSloRequest",description:"SLO creation request. Provide ownership, data access, SLI configuration, target, timeframe, optional cluster scope, and the alerts to create."}),rw=t.Pick(gd,ew,{$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."}),nw={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(tw,{examples:[nw]});Object.assign(rw,{examples:[nw]});var ow=l({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:Es,method:"POST",body:tw,response:_s}),iw=l({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:`${Es}/:id`,method:"PUT",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the SLO to update. Use the `id` returned by SLO query or create."})}),body:rw,response:_s}),aw=l({description:"Deletes an SLO by ID. Deleting an SLO stops future evaluations and removes its attached alerts.",operationId:"deleteSlo",tags:["slos"],url:`${Es}/:id`,method:"DELETE",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the SLO to delete. Use the `id` returned by SLO query or create."})}),response:R});var io=`${gs}/tag-policies`;var _9=["logs","metrics","traces"],lf=t.Array(t.Enum(_9,{description:"Telemetry signal covered by a data tag policy."}),{description:"Telemetry signals covered by the policy. An empty array means logs, metrics, and traces."}),I9=t.Union([Nc,lf]),b9=t.Object({teamIds:t.Array(t.String(),{description:"Team IDs used by this policy scope."}),mode:t.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."}),S9=I("type",[t.Object({type:t.Literal("telemetry",{description:"Policy applies to telemetry data points during ingestion or evaluation."}),assetTypes:lf,shouldInsertWarning:t.Boolean({description:"When true, Tsuga annotates non-compliant telemetry with tag policy warnings instead of only measuring violations."}),dropSample:t.Optional(t.Number({description:"Percentage of non-compliant telemetry datapoints to drop. Omitted means no sampling drop is configured."}))},{title:"TelemetryTagPolicy"}),t.Object({type:t.Literal("tsuga_asset",{description:"Policy applies to Tsuga-managed resources such as dashboards, routes, and keys."}),assetTypes:Nc},{title:"TsugaAssetTagPolicy"})]),O9=I("type",[t.Object({type:t.Literal("telemetry",{description:"Policy applies to telemetry data points during ingestion or evaluation."}),assetTypes:lf,shouldInsertWarning:t.Boolean({description:"When true, Tsuga annotates non-compliant telemetry with tag policy warnings instead of only measuring violations."}),dropSample:t.Optional(t.Number({minimum:0,maximum:100,description:"Percentage of non-compliant telemetry datapoints to drop. Valid values are 0 through 100."}))},{title:"TelemetryTagPolicy"}),t.Object({type:t.Literal("tsuga_asset",{description:"Policy applies to Tsuga-managed resources such as dashboards, routes, and keys."}),assetTypes:Nc},{title:"TsugaAssetTagPolicy"})]),sw="Policy surface and enforcement behavior. Use `telemetry` for telemetry data or `tsuga_asset` for Tsuga-managed resources.",A9=t.Unsafe({...S9,description:sw}),x9=t.Unsafe({...O9,description:sw}),Ii=t.Object({id:t.String({description:"Tsuga-generated tag policy ID assigned when the policy is created."}),name:t.String({description:"Human-readable tag policy name."}),description:t.Optional(t.String({description:"Optional user-provided policy description."})),isActive:t.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:t.String({description:"Tag key enforced by this policy."}),allowedTagValues:t.Array(t.String(),{description:"Allowed values for `tagKey`. An empty array means any value is accepted when the tag exists."}),isRequired:t.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:t.Optional(b9),configuration:A9,creator:t.Optional(pe),updater:t.Optional(pe),owner:t.Optional(t.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 Is=t.Object({name:p({description:"Human-readable tag policy name."}),description:t.Optional(p({description:"Optional policy description."})),isActive:t.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:p({allowEmpty:!1,description:"Tag key enforced by this policy. Tsuga trims surrounding whitespace before storing the policy."}),allowedTagValues:t.Array(p({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:t.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:t.Optional(t.Object({teamIds:t.Array(p(),{minItems:1,maxItems:100,description:"Team IDs used by this policy scope."}),mode:t.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:x9,owner:p({allowEmpty:!1,description:"Team ID that will own and manage the policy."})}),Z6e=l({tags:["tag-policies"],url:io,method:"GET",query:t.Object({teamIds:t.Optional(t.Array(p(),{maxItems:100})),assetTypes:t.Optional(I9),searchQuery:t.Optional(p())}),response:t.Array(Ii)}),X6e=l({tags:["tag-policies"],url:`${io}/:id`,method:"GET",params:t.Object({id:p()}),response:Ii}),J6e=l({tags:["tag-policies"],url:io,method:"POST",body:Is,response:Ii}),eQe=l({tags:["tag-policies"],url:`${io}/:id`,method:"PUT",params:t.Object({id:p()}),body:Is,response:Ii}),tQe=l({tags:["tag-policies"],url:`${io}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),rQe=l({tags:["tag-policies"],url:`${gs}/applicable-tag-rules`,method:"GET",query:t.Object({assetType:t.Enum(la),teamId:p()}),response:t.Array(t.Object({tagKey:t.String(),allowedTagValues:t.Array(t.String()),isRequired:t.Boolean(),tagPolicyId:t.String()}))}),cw=t.Object({total:t.Number(),totalNonCompliant:t.Number(),idsNonCompliant:t.Array(t.String())}),pw=t.Union([t.Literal("ingestion-api-key"),t.Literal("operation-api-key"),t.Literal("rum-public-token"),t.Literal("dashboard"),t.Literal("log-route"),t.Literal("metric-route"),t.Literal("monitor"),t.Literal("notification-rule"),t.Literal("notification-silence"),t.Literal("slo")]),R9=t.Object({total:t.Number(),totalNonCompliant:t.Number(),byAssetType:t.Record(pw,cw)}),C9=t.Omit(cw,["total"]),P9=t.Object({totalNonCompliant:t.Number(),byAssetType:t.Record(pw,C9)}),uw=t.Object({totals:R9,byTeam:t.Record(t.String(),P9)}),nQe=l({tags:["tag-policies"],url:`${io}/:id/stats`,method:"GET",params:t.Object({id:p()}),response:uw}),oQe=l({tags:["tag-policies"],url:`${io}/new-policy-stats`,method:"POST",body:Is,response:uw});var bs=`/${"v1"}/tag-policies`,mw={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"},lw={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"},U9={id:"123-456-abc",...mw},w9={id:"456-789-def",...lw},Ss=t.Pick(Ii,["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)."}),N9=U9,L9=w9;Object.assign(Ss,{examples:[N9,L9]});var df=t.Pick(Is,["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."}),v9=mw,k9=lw;Object.assign(df,{examples:[v9,k9]});var dw=l({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:bs,method:"GET",response:t.Array(Ss)}),fw=l({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:`${bs}/:id`,method:"GET",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the tag policy to retrieve. Use the `id` returned by tag policy list or create responses."})}),response:Ss}),gw=l({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:bs,method:"POST",body:df,response:Ss}),yw=l({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:`${bs}/:id`,method:"PUT",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the tag policy to update. Use the `id` returned by tag policy list, get, or create responses."})}),body:df,response:Ss}),hw=l({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:`${bs}/:id`,method:"DELETE",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the tag policy to delete. Use the `id` returned by tag policy list, create, or update responses."})}),response:R});var Os=`/${"v1"}/teams`,As=t.Pick(Xo,["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)."}),M9={id:"team-123-abc",name:"platform-engineering",visibility:"public",tags:[{key:"department",value:"engineering"}]};Object.assign(As,{examples:[M9]});var Tw=l({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:Os,method:"GET",paginated:!0,query:t.Object(He),response:t.Array(As)}),Ew=l({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:`${Os}/:id`,method:"GET",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the team to retrieve. Use the `id` returned by team list or create responses."})}),response:As}),ff=t.Pick(ap,["name","description","visibility","tags"],{description:"Team create or update request. Provide the team name, optional description, visibility, and tags."}),D9={name:"platform-engineering",visibility:"public",tags:[{key:"department",value:"engineering"}]};Object.assign(ff,{examples:[D9]});var _w=l({description:"Creates a team for ownership and access control. Use this before assigning resources to a new owner team.",operationId:"createTeam",tags:["teams"],url:Os,method:"POST",body:ff,response:As}),Iw=l({description:"Replaces a team definition by ID, including name, description, visibility, and tags.",operationId:"updateTeam",tags:["teams"],url:`${Os}/:id`,method:"PUT",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the team to update. Use the `id` returned by team list, get, or create responses."})}),body:ff,response:As}),bw=l({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:`${Os}/:id`,method:"DELETE",params:t.Object({id:p({allowEmpty:!1,description:"Identifier of the team to delete. Use the `id` returned by team list, create, or update responses."})}),response:R});function gf(e){let r=e.params;if(r?.properties){let n=Object.keys(r.properties);if(n.length===1&&n[0])return n[0]}return"id"}function Sw(e,r,n){let o=e.command(r.commandName).description(r.description),i=yR(r.commandName).replace(/-/g," "),a=o.command("list").description(`List all ${r.commandName}`);if(r.listOptions)for(let c of r.listOptions)a.option(c.flag,c.description);if(r.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){Q(Zo(r.endpoints.list));return}let m=await n()(r.endpoints.list,{body:c.data?Fo({data:c.data}):{}});Q(m)}):a.action(async c=>{let m={};if(r.listOptions)for(let f of r.listOptions){let y=c[f.queryParam];y!==void 0&&(m[f.queryParam]=y)}let d=await n()(r.endpoints.list,Object.keys(m).length>0?{query:m}:void 0);Q(d)}),r.endpoints.get){let c=r.endpoints.get,m=gf(c);o.command("get <id>").description(`Get a ${i} by ID`).action(async d=>{let f=await n()(c,{params:{[m]:d}});Q(f)})}if(r.endpoints.create){let c=r.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){Q(Zo(c));return}let d=Fo(m),f=await n()(c,{body:d});Q(f)})}if(r.endpoints.update){let c=r.endpoints.update,m=gf(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(d,f)=>{if(f.generateSkeleton){Q(Zo(c));return}let y=Fo(f),E=await n()(c,{params:{[m]:d},body:y});Q(E)})}if(r.endpoints.delete){let c=r.endpoints.delete,m=gf(c);o.command("delete <id>").description(`Delete a ${i} by ID`).action(async d=>{let f=await n()(c,{params:{[m]:d}});Q(f)})}}var G9=[{commandName:"cloud-resources",description:"List cloud resources discovered by inventory scans",endpoints:{list:LP},enableListBody:!0},{commandName:"dashboards",description:"Manage dashboards",endpoints:{list:lP,get:dP,create:fP,update:gP,delete:yP},enableListBody:!0},{commandName:"ingestion-api-keys",description:"Manage ingestion API keys",endpoints:{list:SP,create:OP,update:AP,delete:xP}},{commandName:"investigations",description:"Manage investigations (beta)",endpoints:{list:kP,get:MP,create:DP,update:GP,delete:$P}},{commandName:"monitors",description:"Manage monitors",endpoints:{list:pU,get:uU,create:TU,update:EU,delete:_U},enableListBody:!0},{commandName:"notification-rules",description:"Manage notification rules",endpoints:{list:bU,get:SU,create:OU,update:AU,delete:xU}},{commandName:"notification-silences",description:"Manage notification silences",endpoints:{list:UU,get:wU,create:NU,update:LU,delete:vU}},{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:jU},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:KU,get:zU,create:YU,update:VU,delete:QU}},{commandName:"log-routes",description:"Manage routes",endpoints:{list:XP,get:JP,create:eU,update:tU,delete:rU}},{commandName:"services",description:"Manage services",endpoints:{list:oC,get:iC}},{commandName:"slos",description:"Manage SLOs",endpoints:{list:XU,get:JU,create:ow,update:iw,delete:aw},enableListBody:!0},{commandName:"tag-policies",description:"Manage tag policies",endpoints:{list:dw,get:fw,create:gw,update:yw,delete:hw}},{commandName:"teams",description:"Manage teams",endpoints:{list:Tw,get:Ew,create:_w,update:Iw,delete:bw}}];function Ow(e,r){for(let n of G9)Sw(e,n,r)}var Aw=require("node:child_process");var Pp="@tsuga/cli@latest";function $9(){B(`Updating ${Pp}`),B(` $ npm install -g ${Pp}`);try{(0,Aw.execFileSync)("npm",["install","-g",Pp],{stdio:["ignore","inherit","inherit"]})}catch(e){let r=e.status??1;throw new Error(`npm install -g ${Pp} exited ${r}`,{cause:e})}B("Updated. Run `tsuga --version` to confirm the new version.")}function xw(e){e.command("self-update").description("Update the Tsuga CLI to the latest version via npm").action(()=>{$9()})}var bf=require("node:fs"),If=require("node:os"),Si=require("node:path");function j9(e,r){let n=e.slice(0,r).split(/\r\n|\n|\r/g);return[n.length,n.pop().length+1]}function q9(e,r,n){let o=e.split(/\r\n|\n|\r/g),i="",a=(Math.log10(r+1)|0)+1;for(let c=r-1;c<=r+1;c++){let m=o[c-1];m&&(i+=c.toString().padEnd(a," "),i+=": ",i+=m,i+=`
|
|
133
133
|
`,c===r&&(i+=" ".repeat(a+n+2),i+=`^
|
|
134
|
-
`))}return i}var z=class extends Error{line;column;codeblock;constructor(r,n){let[o,i]=
|
|
134
|
+
`))}return i}var z=class extends Error{line;column;codeblock;constructor(r,n){let[o,i]=j9(n.toml,n.ptr),a=q9(n.toml,o,i);super(`Invalid TOML document: ${r}
|
|
135
135
|
|
|
136
|
-
${a}`,n),this.line=o,this.column=i,this.codeblock=a}};function
|
|
137
|
-
`,r);return e[o-1]==="\r"&&o--,o<=n?o:-1}function
|
|
136
|
+
${a}`,n),this.line=o,this.column=i,this.codeblock=a}};function B9(e,r){let n=0;for(;e[r-++n]==="\\";);return--n&&n%2}function Up(e,r=0,n=e.length){let o=e.indexOf(`
|
|
137
|
+
`,r);return e[o-1]==="\r"&&o--,o<=n?o:-1}function bi(e,r){for(let n=r;n<e.length;n++){let o=e[n];if(o===`
|
|
138
138
|
`)return n;if(o==="\r"&&e[n+1]===`
|
|
139
|
-
`)return n+1;if(o<" "&&o!==" "||o==="\x7F")throw new z("control characters are not allowed in comments",{toml:e,ptr:r})}return e.length}function
|
|
139
|
+
`)return n+1;if(o<" "&&o!==" "||o==="\x7F")throw new z("control characters are not allowed in comments",{toml:e,ptr:r})}return e.length}function vt(e,r,n,o){let i;for(;;){for(;(i=e[r])===" "||i===" "||!n&&(i===`
|
|
140
140
|
`||i==="\r"&&e[r+1]===`
|
|
141
|
-
`);)r++;if(o||i!=="#")break;r=
|
|
141
|
+
`);)r++;if(o||i!=="#")break;r=bi(e,r)}return r}function Rw(e,r,n,o,i=!1){if(!o)return r=Up(e,r),r<0?e.length:r;for(let a=r;a<e.length;a++){let c=e[a];if(c==="#")a=Up(e,a);else{if(c===n)return a+1;if(c===o||i&&(c===`
|
|
142
142
|
`||c==="\r"&&e[a+1]===`
|
|
143
|
-
`))return a}}throw new z("cannot find end of structure",{toml:e,ptr:r})}function
|
|
144
|
-
`,f:"\f",r:"\r",e:"\x1B",'"':'"',"\\":"\\"};function
|
|
145
|
-
`&&r++);let a=0,c,m="",
|
|
143
|
+
`))return a}}throw new z("cannot find end of structure",{toml:e,ptr:r})}function wp(e,r){let n=e[r],o=n===e[r+1]&&e[r+1]===e[r+2]?e.slice(r,r+3):n;r+=o.length-1;do r=e.indexOf(o,++r);while(r>-1&&n!=="'"&&B9(e,r));return r>-1&&(r+=o.length,o.length>1&&(e[r]===n&&r++,e[r]===n&&r++)),r}var F9=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i,xs=class e extends Date{#t=!1;#r=!1;#e=null;constructor(r){let n=!0,o=!0,i="Z";if(typeof r=="string"){let a=r.match(F9);a?(a[1]||(n=!1,r=`0000-01-01T${r}`),o=!!a[2],o&&r[10]===" "&&(r=r.replace(" ","T")),a[2]&&+a[2]>23?r="":(i=a[3]||null,r=r.toUpperCase(),!i&&o&&(r+="Z"))):r=""}super(r),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 r=super.toISOString();if(this.isDate())return r.slice(0,10);if(this.isTime())return r.slice(11,23);if(this.#e===null)return r.slice(0,-1);if(this.#e==="Z")return r;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(r,n="Z"){let o=new e(r);return o.#e=n,o}static wrapAsLocalDateTime(r){let n=new e(r);return n.#e=null,n}static wrapAsLocalDate(r){let n=new e(r);return n.#r=!1,n.#e=null,n}static wrapAsLocalTime(r){let n=new e(r);return n.#t=!1,n.#e=null,n}};var H9=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,K9=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,z9=/^[+-]?0[0-9_]/,Y9=/^[0-9a-f]{2,8}$/i,Cw={b:"\b",t:" ",n:`
|
|
144
|
+
`,f:"\f",r:"\r",e:"\x1B",'"':'"',"\\":"\\"};function Np(e,r=0,n=e.length){let o=e[r]==="'",i=e[r++]===e[r]&&e[r]===e[r+1];i&&(n-=2,e[r+=2]==="\r"&&r++,e[r]===`
|
|
145
|
+
`&&r++);let a=0,c,m="",d=r;for(;r<n-1;){let f=e[r++];if(f===`
|
|
146
146
|
`||f==="\r"&&e[r]===`
|
|
147
|
-
`){if(!i)throw new z("newlines are not allowed in strings",{toml:e,ptr:r-1})}else if(f<" "&&f!==" "||f==="\x7F")throw new z("control characters are not allowed in strings",{toml:e,ptr:r-1});if(c){if(c=!1,f==="x"||f==="u"||f==="U"){let y=e.slice(r,r+=f==="x"?2:f==="u"?4:8);if(!
|
|
148
|
-
`||f===" "||f===" "||f==="\r")){if(r=
|
|
149
|
-
`&&e[r]!=="\r")throw new z("invalid escape: only line-ending whitespace may be escaped",{toml:e,ptr:a});r=
|
|
150
|
-
`&&e[c]!=="\r")throw new z("unexpected character encountered",{toml:e,ptr:c});c+=+(e[c]===",")}return[
|
|
151
|
-
`&&c!=="\r"){let m,
|
|
152
|
-
`&&a!=="\r"){let c=
|
|
153
|
-
`&&e[m]!=="\r")throw new z("each key-value declaration must be followed by an end-of-line",{toml:e,ptr:m});m=
|
|
147
|
+
`){if(!i)throw new z("newlines are not allowed in strings",{toml:e,ptr:r-1})}else if(f<" "&&f!==" "||f==="\x7F")throw new z("control characters are not allowed in strings",{toml:e,ptr:r-1});if(c){if(c=!1,f==="x"||f==="u"||f==="U"){let y=e.slice(r,r+=f==="x"?2:f==="u"?4:8);if(!Y9.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===`
|
|
148
|
+
`||f===" "||f===" "||f==="\r")){if(r=vt(e,r-1,!0),e[r]!==`
|
|
149
|
+
`&&e[r]!=="\r")throw new z("invalid escape: only line-ending whitespace may be escaped",{toml:e,ptr:a});r=vt(e,r)}else if(f in Cw)m+=Cw[f];else throw new z("unrecognized escape sequence",{toml:e,ptr:a});d=r}else!o&&f==="\\"&&(a=r-1,c=!0,m+=e.slice(d,a))}return m+e.slice(d,n-1)}function Pw(e,r,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=H9.test(e);if(i||K9.test(e)){if(z9.test(e))throw new z("leading zeroes are not allowed",{toml:r,ptr:n});e=e.replace(/_/g,"");let c=+e;if(isNaN(c))throw new z("invalid number",{toml:r,ptr:n});if(i){if((i=!Number.isSafeInteger(c))&&!o)throw new z("integer value cannot be represented losslessly",{toml:r,ptr:n});(i||o===!0)&&(c=BigInt(e))}return c}let a=new xs(e);if(!a.isValid())throw new z("invalid value",{toml:r,ptr:n});return a}function V9(e,r,n){let o=e.slice(r,n),i=o.indexOf("#");return i>-1&&(bi(e,i),o=o.slice(0,i)),[o.trimEnd(),i]}function Rs(e,r,n,o,i){if(o===0)throw new z("document contains excessively nested structures. aborting.",{toml:e,ptr:r});let a=e[r];if(a==="["||a==="{"){let[d,f]=a==="["?ww(e,r,o,i):Uw(e,r,o,i);if(n){if(f=vt(e,f),e[f]===",")f++;else if(e[f]!==n)throw new z("expected comma or end of structure",{toml:e,ptr:f})}return[d,f]}let c;if(a==='"'||a==="'"){c=wp(e,r);let d=Np(e,r,c);if(n){if(c=vt(e,c),e[c]&&e[c]!==","&&e[c]!==n&&e[c]!==`
|
|
150
|
+
`&&e[c]!=="\r")throw new z("unexpected character encountered",{toml:e,ptr:c});c+=+(e[c]===",")}return[d,c]}c=Rw(e,r,",",n);let m=V9(e,r,c-+(e[c-1]===","));if(!m[0])throw new z("incomplete key-value declaration: no value specified",{toml:e,ptr:r});return n&&m[1]>-1&&(c=vt(e,r+m[1]),c+=+(e[c]===",")),[Pw(m[0],e,r,i),c]}var Q9=/^[a-zA-Z0-9-_]+[ \t]*$/;function Lp(e,r,n="="){let o=r-1,i=[],a=e.indexOf(n,r);if(a<0)throw new z("incomplete key-value: cannot find end of key",{toml:e,ptr:r});do{let c=e[r=++o];if(c!==" "&&c!==" ")if(c==='"'||c==="'"){if(c===e[r+1]&&c===e[r+2])throw new z("multiline strings are not allowed in keys",{toml:e,ptr:r});let m=wp(e,r);if(m<0)throw new z("unfinished string encountered",{toml:e,ptr:r});o=e.indexOf(".",m);let d=e.slice(m,o<0||o>a?a:o),f=Up(d);if(f>-1)throw new z("newlines are not allowed in keys",{toml:e,ptr:r+o+f});if(d.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:r});i.push(Np(e,r,m))}else{o=e.indexOf(".",r);let m=e.slice(r,o<0||o>a?a:o);if(!Q9.test(m))throw new z("only letter, numbers, dashes and underscores are allowed in keys",{toml:e,ptr:r});i.push(m.trimEnd())}}while(o+1&&o<a);return[i,vt(e,a+1,!0,!0)]}function Uw(e,r,n,o){let i={},a=new Set,c;for(r++;(c=e[r++])!=="}"&&c;){if(c===",")throw new z("expected value, found comma",{toml:e,ptr:r-1});if(c==="#")r=bi(e,r);else if(c!==" "&&c!==" "&&c!==`
|
|
151
|
+
`&&c!=="\r"){let m,d=i,f=!1,[y,E]=Lp(e,r-1);for(let Ue=0;Ue<y.length;Ue++){if(Ue&&(d=f?d[m]:d[m]={}),m=y[Ue],(f=Object.hasOwn(d,m))&&(typeof d[m]!="object"||a.has(d[m])))throw new z("trying to redefine an already defined value",{toml:e,ptr:r});!f&&m==="__proto__"&&Object.defineProperty(d,m,{enumerable:!0,configurable:!0,writable:!0})}if(f)throw new z("trying to redefine an already defined value",{toml:e,ptr:r});let[A,ye]=Rs(e,E,"}",n-1,o);a.add(A),d[m]=A,r=ye}}if(!c)throw new z("unfinished table encountered",{toml:e,ptr:r});return[i,r]}function ww(e,r,n,o){let i=[],a;for(r++;(a=e[r++])!=="]"&&a;){if(a===",")throw new z("expected value, found comma",{toml:e,ptr:r-1});if(a==="#")r=bi(e,r);else if(a!==" "&&a!==" "&&a!==`
|
|
152
|
+
`&&a!=="\r"){let c=Rs(e,r-1,"]",n-1,o);i.push(c[0]),r=c[1]}}if(!a)throw new z("unfinished array encountered",{toml:e,ptr:r});return[i,r]}function Nw(e,r,n,o){let i=r,a=n,c,m=!1,d;for(let f=0;f<e.length;f++){if(f){if(i=m?i[c]:i[c]={},a=(d=a[c]).c,o===0&&(d.t===1||d.t===2))return null;if(d.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(d=a[c],d.t!==o&&!(o===1&&d.t===3)||(o===2&&(d.d||(d.d=!0,i[c]=[]),i[c].push(i={}),d.c[d.i++]=d={t:1,d:!1,i:0,c:{}}),d.d))return null;if(d.d=!0,o===1)i=m?i[c]:i[c]={};else if(o===0&&m)return null;return[c,i,d.c]}function yf(e,{maxDepth:r=1e3,integersAsBigInt:n}={}){let o={},i={},a=o,c=i;for(let m=vt(e,0);m<e.length;){if(e[m]==="["){let d=e[++m]==="[",f=Lp(e,m+=+d,"]");if(d){if(e[f[1]-1]!=="]")throw new z("expected end of table declaration",{toml:e,ptr:f[1]-1});f[1]++}let y=Nw(f[0],o,i,d?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 d=Lp(e,m),f=Nw(d[0],a,c,0);if(!f)throw new z("trying to redefine an already defined table or value",{toml:e,ptr:m});let y=Rs(e,d[1],void 0,r,n);f[1][f[0]]=y[0],m=y[1]}if(m=vt(e,m,!0),e[m]&&e[m]!==`
|
|
153
|
+
`&&e[m]!=="\r")throw new z("each key-value declaration must be followed by an end-of-line",{toml:e,ptr:m});m=vt(e,m)}return o}var Lw=/^[a-z0-9-_]+$/i;function Cs(e){let r=typeof e;if(r==="object"){if(Array.isArray(e))return"array";if(e instanceof Date)return"date"}return r}function W9(e){for(let r=0;r<e.length;r++)if(Cs(e[r])!=="object")return!1;return e.length!=0}function hf(e){return JSON.stringify(e).replace(/\x7f/g,"\\u007f")}function Tf(e,r,n,o){if(n===0)throw new Error("Could not stringify the object: maximum object depth exceeded");if(r==="number")return isNaN(e)?"nan":e===1/0?"inf":e===-1/0?"-inf":o&&Number.isInteger(e)?e.toFixed(1):e.toString();if(r==="bigint"||r==="boolean")return e.toString();if(r==="string")return hf(e);if(r==="date"){if(isNaN(e.getTime()))throw new TypeError("cannot serialize invalid date");return e.toISOString()}if(r==="object")return Z9(e,n,o);if(r==="array")return X9(e,n,o)}function Z9(e,r,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+=Lw.test(c)?c:hf(c),i+=" = ",i+=Tf(e[c],Cs(e[c]),r-1,n)}return i+" }"}function X9(e,r,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+=Tf(e[i],Cs(e[i]),r-1,n)}return o+" ]"}function J9(e,r,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&&`
|
|
154
154
|
`}[[${r}]]
|
|
155
|
-
`,i+=
|
|
156
|
-
`)+
|
|
157
|
-
`)+
|
|
155
|
+
`,i+=Ef(0,e[a],r,n,o);return i}function Ef(e,r,n,o,i){if(o===0)throw new Error("Could not stringify the object: maximum object depth exceeded");let a="",c="",m=Object.keys(r);for(let d=0;d<m.length;d++){let f=m[d];if(r[f]!==null&&r[f]!==void 0){let y=Cs(r[f]);if(y==="symbol"||y==="function")throw new TypeError(`cannot serialize values of type '${y}'`);let E=Lw.test(f)?f:hf(f);if(y==="array"&&W9(r[f]))c+=(c&&`
|
|
156
|
+
`)+J9(r[f],n?`${n}.${E}`:E,o-1,i);else if(y==="object"){let A=n?`${n}.${E}`:E;c+=(c&&`
|
|
157
|
+
`)+Ef(A,r[f],A,o-1,i)}else a+=E,a+=" = ",a+=Tf(r[f],y,o,i),a+=`
|
|
158
158
|
`}}return e&&(a||!c)&&(a=a?`[${e}]
|
|
159
159
|
${a}`:`[${e}]`),a&&c?`${a}
|
|
160
|
-
${c}`:a||c}function
|
|
160
|
+
${c}`:a||c}function _f(e,{maxDepth:r=1e3,numbersAsFloat:n=!1}={}){if(Cs(e)!=="object")throw new TypeError("stringify can only be called with an object");let o=Ef(0,e,"",r,n);return o[o.length-1]!==`
|
|
161
161
|
`?o+`
|
|
162
|
-
`:o}var
|
|
163
|
-
`),B(f===void 0?" created":` patched (backup: ${f})`)}function M9(e,r,n){return{environment:"dev",log_user_prompt:n,exporter:{"otlp-http":{endpoint:`${e}/v1/logs`,protocol:"binary",headers:{Authorization:`Bearer ${r}`}}},trace_exporter:{"otlp-http":{endpoint:`${e}/v1/traces`,protocol:"binary",headers:{Authorization:`Bearer ${r}`}}}}}function D9(e,r,n,o){let i=(0,bi.join)(e,".codex"),a=(0,bi.join)(i,"config.toml");B(`Codex \u2192 ${a}`),(0,Tf.mkdirSync)(i,{recursive:!0});let c=Ba(a),m=c===void 0?{}:lf(c),l="otel"in m;delete m.otel,m.otel=M9(r,n,o);let f=Fa(a,c);qa(a,yf(m)),B(f===void 0?" created":l?` replaced existing [otel] tables (backup: ${f})`:` appended (backup: ${f})`)}function hw(){return new eu("--endpoint <url>","OTLP base URL").env("TSUGA_OTLP_ENDPOINT").makeOptionMandatory()}function Tw(){return new eu("--ingestion-api-key <key>","Tsuga ingestion API key").env("TSUGA_INGESTION_API_KEY").makeOptionMandatory()}var Ew="Restart your claude / codex session to load the new config.";function _w(e){let r=e.command("setup").description("Configure local LLM CLIs to ship OTEL telemetry to Tsuga");r.command("claude-code").description("Patch ~/.claude/settings.json with Tsuga OTEL env").addOption(hw()).addOption(Tw()).option("--no-include-prompts","Strip user prompts + tool content from telemetry (default: include)").action(n=>{k9((0,hf.homedir)(),n.endpoint.replace(/\/+$/,""),n.ingestionApiKey,n.includePrompts),B(Ew)}),r.command("codex").description("Patch ~/.codex/config.toml with Tsuga OTEL settings").addOption(hw()).addOption(Tw()).option("--no-include-prompts","Strip user prompts + tool content from telemetry (default: include)").action(n=>{D9((0,hf.homedir)(),n.endpoint.replace(/\/+$/,""),n.ingestionApiKey,n.includePrompts),B(Ew)})}var wp="/v0/logs";var Ef=["CRITICAL","ERROR","WARN","NOTICE","INFO","DEBUG","TRACE"];var Cs=0,_f=t.Object({__tsuga_metadata__:t.Object({id:t.String(),source:t.Optional(t.String())},{additionalProperties:!0}),context:t.Optional(t.Object({team:t.Optional(t.String({description:"Team name associated with this log."})),tag_policy_warnings:t.Optional(t.Record(t.String(),t.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:t.Optional(t.Unknown({description:"Log message after ingestion and route processing. It can be any JSON value because processors may map arbitrary data into `message`."})),timestamp:t.Number({description:"Log timestamp as a Unix timestamp in milliseconds."}),level:t.Enum(Ef,{description:"Log severity, normalized from the source severity into one of the fixed Tsuga levels (ordered `CRITICAL` to `TRACE`)."}),[dS]:t.Optional(t.String({description:"ID of the cluster this log was read from. Only set when the request spanned several clusters."}))},{additionalProperties:!0}),Iw=100,G9="timestamp",$9=t.Union([t.Literal(G9)]),io=t.Partial(t.Object({...He.properties,query:p({type:"tsuga-query",description:"Tsuga query used to filter logs in the selected time range."}),maxResults:t.Integer({minimum:1,maximum:1e3,description:"Maximum number of logs to return. Valid values are 1 through 1000."}),shouldRecommendAttributes:t.Boolean({description:"Whether Tsuga should return suggested attributes to highlight in results."}),triggeredBy:t.Literal("refresh",{description:"Indicates the query was triggered by a refresh action."}),startOffset:t.Number({minimum:Cs,description:"Result offset used when fetching additional log rows."}),startOffsets:t.Array(t.Number({minimum:Cs}),{description:`Result offsets used when fetching additional log rows, one per entry of \`clusterIds\` and in the same order. Echo back each cluster's \`nextStartOffset\` from the previous response. Must have the same length as \`clusterIds\`. Defaults to ${Cs} for every cluster.`}),clusterId:p({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}),clusterIds:Ea,sortBy:$9,sortDirection:t.Union([t.Literal("asc"),t.Literal("desc")],{description:"Timestamp sort direction for log results."})})),YQe=d({tags:["logs"],url:`${wp}/count`,method:"GET",query:t.Pick(io,["from","to","query","clusterId","clusterIds"]),response:t.Object({count:t.Number(),clusterResponses:t.Optional($o())})}),Ps=t.Object({value:t.String(),priority:t.Number()}),VQe=d({tags:["logs"],url:`${wp}/search`,method:"GET",query:io,response:t.Object({logs:t.Optional(t.Array(_f)),attributesToHighlight:t.Optional(t.Array(Ps)),clusterResponses:t.Optional($o(t.Object({nextStartOffset:t.Number({description:"Number of logs consumed on this cluster so far. Echo it back at this cluster's position in `startOffsets` to fetch the next page."})})))},{additionalProperties:!0})}),j9=t.Cyclic({TokenOutput:t.Union([t.Object({type:t.Literal("top"),values:t.Array(t.String())}),t.Object({type:t.Literal("ip"),value:t.String()}),t.Object({type:t.Literal("range"),min:t.Number(),max:t.Number()}),t.Object({type:t.Literal("variable"),value:t.String()}),t.Object({type:t.Literal("text"),value:t.String()}),t.Object({type:t.Literal("date"),value:t.String()}),t.Object({type:t.Literal("url"),value:t.String()}),t.Object({type:t.Literal("structure"),key:t.Array(t.String()),value:t.Array(t.Ref("TokenOutput"))})])},"TokenOutput",{description:"A token identified as part of the pattern"}),q9=t.Object({id:t.String(),pattern:t.Array(j9),size:t.Integer({description:"Number of logs that matched the pattern"}),examples:t.Array(t.Object({id:t.String(),timestampUnix:t.Number()})),timeDistribution:t.Array(t.Number()),staticFeatures:t.Array(t.Object({key:t.String(),value:t.String()},{description:"Fixed groups present in all logs matching the pattern"}))}),QQe=d({tags:["logs"],url:`${wp}/patterns`,method:"GET",query:t.Object({...He.properties,query:p({type:"tsuga-query"}),clusteringThreshold:t.Optional(t.Number()),clusterId:t.Optional(p({allowEmpty:!1}))}),response:t.Object({patterns:t.Array(q9),sampleSize:t.Number()})}),WQe=d({tags:["logs"],url:`${wp}/attributes`,method:"GET",query:t.Object({...He.properties,clusterId:t.Optional(p({allowEmpty:!1,description:"Cluster ID"})),clusterIds:t.Optional(Ea)}),response:t.Object({attributes:t.Array(t.String()),clusterResponses:t.Optional($o())})});var Us=`/${"v1"}/logs`,If=t.Object({context:t.Optional(t.Object({team:t.Optional(t.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."})),...t.Pick(_f,["message","timestamp","level"]).properties},{additionalProperties:!0,$id:"LogEvent",description:"Log event including message, timestamp, severity level, and optional enriched context attributes."}),B9={context:{team:"platform"},message:"Request completed successfully",timestamp:17040672e5,level:"INFO"};Object.assign(If,{examples:[B9]});var bw=t.Object({query:t.Optional(p({type:"tsuga-query",default:"*",description:"Tsuga query selecting logs to return. Omit to search all logs with `*`."})),maxResults:t.Optional(t.Integer({minimum:1,maximum:1e3,default:Iw,description:"Maximum number of logs to return. Defaults to 100. Valid values are 1 through 1000."})),clusterId:t.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."})),...ut.properties},{description:"Log search query. Provide a time range, optional Tsuga query, and optional limit."}),F9={query:"level:ERROR",maxResults:100,from:1704067200,to:1704070800};Object.assign(bw,{examples:[F9]});var Sw=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:`${Us}/search`,method:"GET",query:bw,response:t.Object({logs:t.Array(If,{description:"Log events matching the query and time range."})})}),H9=t.Object({pattern:t.String({description:"Clustered log pattern formatted as a readable string."}),size:t.Integer({description:"Number of logs that matched the pattern"}),groups:t.Array(t.Object({key:t.String({description:"Attribute dot-path shared by all logs in the pattern."}),value:t.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`."}))}),Ow=t.Object({patterns:t.Array(H9,{description:"Log patterns clustered from logs matching the query."}),sampleSize:t.Number({description:"Number of logs sampled while computing patterns."})},{}),K9={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(Ow,{examples:[K9]});var Aw=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:`${Us}/patterns`,method:"GET",query:t.Object({...ut.properties,query:p({type:"tsuga-query",description:"Tsuga query selecting logs to cluster into patterns."}),clusterId:t.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))}),response:Ow}),z9=t.Object({exampleLog:t.Optional(If),team:t.String({description:"Team associated with the new error pattern."}),env:t.String({description:"Environment associated with the new error pattern."}),service:t.String({description:"Service associated with the new error pattern."}),firstSeen:t.Number({description:"Unix timestamp in seconds when this pattern was first seen."}),lastSeen:t.Number({description:"Unix timestamp in seconds when this pattern was last seen."})}),xw=t.Object({newErrorPatterns:t.Array(z9,{description:"Error patterns first seen in the requested time range."})},{}),Y9={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(xw,{examples:[Y9]});var Rw=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:`${Us}/patterns/new`,method:"GET",query:t.Object({...ut.properties,team:t.Optional(p({description:"Team name to restrict pattern detection to."})),env:t.Optional(p({description:"Environment to restrict pattern detection to."})),service:t.Optional(p({description:"Service name to restrict pattern detection to."})),clusterId:t.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))}),response:xw}),V9=t.Object({team:t.String({description:"Team associated with the error pattern."}),env:t.String({description:"Environment associated with the error pattern."}),pattern:t.String({description:"Error pattern formatted as a readable string."}),increaseTimestamps:t.Array(t.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."}))}),Cw=t.Object({errorPatternIncreases:t.Array(V9,{description:"Error patterns with increased occurrence in the requested time range."})},{}),Q9={errorPatternIncreases:[{team:"platform",env:"production",pattern:"Non-resolved segment SegmentId(*) from cache",increaseTimestamps:[17041536e5,17042392e5]}]};Object.assign(Cw,{examples:[Q9]});var Pw=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:`${Us}/patterns/increase`,method:"GET",query:t.Object({...ut.properties,team:p({description:"Team name to analyze for pattern increases."}),env:t.Optional(p({description:"Environment to restrict the analysis to."})),clusterId:t.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))}),response:Cw}),Uw=t.Object({attributes:t.Array(t.String(),{description:"Log attribute dot-paths observed in the time range"})},{}),W9={attributes:["context.env","context.k8s.pod.name","context.service.name","context.team","level","message","timestamp"]};Object.assign(Uw,{examples:[W9]});var Z9=t.Object({...ut.properties,clusterId:t.Optional(p({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."}),ww=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:`${Us}/attributes`,method:"GET",query:Z9,response:Uw});var vr="/v0/metrics",X9=t.Object({__tsuga_metadata__:t.Object({},{additionalProperties:!0}),context:t.Optional(t.Object({},{additionalProperties:!0})),message:t.Optional(t.String()),timestamp:t.Number(),level:t.Enum(Ef)},{additionalProperties:!0}),u8e=d({tags:["metrics"],url:`${vr}/count`,method:"GET",query:t.Pick(io,["from","to","query","clusterId"]),response:t.Object({count:t.Number()})}),m8e=d({tags:["metrics"],url:`${vr}/search`,method:"GET",query:io,response:t.Object({logs:t.Optional(t.Array(X9)),totalHits:t.Optional(t.Number()),attributesToHighlight:t.Optional(t.Array(Ps))},{additionalProperties:!0})}),Np=t.Enum(["counter","gauge","histogram","summary","composite_histogram"],{description:"Metric instrument type, set by the reporting instrumentation. `counter` accumulates a monotonically increasing total (aggregate with `sum` or `increase`); `gauge` reports a point-in-time value that can go up or down (aggregate with `average`, `max`, `min`, or `last`); `histogram`, `composite_histogram`, and `summary` report a distribution of values, from which percentiles can be computed. Tsuga displays `composite_histogram` metrics as Histogram in the app."}),bf=t.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."}),J9=t.Object({capabilities:t.Optional(t.Array(t.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:t.Optional(t.String({description:"Human-readable description of the metric"})),tags:t.Optional(t.Array(t.String(),{description:"Attribute names available as dimensions for filtering or grouping this metric. Exposed publicly as `attributes`."})),temporality:t.Optional(bf),type:t.Optional(Np),unit:t.Optional(t.String({description:"Metric unit reported by instrumentation or inferred metadata."}))}),l8e=d({url:`${vr}/metadata`,method:"GET",query:t.Object({...He.properties,metricName:p({allowEmpty:!1}),clusterId:t.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:J9}),d8e=d({tags:["metrics"],url:vr,method:"GET",query:t.Object({...He.properties,clusterId:t.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:t.Array(t.String())}),Lp=t.Array(t.Object({name:t.String({description:"Metric name observed by Tsuga."}),type:Np}),{description:"Metrics observed in the requested time range, with the instrument type each was reported as."}),e3=[{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:[e3]});var f8e=d({tags:["metrics"],url:`${vr}/names-and-types`,method:"GET",query:t.Object({...He.properties,clusterId:t.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:Lp}),ws=t.Array(t.String(),{description:"Attribute names available as dimensions for filtering or grouping the requested metric(s)."}),t3=["service","env","host","method","status_code"];Object.assign(ws,{examples:[t3]});var g8e=d({tags:["metrics"],url:`${vr}/attributes`,method:"GET",query:t.Object({...He.properties,metricName:p({allowEmpty:!1}),clusterId:t.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:ws}),y8e=d({tags:["metrics"],url:`${vr}/attributes/batch`,method:"GET",query:t.Object({...He.properties,metricNames:t.Array(p({allowEmpty:!1}),{minItems:1,description:"Metric names to fetch attributes for"}),clusterId:t.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:ws}),Sf=t.Object({assets:t.Array(t.Object({type:t.Enum(["dashboard","monitor"],{description:"Kind of asset referencing the metric."}),id:t.String({description:"Dashboard or monitor ID for the asset that queries this metric."}),name:t.String({description:"Display name of the referencing dashboard or monitor."}),owner:t.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."})}),h8e=d({tags:["metrics"],url:`${vr}/assets-usage`,method:"GET",query:t.Object({metricName:p({allowEmpty:!1})}),response:Sf}),T8e=d({url:`${vr}/per-attribute`,method:"GET",query:t.Object({from:t.Optional(t.Number()),to:t.Optional(t.Number()),attribute:p(),clusterId:t.Optional(p({allowEmpty:!1}))}),response:t.Array(t.String())});var Of=`/${"v1"}/metrics`,r3=[{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:[r3]});var Af=t.Object({name:t.String({description:"Metric name observed by Tsuga. Use this value in metric queries and aggregations."}),type:Np,description:t.Optional(t.String({description:"Human-readable description of what the metric measures, set by the reporting instrumentation. Omitted when the instrumentation did not provide one."})),unit:t.Optional(t.String({description:"Metric unit reported by instrumentation or inferred metadata."})),temporality:t.Optional(bf),capabilities:t.Optional(t.Array(t.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:t.Optional(t.Array(t.String(),{description:"Metric attribute names available as dimensions for filtering or grouping."}))}),n3={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(Af,{examples:[n3]});var Nw=t.Object({...ut.properties,clusterId:t.Optional(p({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."}),Lw=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:Of,method:"GET",query:Nw,response:t.Array(Af)}),vw=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:`${Of}/:name`,method:"GET",params:t.Object({name:p({allowEmpty:!1,description:"Metric name to retrieve, for example `http.server.request.duration`."})}),query:Nw,response:Af}),o3=["service","env","host","method","status_code"];Object.assign(ws,{examples:[o3]});var kw=t.Pick(Sf,["assets"]),i3={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(kw,{examples:[i3]});var Mw=d({description:"Retrieve dashboards and monitors that use a specific metric",operationId:"getMetricAssetsUsage",tags:["private"],url:`${Of}/assets-usage`,method:"GET",query:t.Object({metricName:p({allowEmpty:!1,description:"The name of the metric to find usage for"})}),response:kw});var Si="/v0/traces",N8e=d({tags:["traces"],url:`${Si}/count`,method:"GET",query:t.Pick(io,["from","to","query","clusterId"]),response:t.Object({count:t.Number()})}),a3=["unset","ok","error"],s3=t.Enum(a3),c3=["unspecified","internal","server","client","producer","consumer"],p3=t.Enum(c3),Gw=t.Object({__tsuga_metadata__:t.Optional(t.Object({},{additionalProperties:!0})),context:t.Optional(t.Object({telemetry:t.Optional(t.Object({sdk:t.Optional(t.Object({language:t.Optional(t.String())},{additionalProperties:!0}))},{additionalProperties:!0})),tag_policy_warnings:t.Optional(t.Record(t.String(),t.String())),service:t.Optional(t.Object({name:t.Optional(t.String()),version:t.Optional(t.String())},{additionalProperties:!0})),env:t.Optional(t.String())},{additionalProperties:!0})),parent_span_id:t.Optional(t.String()),resource_attributes:t.Object({},{additionalProperties:!0}),span_attributes:t.Object({},{additionalProperties:!0}),duration:t.Number({description:"In milliseconds."}),duration_ns:t.String({description:"In nanoseconds. Transmitted as a string to avoid losing precision, as BigInt is not JSON-compatible."}),start_time:t.String({description:"In nanoseconds. Transmitted as a string to avoid losing precision, as BigInt is not JSON-compatible."}),end_time:t.String({description:"In nanoseconds. Transmitted as a string to avoid losing precision, as BigInt is not JSON-compatible."}),error:t.Optional(t.Object({message:t.String()})),events:t.Optional(t.Array(t.Object({event_attributes:t.Object({},{additionalProperties:!0}),event_name:t.String(),event_timestamp_nanos:t.String({description:"In nanoseconds. Transmitted as a string to avoid losing precision, as BigInt is not JSON-compatible."})}))),links:t.Optional(t.Array(t.Object({},{additionalProperties:!0}))),span_id:t.String(),span:t.Object({kind:p3,name:t.String()}),status_code:t.Optional(s3),trace_id:t.String()}),$w=100,u3="start_time",m3="duration_ns",l3=t.Union([t.Literal(u3),t.Literal(m3)]),d3={...He.properties,query:t.Optional(p({type:"tsuga-query"})),maxResults:t.Optional(t.Integer({minimum:1,maximum:1e4})),shouldRecommendAttributes:t.Optional(t.Boolean()),startOffset:t.Optional(t.Number({minimum:Cs})),clusterId:t.Optional(p({allowEmpty:!1,description:"Cluster ID"})),sortBy:t.Optional(l3),sortDirection:t.Optional(t.Union([t.Literal("asc"),t.Literal("desc")]))},L8e=d({tags:["traces"],url:`${Si}/search`,method:"GET",query:t.Object(d3),response:t.Object({spans:t.Optional(t.Array(Gw)),attributesToHighlight:t.Optional(t.Array(Ps))})});var f3=t.Object({groupByAttributes:t.Array(p({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:t.Integer({minimum:2,description:"Minimum leaf-group size before aggregation occurs. Default 5."}),maxParentDepth:t.Integer({minimum:-1,description:"Max depth of recursive parent aggregation. 0 = leaves only, -1 = unlimited (default)."}),aggregationHistogramBucketsSeconds:t.Array(t.Number({minimum:0}),{description:"Upper bounds for the latency histogram in seconds. Empty array disables the histogram attributes."}),sortSpans:t.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."})}),g3=t.Object({...He.properties,traceId:p({allowEmpty:!1,description:"Trace ID to summarize"}),clusterId:t.Optional(p({allowEmpty:!1,description:"Cluster ID"})),...t.Partial(f3).properties}),v8e=d({tags:["traces"],url:`${Si}/summarize`,method:"GET",query:g3,response:t.Object({spans:t.Array(Gw)})}),k8e=d({tags:["traces"],url:`${Si}/attributes`,method:"GET",query:t.Object({...He.properties,clusterId:t.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:t.Object({attributes:t.Array(t.String())})}),y3=t.Object({key:t.String({description:"Opaque stable key identifying this contributing service within the response. Tsuga assigns it while building the summary; `ranges[].contributions[].serviceKey` and `serviceTotals[].serviceKey` reference this value."}),name:t.String({description:"Observed service name that contributed leaf-span time to the trace. Comes from trace service context and is returned for every contributing service."}),env:t.Optional(t.String({description:"Observed service environment for this contributing service. Comes from trace service context and is absent when the spans do not carry an environment."})),id:t.Optional(t.String({description:"Service catalog ID for this contributing service. Tsuga sets it when exactly one catalog entry matches the observed service and environment; absent when the service is not cataloged or matches ambiguously."})),namespace:t.Optional(t.String({description:"Service namespace from the matched service catalog entry. Returned only when Tsuga can resolve the contributing service to one catalog entry with a namespace."}))}),h3=t.Object({fromNs:t.String({description:"Range start time in nanoseconds since Unix epoch. Tsuga sets it from the trace timeline split where active leaf spans change. Transmitted as a string to avoid losing precision."}),toNs:t.String({description:"Range end time in nanoseconds since Unix epoch. Tsuga sets it from the trace timeline split where active leaf spans change. Transmitted as a string to avoid losing precision."}),durationNs:t.String({description:"Range duration in nanoseconds, computed as `toNs - fromNs`. Transmitted as a string to avoid losing precision."}),contributions:t.Array(t.Object({serviceKey:t.String({description:"Contributing service key for this range. References `services[].key` in the same response."}),weight:t.Number({description:"Share of this range attributed to the service, from `0` through `1`. Tsuga computes the weight from active leaf spans in the range; weights inside one range sum to `1`."}),durationNs:t.String({description:"Estimated duration attributed to this service in the range, computed as `weight` times the range's own `durationNs` and rounded to whole nanoseconds. Use `serviceTotals` as authoritative when rounded range values do not add up exactly."})}),{description:"Services contributing active leaf-span time to this range, with weighted shares for the range duration."}),spanIds:t.Array(t.String(),{description:"Leaf span IDs that produced this range. Tsuga returns IDs from the leaf-only attribution set, including merged sub-ranges after short-range collapsing."})}),T3=t.Object({serviceKey:t.String({description:"Contributing service key for this aggregate total. References `services[].key` in the same response."}),durationNs:t.String({description:"Total wall-clock contribution of this service across the trace, in nanoseconds. Sum of `weight * durationNs` over every range the service contributes to; authoritative when it disagrees with rounded per-range values. Transmitted as a string to avoid losing precision."}),share:t.Number({description:"Share of total trace duration attributed to this service, from `0` through `1`. Computed as `durationNs / totalDurationNs`; multiply by 100 for a percentage."})}),xf=t.Optional(t.Number({minimum:0,description:"Minimum range duration in milliseconds. Shorter ranges are collapsed (absorbed into a neighbor or blended with adjacent shorts) to keep the timeline readable. When omitted, the default depends on the trace: max(1ms, 1% of the total trace duration), so e.g. a 10s trace collapses ranges shorter than 100ms. Pass 0 to disable collapsing."})),Rf=t.Optional(t.Boolean({default:!0,description:"When false, omits the per-range timeline (returns `ranges: []`) and returns only `services` and `serviceTotals`. Cuts payload size for callers that only need the headline. Defaults to true."})),vp=t.Object({traceId:t.String({description:"Trace ID summarized by the response. Echoes the required `traceId` query parameter."}),startTimeNs:t.String({description:"Earliest `start_time` across fetched spans, in nanoseconds since Unix epoch. If the request window does not cover the full trace, this reflects the fetched subset, not necessarily the trace's true start. Transmitted as a string to avoid losing precision."}),endTimeNs:t.String({description:"Latest `end_time` across fetched spans, in nanoseconds since Unix epoch. If the request window does not cover the full trace, this reflects the fetched subset, not necessarily the trace's true end. Transmitted as a string to avoid losing precision."}),totalDurationNs:t.String({description:"Total fetched trace duration in nanoseconds, computed as `endTimeNs - startTimeNs`. Transmitted as a string to avoid losing precision."}),truncated:t.Boolean({description:"Whether the underlying span fetch hit its result cap. When true, the latency summary may be incomplete because not every span in the trace was available."}),services:t.Array(y3,{description:"Unique services that contributed leaf-span time to the trace, enriched with catalog IDs when Tsuga can resolve them. Referenced by `serviceKey` from `ranges` and `serviceTotals`."}),ranges:t.Array(h3,{description:"Sequential trace timeline split into ranges wherever the active leaf-span set changes. Empty when the request sets `includeRanges` to false."}),serviceTotals:t.Array(T3,{description:"Aggregated wall-clock contribution per service across the fetched trace. Use this for service-level latency ownership without processing the per-range timeline."})}),E3={traceId:"78c99c5bb1e4a30297fa134b9dbec64f",startTimeNs:"1704067200000000000",endTimeNs:"1704067202400000000",totalDurationNs:"2400000000",truncated:!1,services:[{key:"checkout|prod",name:"checkout",env:"prod",id:"123-456-abc",namespace:"default"},{key:"payments|prod",name:"payments",env:"prod",id:"456-789-def",namespace:"default"}],ranges:[{fromNs:"1704067200000000000",toNs:"1704067201200000000",durationNs:"1200000000",contributions:[{serviceKey:"checkout|prod",weight:1,durationNs:"1200000000"}],spanIds:["3df8cc3449378f66"]},{fromNs:"1704067201200000000",toNs:"1704067202400000000",durationNs:"1200000000",contributions:[{serviceKey:"checkout|prod",weight:.5,durationNs:"600000000"},{serviceKey:"payments|prod",weight:.5,durationNs:"600000000"}],spanIds:["187a47da1b2560f8","3df8cc3449378f66"]}],serviceTotals:[{serviceKey:"checkout|prod",durationNs:"1800000000",share:.75},{serviceKey:"payments|prod",durationNs:"600000000",share:.25}]};Object.assign(vp,{examples:[E3]});var M8e=d({tags:["traces"],url:`${Si}/latency-summary`,method:"GET",query:t.Object({...He.properties,traceId:p({allowEmpty:!1,description:"Trace ID to summarize"}),clusterId:t.Optional(p({allowEmpty:!1,description:"Cluster ID"})),minRangeDurationMs:xf,includeRanges:Rf}),response:vp}),Dw=t.Object({filter:p({type:"tsuga-query",description:"TQL filter defining the group"}),timeRange:jo}),_3=t.Object({attr:t.String(),value:t.String()}),I3=t.Object({value:t.String(),supportA:t.Number(),supportB:t.Number()}),b3=t.Object({predicate:_3,supportA:t.Number(),supportB:t.Number(),lift:t.Number(),pValue:t.Number(),attrValues:t.Array(I3)}),D8e=d({tags:["traces"],url:`${Si}/contrast-sets`,method:"POST",body:t.Object({groupA:Dw,groupB:Dw,candidateAttrs:t.Optional(t.Array(p({allowEmpty:!1}))),topK:t.Optional(t.Integer({minimum:1,maximum:100})),minLift:t.Optional(t.Number({minimum:1})),minSupport:t.Optional(t.Number({minimum:0,maximum:100})),clusterId:t.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:t.Object({contrastSets:t.Array(b3),groupACount:t.Number(),groupBCount:t.Number()})});var Cf=`/${"v1"}/traces`,Pf=t.Object({context:t.Optional(t.Object({service:t.Optional(t.Object({name:t.Optional(t.String({description:"Service name associated with the span."})),version:t.Optional(t.String({description:"Service version associated with the span."}))},{additionalProperties:!0,description:"Service identity associated with the span, from OpenTelemetry service resource attributes."}))},{additionalProperties:!0,description:"OpenTelemetry resource context resolved for the span, holding the identity of the emitting service."})),parentSpanId:t.Optional(t.String({description:"`spanId` of this span's parent within the same trace. Absent for the root span."})),resourceAttributes:t.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:t.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:t.Number({description:"Span duration in milliseconds, derived from the nanosecond `startTime` and `endTime` values."}),startTime:t.String({description:"Span start time as a Unix epoch timestamp in nanoseconds, encoded as a string to preserve precision."}),endTime:t.String({description:"Span end time as a Unix epoch timestamp in nanoseconds, encoded as a string to preserve precision."}),error:t.Optional(t.Object({message:t.String({description:"Error message associated with the span."})},{description:"Error details associated with the span, separate from the OpenTelemetry `statusCode` field."})),events:t.Optional(t.Array(t.Object({event_attributes:t.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:t.String({description:"Name of the span event."}),event_timestamp_nanos:t.String({description:"Event timestamp in nanoseconds, transmitted as a string for precision."})},{description:"A single timestamped event recorded on the span, with its name and attributes."}),{description:"Events recorded on the span."})),spanId:t.String({description:"Unique span ID within the trace."}),span:t.Object({kind:t.String({description:"OpenTelemetry span kind describing the relationship to remote calls: `unspecified`, `internal`, `server`, `client`, `producer`, or `consumer`."}),name:t.String({description:"Operation name recorded on the span."})},{description:"Operation identity for the span, combining the recorded operation name and the OpenTelemetry span kind."}),statusCode:t.Optional(t.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:t.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."}),S3={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(Pf,{examples:[S3]});var O3={from:1704067200,to:1704070800,query:"context.service.name:my-service",maxResults:100},jw=t.Object({...ut.properties,query:t.Optional(p({type:"tsuga-query",default:"*",description:"Tsuga query selecting spans to return. Omit to search all spans in the range with `*`."})),maxResults:t.Optional(t.Integer({minimum:1,maximum:1e4,default:$w,description:"Maximum number of spans to return. Defaults to 100. Valid values are 1 through 10000."})),clusterId:t.Optional(p({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(jw,{examples:[O3]});var qw=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:`${Cf}/search`,method:"GET",query:jw,response:t.Object({spans:t.Array(Pf,{description:"Spans matching the query and time range."})})}),A3={from:1704067200,to:1704070800,traceId:"78c99c5bb1e4a30297fa134b9dbec64f"},Bw=t.Object({...ut.properties,traceId:p({allowEmpty:!1,description:"Trace ID to summarize. Use the `traceId` returned by span search, the trace details page, or your tracing instrumentation. Required; the requested time range must include the trace."}),clusterId:t.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."})),groupByAttributes:t.Optional(t.Array(p({allowEmpty:!1}),{description:"Glob patterns of span attribute keys to use as additional grouping dimensions. Use this when spans should be summarized separately for matching attributes, such as `db.*`. Matches flattened dotted span attribute keys; omitted by default."})),minLeafSpansToAggregate:t.Optional(t.Integer({minimum:2,default:5,description:"Minimum number of similar leaf spans in a group before Tsuga replaces them with one synthetic summary span. Use higher values for less aggressive summarization. Optional; defaults to 5 and must be at least 2."})),maxParentDepth:t.Optional(t.Integer({minimum:-1,default:-1,description:"Maximum depth of recursive parent aggregation after leaf spans are summarized. Use this to limit parent-level aggregation. Use `0` to aggregate leaf spans only or `-1` for unlimited depth; defaults to `-1`."})),aggregationHistogramBucketsSeconds:t.Optional(t.Array(t.Number({minimum:0}),{description:"Upper-bound bucket values, in seconds, for the latency histogram recorded on synthetic summary spans. Provide custom buckets when the default latency buckets are not suitable. Pass an empty array to omit histogram attributes; omitted values use Tsuga defaults from 5 ms through 10 s."})),sortSpans:t.Optional(t.Boolean({default:!0,description:"Whether Tsuga sorts returned spans by start time, using span ID as the tie-breaker for identical start times. Defaults to `true`; set to `false` only when reconstructing the trace tree yourself, in which case summary spans are appended after surviving spans."}))},{description:"Trace summarization query. Provide a trace ID, a time range covering the trace, and optional aggregation tuning."});Object.assign(Bw,{examples:[A3]});var Fw=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:`${Cf}/summarize`,method:"GET",query:Bw,response:t.Object({spans:t.Array(Pf,{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`."})})}),x3={from:1704067200,to:1704070800,traceId:"78c99c5bb1e4a30297fa134b9dbec64f"},Hw=t.Object({...ut.properties,traceId:p({allowEmpty:!1,description:"Trace ID to summarize. Use the `traceId` returned by span search, the trace details page, or your tracing instrumentation. Required; the requested time range must include the trace."}),clusterId:t.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."})),minRangeDurationMs:xf,includeRanges:Rf},{description:"Trace latency summary query. Provide a trace ID, a time range covering the trace, and optional timeline tuning."});Object.assign(Hw,{examples:[x3]});var Kw=d({description:"Summarizes where wall-clock time is spent in a trace, attributing each slice of the trace timeline to the services with active leaf spans. Returns per-service totals and an optional sequential range timeline. See [Traces](/documentation/explore/traces).",operationId:"getTraceLatencySummary",tags:["public","traces"],url:`${Cf}/latency-summary`,method:"GET",query:Hw,response:vp});var Vw=["timestamp","level","message"],Qw=["count","ratio","team","level","pattern"];function nt(e,r){let n=r??hr(e);if(!n)throw new Error(`--${e} is required`);return $s(n)}function zw(e){let r={from:nt("from",e.from),to:nt("to",e.to)},n=e.query??hr("query");n!==void 0&&(r.query=n);let o=e.maxResults??hr("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})`);r.maxResults=i}return r}function Ee(e){let r=hr(e);return r===void 0?"":` (default: ${r})`}function R3(e){let r=iu(e.output),n=e.fields===void 0?void 0:au(e.fields);return r==="json"?{format:r,fields:n}:{format:r,fields:n??Vw}}function C3(e){let r=iu(e.output),n=e.fields===void 0?void 0:au(e.fields);return r==="json"?{format:r,fields:n}:{format:r,fields:n??Qw}}function Yw(e,r){let n={count:e.size,ratio:r>0?e.size/r: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 P3(e,r){if(r.format==="json"){if(r.fields===void 0){W(e);return}let{fields:i}=r;W({patterns:e.patterns.map(a=>Yw(a,e.sampleSize)).map(a=>su(a,i)),sampleSize:e.sampleSize});return}let n=e.patterns.map(i=>Yw(i,e.sampleSize)),o=cu(r.format,n,r.fields);o.length>0&&B(o)}function U3(e,r){if(r.format==="json"){if(r.fields===void 0){W(e);return}let{fields:o}=r;W({logs:e.logs.map(i=>su(i,o))});return}let n=cu(r.format,e.logs,r.fields);n.length>0&&B(n)}function Ww(e,r){let n=e.command("logs").description("Search and analyze logs");n.command("search").description("Search logs").option("--from <timestamp>",`Start of time range${Ee("from")}`).option("--to <timestamp>",`End of time range${Ee("to")}`).option("--query <query>",`Search query${Ee("query")}`).option("--max-results <n>",`Maximum number of results${Ee("max-results")}`).option("--fields <fields>",`Comma-separated dot-paths to project from each log (default for --output=tsv|csv: ${Vw.join(",")})`).option("-o, --output <format>","Output format: json | tsv | csv","json").action(async c=>{let m=R3(c),l=await r()(Sw,{query:zw(c)});U3(l,m)}),n.command("attributes").description("List log attribute dot-paths observed in the time range").option("--from <timestamp>",`Start of time range${Ee("from")}`).option("--to <timestamp>",`End of time range${Ee("to")}`).action(async c=>{let m=await r()(ww,{query:{from:nt("from",c.from),to:nt("to",c.to)}});W(m)}),n.command("patterns").description("List log patterns").option("--from <timestamp>",`Start of time range${Ee("from")}`).option("--to <timestamp>",`End of time range${Ee("to")}`).option("--query <query>",`Search query${Ee("query")}`).option("--fields <fields>",`Comma-separated dot-paths to project from each pattern (default for --output=tsv|csv: ${Qw.join(",")})`).option("-o, --output <format>","Output format: json | tsv | csv","json").action(async c=>{let m=C3(c),l={from:nt("from",c.from),to:nt("to",c.to)},f=c.query??hr("query");f!==void 0&&(l.query=f);let y=await r()(Aw,{query:l});P3(y,m)}),n.command("new-error-patterns").description("List new error patterns").option("--from <timestamp>",`Start of time range${Ee("from")}`).option("--to <timestamp>",`End of time range${Ee("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:nt("from",c.from),to:nt("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 r()(Rw,{query:m});W(l)}),n.command("error-pattern-increases").description("List error pattern increases for a given team").option("--from <timestamp>",`Start of time range${Ee("from")}`).option("--to <timestamp>",`End of time range${Ee("to")}`).requiredOption("--team <team>","Team to query").option("--env <env>","Filter by environment").action(async c=>{let m={from:nt("from",c.from),to:nt("to",c.to),team:c.team};c.env!==void 0&&(m.env=c.env);let l=await r()(Pw,{query:m});W(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${Ee("from")}`).option("--to <timestamp>",`End of time range${Ee("to")}`).action(async c=>{let m=await r()(Lw,{query:{from:nt("from",c.from),to:nt("to",c.to)}});W(m)}),o.command("get <name>").description("Retrieve a metric by name with its metadata").option("--from <timestamp>",`Start of time range${Ee("from")}`).option("--to <timestamp>",`End of time range${Ee("to")}`).action(async(c,m)=>{let l=await r()(vw,{params:{name:c},query:{from:nt("from",m.from),to:nt("to",m.to)}});W(l)}),o.command("assets-usage <name>").description("List dashboards and monitors that use a specific metric").action(async c=>{let m=await r()(Mw,{query:{metricName:c}});W(m)});let i=e.command("traces").description("Search traces");i.command("search").description("Search spans").option("--from <timestamp>",`Start of time range${Ee("from")}`).option("--to <timestamp>",`End of time range${Ee("to")}`).option("--query <query>",`Search query${Ee("query")}`).option("--max-results <n>",`Maximum number of results${Ee("max-results")}`).action(async c=>{let m=await r()(qw,{query:zw(c)});W(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${Ee("from")}`).option("--to <timestamp>",`End of time range${Ee("to")}`).action(async c=>{let m=await r()(Fw,{query:{traceId:c.traceId,from:nt("from",c.from),to:nt("to",c.to)}});W(m)}),i.command("latency-summary").description("Summarize where wall-clock time is spent in a trace, attributed per service").requiredOption("--trace-id <id>","Trace ID to summarize").option("--from <timestamp>",`Start of time range${Ee("from")}`).option("--to <timestamp>",`End of time range${Ee("to")}`).option("--min-range-duration-ms <n>","Collapse timeline ranges shorter than this (default: max(1ms, 1% of trace duration); 0 disables collapsing)").option("--no-ranges","Omit the per-range timeline; return only services and serviceTotals").action(async c=>{let m={traceId:c.traceId,from:nt("from",c.from),to:nt("to",c.to)};if(c.minRangeDurationMs!==void 0){let f=Number(c.minRangeDurationMs);if(Number.isNaN(f))throw new Error(`--min-range-duration-ms must be a number (got: ${c.minRangeDurationMs})`);m.minRangeDurationMs=f}c.ranges||(m.includeRanges=!1);let l=await r()(Kw,{query:m});W(l)});let a=e.command("aggregation").description("Run aggregation queries");Wn(a,"scalar","Run aggregation queries and return scalar results",HS,r),Wn(a,"timeseries","Run aggregation queries and return timeseries results",zS,r)}var w3="x-tsuga-session-id",Uf="x-tsuga-source",wf="x-tsuga-source-version",Nf="x-tsuga-source-commit",Lf="x-tsuga-source-date",vf="x-tsuga-rationale",N3="x-tsuga-dashboard-id",L3="x-tsuga-widget-id",v3="x-request-id",tWe={[w3]:"Session identifier for request correlation",[Uf]:"SDK or client source identifier (e.g., web-frontend, terraform-provider)",[wf]:"SDK version",[Nf]:"SDK commit hash",[Lf]:"SDK commit date",[vf]:"Optional caller-supplied rationale for this request, recorded for telemetry",[N3]:"ID of the dashboard a query is issued from, when the request originates from a dashboard widget",[L3]:"ID of the dashboard widget (graph) a query is issued from, when the request originates from a dashboard widget",[v3]:"Unique identifier for this API request, useful for debugging and support"};var yn=class e extends Error{constructor(n,o,i,a,c){super(n);this.statusCode=o;this.code=i;this.requestId=a;this.details=c;this.name="CliError"}static fromErrorResponse(n,o){return new e(n.message,n.statusCode,n.code,o,n.details)}};function Zw(e){if(e instanceof yn){let r=[`Error: ${e.message}`];return e.code&&r.push(`Code: ${e.code}`),e.statusCode&&r.push(`Status: ${e.statusCode}`),e.requestId&&r.push(`Request ID: ${e.requestId}`),e.details&&r.push(`Details: ${JSON.stringify(e.details,null,2)}`),r.join(`
|
|
164
|
-
`)}return e instanceof Error?`Error: ${e.message}`:String(e)}function
|
|
162
|
+
`:o}var eY={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 tY(e,r,n,o){let i=(0,Si.join)(e,".claude","settings.json");B(`Claude Code \u2192 ${i}`),(0,bf.mkdirSync)((0,Si.dirname)(i),{recursive:!0});let a=Fa(i),c;try{c=JSON.parse(a??"{}")}catch{throw new Error(`${i} is not valid JSON. Fix or remove it before re-running.`)}if(!ro(c))throw new Error(`${i} must contain a JSON object at the top level.`);let m=c.env??{};if(!ro(m))throw new Error(`${i} "env" must be a JSON object.`);let d=o?"1":"0";c.env={...m,...eY,OTEL_EXPORTER_OTLP_ENDPOINT:r,OTEL_LOG_USER_PROMPTS:d,OTEL_LOG_TOOL_DETAILS:d,OTEL_LOG_TOOL_CONTENT:d,OTEL_EXPORTER_OTLP_HEADERS:`Authorization=Bearer ${n}`};let f=Ha(i,a);Ba(i,`${JSON.stringify(c,null,2)}
|
|
163
|
+
`),B(f===void 0?" created":` patched (backup: ${f})`)}function rY(e,r,n){return{environment:"dev",log_user_prompt:n,exporter:{"otlp-http":{endpoint:`${e}/v1/logs`,protocol:"binary",headers:{Authorization:`Bearer ${r}`}}},trace_exporter:{"otlp-http":{endpoint:`${e}/v1/traces`,protocol:"binary",headers:{Authorization:`Bearer ${r}`}}}}}function nY(e,r,n,o){let i=(0,Si.join)(e,".codex"),a=(0,Si.join)(i,"config.toml");B(`Codex \u2192 ${a}`),(0,bf.mkdirSync)(i,{recursive:!0});let c=Fa(a),m=c===void 0?{}:yf(c),d="otel"in m;delete m.otel,m.otel=rY(r,n,o);let f=Ha(a,c);Ba(a,_f(m)),B(f===void 0?" created":d?` replaced existing [otel] tables (backup: ${f})`:` appended (backup: ${f})`)}function vw(){return new nu("--endpoint <url>","OTLP base URL").env("TSUGA_OTLP_ENDPOINT").makeOptionMandatory()}function kw(){return new nu("--ingestion-api-key <key>","Tsuga ingestion API key").env("TSUGA_INGESTION_API_KEY").makeOptionMandatory()}var Mw="Restart your claude / codex session to load the new config.";function Dw(e){let r=e.command("setup").description("Configure local LLM CLIs to ship OTEL telemetry to Tsuga");r.command("claude-code").description("Patch ~/.claude/settings.json with Tsuga OTEL env").addOption(vw()).addOption(kw()).option("--no-include-prompts","Strip user prompts + tool content from telemetry (default: include)").action(n=>{tY((0,If.homedir)(),n.endpoint.replace(/\/+$/,""),n.ingestionApiKey,n.includePrompts),B(Mw)}),r.command("codex").description("Patch ~/.codex/config.toml with Tsuga OTEL settings").addOption(vw()).addOption(kw()).option("--no-include-prompts","Strip user prompts + tool content from telemetry (default: include)").action(n=>{nY((0,If.homedir)(),n.endpoint.replace(/\/+$/,""),n.ingestionApiKey,n.includePrompts),B(Mw)})}var vp="/v0/logs";var Sf=["CRITICAL","ERROR","WARN","NOTICE","INFO","DEBUG","TRACE"];var Ps=0,Of=t.Object({__tsuga_metadata__:t.Object({id:t.String(),source:t.Optional(t.String())},{additionalProperties:!0}),context:t.Optional(t.Object({team:t.Optional(t.String({description:"Team name associated with this log."})),tag_policy_warnings:t.Optional(t.Record(t.String(),t.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:t.Optional(t.Unknown({description:"Log message after ingestion and route processing. It can be any JSON value because processors may map arbitrary data into `message`."})),timestamp:t.Number({description:"Log timestamp as a Unix timestamp in milliseconds."}),level:t.Enum(Sf,{description:"Log severity, normalized from the source severity into one of the fixed Tsuga levels (ordered `CRITICAL` to `TRACE`)."}),[US]:t.Optional(t.String({description:"ID of the cluster this log was read from. Only set when the request spanned several clusters."}))},{additionalProperties:!0}),Gw=100,oY="timestamp",iY=t.Union([t.Literal(oY)]),ao=t.Partial(t.Object({...Ke.properties,query:p({type:"tsuga-query",description:"Tsuga query used to filter logs in the selected time range."}),maxResults:t.Integer({minimum:1,maximum:1e3,description:"Maximum number of logs to return. Valid values are 1 through 1000."}),shouldRecommendAttributes:t.Boolean({description:"Whether Tsuga should return suggested attributes to highlight in results."}),triggeredBy:t.Literal("refresh",{description:"Indicates the query was triggered by a refresh action."}),startOffset:t.Number({minimum:Ps,description:"Result offset used when fetching additional log rows."}),startOffsets:t.Array(t.Number({minimum:Ps}),{description:`Result offsets used when fetching additional log rows, one per entry of \`clusterIds\` and in the same order. Echo back each cluster's \`nextStartOffset\` from the previous response. Must have the same length as \`clusterIds\`. Defaults to ${Ps} for every cluster.`}),clusterId:p({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}),clusterIds:_a,sortBy:iY,sortDirection:t.Union([t.Literal("asc"),t.Literal("desc")],{description:"Timestamp sort direction for log results."})})),C8e=l({tags:["logs"],url:`${vp}/count`,method:"GET",query:t.Pick(ao,["from","to","query","clusterId","clusterIds"]),response:t.Object({count:t.Number(),clusterResponses:t.Optional(jo())})}),Us=t.Object({value:t.String(),priority:t.Number()}),P8e=l({tags:["logs"],url:`${vp}/search`,method:"GET",query:ao,response:t.Object({logs:t.Optional(t.Array(Of)),attributesToHighlight:t.Optional(t.Array(Us)),clusterResponses:t.Optional(jo(t.Object({nextStartOffset:t.Number({description:"Number of logs consumed on this cluster so far. Echo it back at this cluster's position in `startOffsets` to fetch the next page."})})))},{additionalProperties:!0})}),aY=t.Cyclic({TokenOutput:t.Union([t.Object({type:t.Literal("top"),values:t.Array(t.String())}),t.Object({type:t.Literal("ip"),value:t.String()}),t.Object({type:t.Literal("range"),min:t.Number(),max:t.Number()}),t.Object({type:t.Literal("variable"),value:t.String()}),t.Object({type:t.Literal("text"),value:t.String()}),t.Object({type:t.Literal("date"),value:t.String()}),t.Object({type:t.Literal("url"),value:t.String()}),t.Object({type:t.Literal("structure"),key:t.Array(t.String()),value:t.Array(t.Ref("TokenOutput"))})])},"TokenOutput",{description:"A token identified as part of the pattern"}),sY=t.Object({id:t.String(),pattern:t.Array(aY),size:t.Integer({description:"Number of logs that matched the pattern"}),examples:t.Array(t.Object({id:t.String(),timestampUnix:t.Number()})),timeDistribution:t.Array(t.Number()),staticFeatures:t.Array(t.Object({key:t.String(),value:t.String()},{description:"Fixed groups present in all logs matching the pattern"}))}),U8e=l({tags:["logs"],url:`${vp}/patterns`,method:"GET",query:t.Object({...Ke.properties,query:p({type:"tsuga-query"}),clusteringThreshold:t.Optional(t.Number()),clusterId:t.Optional(p({allowEmpty:!1}))}),response:t.Object({patterns:t.Array(sY),sampleSize:t.Number()})}),w8e=l({tags:["logs"],url:`${vp}/attributes`,method:"GET",query:t.Object({...Ke.properties,clusterId:t.Optional(p({allowEmpty:!1,description:"Cluster ID"})),clusterIds:t.Optional(_a)}),response:t.Object({attributes:t.Array(t.String()),clusterResponses:t.Optional(jo())})});var ws=`/${"v1"}/logs`,Af=t.Object({context:t.Optional(t.Object({team:t.Optional(t.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."})),...t.Pick(Of,["message","timestamp","level"]).properties},{additionalProperties:!0,$id:"LogEvent",description:"Log event including message, timestamp, severity level, and optional enriched context attributes."}),cY={context:{team:"platform"},message:"Request completed successfully",timestamp:17040672e5,level:"INFO"};Object.assign(Af,{examples:[cY]});var $w=t.Object({query:t.Optional(p({type:"tsuga-query",default:"*",description:"Tsuga query selecting logs to return. Omit to search all logs with `*`."})),maxResults:t.Optional(t.Integer({minimum:1,maximum:1e3,default:Gw,description:"Maximum number of logs to return. Defaults to 100. Valid values are 1 through 1000."})),clusterId:t.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."})),...mt.properties},{description:"Log search query. Provide a time range, optional Tsuga query, and optional limit."}),pY={query:"level:ERROR",maxResults:100,from:1704067200,to:1704070800};Object.assign($w,{examples:[pY]});var jw=l({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:`${ws}/search`,method:"GET",query:$w,response:t.Object({logs:t.Array(Af,{description:"Log events matching the query and time range."})})}),uY=t.Object({pattern:t.String({description:"Clustered log pattern formatted as a readable string."}),size:t.Integer({description:"Number of logs that matched the pattern"}),groups:t.Array(t.Object({key:t.String({description:"Attribute dot-path shared by all logs in the pattern."}),value:t.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`."}))}),qw=t.Object({patterns:t.Array(uY,{description:"Log patterns clustered from logs matching the query."}),sampleSize:t.Number({description:"Number of logs sampled while computing patterns."})},{}),mY={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(qw,{examples:[mY]});var Bw=l({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:`${ws}/patterns`,method:"GET",query:t.Object({...mt.properties,query:p({type:"tsuga-query",description:"Tsuga query selecting logs to cluster into patterns."}),clusterId:t.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))}),response:qw}),lY=t.Object({exampleLog:t.Optional(Af),team:t.String({description:"Team associated with the new error pattern."}),env:t.String({description:"Environment associated with the new error pattern."}),service:t.String({description:"Service associated with the new error pattern."}),firstSeen:t.Number({description:"Unix timestamp in seconds when this pattern was first seen."}),lastSeen:t.Number({description:"Unix timestamp in seconds when this pattern was last seen."})}),Fw=t.Object({newErrorPatterns:t.Array(lY,{description:"Error patterns first seen in the requested time range."})},{}),dY={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(Fw,{examples:[dY]});var Hw=l({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:`${ws}/patterns/new`,method:"GET",query:t.Object({...mt.properties,team:t.Optional(p({description:"Team name to restrict pattern detection to."})),env:t.Optional(p({description:"Environment to restrict pattern detection to."})),service:t.Optional(p({description:"Service name to restrict pattern detection to."})),clusterId:t.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))}),response:Fw}),fY=t.Object({team:t.String({description:"Team associated with the error pattern."}),env:t.String({description:"Environment associated with the error pattern."}),pattern:t.String({description:"Error pattern formatted as a readable string."}),increaseTimestamps:t.Array(t.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."}))}),Kw=t.Object({errorPatternIncreases:t.Array(fY,{description:"Error patterns with increased occurrence in the requested time range."})},{}),gY={errorPatternIncreases:[{team:"platform",env:"production",pattern:"Non-resolved segment SegmentId(*) from cache",increaseTimestamps:[17041536e5,17042392e5]}]};Object.assign(Kw,{examples:[gY]});var zw=l({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:`${ws}/patterns/increase`,method:"GET",query:t.Object({...mt.properties,team:p({description:"Team name to analyze for pattern increases."}),env:t.Optional(p({description:"Environment to restrict the analysis to."})),clusterId:t.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))}),response:Kw}),Yw=t.Object({attributes:t.Array(t.String(),{description:"Log attribute dot-paths observed in the time range"})},{}),yY={attributes:["context.env","context.k8s.pod.name","context.service.name","context.team","level","message","timestamp"]};Object.assign(Yw,{examples:[yY]});var hY=t.Object({...mt.properties,clusterId:t.Optional(p({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."}),Vw=l({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:`${ws}/attributes`,method:"GET",query:hY,response:Yw});var kr="/v0/metrics",TY=t.Object({__tsuga_metadata__:t.Object({},{additionalProperties:!0}),context:t.Optional(t.Object({},{additionalProperties:!0})),message:t.Optional(t.String()),timestamp:t.Number(),level:t.Enum(Sf)},{additionalProperties:!0}),K8e=l({tags:["metrics"],url:`${kr}/count`,method:"GET",query:t.Pick(ao,["from","to","query","clusterId"]),response:t.Object({count:t.Number()})}),z8e=l({tags:["metrics"],url:`${kr}/search`,method:"GET",query:ao,response:t.Object({logs:t.Optional(t.Array(TY)),totalHits:t.Optional(t.Number()),attributesToHighlight:t.Optional(t.Array(Us))},{additionalProperties:!0})}),kp=t.Enum(["counter","gauge","histogram","summary","composite_histogram"],{description:"Metric instrument type, set by the reporting instrumentation. `counter` accumulates a monotonically increasing total (aggregate with `sum` or `increase`); `gauge` reports a point-in-time value that can go up or down (aggregate with `average`, `max`, `min`, or `last`); `histogram`, `composite_histogram`, and `summary` report a distribution of values, from which percentiles can be computed. Tsuga displays `composite_histogram` metrics as Histogram in the app."}),xf=t.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."}),EY=t.Object({capabilities:t.Optional(t.Array(t.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:t.Optional(t.String({description:"Human-readable description of the metric"})),tags:t.Optional(t.Array(t.String(),{description:"Attribute names available as dimensions for filtering or grouping this metric. Exposed publicly as `attributes`."})),temporality:t.Optional(xf),type:t.Optional(kp),unit:t.Optional(t.String({description:"Metric unit reported by instrumentation or inferred metadata."}))}),Y8e=l({url:`${kr}/metadata`,method:"GET",query:t.Object({...Ke.properties,metricName:p({allowEmpty:!1}),clusterId:t.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:EY}),V8e=l({tags:["metrics"],url:kr,method:"GET",query:t.Object({...Ke.properties,clusterId:t.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:t.Array(t.String())}),Mp=t.Array(t.Object({name:t.String({description:"Metric name observed by Tsuga."}),type:kp}),{description:"Metrics observed in the requested time range, with the instrument type each was reported as."}),_Y=[{name:"http.server.request.duration",type:"histogram"},{name:"http.server.active_requests",type:"gauge"},{name:"http.server.request.count",type:"counter"}];Object.assign(Mp,{examples:[_Y]});var Q8e=l({tags:["metrics"],url:`${kr}/names-and-types`,method:"GET",query:t.Object({...Ke.properties,clusterId:t.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:Mp}),Ns=t.Array(t.String(),{description:"Attribute names available as dimensions for filtering or grouping the requested metric(s)."}),IY=["service","env","host","method","status_code"];Object.assign(Ns,{examples:[IY]});var W8e=l({tags:["metrics"],url:`${kr}/attributes`,method:"GET",query:t.Object({...Ke.properties,metricName:p({allowEmpty:!1}),clusterId:t.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:Ns}),Z8e=l({tags:["metrics"],url:`${kr}/attributes/batch`,method:"GET",query:t.Object({...Ke.properties,metricNames:t.Array(p({allowEmpty:!1}),{minItems:1,description:"Metric names to fetch attributes for"}),clusterId:t.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:Ns}),Rf=t.Object({assets:t.Array(t.Object({type:t.Enum(["dashboard","monitor"],{description:"Kind of asset referencing the metric."}),id:t.String({description:"Dashboard or monitor ID for the asset that queries this metric."}),name:t.String({description:"Display name of the referencing dashboard or monitor."}),owner:t.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."})}),X8e=l({tags:["metrics"],url:`${kr}/assets-usage`,method:"GET",query:t.Object({metricName:p({allowEmpty:!1})}),response:Rf}),J8e=l({url:`${kr}/per-attribute`,method:"GET",query:t.Object({from:t.Optional(t.Number()),to:t.Optional(t.Number()),attribute:p(),clusterId:t.Optional(p({allowEmpty:!1}))}),response:t.Array(t.String())});var Cf=`/${"v1"}/metrics`,bY=[{name:"http.server.request.duration",type:"histogram"},{name:"http.server.active_requests",type:"gauge"},{name:"http.server.request.count",type:"counter"}];Object.assign(Mp,{examples:[bY]});var Pf=t.Object({name:t.String({description:"Metric name observed by Tsuga. Use this value in metric queries and aggregations."}),type:kp,description:t.Optional(t.String({description:"Human-readable description of what the metric measures, set by the reporting instrumentation. Omitted when the instrumentation did not provide one."})),unit:t.Optional(t.String({description:"Metric unit reported by instrumentation or inferred metadata."})),temporality:t.Optional(xf),capabilities:t.Optional(t.Array(t.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:t.Optional(t.Array(t.String(),{description:"Metric attribute names available as dimensions for filtering or grouping."}))}),SY={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(Pf,{examples:[SY]});var Qw=t.Object({...mt.properties,clusterId:t.Optional(p({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."}),Ww=l({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:Cf,method:"GET",query:Qw,response:t.Array(Pf)}),Zw=l({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:`${Cf}/:name`,method:"GET",params:t.Object({name:p({allowEmpty:!1,description:"Metric name to retrieve, for example `http.server.request.duration`."})}),query:Qw,response:Pf}),OY=["service","env","host","method","status_code"];Object.assign(Ns,{examples:[OY]});var Xw=t.Pick(Rf,["assets"]),AY={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(Xw,{examples:[AY]});var Jw=l({description:"Retrieve dashboards and monitors that use a specific metric",operationId:"getMetricAssetsUsage",tags:["private"],url:`${Cf}/assets-usage`,method:"GET",query:t.Object({metricName:p({allowEmpty:!1,description:"The name of the metric to find usage for"})}),response:Xw});var Oi="/v0/traces",dWe=l({tags:["traces"],url:`${Oi}/count`,method:"GET",query:t.Pick(ao,["from","to","query","clusterId"]),response:t.Object({count:t.Number()})}),xY=["unset","ok","error"],RY=t.Enum(xY),CY=["unspecified","internal","server","client","producer","consumer"],PY=t.Enum(CY),tN=t.Object({__tsuga_metadata__:t.Optional(t.Object({},{additionalProperties:!0})),context:t.Optional(t.Object({telemetry:t.Optional(t.Object({sdk:t.Optional(t.Object({language:t.Optional(t.String())},{additionalProperties:!0}))},{additionalProperties:!0})),tag_policy_warnings:t.Optional(t.Record(t.String(),t.String())),service:t.Optional(t.Object({name:t.Optional(t.String()),version:t.Optional(t.String())},{additionalProperties:!0})),env:t.Optional(t.String())},{additionalProperties:!0})),parent_span_id:t.Optional(t.String()),resource_attributes:t.Object({},{additionalProperties:!0}),span_attributes:t.Object({},{additionalProperties:!0}),duration:t.Number({description:"In milliseconds."}),duration_ns:t.String({description:"In nanoseconds. Transmitted as a string to avoid losing precision, as BigInt is not JSON-compatible."}),start_time:t.String({description:"In nanoseconds. Transmitted as a string to avoid losing precision, as BigInt is not JSON-compatible."}),end_time:t.String({description:"In nanoseconds. Transmitted as a string to avoid losing precision, as BigInt is not JSON-compatible."}),error:t.Optional(t.Object({message:t.String()})),events:t.Optional(t.Array(t.Object({event_attributes:t.Object({},{additionalProperties:!0}),event_name:t.String(),event_timestamp_nanos:t.String({description:"In nanoseconds. Transmitted as a string to avoid losing precision, as BigInt is not JSON-compatible."})}))),links:t.Optional(t.Array(t.Object({},{additionalProperties:!0}))),span_id:t.String(),span:t.Object({kind:PY,name:t.String()}),status_code:t.Optional(RY),trace_id:t.String()}),rN=100,UY="start_time",wY="duration_ns",NY=t.Union([t.Literal(UY),t.Literal(wY)]),LY={...Ke.properties,query:t.Optional(p({type:"tsuga-query"})),maxResults:t.Optional(t.Integer({minimum:1,maximum:1e4})),shouldRecommendAttributes:t.Optional(t.Boolean()),startOffset:t.Optional(t.Number({minimum:Ps})),clusterId:t.Optional(p({allowEmpty:!1,description:"Cluster ID"})),sortBy:t.Optional(NY),sortDirection:t.Optional(t.Union([t.Literal("asc"),t.Literal("desc")]))},fWe=l({tags:["traces"],url:`${Oi}/search`,method:"GET",query:t.Object(LY),response:t.Object({spans:t.Optional(t.Array(tN)),attributesToHighlight:t.Optional(t.Array(Us))})});var vY=t.Object({groupByAttributes:t.Array(p({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:t.Integer({minimum:2,description:"Minimum leaf-group size before aggregation occurs. Default 5."}),maxParentDepth:t.Integer({minimum:-1,description:"Max depth of recursive parent aggregation. 0 = leaves only, -1 = unlimited (default)."}),aggregationHistogramBucketsSeconds:t.Array(t.Number({minimum:0}),{description:"Upper bounds for the latency histogram in seconds. Empty array disables the histogram attributes."}),sortSpans:t.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."})}),kY=t.Object({...Ke.properties,traceId:p({allowEmpty:!1,description:"Trace ID to summarize"}),clusterId:t.Optional(p({allowEmpty:!1,description:"Cluster ID"})),...t.Partial(vY).properties}),gWe=l({tags:["traces"],url:`${Oi}/summarize`,method:"GET",query:kY,response:t.Object({spans:t.Array(tN)})}),yWe=l({tags:["traces"],url:`${Oi}/attributes`,method:"GET",query:t.Object({...Ke.properties,clusterId:t.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:t.Object({attributes:t.Array(t.String())})}),MY=t.Object({key:t.String({description:"Opaque stable key identifying this contributing service within the response. Tsuga assigns it while building the summary; `ranges[].contributions[].serviceKey` and `serviceTotals[].serviceKey` reference this value."}),name:t.String({description:"Observed service name that contributed leaf-span time to the trace. Comes from trace service context and is returned for every contributing service."}),env:t.Optional(t.String({description:"Observed service environment for this contributing service. Comes from trace service context and is absent when the spans do not carry an environment."})),id:t.Optional(t.String({description:"Service catalog ID for this contributing service. Tsuga sets it when exactly one catalog entry matches the observed service and environment; absent when the service is not cataloged or matches ambiguously."})),namespace:t.Optional(t.String({description:"Service namespace from the matched service catalog entry. Returned only when Tsuga can resolve the contributing service to one catalog entry with a namespace."}))}),DY=t.Object({fromNs:t.String({description:"Range start time in nanoseconds since Unix epoch. Tsuga sets it from the trace timeline split where active leaf spans change. Transmitted as a string to avoid losing precision."}),toNs:t.String({description:"Range end time in nanoseconds since Unix epoch. Tsuga sets it from the trace timeline split where active leaf spans change. Transmitted as a string to avoid losing precision."}),durationNs:t.String({description:"Range duration in nanoseconds, computed as `toNs - fromNs`. Transmitted as a string to avoid losing precision."}),contributions:t.Array(t.Object({serviceKey:t.String({description:"Contributing service key for this range. References `services[].key` in the same response."}),weight:t.Number({description:"Share of this range attributed to the service, from `0` through `1`. Tsuga computes the weight from active leaf spans in the range; weights inside one range sum to `1`."}),durationNs:t.String({description:"Estimated duration attributed to this service in the range, computed as `weight` times the range's own `durationNs` and rounded to whole nanoseconds. Use `serviceTotals` as authoritative when rounded range values do not add up exactly."})}),{description:"Services contributing active leaf-span time to this range, with weighted shares for the range duration."}),spanIds:t.Array(t.String(),{description:"Leaf span IDs that produced this range. Tsuga returns IDs from the leaf-only attribution set, including merged sub-ranges after short-range collapsing."})}),GY=t.Object({serviceKey:t.String({description:"Contributing service key for this aggregate total. References `services[].key` in the same response."}),durationNs:t.String({description:"Total wall-clock contribution of this service across the trace, in nanoseconds. Sum of `weight * durationNs` over every range the service contributes to; authoritative when it disagrees with rounded per-range values. Transmitted as a string to avoid losing precision."}),share:t.Number({description:"Share of total trace duration attributed to this service, from `0` through `1`. Computed as `durationNs / totalDurationNs`; multiply by 100 for a percentage."})}),Uf=t.Optional(t.Number({minimum:0,description:"Minimum range duration in milliseconds. Shorter ranges are collapsed (absorbed into a neighbor or blended with adjacent shorts) to keep the timeline readable. When omitted, the default depends on the trace: max(1ms, 1% of the total trace duration), so e.g. a 10s trace collapses ranges shorter than 100ms. Pass 0 to disable collapsing."})),wf=t.Optional(t.Boolean({default:!0,description:"When false, omits the per-range timeline (returns `ranges: []`) and returns only `services` and `serviceTotals`. Cuts payload size for callers that only need the headline. Defaults to true."})),Dp=t.Object({traceId:t.String({description:"Trace ID summarized by the response. Echoes the required `traceId` query parameter."}),startTimeNs:t.String({description:"Earliest `start_time` across fetched spans, in nanoseconds since Unix epoch. If the request window does not cover the full trace, this reflects the fetched subset, not necessarily the trace's true start. Transmitted as a string to avoid losing precision."}),endTimeNs:t.String({description:"Latest `end_time` across fetched spans, in nanoseconds since Unix epoch. If the request window does not cover the full trace, this reflects the fetched subset, not necessarily the trace's true end. Transmitted as a string to avoid losing precision."}),totalDurationNs:t.String({description:"Total fetched trace duration in nanoseconds, computed as `endTimeNs - startTimeNs`. Transmitted as a string to avoid losing precision."}),truncated:t.Boolean({description:"Whether the underlying span fetch hit its result cap. When true, the latency summary may be incomplete because not every span in the trace was available."}),services:t.Array(MY,{description:"Unique services that contributed leaf-span time to the trace, enriched with catalog IDs when Tsuga can resolve them. Referenced by `serviceKey` from `ranges` and `serviceTotals`."}),ranges:t.Array(DY,{description:"Sequential trace timeline split into ranges wherever the active leaf-span set changes. Empty when the request sets `includeRanges` to false."}),serviceTotals:t.Array(GY,{description:"Aggregated wall-clock contribution per service across the fetched trace. Use this for service-level latency ownership without processing the per-range timeline."})}),$Y={traceId:"78c99c5bb1e4a30297fa134b9dbec64f",startTimeNs:"1704067200000000000",endTimeNs:"1704067202400000000",totalDurationNs:"2400000000",truncated:!1,services:[{key:"checkout|prod",name:"checkout",env:"prod",id:"123-456-abc",namespace:"default"},{key:"payments|prod",name:"payments",env:"prod",id:"456-789-def",namespace:"default"}],ranges:[{fromNs:"1704067200000000000",toNs:"1704067201200000000",durationNs:"1200000000",contributions:[{serviceKey:"checkout|prod",weight:1,durationNs:"1200000000"}],spanIds:["3df8cc3449378f66"]},{fromNs:"1704067201200000000",toNs:"1704067202400000000",durationNs:"1200000000",contributions:[{serviceKey:"checkout|prod",weight:.5,durationNs:"600000000"},{serviceKey:"payments|prod",weight:.5,durationNs:"600000000"}],spanIds:["187a47da1b2560f8","3df8cc3449378f66"]}],serviceTotals:[{serviceKey:"checkout|prod",durationNs:"1800000000",share:.75},{serviceKey:"payments|prod",durationNs:"600000000",share:.25}]};Object.assign(Dp,{examples:[$Y]});var hWe=l({tags:["traces"],url:`${Oi}/latency-summary`,method:"GET",query:t.Object({...Ke.properties,traceId:p({allowEmpty:!1,description:"Trace ID to summarize"}),clusterId:t.Optional(p({allowEmpty:!1,description:"Cluster ID"})),minRangeDurationMs:Uf,includeRanges:wf}),response:Dp}),eN=t.Object({filter:p({type:"tsuga-query",description:"TQL filter defining the group"}),timeRange:qo}),jY=t.Object({attr:t.String(),value:t.String()}),qY=t.Object({value:t.String(),supportA:t.Number(),supportB:t.Number()}),BY=t.Object({predicate:jY,supportA:t.Number(),supportB:t.Number(),lift:t.Number(),pValue:t.Number(),attrValues:t.Array(qY)}),TWe=l({tags:["traces"],url:`${Oi}/contrast-sets`,method:"POST",body:t.Object({groupA:eN,groupB:eN,candidateAttrs:t.Optional(t.Array(p({allowEmpty:!1}))),topK:t.Optional(t.Integer({minimum:1,maximum:100})),minLift:t.Optional(t.Number({minimum:1})),minSupport:t.Optional(t.Number({minimum:0,maximum:100})),clusterId:t.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:t.Object({contrastSets:t.Array(BY),groupACount:t.Number(),groupBCount:t.Number()})});var Nf=`/${"v1"}/traces`,Lf=t.Object({context:t.Optional(t.Object({service:t.Optional(t.Object({name:t.Optional(t.String({description:"Service name associated with the span."})),version:t.Optional(t.String({description:"Service version associated with the span."}))},{additionalProperties:!0,description:"Service identity associated with the span, from OpenTelemetry service resource attributes."}))},{additionalProperties:!0,description:"OpenTelemetry resource context resolved for the span, holding the identity of the emitting service."})),parentSpanId:t.Optional(t.String({description:"`spanId` of this span's parent within the same trace. Absent for the root span."})),resourceAttributes:t.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:t.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:t.Number({description:"Span duration in milliseconds, derived from the nanosecond `startTime` and `endTime` values."}),startTime:t.String({description:"Span start time as a Unix epoch timestamp in nanoseconds, encoded as a string to preserve precision."}),endTime:t.String({description:"Span end time as a Unix epoch timestamp in nanoseconds, encoded as a string to preserve precision."}),error:t.Optional(t.Object({message:t.String({description:"Error message associated with the span."})},{description:"Error details associated with the span, separate from the OpenTelemetry `statusCode` field."})),events:t.Optional(t.Array(t.Object({event_attributes:t.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:t.String({description:"Name of the span event."}),event_timestamp_nanos:t.String({description:"Event timestamp in nanoseconds, transmitted as a string for precision."})},{description:"A single timestamped event recorded on the span, with its name and attributes."}),{description:"Events recorded on the span."})),spanId:t.String({description:"Unique span ID within the trace."}),span:t.Object({kind:t.String({description:"OpenTelemetry span kind describing the relationship to remote calls: `unspecified`, `internal`, `server`, `client`, `producer`, or `consumer`."}),name:t.String({description:"Operation name recorded on the span."})},{description:"Operation identity for the span, combining the recorded operation name and the OpenTelemetry span kind."}),statusCode:t.Optional(t.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:t.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."}),FY={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(Lf,{examples:[FY]});var HY={from:1704067200,to:1704070800,query:"context.service.name:my-service",maxResults:100},nN=t.Object({...mt.properties,query:t.Optional(p({type:"tsuga-query",default:"*",description:"Tsuga query selecting spans to return. Omit to search all spans in the range with `*`."})),maxResults:t.Optional(t.Integer({minimum:1,maximum:1e4,default:rN,description:"Maximum number of spans to return. Defaults to 100. Valid values are 1 through 10000."})),clusterId:t.Optional(p({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(nN,{examples:[HY]});var oN=l({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:`${Nf}/search`,method:"GET",query:nN,response:t.Object({spans:t.Array(Lf,{description:"Spans matching the query and time range."})})}),KY={from:1704067200,to:1704070800,traceId:"78c99c5bb1e4a30297fa134b9dbec64f"},iN=t.Object({...mt.properties,traceId:p({allowEmpty:!1,description:"Trace ID to summarize. Use the `traceId` returned by span search, the trace details page, or your tracing instrumentation. Required; the requested time range must include the trace."}),clusterId:t.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."})),groupByAttributes:t.Optional(t.Array(p({allowEmpty:!1}),{description:"Glob patterns of span attribute keys to use as additional grouping dimensions. Use this when spans should be summarized separately for matching attributes, such as `db.*`. Matches flattened dotted span attribute keys; omitted by default."})),minLeafSpansToAggregate:t.Optional(t.Integer({minimum:2,default:5,description:"Minimum number of similar leaf spans in a group before Tsuga replaces them with one synthetic summary span. Use higher values for less aggressive summarization. Optional; defaults to 5 and must be at least 2."})),maxParentDepth:t.Optional(t.Integer({minimum:-1,default:-1,description:"Maximum depth of recursive parent aggregation after leaf spans are summarized. Use this to limit parent-level aggregation. Use `0` to aggregate leaf spans only or `-1` for unlimited depth; defaults to `-1`."})),aggregationHistogramBucketsSeconds:t.Optional(t.Array(t.Number({minimum:0}),{description:"Upper-bound bucket values, in seconds, for the latency histogram recorded on synthetic summary spans. Provide custom buckets when the default latency buckets are not suitable. Pass an empty array to omit histogram attributes; omitted values use Tsuga defaults from 5 ms through 10 s."})),sortSpans:t.Optional(t.Boolean({default:!0,description:"Whether Tsuga sorts returned spans by start time, using span ID as the tie-breaker for identical start times. Defaults to `true`; set to `false` only when reconstructing the trace tree yourself, in which case summary spans are appended after surviving spans."}))},{description:"Trace summarization query. Provide a trace ID, a time range covering the trace, and optional aggregation tuning."});Object.assign(iN,{examples:[KY]});var aN=l({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:`${Nf}/summarize`,method:"GET",query:iN,response:t.Object({spans:t.Array(Lf,{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`."})})}),zY={from:1704067200,to:1704070800,traceId:"78c99c5bb1e4a30297fa134b9dbec64f"},sN=t.Object({...mt.properties,traceId:p({allowEmpty:!1,description:"Trace ID to summarize. Use the `traceId` returned by span search, the trace details page, or your tracing instrumentation. Required; the requested time range must include the trace."}),clusterId:t.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."})),minRangeDurationMs:Uf,includeRanges:wf},{description:"Trace latency summary query. Provide a trace ID, a time range covering the trace, and optional timeline tuning."});Object.assign(sN,{examples:[zY]});var cN=l({description:"Summarizes where wall-clock time is spent in a trace, attributing each slice of the trace timeline to the services with active leaf spans. Returns per-service totals and an optional sequential range timeline. See [Traces](/documentation/explore/traces).",operationId:"getTraceLatencySummary",tags:["public","traces"],url:`${Nf}/latency-summary`,method:"GET",query:sN,response:Dp});var mN=["timestamp","level","message"],lN=["count","ratio","team","level","pattern"];function ot(e,r){let n=r??Tr(e);if(!n)throw new Error(`--${e} is required`);return js(n)}function pN(e){let r={from:ot("from",e.from),to:ot("to",e.to)},n=e.query??Tr("query");n!==void 0&&(r.query=n);let o=e.maxResults??Tr("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})`);r.maxResults=i}return r}function Ee(e){let r=Tr(e);return r===void 0?"":` (default: ${r})`}function YY(e){let r=cu(e.output),n=e.fields===void 0?void 0:pu(e.fields);return r==="json"?{format:r,fields:n}:{format:r,fields:n??mN}}function VY(e){let r=cu(e.output),n=e.fields===void 0?void 0:pu(e.fields);return r==="json"?{format:r,fields:n}:{format:r,fields:n??lN}}function uN(e,r){let n={count:e.size,ratio:r>0?e.size/r: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 QY(e,r){if(r.format==="json"){if(r.fields===void 0){Q(e);return}let{fields:i}=r;Q({patterns:e.patterns.map(a=>uN(a,e.sampleSize)).map(a=>uu(a,i)),sampleSize:e.sampleSize});return}let n=e.patterns.map(i=>uN(i,e.sampleSize)),o=mu(r.format,n,r.fields);o.length>0&&B(o)}function WY(e,r){if(r.format==="json"){if(r.fields===void 0){Q(e);return}let{fields:o}=r;Q({logs:e.logs.map(i=>uu(i,o))});return}let n=mu(r.format,e.logs,r.fields);n.length>0&&B(n)}function dN(e,r){let n=e.command("logs").description("Search and analyze logs");n.command("search").description("Search logs").option("--from <timestamp>",`Start of time range${Ee("from")}`).option("--to <timestamp>",`End of time range${Ee("to")}`).option("--query <query>",`Search query${Ee("query")}`).option("--max-results <n>",`Maximum number of results${Ee("max-results")}`).option("--fields <fields>",`Comma-separated dot-paths to project from each log (default for --output=tsv|csv: ${mN.join(",")})`).option("-o, --output <format>","Output format: json | tsv | csv","json").action(async c=>{let m=YY(c),d=await r()(jw,{query:pN(c)});WY(d,m)}),n.command("attributes").description("List log attribute dot-paths observed in the time range").option("--from <timestamp>",`Start of time range${Ee("from")}`).option("--to <timestamp>",`End of time range${Ee("to")}`).action(async c=>{let m=await r()(Vw,{query:{from:ot("from",c.from),to:ot("to",c.to)}});Q(m)}),n.command("patterns").description("List log patterns").option("--from <timestamp>",`Start of time range${Ee("from")}`).option("--to <timestamp>",`End of time range${Ee("to")}`).option("--query <query>",`Search query${Ee("query")}`).option("--fields <fields>",`Comma-separated dot-paths to project from each pattern (default for --output=tsv|csv: ${lN.join(",")})`).option("-o, --output <format>","Output format: json | tsv | csv","json").action(async c=>{let m=VY(c),d={from:ot("from",c.from),to:ot("to",c.to)},f=c.query??Tr("query");f!==void 0&&(d.query=f);let y=await r()(Bw,{query:d});QY(y,m)}),n.command("new-error-patterns").description("List new error patterns").option("--from <timestamp>",`Start of time range${Ee("from")}`).option("--to <timestamp>",`End of time range${Ee("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:ot("from",c.from),to:ot("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 d=await r()(Hw,{query:m});Q(d)}),n.command("error-pattern-increases").description("List error pattern increases for a given team").option("--from <timestamp>",`Start of time range${Ee("from")}`).option("--to <timestamp>",`End of time range${Ee("to")}`).requiredOption("--team <team>","Team to query").option("--env <env>","Filter by environment").action(async c=>{let m={from:ot("from",c.from),to:ot("to",c.to),team:c.team};c.env!==void 0&&(m.env=c.env);let d=await r()(zw,{query:m});Q(d)});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${Ee("from")}`).option("--to <timestamp>",`End of time range${Ee("to")}`).action(async c=>{let m=await r()(Ww,{query:{from:ot("from",c.from),to:ot("to",c.to)}});Q(m)}),o.command("get <name>").description("Retrieve a metric by name with its metadata").option("--from <timestamp>",`Start of time range${Ee("from")}`).option("--to <timestamp>",`End of time range${Ee("to")}`).action(async(c,m)=>{let d=await r()(Zw,{params:{name:c},query:{from:ot("from",m.from),to:ot("to",m.to)}});Q(d)}),o.command("assets-usage <name>").description("List dashboards and monitors that use a specific metric").action(async c=>{let m=await r()(Jw,{query:{metricName:c}});Q(m)});let i=e.command("traces").description("Search traces");i.command("search").description("Search spans").option("--from <timestamp>",`Start of time range${Ee("from")}`).option("--to <timestamp>",`End of time range${Ee("to")}`).option("--query <query>",`Search query${Ee("query")}`).option("--max-results <n>",`Maximum number of results${Ee("max-results")}`).action(async c=>{let m=await r()(oN,{query:pN(c)});Q(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${Ee("from")}`).option("--to <timestamp>",`End of time range${Ee("to")}`).action(async c=>{let m=await r()(aN,{query:{traceId:c.traceId,from:ot("from",c.from),to:ot("to",c.to)}});Q(m)}),i.command("latency-summary").description("Summarize where wall-clock time is spent in a trace, attributed per service").requiredOption("--trace-id <id>","Trace ID to summarize").option("--from <timestamp>",`Start of time range${Ee("from")}`).option("--to <timestamp>",`End of time range${Ee("to")}`).option("--min-range-duration-ms <n>","Collapse timeline ranges shorter than this (default: max(1ms, 1% of trace duration); 0 disables collapsing)").option("--no-ranges","Omit the per-range timeline; return only services and serviceTotals").action(async c=>{let m={traceId:c.traceId,from:ot("from",c.from),to:ot("to",c.to)};if(c.minRangeDurationMs!==void 0){let f=Number(c.minRangeDurationMs);if(Number.isNaN(f))throw new Error(`--min-range-duration-ms must be a number (got: ${c.minRangeDurationMs})`);m.minRangeDurationMs=f}c.ranges||(m.includeRanges=!1);let d=await r()(cN,{query:m});Q(d)});let a=e.command("aggregation").description("Run aggregation queries");Zn(a,"scalar","Run aggregation queries and return scalar results",sO,r),Zn(a,"timeseries","Run aggregation queries and return timeseries results",pO,r)}var ZY="x-tsuga-session-id",vf="x-tsuga-source",kf="x-tsuga-source-version",Mf="x-tsuga-source-commit",Df="x-tsuga-source-date",Gf="x-tsuga-rationale",XY="x-tsuga-dashboard-id",JY="x-tsuga-widget-id",e3="x-request-id",MWe={[ZY]:"Session identifier for request correlation",[vf]:"SDK or client source identifier (e.g., web-frontend, terraform-provider)",[kf]:"SDK version",[Mf]:"SDK commit hash",[Df]:"SDK commit date",[Gf]:"Optional caller-supplied rationale for this request, recorded for telemetry",[XY]:"ID of the dashboard a query is issued from, when the request originates from a dashboard widget",[JY]:"ID of the dashboard widget (graph) a query is issued from, when the request originates from a dashboard widget",[e3]:"Unique identifier for this API request, useful for debugging and support"};var hn=class e extends Error{constructor(n,o,i,a,c){super(n);this.statusCode=o;this.code=i;this.requestId=a;this.details=c;this.name="CliError"}static fromErrorResponse(n,o){return new e(n.message,n.statusCode,n.code,o,n.details)}};function fN(e){if(e instanceof hn){let r=[`Error: ${e.message}`];return e.code&&r.push(`Code: ${e.code}`),e.statusCode&&r.push(`Status: ${e.statusCode}`),e.requestId&&r.push(`Request ID: ${e.requestId}`),e.details&&r.push(`Details: ${JSON.stringify(e.details,null,2)}`),r.join(`
|
|
164
|
+
`)}return e instanceof Error?`Error: ${e.message}`:String(e)}function t3(e){return e.replace(/\s+/g," ").replace(/[^\x20-\x7e\x80-\xff]/g,"").trim()}function gN(e,r,n,o){return async function(a,c={}){let{body:m,params:d,query:f}=c,y;if(a.url!==void 0)y=a.url;else if(a.buildUrl){if(!d)throw new hn("Internal error: params required for this endpoint");y=a.buildUrl(d)}else throw new hn("Internal error: endpoint has neither url nor buildUrl");let E=n===void 0?f:{clusterId:n,...f},A=Pb(`${e}${y}`,E),ye={Accept:"application/json",Authorization:`Bearer ${r}`,[vf]:"cli",[kf]:"1.6.0",[Mf]:"9f4c4635e",[Df]:"2026-08-05T15:31:12.480Z"};m&&(ye["Content-Type"]="application/json");let Ue=o?.(),Dr=Ue?t3(Ue):"";Dr&&(ye[Gf]=Dr);let so=await fetch(A,{method:a.method,headers:ye,body:m?JSON.stringify(m):null}),Tn;try{Tn=await so.json()}catch{throw new hn(so.status===504?"The server timed out (504). Try a smaller time range.":`Server returned a non-JSON response (HTTP ${so.status}).`,so.status)}if(Tn.error)throw hn.fromErrorResponse(Tn.error,Tn.requestId);return Tn.data}}var r3=3e3,n3="https://registry.npmjs.org/@tsuga/cli/latest";function o3(e,r){let n=e.split(".").map(Number),o=r.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 yN(e){try{let r=Vb();if(r&&Date.now()-new Date(r).getTime()<$s)return;let n=await fetch(n3,{signal:AbortSignal.timeout(r3)});if(!n.ok)return;let i=(await n.json()).version;o3(i,e)&&(process.stderr.write(`
|
|
165
165
|
Update available: ${e} \u2192 ${i}
|
|
166
|
-
`),process.stderr.write("Run `tsuga self-update` to update\n")),
|
|
166
|
+
`),process.stderr.write("Run `tsuga self-update` to update\n")),Qb(new Date().toISOString())}catch{}}var We=new Xf().name("tsuga").description("Tsuga CLI - manage resources from the command line").version("1.6.0").option("--operation-api-key <operation-api-key>","Operation API key").option("--cluster <cluster-id>","Target cluster (overrides config and TSUGA_CLUSTER_ID)"),Gp,hN;function Mr(){if(Gp)return Gp;let e=We.opts(),r=Go({operationApiKey:e.operationApiKey,clusterId:e.cluster});Ds(r.credential,new Date)&&(console.error("Your session expired. Run `tsuga auth login` to sign in again."),process.exit(1));let n=$b(r);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)),Gp=gN(r.apiUrl,n,r.clusterId,()=>hN),Gp}Zb(We);SS(We);var i3=new Set(We.commands);Ow(We,Mr);dN(We,Mr);cC(We,Mr);lC(We,Mr);VC(We,Mr);PS(We,Mr);uR(We,Mr);ES(We,Mr);aR(We,Mr);Dw(We);yC(We);xw(We);bS(We);function TN(e){for(let r of e.commands)r.commands.length===0&&r.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.'),TN(r)}for(let e of We.commands)i3.has(e)||TN(e);We.hook("preAction",(e,r)=>{let{rationale:n}=r.opts();hN=n});We.parseAsync().then(()=>yN("1.6.0")).catch(e=>{console.error(fN(e)),process.exitCode=1});
|
|
167
167
|
/**
|
|
168
168
|
* The following is a list of HTTP status codes and their meanings.
|
|
169
169
|
*
|