@tsuga/cli 1.12.0 → 1.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +3 -3
  2. package/dist/cli.js +21 -21
  3. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -24,13 +24,13 @@ Expecting one of '${o.join("', '")}'`);return this._lifeCycleHooks[r]?this._life
24
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.default.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.default.env[r.envVar]):this.emit(`optionEnv:${r.name()}`))}})}_parseOptionsImplied(){let r=new qs(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 l=c.attributeName(),d=this.getOptionValue(l),f=this.options.find(T=>T.negate&&l===T.attributeName()),g=this.options.find(T=>!T.negate&&l===T.attributeName());return f&&(f.presetArg===void 0&&d===!1||f.presetArg!==void 0&&d===f.presetArg)?f:g||c},i=c=>{let l=o(c),d=l.attributeName();return this.getOptionValueSource(d)==="env"?`environment variable '${l.envVar}'`:`option '${l.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(l=>l.long).map(l=>l.long);i=i.concat(c),a=a.parent}while(a&&!a._enablePositionalOptions);n=Yp(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",i=r.length,a=this.parent?` for '${this.name()}'`:"",c=r.join(", "),l=`error: too many arguments${a}. Expected ${n} argument${o} but got ${i}: ${c}.`;this.error(l,{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=Yp(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
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=>js(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)}helpGroup(r){return r===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=r,this)}commandsGroup(r){return r===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=r,this)}optionsGroup(r){return r===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=r,this)}_initOptionGroup(r){this._defaultOptionGroup&&!r.helpGroupHeading&&r.helpGroup(this._defaultOptionGroup)}_initCommandGroup(r){this._defaultCommandGroup&&!r.helpGroup()&&r.helpGroup(this._defaultCommandGroup)}nameFromFilename(r){return this._name=Zt.default.basename(r,Zt.default.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=l=>this._outputConfiguration.writeErr(l),i=this._outputConfiguration.getErrHasColors(),a=this._outputConfiguration.getErrHelpWidth()):(o=l=>this._outputConfiguration.writeOut(l),i=this._outputConfiguration.getOutHasColors(),a=this._outputConfiguration.getOutHelpWidth()),{error:n,write:l=>(i||(l=this._outputConfiguration.stripColor(l)),o(l)),hasColors:i,helpWidth:a}}outputHelp(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===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(r??"-h, --help",n??"display help for command"),(r||n)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(r){return this._helpOption=r,this._initOptionGroup(r),this}help(r){this.outputHelp(r);let n=Number(se.default.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 Gf(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 $f(){if(se.default.env.NO_COLOR||se.default.env.FORCE_COLOR==="0"||se.default.env.FORCE_COLOR==="false")return!1;if(se.default.env.FORCE_COLOR||se.default.env.CLICOLOR_FORCE!==void 0)return!0}var f4=new lo;function Xe(e){throw new Error(`assertUnreachable: ${JSON.stringify(e,null,2)}`)}function Li(e){return`\u2022\u2022\u2022\u2022${e.slice(-4)}`}function Bf(e){return{accessToken:e.accessToken,accessExpiresAt:e.expiresAt.toISOString()}}function Ff(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 Hf(e){if(e)switch(e.kind){case"operation-api-key":return e.token;case"user-session":return e.userAuth.accessToken;default:Xe(e)}}function Fs(e,r){return e?.kind==="user-session"&&new Date(e.userAuth.accessExpiresAt)<=r}var Vp={r:8,g:203,b:0},Qp={r:0,g:130,b:0},Wp=["\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2557 ","\u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557"," \u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551"," \u2588\u2588\u2551 \u255A\u2550\u2550\u2550\u2550\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2551"," \u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2551"," \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D"];function Zp(e,r,n){return Math.round(e+(r-e)*n)}function UN(e,r){let n=Zp(Vp.r,Qp.r,r),o=Zp(Vp.g,Qp.g,r),i=Zp(Vp.b,Qp.b,r);return`\x1B[38;2;${n};${o};${i}m${e}\x1B[0m`}function wN(e){if(!e)return`
27
+ `)}),this}_outputHelpIfRequested(r){let n=this._getHelpOption();n&&r.find(i=>n.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function Gf(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 $f(){if(se.default.env.NO_COLOR||se.default.env.FORCE_COLOR==="0"||se.default.env.FORCE_COLOR==="false")return!1;if(se.default.env.FORCE_COLOR||se.default.env.CLICOLOR_FORCE!==void 0)return!0}var g4=new lo;function Xe(e){throw new Error(`assertUnreachable: ${JSON.stringify(e,null,2)}`)}function Li(e){return`\u2022\u2022\u2022\u2022${e.slice(-4)}`}function Bf(e){return{accessToken:e.accessToken,accessExpiresAt:e.expiresAt.toISOString()}}function Ff(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 Hf(e){if(e)switch(e.kind){case"operation-api-key":return e.token;case"user-session":return e.userAuth.accessToken;default:Xe(e)}}function Fs(e,r){return e?.kind==="user-session"&&new Date(e.userAuth.accessExpiresAt)<=r}var Vp={r:8,g:203,b:0},Qp={r:0,g:130,b:0},Wp=["\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2557 ","\u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557"," \u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551"," \u2588\u2588\u2551 \u255A\u2550\u2550\u2550\u2550\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2551"," \u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2551"," \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D"];function Zp(e,r,n){return Math.round(e+(r-e)*n)}function UN(e,r){let n=Zp(Vp.r,Qp.r,r),o=Zp(Vp.g,Qp.g,r),i=Zp(Vp.b,Qp.b,r);return`\x1B[38;2;${n};${o};${i}m${e}\x1B[0m`}function wN(e){if(!e)return`
28
28
 
29
29
  ${Wp.join(`
30
30
  `)}`;let r=Wp.length-1;return`
31
31
 
32
32
  ${Wp.map((o,i)=>UN(o,r===0?0:i/r)).join(`
33
- `)}`}function Kf(){return wN(process.stdout.isTTY&&!process.env.NO_COLOR)}var $b=require("node:crypto");var vi=require("node:crypto");function NN(e){return(0,vi.createHash)("sha256").update(e).digest("base64url")}function zf(){let e=(0,vi.randomBytes)(32).toString("base64url");return{verifier:e,challenge:NN(e)}}var tg=require("node:child_process"),rg=require("node:http"),cu=require("node:os");var LN={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Xp(e){return e.replace(/[&<>"']/g,r=>LN[r]??r)}var vN=[":root{color-scheme:light dark;--bg:#f9fafb;--card:#fff;--fg:#1f2937;--fg-muted:#6b7280;","--logo-1:#08cb00;--logo-2:#008200;--brand:#08cb00;--bloom:#e5e7eb}","@media(prefers-color-scheme:dark){:root{--bg:#18181b;--card:#202023;--fg:#e4e4e7;","--fg-muted:#a1a1aa;--logo-1:#fff;--logo-2:#fff;--bloom:#52525b}}","*{box-sizing:border-box}","body{margin:0;min-height:100vh;display:flex;align-items:flex-start;justify-content:center;","padding:24px;padding-top:14vh;font-family:Inter,system-ui,-apple-system,'Segoe UI',sans-serif;","color:var(--fg);background-color:var(--bg);background-image:","radial-gradient(72% 78% at 104% 112%,var(--brand) -20%,transparent 64%),","radial-gradient(46% 46% at 94% -4%,var(--brand) -20%,transparent 64%),","radial-gradient(48% 58% at -8% 68%,var(--bloom) -20%,transparent 64%)}","main{display:flex;flex-direction:column;align-items:center;text-align:center;gap:24px;","width:100%;max-width:480px;padding:32px;border-radius:8px;backdrop-filter:blur(8px);","background-color:color-mix(in srgb,var(--card) 55%,transparent);","box-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1)}",".tile{display:flex;padding:6px;border-radius:6px;background-color:var(--card);","box-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1)}",".tile svg{display:block;width:32px;height:32px}",".copy{display:flex;flex-direction:column;gap:8px}","h1{margin:0;font-size:29px;font-weight:600;line-height:1.2}","p{margin:0;font-size:14px;line-height:20px;color:var(--fg-muted)}"].join(""),kN=['<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 111.94 133.41" aria-hidden="true">','<path fill="var(--logo-2)" d="M40.66,54.06c-11.32,8.54-25.39,13.61-40.66,13.61v-23.36c17.9,0,','33.3-10.6,40.29-25.87v28.28c0,2.48.13,4.93.37,7.34Z"/>','<path fill="var(--logo-2)" d="M67.65,103.01v30.4h-23.36v-35.58c-11.87,10.29-27.34,16.54-44.29,','16.54v-23.36c19.33,0,35.76-12.37,41.8-29.63,3.5,16.76,12.87,31.39,25.85,41.63Z"/>','<rect fill="var(--logo-1)" x="44.29" width="23.36" height=".02"/>','<path fill="var(--logo-1)" d="M111.94,67.67c-16.83,0-32.21-6.14-44.05-16.3,2.32,22.28,21.16,',"39.64,44.05,39.64v23.36c-37.36,0-67.65-30.29-67.65-67.65V.02h23.36c0,24.47,19.83,44.29,44.29,",'44.29v23.36Z"/></svg>'].join("");function Jp(e,r){let n=Xp(e);return['<!doctype html><html lang="en"><head><meta charset="utf-8">','<meta name="viewport" content="width=device-width,initial-scale=1">',`<title>${n}</title><style>${vN}</style></head><body><main>`,`<span class="tile">${kN}</span>`,`<div class="copy"><h1>${n}</h1><p>${Xp(r)}</p></div>`,"</main></body></html>"].join("")}var x4=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 M4=60*1e3;var TY=1/1e6,tu=1e3,ru=60*tu,qN=60*ru,Ks=24*qN,EY=7*Ks,_Y=30*Ks;var nu=["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 BN={s:1,m:60,h:3600,d:86400};function Vf(e){for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);if(n<48||n>57)return!1}return!0}function Qf(){return Math.floor(Date.now()/1e3)}function zs(e){if(typeof e=="number")return e;if(e==="now")return Qf();if(e.startsWith("-")&&e.length>=3){let n=e.at(-1),o=n?BN[n]:void 0;if(o){let i=e.slice(1,-1);if(i.length>0&&Vf(i))return Qf()-parseInt(i,10)*o}}if(Vf(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}
33
+ `)}`}function Kf(){return wN(process.stdout.isTTY&&!process.env.NO_COLOR)}var $b=require("node:crypto");var vi=require("node:crypto");function NN(e){return(0,vi.createHash)("sha256").update(e).digest("base64url")}function zf(){let e=(0,vi.randomBytes)(32).toString("base64url");return{verifier:e,challenge:NN(e)}}var tg=require("node:child_process"),rg=require("node:http"),cu=require("node:os");var LN={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Xp(e){return e.replace(/[&<>"']/g,r=>LN[r]??r)}var vN=[":root{color-scheme:light dark;--bg:#f9fafb;--card:#fff;--fg:#1f2937;--fg-muted:#6b7280;","--logo-1:#08cb00;--logo-2:#008200;--brand:#08cb00;--bloom:#e5e7eb}","@media(prefers-color-scheme:dark){:root{--bg:#18181b;--card:#202023;--fg:#e4e4e7;","--fg-muted:#a1a1aa;--logo-1:#fff;--logo-2:#fff;--bloom:#52525b}}","*{box-sizing:border-box}","body{margin:0;min-height:100vh;display:flex;align-items:flex-start;justify-content:center;","padding:24px;padding-top:14vh;font-family:Inter,system-ui,-apple-system,'Segoe UI',sans-serif;","color:var(--fg);background-color:var(--bg);background-image:","radial-gradient(72% 78% at 104% 112%,var(--brand) -20%,transparent 64%),","radial-gradient(46% 46% at 94% -4%,var(--brand) -20%,transparent 64%),","radial-gradient(48% 58% at -8% 68%,var(--bloom) -20%,transparent 64%)}","main{display:flex;flex-direction:column;align-items:center;text-align:center;gap:24px;","width:100%;max-width:480px;padding:32px;border-radius:8px;backdrop-filter:blur(8px);","background-color:color-mix(in srgb,var(--card) 55%,transparent);","box-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1)}",".tile{display:flex;padding:6px;border-radius:6px;background-color:var(--card);","box-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1)}",".tile svg{display:block;width:32px;height:32px}",".copy{display:flex;flex-direction:column;gap:8px}","h1{margin:0;font-size:29px;font-weight:600;line-height:1.2}","p{margin:0;font-size:14px;line-height:20px;color:var(--fg-muted)}"].join(""),kN=['<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 111.94 133.41" aria-hidden="true">','<path fill="var(--logo-2)" d="M40.66,54.06c-11.32,8.54-25.39,13.61-40.66,13.61v-23.36c17.9,0,','33.3-10.6,40.29-25.87v28.28c0,2.48.13,4.93.37,7.34Z"/>','<path fill="var(--logo-2)" d="M67.65,103.01v30.4h-23.36v-35.58c-11.87,10.29-27.34,16.54-44.29,','16.54v-23.36c19.33,0,35.76-12.37,41.8-29.63,3.5,16.76,12.87,31.39,25.85,41.63Z"/>','<rect fill="var(--logo-1)" x="44.29" width="23.36" height=".02"/>','<path fill="var(--logo-1)" d="M111.94,67.67c-16.83,0-32.21-6.14-44.05-16.3,2.32,22.28,21.16,',"39.64,44.05,39.64v23.36c-37.36,0-67.65-30.29-67.65-67.65V.02h23.36c0,24.47,19.83,44.29,44.29,",'44.29v23.36Z"/></svg>'].join("");function Jp(e,r){let n=Xp(e);return['<!doctype html><html lang="en"><head><meta charset="utf-8">','<meta name="viewport" content="width=device-width,initial-scale=1">',`<title>${n}</title><style>${vN}</style></head><body><main>`,`<span class="tile">${kN}</span>`,`<div class="copy"><h1>${n}</h1><p>${Xp(r)}</p></div>`,"</main></body></html>"].join("")}var R4=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 D4=60*1e3;var EY=1/1e6,tu=1e3,ru=60*tu,qN=60*ru,Ks=24*qN,_Y=7*Ks,IY=30*Ks;var nu=["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 BN={s:1,m:60,h:3600,d:86400};function Vf(e){for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);if(n<48||n>57)return!1}return!0}function Qf(){return Math.floor(Date.now()/1e3)}function zs(e){if(typeof e=="number")return e;if(e==="now")return Qf();if(e.startsWith("-")&&e.length>=3){let n=e.at(-1),o=n?BN[n]:void 0;if(o){let i=e.slice(1,-1);if(i.length>0&&Vf(i))return Qf()-parseInt(i,10)*o}}if(Vf(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}
34
34
  `)}function Q(e){B(JSON.stringify(e,null,2))}function Zf(e){process.stderr.write(`${e}
35
35
  `)}var Wf=["json","tsv","csv"];function ou(e){let r=Wf.find(n=>n===e);if(r!==void 0)return r;throw new Error(`--output must be one of: ${Wf.join(", ")} (got: ${e})`)}function iu(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 Xf(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 au(e,r){let n=Object.create(null);for(let o of r){let i=Xf(e,o);if(i===void 0)continue;let a=o.split("."),c=a.pop();if(c===void 0)continue;let l=n;for(let d of a)(typeof l[d]!="object"||l[d]===null)&&(l[d]=Object.create(null)),l=l[d];l[c]=i}return n}function Jf(e){return e==null?null:typeof e=="string"?e:JSON.stringify(e)}var FN={"\\":"\\\\"," ":"\\t","\r":"\\r","\n":"\\n"};function HN(e){let r=Jf(e);return r===null?"":r.replace(/[\\\t\r\n]/g,n=>FN[n]??n)}function KN(e){let r=Jf(e);return r===null?"":/[,"\n\r]/.test(r)?`"${r.replaceAll('"','""')}"`:r}function su(e,r,n){if(r.length===0)return"";let o=e==="csv"?",":" ",i=e==="csv"?KN:HN,a=n.map(l=>i(l)).join(o),c=r.map(l=>n.map(d=>i(Xf(l,d))).join(o));return[a,...c].join(`
36
36
  `)}var ng="/oauth/callback",YN=5*ru,VN=Jp("Login complete","You can close this tab and return to the terminal."),Ys=Jp("Login failed","Return to the terminal for details.");function QN(e){return(0,cu.platform)()==="darwin"?["open",[e]]:(0,cu.platform)()==="win32"?["rundll32",["url.dll,FileProtocolHandler",e]]:["xdg-open",[e]]}function WN(e){let[r,n]=QN(e),o=(0,tg.spawnSync)(r,n,{stdio:"ignore"});return o.error===void 0&&o.status===0}async function ZN(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)."))},YN),c=(l,d,f,g)=>{l.writeHead(d,{"Content-Type":"text/html"}),l.end(f),clearTimeout(a),g()};e.on("request",(l,d)=>{let f=new URL(l.url??"/",n);if(f.pathname!==ng){d.writeHead(404,{"Content-Type":"text/html"}),d.end(Ys);return}let g=f.searchParams.get("error");if(g){let _=f.searchParams.get("error_description")??"";c(d,400,Ys,()=>i(new Error(`Authorization failed: ${g}${_?` (${_})`:""}`)));return}if(f.searchParams.get("state")!==r){c(d,400,Ys,()=>i(new Error("State mismatch on OAuth callback; aborting for safety.")));return}let T=f.searchParams.get("code");if(!T){c(d,400,Ys,()=>i(new Error("OAuth callback did not include an authorization code.")));return}c(d,200,VN,()=>o(T))})})}async function og(e){let r=(0,rg.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}${ng}`;try{let a=e.buildAuthorizeUrl(i);return WN(a)?B("Opening your browser to complete login..."):(B("Visit this URL in your browser to complete login:"),B(` ${a}`)),{code:await ZN(r,e.state,o),redirectUri:i}}finally{r.close()}}var y={};Mt(y,{Assign:()=>XN,Clone:()=>Mi,Create:()=>ev,Discard:()=>tv,Metrics:()=>qt,Update:()=>rv});var qt={assign:0,create:0,clone:0,discard:0,update:0};function XN(e,r){return qt.assign+=1,{...e,...r}}var s={};Mt(s,{Entries:()=>IL,EntriesRegExp:()=>_L,Every:()=>hL,EveryAll:()=>TL,GraphemeCount:()=>fL,HasPropertyKey:()=>EL,IsArray:()=>Sn,IsAsyncIterator:()=>oL,IsBigInt:()=>ki,IsBoolean:()=>lg,IsClassInstance:()=>mL,IsConstructor:()=>iL,IsDeepEqual:()=>mu,IsEqual:()=>ee,IsFunction:()=>mg,IsGreaterEqualThan:()=>fg,IsGreaterThan:()=>pL,IsInteger:()=>uu,IsIterator:()=>aL,IsLessEqualThan:()=>dg,IsLessThan:()=>uL,IsMaxLength:()=>gL,IsMinLength:()=>yL,IsMultipleOf:()=>lL,IsNull:()=>Zs,IsNumber:()=>Xs,IsObject:()=>On,IsObjectNotArray:()=>sL,IsString:()=>Br,IsSymbol:()=>cL,IsUndefined:()=>lu,IsValueLike:()=>dL,Keys:()=>Ws,Symbols:()=>bL,Values:()=>SL});function qr(e,r,n){return e>=r&&e<=n}function ig(e){return qr(e,127462,127487)}function JN(e){return qr(e,65024,65039)}function eL(e){return qr(e,768,879)||qr(e,6832,6911)||qr(e,7616,7679)||qr(e,65056,65071)}function Qs(e){return e>65535?2:1}function ag(e,r){for(;r<e.length;){let n=e.codePointAt(r);if(eL(n)||JN(n))r+=Qs(n);else break}return r}function pu(e,r){let n=e.codePointAt(r),o=r+Qs(n);for(o=ag(e,o);o<e.length-1&&e[o]==="\u200D";){let i=e.codePointAt(o+1);o+=1+Qs(i),o=ag(e,o)}return ig(n)&&o<e.length&&ig(e.codePointAt(o))&&(o+=Qs(e.codePointAt(o))),o}function sg(e){return qr(e,55296,56319)||qr(e,768,879)||e===8205}function cg(e){let r=0,n=0;for(;n<e.length;)n=pu(e,n),r++;return r}function tL(e,r){let n=0,o=0;for(;o<e.length;)if(o=pu(e,o),n++,n>=r)return!0;return!1}function rL(e,r){let n=0,o=0;for(;o<e.length;)if(o=pu(e,o),n++,n>r)return!1;return!0}function pg(e,r){let n=0;for(;n<e.length;){if(sg(e.charCodeAt(n)))return tL(e,r);if(n++,n>=r)return!0}return!1}function ug(e,r){let n=0;for(;n<e.length;){if(sg(e.charCodeAt(n)))return rL(e,r);if(n++,n>r)return!1}return!0}function Sn(e){return Array.isArray(e)}function oL(e){return On(e)&&Symbol.asyncIterator in e}function ki(e){return ee(typeof e,"bigint")}function lg(e){return ee(typeof e,"boolean")}function iL(e){if(lu(e)||!mg(e))return!1;let r=Function.prototype.toString.call(e);return!!(/^class\s/.test(r)||/\[native code\]/.test(r))}function mg(e){return ee(typeof e,"function")}function uu(e){return Number.isInteger(e)}function aL(e){return On(e)&&Symbol.iterator in e}function Zs(e){return ee(e,null)}function Xs(e){return Number.isFinite(e)}function sL(e){return On(e)&&!Sn(e)}function On(e){return ee(typeof e,"object")&&!Zs(e)}function Br(e){return ee(typeof e,"string")}function cL(e){return ee(typeof e,"symbol")}function lu(e){return ee(e,void 0)}function ee(e,r){return e===r}function pL(e,r){return e>r}function uL(e,r){return e<r}function dg(e,r){return e<=r}function fg(e,r){return e>=r}function lL(e,r){if(ki(e)||ki(r))return BigInt(e)%BigInt(r)===0n;let n=1e-10;if(!Xs(e)||uu(e)&&1/r%1===0)return!0;let o=e%r;return Math.min(Math.abs(o),Math.abs(o-r))<n}function mL(e){if(!On(e))return!1;let r=globalThis.Object.getPrototypeOf(e);return Zs(r)?!1:ee(typeof r.constructor,"function")&&!(ee(r.constructor,globalThis.Object)||ee(r.constructor.name,"Object"))}function dL(e){return ki(e)||lg(e)||Zs(e)||Xs(e)||Br(e)||lu(e)}function fL(e){return cg(e)}function gL(e,r){return ug(e,r)}function yL(e,r){return pg(e,r)}function hL(e,r,n){for(let o=r;o<e.length;o++)if(!n(e[o],o))return!1;return!0}function TL(e,r,n){let o=!0;for(let i=r;i<e.length;i++)n(e[i],i)||(o=!1);return o}function EL(e,r){return ee(r,"__proto__")||ee(r,"constructor")?Object.prototype.hasOwnProperty.call(e,r):r in e}function _L(e){return Ws(e).map(r=>[new RegExp(`^${r}$`),e[r]])}function IL(e){return Object.entries(e)}function Ws(e){return Object.getOwnPropertyNames(e)}function bL(e){return Object.getOwnPropertySymbols(e)}function SL(e){return Object.values(e)}function OL(e,r){if(!On(r))return!1;let n=Ws(e);return ee(n.length,Ws(r).length)&&n.every(o=>mu(e[o],r[o]))}function AL(e,r){return Sn(r)&&ee(e.length,r.length)&&e.every((n,o)=>mu(e[o],r[o]))}function mu(e,r){return Sn(e)?AL(e,r):On(e)?OL(e,r):ee(e,r)}var ct={};Mt(ct,{IsBigInt64Array:()=>$L,IsBigUint64Array:()=>jL,IsBoolean:()=>xL,IsDate:()=>BL,IsFloat32Array:()=>DL,IsFloat64Array:()=>GL,IsInt16Array:()=>LL,IsInt32Array:()=>kL,IsInt8Array:()=>UL,IsMap:()=>HL,IsNumber:()=>RL,IsRegExp:()=>qL,IsSet:()=>FL,IsString:()=>CL,IsTypeArray:()=>PL,IsUint16Array:()=>vL,IsUint32Array:()=>ML,IsUint8Array:()=>wL,IsUint8ClampedArray:()=>NL});function xL(e){return e instanceof Boolean}function RL(e){return e instanceof Number}function CL(e){return e instanceof String}function PL(e){return globalThis.ArrayBuffer.isView(e)}function UL(e){return e instanceof globalThis.Int8Array}function wL(e){return e instanceof globalThis.Uint8Array}function NL(e){return e instanceof globalThis.Uint8ClampedArray}function LL(e){return e instanceof globalThis.Int16Array}function vL(e){return e instanceof globalThis.Uint16Array}function kL(e){return e instanceof globalThis.Int32Array}function ML(e){return e instanceof globalThis.Uint32Array}function DL(e){return e instanceof globalThis.Float32Array}function GL(e){return e instanceof globalThis.Float64Array}function $L(e){return e instanceof globalThis.BigInt64Array}function jL(e){return e instanceof globalThis.BigUint64Array}function qL(e){return e instanceof globalThis.RegExp}function BL(e){return e instanceof globalThis.Date}function FL(e){return e instanceof globalThis.Set}function HL(e){return e instanceof globalThis.Map}function zL(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~guard")}function YL(e){return e.map(r=>du(r))}function VL(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:du(i.value)})}return r}function QL(e){return new RegExp(e.source,e.flags)}function du(e){return e instanceof RegExp?QL(e):zL(e)?e:s.IsArray(e)?YL(e):s.IsObject(e)?VL(e):e}function Mi(e){return qt.clone+=1,du(e)}var Pt={};Mt(Pt,{Get:()=>XL,Reset:()=>WL,Set:()=>ZL});var An={immutableTypes:!1,maxErrors:8,useEval:!0,exactOptionalPropertyTypes:!1,enumerableKind:!1};function WL(){An.immutableTypes=!1,An.maxErrors=8,An.useEval=!0,An.exactOptionalPropertyTypes=!1,An.enumerableKind=!1}function ZL(e){for(let r of s.Keys(e)){let n=e[r];n!==void 0&&Object.defineProperty(An,r,{value:n})}}function XL(){return An}function JL(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 gg(e,r){return{...e,...r}}function ev(e,r,n={}){qt.create+=1;let o=Pt.Get(),i=gg(r,n),a=o.enumerableKind?gg(i,e):JL(i,e);return o.immutableTypes?Object.freeze(a):a}function tv(e,r){qt.discard+=1;let n={},o=Object.getOwnPropertyDescriptors(Mi(e)),i=new Set(r);for(let a of Object.keys(o))i.has(a)||Object.defineProperty(n,a,o[a]);return n}function rv(e,r,n){qt.update+=1;let o=Pt.Get(),i=Mi(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 S(e,r){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.IsEqual(e["~kind"],r)}function A(e){return s.IsObject(e)}function yg(e){return y.Create({"~kind":"OptionalAddAction"},{type:e},{})}function hg(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"type")&&s.IsEqual(e["~kind"],"OptionalAddAction")&&A(e.type)}function Tg(e){return y.Create({"~kind":"OptionalRemoveAction"},{type:e},{})}function Eg(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"type")&&s.IsEqual(e["~kind"],"OptionalRemoveAction")&&A(e.type)}function _g(e){return y.Create({"~kind":"ReadonlyAddAction"},{type:e},{})}function Ig(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"type")&&s.IsEqual(e["~kind"],"ReadonlyAddAction")&&A(e.type)}function bg(e){return y.Create({"~kind":"ReadonlyRemoveAction"},{type:e},{})}function Sg(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.HasPropertyKey(e,"type")&&s.IsEqual(e["~kind"],"ReadonlyRemoveAction")&&A(e.type)}function P(e,r,n){return y.Create({"~kind":"Deferred"},{action:e,parameters:r,options:n},{})}function Og(e){return S(e,"Deferred")}function fu(e){return y.Update(e,{"~immutable":!0},{})}function Fr(e){return fu(e)}function xn(e){return A(e)&&s.HasPropertyKey(e,"~immutable")}function mo(e){return y.Discard(e,["~optional"])}function Et(e){return y.Update(e,{"~optional":!0},{})}function Js(e){return Et(e)}function Ge(e){return A(e)&&s.HasPropertyKey(e,"~optional")}function ec(e){return y.Discard(e,["~readonly"])}function _t(e){return y.Update(e,{"~readonly":!0},{})}function tc(e){return _t(e)}function Rn(e){return A(e)&&s.HasPropertyKey(e,"~readonly")}function Bt(e,r){return y.Create({"~kind":"Array"},{type:"array",items:e},r)}function te(e){return S(e,"Array")}function rc(e){return y.Discard(e,["~kind","type","items"])}function Xt(e,r){return y.Create({"~kind":"AsyncIterator"},{type:"asyncIterator",iteratorItems:e},r)}function at(e){return S(e,"AsyncIterator")}function Ag(e){return y.Discard(e,["~kind","type","iteratorItems"])}function xg(e){return{enumerable:Pt.Get().enumerableKind,writable:!1,configurable:!1,value:e}}var nc=class{constructor(){globalThis.Object.defineProperty(this,"~kind",xg("Base")),globalThis.Object.defineProperty(this,"~guard",xg({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 Ut(e){return S(e,"Base")}function Hr(e,r,n={}){return y.Create({"~kind":"Constructor"},{type:"constructor",parameters:e,instanceType:r},n)}function $e(e){return S(e,"Constructor")}function Rg(e){return y.Discard(e,["~kind","type","parameters","instanceType"])}function Kr(e,r,n={}){return y.Create({"~kind":"Function"},{type:"function",parameters:e,returnType:r},n)}function je(e){return S(e,"Function")}function Cg(e){return y.Discard(e,["~kind","type","parameters","returnType"])}function Le(e,r){return y.Create({"~kind":"Ref"},{$ref:e},r)}function pe(e){return S(e,"Ref")}function zr(e,r){return y.Create({"~kind":"Generic"},{type:"generic",parameters:e,expression:r})}function fo(e){return S(e,"Generic")}var Pg="(?!)";function Z(e){return y.Create({"~kind":"Never"},{not:{}},e)}function gr(e){return S(e,"Never")}function nv(){return["(not-resolvable)",Z()]}function ov(){return["(not-generic)",Z()]}function iv(e,r,n){return[e,zr(r,n)]}function av(e,r,n){return r in e?Ug(e,r,e[r],n):nv()}function Ug(e,r,n,o){return fo(n)?iv(r,n.parameters,n.expression):pe(n)?av(e,n.$ref,o):ov()}function wg(e,r,n){return Ug(e,"(anonymous)",r,n)}function Jt(e,r,n){let o=s.Keys(e).reduce((i,a)=>({...i,[a]:y.Update(e[a],{},{$id:a})}),{});return y.Create({"~kind":"Cyclic"},{$defs:o,$ref:r},n)}function me(e){return S(e,"Cyclic")}var ie={};Mt(ie,{Match:()=>sv});function sv(e,r){return r[e.length]?.(...e)??(()=>{throw Error("Invalid Arguments")})()}function Je(e){return y.Create({"~kind":"Unknown"},{},e)}function It(e){return S(e,"Unknown")}function Di(...e){let[r,n]=ie.Match(e,{2:(o,i)=>[o,i,i],1:o=>[o,Je(),Je()]});return y.Create({"~kind":"Infer"},{type:"infer",name:r,extends:n},{})}function Pe(e){return S(e,"Infer")}function go(e){return y.Create({"~kind":"Any"},{},e)}function pt(e){return S(e,"Any")}function Ng(e){return s.IsObjectNotArray(e)}function Lg(e){return s.Keys(e).filter(n=>isNaN(n)).reduce((n,o)=>[...n,e[o]],[])}function vg(e,r){let n=Ng(e)?Lg(e):e;return y.Create({"~kind":"Enum"},{enum:n},r)}function Ue(e){return S(e,"Enum")}function wt(e,r={}){return y.Create({"~kind":"Intersect"},{allOf:e},r)}function w(e){return S(e,"Intersect")}function kg(e){return y.Discard(e,["~kind","allOf"])}function H(){throw new Error("Unreachable")}var Vr={};Mt(Vr,{Hash:()=>Av,HashCode:()=>Bg});function cv(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 pv(e){return typeof e=="number"}var ut;(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"})(ut||(ut={}));var yo=BigInt("14695981039346656037"),[uv,lv]=[BigInt("1099511628211"),BigInt("18446744073709551616")],mv=Array.from({length:256}).map((e,r)=>BigInt(r)),$g=new Float64Array(1),jg=new DataView($g.buffer),qg=new Uint8Array($g.buffer);function et(e){yo=yo^mv[e],yo=yo*uv%lv}function dv(e){et(ut.Array);for(let r of e)Yr(r)}function fv(e){et(ut.BigInt),jg.setBigInt64(0,e);for(let r of qg)et(r)}function Dg(e){et(ut.Boolean),et(e?1:0)}function gv(e){et(ut.Constructor),Yr(e.toString())}function yv(e){et(ut.Date),Yr(e.getTime())}function hv(e){et(ut.Function),Yr(e.toString())}function Tv(e){et(ut.Null)}function Gg(e){et(ut.Number),jg.setFloat64(0,e,!0);for(let r of qg)et(r)}function Ev(e){et(ut.Object);for(let r of cv(e).sort())Yr(r),Yr(e[r])}function _v(e){et(ut.RegExp),gu(e.toString())}var Iv=new TextEncoder;function gu(e){et(ut.String);for(let r of Iv.encode(e))et(r)}function bv(e){et(ut.Symbol),Yr(e.toString())}function Sv(e){et(ut.TypeArray);let r=new Uint8Array(e.buffer);for(let n=0;n<r.length;n++)et(r[n])}function Ov(e){return et(ut.Undefined)}function Yr(e){return ct.IsTypeArray(e)?Sv(e):ct.IsDate(e)?yv(e):ct.IsRegExp(e)?_v(e):ct.IsBoolean(e)?Dg(e.valueOf()):ct.IsString(e)?gu(e.valueOf()):ct.IsNumber(e)?Gg(e.valueOf()):pv(e)?Gg(e):s.IsArray(e)?dv(e):s.IsBoolean(e)?Dg(e):s.IsBigInt(e)?fv(e):s.IsConstructor(e)?gv(e):s.IsNull(e)?Tv(e):s.IsObject(e)?Ev(e):s.IsString(e)?gu(e):s.IsSymbol(e)?bv(e):s.IsUndefined(e)?Ov(e):s.IsFunction(e)?hv(e):H()}function Bg(e){return yo=BigInt("14695981039346656037"),Yr(e),yo}function Av(e){return Bg(e).toString(16).padStart(16,"0")}function Fg(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 xv=Fg;function Hg(){return xv}var Gi=class{constructor(r,n){this.type=r,this.decode=n}Encode(r){let n=this.type,o=Cn(n)?c=>this.decode(n["~codec"].decode(c)):this.decode,i=Cn(n)?c=>n["~codec"].encode(r(c)):r,a={decode:o,encode:i};return y.Update(this.type,{"~codec":a},{})}},$i=class{constructor(r){this.type=r}Decode(r){return new Gi(this.type,r)}};function oc(e){return new $i(e)}function zg(e,r){return oc(e).Decode(r).Encode(()=>{throw Error("Encode not implemented")})}function Yg(e,r){return oc(e).Decode(()=>{throw Error("Decode not implemented")}).Encode(r)}function Cn(e){return A(e)&&s.HasPropertyKey(e,"~codec")&&s.IsObject(e["~codec"])&&s.HasPropertyKey(e["~codec"],"encode")&&s.HasPropertyKey(e["~codec"],"decode")}function Cv(e,r){let n=ic(e)?[...e["~refine"],r]:[r];return y.Update(e,{"~refine":n},{})}function Vg(e,r,n="error"){return Cv(e,{refine:r,message:n})}function ic(e){return A(e)&&s.HasPropertyKey(e,"~refine")}var Qg="-?(?:0|[1-9][0-9]*)n";function ji(e){return y.Create({"~kind":"BigInt"},{type:"bigint"},e)}function At(e){return S(e,"BigInt")}function ac(e){return y.Create({"~kind":"Boolean"},{type:"boolean"},e)}function lt(e){return S(e,"Boolean")}function qi(e){return y.Create({"~kind":"Identifier"},{name:e})}function Wg(e){return S(e,"Identifier")}var sc="-?(?:0|[1-9][0-9]*)";function Pn(e){return y.Create({"~kind":"Integer"},{type:"integer"},e)}function He(e){return S(e,"Integer")}function er(e,r){return y.Create({"~kind":"Iterator"},{type:"iterator",iteratorItems:e},r)}function st(e){return S(e,"Iterator")}function Zg(e){return y.Discard(e,["~kind","type","iteratorItems"])}var yu=class extends Error{constructor(r){super("Invalid Literal value"),Object.defineProperty(this,"cause",{value:{value:r},writable:!1,configurable:!1,enumerable:!1})}};function Pv(e){return s.IsBigInt(e)?"bigint":s.IsBoolean(e)?"boolean":s.IsNumber(e)?"number":s.IsString(e)?"string":(()=>{throw new yu(e)})()}function Y(e,r){return y.Create({"~kind":"Literal"},{type:Pv(e),const:e},r)}function cc(e){return s.IsBigInt(e)||s.IsBoolean(e)||s.IsNumber(e)||s.IsString(e)}function Xg(e){return X(e)&&s.IsBigInt(e.const)}function Jg(e){return X(e)&&s.IsBoolean(e.const)}function ho(e){return X(e)&&s.IsNumber(e.const)}function To(e){return X(e)&&s.IsString(e.const)}function X(e){return S(e,"Literal")}function Qr(e){return y.Create({"~kind":"Null"},{type:"null"},e)}function tr(e){return S(e,"Null")}var pc="-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?";function Nt(e){return y.Create({"~kind":"Number"},{type:"number"},e)}function be(e){return S(e,"Number")}function Eo(e){return y.Create({"~kind":"Symbol"},{type:"symbol"},e)}function rr(e){return S(e,"Symbol")}function ey(e){return s.Keys(e).filter(r=>!Ge(e[r]))}function ty(e){return s.Keys(e)}function uc(e){return s.Values(e)}function Uv(e,r={}){let n=ey(e),o=n.length>0?{required:n}:{};return y.Create({"~kind":"Object"},{type:"object",...o,properties:e},r)}var N=Uv;function k(e){return S(e,"Object")}function ry(e){return y.Discard(e,["~kind","type","properties","required"])}function Un(...e){let[r,n,o]=ie.Match(e,{3:(i,a,c)=>[i,a,c],2:(i,a)=>[i,a,a],1:i=>[i,Je(),Je()]});return y.Create({"~kind":"Parameter"},{name:r,extends:n,equals:o},{})}function ny(e){return S(e,"Parameter")}function nr(e,r){return y.Create({"~kind":"Promise"},{type:"promise",item:e},r)}function tt(e){return S(e,"Promise")}function oy(e){return y.Discard(e,["~kind","type","item"])}var lc=".*";function bt(e){return y.Create({"~kind":"String"},{type:"string"},e)}function ve(e){return S(e,"String")}function St(e,r){let n="object",o={[e]:r};return y.Create({"~kind":"Record"},{type:n,patternProperties:o})}var _o=`^${sc}$`,Io=`^${pc}$`,Dt=`^${lc}$`;function Bi(e,r,n={}){return P("Record",[e,r],n)}function wv(e,r,n={}){return C({},Bi(e,r,n))}function mc(e,r,n={}){return wv(e,r,n)}function dc(e,r){return St(e,r)}function xt(e){return s.Keys(e.patternProperties)[0]}function bo(e){let r=xt(e);return s.IsEqual(r,_o)?Pn():s.IsEqual(r,Io)?Nt():bt()}function rt(e){return e.patternProperties[xt(e)]}function Se(e){return S(e,"Record")}function wn(e){return y.Create({"~kind":"Rest"},{type:"rest",items:e},{})}function Wr(e){return S(e,"Rest")}function fc(e){return y.Create({"~kind":"This"},{$ref:"#"},e)}function iy(e){return S(e,"This")}function Ke(e,r={}){let[n,o,i]=[e,e.length,!1];return y.Create({"~kind":"Tuple"},{type:"array",additionalItems:i,items:n,minItems:o},r)}function V(e){return S(e,"Tuple")}function ay(e){return y.Discard(e,["~kind","type","items","minItems","additionalItems"])}function So(e){return y.Create({"~kind":"Undefined"},{type:"undefined"},e)}function or(e){return S(e,"Undefined")}function q(e,r={}){return y.Create({"~kind":"Union"},{anyOf:e},r)}function O(e){return S(e,"Union")}function sy(e){return y.Discard(e,["~kind","anyOf"])}function cy(e){return y.Create({"~kind":"Unsafe"},{},e)}function py(e){return S(e,"Unsafe")}function gc(e){return y.Create({"~kind":"Void"},{type:"void"},e)}function Rt(e){return S(e,"Void")}function Lv(e,r){return s.IsEqual(e,"Array")?Bt(r[0]):s.IsEqual(e,"AsyncIterator")?Xt(r[0]):s.IsEqual(e,"Iterator")?er(r[0]):s.IsEqual(e,"Promise")?nr(r[0]):s.IsEqual(e,"Awaited")?sa(r[0]):s.IsEqual(e,"Capitalize")?Hi(r[0]):s.IsEqual(e,"ConstructorParameters")?Qi(r[0]):s.IsEqual(e,"Evaluate")?Tu(r[0]):s.IsEqual(e,"Exclude")?Wi(r[0],r[1]):s.IsEqual(e,"Extract")?Zi(r[0],r[1]):s.IsEqual(e,"Index")?xo(r[0],r[1]):s.IsEqual(e,"InstanceType")?Xi(r[0]):s.IsEqual(e,"Lowercase")?Ki(r[0]):s.IsEqual(e,"NonNullable")?Ji(r[0]):s.IsEqual(e,"Omit")?ea(r[0],r[1]):s.IsEqual(e,"Options")?Co(r[0],r[1]):s.IsEqual(e,"Parameters")?ta(r[0]):s.IsEqual(e,"Partial")?ra(r[0]):s.IsEqual(e,"Pick")?na(r[0],r[1]):s.IsEqual(e,"Readonly")?oa(r[0]):s.IsEqual(e,"KeyOf")?Ro(r[0]):s.IsEqual(e,"Record")?Bi(r[0],r[1]):s.IsEqual(e,"Required")?ia(r[0]):s.IsEqual(e,"ReturnType")?aa(r[0]):s.IsEqual(e,"Uncapitalize")?zi(r[0]):s.IsEqual(e,"Uppercase")?Yi(r[0]):yc(Le(e),r)}function Nn(){throw Error("Unreachable")}var vv=(e,r=[])=>e.reduce((n,o)=>s.IsArray(o)&&s.IsEqual(o.length,2)?[...n,o[0]]:[...n,o],[]),yr=e=>{let[r,n]=e;return vv([...r,...n])};function fy(e){return Un(e[0],e[2],e[4])}function gy(e){return Un(e[0],e[2],e[2])}function yy(e){return Un(e[0],Je(),e[2])}function hy(e){return Un(e,Je(),Je())}function Ty(e){return yr(e)}function Ey(e){return e[1]}function _y(e){return yr(e)}function Iy(e){return e[1]}function by(e){return Lv(e[0],e[1])}function Sy(e){return null}function Oy(e){return bt()}function Ay(e){return Nt()}function xy(e){return ac()}function Ry(e){return So()}function Cy(e){return Qr()}function Py(e){return Pn()}function Uy(e){return ji()}function wy(e){return Je()}function Ny(e){return go()}function Ly(e){return N({})}function vy(e){return Z()}function ky(e){return Eo()}function My(e){return gc()}function Dy(e){return fc()}function Gy(e){return e[1]}function $y(e){return Y(e)}function jy(e){return s.IsEqual(e.length,3)?[e[0],e[1],...e[2]]:[e[0]]}function qy(e){return e[1]}function By(e){return Fi(e)}function Fy(e){return Y(BigInt(e))}function Hy(e){return Y(s.IsEqual(e,"true"))}function Ky(e){return Y(parseFloat(e))}function zy(e){return Y(e)}function Yy(e){return e.length>0}function Vy(e){return e.reduce((r,n)=>s.IsEqual(n.length,3)?[...r,[n[1]]]:[...r,[]],[])}function Qy(e){return s.IsEqual(e.length,6)?[e[1],e[3],e[5]]:[]}function Wy(e){return s.IsArray(e)&&s.IsEqual(e.length,3)?e[1]:e}var uy=(e,r)=>r.reduceRight((n,o)=>{let i=o;return s.IsEqual(i.length,1)?xo(n,i[0]):s.IsEqual(i.length,0)?Bt(n):Nn()},e),ly=(e,r)=>s.IsEqual(r.length,3)?Vi(e,r[0],r[1],r[2]):e;function Zy(e){let[r,n,o,i]=e;return ly(r?Ro(uy(n,o)):uy(n,o),i)}function hu(e,r){return s.IsEqual(r.length,3)?(()=>{let[n,o,i]=r,a=hu(o,i);if(s.IsEqual(n,"&"))return w(a)?wt([e,...a.allOf]):wt([e,a]);if(s.IsEqual(n,"|"))return O(a)?q([e,...a.anyOf]):q([e,a]);Nn()})():e}function Xy(e){let[r,n]=e;return hu(r,n)}function Jy(e){let[r,n]=e;return hu(r,n)}function eh(e){return fu(e[1])}function th(e){return e[1]}function rh(e){return zr(e[0],e[2])}function nh(e){return s.IsEqual(e.length,4)?Di(e[1],e[3]):s.IsEqual(e.length,2)?Di(e[1],Je()):Nn()}function oh(e){return`${e}`}function ih(e){return He(e[3])?_o:be(e[3])?Io:rr(e[3])?Dt:ve(e[3])?Dt:Nn()}function ah(e){return e.length>0}function sh(e){return e.length>0}function ch(e){let[r,n,o,i,a]=e;return{[n]:r&&o?_t(Et(a)):r&&!o?_t(a):!r&&o?Et(a):a}}function ph(e){return yr(e)}function uh(e){return e.reduce((r,n)=>s.HasPropertyKey(n,_o)||s.HasPropertyKey(n,Io)||s.HasPropertyKey(n,Dt)?[r[0],y.Assign(r[1],n)]:[y.Assign(r[0],n),r[1]],[{},{}])}function lh(e){return uh(e[1])}function mh(e){let[r,n]=e,o=s.IsEqual(s.Keys(n).length,0)?{}:{patternProperties:n};return N(r,o)}function dh(e){return s.IsEqual(e.length,5)?_t(Et(e[4])):s.IsEqual(e.length,3)?e[2]:s.IsEqual(e.length,4)?s.IsEqual(e[2],"readonly")?_t(e[3]):Et(e[3]):Nn()}function fh(e){return _t(Et(e[1]))}function gh(e){return _t(e[1])}function yh(e){return Et(e[0])}function hh(e){return s.IsEqual(e.length,2)?wn(e[1]):s.IsEqual(e.length,1)?e[0]:Nn()}function Th(e){return yr(e)}function Eh(e){return Ke(e[1])}function _h(e){return _t(Et(e[4]))}function Ih(e){return _t(e[3])}function bh(e){return Et(e[3])}function Sh(e){return e[2]}function Oh(e){return s.IsEqual(e.length,2)?wn(e[1]):s.IsEqual(e.length,1)?e[0]:Nn()}function Ah(e){return yr(e)}function xh(e){return Kr(e[1],e[4])}function Rh(e){return Hr(e[2],e[5])}function my(e,r){return s.IsEqual(e,"remove")?bg(r):s.IsEqual(e,"add")?_g(r):r}function Ch(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 dy(e,r){return s.IsEqual(e,"remove")?Tg(r):s.IsEqual(e,"add")?yg(r):r}function Ph(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 Uh(e){return s.IsEqual(e.length,2)?[e[1]]:[]}function wh(e){return s.IsArray(e[6])&&s.IsEqual(e[6].length,1)?Oo(qi(e[3]),e[5],e[6][0],my(e[1],dy(e[8],e[10]))):Oo(qi(e[3]),e[5],Le(e[3]),my(e[1],dy(e[8],e[10])))}function Nh(e){return Le(e)}function Lh(e){return Co(e[2],e[4])}function vh(e){return parseFloat(e)}function kh(e){return s.IsEqual(e,"true")}function Mh(e){return null}function Dh(e){return{[e[0]]:e[2]}}function Gh(e){return yr(e)}function kv(e){return e.reduce((r,n)=>y.Assign(r,n),{})}function $h(e){return kv(e[1])}function jh(e){return yr(e)}function qh(e){return e[1]}function Bh(e){return ji()}function Fh(e){return bt()}function Hh(e){return Nt()}function Kh(e){return Pn()}function zh(e){return Z()}function Yh(e){return Y(e)}function Vh(e){return q(e[1])}function Qh(e){return e.length===3?[...e[0],...e[2]]:e.length===1?[...e[0]]:[]}function Wh(e){return[e[0],...e[1]]}function Zh(e){return e[1]}function Xh(e){return yr(e)}function Jh(e){return s.IsEqual(e.length,2)?e[1]:[]}function eT(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]]:zr(r,Ao(n,o,a))}}function tT(e){let r=e[2],[n,o]=e[3],i=s.IsEqual(s.Keys(o).length,0)?{}:{patternProperties:o};return{[e[1]]:Ao(r,n,i)}}function rT(e){return{[e[1]]:zr(e[2],e[4])}}function nT(e){return{[e[1]]:e[3]}}function oT(e){return null}function iT(e){return uh(yr(e))}function aT(e){return e[1]}function sT(e){let r=e[0],n=e[1];return Eu(y.Assign(r,n[0]))}function ce(e){return Sn(e)&&ee(e.length,2)}function Gv(e,r){return ee(r.indexOf(e),0)?[e,r.slice(e.length)]:[]}function qe(e,r){let[n,...o]=e;return Br(n)?(()=>{let i=Gv(n,r);return ee(i.length,2)?i:qe(o,r)})():[]}function _u(e,r){return Array.from({length:r-e+1},(n,o)=>String.fromCharCode(e+o))}var cT=[..._u(97,122),..._u(65,90)],Iu="0",bu=_u(49,57),Po=[Iu,...bu],pT=" ",Uo=`
@@ -39,13 +39,13 @@ ${Wp.map((o,i)=>UN(o,r===0?0:i/r)).join(`
39
39
  `,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(`
40
40
  `,e),([r,n])=>[[r],n]),([r,n])=>[r,n],()=>[]))))),([r,n])=>[r,n]),qT=(e,r=[])=>u(u($T(e),([n,o])=>u(jT(o),([i,a])=>[[n,i],a])),([n,o])=>qT(o,[...r,n]),()=>[r,e]),Wk=e=>u(u(qT(e),([r,n])=>u(u(u($T(n),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>u([[],n],([o,i])=>[o,i],()=>[])),([o,i])=>[[r,o],i])),([r,n])=>[ph(r),n]),Cu=e=>u(u(h("{",e),([r,n])=>u(Wk(n),([o,i])=>u(h("}",i),([a,c])=>[[r,o,a],c]))),([r,n])=>[lh(r),n]),Zk=e=>u(Cu(e),([r,n])=>[mh(r),n]),Xk=e=>u(u(u(Oe(e),([r,n])=>u(h("?",n),([o,i])=>u(h(":",i),([a,c])=>u(h("readonly",c),([l,d])=>u(J(d),([f,g])=>[[r,o,a,l,f],g]))))),([r,n])=>[r,n],()=>u(u(Oe(e),([r,n])=>u(h(":",n),([o,i])=>u(h("readonly",i),([a,c])=>u(J(c),([l,d])=>[[r,o,a,l],d])))),([r,n])=>[r,n],()=>u(u(Oe(e),([r,n])=>u(h("?",n),([o,i])=>u(h(":",i),([a,c])=>u(J(c),([l,d])=>[[r,o,a,l],d])))),([r,n])=>[r,n],()=>u(u(Oe(e),([r,n])=>u(h(":",n),([o,i])=>u(J(i),([a,c])=>[[r,o,a],c]))),([r,n])=>[r,n],()=>[])))),([r,n])=>[dh(r),n]),Jk=e=>u(u(h("readonly",e),([r,n])=>u(J(n),([o,i])=>u(h("?",i),([a,c])=>[[r,o,a],c]))),([r,n])=>[fh(r),n]),eM=e=>u(u(h("readonly",e),([r,n])=>u(J(n),([o,i])=>[[r,o],i])),([r,n])=>[gh(r),n]),tM=e=>u(u(J(e),([r,n])=>u(h("?",n),([o,i])=>[[r,o],i])),([r,n])=>[yh(r),n]),bT=e=>u(u(Xk(e),([r,n])=>[r,n],()=>u(Jk(e),([r,n])=>[r,n],()=>u(eM(e),([r,n])=>[r,n],()=>u(tM(e),([r,n])=>[r,n],()=>u(J(e),([r,n])=>[r,n],()=>[]))))),([r,n])=>[r,n]),BT=e=>u(u(u(h("...",e),([r,n])=>u(bT(n),([o,i])=>[[r,o],i])),([r,n])=>[r,n],()=>u(u(bT(e),([r,n])=>[[r],n]),([r,n])=>[r,n],()=>[])),([r,n])=>[hh(r),n]),FT=(e,r=[])=>u(u(BT(e),([n,o])=>u(h(",",o),([i,a])=>[[n,i],a])),([n,o])=>FT(o,[...r,n]),()=>[r,e]),rM=e=>u(u(FT(e),([r,n])=>u(u(u(BT(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]),nM=e=>u(u(h("[",e),([r,n])=>u(rM(n),([o,i])=>u(h("]",i),([a,c])=>[[r,o,a],c]))),([r,n])=>[Eh(r),n]),oM=e=>u(u(Oe(e),([r,n])=>u(h("?",n),([o,i])=>u(h(":",i),([a,c])=>u(h("readonly",c),([l,d])=>u(J(d),([f,g])=>[[r,o,a,l,f],g]))))),([r,n])=>[_h(r),n]),iM=e=>u(u(Oe(e),([r,n])=>u(h(":",n),([o,i])=>u(h("readonly",i),([a,c])=>u(J(c),([l,d])=>[[r,o,a,l],d])))),([r,n])=>[Ih(r),n]),aM=e=>u(u(Oe(e),([r,n])=>u(h("?",n),([o,i])=>u(h(":",i),([a,c])=>u(J(c),([l,d])=>[[r,o,a,l],d])))),([r,n])=>[bh(r),n]),sM=e=>u(u(Oe(e),([r,n])=>u(h(":",n),([o,i])=>u(J(i),([a,c])=>[[r,o,a],c]))),([r,n])=>[Sh(r),n]),ST=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]),HT=e=>u(u(u(h("...",e),([r,n])=>u(ST(n),([o,i])=>[[r,o],i])),([r,n])=>[r,n],()=>u(u(ST(e),([r,n])=>[[r],n]),([r,n])=>[r,n],()=>[])),([r,n])=>[Oh(r),n]),KT=(e,r=[])=>u(u(HT(e),([n,o])=>u(h(",",o),([i,a])=>[[n,i],a])),([n,o])=>KT(o,[...r,n]),()=>[r,e]),zT=e=>u(u(KT(e),([r,n])=>u(u(u(HT(n),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>u([[],n],([o,i])=>[o,i],()=>[])),([o,i])=>[[r,o],i])),([r,n])=>[Ah(r),n]),cM=e=>u(u(h("(",e),([r,n])=>u(zT(n),([o,i])=>u(h(")",i),([a,c])=>u(h("=>",c),([l,d])=>u(J(d),([f,g])=>[[r,o,a,l,f],g]))))),([r,n])=>[xh(r),n]),pM=e=>u(u(h("new",e),([r,n])=>u(h("(",n),([o,i])=>u(zT(i),([a,c])=>u(h(")",c),([l,d])=>u(h("=>",d),([f,g])=>u(J(g),([T,_])=>[[r,o,a,l,f,T],_])))))),([r,n])=>[Rh(r),n]),uM=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])=>[Ch(r),n]),lM=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])=>[Ph(r),n]),mM=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])=>[Uh(r),n]),dM=e=>u(u(h("{",e),([r,n])=>u(uM(n),([o,i])=>u(h("[",i),([a,c])=>u(Oe(c),([l,d])=>u(h("in",d),([f,g])=>u(J(g),([T,_])=>u(mM(_),([ae,fe])=>u(h("]",fe),([Gr,uo])=>u(lM(uo),([$r,dN])=>u(h(":",dN),([fN,gN])=>u(J(gN),([yN,hN])=>u(RT(hN),([TN,EN])=>u(h("}",EN),([_N,IN])=>[[r,o,a,l,f,T,ae,Gr,$r,fN,yN,TN,_N],IN]))))))))))))),([r,n])=>[wh(r),n]),fM=e=>u(Oe(e),([r,n])=>[Nh(r),n]),gM=e=>u(u(h("Options",e),([r,n])=>u(h("<",n),([o,i])=>u(J(i),([a,c])=>u(h(",",c),([l,d])=>u(QT(d),([f,g])=>u(h(">",g),([T,_])=>[[r,o,a,l,f,T],_])))))),([r,n])=>[Lh(r),n]),yM=e=>u(bc(e),([r,n])=>[vh(r),n]),hM=e=>u(u(h("true",e),([r,n])=>[r,n],()=>u(h("false",e),([r,n])=>[r,n],()=>[])),([r,n])=>[kh(r),n]),TM=e=>u(Sc(['"',"'"],e),([r,n])=>[r,n]),EM=e=>u(h("null",e),([r,n])=>[Mh(r),n]),YT=e=>u(u(GT(e),([r,n])=>u(h(":",n),([o,i])=>u(Pu(i),([a,c])=>[[r,o,a],c]))),([r,n])=>[Dh(r),n]),VT=(e,r=[])=>u(u(YT(e),([n,o])=>u(jT(o),([i,a])=>[[n,i],a])),([n,o])=>VT(o,[...r,n]),()=>[r,e]),_M=e=>u(u(VT(e),([r,n])=>u(u(u(YT(n),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>u([[],n],([o,i])=>[o,i],()=>[])),([o,i])=>[[r,o],i])),([r,n])=>[Gh(r),n]),QT=e=>u(u(h("{",e),([r,n])=>u(_M(n),([o,i])=>u(h("}",i),([a,c])=>[[r,o,a],c]))),([r,n])=>[$h(r),n]),WT=(e,r=[])=>u(u(Pu(e),([n,o])=>u(h(",",o),([i,a])=>[[n,i],a])),([n,o])=>WT(o,[...r,n]),()=>[r,e]),IM=e=>u(u(WT(e),([r,n])=>u(u(u(Pu(n),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>u([[],n],([o,i])=>[o,i],()=>[])),([o,i])=>[[r,o],i])),([r,n])=>[jh(r),n]),bM=e=>u(u(h("[",e),([r,n])=>u(IM(n),([o,i])=>u(h("]",i),([a,c])=>[[r,o,a],c]))),([r,n])=>[qh(r),n]),Pu=e=>u(u(yM(e),([r,n])=>[r,n],()=>u(hM(e),([r,n])=>[r,n],()=>u(TM(e),([r,n])=>[r,n],()=>u(EM(e),([r,n])=>[r,n],()=>u(QT(e),([r,n])=>[r,n],()=>u(bM(e),([r,n])=>[r,n],()=>[])))))),([r,n])=>[r,n]),SM=e=>u(h("-?(?:0|[1-9][0-9]*)n",e),([r,n])=>[Bh(r),n]),OM=e=>u(h(".*",e),([r,n])=>[Fh(r),n]),AM=e=>u(h("-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?",e),([r,n])=>[Hh(r),n]),xM=e=>u(h("-?(?:0|[1-9][0-9]*)",e),([r,n])=>[Kh(r),n]),RM=e=>u(h("(?!)",e),([r,n])=>[zh(r),n]),CM=e=>u(IT(["-?(?:0|[1-9][0-9]*)n",".*","-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?","-?(?:0|[1-9][0-9]*)","(?!)","(",")","$","|"],e),([r,n])=>[Yh(r),n]),PM=e=>u(u(SM(e),([r,n])=>[r,n],()=>u(OM(e),([r,n])=>[r,n],()=>u(AM(e),([r,n])=>[r,n],()=>u(xM(e),([r,n])=>[r,n],()=>u(RM(e),([r,n])=>[r,n],()=>u(UM(e),([r,n])=>[r,n],()=>u(CM(e),([r,n])=>[r,n],()=>[]))))))),([r,n])=>[r,n]),UM=e=>u(u(h("(",e),([r,n])=>u(Uu(n),([o,i])=>u(h(")",i),([a,c])=>[[r,o,a],c]))),([r,n])=>[Vh(r),n]),ZT=e=>u(u(u(Au(e),([r,n])=>u(h("|",n),([o,i])=>u(ZT(i),([a,c])=>[[r,o,a],c]))),([r,n])=>[r,n],()=>u(u(Au(e),([r,n])=>[[r],n]),([r,n])=>[r,n],()=>u([[],e],([r,n])=>[r,n],()=>[]))),([r,n])=>[Qh(r),n]),Au=e=>u(u(PM(e),([r,n])=>u(Uu(n),([o,i])=>[[r,o],i])),([r,n])=>[Wh(r),n]),Uu=e=>u(u(ZT(e),([r,n])=>[r,n],()=>u(Au(e),([r,n])=>[r,n],()=>[])),([r,n])=>[r,n]),XT=e=>u(u(h("^",e),([r,n])=>u(Uu(n),([o,i])=>u(h("$",i),([a,c])=>[[r,o,a],c]))),([r,n])=>[Zh(r),n]),JT=(e,r=[])=>u(u(J(e),([n,o])=>u(h(",",o),([i,a])=>[[n,i],a])),([n,o])=>JT(o,[...r,n]),()=>[r,e]),wM=e=>u(u(JT(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])=>[Xh(r),n]),eE=e=>u(u(u(h("extends",e),([r,n])=>u(wM(n),([o,i])=>[[r,o],i])),([r,n])=>[r,n],()=>u([[],e],([r,n])=>[r,n],()=>[])),([r,n])=>[Jh(r),n]),NM=e=>u(u(h("interface",e),([r,n])=>u(Oe(n),([o,i])=>u(xu(i),([a,c])=>u(eE(c),([l,d])=>u(Cu(d),([f,g])=>[[r,o,a,l,f],g]))))),([r,n])=>[eT(r),n]),LM=e=>u(u(h("interface",e),([r,n])=>u(Oe(n),([o,i])=>u(eE(i),([a,c])=>u(Cu(c),([l,d])=>[[r,o,a,l],d])))),([r,n])=>[tT(r),n]),vM=e=>u(u(h("type",e),([r,n])=>u(Oe(n),([o,i])=>u(xu(i),([a,c])=>u(h("=",c),([l,d])=>u(J(d),([f,g])=>[[r,o,a,l,f],g]))))),([r,n])=>[rT(r),n]),kM=e=>u(u(h("type",e),([r,n])=>u(Oe(n),([o,i])=>u(h("=",i),([a,c])=>u(J(c),([l,d])=>[[r,o,a,l],d])))),([r,n])=>[nT(r),n]),MM=e=>u(u(u(h("export",e),([r,n])=>[[r],n]),([r,n])=>[r,n],()=>u([[],e],([r,n])=>[r,n],()=>[])),([r,n])=>[oT(r),n]),DM=e=>u(u(u(h(";",e),([r,n])=>u(h(`
41
41
  `,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(`
42
- `,e),([r,n])=>[[r],n]),([r,n])=>[r,n],()=>[]))),([r,n])=>[r,n]),tE=(e,r=[])=>u(u(wu(e),([n,o])=>u(DM(o),([i,a])=>[[n,i],a])),([n,o])=>tE(o,[...r,n]),()=>[r,e]),GM=e=>u(u(tE(e),([r,n])=>u(u(u(wu(n),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>u([[],n],([o,i])=>[o,i],()=>[])),([o,i])=>[[r,o],i])),([r,n])=>[iT(r),n]),wu=e=>u(u(MM(e),([r,n])=>u(u(NM(n),([o,i])=>[o,i],()=>u(LM(n),([o,i])=>[o,i],()=>u(vM(n),([o,i])=>[o,i],()=>u(kM(n),([o,i])=>[o,i],()=>[])))),([o,i])=>u(RT(i),([a,c])=>[[r,o,a],c]))),([r,n])=>[aT(r),n]),$M=e=>u(u(wu(e),([r,n])=>u(GM(n),([o,i])=>[[r,o],i])),([r,n])=>[sT(r),n]),rE=e=>u(u($M(e),([r,n])=>[r,n],()=>u(Bk(e),([r,n])=>[r,n],()=>u(J(e),([r,n])=>[r,n],()=>[]))),([r,n])=>[r,n]);function nE(e){let r=Ru(`\`${e}\``);return s.IsEqual(r.length,2)?r[0]:H()}function Fi(e,r={}){return P("TemplateLiteral",[e],r)}function oE(e){return C({},Fi(e,{}))}function qM(e){let r=nE(e);return oE(r)}function iE(e,r={}){let n=s.IsString(e)?qM(e):oE(e);return y.Update(n,{},r)}function we(e){return S(e,"TemplateLiteral")}var L={};Mt(L,{ExtendsFalse:()=>F,ExtendsTrue:()=>x,ExtendsUnion:()=>Nu,IsExtendsFalse:()=>BM,IsExtendsTrue:()=>sE,IsExtendsTrueLike:()=>Ae,IsExtendsUnion:()=>aE});function Nu(e){return y.Create({"~kind":"ExtendsUnion"},{inferred:e})}function aE(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 y.Create({"~kind":"ExtendsTrue"},{inferred:e})}function sE(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 y.Create({"~kind":"ExtendsFalse"},{})}function BM(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.IsEqual(e["~kind"],"ExtendsFalse")}function Ae(e){return aE(e)||sE(e)}function Ac(e){let r=XT(e);return s.IsEqual(r.length,2)?r[0]:H()}function FM(e){return!0}function cE(e){let[r,...n]=e;return A(r)?HM(r)?cE(n):!1:!0}function pE(e){return s.IsEqual(e.length,0)?!1:cE(e)}function HM(e){return O(e)?pE(e.anyOf):X(e)?FM(e.const):!1}function xc(e){return pE(e)}function uE(e,r,n=[]){let[o,...i]=e;return s.IsString(o)?uE(i,r,[...n,`${o}${r}`]):n}function KM(e,r){return s.IsEqual(e.length,0)?[`${r}`]:uE(e,r)}function lE(e,r,n=[]){let[o,...i]=r;return A(o)?lE(e,i,[...n,...mE(e,o)]):n}function mE(e,r){return O(r)?lE(e,r.anyOf):X(r)?KM(e,r.const):H()}function dE(e,r){let[n,...o]=r;return A(n)?dE(mE(e,n),o):e}function zM(e){return e.map(r=>Y(r))}function YM(e){let r=dE([],e),n=zM(r);return q(n)}function VM(e){return s.IsEqual(e.length,0)?H():s.IsEqual(e.length,1)&&X(e[0])?e[0]:YM(e)}function nt(e){let r=Ac(e);return xc(r)?VM(r):bt()}function QM(e){return s.IsString(e)||s.IsNumber(e)?Y(e):s.IsNull(e)?Qr():Z()}function Ft(e){return e.map(n=>QM(n))}function ca(e){let r=Ft(e);return q(r)}function Ln(e){return ca(e.enum)}function WM(e,r,n,o){let i=re(e,n,o);return Ae(i)?x(y.Assign(y.Assign(e,i.inferred),{[r]:n})):F()}function ZM(e,r){return x(e)}function XM(e,r,n){let o=ca(n);return re(e,r,o)}function fE(e,r,n){let[o,...i]=n;return A(o)?(()=>{let a=re(e,r,o);return Ae(a)?fE(a.inferred,r,i):F()})():x(e)}function JM(e,r,n){let o=nt(n);return re(e,r,o)}function gE(e,r,n){let[o,...i]=n;return A(o)?(()=>{let a=re(e,r,o);return Ae(a)?x(a.inferred):gE(e,r,i)})():F()}function K(e,r,n){return pt(n)?ZM(e,r):Ue(n)?XM(e,r,n.enum):Pe(n)?WM(e,n.name,r,n.extends):w(n)?fE(e,r,n.allOf):we(n)?JM(e,r,n.pattern):O(n)?gE(e,r,n.anyOf):It(n)?x(e):F()}function yE(e,r,n){return Pe(n)?K(e,r,n):pt(n)?x(e):It(n)?x(e):Nu(e)}function e0(e,r){let n=xn(e),o=xn(r);return n&&o||!n&&o?!0:!(n&&!o)}function hE(e,r,n,o){return te(o)?e0(r,o)?re(e,n,o.items):F():K(e,r,o)}function TE(e,r,n){return at(n)?re(e,r,n.iteratorItems):K(e,Xt(r),n)}function EE(e,r,n){return At(n)?x(e):K(e,r,n)}function _E(e,r,n){return lt(n)?x(e):K(e,r,n)}function t0(e,r,n,o,i){let a=Pe(o)?r:o,c=Pe(o)?o:r,l=Ge(r),d=Ge(o),f=re(e,a,c);return!l&&d?F():Ae(f)?pa(f.inferred,n,i):F()}function r0(e,r,n,o){let[i,...a]=o;return A(i)?t0(e,r,n,i,a):Ge(r)?x(e):F()}function n0(e,r,n){let[o,...i]=r;return A(o)?r0(e,o,i,n):x(e)}function pa(e,r,n){return n0(e,r,n)}function Rc(e,r,n){return Rt(n)?x(e):re(e,r,n)}function IE(e,r,n,o){return $e(o)?(()=>{let i=pa(e,r,o.parameters);return Ae(i)?Rc(i.inferred,n,o.instanceType):F()})():F()}function bE(e,r,n){return re(e,Ln(r),n)}function SE(e,r,n,o){return je(o)?(()=>{let i=pa(e,r,o.parameters);return Ae(i)?Rc(i.inferred,n,o.returnType):F()})():F()}function OE(e,r,n){return He(n)?x(e):be(n)?x(e):K(e,r,n)}var ua="equal",o0="disjoint",la="left-inside",ma="right-inside";function da(e,r){let n=[It(e)?L.ExtendsFalse():ot({},e,r),It(e)?L.ExtendsTrue({}):ot({},r,e)];return L.IsExtendsTrueLike(n[0])&&L.IsExtendsTrueLike(n[1])?ua:L.IsExtendsTrueLike(n[0])&&L.IsExtendsFalse(n[1])?la:L.IsExtendsFalse(n[0])&&L.IsExtendsTrueLike(n[1])?ma:o0}function i0(e){return O(e)?ir(e.anyOf):[e]}function ir(e){return e.reduce((r,n)=>[...r,...i0(n)],[])}function Lu(e){return e.reduceRight((n,o,i)=>({[i]:o,...n}),{})}function AE(e){let r=Lu(e.items);return N(r)}function a0(e,r){return Rn(e)?!!Rn(r):!1}function s0(e,r){return Ge(e)?!!Ge(r):!1}function c0(e,r){let n=a0(e,r),o=s0(e,r),i=Ne([e,r]),a=ec(mo(i));return n&&o?_t(Et(a)):n&&!o?_t(a):!n&&o?Et(a):a}function p0(e,r,n){return n in e?n in r?c0(e[n],r[n]):e[n]:n in r?r[n]:Z()}function u0(e,r){return[...new Set([...s.Keys(r),...s.Keys(e)])].reduce((o,i)=>({...o,[i]:p0(e,r,i)}),{})}function xE(e){return k(e)?e.properties:V(e)?Lu(e.items):H()}function RE(e,r){let n=xE(e),o=xE(r),i=u0(n,o);return N(i)}function CE(e,r){let n=da(e,r);return s.IsEqual(n,la)?e:s.IsEqual(n,ma)||s.IsEqual(n,ua)?r:Z()}function PE(e){return k(e)||V(e)}function UE(e){return w(e)?Ne(e.allOf):e}function l0(e,r){let n=UE(e),o=UE(r),i=PE(n),a=PE(o);return i&&a?RE(Jr(n),o):i&&!a?Jr(n):!i&&a?o:CE(Jr(n),o)}function wE(e,r,n=[]){let[o,...i]=r;return s.IsUndefined(o)?n.length===0?[e]:n:wE(e,i,[...n,l0(e,o)])}function NE(e,r,n=[]){let[o,...i]=e;return A(o)?NE(i,r,[...n,...fa([o],r)]):n}function fa(e,r=[]){let[n,...o]=e;return A(n)?O(n)?fa(o,NE(n.anyOf,r)):fa(o,wE(n,r)):r}function Ne(e){let r=fa(e);return vu(r)}function hr(e){return vu(e)}function Jr(e){return w(e)?Ne(e.allOf):O(e)?hr(e.anyOf):e}function vn(e){return s.IsEqual(e.length,1)?e[0]:s.IsEqual(e.length,0)?Z():q(e)}function m0(e,r){return r.filter(n=>da(e,n)!==ma)}function d0(e,r){let n=r.some(o=>{let i=da(e,o);return s.IsEqual(i,la)||s.IsEqual(i,ua)});return s.IsEqual(n,!1)}function f0(e,r){let n=Jr(e);return pt(n)?[n]:d0(n,r)?[...m0(n,r),n]:r}function ku(e,r=[]){let[n,...o]=e;return A(n)?k(n)?ku(o,[...r,n]):ku(o,f0(n,r)):r}function vu(e){let r=ku(e),n=ir(r);return n.length===0?Z():n.length===1?n[0]:q(n)}function g0(e,r,n,o){let i=I(e,r,n);return y.Update(Jr(i),{},o)}function LE(e,r,n,o){return g0(e,r,n,o)}function vE(e,r,n){let o=Ne(r);return re(e,o,n)}function kE(e,r,n){return st(n)?re(e,r,n.iteratorItems):K(e,er(r),n)}function Cc(e,r,n){return r===n?x(e):F()}function y0(e,r,n){return X(n)?Cc(e,r,n.const):At(n)?x(e):K(e,Y(r),n)}function h0(e,r,n){return X(n)?Cc(e,r,n.const):lt(n)?x(e):K(e,Y(r),n)}function T0(e,r,n){return X(n)?Cc(e,r,n.const):be(n)?x(e):K(e,Y(r),n)}function E0(e,r,n){return X(n)?Cc(e,r,n.const):ve(n)?x(e):K(e,Y(r),n)}function ME(e,r,n){return s.IsBigInt(r.const)?y0(e,r.const,n):s.IsBoolean(r.const)?h0(e,r.const,n):s.IsNumber(r.const)?T0(e,r.const,n):s.IsString(r.const)?E0(e,r.const,n):H()}function DE(e,r,n){return Pe(n)?K(e,r,n):x(e)}function GE(e,r,n){return tr(n)?x(e):K(e,r,n)}function $E(e,r,n){return be(n)?x(e):K(e,r,n)}function _0(e,r,n){return Ge(r)?Ge(n)?x(e):F():x(e)}function I0(e,r,n){return Pe(n)&&gr(n.extends)?F():(()=>{let o=re(e,r,n);return Ae(o)?_0(o.inferred,r,n):F()})()}function b0(e,r){return e.reduce((n,o)=>o in r?Ae(r[o])?{...n,...r[o].inferred}:H():H(),{})}function S0(e,r,n){let o={};for(let c of s.Keys(n))o[c]=c in r?I0({},r[c],n[c]):Ge(n[c])?Pe(n[c])?x(y.Assign(e,{[n[c].name]:n[c].extends})):x(e):F();let i=s.Values(o).every(c=>Ae(c)),a=i?b0(s.Keys(o),o):{};return i?x(a):F()}function O0(e,r,n){let o=S0(e,r,n);return Ae(o)?x(y.Assign(e,o.inferred)):F()}function A0(e,r,n){return O0(e,r,n)}function jE(e,r,n){return k(n)?A0(e,r,n.properties):K(e,N(r),n)}function qE(e,r,n){return tt(n)?re(e,r,n.item):K(e,nr(r),n)}function BE(e,r,n){return ve(n)?x(e):K(e,r,n)}function FE(e,r,n){return rr(n)?x(e):K(e,r,n)}function HE(e,r,n){let o=nt(r);return re(e,o,n)}function Mu(e,r){return y.Create({"~kind":"Inferrable"},{name:e,type:r},{})}function ga(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 Du(e){return Wr(e)?Pe(e.items)?te(e.items.extends)?Mu(e.items.name,e.items.extends.items):It(e.items.extends)?Mu(e.items.name,e.items.extends):void 0:H():void 0}function Pc(e){return Pe(e)?Mu(e.name,e.extends):void 0}function Gu(e,r,n=[]){let[o,...i]=e;return A(o)?(()=>{let a=re({},o,r);return Ae(a)?Gu(i,r,[...n,o]):void 0})():n}function KE(e,r,n,o){let i=Gu(n,o);return s.IsArray(i)?x(y.Assign(e,{[r]:Ke(i)})):F()}function Uc(e,r,n,o){let i=Gu(n,o);return s.IsArray(i)?x(y.Assign(e,{[r]:q(i)})):F()}function x0(e){return[...e].reverse()}function $u(e,r){return r?x0(e):e}function R0(e){let r=e.length>0?e[0]:void 0,n=A(r)?Du(r):void 0;return A(n)}function C0(e,r,n,o,i,a){let c=re(e,n,i);return Ae(c)?zE(c.inferred,r,o,a):F()}function P0(e,r,n,o,i){let a=Du(o);return ga(a)?KE(e,a.name,$u(n,r),a.type):(()=>{let[c,...l]=n;return A(c)?C0(e,r,c,l,o,i):F()})()}function U0(e,r,n,o){let[i,...a]=o;return A(i)?P0(e,r,n,i,a):s.IsEqual(n.length,0)?x(e):F()}function zE(e,r,n,o){return U0(e,r,n,o)}function w0(e,r,n){let o=wc(e,{callstack:[]},n),i=R0(o);return zE(e,i,$u(r,i),$u(o,i))}function YE(e,r,n){let o=Pc(n);return ga(o)?Uc(e,o.name,r,o.type):(()=>{let[i,...a]=r;return A(i)?(()=>{let c=re(e,i,n);return Ae(c)?YE(c.inferred,a,n):F()})():x(e)})()}function VE(e,r,n){let o=wc(e,{callstack:[]},r);return V(n)?w0(e,o,n.items):te(n)?YE(e,o,n.items):K(e,Ke(o),n)}function QE(e,r,n){return Rt(n)?x(e):or(n)?x(e):K(e,r,n)}function WE(e,r,n){let[o,...i]=n;return A(o)?(()=>{let a=re(e,r,o);return Ae(a)?x(a.inferred):WE(e,r,i)})():F()}function ju(e,r,n){let[o,...i]=r;return A(o)?(()=>{let a=WE(e,o,n);return Ae(a)?ju(a.inferred,i,n):F()})():x(e)}function ZE(e,r,n){let o=Pc(n);return ga(o)?Uc(e,o.name,r,o.type):O(n)?ju(e,r,n.anyOf):ju(e,r,[n])}function XE(e,r,n){return Pe(n)?K(e,r,n):pt(n)?x(e):It(n)?x(e):F()}function JE(e,r,n){return Rt(n)?x(e):K(e,r,n)}function re(e,r,n){return pt(r)?yE(e,r,n):te(r)?hE(e,r,r.items,n):at(r)?TE(e,r.iteratorItems,n):At(r)?EE(e,r,n):lt(r)?_E(e,r,n):$e(r)?IE(e,r.parameters,r.instanceType,n):Ue(r)?bE(e,r,n):je(r)?SE(e,r.parameters,r.returnType,n):He(r)?OE(e,r,n):w(r)?vE(e,r.allOf,n):st(r)?kE(e,r.iteratorItems,n):X(r)?ME(e,r,n):gr(r)?DE(e,r,n):tr(r)?GE(e,r,n):be(r)?$E(e,r,n):k(r)?jE(e,r.properties,n):tt(r)?qE(e,r.item,n):ve(r)?BE(e,r,n):rr(r)?FE(e,r,n):we(r)?HE(e,r.pattern,n):V(r)?VE(e,r.items,n):or(r)?QE(e,r,n):O(r)?ZE(e,r.anyOf,n):It(r)?XE(e,r,n):Rt(r)?JE(e,r,n):F()}function Ao(e,r,n={}){return P("Interface",[e,r],n)}function No(e){return A(e)&&s.HasPropertyKey(e,"action")&&s.IsEqual(e.action,"Interface")}function e_(e,r,n={}){return C({},Ao(e,r,n))}function N0(e,r,n){return e.includes(n)?!0:en([...e,n],r,r[n])}function t_(e,r,n){let o=uc(n);return kn(e,r,o)}function kn(e,r,n){let[o,...i]=n;return A(o)?en(e,r,o)?!0:kn(e,r,i):!1}function en(e,r,n){return pe(n)?N0(e,r,n.$ref):te(n)?en(e,r,n.items):at(n)?en(e,r,n.iteratorItems):$e(n)?kn(e,r,[...n.parameters,n.instanceType]):je(n)?kn(e,r,[...n.parameters,n.returnType]):No(n)?t_(e,r,n.parameters[1]):w(n)?kn(e,r,n.allOf):st(n)?en(e,r,n.iteratorItems):k(n)?t_(e,r,n.properties):tt(n)?en(e,r,n.item):O(n)?kn(e,r,n.anyOf):V(n)?kn(e,r,n.items):Se(n)?en(e,r,rt(n)):!1}function Nc(e,r,n){return en(e,r,n)}function L0(e,r){return r.reduce((n,o)=>o in e?Nc([o],e,e[o])?[...n,o]:n:H(),[])}function r_(e){let r=ty(e);return L0(e,r)}function v0(e,r,n){return n.includes(r)?n:r in e?tn(e,e[r],[...n,r]):H()}function n_(e,r,n){let o=uc(r);return Lo(e,o,n)}function Lo(e,r,n){return r.reduce((o,i)=>tn(e,i,o),n)}function tn(e,r,n){return pe(r)?v0(e,r.$ref,n):te(r)?tn(e,r.items,n):at(r)?tn(e,r.iteratorItems,n):$e(r)?Lo(e,[...r.parameters,r.instanceType],n):je(r)?Lo(e,[...r.parameters,r.returnType],n):No(r)?n_(e,r.parameters[1],n):w(r)?Lo(e,r.allOf,n):st(r)?tn(e,r.iteratorItems,n):k(r)?n_(e,r.properties,n):tt(r)?tn(e,r.item,n):O(r)?Lo(e,r.anyOf,n):V(r)?Lo(e,r.items,n):Se(r)?tn(e,rt(r),n):n}function o_(e,r,n){return tn(e,n,[r])}function k0(e){return go()}function M0(e){return s.Keys(e).reduce((r,n)=>({...r,[n]:ar(e[n])}),{})}function ya(e){return e.reduce((r,n)=>[...r,ar(n)],[])}function ar(e){return pe(e)?k0(e.$ref):te(e)?Bt(ar(e.items),rc(e)):at(e)?Xt(ar(e.iteratorItems)):$e(e)?Hr(ya(e.parameters),ar(e.instanceType)):je(e)?Kr(ya(e.parameters),ar(e.returnType)):w(e)?wt(ya(e.allOf)):st(e)?er(ar(e.iteratorItems)):k(e)?N(M0(e.properties)):tt(e)?nr(ar(e.item)):Se(e)?mc(bo(e),ar(rt(e))):O(e)?q(ya(e.anyOf)):V(e)?Ke(ya(e.items)):e}function D0(e,r){return r in e?ar(e[r]):Je()}function i_(e){return D0(e.$defs,e.$ref)}function G0(e,r,n){let o=Ct(e,{callstack:[]},r),i=ha({},{callstack:[]},n);return Ne([...o,N(i)])}function $0(e,r){return s.Keys(e).filter(o=>r.includes(o)).reduce((o,i)=>{let a=e[i],c=No(a)?G0(e,a.parameters[0],a.parameters[1]):a;return{...o,[i]:c}},{})}function a_(e,r,n){let o=o_(e,r,n),i=$0(e,o);return Jt(i,r)}function s_(e,r){return r in e?pe(e[r])?s_(e,e[r].$ref):e[r]:Z()}function sr(e,r){return s_(e,r)}function c_(e){return me(e)?i_(e):e}function ot(e,r,n){let o=c_(r),i=c_(n);return re(e,o,i)}function j0(e,r,n){if(Pe(r)||vo(r)||L.IsExtendsTrueLike(ot({},r,n)))return;let o={parameter:e,extends:n,received:r};throw new Error("Generic argument does not satify constraint",{cause:o})}function p_(e,r,n,o,i){let a=I(e,r,i);return j0(n,a,o),y.Assign(e,{[n]:a})}function q0(e,r,n,o,i){let a=I(e,r,n.extends),c=I(e,r,n.equals),[l,...d]=i;return A(l)?qu(p_(e,r,n.name,a,l),r,o,d):qu(p_(e,r,n.name,a,c),r,o,[])}function qu(e,r,n,o){let[i,...a]=n;return A(i)?q0(e,r,i,a,o):e}function u_(e,r,n,o){return qu(e,r,n,o)}function B0(e){return s.IsGreaterThan(e.length,0)?e[0]:""}function l_(e,r,n,o){let i=Ct(e,r,o);return yc(n,i)}function F0(e,r,n,o){return l_(e,r,Le(n),o)}function H0(e,r,n,o,i,a){let c=Ct(e,r,a),l=u_(e,r,o,c),d=I(l,{callstack:[...r.callstack,n]},i);return I(e,r,d)}function Lc(e,r,n,o){let[i,a]=wg(e,n,o);return fo(a)?s.IsEqual(B0(r.callstack),i)?F0(e,r,i,o):H0(e,r,i,a.parameters,a.expression,o):l_(e,r,n,o)}function yc(e,r){return y.Create({"~kind":"Call"},{target:e,arguments:r},{})}function m_(e,r){return Lc({},{callstack:[]},e,r)}function vo(e){return S(e,"Call")}function d_(e){return tt(e)?d_(e.item):e}function K0(e,r,n,o){let i=I(e,r,n);return y.Update(d_(i),{},o)}function f_(e,r,n,o){return v(e,[n])?K0(e,r,n,o):sa(n,o)}function g_(e,r){return e(r)}function y_(e,r){return s.IsString(r)?Y(g_(e,r)):Y(r)}function h_(e,r){let n=nt(r);return Tr(e,n)}function T_(e,r){let n=r.map(o=>Tr(e,o));return q(n)}function Tr(e,r){return X(r)?y_(e,r.const):we(r)?h_(e,r.pattern):O(r)?T_(e,r.anyOf):r}function Hi(e,r={}){return P("Capitalize",[e],r)}function E_(e,r={}){return C({},Hi(e,r))}function Ki(e,r={}){return P("Lowercase",[e],r)}function __(e,r={}){return C({},Ki(e,r))}function zi(e,r={}){return P("Uncapitalize",[e],r)}function I_(e,r={}){return C({},zi(e,r))}function Yi(e,r={}){return P("Uppercase",[e],r)}function b_(e,r={}){return C({},Yi(e,r))}var z0=e=>e[0].toUpperCase()+e.slice(1),Y0=e=>e.toLowerCase(),V0=e=>e[0].toLowerCase()+e.slice(1),Q0=e=>e.toUpperCase();function W0(e,r,n,o){let i=I(e,r,n);return y.Update(Tr(z0,i),{},o)}function S_(e,r,n,o){return v(e,[n])?W0(e,r,n,o):Hi(n,o)}function Z0(e,r,n,o){let i=I(e,r,n);return y.Update(Tr(Y0,i),{},o)}function O_(e,r,n,o){return v(e,[n])?Z0(e,r,n,o):Ki(n,o)}function X0(e,r,n,o){let i=I(e,r,n);return y.Update(Tr(V0,i),{},o)}function A_(e,r,n,o){return v(e,[n])?X0(e,r,n,o):zi(n,o)}function J0(e,r,n,o){let i=I(e,r,n);return y.Update(Tr(Q0,i),{},o)}function x_(e,r,n,o){return v(e,[n])?J0(e,r,n,o):Yi(n,o)}function Vi(e,r,n,o,i={}){return P("Conditional",[e,r,n,o],i)}function R_(e,r,n,o,i={}){return C({},Vi(e,r,n,o,i))}function eD(e,r,n,o,i,a,c){let l=I(e,r,n),d=I(e,r,o),f=ot(e,l,d);return y.Update(L.IsExtendsUnion(f)?q([I(f.inferred,r,i),I(e,r,a)]):L.IsExtendsTrue(f)?I(f.inferred,r,i):I(e,r,a),{},c)}function C_(e,r,n,o,i,a,c){return v(e,[n,o])?eD(e,r,n,o,i,a,c):Vi(n,o,i,a,c)}function Qi(e,r={}){return P("ConstructorParameters",[e],r)}function P_(e,r={}){return C({},Qi(e,r))}function tD(e){return $e(e)?I({},{callstack:[]},Ke(e.parameters)):Z()}function rD(e,r,n,o){let i=I(e,r,n);return y.Update(tD(i),{},o)}function U_(e,r,n,o){return v(e,[n])?rD(e,r,n,o):Qi(n,o)}function Wi(e,r,n={}){return P("Exclude",[e,r],n)}function w_(e,r,n={}){return C({},Wi(e,r,n))}function N_(e,r){return e.reduce((n,o)=>[...n,...L_(o,r)],[])}function L_(e,r){let n=ot({},e,r);return L.IsExtendsTrueLike(n)?[]:[e]}function nD(e,r){let n=Ue(e)?N_(Ft(e.enum),r):O(e)?N_(ir(e.anyOf),r):L_(e,r);return hr(n)}function oD(e,r,n,o,i){let a=I(e,r,n),c=I(e,r,o);return y.Update(nD(a,c),{},i)}function vc(e,r,n,o,i){return v(e,[n,o])?oD(e,r,n,o,i):Wi(n,o,i)}function Zi(e,r,n={}){return P("Extract",[e,r],n)}function v_(e,r,n={}){return C({},Zi(e,r,n))}function k_(e,r){return e.reduce((n,o)=>[...n,...M_(o,r)],[])}function M_(e,r){let n=ot({},e,r);return L.IsExtendsTrueLike(n)?[e]:[]}function iD(e,r){let n=Ue(e)?k_(Ft(e.enum),r):O(e)?k_(ir(e.anyOf),r):M_(e,r);return hr(n)}function aD(e,r,n,o,i){let a=I(e,r,n),c=I(e,r,o);return y.Update(iD(a,c),{},i)}function D_(e,r,n,o,i){return v(e,[n,o])?aD(e,r,n,o,i):Zi(n,o,i)}var sD=new RegExp("^(?:0|[1-9][0-9]*)$");function ko(e){let r=`${e}`;return sD.test(r)?parseInt(r):e}function cD(e){return Y(ko(e))}function G_(e){return e.map(r=>$_(r))}function $_(e){return w(e)?wt(G_(e.allOf)):O(e)?q(G_(e.anyOf)):X(e)?cD(e.const):e}function j_(e,r){let n=$_(r),o=ot({},n,Nt());return L.IsExtendsTrueLike(o)?e:Z()}function q_(e,r){let n=sr(e,r);return cr(n)}function kc(e){return e.reduce((r,n)=>[...r,...cr(n)],[])}function B_(e){let r=Ft(e);return kc(r)}function F_(e){let r=Ne(e);return cr(r)}function H_(e){return[`${e}`]}function K_(e){let r=nt(e);return cr(r)}function cr(e){return me(e)?q_(e.$defs,e.$ref):Ue(e)?B_(e.enum):w(e)?F_(e.allOf):X(e)?H_(e.const):we(e)?K_(e.pattern):O(e)?kc(e.anyOf):[]}function Mo(e){return cr(e)}function pD(e,r){return r in e?[e[r]]:[]}function uD(e,r){return r.reduce((n,o)=>[...n,...pD(e,o)],[])}function z_(e,r){let n=Mo(r),o=uD(e,n);return hr(o)}function lD(e){return Y(ko(e))}function Y_(e){return e.map(r=>Bu(r))}function Bu(e){return w(e)?wt(Y_(e.allOf)):O(e)?q(Y_(e.anyOf)):X(e)?lD(e.const):e}function mD(e,r){return e.reduceRight((n,o,i)=>{let a=ot({},Y(i),r);return L.IsExtendsTrueLike(a)?[o,...n]:n},[])}function dD(e,r){let n=Bu(r),o=mD(e,n);return vn(o)}function fD(e){return vn(e)}function V_(e,r){return be(r)||He(r)?fD(e):dD(e,r)}function gD(e){return e.reduce((r,n)=>cc(n)?[...r,Y(n)]:r,[])}function Do(e){let r=gD(e);return q(r)}function xo(e,r,n={}){return P("Index",[e,r],n)}function Q_(e,r,n={}){let o=s.IsArray(r)?Do(r):r;return C({},xo(e,o,n))}function W_(e,r){let n=sr(e,r);return Ht(n)}function yD(e,r){let n=s.Keys(e).filter(g=>!s.HasPropertyKey(r,g)),o=s.Keys(r).filter(g=>!s.HasPropertyKey(e,g)),i=s.Keys(e).filter(g=>s.HasPropertyKey(r,g)),a=n.reduce((g,T)=>({...g,[T]:e[T]}),{}),c=o.reduce((g,T)=>({...g,[T]:r[T]}),{}),l=i.reduce((g,T)=>({...g,[T]:Ne([e[T],r[T]])}),{}),d=y.Assign(a,c);return y.Assign(d,l)}function Z_(e){return e.reduce((r,n)=>yD(r,Ht(n)),{})}function X_(e){let r=AE(Ke(e));return Ht(r)}function hD(e,r){return s.Keys(e).filter(i=>i in r).reduce((i,a)=>({...i,[a]:hr([e[a],r[a]])}),{})}function J_(e,r){let[n,...o]=e;return A(n)?J_(o,hD(r,Ht(n))):r}function eI(e){let[r,...n]=e;return A(r)?J_(n,Ht(r)):H()}function Ht(e){return me(e)?W_(e.$defs,e.$ref):w(e)?Z_(e.allOf):O(e)?eI(e.anyOf):V(e)?X_(e.items):k(e)?e.properties:{}}function Go(e){let r=Ht(e);return N(r)}function TD(e){return me(e)||w(e)||O(e)?Go(e):e}function ED(e,r){let n=TD(e);return te(n)?j_(n.items,r):k(n)?z_(n.properties,r):V(n)?V_(n.items,r):Z()}function _D(e,r,n,o,i){let a=I(e,r,n),c=I(e,r,o);return y.Update(ED(a,c),{},i)}function tI(e,r,n,o,i){return v(e,[n,o])?_D(e,r,n,o,i):xo(n,o,i)}function Xi(e,r={}){return P("InstanceType",[e],r)}function rI(e,r={}){return C({},Xi(e,r))}function ID(e){return $e(e)?e.instanceType:Z()}function bD(e,r,n,o){let i=I(e,r,n);return y.Update(ID(i),{},o)}function nI(e,r,n,o={}){return v(e,[n])?bD(e,r,n,o):Xi(n,o)}function SD(e,r,n,o,i){let a=Ct(e,{callstack:[]},n),c=ha(e,{callstack:[]},o),l=Ne([...a,N(c)]);return y.Update(l,{},i)}function oI(e,r,n,o,i){return v(e,n)?SD(e,r,n,o,i):Ao(n,o,i)}function Ro(e,r={}){return P("KeyOf",[e],r)}function iI(e,r={}){return C({},Ro(e,r))}function aI(){return q([Nt(),bt(),Eo()])}function sI(e){return Nt()}function OD(e){return e.reduce((n,o)=>cc(o)?[...n,Y(ko(o))]:H(),[])}function cI(e){let r=s.Keys(e),n=OD(r);return vn(n)}function pI(e){return bo(e)}function uI(e){let r=e.map((n,o)=>Y(o));return vn(r)}function AD(e){return me(e)||w(e)||O(e)?Go(e):e}function xD(e){let r=AD(e);return pt(r)?aI():te(r)?sI(r.items):k(r)?cI(r.properties):Se(r)?pI(r):V(r)?uI(r.items):Z()}function RD(e,r,n,o){let i=I(e,r,n);return y.Update(xD(i),{},o)}function lI(e,r,n,o){return v(e,[n])?RD(e,r,n,o):Ro(n,o)}function CD(e){let r=nt(e);return Fu(r)}function mI(e){return e.reduce((r,n)=>[...r,...Fu(n)],[])}function Fu(e){return Ue(e)?mI(Ft(e.enum)):To(e)||ho(e)?[e]:we(e)?CD(e.pattern):O(e)?mI(e.anyOf):[]}function dI(e){return Fu(e)}function Oo(e,r,n,o,i={}){return P("Mapped",[e,r,n,o],i)}function fI(e,r,n,o,i={}){return C({},Oo(e,r,n,o,i))}function PD(e,r,n,o,i){let a=y.Assign(e,{[n.name]:o}),c=I(a,r,i);return we(c)?nt(c.pattern):c}function UD(e,r,n,o,i){let a=y.Assign(e,{[n.name]:o});return I(a,r,i)}function wD(e,r,n,o,i,a){let c=UD(e,r,n,o,a),l=PD(e,r,n,o,i);return To(l)||ho(l)?{[l.const]:c}:{}}function ND(e,r,n,o,i,a){return o.reduce((c,l)=>({...c,...wD(e,r,n,l,i,a)}),{})}function LD(e,r,n,o,i,a){let c=dI(o),l=ND(e,r,n,c,i,a);return N(l)}function vD(e,r,n,o,i,a,c){let l=I(e,r,o);return y.Update(LD(e,r,n,l,i,a),{},c)}function gI(e,r,n,o,i,a,c){return v(e,[o])?vD(e,r,n,o,i,a,c):Oo(n,o,i,a,c)}function kD(e,r){return s.Keys(e).filter(o=>r.includes(o)).reduce((o,i)=>({...o,[i]:a_(e,i,e[i])}),{})}function MD(e,r){return s.Keys(e).filter(o=>!r.includes(o)).reduce((o,i)=>({...o,[i]:I(e,{callstack:[]},e[i])}),{})}function DD(e,r){let n=r_(e),o=kD(e,n),i=MD(e,n),a={...o,...i};return y.Update(a,{},r)}function yI(e,r,n,o){let i=y.Assign(e,n);return DD(i,o)}function Ji(e,r={}){return P("NonNullable",[e],r)}function hI(e,r={}){return C({},Ji(e,r))}function GD(e){let r=q([Qr(),So()]);return vc({},{callstack:[]},e,r,{})}function $D(e,r,n,o){let i=I(e,r,n);return y.Update(GD(i),{},o)}function TI(e,r,n,o){return v(e,[n])?$D(e,r,n,o):Ji(n,o)}function Mc(e){let r=Go(e);return k(r)?r.properties:H()}function ea(e,r,n={}){return P("Omit",[e,r],n)}function EI(e,r,n={}){let o=s.IsArray(r)?Do(r):r;return C({},ea(e,o,n))}function jD(e,r){return s.Keys(e).reduce((o,i)=>r.includes(i)?o:{...o,[i]:e[i]},{})}function qD(e,r){let n=Mc(e),o=Mo(r),i=jD(n,o);return N(i)}function BD(e,r,n,o,i){let a=I(e,r,n),c=I(e,r,o);return y.Update(qD(a,c),{},i)}function _I(e,r,n,o,i){return v(e,[n,o])?BD(e,r,n,o,i):ea(n,o,i)}function Co(e,r){return P("Options",[e,r],{})}function Dc(e,r){return C({},Co(e,r))}function FD(e,r,n,o){let i=I(e,r,n);return y.Update(i,{},o)}function II(e,r,n,o){return v(e,[n])?FD(e,r,n,o):Co(n,o)}function ta(e,r={}){return P("Parameters",[e],r)}function bI(e,r={}){return C({},ta(e,r))}function HD(e){return je(e)?I({},{callstack:[]},Ke(e.parameters)):Z()}function KD(e,r,n,o){let i=I(e,r,n);return y.Update(HD(i),{},o)}function SI(e,r,n,o){return v(e,[n])?KD(e,r,n,o):ta(n,o)}function ra(e,r={}){return P("Partial",[e],r)}function OI(e,r={}){return C({},ra(e,r))}function AI(e,r){let n=sr(e,r),o=rn(n);return Jt(y.Assign(e,{[r]:o}),r)}function xI(e){let r=e.map(n=>rn(n));return Ne(r)}function RI(e){let r=e.map(n=>rn(n));return q(r)}function CI(e){let r=s.Keys(e).reduce((o,i)=>({...o,[i]:Js(e[i])}),{});return N(r)}function rn(e){return me(e)?AI(e.$defs,e.$ref):w(e)?xI(e.allOf):O(e)?RI(e.anyOf):k(e)?CI(e.properties):N({})}function zD(e,r,n,o){let i=I(e,r,n);return y.Update(rn(i),{},o)}function PI(e,r,n,o){return v(e,[n])?zD(e,r,n,o):ra(n,o)}function na(e,r,n={}){return P("Pick",[e,r],n)}function UI(e,r,n={}){let o=s.IsArray(r)?Do(r):r;return C({},na(e,o,n))}function YD(e,r){return s.Keys(e).reduce((o,i)=>r.includes(i)?y.Assign(o,{[i]:e[i]}):o,{})}function VD(e,r){let n=Mc(e),o=Mo(r),i=YD(n,o);return N(i)}function QD(e,r,n,o,i){let a=I(e,r,n),c=I(e,r,o);return y.Update(VD(a,c),{},i)}function wI(e,r,n,o,i){return v(e,[n,o])?QD(e,r,n,o,i):na(n,o,i)}function oa(e,r={}){return P("ReadonlyType",[e],r)}function NI(e,r={}){return C({},oa(e,r))}function LI(e){return Fr(Bt(e))}function vI(e,r){let n=sr(e,r),o=nn(n);return Jt(y.Assign(e,{[r]:o}),r)}function kI(e){let r=e.map(n=>nn(n));return Ne(r)}function MI(e){let r=s.Keys(e).reduce((o,i)=>({...o,[i]:tc(e[i])}),{});return N(r)}function DI(e){return Fr(Ke(e))}function GI(e){let r=e.map(n=>nn(n));return q(r)}function nn(e){return te(e)?LI(e.items):me(e)?vI(e.$defs,e.$ref):w(e)?kI(e.allOf):k(e)?MI(e.properties):V(e)?DI(e.items):O(e)?GI(e.anyOf):e}function WD(e,r,n,o){let i=I(e,r,n);return y.Update(nn(i),{},o)}function $I(e,r,n,o){return v(e,[n])?WD(e,r,n,o):oa(n,o)}function jI(e){return St(Dt,e)}function qI(e){return N({true:e,false:e})}function BI(e,r){let n=ca(e);return on(n,r)}function FI(e,r){return St(_o,r)}function HI(e,r){let n=Ne(e);return on(n,r)}function KI(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 St(Io,r)}function YI(e,r){return s.HasPropertyKey(e,"pattern")&&(s.IsString(e.pattern)||e.pattern instanceof RegExp)?St(e.pattern.toString(),r):St(Dt,r)}function VI(e,r){let n=Ac(e);return xc(n)?on(nt(e),r):St(e,r)}function ZD(e){return e.some(r=>ve(r)||be(r)||He(r))}function XD(e,r){return s.IsEqual(ZD(e),!0)?St(Dt,r):void 0}function JD(e,r){return e.reduce((n,o)=>X(o)&&(s.IsString(o.const)||s.IsNumber(o.const))?{...n,[o.const]:r}:n,{})}function eG(e,r){let n=JD(e,r);return N(n)}function QI(e,r){let n=ir(e),o=XD(n,r);return A(o)?o:eG(n,r)}function on(e,r){return pt(e)?jI(r):lt(e)?qI(r):Ue(e)?BI(e.enum,r):He(e)?FI(e,r):w(e)?HI(e.allOf,r):X(e)?KI(e.const,r):be(e)?zI(e,r):O(e)?QI(e.anyOf,r):ve(e)?YI(e,r):we(e)?VI(e.pattern,r):N({})}function tG(e,r,n,o,i){let a=I(e,r,n),c=I(e,r,o);return y.Update(on(a,c),{},i)}function WI(e,r,n,o,i){return v(e,[n])?tG(e,r,n,o,i):Bi(n,o,i)}function ZI(e,r,n){return n in e?Nc([n],e,e[n])?Le(n):I(e,r,e[n]):Le(n)}function XI(e,r){let n=sr(e,r),o=an(n);return Jt(y.Assign(e,{[r]:o}),r)}function JI(e){let r=e.map(n=>an(n));return Ne(r)}function eb(e){let r=e.map(n=>an(n));return q(r)}function tb(e){let r=s.Keys(e).reduce((o,i)=>({...o,[i]:mo(e[i])}),{});return N(r)}function an(e){return me(e)?XI(e.$defs,e.$ref):w(e)?JI(e.allOf):O(e)?eb(e.anyOf):k(e)?tb(e.properties):N({})}function ia(e,r={}){return P("Required",[e],r)}function rb(e,r={}){return C({},ia(e,r))}function rG(e,r,n,o){let i=I(e,r,n);return y.Update(an(i),{},o)}function nb(e,r,n,o){return v(e,[n])?rG(e,r,n,o):ia(n,o)}function aa(e,r={}){return P("ReturnType",[e],r)}function ob(e,r={}){return C({},aa(e,r))}function nG(e){return je(e)?e.returnType:Z()}function oG(e,r,n,o){let i=I(e,r,n);return y.Update(nG(i),{},o)}function ib(e,r,n,o){return v(e,[n])?oG(e,r,n,o):aa(n,o)}function ab(e){return y.Create({"~kind":"TemplateLiteral"},{type:"string",pattern:e},{})}function iG(e){return e.join("|")}function aG(e){return e.slice(1,e.length-1)}function sG(e,r,n){return sn(r,`${n}${e}`)}function cG(e,r){return sn(e,`${r}${Qg}`)}function pG(e,r){return sn(e,`${r}${sc}`)}function uG(e,r){return sn(e,`${r}${pc}`)}function lG(e,r){return Ku(q([Y("false"),Y("true")]),e,r)}function mG(e,r){return sn(e,`${r}${lc}`)}function dG(e,r,n){return sn(r,`${n}${aG(e)}`)}function fG(e,r,n,o=[]){let i=Ft(e);return Hu(i,r,n)}function Hu(e,r,n,o=[]){let[i,...a]=e;return A(i)?Hu(a,r,n,[...o,Ku(i,[],"")]):sn(r,`${n}(${iG(o)})`)}function Ku(e,r,n){return Ue(e)?fG(e.enum,r,n):He(e)?pG(r,n):X(e)?sG(e.const,r,n):At(e)?cG(r,n):lt(e)?lG(r,n):be(e)?uG(r,n):ve(e)?mG(r,n):we(e)?dG(e.pattern,r,n):O(e)?Hu(e.anyOf,r,n):Pg}function sn(e,r){let[n,...o]=e;return A(n)?Ku(n,o,r):r}function gG(e){return`^${sn(e,"")}$`}function sb(e){let r=gG(e);return ab(r)}function yG(e,r,n,o){let i=Ct(e,r,n);return y.Update(sb(i),{},o)}function cb(e,r,n,o){return v(e,n)?yG(e,r,n,o):Fi(n,o)}function hG(e){return Wr(e)?V(e.items)?zu(e.items.items):Pe(e.items)?[e]:pe(e.items)?[e]:[Z()]:[e]}function zu(e){return e.reduce((n,o)=>[...n,...hG(o)],[])}function TG(e,r){return r in e}function EG(e,r){return w(r)?v(e,r.allOf):O(r)?v(e,r.anyOf):pe(r)?TG(e,r.$ref):!0}function v(e,r){let[n,...o]=r;return A(n)?EG(e,n)?v(e,o):!1:!0}function Ta(e,r,n){return Sg(e)?Ta(e.type,"remove",n):Eg(e)?Ta(e.type,r,"remove"):Ig(e)?Ta(e.type,"add",n):hg(e)?Ta(e.type,r,"add"):[e,r,n]}function _G(e,r){return s.IsEqual(e,"remove")?ec(r):s.IsEqual(e,"add")?_t(r):r}function IG(e,r){return s.IsEqual(e,"remove")?mo(r):s.IsEqual(e,"add")?Et(r):r}function ha(e,r,n){return s.Keys(n).reduce((o,i)=>({...o,[i]:I(e,r,n[i])}),{})}function wc(e,r,n){let o=Ct(e,r,n);return zu(o)}function Ct(e,r,n){return n.map(o=>I(e,r,o))}function bG(e,r,n,o,i){return s.IsEqual(n,"Awaited")?f_(e,r,o[0],i):s.IsEqual(n,"Capitalize")?S_(e,r,o[0],i):s.IsEqual(n,"Conditional")?C_(e,r,o[0],o[1],o[2],o[3],i):s.IsEqual(n,"ConstructorParameters")?U_(e,r,o[0],i):s.IsEqual(n,"Evaluate")?LE(e,r,o[0],i):s.IsEqual(n,"Exclude")?vc(e,r,o[0],o[1],i):s.IsEqual(n,"Extract")?D_(e,r,o[0],o[1],i):s.IsEqual(n,"Index")?tI(e,r,o[0],o[1],i):s.IsEqual(n,"InstanceType")?nI(e,r,o[0],i):s.IsEqual(n,"Interface")?oI(e,r,o[0],o[1],i):s.IsEqual(n,"KeyOf")?lI(e,r,o[0],i):s.IsEqual(n,"Lowercase")?O_(e,r,o[0],i):s.IsEqual(n,"Mapped")?gI(e,r,o[0],o[1],o[2],o[3],i):s.IsEqual(n,"Module")?yI(e,r,o[0],i):s.IsEqual(n,"NonNullable")?TI(e,r,o[0],i):s.IsEqual(n,"Pick")?wI(e,r,o[0],o[1],i):s.IsEqual(n,"Options")?II(e,r,o[0],o[1]):s.IsEqual(n,"Parameters")?SI(e,r,o[0],i):s.IsEqual(n,"Partial")?PI(e,r,o[0],i):s.IsEqual(n,"Omit")?_I(e,r,o[0],o[1],i):s.IsEqual(n,"ReadonlyType")?$I(e,r,o[0],i):s.IsEqual(n,"Record")?WI(e,r,o[0],o[1],i):s.IsEqual(n,"Required")?nb(e,r,o[0],i):s.IsEqual(n,"ReturnType")?ib(e,r,o[0],i):s.IsEqual(n,"TemplateLiteral")?cb(e,r,o[0],i):s.IsEqual(n,"Uncapitalize")?A_(e,r,o[0],i):s.IsEqual(n,"Uppercase")?x_(e,r,o[0],i):P(n,o,i)}function I(e,r,n){let o=xn(n),i=Ta(n,Rn(n)?"add":"none",Ge(n)?"add":"none"),a=Ut(i[0])?i[0].Clone():i[0],c=pe(a)?ZI(e,r,a.$ref):te(a)?Bt(I(e,r,a.items),rc(a)):at(a)?Xt(I(e,r,a.iteratorItems),Ag(a)):vo(a)?Lc(e,r,a.target,a.arguments):$e(a)?Hr(Ct(e,r,a.parameters),I(e,r,a.instanceType),Rg(a)):Og(a)?bG(e,r,a.action,a.parameters,a.options):je(a)?Kr(Ct(e,r,a.parameters),I(e,r,a.returnType),Cg(a)):w(a)?wt(Ct(e,r,a.allOf),kg(a)):st(a)?er(I(e,r,a.iteratorItems),Zg(a)):k(a)?N(ha(e,r,a.properties),ry(a)):tt(a)?nr(I(e,r,a.item),oy(a)):Se(a)?dc(xt(a),I(e,r,rt(a))):Wr(a)?wn(I(e,r,a.items)):V(a)?Ke(wc(e,r,a.items),ay(a)):O(a)?q(Ct(e,r,a.anyOf),sy(a)):a,l=o?Fr(c):c;return _G(i[1],IG(i[2],l))}function C(e,r){return I(e,{callstack:[]},r)}function sa(e,r={}){return P("Awaited",[e],r)}function pb(e,r={}){return C({},sa(e,r))}function Tu(e,r={}){return P("Evaluate",[e],r)}function Kt(e,r={}){return C({},Tu(e,r))}function Eu(e,r={}){return P("Module",[e],r)}function ub(e,r={}){return C({},Eu(e,r))}function lb(...e){let[r,n,o]=ie.Match(e,{2:(c,l)=>s.IsString(c)?[{},c,l]:[c,l,{}],3:(c,l,d)=>[c,l,d],1:c=>[{},c,{}]}),i=rE(n),a=s.IsArray(i)&&s.IsEqual(i.length,2)?I(r,{callstack:[]},i[0]):Z();return y.Update(a,{},o)}var t={};Mt(t,{Any:()=>go,Array:()=>Bt,AsyncIterator:()=>Xt,Awaited:()=>pb,Base:()=>nc,BigInt:()=>ji,Boolean:()=>ac,Call:()=>m_,Capitalize:()=>E_,Codec:()=>oc,Conditional:()=>R_,Constructor:()=>Hr,ConstructorParameters:()=>P_,Cyclic:()=>Jt,Decode:()=>zg,DecodeBuilder:()=>$i,Encode:()=>Yg,EncodeBuilder:()=>Gi,Enum:()=>vg,Evaluate:()=>Kt,Exclude:()=>w_,Extends:()=>ot,ExtendsResult:()=>L,Extract:()=>v_,Function:()=>Kr,Generic:()=>zr,Identifier:()=>qi,Immutable:()=>Fr,Index:()=>Q_,Infer:()=>Di,InstanceType:()=>rI,Instantiate:()=>C,Integer:()=>Pn,Interface:()=>e_,Intersect:()=>wt,IsAny:()=>pt,IsArray:()=>te,IsAsyncIterator:()=>at,IsBase:()=>Ut,IsBigInt:()=>At,IsBoolean:()=>lt,IsCall:()=>vo,IsCodec:()=>Cn,IsConstructor:()=>$e,IsCyclic:()=>me,IsEnum:()=>Ue,IsFunction:()=>je,IsGeneric:()=>fo,IsIdentifier:()=>Wg,IsImmutable:()=>xn,IsInfer:()=>Pe,IsInteger:()=>He,IsIntersect:()=>w,IsIterator:()=>st,IsKind:()=>S,IsLiteral:()=>X,IsNever:()=>gr,IsNull:()=>tr,IsNumber:()=>be,IsObject:()=>k,IsOptional:()=>Ge,IsParameter:()=>ny,IsPromise:()=>tt,IsReadonly:()=>Rn,IsRecord:()=>Se,IsRef:()=>pe,IsRefine:()=>ic,IsRest:()=>Wr,IsSchema:()=>A,IsString:()=>ve,IsSymbol:()=>rr,IsTemplateLiteral:()=>we,IsThis:()=>iy,IsTuple:()=>V,IsUndefined:()=>or,IsUnion:()=>O,IsUnknown:()=>It,IsUnsafe:()=>py,IsVoid:()=>Rt,Iterator:()=>er,KeyOf:()=>iI,Literal:()=>Y,Lowercase:()=>__,Mapped:()=>fI,Module:()=>ub,Never:()=>Z,NonNullable:()=>hI,Null:()=>Qr,Number:()=>Nt,Object:()=>N,Omit:()=>EI,Optional:()=>Js,Options:()=>Dc,Parameter:()=>Un,Parameters:()=>bI,Partial:()=>OI,Pick:()=>UI,Promise:()=>nr,Readonly:()=>tc,ReadonlyType:()=>NI,Record:()=>mc,RecordKey:()=>bo,RecordKeyAsPattern:()=>xt,RecordValue:()=>rt,Ref:()=>Le,Refine:()=>Vg,Required:()=>rb,Rest:()=>wn,ReturnType:()=>ob,Script:()=>lb,String:()=>bt,Symbol:()=>Eo,TemplateLiteral:()=>iE,This:()=>fc,Tuple:()=>Ke,Uncapitalize:()=>I_,Undefined:()=>So,Union:()=>q,Unknown:()=>Je,Unsafe:()=>cy,Uppercase:()=>b_,Void:()=>gc});var mb="lowercase-email",Yu="iana-timezone",Vu="simple-time",Qu="simple-date-time";var SG=(e,r)=>RegExp(`^${e.source}(${r.source}${e.source})*$`),OG=/[a-zA-Z0-9-_]+/,AG=/\./,m_e=SG(OG,AG);var db="lowercase-domain";var $o="kebab-case";var fb="camel-case";var xG=new Set;function b(e,r,n={}){let o=r.map(i=>{let a=i;return a.$id?(xG.add(i),t.Ref(a.$id)):i});return t.Unsafe({...n,type:"object",discriminator:{propertyName:e},required:[e],oneOf:o})}function Be(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 qo=1e3,Gc=100,ye={limit:t.Optional(t.Integer({minimum:1,maximum:qo,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."}))},ze={...ye,limit:t.Optional(t.Integer({minimum:1,maximum:qo,default:Gc,description:`Maximum number of items to return in this page. Omit to use the public API default of ${Gc}.`}))},RG=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."}),h_e=t.Object({pagination:RG},{$id:"ResponseMetadata",description:"Metadata accompanying `data` on paginated operations, describing the full result set the page was taken from."});function E(e={}){return t.Unsafe({...e,type:"string"})}var jo=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:fb,minLength:i,maxLength:jo,...a});case"kebab-case":return t.String({format:$o,minLength:i,maxLength:jo,...a});case"email":return t.String({format:mb,minLength:i,maxLength:254,errorMessage:{format:"Must be a valid lowercase email address."},...a});case"lowercase-domain":return t.String({format:db,minLength:i,maxLength:jo,...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:jo,...a});case"long":return t.String({minLength:i,maxLength:5e4,...a});case"short":return t.String({minLength:i,maxLength:jo,...a});case"tsuga-formula":return t.String({format:"tsuga-formula",minLength:i,maxLength:jo,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:Xe(r)}}var Ea=["ingestion-api-key","operation-api-key","rum-public-token","dashboard","log-route","metric-route","monitor","notification-rule","notification-silence","slo"],$c=t.Array(t.Enum(Ea,{description:"Tsuga-managed asset type."}),{description:"Tsuga-managed asset types covered by the policy. An empty array means all supported asset types."});var Wu=["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"],P_e=t.Enum(Wu),CG=["CLUSTER_AGGREGATION_STRUCTURE"],U_e=t.Object({code:t.Enum(Wu),message:t.String()}),gb=[...Wu,...CG,"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"],yb=["INTERNAL_ERROR","INVALID_QUERY_TO_CLUSTER"];var PG=["NETWORK_ERROR","RESPONSE_PARSE_ERROR"],UG=[...gb,...yb,...PG],wG=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(Ea,{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."}),NG=b("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`."}),LG=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:NG},{description:"A single grok rule that failed to compile, with its position in the submitted rules and the structured compile error."}),hb=b("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(wG,{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(LG,{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."}),w_e=t.Object({code:t.Optional(t.Enum(UG,{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(hb)},{$id:"ErrorResponse",description:"Standard envelope for API errors"}),N_e=t.Object({code:t.Optional(t.Enum(gb,{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(hb)},{$id:"ClientErrorResponse",description:"Standard envelope for client (4XX) API errors"}),L_e=t.Object({code:t.Optional(t.Enum(yb,{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"}),v_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"}),k_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 m({body:e,description:r,method:n,operationId:o,params:i,tags:a,query:c,paginated:l,response:d,url:f}){return i?{buildUrl:T=>f.replace(/:[a-zA-Z_]+/g,_=>T[_.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},...l===void 0?{}:{paginated:l},...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},...l===void 0?{}:{paginated:l},...a===void 0?{}:{tags:a}}}function Tb(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 Zu="tsuga-cli";var Mn="/v0/oauth",Eb=m({description:"OAuth 2.1 authorization endpoint: validates the client and redirect URI, then redirects to the consent page",url:`${Mn}/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)"})}),_b=m({description:"OAuth 2.1 token endpoint: exchanges an authorization code (PKCE) or refresh token for a token pair",url:`${Mn}/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()})}),Z_e=m({description:"Resolve a signed authorization request handle for the consent page",url:`${Mn}/authorization-request`,method:"GET",query:t.Object({handle:t.String()}),response:t.Object({clientId:t.String(),clientName:t.String(),redirectUri:t.String()})}),X_e=m({description:"Approve or deny an OAuth authorization request from the consent page",url:`${Mn}/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"})})}),J_e=m({description:"Validate an OAuth access token (internal, for the MCP resource server)",url:`${Mn}/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"],kG=t.Object({id:t.String(),createdAt:E(),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(E())}),eIe=m({tags:["oauth"],description:"List OAuth grants: your own, or all users for admins",url:`${Mn}/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(kG)}),tIe=m({tags:["oauth"],description:"Delete an OAuth grant (own grant, or any grant for admins)",url:`${Mn}/grants/:id`,method:"DELETE",params:t.Object({id:t.String()}),response:R});function Ib(e,r){let n=new URL(Eb.url,e);return n.search=new URLSearchParams({response_type:"code",client_id:Zu,redirect_uri:r.redirectUri,code_challenge:r.challenge,code_challenge_method:"S256",state:r.state}).toString(),n.href}function MG(e){if(!e)return{};try{let r=JSON.parse(e);return typeof r=="object"&&r!==null?r:{}}catch{return{}}}async function DG(e,r){let n=await fetch(new URL(_b.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=MG(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*tu)}}async function bb(e,r){return DG(e,{grant_type:"authorization_code",client_id:Zu,code:r.code,code_verifier:r.verifier,redirect_uri:r.redirectUri})}var Gt=require("node:fs"),Ju=require("node:os"),Gn=require("node:path");var Ob=In(require("os"),1),_a=In(require("path"),1),cn=Ob.default.homedir(),{env:Dn}=process,Sb=Dn.XDG_DATA_HOME||(cn?_a.default.join(cn,".local","share"):void 0),jc=Dn.XDG_CONFIG_HOME||(cn?_a.default.join(cn,".config"):void 0),aIe=Dn.XDG_STATE_HOME||(cn?_a.default.join(cn,".local","state"):void 0),Ab=Dn.XDG_CACHE_HOME||(cn?_a.default.join(cn,".cache"):void 0),sIe=Dn.XDG_RUNTIME_DIR||void 0,GG=(Dn.XDG_DATA_DIRS||"/usr/local/share/:/usr/share/").split(":");Sb&&GG.unshift(Sb);var $G=(Dn.XDG_CONFIG_DIRS||"/etc/xdg").split(":");jc&&$G.unshift(jc);var xb=(0,Gn.join)(jc??(0,Gn.join)((0,Ju.homedir)(),".config"),"tsuga"),Ia=(0,Gn.join)(xb,"config.json"),Rb=(0,Gn.join)(Ab??(0,Gn.join)((0,Ju.homedir)(),".cache"),"tsuga"),Xu=(0,Gn.join)(Rb,"update-check.json"),ba="https://api.tsuga.com";function Cb(e){return Hf(e.credential)}function qc(){if(!(0,Gt.existsSync)(Ia))return{};try{let e=JSON.parse((0,Gt.readFileSync)(Ia,"utf-8")),{operationApiKey:r,userAuth:n,...o}=e;return!r&&!n?e:{...o,credentials:{...e.credentials??{},[ba]:{...r?{operationApiKey:r}:{},...n?{userAuth:n}:{},...e.credentials?.[ba]??{}}}}}catch{throw new Error(`Config file corrupted: ${Ia}
42
+ `,e),([r,n])=>[[r],n]),([r,n])=>[r,n],()=>[]))),([r,n])=>[r,n]),tE=(e,r=[])=>u(u(wu(e),([n,o])=>u(DM(o),([i,a])=>[[n,i],a])),([n,o])=>tE(o,[...r,n]),()=>[r,e]),GM=e=>u(u(tE(e),([r,n])=>u(u(u(wu(n),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>u([[],n],([o,i])=>[o,i],()=>[])),([o,i])=>[[r,o],i])),([r,n])=>[iT(r),n]),wu=e=>u(u(MM(e),([r,n])=>u(u(NM(n),([o,i])=>[o,i],()=>u(LM(n),([o,i])=>[o,i],()=>u(vM(n),([o,i])=>[o,i],()=>u(kM(n),([o,i])=>[o,i],()=>[])))),([o,i])=>u(RT(i),([a,c])=>[[r,o,a],c]))),([r,n])=>[aT(r),n]),$M=e=>u(u(wu(e),([r,n])=>u(GM(n),([o,i])=>[[r,o],i])),([r,n])=>[sT(r),n]),rE=e=>u(u($M(e),([r,n])=>[r,n],()=>u(Bk(e),([r,n])=>[r,n],()=>u(J(e),([r,n])=>[r,n],()=>[]))),([r,n])=>[r,n]);function nE(e){let r=Ru(`\`${e}\``);return s.IsEqual(r.length,2)?r[0]:H()}function Fi(e,r={}){return P("TemplateLiteral",[e],r)}function oE(e){return C({},Fi(e,{}))}function qM(e){let r=nE(e);return oE(r)}function iE(e,r={}){let n=s.IsString(e)?qM(e):oE(e);return y.Update(n,{},r)}function we(e){return S(e,"TemplateLiteral")}var L={};Mt(L,{ExtendsFalse:()=>F,ExtendsTrue:()=>x,ExtendsUnion:()=>Nu,IsExtendsFalse:()=>BM,IsExtendsTrue:()=>sE,IsExtendsTrueLike:()=>Ae,IsExtendsUnion:()=>aE});function Nu(e){return y.Create({"~kind":"ExtendsUnion"},{inferred:e})}function aE(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 y.Create({"~kind":"ExtendsTrue"},{inferred:e})}function sE(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 y.Create({"~kind":"ExtendsFalse"},{})}function BM(e){return s.IsObject(e)&&s.HasPropertyKey(e,"~kind")&&s.IsEqual(e["~kind"],"ExtendsFalse")}function Ae(e){return aE(e)||sE(e)}function Ac(e){let r=XT(e);return s.IsEqual(r.length,2)?r[0]:H()}function FM(e){return!0}function cE(e){let[r,...n]=e;return A(r)?HM(r)?cE(n):!1:!0}function pE(e){return s.IsEqual(e.length,0)?!1:cE(e)}function HM(e){return O(e)?pE(e.anyOf):X(e)?FM(e.const):!1}function xc(e){return pE(e)}function uE(e,r,n=[]){let[o,...i]=e;return s.IsString(o)?uE(i,r,[...n,`${o}${r}`]):n}function KM(e,r){return s.IsEqual(e.length,0)?[`${r}`]:uE(e,r)}function lE(e,r,n=[]){let[o,...i]=r;return A(o)?lE(e,i,[...n,...mE(e,o)]):n}function mE(e,r){return O(r)?lE(e,r.anyOf):X(r)?KM(e,r.const):H()}function dE(e,r){let[n,...o]=r;return A(n)?dE(mE(e,n),o):e}function zM(e){return e.map(r=>Y(r))}function YM(e){let r=dE([],e),n=zM(r);return q(n)}function VM(e){return s.IsEqual(e.length,0)?H():s.IsEqual(e.length,1)&&X(e[0])?e[0]:YM(e)}function nt(e){let r=Ac(e);return xc(r)?VM(r):bt()}function QM(e){return s.IsString(e)||s.IsNumber(e)?Y(e):s.IsNull(e)?Qr():Z()}function Ft(e){return e.map(n=>QM(n))}function ca(e){let r=Ft(e);return q(r)}function Ln(e){return ca(e.enum)}function WM(e,r,n,o){let i=re(e,n,o);return Ae(i)?x(y.Assign(y.Assign(e,i.inferred),{[r]:n})):F()}function ZM(e,r){return x(e)}function XM(e,r,n){let o=ca(n);return re(e,r,o)}function fE(e,r,n){let[o,...i]=n;return A(o)?(()=>{let a=re(e,r,o);return Ae(a)?fE(a.inferred,r,i):F()})():x(e)}function JM(e,r,n){let o=nt(n);return re(e,r,o)}function gE(e,r,n){let[o,...i]=n;return A(o)?(()=>{let a=re(e,r,o);return Ae(a)?x(a.inferred):gE(e,r,i)})():F()}function K(e,r,n){return pt(n)?ZM(e,r):Ue(n)?XM(e,r,n.enum):Pe(n)?WM(e,n.name,r,n.extends):w(n)?fE(e,r,n.allOf):we(n)?JM(e,r,n.pattern):O(n)?gE(e,r,n.anyOf):It(n)?x(e):F()}function yE(e,r,n){return Pe(n)?K(e,r,n):pt(n)?x(e):It(n)?x(e):Nu(e)}function e0(e,r){let n=xn(e),o=xn(r);return n&&o||!n&&o?!0:!(n&&!o)}function hE(e,r,n,o){return te(o)?e0(r,o)?re(e,n,o.items):F():K(e,r,o)}function TE(e,r,n){return at(n)?re(e,r,n.iteratorItems):K(e,Xt(r),n)}function EE(e,r,n){return At(n)?x(e):K(e,r,n)}function _E(e,r,n){return lt(n)?x(e):K(e,r,n)}function t0(e,r,n,o,i){let a=Pe(o)?r:o,c=Pe(o)?o:r,l=Ge(r),d=Ge(o),f=re(e,a,c);return!l&&d?F():Ae(f)?pa(f.inferred,n,i):F()}function r0(e,r,n,o){let[i,...a]=o;return A(i)?t0(e,r,n,i,a):Ge(r)?x(e):F()}function n0(e,r,n){let[o,...i]=r;return A(o)?r0(e,o,i,n):x(e)}function pa(e,r,n){return n0(e,r,n)}function Rc(e,r,n){return Rt(n)?x(e):re(e,r,n)}function IE(e,r,n,o){return $e(o)?(()=>{let i=pa(e,r,o.parameters);return Ae(i)?Rc(i.inferred,n,o.instanceType):F()})():F()}function bE(e,r,n){return re(e,Ln(r),n)}function SE(e,r,n,o){return je(o)?(()=>{let i=pa(e,r,o.parameters);return Ae(i)?Rc(i.inferred,n,o.returnType):F()})():F()}function OE(e,r,n){return He(n)?x(e):be(n)?x(e):K(e,r,n)}var ua="equal",o0="disjoint",la="left-inside",ma="right-inside";function da(e,r){let n=[It(e)?L.ExtendsFalse():ot({},e,r),It(e)?L.ExtendsTrue({}):ot({},r,e)];return L.IsExtendsTrueLike(n[0])&&L.IsExtendsTrueLike(n[1])?ua:L.IsExtendsTrueLike(n[0])&&L.IsExtendsFalse(n[1])?la:L.IsExtendsFalse(n[0])&&L.IsExtendsTrueLike(n[1])?ma:o0}function i0(e){return O(e)?ir(e.anyOf):[e]}function ir(e){return e.reduce((r,n)=>[...r,...i0(n)],[])}function Lu(e){return e.reduceRight((n,o,i)=>({[i]:o,...n}),{})}function AE(e){let r=Lu(e.items);return N(r)}function a0(e,r){return Rn(e)?!!Rn(r):!1}function s0(e,r){return Ge(e)?!!Ge(r):!1}function c0(e,r){let n=a0(e,r),o=s0(e,r),i=Ne([e,r]),a=ec(mo(i));return n&&o?_t(Et(a)):n&&!o?_t(a):!n&&o?Et(a):a}function p0(e,r,n){return n in e?n in r?c0(e[n],r[n]):e[n]:n in r?r[n]:Z()}function u0(e,r){return[...new Set([...s.Keys(r),...s.Keys(e)])].reduce((o,i)=>({...o,[i]:p0(e,r,i)}),{})}function xE(e){return k(e)?e.properties:V(e)?Lu(e.items):H()}function RE(e,r){let n=xE(e),o=xE(r),i=u0(n,o);return N(i)}function CE(e,r){let n=da(e,r);return s.IsEqual(n,la)?e:s.IsEqual(n,ma)||s.IsEqual(n,ua)?r:Z()}function PE(e){return k(e)||V(e)}function UE(e){return w(e)?Ne(e.allOf):e}function l0(e,r){let n=UE(e),o=UE(r),i=PE(n),a=PE(o);return i&&a?RE(Jr(n),o):i&&!a?Jr(n):!i&&a?o:CE(Jr(n),o)}function wE(e,r,n=[]){let[o,...i]=r;return s.IsUndefined(o)?n.length===0?[e]:n:wE(e,i,[...n,l0(e,o)])}function NE(e,r,n=[]){let[o,...i]=e;return A(o)?NE(i,r,[...n,...fa([o],r)]):n}function fa(e,r=[]){let[n,...o]=e;return A(n)?O(n)?fa(o,NE(n.anyOf,r)):fa(o,wE(n,r)):r}function Ne(e){let r=fa(e);return vu(r)}function hr(e){return vu(e)}function Jr(e){return w(e)?Ne(e.allOf):O(e)?hr(e.anyOf):e}function vn(e){return s.IsEqual(e.length,1)?e[0]:s.IsEqual(e.length,0)?Z():q(e)}function m0(e,r){return r.filter(n=>da(e,n)!==ma)}function d0(e,r){let n=r.some(o=>{let i=da(e,o);return s.IsEqual(i,la)||s.IsEqual(i,ua)});return s.IsEqual(n,!1)}function f0(e,r){let n=Jr(e);return pt(n)?[n]:d0(n,r)?[...m0(n,r),n]:r}function ku(e,r=[]){let[n,...o]=e;return A(n)?k(n)?ku(o,[...r,n]):ku(o,f0(n,r)):r}function vu(e){let r=ku(e),n=ir(r);return n.length===0?Z():n.length===1?n[0]:q(n)}function g0(e,r,n,o){let i=I(e,r,n);return y.Update(Jr(i),{},o)}function LE(e,r,n,o){return g0(e,r,n,o)}function vE(e,r,n){let o=Ne(r);return re(e,o,n)}function kE(e,r,n){return st(n)?re(e,r,n.iteratorItems):K(e,er(r),n)}function Cc(e,r,n){return r===n?x(e):F()}function y0(e,r,n){return X(n)?Cc(e,r,n.const):At(n)?x(e):K(e,Y(r),n)}function h0(e,r,n){return X(n)?Cc(e,r,n.const):lt(n)?x(e):K(e,Y(r),n)}function T0(e,r,n){return X(n)?Cc(e,r,n.const):be(n)?x(e):K(e,Y(r),n)}function E0(e,r,n){return X(n)?Cc(e,r,n.const):ve(n)?x(e):K(e,Y(r),n)}function ME(e,r,n){return s.IsBigInt(r.const)?y0(e,r.const,n):s.IsBoolean(r.const)?h0(e,r.const,n):s.IsNumber(r.const)?T0(e,r.const,n):s.IsString(r.const)?E0(e,r.const,n):H()}function DE(e,r,n){return Pe(n)?K(e,r,n):x(e)}function GE(e,r,n){return tr(n)?x(e):K(e,r,n)}function $E(e,r,n){return be(n)?x(e):K(e,r,n)}function _0(e,r,n){return Ge(r)?Ge(n)?x(e):F():x(e)}function I0(e,r,n){return Pe(n)&&gr(n.extends)?F():(()=>{let o=re(e,r,n);return Ae(o)?_0(o.inferred,r,n):F()})()}function b0(e,r){return e.reduce((n,o)=>o in r?Ae(r[o])?{...n,...r[o].inferred}:H():H(),{})}function S0(e,r,n){let o={};for(let c of s.Keys(n))o[c]=c in r?I0({},r[c],n[c]):Ge(n[c])?Pe(n[c])?x(y.Assign(e,{[n[c].name]:n[c].extends})):x(e):F();let i=s.Values(o).every(c=>Ae(c)),a=i?b0(s.Keys(o),o):{};return i?x(a):F()}function O0(e,r,n){let o=S0(e,r,n);return Ae(o)?x(y.Assign(e,o.inferred)):F()}function A0(e,r,n){return O0(e,r,n)}function jE(e,r,n){return k(n)?A0(e,r,n.properties):K(e,N(r),n)}function qE(e,r,n){return tt(n)?re(e,r,n.item):K(e,nr(r),n)}function BE(e,r,n){return ve(n)?x(e):K(e,r,n)}function FE(e,r,n){return rr(n)?x(e):K(e,r,n)}function HE(e,r,n){let o=nt(r);return re(e,o,n)}function Mu(e,r){return y.Create({"~kind":"Inferrable"},{name:e,type:r},{})}function ga(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 Du(e){return Wr(e)?Pe(e.items)?te(e.items.extends)?Mu(e.items.name,e.items.extends.items):It(e.items.extends)?Mu(e.items.name,e.items.extends):void 0:H():void 0}function Pc(e){return Pe(e)?Mu(e.name,e.extends):void 0}function Gu(e,r,n=[]){let[o,...i]=e;return A(o)?(()=>{let a=re({},o,r);return Ae(a)?Gu(i,r,[...n,o]):void 0})():n}function KE(e,r,n,o){let i=Gu(n,o);return s.IsArray(i)?x(y.Assign(e,{[r]:Ke(i)})):F()}function Uc(e,r,n,o){let i=Gu(n,o);return s.IsArray(i)?x(y.Assign(e,{[r]:q(i)})):F()}function x0(e){return[...e].reverse()}function $u(e,r){return r?x0(e):e}function R0(e){let r=e.length>0?e[0]:void 0,n=A(r)?Du(r):void 0;return A(n)}function C0(e,r,n,o,i,a){let c=re(e,n,i);return Ae(c)?zE(c.inferred,r,o,a):F()}function P0(e,r,n,o,i){let a=Du(o);return ga(a)?KE(e,a.name,$u(n,r),a.type):(()=>{let[c,...l]=n;return A(c)?C0(e,r,c,l,o,i):F()})()}function U0(e,r,n,o){let[i,...a]=o;return A(i)?P0(e,r,n,i,a):s.IsEqual(n.length,0)?x(e):F()}function zE(e,r,n,o){return U0(e,r,n,o)}function w0(e,r,n){let o=wc(e,{callstack:[]},n),i=R0(o);return zE(e,i,$u(r,i),$u(o,i))}function YE(e,r,n){let o=Pc(n);return ga(o)?Uc(e,o.name,r,o.type):(()=>{let[i,...a]=r;return A(i)?(()=>{let c=re(e,i,n);return Ae(c)?YE(c.inferred,a,n):F()})():x(e)})()}function VE(e,r,n){let o=wc(e,{callstack:[]},r);return V(n)?w0(e,o,n.items):te(n)?YE(e,o,n.items):K(e,Ke(o),n)}function QE(e,r,n){return Rt(n)?x(e):or(n)?x(e):K(e,r,n)}function WE(e,r,n){let[o,...i]=n;return A(o)?(()=>{let a=re(e,r,o);return Ae(a)?x(a.inferred):WE(e,r,i)})():F()}function ju(e,r,n){let[o,...i]=r;return A(o)?(()=>{let a=WE(e,o,n);return Ae(a)?ju(a.inferred,i,n):F()})():x(e)}function ZE(e,r,n){let o=Pc(n);return ga(o)?Uc(e,o.name,r,o.type):O(n)?ju(e,r,n.anyOf):ju(e,r,[n])}function XE(e,r,n){return Pe(n)?K(e,r,n):pt(n)?x(e):It(n)?x(e):F()}function JE(e,r,n){return Rt(n)?x(e):K(e,r,n)}function re(e,r,n){return pt(r)?yE(e,r,n):te(r)?hE(e,r,r.items,n):at(r)?TE(e,r.iteratorItems,n):At(r)?EE(e,r,n):lt(r)?_E(e,r,n):$e(r)?IE(e,r.parameters,r.instanceType,n):Ue(r)?bE(e,r,n):je(r)?SE(e,r.parameters,r.returnType,n):He(r)?OE(e,r,n):w(r)?vE(e,r.allOf,n):st(r)?kE(e,r.iteratorItems,n):X(r)?ME(e,r,n):gr(r)?DE(e,r,n):tr(r)?GE(e,r,n):be(r)?$E(e,r,n):k(r)?jE(e,r.properties,n):tt(r)?qE(e,r.item,n):ve(r)?BE(e,r,n):rr(r)?FE(e,r,n):we(r)?HE(e,r.pattern,n):V(r)?VE(e,r.items,n):or(r)?QE(e,r,n):O(r)?ZE(e,r.anyOf,n):It(r)?XE(e,r,n):Rt(r)?JE(e,r,n):F()}function Ao(e,r,n={}){return P("Interface",[e,r],n)}function No(e){return A(e)&&s.HasPropertyKey(e,"action")&&s.IsEqual(e.action,"Interface")}function e_(e,r,n={}){return C({},Ao(e,r,n))}function N0(e,r,n){return e.includes(n)?!0:en([...e,n],r,r[n])}function t_(e,r,n){let o=uc(n);return kn(e,r,o)}function kn(e,r,n){let[o,...i]=n;return A(o)?en(e,r,o)?!0:kn(e,r,i):!1}function en(e,r,n){return pe(n)?N0(e,r,n.$ref):te(n)?en(e,r,n.items):at(n)?en(e,r,n.iteratorItems):$e(n)?kn(e,r,[...n.parameters,n.instanceType]):je(n)?kn(e,r,[...n.parameters,n.returnType]):No(n)?t_(e,r,n.parameters[1]):w(n)?kn(e,r,n.allOf):st(n)?en(e,r,n.iteratorItems):k(n)?t_(e,r,n.properties):tt(n)?en(e,r,n.item):O(n)?kn(e,r,n.anyOf):V(n)?kn(e,r,n.items):Se(n)?en(e,r,rt(n)):!1}function Nc(e,r,n){return en(e,r,n)}function L0(e,r){return r.reduce((n,o)=>o in e?Nc([o],e,e[o])?[...n,o]:n:H(),[])}function r_(e){let r=ty(e);return L0(e,r)}function v0(e,r,n){return n.includes(r)?n:r in e?tn(e,e[r],[...n,r]):H()}function n_(e,r,n){let o=uc(r);return Lo(e,o,n)}function Lo(e,r,n){return r.reduce((o,i)=>tn(e,i,o),n)}function tn(e,r,n){return pe(r)?v0(e,r.$ref,n):te(r)?tn(e,r.items,n):at(r)?tn(e,r.iteratorItems,n):$e(r)?Lo(e,[...r.parameters,r.instanceType],n):je(r)?Lo(e,[...r.parameters,r.returnType],n):No(r)?n_(e,r.parameters[1],n):w(r)?Lo(e,r.allOf,n):st(r)?tn(e,r.iteratorItems,n):k(r)?n_(e,r.properties,n):tt(r)?tn(e,r.item,n):O(r)?Lo(e,r.anyOf,n):V(r)?Lo(e,r.items,n):Se(r)?tn(e,rt(r),n):n}function o_(e,r,n){return tn(e,n,[r])}function k0(e){return go()}function M0(e){return s.Keys(e).reduce((r,n)=>({...r,[n]:ar(e[n])}),{})}function ya(e){return e.reduce((r,n)=>[...r,ar(n)],[])}function ar(e){return pe(e)?k0(e.$ref):te(e)?Bt(ar(e.items),rc(e)):at(e)?Xt(ar(e.iteratorItems)):$e(e)?Hr(ya(e.parameters),ar(e.instanceType)):je(e)?Kr(ya(e.parameters),ar(e.returnType)):w(e)?wt(ya(e.allOf)):st(e)?er(ar(e.iteratorItems)):k(e)?N(M0(e.properties)):tt(e)?nr(ar(e.item)):Se(e)?mc(bo(e),ar(rt(e))):O(e)?q(ya(e.anyOf)):V(e)?Ke(ya(e.items)):e}function D0(e,r){return r in e?ar(e[r]):Je()}function i_(e){return D0(e.$defs,e.$ref)}function G0(e,r,n){let o=Ct(e,{callstack:[]},r),i=ha({},{callstack:[]},n);return Ne([...o,N(i)])}function $0(e,r){return s.Keys(e).filter(o=>r.includes(o)).reduce((o,i)=>{let a=e[i],c=No(a)?G0(e,a.parameters[0],a.parameters[1]):a;return{...o,[i]:c}},{})}function a_(e,r,n){let o=o_(e,r,n),i=$0(e,o);return Jt(i,r)}function s_(e,r){return r in e?pe(e[r])?s_(e,e[r].$ref):e[r]:Z()}function sr(e,r){return s_(e,r)}function c_(e){return me(e)?i_(e):e}function ot(e,r,n){let o=c_(r),i=c_(n);return re(e,o,i)}function j0(e,r,n){if(Pe(r)||vo(r)||L.IsExtendsTrueLike(ot({},r,n)))return;let o={parameter:e,extends:n,received:r};throw new Error("Generic argument does not satify constraint",{cause:o})}function p_(e,r,n,o,i){let a=I(e,r,i);return j0(n,a,o),y.Assign(e,{[n]:a})}function q0(e,r,n,o,i){let a=I(e,r,n.extends),c=I(e,r,n.equals),[l,...d]=i;return A(l)?qu(p_(e,r,n.name,a,l),r,o,d):qu(p_(e,r,n.name,a,c),r,o,[])}function qu(e,r,n,o){let[i,...a]=n;return A(i)?q0(e,r,i,a,o):e}function u_(e,r,n,o){return qu(e,r,n,o)}function B0(e){return s.IsGreaterThan(e.length,0)?e[0]:""}function l_(e,r,n,o){let i=Ct(e,r,o);return yc(n,i)}function F0(e,r,n,o){return l_(e,r,Le(n),o)}function H0(e,r,n,o,i,a){let c=Ct(e,r,a),l=u_(e,r,o,c),d=I(l,{callstack:[...r.callstack,n]},i);return I(e,r,d)}function Lc(e,r,n,o){let[i,a]=wg(e,n,o);return fo(a)?s.IsEqual(B0(r.callstack),i)?F0(e,r,i,o):H0(e,r,i,a.parameters,a.expression,o):l_(e,r,n,o)}function yc(e,r){return y.Create({"~kind":"Call"},{target:e,arguments:r},{})}function m_(e,r){return Lc({},{callstack:[]},e,r)}function vo(e){return S(e,"Call")}function d_(e){return tt(e)?d_(e.item):e}function K0(e,r,n,o){let i=I(e,r,n);return y.Update(d_(i),{},o)}function f_(e,r,n,o){return v(e,[n])?K0(e,r,n,o):sa(n,o)}function g_(e,r){return e(r)}function y_(e,r){return s.IsString(r)?Y(g_(e,r)):Y(r)}function h_(e,r){let n=nt(r);return Tr(e,n)}function T_(e,r){let n=r.map(o=>Tr(e,o));return q(n)}function Tr(e,r){return X(r)?y_(e,r.const):we(r)?h_(e,r.pattern):O(r)?T_(e,r.anyOf):r}function Hi(e,r={}){return P("Capitalize",[e],r)}function E_(e,r={}){return C({},Hi(e,r))}function Ki(e,r={}){return P("Lowercase",[e],r)}function __(e,r={}){return C({},Ki(e,r))}function zi(e,r={}){return P("Uncapitalize",[e],r)}function I_(e,r={}){return C({},zi(e,r))}function Yi(e,r={}){return P("Uppercase",[e],r)}function b_(e,r={}){return C({},Yi(e,r))}var z0=e=>e[0].toUpperCase()+e.slice(1),Y0=e=>e.toLowerCase(),V0=e=>e[0].toLowerCase()+e.slice(1),Q0=e=>e.toUpperCase();function W0(e,r,n,o){let i=I(e,r,n);return y.Update(Tr(z0,i),{},o)}function S_(e,r,n,o){return v(e,[n])?W0(e,r,n,o):Hi(n,o)}function Z0(e,r,n,o){let i=I(e,r,n);return y.Update(Tr(Y0,i),{},o)}function O_(e,r,n,o){return v(e,[n])?Z0(e,r,n,o):Ki(n,o)}function X0(e,r,n,o){let i=I(e,r,n);return y.Update(Tr(V0,i),{},o)}function A_(e,r,n,o){return v(e,[n])?X0(e,r,n,o):zi(n,o)}function J0(e,r,n,o){let i=I(e,r,n);return y.Update(Tr(Q0,i),{},o)}function x_(e,r,n,o){return v(e,[n])?J0(e,r,n,o):Yi(n,o)}function Vi(e,r,n,o,i={}){return P("Conditional",[e,r,n,o],i)}function R_(e,r,n,o,i={}){return C({},Vi(e,r,n,o,i))}function eD(e,r,n,o,i,a,c){let l=I(e,r,n),d=I(e,r,o),f=ot(e,l,d);return y.Update(L.IsExtendsUnion(f)?q([I(f.inferred,r,i),I(e,r,a)]):L.IsExtendsTrue(f)?I(f.inferred,r,i):I(e,r,a),{},c)}function C_(e,r,n,o,i,a,c){return v(e,[n,o])?eD(e,r,n,o,i,a,c):Vi(n,o,i,a,c)}function Qi(e,r={}){return P("ConstructorParameters",[e],r)}function P_(e,r={}){return C({},Qi(e,r))}function tD(e){return $e(e)?I({},{callstack:[]},Ke(e.parameters)):Z()}function rD(e,r,n,o){let i=I(e,r,n);return y.Update(tD(i),{},o)}function U_(e,r,n,o){return v(e,[n])?rD(e,r,n,o):Qi(n,o)}function Wi(e,r,n={}){return P("Exclude",[e,r],n)}function w_(e,r,n={}){return C({},Wi(e,r,n))}function N_(e,r){return e.reduce((n,o)=>[...n,...L_(o,r)],[])}function L_(e,r){let n=ot({},e,r);return L.IsExtendsTrueLike(n)?[]:[e]}function nD(e,r){let n=Ue(e)?N_(Ft(e.enum),r):O(e)?N_(ir(e.anyOf),r):L_(e,r);return hr(n)}function oD(e,r,n,o,i){let a=I(e,r,n),c=I(e,r,o);return y.Update(nD(a,c),{},i)}function vc(e,r,n,o,i){return v(e,[n,o])?oD(e,r,n,o,i):Wi(n,o,i)}function Zi(e,r,n={}){return P("Extract",[e,r],n)}function v_(e,r,n={}){return C({},Zi(e,r,n))}function k_(e,r){return e.reduce((n,o)=>[...n,...M_(o,r)],[])}function M_(e,r){let n=ot({},e,r);return L.IsExtendsTrueLike(n)?[e]:[]}function iD(e,r){let n=Ue(e)?k_(Ft(e.enum),r):O(e)?k_(ir(e.anyOf),r):M_(e,r);return hr(n)}function aD(e,r,n,o,i){let a=I(e,r,n),c=I(e,r,o);return y.Update(iD(a,c),{},i)}function D_(e,r,n,o,i){return v(e,[n,o])?aD(e,r,n,o,i):Zi(n,o,i)}var sD=new RegExp("^(?:0|[1-9][0-9]*)$");function ko(e){let r=`${e}`;return sD.test(r)?parseInt(r):e}function cD(e){return Y(ko(e))}function G_(e){return e.map(r=>$_(r))}function $_(e){return w(e)?wt(G_(e.allOf)):O(e)?q(G_(e.anyOf)):X(e)?cD(e.const):e}function j_(e,r){let n=$_(r),o=ot({},n,Nt());return L.IsExtendsTrueLike(o)?e:Z()}function q_(e,r){let n=sr(e,r);return cr(n)}function kc(e){return e.reduce((r,n)=>[...r,...cr(n)],[])}function B_(e){let r=Ft(e);return kc(r)}function F_(e){let r=Ne(e);return cr(r)}function H_(e){return[`${e}`]}function K_(e){let r=nt(e);return cr(r)}function cr(e){return me(e)?q_(e.$defs,e.$ref):Ue(e)?B_(e.enum):w(e)?F_(e.allOf):X(e)?H_(e.const):we(e)?K_(e.pattern):O(e)?kc(e.anyOf):[]}function Mo(e){return cr(e)}function pD(e,r){return r in e?[e[r]]:[]}function uD(e,r){return r.reduce((n,o)=>[...n,...pD(e,o)],[])}function z_(e,r){let n=Mo(r),o=uD(e,n);return hr(o)}function lD(e){return Y(ko(e))}function Y_(e){return e.map(r=>Bu(r))}function Bu(e){return w(e)?wt(Y_(e.allOf)):O(e)?q(Y_(e.anyOf)):X(e)?lD(e.const):e}function mD(e,r){return e.reduceRight((n,o,i)=>{let a=ot({},Y(i),r);return L.IsExtendsTrueLike(a)?[o,...n]:n},[])}function dD(e,r){let n=Bu(r),o=mD(e,n);return vn(o)}function fD(e){return vn(e)}function V_(e,r){return be(r)||He(r)?fD(e):dD(e,r)}function gD(e){return e.reduce((r,n)=>cc(n)?[...r,Y(n)]:r,[])}function Do(e){let r=gD(e);return q(r)}function xo(e,r,n={}){return P("Index",[e,r],n)}function Q_(e,r,n={}){let o=s.IsArray(r)?Do(r):r;return C({},xo(e,o,n))}function W_(e,r){let n=sr(e,r);return Ht(n)}function yD(e,r){let n=s.Keys(e).filter(g=>!s.HasPropertyKey(r,g)),o=s.Keys(r).filter(g=>!s.HasPropertyKey(e,g)),i=s.Keys(e).filter(g=>s.HasPropertyKey(r,g)),a=n.reduce((g,T)=>({...g,[T]:e[T]}),{}),c=o.reduce((g,T)=>({...g,[T]:r[T]}),{}),l=i.reduce((g,T)=>({...g,[T]:Ne([e[T],r[T]])}),{}),d=y.Assign(a,c);return y.Assign(d,l)}function Z_(e){return e.reduce((r,n)=>yD(r,Ht(n)),{})}function X_(e){let r=AE(Ke(e));return Ht(r)}function hD(e,r){return s.Keys(e).filter(i=>i in r).reduce((i,a)=>({...i,[a]:hr([e[a],r[a]])}),{})}function J_(e,r){let[n,...o]=e;return A(n)?J_(o,hD(r,Ht(n))):r}function eI(e){let[r,...n]=e;return A(r)?J_(n,Ht(r)):H()}function Ht(e){return me(e)?W_(e.$defs,e.$ref):w(e)?Z_(e.allOf):O(e)?eI(e.anyOf):V(e)?X_(e.items):k(e)?e.properties:{}}function Go(e){let r=Ht(e);return N(r)}function TD(e){return me(e)||w(e)||O(e)?Go(e):e}function ED(e,r){let n=TD(e);return te(n)?j_(n.items,r):k(n)?z_(n.properties,r):V(n)?V_(n.items,r):Z()}function _D(e,r,n,o,i){let a=I(e,r,n),c=I(e,r,o);return y.Update(ED(a,c),{},i)}function tI(e,r,n,o,i){return v(e,[n,o])?_D(e,r,n,o,i):xo(n,o,i)}function Xi(e,r={}){return P("InstanceType",[e],r)}function rI(e,r={}){return C({},Xi(e,r))}function ID(e){return $e(e)?e.instanceType:Z()}function bD(e,r,n,o){let i=I(e,r,n);return y.Update(ID(i),{},o)}function nI(e,r,n,o={}){return v(e,[n])?bD(e,r,n,o):Xi(n,o)}function SD(e,r,n,o,i){let a=Ct(e,{callstack:[]},n),c=ha(e,{callstack:[]},o),l=Ne([...a,N(c)]);return y.Update(l,{},i)}function oI(e,r,n,o,i){return v(e,n)?SD(e,r,n,o,i):Ao(n,o,i)}function Ro(e,r={}){return P("KeyOf",[e],r)}function iI(e,r={}){return C({},Ro(e,r))}function aI(){return q([Nt(),bt(),Eo()])}function sI(e){return Nt()}function OD(e){return e.reduce((n,o)=>cc(o)?[...n,Y(ko(o))]:H(),[])}function cI(e){let r=s.Keys(e),n=OD(r);return vn(n)}function pI(e){return bo(e)}function uI(e){let r=e.map((n,o)=>Y(o));return vn(r)}function AD(e){return me(e)||w(e)||O(e)?Go(e):e}function xD(e){let r=AD(e);return pt(r)?aI():te(r)?sI(r.items):k(r)?cI(r.properties):Se(r)?pI(r):V(r)?uI(r.items):Z()}function RD(e,r,n,o){let i=I(e,r,n);return y.Update(xD(i),{},o)}function lI(e,r,n,o){return v(e,[n])?RD(e,r,n,o):Ro(n,o)}function CD(e){let r=nt(e);return Fu(r)}function mI(e){return e.reduce((r,n)=>[...r,...Fu(n)],[])}function Fu(e){return Ue(e)?mI(Ft(e.enum)):To(e)||ho(e)?[e]:we(e)?CD(e.pattern):O(e)?mI(e.anyOf):[]}function dI(e){return Fu(e)}function Oo(e,r,n,o,i={}){return P("Mapped",[e,r,n,o],i)}function fI(e,r,n,o,i={}){return C({},Oo(e,r,n,o,i))}function PD(e,r,n,o,i){let a=y.Assign(e,{[n.name]:o}),c=I(a,r,i);return we(c)?nt(c.pattern):c}function UD(e,r,n,o,i){let a=y.Assign(e,{[n.name]:o});return I(a,r,i)}function wD(e,r,n,o,i,a){let c=UD(e,r,n,o,a),l=PD(e,r,n,o,i);return To(l)||ho(l)?{[l.const]:c}:{}}function ND(e,r,n,o,i,a){return o.reduce((c,l)=>({...c,...wD(e,r,n,l,i,a)}),{})}function LD(e,r,n,o,i,a){let c=dI(o),l=ND(e,r,n,c,i,a);return N(l)}function vD(e,r,n,o,i,a,c){let l=I(e,r,o);return y.Update(LD(e,r,n,l,i,a),{},c)}function gI(e,r,n,o,i,a,c){return v(e,[o])?vD(e,r,n,o,i,a,c):Oo(n,o,i,a,c)}function kD(e,r){return s.Keys(e).filter(o=>r.includes(o)).reduce((o,i)=>({...o,[i]:a_(e,i,e[i])}),{})}function MD(e,r){return s.Keys(e).filter(o=>!r.includes(o)).reduce((o,i)=>({...o,[i]:I(e,{callstack:[]},e[i])}),{})}function DD(e,r){let n=r_(e),o=kD(e,n),i=MD(e,n),a={...o,...i};return y.Update(a,{},r)}function yI(e,r,n,o){let i=y.Assign(e,n);return DD(i,o)}function Ji(e,r={}){return P("NonNullable",[e],r)}function hI(e,r={}){return C({},Ji(e,r))}function GD(e){let r=q([Qr(),So()]);return vc({},{callstack:[]},e,r,{})}function $D(e,r,n,o){let i=I(e,r,n);return y.Update(GD(i),{},o)}function TI(e,r,n,o){return v(e,[n])?$D(e,r,n,o):Ji(n,o)}function Mc(e){let r=Go(e);return k(r)?r.properties:H()}function ea(e,r,n={}){return P("Omit",[e,r],n)}function EI(e,r,n={}){let o=s.IsArray(r)?Do(r):r;return C({},ea(e,o,n))}function jD(e,r){return s.Keys(e).reduce((o,i)=>r.includes(i)?o:{...o,[i]:e[i]},{})}function qD(e,r){let n=Mc(e),o=Mo(r),i=jD(n,o);return N(i)}function BD(e,r,n,o,i){let a=I(e,r,n),c=I(e,r,o);return y.Update(qD(a,c),{},i)}function _I(e,r,n,o,i){return v(e,[n,o])?BD(e,r,n,o,i):ea(n,o,i)}function Co(e,r){return P("Options",[e,r],{})}function Dc(e,r){return C({},Co(e,r))}function FD(e,r,n,o){let i=I(e,r,n);return y.Update(i,{},o)}function II(e,r,n,o){return v(e,[n])?FD(e,r,n,o):Co(n,o)}function ta(e,r={}){return P("Parameters",[e],r)}function bI(e,r={}){return C({},ta(e,r))}function HD(e){return je(e)?I({},{callstack:[]},Ke(e.parameters)):Z()}function KD(e,r,n,o){let i=I(e,r,n);return y.Update(HD(i),{},o)}function SI(e,r,n,o){return v(e,[n])?KD(e,r,n,o):ta(n,o)}function ra(e,r={}){return P("Partial",[e],r)}function OI(e,r={}){return C({},ra(e,r))}function AI(e,r){let n=sr(e,r),o=rn(n);return Jt(y.Assign(e,{[r]:o}),r)}function xI(e){let r=e.map(n=>rn(n));return Ne(r)}function RI(e){let r=e.map(n=>rn(n));return q(r)}function CI(e){let r=s.Keys(e).reduce((o,i)=>({...o,[i]:Js(e[i])}),{});return N(r)}function rn(e){return me(e)?AI(e.$defs,e.$ref):w(e)?xI(e.allOf):O(e)?RI(e.anyOf):k(e)?CI(e.properties):N({})}function zD(e,r,n,o){let i=I(e,r,n);return y.Update(rn(i),{},o)}function PI(e,r,n,o){return v(e,[n])?zD(e,r,n,o):ra(n,o)}function na(e,r,n={}){return P("Pick",[e,r],n)}function UI(e,r,n={}){let o=s.IsArray(r)?Do(r):r;return C({},na(e,o,n))}function YD(e,r){return s.Keys(e).reduce((o,i)=>r.includes(i)?y.Assign(o,{[i]:e[i]}):o,{})}function VD(e,r){let n=Mc(e),o=Mo(r),i=YD(n,o);return N(i)}function QD(e,r,n,o,i){let a=I(e,r,n),c=I(e,r,o);return y.Update(VD(a,c),{},i)}function wI(e,r,n,o,i){return v(e,[n,o])?QD(e,r,n,o,i):na(n,o,i)}function oa(e,r={}){return P("ReadonlyType",[e],r)}function NI(e,r={}){return C({},oa(e,r))}function LI(e){return Fr(Bt(e))}function vI(e,r){let n=sr(e,r),o=nn(n);return Jt(y.Assign(e,{[r]:o}),r)}function kI(e){let r=e.map(n=>nn(n));return Ne(r)}function MI(e){let r=s.Keys(e).reduce((o,i)=>({...o,[i]:tc(e[i])}),{});return N(r)}function DI(e){return Fr(Ke(e))}function GI(e){let r=e.map(n=>nn(n));return q(r)}function nn(e){return te(e)?LI(e.items):me(e)?vI(e.$defs,e.$ref):w(e)?kI(e.allOf):k(e)?MI(e.properties):V(e)?DI(e.items):O(e)?GI(e.anyOf):e}function WD(e,r,n,o){let i=I(e,r,n);return y.Update(nn(i),{},o)}function $I(e,r,n,o){return v(e,[n])?WD(e,r,n,o):oa(n,o)}function jI(e){return St(Dt,e)}function qI(e){return N({true:e,false:e})}function BI(e,r){let n=ca(e);return on(n,r)}function FI(e,r){return St(_o,r)}function HI(e,r){let n=Ne(e);return on(n,r)}function KI(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 St(Io,r)}function YI(e,r){return s.HasPropertyKey(e,"pattern")&&(s.IsString(e.pattern)||e.pattern instanceof RegExp)?St(e.pattern.toString(),r):St(Dt,r)}function VI(e,r){let n=Ac(e);return xc(n)?on(nt(e),r):St(e,r)}function ZD(e){return e.some(r=>ve(r)||be(r)||He(r))}function XD(e,r){return s.IsEqual(ZD(e),!0)?St(Dt,r):void 0}function JD(e,r){return e.reduce((n,o)=>X(o)&&(s.IsString(o.const)||s.IsNumber(o.const))?{...n,[o.const]:r}:n,{})}function eG(e,r){let n=JD(e,r);return N(n)}function QI(e,r){let n=ir(e),o=XD(n,r);return A(o)?o:eG(n,r)}function on(e,r){return pt(e)?jI(r):lt(e)?qI(r):Ue(e)?BI(e.enum,r):He(e)?FI(e,r):w(e)?HI(e.allOf,r):X(e)?KI(e.const,r):be(e)?zI(e,r):O(e)?QI(e.anyOf,r):ve(e)?YI(e,r):we(e)?VI(e.pattern,r):N({})}function tG(e,r,n,o,i){let a=I(e,r,n),c=I(e,r,o);return y.Update(on(a,c),{},i)}function WI(e,r,n,o,i){return v(e,[n])?tG(e,r,n,o,i):Bi(n,o,i)}function ZI(e,r,n){return n in e?Nc([n],e,e[n])?Le(n):I(e,r,e[n]):Le(n)}function XI(e,r){let n=sr(e,r),o=an(n);return Jt(y.Assign(e,{[r]:o}),r)}function JI(e){let r=e.map(n=>an(n));return Ne(r)}function eb(e){let r=e.map(n=>an(n));return q(r)}function tb(e){let r=s.Keys(e).reduce((o,i)=>({...o,[i]:mo(e[i])}),{});return N(r)}function an(e){return me(e)?XI(e.$defs,e.$ref):w(e)?JI(e.allOf):O(e)?eb(e.anyOf):k(e)?tb(e.properties):N({})}function ia(e,r={}){return P("Required",[e],r)}function rb(e,r={}){return C({},ia(e,r))}function rG(e,r,n,o){let i=I(e,r,n);return y.Update(an(i),{},o)}function nb(e,r,n,o){return v(e,[n])?rG(e,r,n,o):ia(n,o)}function aa(e,r={}){return P("ReturnType",[e],r)}function ob(e,r={}){return C({},aa(e,r))}function nG(e){return je(e)?e.returnType:Z()}function oG(e,r,n,o){let i=I(e,r,n);return y.Update(nG(i),{},o)}function ib(e,r,n,o){return v(e,[n])?oG(e,r,n,o):aa(n,o)}function ab(e){return y.Create({"~kind":"TemplateLiteral"},{type:"string",pattern:e},{})}function iG(e){return e.join("|")}function aG(e){return e.slice(1,e.length-1)}function sG(e,r,n){return sn(r,`${n}${e}`)}function cG(e,r){return sn(e,`${r}${Qg}`)}function pG(e,r){return sn(e,`${r}${sc}`)}function uG(e,r){return sn(e,`${r}${pc}`)}function lG(e,r){return Ku(q([Y("false"),Y("true")]),e,r)}function mG(e,r){return sn(e,`${r}${lc}`)}function dG(e,r,n){return sn(r,`${n}${aG(e)}`)}function fG(e,r,n,o=[]){let i=Ft(e);return Hu(i,r,n)}function Hu(e,r,n,o=[]){let[i,...a]=e;return A(i)?Hu(a,r,n,[...o,Ku(i,[],"")]):sn(r,`${n}(${iG(o)})`)}function Ku(e,r,n){return Ue(e)?fG(e.enum,r,n):He(e)?pG(r,n):X(e)?sG(e.const,r,n):At(e)?cG(r,n):lt(e)?lG(r,n):be(e)?uG(r,n):ve(e)?mG(r,n):we(e)?dG(e.pattern,r,n):O(e)?Hu(e.anyOf,r,n):Pg}function sn(e,r){let[n,...o]=e;return A(n)?Ku(n,o,r):r}function gG(e){return`^${sn(e,"")}$`}function sb(e){let r=gG(e);return ab(r)}function yG(e,r,n,o){let i=Ct(e,r,n);return y.Update(sb(i),{},o)}function cb(e,r,n,o){return v(e,n)?yG(e,r,n,o):Fi(n,o)}function hG(e){return Wr(e)?V(e.items)?zu(e.items.items):Pe(e.items)?[e]:pe(e.items)?[e]:[Z()]:[e]}function zu(e){return e.reduce((n,o)=>[...n,...hG(o)],[])}function TG(e,r){return r in e}function EG(e,r){return w(r)?v(e,r.allOf):O(r)?v(e,r.anyOf):pe(r)?TG(e,r.$ref):!0}function v(e,r){let[n,...o]=r;return A(n)?EG(e,n)?v(e,o):!1:!0}function Ta(e,r,n){return Sg(e)?Ta(e.type,"remove",n):Eg(e)?Ta(e.type,r,"remove"):Ig(e)?Ta(e.type,"add",n):hg(e)?Ta(e.type,r,"add"):[e,r,n]}function _G(e,r){return s.IsEqual(e,"remove")?ec(r):s.IsEqual(e,"add")?_t(r):r}function IG(e,r){return s.IsEqual(e,"remove")?mo(r):s.IsEqual(e,"add")?Et(r):r}function ha(e,r,n){return s.Keys(n).reduce((o,i)=>({...o,[i]:I(e,r,n[i])}),{})}function wc(e,r,n){let o=Ct(e,r,n);return zu(o)}function Ct(e,r,n){return n.map(o=>I(e,r,o))}function bG(e,r,n,o,i){return s.IsEqual(n,"Awaited")?f_(e,r,o[0],i):s.IsEqual(n,"Capitalize")?S_(e,r,o[0],i):s.IsEqual(n,"Conditional")?C_(e,r,o[0],o[1],o[2],o[3],i):s.IsEqual(n,"ConstructorParameters")?U_(e,r,o[0],i):s.IsEqual(n,"Evaluate")?LE(e,r,o[0],i):s.IsEqual(n,"Exclude")?vc(e,r,o[0],o[1],i):s.IsEqual(n,"Extract")?D_(e,r,o[0],o[1],i):s.IsEqual(n,"Index")?tI(e,r,o[0],o[1],i):s.IsEqual(n,"InstanceType")?nI(e,r,o[0],i):s.IsEqual(n,"Interface")?oI(e,r,o[0],o[1],i):s.IsEqual(n,"KeyOf")?lI(e,r,o[0],i):s.IsEqual(n,"Lowercase")?O_(e,r,o[0],i):s.IsEqual(n,"Mapped")?gI(e,r,o[0],o[1],o[2],o[3],i):s.IsEqual(n,"Module")?yI(e,r,o[0],i):s.IsEqual(n,"NonNullable")?TI(e,r,o[0],i):s.IsEqual(n,"Pick")?wI(e,r,o[0],o[1],i):s.IsEqual(n,"Options")?II(e,r,o[0],o[1]):s.IsEqual(n,"Parameters")?SI(e,r,o[0],i):s.IsEqual(n,"Partial")?PI(e,r,o[0],i):s.IsEqual(n,"Omit")?_I(e,r,o[0],o[1],i):s.IsEqual(n,"ReadonlyType")?$I(e,r,o[0],i):s.IsEqual(n,"Record")?WI(e,r,o[0],o[1],i):s.IsEqual(n,"Required")?nb(e,r,o[0],i):s.IsEqual(n,"ReturnType")?ib(e,r,o[0],i):s.IsEqual(n,"TemplateLiteral")?cb(e,r,o[0],i):s.IsEqual(n,"Uncapitalize")?A_(e,r,o[0],i):s.IsEqual(n,"Uppercase")?x_(e,r,o[0],i):P(n,o,i)}function I(e,r,n){let o=xn(n),i=Ta(n,Rn(n)?"add":"none",Ge(n)?"add":"none"),a=Ut(i[0])?i[0].Clone():i[0],c=pe(a)?ZI(e,r,a.$ref):te(a)?Bt(I(e,r,a.items),rc(a)):at(a)?Xt(I(e,r,a.iteratorItems),Ag(a)):vo(a)?Lc(e,r,a.target,a.arguments):$e(a)?Hr(Ct(e,r,a.parameters),I(e,r,a.instanceType),Rg(a)):Og(a)?bG(e,r,a.action,a.parameters,a.options):je(a)?Kr(Ct(e,r,a.parameters),I(e,r,a.returnType),Cg(a)):w(a)?wt(Ct(e,r,a.allOf),kg(a)):st(a)?er(I(e,r,a.iteratorItems),Zg(a)):k(a)?N(ha(e,r,a.properties),ry(a)):tt(a)?nr(I(e,r,a.item),oy(a)):Se(a)?dc(xt(a),I(e,r,rt(a))):Wr(a)?wn(I(e,r,a.items)):V(a)?Ke(wc(e,r,a.items),ay(a)):O(a)?q(Ct(e,r,a.anyOf),sy(a)):a,l=o?Fr(c):c;return _G(i[1],IG(i[2],l))}function C(e,r){return I(e,{callstack:[]},r)}function sa(e,r={}){return P("Awaited",[e],r)}function pb(e,r={}){return C({},sa(e,r))}function Tu(e,r={}){return P("Evaluate",[e],r)}function Kt(e,r={}){return C({},Tu(e,r))}function Eu(e,r={}){return P("Module",[e],r)}function ub(e,r={}){return C({},Eu(e,r))}function lb(...e){let[r,n,o]=ie.Match(e,{2:(c,l)=>s.IsString(c)?[{},c,l]:[c,l,{}],3:(c,l,d)=>[c,l,d],1:c=>[{},c,{}]}),i=rE(n),a=s.IsArray(i)&&s.IsEqual(i.length,2)?I(r,{callstack:[]},i[0]):Z();return y.Update(a,{},o)}var t={};Mt(t,{Any:()=>go,Array:()=>Bt,AsyncIterator:()=>Xt,Awaited:()=>pb,Base:()=>nc,BigInt:()=>ji,Boolean:()=>ac,Call:()=>m_,Capitalize:()=>E_,Codec:()=>oc,Conditional:()=>R_,Constructor:()=>Hr,ConstructorParameters:()=>P_,Cyclic:()=>Jt,Decode:()=>zg,DecodeBuilder:()=>$i,Encode:()=>Yg,EncodeBuilder:()=>Gi,Enum:()=>vg,Evaluate:()=>Kt,Exclude:()=>w_,Extends:()=>ot,ExtendsResult:()=>L,Extract:()=>v_,Function:()=>Kr,Generic:()=>zr,Identifier:()=>qi,Immutable:()=>Fr,Index:()=>Q_,Infer:()=>Di,InstanceType:()=>rI,Instantiate:()=>C,Integer:()=>Pn,Interface:()=>e_,Intersect:()=>wt,IsAny:()=>pt,IsArray:()=>te,IsAsyncIterator:()=>at,IsBase:()=>Ut,IsBigInt:()=>At,IsBoolean:()=>lt,IsCall:()=>vo,IsCodec:()=>Cn,IsConstructor:()=>$e,IsCyclic:()=>me,IsEnum:()=>Ue,IsFunction:()=>je,IsGeneric:()=>fo,IsIdentifier:()=>Wg,IsImmutable:()=>xn,IsInfer:()=>Pe,IsInteger:()=>He,IsIntersect:()=>w,IsIterator:()=>st,IsKind:()=>S,IsLiteral:()=>X,IsNever:()=>gr,IsNull:()=>tr,IsNumber:()=>be,IsObject:()=>k,IsOptional:()=>Ge,IsParameter:()=>ny,IsPromise:()=>tt,IsReadonly:()=>Rn,IsRecord:()=>Se,IsRef:()=>pe,IsRefine:()=>ic,IsRest:()=>Wr,IsSchema:()=>A,IsString:()=>ve,IsSymbol:()=>rr,IsTemplateLiteral:()=>we,IsThis:()=>iy,IsTuple:()=>V,IsUndefined:()=>or,IsUnion:()=>O,IsUnknown:()=>It,IsUnsafe:()=>py,IsVoid:()=>Rt,Iterator:()=>er,KeyOf:()=>iI,Literal:()=>Y,Lowercase:()=>__,Mapped:()=>fI,Module:()=>ub,Never:()=>Z,NonNullable:()=>hI,Null:()=>Qr,Number:()=>Nt,Object:()=>N,Omit:()=>EI,Optional:()=>Js,Options:()=>Dc,Parameter:()=>Un,Parameters:()=>bI,Partial:()=>OI,Pick:()=>UI,Promise:()=>nr,Readonly:()=>tc,ReadonlyType:()=>NI,Record:()=>mc,RecordKey:()=>bo,RecordKeyAsPattern:()=>xt,RecordValue:()=>rt,Ref:()=>Le,Refine:()=>Vg,Required:()=>rb,Rest:()=>wn,ReturnType:()=>ob,Script:()=>lb,String:()=>bt,Symbol:()=>Eo,TemplateLiteral:()=>iE,This:()=>fc,Tuple:()=>Ke,Uncapitalize:()=>I_,Undefined:()=>So,Union:()=>q,Unknown:()=>Je,Unsafe:()=>cy,Uppercase:()=>b_,Void:()=>gc});var mb="lowercase-email",Yu="iana-timezone",Vu="simple-time",Qu="simple-date-time";var SG=(e,r)=>RegExp(`^${e.source}(${r.source}${e.source})*$`),OG=/[a-zA-Z0-9-_]+/,AG=/\./,d_e=SG(OG,AG);var db="lowercase-domain";var $o="kebab-case";var fb="camel-case";var xG=new Set;function b(e,r,n={}){let o=r.map(i=>{let a=i;return a.$id?(xG.add(i),t.Ref(a.$id)):i});return t.Unsafe({...n,type:"object",discriminator:{propertyName:e},required:[e],oneOf:o})}function Be(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 qo=1e3,Gc=100,ye={limit:t.Optional(t.Integer({minimum:1,maximum:qo,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."}))},ze={...ye,limit:t.Optional(t.Integer({minimum:1,maximum:qo,default:Gc,description:`Maximum number of items to return in this page. Omit to use the public API default of ${Gc}.`}))},RG=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."}),T_e=t.Object({pagination:RG},{$id:"ResponseMetadata",description:"Metadata accompanying `data` on paginated operations, describing the full result set the page was taken from."});function E(e={}){return t.Unsafe({...e,type:"string"})}var jo=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:fb,minLength:i,maxLength:jo,...a});case"kebab-case":return t.String({format:$o,minLength:i,maxLength:jo,...a});case"email":return t.String({format:mb,minLength:i,maxLength:254,errorMessage:{format:"Must be a valid lowercase email address."},...a});case"lowercase-domain":return t.String({format:db,minLength:i,maxLength:jo,...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:jo,...a});case"long":return t.String({minLength:i,maxLength:5e4,...a});case"short":return t.String({minLength:i,maxLength:jo,...a});case"tsuga-formula":return t.String({format:"tsuga-formula",minLength:i,maxLength:jo,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:Xe(r)}}var Ea=["ingestion-api-key","operation-api-key","rum-public-token","dashboard","log-route","metric-route","monitor","notification-rule","notification-silence","slo"],$c=t.Array(t.Enum(Ea,{description:"Tsuga-managed asset type."}),{description:"Tsuga-managed asset types covered by the policy. An empty array means all supported asset types."});var Wu=["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"],U_e=t.Enum(Wu),CG=["CLUSTER_AGGREGATION_STRUCTURE"],w_e=t.Object({code:t.Enum(Wu),message:t.String()}),gb=[...Wu,...CG,"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"],yb=["INTERNAL_ERROR","INVALID_QUERY_TO_CLUSTER"];var PG=["NETWORK_ERROR","RESPONSE_PARSE_ERROR"],UG=[...gb,...yb,...PG],wG=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(Ea,{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."}),NG=b("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`."}),LG=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:NG},{description:"A single grok rule that failed to compile, with its position in the submitted rules and the structured compile error."}),hb=b("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(wG,{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(LG,{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."}),N_e=t.Object({code:t.Optional(t.Enum(UG,{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(hb)},{$id:"ErrorResponse",description:"Standard envelope for API errors"}),L_e=t.Object({code:t.Optional(t.Enum(gb,{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(hb)},{$id:"ClientErrorResponse",description:"Standard envelope for client (4XX) API errors"}),v_e=t.Object({code:t.Optional(t.Enum(yb,{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"}),k_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"}),M_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 m({body:e,description:r,method:n,operationId:o,params:i,tags:a,query:c,paginated:l,response:d,url:f}){return i?{buildUrl:T=>f.replace(/:[a-zA-Z_]+/g,_=>T[_.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},...l===void 0?{}:{paginated:l},...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},...l===void 0?{}:{paginated:l},...a===void 0?{}:{tags:a}}}function Tb(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 Zu="tsuga-cli";var Mn="/v0/oauth",Eb=m({description:"OAuth 2.1 authorization endpoint: validates the client and redirect URI, then redirects to the consent page",url:`${Mn}/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)"})}),_b=m({description:"OAuth 2.1 token endpoint: exchanges an authorization code (PKCE) or refresh token for a token pair",url:`${Mn}/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()})}),X_e=m({description:"Resolve a signed authorization request handle for the consent page",url:`${Mn}/authorization-request`,method:"GET",query:t.Object({handle:t.String()}),response:t.Object({clientId:t.String(),clientName:t.String(),redirectUri:t.String()})}),J_e=m({description:"Approve or deny an OAuth authorization request from the consent page",url:`${Mn}/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"})})}),eIe=m({description:"Validate an OAuth access token (internal, for the MCP resource server)",url:`${Mn}/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"],kG=t.Object({id:t.String(),createdAt:E(),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(E())}),tIe=m({tags:["oauth"],description:"List OAuth grants: your own, or all users for admins",url:`${Mn}/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(kG)}),rIe=m({tags:["oauth"],description:"Delete an OAuth grant (own grant, or any grant for admins)",url:`${Mn}/grants/:id`,method:"DELETE",params:t.Object({id:t.String()}),response:R});function Ib(e,r){let n=new URL(Eb.url,e);return n.search=new URLSearchParams({response_type:"code",client_id:Zu,redirect_uri:r.redirectUri,code_challenge:r.challenge,code_challenge_method:"S256",state:r.state}).toString(),n.href}function MG(e){if(!e)return{};try{let r=JSON.parse(e);return typeof r=="object"&&r!==null?r:{}}catch{return{}}}async function DG(e,r){let n=await fetch(new URL(_b.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=MG(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*tu)}}async function bb(e,r){return DG(e,{grant_type:"authorization_code",client_id:Zu,code:r.code,code_verifier:r.verifier,redirect_uri:r.redirectUri})}var Gt=require("node:fs"),Ju=require("node:os"),Gn=require("node:path");var Ob=In(require("os"),1),_a=In(require("path"),1),cn=Ob.default.homedir(),{env:Dn}=process,Sb=Dn.XDG_DATA_HOME||(cn?_a.default.join(cn,".local","share"):void 0),jc=Dn.XDG_CONFIG_HOME||(cn?_a.default.join(cn,".config"):void 0),sIe=Dn.XDG_STATE_HOME||(cn?_a.default.join(cn,".local","state"):void 0),Ab=Dn.XDG_CACHE_HOME||(cn?_a.default.join(cn,".cache"):void 0),cIe=Dn.XDG_RUNTIME_DIR||void 0,GG=(Dn.XDG_DATA_DIRS||"/usr/local/share/:/usr/share/").split(":");Sb&&GG.unshift(Sb);var $G=(Dn.XDG_CONFIG_DIRS||"/etc/xdg").split(":");jc&&$G.unshift(jc);var xb=(0,Gn.join)(jc??(0,Gn.join)((0,Ju.homedir)(),".config"),"tsuga"),Ia=(0,Gn.join)(xb,"config.json"),Rb=(0,Gn.join)(Ab??(0,Gn.join)((0,Ju.homedir)(),".cache"),"tsuga"),Xu=(0,Gn.join)(Rb,"update-check.json"),ba="https://api.tsuga.com";function Cb(e){return Hf(e.credential)}function qc(){if(!(0,Gt.existsSync)(Ia))return{};try{let e=JSON.parse((0,Gt.readFileSync)(Ia,"utf-8")),{operationApiKey:r,userAuth:n,...o}=e;return!r&&!n?e:{...o,credentials:{...e.credentials??{},[ba]:{...r?{operationApiKey:r}:{},...n?{userAuth:n}:{},...e.credentials?.[ba]??{}}}}}catch{throw new Error(`Config file corrupted: ${Ia}
43
43
  Re-authenticate with \`tsuga auth login\` or \`tsuga auth operation-key <OPERATION_API_KEY>\`.`)}}function Sa(){try{return qc()}catch{return{}}}function Oa(e){(0,Gt.mkdirSync)(xb,{recursive:!0,mode:448}),(0,Gt.writeFileSync)(Ia,`${JSON.stringify(e,null,2)}
44
44
  `,{mode:384})}function el(e,r=Bo()){return e.credentials?.[r]??{}}function tl(e,r,n=Bo()){return{...e,credentials:{...e.credentials??{},[n]:r}}}function Bo(e){return(e?.trim()||process.env.TSUGA_API_URL?.trim()||ba).replace(/\/+$/,"")}function Fo(e){let r=qc(),n=Bo(e.apiUrl),o=el(r,n),i=Ff({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 Pb(){return el(qc()).userAuth}function Ub(e){let r=Sa();Oa(tl(r,{userAuth:e}))}function wb(e){let r=Sa();Oa(tl(r,{operationApiKey:e}))}function Nb(){let e=Sa(),r=el(e);Oa(tl(e,r.operationApiKey?{operationApiKey:r.operationApiKey}:{}))}function Aa(){return Ia}var Lb={from:"-30m",to:"now",query:"*","max-results":"100"};function Er(e){return(qc().defaults??{})[e]??Lb[e]}function vb(e,r){let n=Sa();Oa({...n,defaults:{...n.defaults??{},[e]:r}})}function kb(){let{defaults:e,...r}=Sa();Oa(r)}function Mb(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: ${Li(o.userAuth.accessToken)} (expires ${o.userAuth.accessExpiresAt})`);break;default:Xe(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={...Lb,...e.defaults};for(let[a,c]of Object.entries(i)){let l=a in e.defaults?" *":"";n.push(` ${a}: ${c}${l}`)}return`${n.join(`
45
45
  `)}
46
46
  `}function Db(){if((0,Gt.existsSync)(Xu))try{return JSON.parse((0,Gt.readFileSync)(Xu,"utf-8")).lastUpdateCheck}catch{return}}function Gb(e){(0,Gt.mkdirSync)(Rb,{recursive:!0,mode:448}),(0,Gt.writeFileSync)(Xu,`${JSON.stringify({lastUpdateCheck:e})}
47
47
  `,{mode:384})}async function jG(){let e=Bo(),{verifier:r,challenge:n}=zf(),o=(0,$b.randomBytes)(16).toString("base64url"),{code:i,redirectUri:a}=await og({state:o,buildAuthorizeUrl:l=>Ib(e,{redirectUri:l,challenge:n,state:o})}),c=await bb(e,{code:i,verifier:r,redirectUri:a});Ub(Bf(c)),B(`Logged in. Session token ${Li(c.accessToken)} saved to ${Aa()}`)}function qG(){let e=Bo(),r=Pb();if(!r){let n=e===ba?"":` for ${e}`;process.stderr.write(`No user session${n}. Run \`tsuga auth login\`.
48
- `),process.exitCode=1;return}if(Fs({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 BG(){let{credential:e}=Fo({});if(!e){B("Not authenticated. Run `tsuga auth login` or `tsuga auth operation-key <OPERATION_API_KEY>`.");return}switch(e.kind){case"user-session":B(`Logged in as a user (token ${Li(e.userAuth.accessToken)}, expires ${e.userAuth.accessExpiresAt}).`);return;case"operation-api-key":B("Authenticated with an operation API key.");return;default:Xe(e)}}function FG(){Nb(),B("Local user session cleared.")}function jb(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 (replaces any saved operation API key)").action(jG),r.command("logout").description("Clear the saved user session").action(FG),r.command("token").description("Print the saved user access token to stdout").action(qG),r.command("operation-key <OPERATION_API_KEY>").description("Save an operation API key to the config file (replaces any saved user session)").action(n=>{wb(n),B(`Operation API key saved to ${Aa()}`)}),r.command("status").description("Show the current authentication method").action(BG)}var HG=["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"],KG=["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"],zG=["log","metric","trace","rum"],YG=[...KG,...zG],AIe=[...HG,...YG];var Fc=["admin","public_editor","public_viewer","teams_only"],Ho=["admin","editor","viewer"];var $n="/v0/team-membership",rl="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.",nl=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(Ho,{description:rl})}),qb=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(Ho,{description:rl})}),VG=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."})}),QG=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."}))})),xIe=m({tags:["access-control"],url:$n,method:"GET",query:QG,response:t.Array(nl)}),RIe=m({tags:["access-control"],url:$n,method:"POST",body:qb,response:nl}),CIe=m({tags:["access-control"],url:$n,method:"PUT",body:qb,response:nl}),PIe=m({tags:["access-control"],url:$n,method:"DELETE",body:VG,response:R}),Bc=500,Bb=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(Ho,{description:rl})},{oneOf:[{required:["userId"]},{required:["userEmail"]}]}),{minItems:1,maxItems:Bc,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."}),WG={teamId:"team-123-abc",members:[{userId:"user-123-abc",roleKey:"viewer"},{userEmail:"sam@example.com",roleKey:"editor"}]};Object.assign(Bb,{examples:[WG]});var Fb=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."}),ZG={results:[{userId:"user-123-abc",status:"added"},{userId:"sam@example.com",status:"user_not_found"}]};Object.assign(Fb,{examples:[ZG]});var UIe=m({tags:["access-control"],url:`${$n}/bulk-add`,method:"POST",body:Bb,response:Fb}),wIe=m({tags:["access-control"],url:`${$n}/bulk-update-user-roles`,method:"PUT",body:t.Object({userIds:t.Array(p({allowEmpty:!1}),{minItems:1,maxItems:Bc}),teamId:p({allowEmpty:!1}),role:t.Enum(Ho)}),response:t.Object({})}),Hb=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:Bc,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:Bc,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."}),XG={teamId:"team-123-abc",userIds:["user-123-abc"]};Object.assign(Hb,{examples:[XG]});var Kb=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."}),JG={results:[{userId:"user-123-abc",status:"removed"},{userId:"missing@example.com",status:"user_not_found"}]};Object.assign(Kb,{examples:[JG]});var NIe=m({tags:["access-control"],url:`${$n}/bulk-remove`,method:"DELETE",body:Hb,response:Kb});var e$=["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"],zb=t.Enum(e$,{description:"Stable nav item key within a main sidebar category."}),Yb=t.Array(zb,{description:"Nav item keys shown in the primary sidebar for this category, in display order."}),Vb=t.Optional(t.Array(zb,{description:"Nav item keys for this category that are folded away (e.g. View more). Omitted or empty means none."})),Qb="Stable category id. Unknown or renamed ids are ignored by the client catalog.",Wb="Sidebar categories in display order. Unknown or renamed ids are ignored by the client catalog.",ol=t.Object({categories:t.Array(t.Object({id:t.String({description:Qb}),visible:Yb,folded:Vb}),{description:Wb})}),Zb=t.Object({categories:t.Array(t.Object({id:p({allowEmpty:!1,description:Qb}),visible:Yb,folded:Vb}),{description:Wb})});var Hc="/v0/org",t$=`${Hc}/current-user`,Xb=`${Hc}/settings`,Jb=`${Hc}/allowed-domains`,Kc=50,eS=t.Object({id:t.String(),name:t.String(),createdAt:E(),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()}),tS=t.Object({allowedDomains:t.Array(p({allowEmpty:!1,type:"lowercase-domain",description:'A lowercase email domain (e.g. "acme.com").'}),{maxItems:Kc,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."})}),rS=t.Pick(eS,["allowedDomains"]),qIe=m({tags:["organization"],url:t$,method:"GET",response:eS}),BIe=m({tags:["organization"],url:Xb,method:"GET",response:t.Object({enableLlmFeatures:t.Boolean(),allowEmailPasswordLogin:t.Boolean(),sidebarNavLayout:t.Optional(ol)})}),FIe=m({tags:["organization"],url:Xb,method:"PUT",body:t.Object({enableLlmFeatures:t.Optional(t.Boolean()),allowEmailPasswordLogin:t.Optional(t.Boolean()),sidebarNavLayout:t.Optional(t.Union([Zb,t.Null()]))}),response:t.Object({enableLlmFeatures:t.Boolean(),allowEmailPasswordLogin:t.Boolean(),sidebarNavLayout:t.Optional(ol)})}),HIe=m({tags:["organization"],url:Hc,method:"PUT",body:tS,response:t.Object({allowedDomains:t.Array(t.String())})}),KIe=m({tags:["organization"],url:Jb,method:"GET",response:rS}),zIe=m({tags:["organization"],url:Jb,method:"PUT",body:tS,response:rS});var zc="/v0/admin",ke=`${zc}/clusters`,oS=t.Object({helmParameters:t.Record(t.String(),t.Union([t.Number(),t.Boolean(),t.Null(),t.String()])),helmVersion:t.String()}),nS=t.Record(t.String(),oS),sl=["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"],cl=["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"],pl=["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"],iS=["aws","gcp","azure"],xa=["xs","s","m","l"],ul=["1.0"],r$=["tsuga-cluster","tsuga-telemetry","tsuga-deployer","tsuga-events"],Yc=t.Enum(r$,{description:"Helm installation name identifying a chart component on the cluster."}),n$={id:t.String(),name:t.String(),createdAt:E(),clusterCertificateExpiresAt:E(),bridgeEndpoint:t.String(),deployerEndpoint:t.String(),targetConfiguration:nS,appliedConfiguration:t.Optional(nS),automaticallyDeployLatestVersion:t.Boolean(),automatedDeploymentDisabledBy:t.Optional(t.String()),automatedDeploymentDisabledReason:t.Optional(t.String()),automatedDeploymentDisabledAt:t.Optional(E()),soakTimeMin:t.Optional(t.Number()),clusterSize:t.Optional(t.Enum(xa)),gitSyncByInstallation:t.Record(Yc,t.Boolean(),{description:"Per-installation git-sync state, keyed by installationName."})},il={...n$,orgId:t.String(),orgName:t.String()},ebe=m({tags:["admin"],method:"GET",url:ke,query:t.Object({orgId:t.Optional(p())}),response:t.Array(b("clusterType",[t.Object({...il,clusterType:t.Literal("aws"),clusterAccountId:t.String(),clusterBuilderRoleVersion:t.Optional(t.Enum(ul)),clusterRegion:t.Enum(sl)}),t.Object({...il,clusterType:t.Literal("gcp"),clusterAccountId:t.String(),clusterRegion:t.Enum(cl)}),t.Object({...il,clusterType:t.Literal("azure"),clusterTenantId:t.String(),clusterSubscriptionId:t.String(),clusterRegion:t.Enum(pl)})]))}),tbe=m({tags:["admin"],method:"PUT",url:`${ke}/create`,body:b("clusterType",[t.Object({clusterType:t.Literal("aws"),orgId:p(),name:p(),clusterSize:t.Enum(xa),clusterAccountId:t.String({minLength:12,maxLength:12}),clusterBuilderRoleVersion:t.Enum(ul),clusterRegion:t.Enum(sl)}),t.Object({clusterType:t.Literal("gcp"),orgId:p(),name:p(),clusterSize:t.Enum(xa),clusterAccountId:p(),clusterRegion:t.Enum(cl)}),t.Object({clusterType:t.Literal("azure"),orgId:p(),name:p(),clusterSize:t.Enum(xa),clusterTenantId:p(),clusterSubscriptionId:p(),clusterRegion:t.Enum(pl)})]),response:t.Object({id:t.String(),bridgeEndpoint:t.String(),deployerEndpoint:t.String()})}),rbe=m({tags:["admin"],method:"DELETE",url:`${ke}/:id`,params:t.Object({id:p()}),body:t.Object({orgId:p()}),response:R}),nbe=m({tags:["admin"],method:"PUT",url:`${ke}/add-inbounder-key`,body:t.Object({orgId:p(),clusterId:p()}),response:t.Object({orgId:t.String(),clusterId:t.String(),inbounderAuthenticationKey:t.String()})}),obe=m({tags:["admin"],method:"PUT",url:`${ke}/replace-all-inbounder-keys`,body:t.Object({orgId:p(),clusterId:p()}),response:t.Object({orgId:t.String(),clusterId:t.String(),inbounderAuthenticationKey:t.String()})}),ibe=m({tags:["admin"],method:"PUT",url:`${ke}/replace-inbounder-key`,body:t.Object({orgId:p(),clusterId:p(),inbounderAuthenticationKeyToReplace:p()}),response:t.Object({orgId:t.String(),clusterId:t.String(),inbounderAuthenticationKey:t.String()})}),abe=m({tags:["admin"],method:"PUT",url:`${ke}/delete-inbounder-key`,body:t.Object({orgId:p(),clusterId:p(),inbounderAuthenticationKeyToDelete:p()}),response:t.Object({orgId:t.String(),clusterId:t.String(),isKeyDeleted:t.Boolean()})}),sbe=m({tags:["admin"],method:"PUT",url:`${ke}/rotate-deployer-key`,body:t.Object({orgId:p(),clusterId:p(),newKey:p()}),response:t.Object({orgId:t.String(),clusterId:t.String(),isKeyUpdated:t.Boolean()})}),cbe=m({tags:["admin"],method:"PUT",url:`${ke}/rotate-bridge-key`,body:t.Object({orgId:p(),clusterId:p(),newKey:p()}),response:t.Object({orgId:t.String(),clusterId:t.String(),isKeyUpdated:t.Boolean()})}),al={central:t.String(),ngrokBridgeDomain:t.String(),ngrokDeployerDomain:t.String(),clusterCertificateExpiresAt:E(),clusterName:t.String(),clusterSize:t.Optional(t.Enum(xa)),secretBridgeAuthenticationKey:t.String(),secretDeployerAuthenticationKey:t.String(),secretOutbounderAuthenticationKey:t.String(),slackChannelEmail:t.String(),customerTier:t.String()},pbe=m({tags:["admin"],method:"POST",url:`${ke}/:id`,body:t.Object({orgId:p()}),params:t.Object({id:p()}),response:b("clusterType",[t.Object({...al,clusterType:t.Literal("aws"),clusterAccountId:t.String(),clusterBuilderRoleVersion:t.Optional(t.Enum(ul)),clusterRegion:t.Enum(sl)}),t.Object({...al,clusterType:t.Literal("gcp"),clusterAccountId:t.String(),clusterRegion:t.Enum(cl)}),t.Object({...al,clusterType:t.Literal("azure"),clusterTenantId:t.String(),clusterSubscriptionId:t.String(),clusterRegion:t.Enum(pl)})])}),ube=m({tags:["admin"],method:"POST",url:`${ke}/configuration`,body:t.Object({id:p({allowEmpty:!1}),orgId:p({allowEmpty:!1}),installationName:Yc,targetConfiguration:oS,gitSyncEnabled:t.Boolean({description:"Persisted on upgrade: whether this chart's values are synced from git."})}),response:t.Object({status:t.String()})}),lbe=m({tags:["admin"],method:"GET",url:`${ke}/git-values`,query:t.Object({orgId:p({allowEmpty:!1}),clusterId:p({allowEmpty:!1}),installationName:Yc}),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)."}))})}),mbe=m({tags:["admin"],method:"POST",url:`${ke}/git-sync`,body:t.Object({clusterId:p({allowEmpty:!1}),orgId:p({allowEmpty:!1}),installationName:Yc,gitSyncEnabled:t.Boolean({description:"Whether this chart syncs its Helm values from git."})}),response:t.Object({status:t.String()})}),dbe=m({tags:["admin"],method:"POST",url:`${ke}/automation`,body:t.Object({id:p(),orgId:p(),enableAutomatedDeployment:t.Boolean(),disabledReason:t.Optional(p())}),response:t.Object({status:t.String()})}),fbe=m({tags:["admin"],method:"POST",url:`${ke}/soak-time`,body:t.Object({id:p(),orgId:p(),soakTimeMin:t.Optional(t.Number())}),response:t.Object({status:t.String()})}),gbe=m({tags:["admin"],method:"POST",url:`${ke}/deploy`,body:t.Object({orgId:p(),clusterId:p(),chartName:p(),toVersion:p()}),response:t.Object({id:t.String()})}),o$=b("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()})})]),ybe=m({tags:["admin"],method:"GET",url:`${ke}/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:o$,updatedAt:E(),createdAt:E(),installationName:t.String(),chartName:t.String(),isAutomated:t.Boolean(),createdBy:t.Optional(t.String()),createdByName:t.Optional(t.String()),createdByEmail:t.Optional(t.String())}))}),i$=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())}))}),hbe=m({tags:["admin"],method:"POST",url:`${ke}/status`,body:t.Object({orgId:t.Optional(p()),clusterId:t.Optional(p())}),response:t.Array(t.Object({orgId:t.String(),clusterId:t.String(),status:i$}))}),Tbe=m({tags:["admin"],method:"POST",url:`${ke}/argocd-cert-info`,body:t.Object({orgId:p(),clusterId:p()}),response:t.Object({certificateExpiresAt:t.String()})}),a$=t.Object({kind:t.String(),name:t.String()}),s$=t.Object({id:a$,liveManifest:t.Optional(t.String()),targetManifest:t.Optional(t.String())}),Ebe=m({tags:["admin"],method:"POST",url:`${ke}/resource-details`,body:t.Object({orgId:p(),clusterId:p(),installationName:p()}),response:t.Object({resources:t.Array(s$)})}),_be=m({tags:["admin"],method:"GET",url:`${ke}/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(E()),pushedAt:t.Optional(E())}))});var c$=t.Object({id:t.Object({name:t.String(),kind:t.String()}),previewManifest:t.Optional(t.String())}),Ibe=m({tags:["admin"],method:"POST",url:`${ke}/versions/render`,body:t.Object({chartName:p(),version:p(),values:p({type:"long"}),installationName:p(),namespace:p()}),response:t.Array(c$)}),_r=`${zc}/orgs`,bbe=m({tags:["admin"],url:_r,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:E(),updatedAt:E()}))}),Sbe=m({tags:["admin"],url:_r,method:"POST",body:t.Object({allowedDomains:t.Array(p({type:"lowercase-domain"}),{maxItems:Kc}),name:p()}),response:t.Object({id:t.String(),name:t.String()})}),Obe=m({tags:["admin"],url:`${_r}/:id`,method:"PUT",params:t.Object({id:p()}),body:t.Object({allowedDomains:t.Optional(t.Array(p({type:"lowercase-domain"}),{maxItems:Kc}))}),response:t.Object({id:t.String(),name:t.String(),allowedDomains:t.Array(t.String())})}),Abe=m({tags:["admin"],url:`${_r}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),xbe=m({tags:["admin"],url:`${_r}/:id/restore`,method:"POST",params:t.Object({id:p()}),response:t.Object({success:t.Boolean()})}),Rbe=m({tags:["admin"],url:`${_r}/: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()})}),Cbe=m({tags:["admin"],url:`${_r}/synchronize-sds-rules`,method:"POST",response:t.Object({errorOrgs:t.Optional(t.Array(t.Object({id:t.String(),name:t.String()}))),synchronizedOrgsCount:t.Number()})}),p$=["custom_usage_tag","ingestion_api_key","inventory_resource","monitor","retention_policy","route","sensitive_data_scanner_rule","tag_policy","team"],u$=t.Enum(p$),Pbe=m({tags:["admin"],url:`${_r}/refresh-assets`,method:"POST",body:t.Object({assetTypes:t.Array(u$,{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()}))}))}),Ube=m({tags:["admin"],url:`${_r}/sudo`,method:"POST",body:t.Object({orgId:p()}),response:t.Object({sudoToken:t.String()})}),l$=`${zc}/users`,wbe=m({tags:["admin"],url:`${l$}/invite`,method:"POST",body:t.Object({email:p({type:"email"}),orgId:p(),userRole:t.Enum(Fc)}),response:t.Array(t.Object({inviteId:t.String(),email:t.String(),result:t.Union([t.Literal("success"),t.Literal("email-failed")])}))});var Nbe=m({tags:["admin"],url:`${zc}/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 aS=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(iS,{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`."}),m$={id:"abc-123-def",name:"production",friendlyName:"Production (US)",clusterType:"aws",clusterRegion:"us-east-1"};Object.assign(aS,{examples:[m$]});var sS=m({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(aS)});function cS(e,r){e.command("cluster").description("Manage Tsuga cluster selection").command("list").description("List all Tsuga clusters available to the operation API key").action(async()=>{let o=await r()(sS);Q(o)})}function uS(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("__")||uS(c,[...r,c.name()],n,o)}function d$(e){let r=new Map,n=new Set;return uS(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 pS(e){return e.map(({key:r,cmds:n,flags:o})=>` ${JSON.stringify(r)}) cmds=${JSON.stringify(n)} flags=${JSON.stringify(o)} ;;`).join(`
48
+ `),process.exitCode=1;return}if(Fs({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 BG(){let{credential:e}=Fo({});if(!e){B("Not authenticated. Run `tsuga auth login` or `tsuga auth operation-key <OPERATION_API_KEY>`.");return}switch(e.kind){case"user-session":B(`Logged in as a user (token ${Li(e.userAuth.accessToken)}, expires ${e.userAuth.accessExpiresAt}).`);return;case"operation-api-key":B("Authenticated with an operation API key.");return;default:Xe(e)}}function FG(){Nb(),B("Local user session cleared.")}function jb(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 (replaces any saved operation API key)").action(jG),r.command("logout").description("Clear the saved user session").action(FG),r.command("token").description("Print the saved user access token to stdout").action(qG),r.command("operation-key <OPERATION_API_KEY>").description("Save an operation API key to the config file (replaces any saved user session)").action(n=>{wb(n),B(`Operation API key saved to ${Aa()}`)}),r.command("status").description("Show the current authentication method").action(BG)}var HG=["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"],KG=["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"],zG=["log","metric","trace","rum"],YG=[...KG,...zG],xIe=[...HG,...YG];var Fc=["admin","public_editor","public_viewer","teams_only"],Ho=["admin","editor","viewer"];var $n="/v0/team-membership",rl="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.",nl=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(Ho,{description:rl})}),qb=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(Ho,{description:rl})}),VG=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."})}),QG=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."}))})),RIe=m({tags:["access-control"],url:$n,method:"GET",query:QG,response:t.Array(nl)}),CIe=m({tags:["access-control"],url:$n,method:"POST",body:qb,response:nl}),PIe=m({tags:["access-control"],url:$n,method:"PUT",body:qb,response:nl}),UIe=m({tags:["access-control"],url:$n,method:"DELETE",body:VG,response:R}),Bc=500,Bb=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(Ho,{description:rl})},{oneOf:[{required:["userId"]},{required:["userEmail"]}]}),{minItems:1,maxItems:Bc,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."}),WG={teamId:"team-123-abc",members:[{userId:"user-123-abc",roleKey:"viewer"},{userEmail:"sam@example.com",roleKey:"editor"}]};Object.assign(Bb,{examples:[WG]});var Fb=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."}),ZG={results:[{userId:"user-123-abc",status:"added"},{userId:"sam@example.com",status:"user_not_found"}]};Object.assign(Fb,{examples:[ZG]});var wIe=m({tags:["access-control"],url:`${$n}/bulk-add`,method:"POST",body:Bb,response:Fb}),NIe=m({tags:["access-control"],url:`${$n}/bulk-update-user-roles`,method:"PUT",body:t.Object({userIds:t.Array(p({allowEmpty:!1}),{minItems:1,maxItems:Bc}),teamId:p({allowEmpty:!1}),role:t.Enum(Ho)}),response:t.Object({})}),Hb=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:Bc,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:Bc,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."}),XG={teamId:"team-123-abc",userIds:["user-123-abc"]};Object.assign(Hb,{examples:[XG]});var Kb=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."}),JG={results:[{userId:"user-123-abc",status:"removed"},{userId:"missing@example.com",status:"user_not_found"}]};Object.assign(Kb,{examples:[JG]});var LIe=m({tags:["access-control"],url:`${$n}/bulk-remove`,method:"DELETE",body:Hb,response:Kb});var e$=["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"],zb=t.Enum(e$,{description:"Stable nav item key within a main sidebar category."}),Yb=t.Array(zb,{description:"Nav item keys shown in the primary sidebar for this category, in display order."}),Vb=t.Optional(t.Array(zb,{description:"Nav item keys for this category that are folded away (e.g. View more). Omitted or empty means none."})),Qb="Stable category id. Unknown or renamed ids are ignored by the client catalog.",Wb="Sidebar categories in display order. Unknown or renamed ids are ignored by the client catalog.",ol=t.Object({categories:t.Array(t.Object({id:t.String({description:Qb}),visible:Yb,folded:Vb}),{description:Wb})}),Zb=t.Object({categories:t.Array(t.Object({id:p({allowEmpty:!1,description:Qb}),visible:Yb,folded:Vb}),{description:Wb})});var Hc="/v0/org",t$=`${Hc}/current-user`,Xb=`${Hc}/settings`,Jb=`${Hc}/allowed-domains`,Kc=50,eS=t.Object({id:t.String(),name:t.String(),createdAt:E(),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()}),tS=t.Object({allowedDomains:t.Array(p({allowEmpty:!1,type:"lowercase-domain",description:'A lowercase email domain (e.g. "acme.com").'}),{maxItems:Kc,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."})}),rS=t.Pick(eS,["allowedDomains"]),BIe=m({tags:["organization"],url:t$,method:"GET",response:eS}),FIe=m({tags:["organization"],url:Xb,method:"GET",response:t.Object({enableLlmFeatures:t.Boolean(),allowEmailPasswordLogin:t.Boolean(),sidebarNavLayout:t.Optional(ol)})}),HIe=m({tags:["organization"],url:Xb,method:"PUT",body:t.Object({enableLlmFeatures:t.Optional(t.Boolean()),allowEmailPasswordLogin:t.Optional(t.Boolean()),sidebarNavLayout:t.Optional(t.Union([Zb,t.Null()]))}),response:t.Object({enableLlmFeatures:t.Boolean(),allowEmailPasswordLogin:t.Boolean(),sidebarNavLayout:t.Optional(ol)})}),KIe=m({tags:["organization"],url:Hc,method:"PUT",body:tS,response:t.Object({allowedDomains:t.Array(t.String())})}),zIe=m({tags:["organization"],url:Jb,method:"GET",response:rS}),YIe=m({tags:["organization"],url:Jb,method:"PUT",body:tS,response:rS});var zc="/v0/admin",ke=`${zc}/clusters`,oS=t.Object({helmParameters:t.Record(t.String(),t.Union([t.Number(),t.Boolean(),t.Null(),t.String()])),helmVersion:t.String()}),nS=t.Record(t.String(),oS),sl=["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"],cl=["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"],pl=["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"],iS=["aws","gcp","azure"],xa=["xs","s","m","l"],ul=["1.0"],r$=["tsuga-cluster","tsuga-telemetry","tsuga-deployer","tsuga-events"],Yc=t.Enum(r$,{description:"Helm installation name identifying a chart component on the cluster."}),n$={id:t.String(),name:t.String(),createdAt:E(),clusterCertificateExpiresAt:E(),bridgeEndpoint:t.String(),deployerEndpoint:t.String(),targetConfiguration:nS,appliedConfiguration:t.Optional(nS),automaticallyDeployLatestVersion:t.Boolean(),automatedDeploymentDisabledBy:t.Optional(t.String()),automatedDeploymentDisabledReason:t.Optional(t.String()),automatedDeploymentDisabledAt:t.Optional(E()),soakTimeMin:t.Optional(t.Number()),clusterSize:t.Optional(t.Enum(xa)),gitSyncByInstallation:t.Record(Yc,t.Boolean(),{description:"Per-installation git-sync state, keyed by installationName."})},il={...n$,orgId:t.String(),orgName:t.String()},tbe=m({tags:["admin"],method:"GET",url:ke,query:t.Object({orgId:t.Optional(p())}),response:t.Array(b("clusterType",[t.Object({...il,clusterType:t.Literal("aws"),clusterAccountId:t.String(),clusterBuilderRoleVersion:t.Optional(t.Enum(ul)),clusterRegion:t.Enum(sl)}),t.Object({...il,clusterType:t.Literal("gcp"),clusterAccountId:t.String(),clusterRegion:t.Enum(cl)}),t.Object({...il,clusterType:t.Literal("azure"),clusterTenantId:t.String(),clusterSubscriptionId:t.String(),clusterRegion:t.Enum(pl)})]))}),rbe=m({tags:["admin"],method:"PUT",url:`${ke}/create`,body:b("clusterType",[t.Object({clusterType:t.Literal("aws"),orgId:p(),name:p(),clusterSize:t.Enum(xa),clusterAccountId:t.String({minLength:12,maxLength:12}),clusterBuilderRoleVersion:t.Enum(ul),clusterRegion:t.Enum(sl)}),t.Object({clusterType:t.Literal("gcp"),orgId:p(),name:p(),clusterSize:t.Enum(xa),clusterAccountId:p(),clusterRegion:t.Enum(cl)}),t.Object({clusterType:t.Literal("azure"),orgId:p(),name:p(),clusterSize:t.Enum(xa),clusterTenantId:p(),clusterSubscriptionId:p(),clusterRegion:t.Enum(pl)})]),response:t.Object({id:t.String(),bridgeEndpoint:t.String(),deployerEndpoint:t.String()})}),nbe=m({tags:["admin"],method:"DELETE",url:`${ke}/:id`,params:t.Object({id:p()}),body:t.Object({orgId:p()}),response:R}),obe=m({tags:["admin"],method:"PUT",url:`${ke}/add-inbounder-key`,body:t.Object({orgId:p(),clusterId:p()}),response:t.Object({orgId:t.String(),clusterId:t.String(),inbounderAuthenticationKey:t.String()})}),ibe=m({tags:["admin"],method:"PUT",url:`${ke}/replace-all-inbounder-keys`,body:t.Object({orgId:p(),clusterId:p()}),response:t.Object({orgId:t.String(),clusterId:t.String(),inbounderAuthenticationKey:t.String()})}),abe=m({tags:["admin"],method:"PUT",url:`${ke}/replace-inbounder-key`,body:t.Object({orgId:p(),clusterId:p(),inbounderAuthenticationKeyToReplace:p()}),response:t.Object({orgId:t.String(),clusterId:t.String(),inbounderAuthenticationKey:t.String()})}),sbe=m({tags:["admin"],method:"PUT",url:`${ke}/delete-inbounder-key`,body:t.Object({orgId:p(),clusterId:p(),inbounderAuthenticationKeyToDelete:p()}),response:t.Object({orgId:t.String(),clusterId:t.String(),isKeyDeleted:t.Boolean()})}),cbe=m({tags:["admin"],method:"PUT",url:`${ke}/rotate-deployer-key`,body:t.Object({orgId:p(),clusterId:p(),newKey:p()}),response:t.Object({orgId:t.String(),clusterId:t.String(),isKeyUpdated:t.Boolean()})}),pbe=m({tags:["admin"],method:"PUT",url:`${ke}/rotate-bridge-key`,body:t.Object({orgId:p(),clusterId:p(),newKey:p()}),response:t.Object({orgId:t.String(),clusterId:t.String(),isKeyUpdated:t.Boolean()})}),al={central:t.String(),ngrokBridgeDomain:t.String(),ngrokDeployerDomain:t.String(),clusterCertificateExpiresAt:E(),clusterName:t.String(),clusterSize:t.Optional(t.Enum(xa)),secretBridgeAuthenticationKey:t.String(),secretDeployerAuthenticationKey:t.String(),secretOutbounderAuthenticationKey:t.String(),slackChannelEmail:t.String(),customerTier:t.String()},ube=m({tags:["admin"],method:"POST",url:`${ke}/:id`,body:t.Object({orgId:p()}),params:t.Object({id:p()}),response:b("clusterType",[t.Object({...al,clusterType:t.Literal("aws"),clusterAccountId:t.String(),clusterBuilderRoleVersion:t.Optional(t.Enum(ul)),clusterRegion:t.Enum(sl)}),t.Object({...al,clusterType:t.Literal("gcp"),clusterAccountId:t.String(),clusterRegion:t.Enum(cl)}),t.Object({...al,clusterType:t.Literal("azure"),clusterTenantId:t.String(),clusterSubscriptionId:t.String(),clusterRegion:t.Enum(pl)})])}),lbe=m({tags:["admin"],method:"POST",url:`${ke}/configuration`,body:t.Object({id:p({allowEmpty:!1}),orgId:p({allowEmpty:!1}),installationName:Yc,targetConfiguration:oS,gitSyncEnabled:t.Boolean({description:"Persisted on upgrade: whether this chart's values are synced from git."})}),response:t.Object({status:t.String()})}),mbe=m({tags:["admin"],method:"GET",url:`${ke}/git-values`,query:t.Object({orgId:p({allowEmpty:!1}),clusterId:p({allowEmpty:!1}),installationName:Yc}),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)."}))})}),dbe=m({tags:["admin"],method:"POST",url:`${ke}/git-sync`,body:t.Object({clusterId:p({allowEmpty:!1}),orgId:p({allowEmpty:!1}),installationName:Yc,gitSyncEnabled:t.Boolean({description:"Whether this chart syncs its Helm values from git."})}),response:t.Object({status:t.String()})}),fbe=m({tags:["admin"],method:"POST",url:`${ke}/automation`,body:t.Object({id:p(),orgId:p(),enableAutomatedDeployment:t.Boolean(),disabledReason:t.Optional(p())}),response:t.Object({status:t.String()})}),gbe=m({tags:["admin"],method:"POST",url:`${ke}/soak-time`,body:t.Object({id:p(),orgId:p(),soakTimeMin:t.Optional(t.Number())}),response:t.Object({status:t.String()})}),ybe=m({tags:["admin"],method:"POST",url:`${ke}/deploy`,body:t.Object({orgId:p(),clusterId:p(),chartName:p(),toVersion:p()}),response:t.Object({id:t.String()})}),o$=b("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()})})]),hbe=m({tags:["admin"],method:"GET",url:`${ke}/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:o$,updatedAt:E(),createdAt:E(),installationName:t.String(),chartName:t.String(),isAutomated:t.Boolean(),createdBy:t.Optional(t.String()),createdByName:t.Optional(t.String()),createdByEmail:t.Optional(t.String())}))}),i$=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())}))}),Tbe=m({tags:["admin"],method:"POST",url:`${ke}/status`,body:t.Object({orgId:t.Optional(p()),clusterId:t.Optional(p())}),response:t.Array(t.Object({orgId:t.String(),clusterId:t.String(),status:i$}))}),Ebe=m({tags:["admin"],method:"POST",url:`${ke}/argocd-cert-info`,body:t.Object({orgId:p(),clusterId:p()}),response:t.Object({certificateExpiresAt:t.String()})}),a$=t.Object({kind:t.String(),name:t.String()}),s$=t.Object({id:a$,liveManifest:t.Optional(t.String()),targetManifest:t.Optional(t.String())}),_be=m({tags:["admin"],method:"POST",url:`${ke}/resource-details`,body:t.Object({orgId:p(),clusterId:p(),installationName:p()}),response:t.Object({resources:t.Array(s$)})}),Ibe=m({tags:["admin"],method:"GET",url:`${ke}/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(E()),pushedAt:t.Optional(E())}))});var c$=t.Object({id:t.Object({name:t.String(),kind:t.String()}),previewManifest:t.Optional(t.String())}),bbe=m({tags:["admin"],method:"POST",url:`${ke}/versions/render`,body:t.Object({chartName:p(),version:p(),values:p({type:"long"}),installationName:p(),namespace:p()}),response:t.Array(c$)}),_r=`${zc}/orgs`,Sbe=m({tags:["admin"],url:_r,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:E(),updatedAt:E()}))}),Obe=m({tags:["admin"],url:_r,method:"POST",body:t.Object({allowedDomains:t.Array(p({type:"lowercase-domain"}),{maxItems:Kc}),name:p()}),response:t.Object({id:t.String(),name:t.String()})}),Abe=m({tags:["admin"],url:`${_r}/:id`,method:"PUT",params:t.Object({id:p()}),body:t.Object({allowedDomains:t.Optional(t.Array(p({type:"lowercase-domain"}),{maxItems:Kc}))}),response:t.Object({id:t.String(),name:t.String(),allowedDomains:t.Array(t.String())})}),xbe=m({tags:["admin"],url:`${_r}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),Rbe=m({tags:["admin"],url:`${_r}/:id/restore`,method:"POST",params:t.Object({id:p()}),response:t.Object({success:t.Boolean()})}),Cbe=m({tags:["admin"],url:`${_r}/: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()})}),Pbe=m({tags:["admin"],url:`${_r}/synchronize-sds-rules`,method:"POST",response:t.Object({errorOrgs:t.Optional(t.Array(t.Object({id:t.String(),name:t.String()}))),synchronizedOrgsCount:t.Number()})}),p$=["custom_usage_tag","ingestion_api_key","inventory_resource","monitor","retention_policy","route","sensitive_data_scanner_rule","tag_policy","team"],u$=t.Enum(p$),Ube=m({tags:["admin"],url:`${_r}/refresh-assets`,method:"POST",body:t.Object({assetTypes:t.Array(u$,{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()}))}))}),wbe=m({tags:["admin"],url:`${_r}/sudo`,method:"POST",body:t.Object({orgId:p()}),response:t.Object({sudoToken:t.String()})}),l$=`${zc}/users`,Nbe=m({tags:["admin"],url:`${l$}/invite`,method:"POST",body:t.Object({email:p({type:"email"}),orgId:p(),userRole:t.Enum(Fc)}),response:t.Array(t.Object({inviteId:t.String(),email:t.String(),result:t.Union([t.Literal("success"),t.Literal("email-failed")])}))});var Lbe=m({tags:["admin"],url:`${zc}/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 aS=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(iS,{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`."}),m$={id:"abc-123-def",name:"production",friendlyName:"Production (US)",clusterType:"aws",clusterRegion:"us-east-1"};Object.assign(aS,{examples:[m$]});var sS=m({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(aS)});function cS(e,r){e.command("cluster").description("Manage Tsuga cluster selection").command("list").description("List all Tsuga clusters available to the operation API key").action(async()=>{let o=await r()(sS);Q(o)})}function uS(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("__")||uS(c,[...r,c.name()],n,o)}function d$(e){let r=new Map,n=new Set;return uS(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 pS(e){return e.map(({key:r,cmds:n,flags:o})=>` ${JSON.stringify(r)}) cmds=${JSON.stringify(n)} flags=${JSON.stringify(o)} ;;`).join(`
49
49
  `)}function f$(e,r){return`_tsuga_complete() {
50
50
  local cur key cmds flags words i word prev
51
51
  local valueflags="${r}"
@@ -132,46 +132,46 @@ Usage:
132
132
  bash: eval "$(tsuga completion bash)" # add to ~/.bashrc
133
133
  zsh: eval "$(tsuga completion zsh)" # add to ~/.zshrc
134
134
  fish: tsuga completion fish > ~/.config/fish/completions/tsuga.fish`).action(r=>{let{rows:n,valueFlags:o}=d$(e);if(r==="bash")B(f$(pS(n),o));else if(r==="zsh")B(g$(pS(n),o));else if(r==="fish")B(h$(y$(n),o));else throw new Error(`Unsupported shell "${r}". Supported: bash, zsh, fish.`)})}function mS(e){let r=e.command("config").description("Show or manage configuration");r.action(()=>{let n=e.opts(),o=Fo({operationApiKey:n.operationApiKey,clusterId:n.cluster});B(Mb(o,Aa()).trimEnd())}),r.command("set").description("Set a configuration value").command("default <FLAG_NAME> <VALUE>").description("Set a custom default value for a command flag").allowUnknownOption(!0).action((n,o)=>{vb(n,o),B(`Default set: ${n} = ${o}`)}),r.command("reset").description("Reset configuration values").command("defaults").description("Clear all custom defaults").action(()=>{kb(),B("Custom defaults cleared")})}var dS=`/${"v1"}/docs`,fS=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"}),T$={path:"getting-started/send-your-first-logs",title:"Send your first logs",content:`# Send your first logs
135
- ...`};Object.assign(fS,{examples:[T$]});var gS=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"}),E$={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(gS,{examples:[E$]});var yS=m({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:dS,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:fS}),hS=m({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:`${dS}/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(gS)});function TS(e,r){let n=e.command("docs").description("Search and fetch Tsuga documentation and API-reference pages");n.command("get <DOC_PATH>").description("Get a documentation or API-reference page by path (e.g. 'getting-started/send-your-first-logs' or 'api/aggregateScalar')").action(async o=>{let i=await r()(yS,{query:{path:o}});Q(i)}),n.command("search <SEARCH_TEXT>").description("Search Tsuga documentation and the full API reference, ranked by relevance").action(async o=>{let i=await r()(hS,{query:{query:o}});Q(i)})}var _$=`/${"v1"}/feedback`,ES=t.Object({id:t.String({description:"API request ID recorded with the feedback."})},{$id:"Feedback",description:"A recorded piece of feedback"}),I$={id:"request-123-abc"};Object.assign(ES,{examples:[I$]});var _S=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."})}),b$={content:"The traces command times out for large services."};Object.assign(_S,{examples:[b$]});var IS=m({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:_$,method:"POST",body:_S,response:ES});function bS(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()(IS,{body:{content:n.join(" ")}});Q(o)})}var S$={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:[]}},O$={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:[]}},A$={user:S$,team:O$};function ml(e){return SS(e,"team")}function dl(e){return SS(e,"user")}function SS(e,r){let n=[],o=A$[r];for(let[i,a]of Object.entries(o))for(let[c,l]of Object.entries(a))l.includes(e)&&n.push({actionType:c,resourceType:i});return n}var fSe={admin:{name:"Global admin",description:"Full control across the organization. Can view and modify everything, including private teams.",permissions:dl("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:dl("public_editor"),roleKey:"public_editor"},public_viewer:{name:"Public viewer",description:"Read-only access to public team data. Cannot make changes.",permissions:dl("public_viewer"),roleKey:"public_viewer"},teams_only:{name:"Teams only",description:"Only access data and assets in their own teams.",permissions:[],roleKey:"teams_only"}},gSe={admin:{name:"Team admin",description:"Full team control, manage assets, members, and settings.",permissions:ml("admin"),roleKey:"admin"},editor:{name:"Team editor",description:"Can view and update most assets (like dashboards, monitors).",permissions:ml("editor"),roleKey:"editor"},viewer:{name:"Team viewer",description:"Can view all team data but cannot make changes.",permissions:ml("viewer"),roleKey:"viewer"}};var OS="__tsuga_cluster_id__",x$=t.Object({}),R$=t.Object({status:t.Literal("error"),message:t.String({description:"Why this cluster failed to answer the query."})});function Ko(e=x$){let r=b("status",[t.Object({...e.properties,status:t.Literal("ok")}),R$]);return Object.assign(dc(Dt,r),{description:'Outcome per cluster, keyed by cluster ID. A cluster that failed reports `status: "error"`.'})}var Ra=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 AS=t.Object({type:t.Literal("number"),number:t.String()}),C$=t.Object({type:t.Literal("string"),string:t.String()}),P$=t.Object({type:t.Literal("timestamp"),timestamp:t.String()}),Ca=b("type",[AS,C$,P$]),U$=t.Object({by:t.Record(t.String(),Ca),computed:t.Record(t.String(),AS)}),w$=t.Object({type:t.Literal("buckets"),buckets:t.Array(U$),clusterResponses:t.Optional(Ko())}),N$=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()))}),Vc=b("type",[w$,N$]);var L$=["all","owning-team-and-public","owning-team-only"],pn=t.Enum(L$,{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 RS=1456444800,CS=4927737600,v$=RS*1e3,k$=CS*1e3,Qc=1704067200,fl=Qc*1e3,PS={title:"TimeRange",description:"Inclusive time range for telemetry queries. Use Unix timestamps in seconds unless the field description says milliseconds.",examples:[{from:Qc,to:Qc}]},M$={title:"TimeRange",description:"Inclusive time range for telemetry queries using Unix timestamps in milliseconds.",examples:[{from:fl,to:fl}]},Wc=e=>t.Integer({description:e,examples:[Qc],minimum:RS,maximum:CS,format:"int64"}),xS=e=>t.Integer({description:e,examples:[fl],minimum:v$,maximum:k$,format:"int64"}),Ye=t.Object({from:t.Optional(Wc("Start of the query window as a Unix timestamp in seconds")),to:t.Optional(Wc("End of the query window as a Unix timestamp in seconds"))},PS),mt=t.Object({from:Wc("Start of the query window as a Unix timestamp in seconds"),to:Wc("End of the query window as a Unix timestamp in seconds")},PS),zo=t.Object({from:xS("Start of the query window as a Unix timestamp in milliseconds"),to:xS("End of the query window as a Unix timestamp in milliseconds")},M$);var $$="/v0/aggregation",j$=t.Union([t.Literal("a"),t.Literal("d"),t.Literal("q"),t.Literal("w"),t.Literal("t")]),gl=t.Object({parallelism:t.Number(),engine:j$,recordBatchCache:t.Optional(t.Boolean()),includeNullGroups:t.Optional(t.Boolean()),restartAwareGaugeSum:t.Optional(t.Boolean())}),yl=["logs","metrics","traces"];var NS={logs:"Logs",metrics:"Metrics",traces:"Spans"},q$=[...yl,"connections","log-patterns","spans","rum"];var GSe={...NS,connections:"Connections","log-patterns":"Log Patterns",spans:"Spans",rum:"RUM events"},pr=[...yl,"rum"];var $Se={...NS,rum:"RUM events"};var jSe=t.Enum(q$,{description:"Data source being queried"}),LS=t.Enum(yl,{description:"Telemetry source queried by this aggregation: `logs`, `metrics`, or `traces`."}),zt=t.Enum(pr,{description:"Telemetry source queried by this aggregation: `logs`, `metrics`, `traces`, or `rum`."}),jn=t.String({description:"Attribute containing the values to aggregate"}),qn=p({description:"Attribute containing the values to aggregate"}),B$=b("type",[t.Object({type:t.Literal("count",{description:"Counts the total number of records"}),field:t.Optional(jn)},{$id:"AggregateCount",title:"Count"}),t.Object({type:t.Literal("unique-count",{description:"Counts the distinct values of the field"}),field:jn},{$id:"AggregateUniqueCount",title:"UniqueCount"}),t.Object({type:t.Literal("average",{description:"Calculates the average value of the selected field"}),field:jn},{$id:"AggregateAverage",title:"Average"}),t.Object({type:t.Literal("max",{description:"Finds the largest value of the field"}),field:jn},{$id:"AggregateMax",title:"Max"}),t.Object({type:t.Literal("min",{description:"Finds the smallest value of the field"}),field:jn},{$id:"AggregateMin",title:"Min"}),t.Object({type:t.Literal("sum",{description:"Sums the values of the selected field"}),field:jn},{$id:"AggregateSum",title:"Sum"}),t.Object({type:t.Literal("percentile",{description:"Calculates a percentile of the selected field"}),field:jn,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`."}),F$=b("type",[t.Object({type:t.Literal("count",{description:"Counts the total number of records"}),field:t.Optional(qn)},{$id:"InputAggregateCount",title:"Count"}),t.Object({type:t.Literal("unique-count",{description:"Counts the distinct values of the field"}),field:qn},{$id:"InputAggregateUniqueCount",title:"UniqueCount"}),t.Object({type:t.Literal("average",{description:"Calculates the average value of the selected field"}),field:qn},{$id:"InputAggregateAverage",title:"Average"}),t.Object({type:t.Literal("max",{description:"Finds the largest value of the field"}),field:qn},{$id:"InputAggregateMax",title:"Max"}),t.Object({type:t.Literal("min",{description:"Finds the smallest value of the field"}),field:qn},{$id:"InputAggregateMin",title:"Min"}),t.Object({type:t.Literal("sum",{description:"Sums the values of the selected field"}),field:qn},{$id:"InputAggregateSum",title:"Sum"}),t.Object({type:t.Literal("percentile",{description:"Calculates a percentile of the selected field"}),field:qn,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`."}),vS=t.Object({type:t.Literal("per-second",{description:"Normalizes the metric to events per second"})},{$id:"FunctionPerSecond",title:"PerSecond"}),kS=t.Object({type:t.Literal("per-minute",{description:"Normalizes the metric to events per minute"})},{$id:"FunctionPerMinute",title:"PerMinute"}),MS=t.Object({type:t.Literal("per-hour",{description:"Normalizes the metric to events per hour"})},{$id:"FunctionPerHour",title:"PerHour"}),DS=t.Object({type:t.Literal("rate",{description:"Calculates the rate of change"})},{$id:"FunctionRate",title:"Rate"}),GS=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"}),$S=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"}),jS=t.Object({type:t.Literal("sqrt",{description:"Applies a square root transformation to the values"})},{$id:"FunctionSqrt",title:"Sqrt"}),qS=t.Object({type:t.Literal("last",{description:"Takes the last value of the metric for the selected time frame"})},{$id:"FunctionLast",title:"Last"}),H$=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"}),K$=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"}),z$=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"}),Y$=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"}),V$=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"}),Q$=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"}),W$=b("type",[vS,kS,MS,DS,GS,H$,z$,$S,jS,qS,V$],{title:"Function",description:"Post-processing function applied to an aggregation query result after the aggregate is computed, selected by `type`."}),Z$=b("type",[vS,kS,MS,DS,GS,K$,Y$,$S,jS,qS,Q$],{title:"InputFunction",description:"Post-processing function applied to an aggregation query result after the aggregate is computed, selected by `type`."});var US=t.Object({min:t.Number({description:"Lower bound of the distribution range."}),max:t.Number({description:"Upper bound of the distribution range."})}),X$=["linear","log"],Zc=t.Enum(X$,{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."}),wS=t.Integer({minimum:1}),J$=b("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(wS),bounds:t.Optional(US),boundsScale:t.Optional(Zc),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(wS),bounds:t.Optional(US)},{title:"Heatmap",description:"Returns a distribution per time window"})]),Xc=15,e1=["zero","null"],t1=t.Enum(e1,{description:"`zero` fills missing points with zero. `null` keeps missing points null."}),BS=t.Object({mode:t.Object({type:t1},{description:"How missing aggregation points should be filled."})},{description:"Missing-point fill behavior for aggregation results. Optional; omit to keep missing points null."}),FS=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."}),HS={aggregate:B$,functions:t.Optional(t.Array(W$,{description:"Post-processing functions applied to aggregation results"})),fill:t.Optional(BS),timeAggregate:t.Optional(FS)},KS={aggregate:F$,functions:t.Optional(t.Array(Z$,{maxItems:10,description:"Post-processing functions applied to aggregation results. Defaults to an empty array when omitted."})),fill:t.Optional(BS),timeAggregate:t.Optional(FS)},r1={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."},zS={maxItems:Xc,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").'},YS=t.Array(t.Object({...HS,filter:t.Optional(t.String({description:"Filter to apply to the aggregation"}))},{title:"AggregationQuery"}),r1),Pa=t.Array(t.Object({...KS,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"}),zS),Ir=t.Array(t.Object({...HS,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."}),br=t.Array(t.Object({...KS,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."}),{...zS,description:"Aggregation queries used by alerting and SLO evaluation. Each query is referenced from formulas as q1, q2, and so on."});var Jc=t.String({description:"Formula referencing submitted query outputs, such as `q1 + q2`. References must be within `q1` through `qN` for the submitted queries."}),Bn=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."}),n1=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"}),o1=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"}),VS=7;var Yo=t.Array(n1,{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."}),Sr=t.Array(o1,{maxItems:VS,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 qSe=m({tags:["aggregation"],url:`${$$}/multi-query`,method:"POST",body:t.Object({timeRange:zo,queries:Pa,groupBy:t.Optional(Sr),returnType:J$,dataSource:zt,formula:Bn,executionOptions:gl,triggeredBy:t.Optional(t.Literal("refresh")),shouldStreamResults:t.Optional(t.Boolean()),clusterId:t.Optional(p({allowEmpty:!1})),clusterIds:t.Optional(Ra),viewAs:t.Optional(t.Object({owner:p({allowEmpty:!1,description:"Team ID to fetch data as"}),permissions:pn}))}),response:Vc});var hl=["red","orange","amber","yellow","green","emerald","teal","cyan","sky","blue","indigo","purple","pink"],Tl=["light","dark"];var i1={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)"}},QS=["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 YSe=i1.light.red.background;var WS=[{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-----
135
+ ...`};Object.assign(fS,{examples:[T$]});var gS=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"}),E$={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(gS,{examples:[E$]});var yS=m({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:dS,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:fS}),hS=m({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:`${dS}/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(gS)});function TS(e,r){let n=e.command("docs").description("Search and fetch Tsuga documentation and API-reference pages");n.command("get <DOC_PATH>").description("Get a documentation or API-reference page by path (e.g. 'getting-started/send-your-first-logs' or 'api/aggregateScalar')").action(async o=>{let i=await r()(yS,{query:{path:o}});Q(i)}),n.command("search <SEARCH_TEXT>").description("Search Tsuga documentation and the full API reference, ranked by relevance").action(async o=>{let i=await r()(hS,{query:{query:o}});Q(i)})}var _$=`/${"v1"}/feedback`,ES=t.Object({id:t.String({description:"API request ID recorded with the feedback."})},{$id:"Feedback",description:"A recorded piece of feedback"}),I$={id:"request-123-abc"};Object.assign(ES,{examples:[I$]});var _S=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."})}),b$={content:"The traces command times out for large services."};Object.assign(_S,{examples:[b$]});var IS=m({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:_$,method:"POST",body:_S,response:ES});function bS(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()(IS,{body:{content:n.join(" ")}});Q(o)})}var S$={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:[]}},O$={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:[]}},A$={user:S$,team:O$};function ml(e){return SS(e,"team")}function dl(e){return SS(e,"user")}function SS(e,r){let n=[],o=A$[r];for(let[i,a]of Object.entries(o))for(let[c,l]of Object.entries(a))l.includes(e)&&n.push({actionType:c,resourceType:i});return n}var gSe={admin:{name:"Global admin",description:"Full control across the organization. Can view and modify everything, including private teams.",permissions:dl("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:dl("public_editor"),roleKey:"public_editor"},public_viewer:{name:"Public viewer",description:"Read-only access to public team data. Cannot make changes.",permissions:dl("public_viewer"),roleKey:"public_viewer"},teams_only:{name:"Teams only",description:"Only access data and assets in their own teams.",permissions:[],roleKey:"teams_only"}},ySe={admin:{name:"Team admin",description:"Full team control, manage assets, members, and settings.",permissions:ml("admin"),roleKey:"admin"},editor:{name:"Team editor",description:"Can view and update most assets (like dashboards, monitors).",permissions:ml("editor"),roleKey:"editor"},viewer:{name:"Team viewer",description:"Can view all team data but cannot make changes.",permissions:ml("viewer"),roleKey:"viewer"}};var OS="__tsuga_cluster_id__",x$=t.Object({}),R$=t.Object({status:t.Literal("error"),message:t.String({description:"Why this cluster failed to answer the query."})});function Ko(e=x$){let r=b("status",[t.Object({...e.properties,status:t.Literal("ok")}),R$]);return Object.assign(dc(Dt,r),{description:'Outcome per cluster, keyed by cluster ID. A cluster that failed reports `status: "error"`.'})}var C$=5,Ra=t.Array(p({allowEmpty:!1}),{minItems:1,maxItems:C$,uniqueItems:!0,description:"IDs of the clusters to query, without duplicates. Mutually exclusive with `clusterId`. Omit both to use the default cluster."});var AS=t.Object({type:t.Literal("number"),number:t.String()}),P$=t.Object({type:t.Literal("string"),string:t.String()}),U$=t.Object({type:t.Literal("timestamp"),timestamp:t.String()}),Ca=b("type",[AS,P$,U$]),w$=t.Object({by:t.Record(t.String(),Ca),computed:t.Record(t.String(),AS)}),N$=t.Object({type:t.Literal("buckets"),buckets:t.Array(w$),clusterResponses:t.Optional(Ko())}),L$=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()))}),Vc=b("type",[N$,L$]);var v$=["all","owning-team-and-public","owning-team-only"],pn=t.Enum(v$,{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 RS=1456444800,CS=4927737600,k$=RS*1e3,M$=CS*1e3,Qc=1704067200,fl=Qc*1e3,PS={title:"TimeRange",description:"Inclusive time range for telemetry queries. Use Unix timestamps in seconds unless the field description says milliseconds.",examples:[{from:Qc,to:Qc}]},D$={title:"TimeRange",description:"Inclusive time range for telemetry queries using Unix timestamps in milliseconds.",examples:[{from:fl,to:fl}]},Wc=e=>t.Integer({description:e,examples:[Qc],minimum:RS,maximum:CS,format:"int64"}),xS=e=>t.Integer({description:e,examples:[fl],minimum:k$,maximum:M$,format:"int64"}),Ye=t.Object({from:t.Optional(Wc("Start of the query window as a Unix timestamp in seconds")),to:t.Optional(Wc("End of the query window as a Unix timestamp in seconds"))},PS),mt=t.Object({from:Wc("Start of the query window as a Unix timestamp in seconds"),to:Wc("End of the query window as a Unix timestamp in seconds")},PS),zo=t.Object({from:xS("Start of the query window as a Unix timestamp in milliseconds"),to:xS("End of the query window as a Unix timestamp in milliseconds")},D$);var j$="/v0/aggregation",q$=t.Union([t.Literal("a"),t.Literal("d"),t.Literal("q"),t.Literal("w"),t.Literal("t")]),gl=t.Object({parallelism:t.Number(),engine:q$,recordBatchCache:t.Optional(t.Boolean()),includeNullGroups:t.Optional(t.Boolean()),restartAwareGaugeSum:t.Optional(t.Boolean())}),yl=["logs","metrics","traces"];var NS={logs:"Logs",metrics:"Metrics",traces:"Spans"},B$=[...yl,"connections","log-patterns","spans","rum"];var $Se={...NS,connections:"Connections","log-patterns":"Log Patterns",spans:"Spans",rum:"RUM events"},pr=[...yl,"rum"];var jSe={...NS,rum:"RUM events"};var qSe=t.Enum(B$,{description:"Data source being queried"}),LS=t.Enum(yl,{description:"Telemetry source queried by this aggregation: `logs`, `metrics`, or `traces`."}),zt=t.Enum(pr,{description:"Telemetry source queried by this aggregation: `logs`, `metrics`, `traces`, or `rum`."}),jn=t.String({description:"Attribute containing the values to aggregate"}),qn=p({description:"Attribute containing the values to aggregate"}),F$=b("type",[t.Object({type:t.Literal("count",{description:"Counts the total number of records"}),field:t.Optional(jn)},{$id:"AggregateCount",title:"Count"}),t.Object({type:t.Literal("unique-count",{description:"Counts the distinct values of the field"}),field:jn},{$id:"AggregateUniqueCount",title:"UniqueCount"}),t.Object({type:t.Literal("average",{description:"Calculates the average value of the selected field"}),field:jn},{$id:"AggregateAverage",title:"Average"}),t.Object({type:t.Literal("max",{description:"Finds the largest value of the field"}),field:jn},{$id:"AggregateMax",title:"Max"}),t.Object({type:t.Literal("min",{description:"Finds the smallest value of the field"}),field:jn},{$id:"AggregateMin",title:"Min"}),t.Object({type:t.Literal("sum",{description:"Sums the values of the selected field"}),field:jn},{$id:"AggregateSum",title:"Sum"}),t.Object({type:t.Literal("percentile",{description:"Calculates a percentile of the selected field"}),field:jn,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`."}),H$=b("type",[t.Object({type:t.Literal("count",{description:"Counts the total number of records"}),field:t.Optional(qn)},{$id:"InputAggregateCount",title:"Count"}),t.Object({type:t.Literal("unique-count",{description:"Counts the distinct values of the field"}),field:qn},{$id:"InputAggregateUniqueCount",title:"UniqueCount"}),t.Object({type:t.Literal("average",{description:"Calculates the average value of the selected field"}),field:qn},{$id:"InputAggregateAverage",title:"Average"}),t.Object({type:t.Literal("max",{description:"Finds the largest value of the field"}),field:qn},{$id:"InputAggregateMax",title:"Max"}),t.Object({type:t.Literal("min",{description:"Finds the smallest value of the field"}),field:qn},{$id:"InputAggregateMin",title:"Min"}),t.Object({type:t.Literal("sum",{description:"Sums the values of the selected field"}),field:qn},{$id:"InputAggregateSum",title:"Sum"}),t.Object({type:t.Literal("percentile",{description:"Calculates a percentile of the selected field"}),field:qn,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`."}),vS=t.Object({type:t.Literal("per-second",{description:"Normalizes the metric to events per second"})},{$id:"FunctionPerSecond",title:"PerSecond"}),kS=t.Object({type:t.Literal("per-minute",{description:"Normalizes the metric to events per minute"})},{$id:"FunctionPerMinute",title:"PerMinute"}),MS=t.Object({type:t.Literal("per-hour",{description:"Normalizes the metric to events per hour"})},{$id:"FunctionPerHour",title:"PerHour"}),DS=t.Object({type:t.Literal("rate",{description:"Calculates the rate of change"})},{$id:"FunctionRate",title:"Rate"}),GS=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"}),$S=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"}),jS=t.Object({type:t.Literal("sqrt",{description:"Applies a square root transformation to the values"})},{$id:"FunctionSqrt",title:"Sqrt"}),qS=t.Object({type:t.Literal("last",{description:"Takes the last value of the metric for the selected time frame"})},{$id:"FunctionLast",title:"Last"}),K$=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"}),z$=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"}),Y$=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"}),V$=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"}),Q$=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"}),W$=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"}),Z$=b("type",[vS,kS,MS,DS,GS,K$,Y$,$S,jS,qS,Q$],{title:"Function",description:"Post-processing function applied to an aggregation query result after the aggregate is computed, selected by `type`."}),X$=b("type",[vS,kS,MS,DS,GS,z$,V$,$S,jS,qS,W$],{title:"InputFunction",description:"Post-processing function applied to an aggregation query result after the aggregate is computed, selected by `type`."});var US=t.Object({min:t.Number({description:"Lower bound of the distribution range."}),max:t.Number({description:"Upper bound of the distribution range."})}),J$=["linear","log"],Zc=t.Enum(J$,{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."}),wS=t.Integer({minimum:1}),e1=b("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(wS),bounds:t.Optional(US),boundsScale:t.Optional(Zc),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(wS),bounds:t.Optional(US)},{title:"Heatmap",description:"Returns a distribution per time window"})]),Xc=15,t1=["zero","null"],r1=t.Enum(t1,{description:"`zero` fills missing points with zero. `null` keeps missing points null."}),BS=t.Object({mode:t.Object({type:r1},{description:"How missing aggregation points should be filled."})},{description:"Missing-point fill behavior for aggregation results. Optional; omit to keep missing points null."}),FS=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."}),HS={aggregate:F$,functions:t.Optional(t.Array(Z$,{description:"Post-processing functions applied to aggregation results"})),fill:t.Optional(BS),timeAggregate:t.Optional(FS)},KS={aggregate:H$,functions:t.Optional(t.Array(X$,{maxItems:10,description:"Post-processing functions applied to aggregation results. Defaults to an empty array when omitted."})),fill:t.Optional(BS),timeAggregate:t.Optional(FS)},n1={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."},zS={maxItems:Xc,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").'},YS=t.Array(t.Object({...HS,filter:t.Optional(t.String({description:"Filter to apply to the aggregation"}))},{title:"AggregationQuery"}),n1),Pa=t.Array(t.Object({...KS,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"}),zS),Ir=t.Array(t.Object({...HS,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."}),br=t.Array(t.Object({...KS,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."}),{...zS,description:"Aggregation queries used by alerting and SLO evaluation. Each query is referenced from formulas as q1, q2, and so on."});var Jc=t.String({description:"Formula referencing submitted query outputs, such as `q1 + q2`. References must be within `q1` through `qN` for the submitted queries."}),Bn=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."}),o1=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"}),i1=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"}),VS=7;var Yo=t.Array(o1,{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."}),Sr=t.Array(i1,{maxItems:VS,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 BSe=m({tags:["aggregation"],url:`${j$}/multi-query`,method:"POST",body:t.Object({timeRange:zo,queries:Pa,groupBy:t.Optional(Sr),returnType:e1,dataSource:zt,formula:Bn,executionOptions:gl,triggeredBy:t.Optional(t.Literal("refresh")),shouldStreamResults:t.Optional(t.Boolean()),clusterId:t.Optional(p({allowEmpty:!1})),clusterIds:t.Optional(Ra),viewAs:t.Optional(t.Object({owner:p({allowEmpty:!1,description:"Team ID to fetch data as"}),permissions:pn}))}),response:Vc});var hl=["red","orange","amber","yellow","green","emerald","teal","cyan","sky","blue","indigo","purple","pink"],Tl=["light","dark"];var a1={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)"}},QS=["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 VSe=a1.light.red.background;var WS=[{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-----
136
136
  MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDAC4AWkdwKYSd8
137
137
  Ks14IReLcYgADhoXk56ZzXI=
138
- -----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}"}],a1=WS.map(e=>e.key);var tOe=new Set(a1),rOe=WS.map(e=>e.key);var M="context";var ZS="trace_id",mOe=`${M}.team`,dOe=`${M}.env`,fOe=`${M}.api_key_id`,ep=`${M}.service.name`,gOe=`${M}.service.version`,El=`${M}.span.kind`,_l=`${M}.span.name`,Il=`${M}.status.code`,XS=["SPAN_KIND_UNSPECIFIED","SPAN_KIND_INTERNAL","SPAN_KIND_SERVER","SPAN_KIND_CLIENT","SPAN_KIND_PRODUCER","SPAN_KIND_CONSUMER"];var Ua=`${M}.host.name`,s1=`${M}.instance`,c1=`${M}.instanceid`,p1=`${M}.instance_name`,yOe=`${M}.telemetry.sdk.language`,hOe=`${M}.process.runtime.name`,TOe=`${M}.scope.name`,EOe=`${M}.cloud.provider`,_Oe=`${M}.cloud.platform`,IOe=`${M}.aws.ecs.task.arn`,bOe=`${M}.k8s.cluster.name`,SOe=`${M}.k8s.cluster.uid`,OOe=`${M}.k8s.namespace.name`,u1=`${M}.k8s.pod.name`,AOe=`${M}.k8s.pod.uid`,xOe=`${M}.k8s.container.name`,ROe=`${M}.k8s.node.name`,COe=`${M}.k8s.node.uid`,l1=`${M}.k8s.deployment.name`,POe=`${M}.k8s.deployment.uid`,m1=`${M}.k8s.replicaset.name`,UOe=`${M}.k8s.replicaset.uid`,d1=`${M}.k8s.statefulset.name`,wOe=`${M}.k8s.statefulset.uid`,f1=`${M}.k8s.daemonset.name`,NOe=`${M}.k8s.daemonset.uid`,LOe=`${M}.k8s.job.name`,vOe=`${M}.k8s.job.uid`,kOe=`${M}.k8s.cronjob.name`,MOe=`${M}.k8s.cronjob.uid`,bl="status_code",Sl="span.name";var Ol="span.kind";var g1="db.system.name",y1="db.system",h1="db.namespace",T1="db.name";var DOe=`span_attributes.${h1}`,GOe=`span_attributes.${T1}`,$Oe=`span_attributes.${g1}`,jOe=`span_attributes.${y1}`;var qOe={name:"tsuga.internal.processing_tag_policy_violations_total",attributes:{tagPolicyId:`${M}.tag_policy_id`,dataSource:`${M}.data_source`}};var BOe={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 Al="__tsuga_metadata__",FOe=`${Al}.signature`,HOe=`${Al}.routes`,KOe=`${Al}.trace_id_bucket`;var WOe={[El]:Ol,[El.replace(`${M}.`,"")]:Ol,[_l]:Sl,[_l.replace(`${M}.`,"")]:Sl,[Il]:bl,[Il.replace(`${M}.`,"")]:bl};function JS(e){return e.replace(/ies$/,"y").replace(/s$/,"")}var eO=["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"],tO=["alert_queries","alert_thresholds","alert_values"],E1=[...eO,...tO],rO=["alert_event_name","alert_message"],bAe=[...E1,...rO],SAe=new Set([...eO,...rO]),OAe=new Set(tO);var _1="^\\S(.*\\S)?$",I1=128,b1=256,S1=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"}),O1=t.Object({key:t.String({maxLength:I1,description:"Tag key to attach to the resource."}),value:t.String({maxLength:b1,pattern:_1,description:"Tag value to attach to the resource. Leading or trailing whitespace is rejected."})},{title:"Tag"}),Yt=t.Array(S1,{title:"Tags",description:"Key/value tags applied to the resource. Use them to organize resources and to satisfy tag policies."}),Vt=t.Array(O1,{title:"Tags",maxItems:50,description:"Key/value tags to apply to the resource. Tag policies may require specific keys or values."}),Me=t.Optional(Yt),Ve=t.Optional(Vt);var un="/v0/teams",rp=["public","private"],tp={NAME:"name",CREATED_AT:"createdAt",MEMBER_COUNT:"memberCount",VISIBILITY:"visibility"},A1=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`."}),iO=t.Object({color:t.Enum(hl,{description:"Color token used by Tsuga when rendering the team avatar."}),mode:t.Enum(Tl,{description:"Avatar rendering mode selected for the team."}),iconName:t.Enum(QS,{description:"Icon name rendered inside the team avatar when icon mode is used."})}),xl=t.Object({color:t.Enum(hl),mode:t.Enum(Tl)}),nO=100,oO=250,Vo=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:Me,createdAt:E({description:"Timestamp when Tsuga created the team."}),updatedAt:E({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(iO)}),np=t.Object({name:t.String({minLength:1,maxLength:nO,format:$o,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 ${nO} characters.`}),description:t.Optional(t.String({maxLength:oO,description:`Optional team description. Maximum length is ${oO} 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(iO)}),x1=t.Object({id:t.String(),name:t.String(),email:t.String(),role:t.Enum(Ho),joinedTeamAt:E(),orgRole:t.Enum(Fc),avatar:t.Optional(xl)}),_xe=m({tags:["teams"],url:un,method:"GET",paginated:!0,response:t.Array(Vo),query:t.Object({...ye,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(A1),sortDirection:t.Optional(t.Enum(["asc","desc"],{description:"Sort direction: ascending or descending."}))})}),Ixe=m({tags:["teams"],url:`${un}/:id`,method:"GET",params:t.Object({id:p()}),response:Vo}),bxe=m({tags:["teams"],url:`${un}/:id/members`,method:"GET",params:t.Object({id:p()}),response:t.Array(x1)}),Sxe=m({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()})}),Oxe=m({tags:["teams"],url:un,method:"POST",body:np,response:Vo}),Axe=m({tags:["teams"],url:`${un}/:id`,method:"PUT",params:t.Object({id:p()}),body:np,response:Vo}),xxe=m({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({})}),Rxe=m({tags:["teams"],url:`${un}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R});var R1=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=b("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(R1)})],{description:"User or operation API key responsible for creating or updating a resource. Returned by Tsuga for audit context."});var ft="/v0/monitors",Qo=["alert","resolve","keep_last_status","consider_zero"],Wo=["alert","resolve","keep_last_status"];var sO=["no_aggregation","all","any","each","proportion"],cO=["greater_than","less_than","equal","not_equal","greater_than_or_equal","less_than_or_equal"];var C1=t.Object({formula:t.String({description:"Formula result to compare against the threshold, usually `q1` or a formula alias."}),operator:t.Enum(cO,{description:"Comparison operator used to evaluate the threshold condition."}),threshold:t.Number({description:"Numeric threshold value used by the comparison."})}),P1=t.Object({formula:p({type:"tsuga-formula",description:"Formula result to compare against the threshold, usually `q1` or a formula alias."}),operator:t.Enum(cO,{description:"Comparison operator used to evaluate the threshold condition."}),threshold:t.Number({description:"Numeric threshold value used by the comparison."})}),U1=5,Rl=t.Array(C1,{description:"Threshold conditions evaluated against query and formula results. All listed conditions must match for a non-grouped threshold monitor to alert."}),Cl=t.Array(P1,{minItems:1,maxItems:U1,description:"Threshold conditions evaluated against query and formula results. All listed conditions must match for a non-grouped threshold monitor to alert."}),Pl=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`."}),Ul=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(sO,{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(sO,{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`."}))},wl={...op,timeframe:t.Number({description:"Lookback window, in minutes, that each anomaly monitor evaluation aggregates over. Always a whole number from 5 through 1440."})},Nl={...ip,timeframe:t.Integer({minimum:5,maximum:1440,description:"Lookback window, in minutes, that each anomaly monitor evaluation aggregates over."})},pO=t.Object({type:t.Literal("metric",{description:"Threshold monitor over metric aggregations."}),conditions:Rl,noDataBehavior:t.Enum(Qo,{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:Ir},{$id:"MonitorConfigurationMetric"}),uO=t.Object({type:t.Literal("metric",{description:"Threshold monitor over metric aggregations."}),conditions:Cl,noDataBehavior:t.Enum(Qo,{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:br},{$id:"InputMonitorConfigurationMetric"}),lO=t.Object({type:t.Literal("log",{description:"Threshold monitor over log aggregations."}),conditions:Rl,noDataBehavior:t.Enum(Qo,{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:Ir},{$id:"MonitorConfigurationLog"}),mO=t.Object({type:t.Literal("log",{description:"Threshold monitor over log aggregations."}),conditions:Cl,noDataBehavior:t.Enum(Qo,{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:br},{$id:"InputMonitorConfigurationLog"}),dO=t.Object({type:t.Literal("trace",{description:"Threshold monitor over trace aggregations."}),conditions:Rl,noDataBehavior:t.Enum(Qo,{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:Ir},{$id:"MonitorConfigurationTrace"}),w1=t.Object({type:t.Literal("trace",{description:"Threshold monitor over trace aggregations."}),conditions:Cl,noDataBehavior:t.Enum(Qo,{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:br},{$id:"InputMonitorConfigurationTrace"}),fO=t.Object({type:t.Literal("anomaly-log",{description:"Anomaly monitor over log aggregations."}),condition:Pl,noDataBehavior:t.Enum(Wo,{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."}),...wl,queries:Ir},{$id:"MonitorConfigurationAnomalyLog"}),gO=t.Object({type:t.Literal("anomaly-log",{description:"Anomaly monitor over log aggregations."}),condition:Ul,noDataBehavior:t.Enum(Wo,{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."}),...Nl,queries:br},{$id:"InputMonitorConfigurationAnomalyLog"}),yO=t.Object({type:t.Literal("anomaly-metric",{description:"Anomaly monitor over metric aggregations."}),condition:Pl,noDataBehavior:t.Enum(Wo,{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."}),...wl,queries:Ir},{$id:"MonitorConfigurationAnomalyMetric"}),hO=t.Object({type:t.Literal("anomaly-metric",{description:"Anomaly monitor over metric aggregations."}),condition:Ul,noDataBehavior:t.Enum(Wo,{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."}),...Nl,queries:br},{$id:"InputMonitorConfigurationAnomalyMetric"}),TO=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:Pl,noDataBehavior:t.Enum(Wo,{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."}),...wl,queries:Ir},{$id:"MonitorConfigurationAnomalyTrace"}),N1=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:Ul,noDataBehavior:t.Enum(Wo,{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."}),...Nl,queries:br},{$id:"InputMonitorConfigurationAnomalyTrace"}),EO=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"}),L1=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"}),v1=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"}),k1=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"}),M1=b("type",[pO,lO,dO,fO,yO,v1,TO,EO],{description:"Monitor evaluation configuration. The `type` discriminator determines which telemetry source, condition shape, and evaluation rules Tsuga uses."}),D1=b("type",[uO,mO,w1,gO,hO,N1,k1,L1],{description:"Monitor evaluation configuration. The `type` discriminator determines which telemetry source, condition shape, and evaluation rules Tsuga uses."});var Or=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:Me,configuration:M1,priority:t.Enum(dt,{description:"Monitor priority from 1 through 5, where 1 is highest priority."}),permissions:pn,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(E({description:"Timestamp until which the monitor is snoozed."})),creator:t.Optional(ue),updater:t.Optional(ue),createdAt:E({description:"Timestamp when Tsuga created the monitor."}),updatedAt:E({description:"Timestamp when Tsuga last updated the monitor."}),assetUpdatedAt:E({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."}),clusterIds:t.Array(t.String(),{description:"Cluster IDs where the monitor is deployed. Empty means all eligible clusters."})},{title:"Monitor"}),G1=b("type",[pO,lO,dO,fO,yO,TO,EO]),Yxe=t.Object({...Or.properties,configuration:G1},{title:"Monitor"}),Vxe=t.Object({...Or.properties,configuration:b("type",[uO,mO,gO,hO])},{title:"Monitor"}),wa=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:D1,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:pn,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."}))}),aO=["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 Ll=t.Object({owners:Be(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:Be(Vt.items,{description:"Restrict results to monitors that have at least one of the listed key/value tags",maxItems:50}),priorities:Be(t.Enum(dt),{description:"Restrict results to monitors with one of these priorities",maxItems:dt.length}),types:Be(t.Enum(aO),{description:"Restrict results to monitors with these types",maxItems:aO.length}),activity:t.Enum(["active","snoozed"],{description:"Restrict results by activity status: active monitors or currently snoozed monitors"}),clusterIds:Be(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"}),vl=t.Partial(t.Object({...ye,filters:t.Partial(Ll),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."})})),Qxe=m({tags:["monitors"],url:`${ft}/query`,method:"POST",paginated:!0,response:t.Array(Or),body:vl}),Wxe=m({tags:["monitors"],url:`${ft}/tags/query`,method:"POST",body:t.Object({filters:t.Optional(t.Partial(t.Omit(Ll,["tags"])))}),response:Yt}),Zxe=m({tags:["monitors"],url:`${ft}/counts/query`,method:"POST",body:t.Object({filters:t.Optional(t.Partial(t.Omit(Ll,["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."})})}),Xxe=m({tags:["monitors"],url:`${ft}/:id`,method:"GET",params:t.Object({id:p()}),response:Or}),Jxe=m({tags:["monitors"],url:ft,method:"POST",body:wa,response:Or}),eRe=m({tags:["monitors"],url:`${ft}/:id`,method:"PUT",params:t.Object({id:p()}),body:wa,response:Or}),tRe=m({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({})}),rRe=m({tags:["monitors"],url:`${ft}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),nRe=m({tags:["monitors"],url:`${ft}/bulk-delete`,method:"DELETE",body:t.Object({ids:t.Array(p())}),response:t.Object({})}),oRe=m({tags:["monitors"],url:`${ft}/:id/snooze`,method:"POST",params:t.Object({id:p()}),body:t.Object({pauseUntil:p({allowEmpty:!1,type:"date-time"})}),response:Or}),iRe=m({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({})}),$1=["alert","alert_consider_zero","alert_no_data","keep_last_status_alert"],j1=["ok","ok_consider_zero","ok_no_data","keep_last_status_ok"],q1=[...$1,...j1],Fn=t.Enum(q1),B1=b("type",[t.Object({type:t.Literal("each"),subStates:t.Record(t.String(),t.Object({stateValue:t.Union([Fn,t.Null()]),lastChangedAt:E()}))}),t.Object({type:t.Literal("no_aggregation"),stateValue:t.Optional(Fn)}),t.Object({type:t.Literal("any"),stateValue:t.Optional(Fn)}),t.Object({type:t.Literal("all"),stateValue:t.Optional(Fn)}),t.Object({type:t.Literal("proportion"),stateValue:t.Optional(Fn)})]),F1=t.Object({monitorId:t.String(),currentState:B1,lastChangedAt:t.Optional(E())}),aRe=m({tags:["monitors"],url:`${ft}/states/:id`,method:"GET",params:t.Object({id:p()}),response:F1}),sRe=m({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:E(),fromState:t.Optional(Fn),toState:t.Optional(Fn),dimension:t.Optional(t.String())}))}),H1=["unprocessed","processed","failed-to-process"],cRe=m({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:E(),formulaResult:t.Object({groups:t.Array(t.Object({groupKey:t.Record(t.String(),Ca),results:t.Array(t.Union([t.Number(),t.Null()])),conditionMet:t.Enum(["true","false","nan-no-data"])}))}),createdAt:E(),status:t.Enum(H1)}))})});var Ar="/v0/slos",K1=[7,30,90],z1=["good","bad"],SO=t.Enum(z1,{description:"How to treat SLO with no data: good (count as meeting the SLO), bad (count as breaching it)"}),Y1=["good","bad","ignore"],OO=t.Enum(Y1,{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)"}),_O=30,IO=1440,AO=["greater_than","less_than","greater_than_or_equal","less_than_or_equal"],V1=["healthy","breached","no_data"],ap=t.Enum(V1,{description:"SLO status: healthy (meeting the target), breached (breaching it), or no_data (not evaluated yet)"}),bO={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},Q1=t.Object({overall:t.Object(bO,{description:"Latest overall evaluation for the cluster"}),perGroup:t.Array(t.Object({groupKey:t.Record(t.String(),Ca,{description:"Group-by field values identifying this group, keyed by field name. Present only when the SLO configuration sets `groupByFields`."}),...bO}),{description:"Latest evaluation for each group produced by the SLO configuration's `groupByFields`. Empty when the SLO is not grouped."})},{title:"SloClusterResults"}),xO=t.Record(t.String(),Q1,{description:"Latest evaluation results keyed by cluster ID."}),kl=t.Object({queries:Ir,formula:Jc},{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."}),Ml=t.Object({queries:br,formula:Bn},{title:"SloQueryFormula",description:"Aggregation queries combined by a formula to produce the SLO signal. Formulas reference queries as q1, q2, and so on."}),W1=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"}),Z1=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 X1=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"}),J1=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"}),ej=b("type",[W1,X1],{description:"Alert trigger configuration: burn-rate or threshold"}),RO=b("type",[Z1,J1],{description:"Alert trigger configuration: burn-rate or threshold"}),Dl=t.Enum(dt,{description:"Alert priority (1 is highest, 5 is lowest)"}),Gl=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:Dl,configuration:ej,createdAt:E({description:"Timestamp when Tsuga created the alert."}),updatedAt:E({description:"Timestamp when Tsuga last updated the alert."}),assetUpdatedAt:E({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})},{title:"SloAlert"}),tj=t.Object({priority:Dl,configuration:RO}),rj=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:Dl,configuration:RO}),nj=b("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:kl,totalQuery:kl,groupByFields:t.Optional(Yo),noDataBehavior:SO},{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:kl,sliceSizeMinutes:t.Integer({description:"Length of each time-SLO evaluation slice in minutes. Required for `type: time`."}),threshold:t.Object({operator:t.Enum(AO,{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(Yo),noDataBehavior:OO},{title:"TimeSliceSloConfiguration"})],{description:"SLI configuration for this SLO. Use `event` for good/total event-ratio SLOs or `time` for thresholded time-slice SLOs."}),oj=b("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:Ml,totalQuery:Ml,groupByFields:t.Optional(Sr),noDataBehavior:SO},{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:Ml,sliceSizeMinutes:t.Integer({minimum:_O,maximum:IO,description:`Length of each time-SLO evaluation slice in minutes. Required for \`type: time\`. Valid input is ${_O} through ${IO}.`}),threshold:t.Object({operator:t.Enum(AO,{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(Sr),noDataBehavior:OO},{title:"TimeSliceSloConfiguration"})],{description:"SLI configuration for this SLO. Use `event` for good/total event-ratio SLOs or `time` for thresholded time-slice SLOs."}),ij=t.Number({exclusiveMinimum:0,exclusiveMaximum:100,description:"Target percentage (0 < target < 100, e.g. 99.9)"}),CO=t.Enum(K1,{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."}),aj=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."}),sj=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."}),Zo=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:Me,configuration:nj,target:t.Number({description:"Target percentage (0 < target < 100, e.g. 99.9)"}),timeframeDays:CO,owner:t.String({description:"Team ID that owns the SLO"}),permissions:pn,clusterIds:aj,creator:t.Optional(ue),updater:t.Optional(ue),alerts:t.Array(Gl,{description:"Alerts attached to this SLO"}),createdAt:E({description:"Timestamp when Tsuga created the SLO."}),updatedAt:E({description:"Timestamp when Tsuga last updated the SLO."}),assetUpdatedAt:E({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})},{title:"Slo"}),cj=t.Object({...Zo.properties,results:xO},{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:oj,target:ij,timeframeDays:CO,owner:p({allowEmpty:!1,description:"Team ID that owns the SLO"}),permissions:pn,clusterIds:t.Optional(sj),alerts:t.Array(tj,{description:"Alerts to create on this SLO. Send an empty array for none."})}),$l=t.Object({...t.Omit(sp,["alerts"]).properties,alerts:t.Array(rj,{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."})}),PO=t.Object({owners:Be(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:Be(Vt.items,{description:"Restrict results to SLOs that have at least one of the listed key/value tags",maxItems:50}),clusterIds:Be(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:Be(ap,{description:"Restrict results to SLOs whose status is one of these values",maxItems:3})},{description:"Optional filters applied to narrow the returned SLOs"}),jl=t.Partial(t.Object({...ye,filters:t.Partial(PO),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"})})),_Re=m({tags:["slos"],url:`${Ar}/query`,method:"POST",paginated:!0,response:t.Array(cj),body:jl}),IRe=m({tags:["slos"],url:`${Ar}/tags/query`,method:"POST",body:t.Object({filters:t.Optional(t.Partial(t.Omit(PO,["tags","statuses"])))}),response:Yt}),bRe=m({tags:["slos"],url:`${Ar}/:id`,method:"GET",params:t.Object({id:p()}),response:Zo}),SRe=m({tags:["slos"],url:`${Ar}/:id/results`,method:"GET",params:t.Object({id:p()}),response:xO}),ORe=m({tags:["slos"],url:Ar,method:"POST",body:sp,response:Zo}),ARe=m({tags:["slos"],url:`${Ar}/:id`,method:"PUT",params:t.Object({id:p()}),body:$l,response:Zo}),xRe=m({tags:["slos"],url:`${Ar}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),RRe=m({tags:["slos"],url:`${Ar}/bulk-delete`,method:"DELETE",body:t.Object({ids:t.Array(p())}),response:t.Object({})}),CRe=m({tags:["slos"],url:`${Ar}/bulk-update`,method:"PUT",body:t.Object({sloIds:t.Array(p()),owner:p({allowEmpty:!1})}),response:t.Object({})});var Xo="/v0/notifications",Kn=`${Xo}/rules`,UO=`${Xo}/slack/setup`,Na=`${Xo}/integrations`,Hn=["triggered","resolved","no-data"],pj=["sent","stale","pending","rate-limited","failed","silenced"],uj=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."})),ql=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."}),lj=t.Optional(ql),mj=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."})),dj=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."})),La=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:uj,renotifyConfig:mj,config:b("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`."})}),Jo=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:lj,config:b("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:dj}),Bl=b("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."}),Fl=b("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."}),ei=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:Bl,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(Hn),{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:E({description:"Timestamp when Tsuga created the rule."}),updatedAt:E({description:"Timestamp when Tsuga last updated the rule."}),isActive:t.Boolean({description:"Whether the rule currently sends notifications when its filters match."}),tags:Me,targets:t.Array(La,{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)}),va=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:Fl,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(Hn),{maxItems:Hn.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(Jo,{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:E({description:"Timestamp when Tsuga created the rule."}),updatedAt:E({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:Me,monitorIds:t.Array(t.String(),{description:"Monitors this rule reacts to."}),fallbackTarget:La,creator:t.Optional(ue),updater:t.Optional(ue)}),wO=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:Jo}),DRe=m({tags:["notification-rules"],url:Kn,method:"GET",paginated:!0,query:t.Object(ye),response:t.Array(ei)}),GRe=m({tags:["notification-rules"],url:`${Kn}/:id`,params:t.Object({id:p()}),method:"GET",response:ei}),$Re=m({tags:["notification-rules"],url:Kn,method:"POST",body:va,response:ei}),jRe=m({tags:["notification-rules"],url:`${Kn}/:id`,method:"PUT",params:t.Object({id:p()}),body:va,response:ei}),qRe=m({tags:["notification-rules"],url:`${Kn}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),ka=`${Xo}/adaptive-rules`,BRe=m({tags:["notification-rules"],url:ka,method:"GET",paginated:!0,query:t.Object(ye),response:t.Array(cp)}),FRe=m({tags:["notification-rules"],url:`${ka}/:id`,params:t.Object({id:p()}),method:"GET",response:cp}),HRe=m({tags:["notification-rules"],url:ka,method:"POST",body:wO,response:cp}),KRe=m({tags:["notification-rules"],url:`${ka}/:id`,method:"PUT",params:t.Object({id:p()}),body:wO,response:cp}),zRe=m({tags:["notification-rules"],url:`${ka}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),YRe=m({tags:["notification-integrations"],url:`${UO}/start`,method:"POST",response:t.Object({redirectUrl:t.String()})}),fj=["google-chat","grafana-irm","incident-io","jira","microsoft-teams","pagerduty","servicenow","slack","squadcast","webhook"],gj=t.Object({id:t.String(),name:t.String(),type:t.Enum(fj),createdAt:E(),ruleCount:t.Number(),creator:t.Optional(ue)}),VRe=m({tags:["notification-integrations"],url:`${Kn}/integrations`,method:"GET",paginated:!0,query:t.Object(ye),response:t.Array(gj)}),QRe=m({tags:["notification-integrations"],url:`${UO}/callback`,method:"GET",query:t.Object({code:p()}),response:t.Object({success:t.Boolean()})}),Hl=["POST","PUT"],yj=t.Record(t.String(),t.String()),hj=t.Record(t.String(),t.Unknown()),Tj=t.Record(t.String(),t.Union([t.String(),t.Number(),t.Boolean(),t.Null(),t.Array(t.Union([t.String(),t.Number(),t.Boolean()]))])),Ej=b("type",[t.Object({type:t.Literal("json"),value:hj}),t.Object({type:t.Literal("form"),value:Tj})]),_j=t.Object({ok:t.String(),alert:t.String()}),Kl=t.Object({id:t.String(),name:t.String(),setting:b("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(Hl),authentication:b("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(yj),payloadTemplate:Ej,eventNameMapping:t.Optional(_j)}),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:Me}),Ij=t.Object({type:t.Literal("webhook"),url:p({type:"uri"}),method:t.Enum(Hl),authentication:b("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:b("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})}))}),NO=t.Object({type:t.Literal("incident-io"),alertSourceConfigId:p(),token:p()}),LO=t.Object({type:t.Literal("grafana-irm"),url:p({type:"uri"})}),vO=t.Object({type:t.Literal("pagerduty"),integrationKey:p()}),kO=t.Object({type:t.Literal("microsoft-teams"),webhookUrl:p({type:"uri"})}),bj=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})}),Sj=t.Object({type:t.Literal("google-chat"),webhookUrl:p({type:"uri"})}),Oj=t.Object({type:t.Literal("squadcast"),webhookUrl:p({type:"uri"})}),Aj=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."})}),xj=t.Object({name:p(),setting:b("type",[NO,LO,vO,kO,Ij,bj,Sj,Oj,Aj]),tags:Ve}),Rj=t.Object({type:t.Literal("webhook"),url:t.Optional(p({type:"uri"})),method:t.Optional(t.Enum(Hl)),authentication:t.Optional(b("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(b("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}))}))}),Cj=t.Object({type:t.Literal("servicenow"),instanceName:t.Optional(p({allowEmpty:!1})),username:t.Optional(p({allowEmpty:!1})),password:t.Optional(p({allowEmpty:!1}))}),Pj=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}))}),Uj=t.Object({type:t.Literal("google-chat"),webhookUrl:p({type:"uri"})}),wj=t.Object({type:t.Literal("squadcast"),webhookUrl:p({type:"uri"})}),Nj=t.Object({name:t.Optional(p()),setting:t.Optional(b("type",[NO,LO,vO,kO,Rj,Cj,Uj,wj,Pj]))}),WRe=m({tags:["notification-integrations"],url:Na,method:"POST",body:xj,response:Kl}),ZRe=m({tags:["notification-integrations"],url:`${Na}/:id`,method:"GET",params:t.Object({id:p()}),response:Kl}),XRe=m({tags:["notification-integrations"],url:`${Na}/:id`,method:"PUT",params:t.Object({id:p()}),body:Nj,response:Kl}),JRe=m({tags:["notification-integrations"],url:`${Na}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),Lj=b("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."}),eCe=m({tags:["notification-integrations"],url:`${Na}/:id/jira-metadata`,method:"GET",params:t.Object({id:p()}),response:Lj}),tCe=m({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(pj),tryCount:t.Number(),nextTryAt:E(),createdAt:E(),updatedAt:E(),sentAt:t.Optional(E())})),isTruncated:t.Boolean()})}),vj=["slack","incident-io","pagerduty","email","grafana-irm","microsoft-teams","webhook","servicenow","google-chat","squadcast","jira"],rCe=m({tags:["notification-rules"],url:`${Kn}/test`,method:"POST",body:t.Object({notificationRule:va,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(vj,{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 kj=t.Object({team:t.String({description:"Team name observed on telemetry for this service."}),lastSeenAt:E({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."}),Mj=t.Object({ingestionApiKey:t.String({description:"Ingestion API key name or identifier observed on telemetry for this service."}),lastSeenAt:E({description:"Most recent time this ingestion key was observed for the service."})},{description:"An ingestion API key observed on telemetry for this service, with the last time it was seen."}),Dj=t.Object({version:t.String({description:"Service version value observed in telemetry."}),firstSeenAt:E({description:"First time this version was observed for the service."}),lastSeenAt:E({description:"Most recent time this version was observed for the service."}),faulty: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."}),Gj=t.Object({language:t.String({description:"Programming language observed for this service."}),lastSeenAt:E({description:"Most recent time this language was observed."})},{description:"A programming language observed for this service, with the last time it was seen."}),$j=t.Object({runtime:t.String({description:"Runtime observed for this service."}),lastSeenAt:E({description:"Most recent time this runtime was observed."})},{description:"A runtime observed for this service, with the last time it was seen."}),MO=t.Object({protocol:t.String({description:"Observed API protocol (e.g. 'http', 'grpc', 'graphql')"}),lastSeenAt:E({description:"Most recent observation timestamp"})},{description:"An API protocol observed for this service, with the last time it was seen."}),jj=t.Object({framework:t.String({description:"Observed application framework (e.g. 'express', 'fastify', 'django', 'rails')"}),lastSeenAt:E({description:"Most recent observation timestamp"})},{description:"An application framework detected from OpenTelemetry instrumentation scope, with the last time it was seen."}),qj=t.Object({platform:t.String({description:"Observed cloud or orchestration platform (e.g. 'aws_eks', 'kubernetes')"}),lastSeenAt:E({description:"Most recent observation timestamp"})},{description:"A cloud or orchestration platform this service runs on, with the last time it was seen."}),Bj=t.Object({provider:t.String({description:"Observed cloud provider (e.g. 'aws', 'gcp', 'azure')"}),lastSeenAt:E({description:"Most recent observation timestamp"})},{description:"A cloud provider this service runs on, with the last time it was seen."}),Ma=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(kj,{description:"Team names observed on telemetry for this service and when each was last seen."}),ingestionApiKeys:t.Array(Mj,{description:"Ingestion API keys observed on telemetry for this service and when each was last seen."}),versions:t.Array(Dj,{description:"Service version values observed in telemetry, including first and last seen timestamps."}),languages:t.Array(Gj,{description:"Programming languages observed for this service."}),runtimes:t.Array($j,{description:"Runtime values observed for this service."}),serverProtocols:t.Array(MO,{description:"API protocols this service exposes (from server-kind spans)"}),clientProtocols:t.Array(MO,{description:"API protocols this service calls out over (from client-kind spans)"}),frameworks:t.Array(jj,{description:"Application frameworks detected from OTel instrumentation scope"}),cloudPlatforms:t.Array(qj,{description:"Cloud platforms this service is running on"}),cloudProviders:t.Array(Bj,{description:"Cloud providers this service is running on"}),lastSeenAt:E({description:"Most recent time Tsuga observed telemetry for this service."}),firstSeenAt:E({description:"First time Tsuga observed telemetry for this service."}),sources: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:E({description:"Timestamp when Tsuga created this service catalog entry."}),updatedAt:E({description:"Timestamp when Tsuga last updated this service catalog entry."})}),dCe=m({tags:["service-catalog"],query:t.Object({...ye,clusterId:t.Optional(p())}),method:"GET",paginated:!0,url:`${Lt}/services`,response:t.Array(Ma)}),Fj=t.Object({spanKind:t.Enum(XS),count:t.Number()}),DO=t.Object({...Ma.properties,spanKindCounts:t.Array(Fj),envs:t.Object({primaryEnv:t.String(),allEnvs:t.Array(t.String())})}),fCe=m({tags:["service-catalog"],query:t.Object({...ye,clusterId:t.Optional(p()),env:t.Optional(p())}),method:"GET",paginated:!0,url:`${Lt}/v2/services`,response:t.Array(DO)}),gCe=m({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:DO}),yCe=m({tags:["service-catalog"],method:"GET",url:`${Lt}/services/:serviceId`,params:t.Object({serviceId:p()}),response:Ma}),zl=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:La.properties.config,rateLimit:La.properties.rateLimit,createdAt:E({description:"Timestamp when user created this service target."}),updatedAt:E({description:"Timestamp when user last updated this service target."})}),Hj=t.Object({config:Jo.properties.config,rateLimit:Jo.properties.rateLimit}),Kj=t.Object({config:Jo.properties.config,rateLimit:t.Union([ql,t.Null()])}),hCe=m({tags:["service-catalog"],method:"GET",url:`${Lt}/services/:serviceId/targets`,params:t.Object({serviceId:p()}),response:t.Array(zl)}),TCe=m({tags:["service-catalog"],method:"POST",url:`${Lt}/services/:serviceId/targets`,params:t.Object({serviceId:p()}),body:Hj,response:zl}),ECe=m({tags:["service-catalog"],method:"PUT",url:`${Lt}/services/:serviceId/targets/:targetId`,params:t.Object({serviceId:p(),targetId:p()}),body:Kj,response:zl}),_Ce=m({tags:["service-catalog"],method:"DELETE",url:`${Lt}/services/:serviceId/targets/:targetId`,params:t.Object({serviceId:p(),targetId:p()}),response:R}),zj=["otel_kube","otel_host_kube","otel_host","prometheus","aws_ec2","gcp_compute_engine"];var GO=t.Object({id:t.String(),hostName:t.String(),env:t.Optional(t.String()),cpuUtilizationAverage:t.Number(),hostType:t.Enum(zj),teams:t.Array(t.String()),tags:t.Array(t.String()),firstSeenAt:E(),lastSeenAt:E(),clusterId:t.String()}),ICe=m({tags:["service-catalog"],method:"GET",url:`${Lt}/hosts`,response:t.Array(GO)}),bCe=m({tags:["service-catalog"],method:"GET",url:`${Lt}/hosts/:hostId`,params:t.Object({hostId:p()}),response:GO}),Yj=["http","rpc","messaging","genai","object_store"],$O={name:t.String({description:"Service or inferred dependency name shown in the graph."}),env:t.Optional(t.String({description:"Environment observed from spans."}))},Yl=t.Object({...$O,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."})}),jO={...$O,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"}))},Vl=t.Object({...jO,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`."})}),Ql=t.Object({...jO,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(Yj,{description:"Inferred dependency type from span metadata: http, rpc, messaging, genai, or object_store."})}),Vj=b("nodeType",[Yl,Vl,Ql]),Wl=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."}),SCe=m({tags:["service-catalog"],url:`${Lt}/services/:serviceId/graph`,method:"GET",params:t.Object({serviceId:p()}),query:t.Object({...Ye.properties,query:t.Optional(p({type:"tsuga-query"}))}),response:t.Object({clusterId:t.String(),nodes:t.Array(Vj),edges:t.Array(Wl)})}),Qj=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"})}))}),OCe=m({tags:["service-catalog"],method:"GET",url:`${Lt}/services/:serviceId/related-resources`,params:t.Object({serviceId:p()}),response:Qj}),ACe=m({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 Zl=`/${"v1"}/services`,Xl=t.Pick(Ma,["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)."}),Wj={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(Xl,{examples:[Wj]});var qO=m({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:Zl,method:"GET",paginated:!0,query:t.Object({...ze,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(Xl)}),BO=m({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:`${Zl}/: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:Xl}),Zj=t.Pick(Yl,["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."}),Xj=t.Pick(Ql,["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."}),Jj=t.Pick(Vl,["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."}),eq=b("nodeType",[Zj,Jj,Xj]),tq=t.Pick(Wl,["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."}),rq=t.Optional(t.Integer({...Ye.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."})),nq=t.Optional(t.Integer({...Ye.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."})),oq=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."}),FO=m({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:`${Zl}/: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:rq,to:nq,query:t.Optional(oq)},{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(eq,{description:"Observed and inferred nodes included in the service dependency graph."}),edges:t.Array(tq,{description:"Directed dependency edges between graph nodes."})})});var xe=" (unix seconds, ISO 8601, or relative like -1h/-30m/now)";function HO(e,r){let n=r??Er(e);return n===void 0?void 0:zs(n)}function Jl(e){let r=Er(e);return r===void 0?"":` (default: ${r})`}function KO(e,r){e.command("service-graph").description("Inspect service dependency graphs").command("get <SERVICE_ID>").description("Retrieve the dependency graph for a service").option("--from <TIMESTAMP>",`Start of time range${xe}${Jl("from")}`).option("--to <TIMESTAMP>",`End of time range${xe}${Jl("to")}`).option("--query <TSUGA_QUERY>",`Tsuga query to filter graph spans${Jl("query")}`).action(async(o,i)=>{let a={},c=HO("from",i.from),l=HO("to",i.to);c!==void 0&&(a.from=c),l!==void 0&&(a.to=l),i.query!==void 0&&(a.query=i.query);let d=await r()(FO,{params:{serviceId:o},query:a});Q(d)})}var iq=`/${"v1"}/grok`,aq=25,sq=100,zO=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:aq,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:sq,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."}),cq={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(zO,{examples:[cq]});var YO=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."}),pq={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(YO,{examples:[pq]});var VO=m({url:`${iq}/parse`,method:"POST",operationId:"parseGrok",tags:["public","grok"],body:zO,response:YO,description:"Parses sample log lines with Grok rules and returns extracted fields, using the same Grok engine as the log route processor. Use this endpoint to author and test route Grok rules before saving them. The operation requires public API read access to log routes. A rule that fails to compile returns a 400 response with error code `GROK_RULE_VALIDATION_ERROR` and structured details in `error.details.ruleErrors`."});var QO=In(require("node:fs"));function ti(e){if(e.file){let r=QO.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_PATH> or -d <JSON>. Use --generate-skeleton to get a template.")}function uq(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")&&uq(e["~guard"])}function tm(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 xr(e){return s.IsObject(e)&&!s.IsArray(e)}function pp(e){return s.IsBoolean(e)}function j(e){return xr(e)||pp(e)}function rm(e){return s.HasPropertyKey(e,"additionalItems")&&j(e.additionalItems)}function Rr(e){return s.HasPropertyKey(e,"additionalProperties")&&j(e.additionalProperties)}function nm(e){return s.HasPropertyKey(e,"allOf")&&s.IsArray(e.allOf)&&e.allOf.every(r=>j(r))}function Da(e){return s.HasPropertyKey(e,"$anchor")&&s.IsString(e.$anchor)}function om(e){return s.HasPropertyKey(e,"anyOf")&&s.IsArray(e.anyOf)&&e.anyOf.every(r=>j(r))}function im(e){return s.HasPropertyKey(e,"const")}function zn(e){return s.HasPropertyKey(e,"contains")&&j(e.contains)}function vt(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 sm(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 cm(e){return s.HasPropertyKey(e,"dependentSchemas")&&s.IsObject(e.dependentSchemas)&&Object.values(e.dependentSchemas).every(r=>j(r))}function pm(e){return s.HasPropertyKey(e,"$dynamicAnchor")&&s.IsString(e.$dynamicAnchor)}function um(e){return s.HasPropertyKey(e,"else")&&j(e.else)}function lm(e){return s.HasPropertyKey(e,"enum")&&s.IsArray(e.enum)}function mm(e){return s.HasPropertyKey(e,"exclusiveMaximum")&&(s.IsNumber(e.exclusiveMaximum)||s.IsBigInt(e.exclusiveMaximum))}function Cr(e){return s.HasPropertyKey(e,"exclusiveMinimum")&&(s.IsNumber(e.exclusiveMinimum)||s.IsBigInt(e.exclusiveMinimum))}function Ga(e){return s.HasPropertyKey(e,"format")&&s.IsString(e.format)}function Yn(e){return s.HasPropertyKey(e,"$id")&&s.IsString(e.$id)}function dm(e){return s.HasPropertyKey(e,"if")&&j(e.if)}function ri(e){return s.HasPropertyKey(e,"items")&&(j(e.items)||s.IsArray(e.items)&&e.items.every(r=>j(r)))}function fm(e){return ri(e)&&s.IsArray(e.items)}function gm(e){return s.HasPropertyKey(e,"maximum")&&(s.IsNumber(e.maximum)||s.IsBigInt(e.maximum))}function ym(e){return s.HasPropertyKey(e,"maxContains")&&s.IsNumber(e.maxContains)}function up(e){return s.HasPropertyKey(e,"maxItems")&&s.IsNumber(e.maxItems)}function hm(e){return s.HasPropertyKey(e,"maxLength")&&s.IsNumber(e.maxLength)}function Tm(e){return s.HasPropertyKey(e,"maxProperties")&&s.IsNumber(e.maxProperties)}function Pr(e){return s.HasPropertyKey(e,"minimum")&&(s.IsNumber(e.minimum)||s.IsBigInt(e.minimum))}function Vn(e){return s.HasPropertyKey(e,"minContains")&&s.IsNumber(e.minContains)}function ni(e){return s.HasPropertyKey(e,"minItems")&&s.IsNumber(e.minItems)}function $a(e){return s.HasPropertyKey(e,"minLength")&&s.IsNumber(e.minLength)}function ja(e){return s.HasPropertyKey(e,"minProperties")&&s.IsNumber(e.minProperties)}function Em(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 Im(e){return s.HasPropertyKey(e,"oneOf")&&s.IsArray(e.oneOf)&&e.oneOf.every(r=>j(r))}function qa(e){return s.HasPropertyKey(e,"pattern")&&(s.IsString(e.pattern)||e.pattern instanceof RegExp)}function Ba(e){return s.HasPropertyKey(e,"patternProperties")&&s.IsObject(e.patternProperties)&&Object.values(e.patternProperties).every(r=>j(r))}function oi(e){return s.HasPropertyKey(e,"prefixItems")&&s.IsArray(e.prefixItems)&&e.prefixItems.every(r=>j(r))}function Fa(e){return s.HasPropertyKey(e,"properties")&&s.IsObject(e.properties)&&Object.values(e.properties).every(r=>j(r))}function bm(e){return s.HasPropertyKey(e,"propertyNames")&&(s.IsObject(e.propertyNames)||j(e.propertyNames))}function lq(e){return s.HasPropertyKey(e,"$recursiveAnchor")&&s.IsBoolean(e.$recursiveAnchor)}function lp(e){return lq(e)&&s.IsEqual(e.$recursiveAnchor,!0)}function Sm(e){return s.HasPropertyKey(e,"$recursiveRef")&&s.IsString(e.$recursiveRef)}function Om(e){return s.HasPropertyKey(e,"$ref")&&s.IsString(e.$ref)}function Qn(e){return s.HasPropertyKey(e,"required")&&s.IsArray(e.required)&&e.required.every(r=>s.IsString(r))}function Am(e){return s.HasPropertyKey(e,"then")&&j(e.then)}function xm(e){return s.HasPropertyKey(e,"type")&&(s.IsString(e.type)||s.IsArray(e.type)&&e.type.every(r=>s.IsString(r)))}function ii(e){return s.HasPropertyKey(e,"uniqueItems")&&s.IsBoolean(e.uniqueItems)}function mp(e){return s.HasPropertyKey(e,"unevaluatedItems")&&j(e.unevaluatedItems)}function dp(e){return s.HasPropertyKey(e,"unevaluatedProperties")&&j(e.unevaluatedProperties)}var yt=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}},Ha=class extends yt{constructor(r){super(),this.callback=r}AddError(r){return this.callback(r),!1}},Qe=class extends Ha{constructor(){super(r=>this.errors.push(r)),this.errors=[]}AddError(r){return this.errors.push(r),!1}GetErrors(){return this.errors}};var mq="external_",dq=0,yNe={identifier:`${mq}${dq}`,variables:[]};function WO(e,r,n,o){return n["~guard"].check(o)}function ZO(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 XO(e,r,n,o){return s.Every(n["~refine"],0,(i,a)=>i.refine(o))}function JO(e,r,n,o,i,a){return s.EveryAll(i["~refine"],0,(c,l)=>c.refine(a)||r.AddError({keyword:"~refine",schemaPath:n,instancePath:o,params:{index:l,message:c.message}}))}function eA(e){return ri(e)&&s.IsArray(e.items)}function tA(e,r,n,o){return eA(n)?o.every((a,c)=>s.IsLessThan(c,n.items.length)||G(e,r,n.additionalItems,a)&&r.AddIndex(c)):!0}function rA(e,r,n,o,i,a){return eA(i)?a.every((l,d)=>{let f=`${n}/additionalItems`,g=`${o}/${d}`;return s.IsLessThan(d,i.items.length)||W(e,r,f,g,i.additionalItems,l)&&r.AddIndex(d)}):!0}function fq(e){return`^${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}$`}function nA(e){let r=[];return Ba(e)&&r.push(...s.Keys(e.patternProperties)),Fa(e)&&r.push(...s.Keys(e.properties).map(fq)),s.IsEqual(r.length,0)?"(?!)":`(${r.join("|")})`}function oA(e,r,n,o){let i=new RegExp(nA(n));return s.Every(s.Keys(o),0,(c,l)=>i.test(c)||G(e,r,n.additionalProperties,o[c])&&r.AddKey(c))}function iA(e,r,n,o,i,a){let c=new RegExp(nA(i)),l=[];return s.EveryAll(s.Keys(a),0,(f,g)=>{let T=`${n}/additionalProperties`,_=`${o}/${f}`,ae=new Qe,fe=c.test(f)||W(e,ae,T,_,i.additionalProperties,a[f])&&r.AddKey(f);return fe||l.push(f),fe})||r.AddError({keyword:"additionalProperties",schemaPath:n,instancePath:o,params:{additionalProperties:l}})}function aA(e,r,n,o){let i=n.allOf.reduce((a,c)=>{let l=new yt;return G(e,l,c,o)?[...a,l]:a},[]);return s.IsEqual(i.length,n.allOf.length)&&r.Merge(i)}function sA(e,r,n,o,i,a){let c=[],l=i.allOf.reduce((f,g,T)=>{let _=`${n}/allOf/${T}`,ae=new Qe,fe=W(e,ae,_,o,g,a);return fe||c.push(ae),fe?[...f,ae]:f},[]),d=s.IsEqual(l.length,i.allOf.length)&&r.Merge(l);return d||c.forEach(f=>f.GetErrors().forEach(g=>r.AddError(g))),d}function cA(e,r,n,o){let i=n.anyOf.reduce((a,c,l)=>{let d=new yt;return G(e,d,c,o)?[...a,d]:a},[]);return s.IsGreaterThan(i.length,0)&&r.Merge(i)}function pA(e,r,n,o,i,a){let c=[],l=i.anyOf.reduce((f,g,T)=>{let _=new Qe,ae=`${n}/anyOf/${T}`,fe=W(e,_,ae,o,g,a);return fe||c.push(_),fe?[...f,_]:f},[]),d=s.IsGreaterThan(l.length,0)&&r.Merge(l);return d||c.forEach(f=>f.GetErrors().forEach(g=>r.AddError(g))),d||r.AddError({keyword:"anyOf",schemaPath:n,instancePath:o,params:{}})}function Cm(e,r,n,o){return n}function uA(e,r,n,o,i,a){return Cm(e,r,i,a)||r.AddError({keyword:"boolean",schemaPath:n,instancePath:o,params:{}})}function Pm(e,r,n,o){return s.IsValueLike(n.const)?s.IsEqual(o,n.const):s.IsDeepEqual(o,n.const)}function lA(e,r,n,o,i,a){return Pm(e,r,i,a)||r.AddError({keyword:"const",schemaPath:n,instancePath:o,params:{allowedValue:i.const}})}function gq(e){return!(Vn(e)&&s.IsEqual(e.minContains,0))}function Um(e,r,n,o){return gq(n)?!s.IsEqual(o.length,0)&&o.some(i=>G(e,r,n.contains,i)):!0}function mA(e,r,n,o,i,a){return Um(e,r,i,a)||r.AddError({keyword:"contains",schemaPath:n,instancePath:o,params:{minContains:1}})}function dA(e,r,n,o){let i=s.IsEqual(s.Keys(o).length,0),a=s.Every(s.Entries(n.dependencies),0,([c,l])=>!s.HasPropertyKey(o,c)||(s.IsArray(l)?l.every(d=>s.HasPropertyKey(o,d)):G(e,r,l,o)));return i||a}function fA(e,r,n,o,i,a){let c=s.IsEqual(s.Keys(a).length,0),l=s.EveryAll(s.Entries(i.dependencies),0,([d,f])=>{let g=`${n}/dependencies/${d}`;return!s.HasPropertyKey(a,d)||(s.IsArray(f)?f.every(T=>s.HasPropertyKey(a,T)||r.AddError({keyword:"dependencies",schemaPath:n,instancePath:o,params:{property:d,dependencies:f}})):W(e,r,g,o,f,a))});return c||l}function gA(e,r,n,o){let i=s.IsEqual(s.Keys(o).length,0),a=s.Every(s.Entries(n.dependentRequired),0,([c,l])=>!s.HasPropertyKey(o,c)||l.every(d=>s.HasPropertyKey(o,d)));return i||a}function yA(e,r,n,o,i,a){let c=s.IsEqual(s.Keys(a).length,0),l=s.EveryAll(s.Entries(i.dependentRequired),0,([d,f])=>!s.HasPropertyKey(a,d)||s.EveryAll(f,0,g=>s.HasPropertyKey(a,g)||r.AddError({keyword:"dependentRequired",schemaPath:n,instancePath:o,params:{property:d,dependencies:f}})));return c||l}function hA(e,r,n,o){let i=s.IsEqual(s.Keys(o).length,0),a=s.Every(s.Entries(n.dependentSchemas),0,([c,l])=>!s.HasPropertyKey(o,c)||G(e,r,l,o));return i||a}function TA(e,r,n,o,i,a){let c=s.IsEqual(s.Keys(a).length,0),l=s.EveryAll(s.Entries(i.dependentSchemas),0,([d,f])=>{let g=`${n}/dependentSchemas/${d}`;return!s.HasPropertyKey(a,d)||W(e,r,g,o,f,a)});return c||l}function wm(e,r,n,o){return n.enum.some(i=>s.IsValueLike(i)?s.IsEqual(o,i):s.IsDeepEqual(o,i))}function EA(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 Nm(e,r,n,o){return s.IsLessThan(o,n.exclusiveMaximum)}function _A(e,r,n,o,i,a){return Nm(e,r,i,a)||r.AddError({keyword:"exclusiveMaximum",schemaPath:n,instancePath:o,params:{comparison:"<",limit:i.exclusiveMaximum}})}function Lm(e,r,n,o){return s.IsGreaterThan(o,n.exclusiveMinimum)}function IA(e,r,n,o,i,a){return Lm(e,r,i,a)||r.AddError({keyword:"exclusiveMinimum",schemaPath:n,instancePath:o,params:{comparison:">",limit:i.exclusiveMinimum}})}var si={};Mt(si,{Clear:()=>SA,Entries:()=>vq,Get:()=>Dq,Has:()=>Mq,IsDate:()=>Ka,IsDateTime:()=>vm,IsDuration:()=>km,IsEmail:()=>Mm,IsHostname:()=>Dm,IsIPv4:()=>qm,IsIPv6:()=>Bm,IsIdnEmail:()=>Gm,IsIdnHostname:()=>jm,IsIri:()=>Hm,IsIriReference:()=>Fm,IsJsonPointer:()=>zm,IsJsonPointerUriFragment:()=>Km,IsRegex:()=>Ym,IsRelativeJsonPointer:()=>Vm,IsTime:()=>za,IsUri:()=>Zm,IsUriReference:()=>Qm,IsUriTemplate:()=>Wm,IsUrl:()=>Xm,IsUuid:()=>Jm,Reset:()=>OA,Set:()=>kq,Test:()=>Gq});var yq=[0,31,28,31,30,31,30,31,31,30,31,30,31],hq=/^(\d\d\d\d)-(\d\d)-(\d\d)$/;function Tq(e){return e%4===0&&(e%100!==0||e%400===0)}function Ka(e){let r=hq.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&&Tq(n)?29:yq[o])}var Eq=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(?:Z|([+-])(\d\d):(\d\d))?$/i;function za(e,r=!0){let n=Eq.exec(e);if(!n)return!1;let o=+n[1],i=+n[2],a=+n[3],c=n[4]==="-"?-1:1,l=+(n[5]||0),d=+(n[6]||0);if(l>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,g=o-l*c-(f<0?1:0);return(g===23||g===-1)&&(f===59||f===-1)&&a<61}function vm(e,r=!0){let n=e.split(/T/i);return n.length===2&&Ka(n[0])&&za(n[1],r)}var _q=/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/;function km(e){return _q.test(e)}var Iq=/^(?!.*\.\.)[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 Mm(e){return Iq.test(e)}var bq=/^(?=.{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 Dm(e){return bq.test(e)}var Sq=/^(?!.*\.\.)[\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 Gm(e){return Sq.test(e)}function $m(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 jm(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 g=i.charAt(d-1),T=i.charAt(d+1);if(!/^[lL]$/.test(g)||!/^[lL]$/.test(T))return!1}if(f==="\u30FB"){if(i.length===1)return!1;if(d===0){let g=i.charAt(d+1);if(!$m(g))return!1}else{let g=i.charAt(d-1),T=i.charAt(d+1);if(!$m(g)||!$m(T))return!1}}if(f==="\u0375"){if(d===i.length-1)return!1;let g=i.charAt(d+1);if(!/[\u0370-\u03FF]/.test(g))return!1}if(f==="\u05F3"||f==="\u05F4"){if(d===0)return!1;let g=i.charAt(d-1);if(!/[\u05D0-\u05EA]/.test(g))return!1}if(f==="\u200D"&&(d===0||i.charAt(d-1)!=="\u094D"))return!1}let c=!1,l=!1;for(let d=0;d<i.length;d++){let f=i.charAt(d);/[\u0660-\u0669]/.test(f)&&(c=!0),/[\u06F0-\u06F9]/.test(f)&&(l=!0)}if(c&&l)return!1}return!0}var Oq=/^(?:(?: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 qm(e){return Oq.test(e)}var Aq=/^((([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 Bm(e){return Aq.test(e)}function bA(e){try{return new URL(e,"http://example.com"),!0}catch{return!1}}function Fm(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))?bA(e):e.match(/^([a-zA-Z][a-zA-Z0-9+\-.]*)(\/\/)/)&&r===-1?!1:bA(e)}function Hm(e){try{return new URL(e),!0}catch{return!1}}var xq=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;function Km(e){return xq.test(e)}var Rq=/^(?:\/(?:[^~/]|~0|~1)*)*$/;function zm(e){return Rq.test(e)}function Ym(e){if(e.length===0)return!1;try{return new RegExp(e),!0}catch{return!1}}var Cq=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function Vm(e){return Cq.test(e)}var Pq=/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i;function Qm(e){return Pq.test(e)}var Uq=/^(?:(?:[^\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 Wm(e){return Uq.test(e)}var wq=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i;function Zm(e){return wq.test(e)}var Nq=/^(?: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 Xm(e){return Nq.test(e)}var Lq=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;function Jm(e){return Lq.test(e)}var he=new Map;function SA(){he.clear()}function vq(){return[...he.entries()]}function kq(e,r){he.set(e,r)}function Mq(e){return he.has(e)}function Dq(e){return he.get(e)}function Gq(e,r){return he.get(e)?.(r)??!0}function OA(){SA(),he.set("date-time",vm),he.set("date",Ka),he.set("duration",km),he.set("email",Mm),he.set("hostname",Dm),he.set("idn-email",Gm),he.set("idn-hostname",jm),he.set("ipv4",qm),he.set("ipv6",Bm),he.set("iri-reference",Fm),he.set("iri",Hm),he.set("json-pointer-uri-fragment",Km),he.set("json-pointer",zm),he.set("regex",Ym),he.set("relative-json-pointer",Vm),he.set("time",za),he.set("uri-reference",Qm),he.set("uri-template",Wm),he.set("uri",Zm),he.set("url",Xm),he.set("uuid",Jm)}OA();function ed(e,r,n,o){return si.Test(n.format,o)}function AA(e,r,n,o,i,a){return ed(e,r,i,a)||r.AddError({keyword:"format",schemaPath:n,instancePath:o,params:{format:i.format}})}function xA(e,r,n,o){let i=Am(n)?n.then:!0,a=um(n)?n.else:!0;return G(e,r,n.if,o)?G(e,r,i,o):G(e,r,a,o)}function RA(e,r,n,o,i,a){let c=Am(i)?i.then:!0,l=um(i)?i.else:!0,d=new Qe,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,l,a)||r.AddError({keyword:"if",schemaPath:n,instancePath:o,params:{failingKeyword:"else"}});return f&&r.Merge([d]),f}function $q(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 jq(e,r,n,o,i,a){return s.EveryAll(i.items,0,(c,l)=>{let d=`${n}/items/${l}`,f=`${o}/${l}`;return s.IsLessEqualThan(a.length,l)||W(e,r,d,f,c,a[l])&&r.AddIndex(l)})}function qq(e,r,n,o){let i=oi(n)?n.prefixItems.length:0;return s.Every(o,i,(a,c)=>G(e,r,n.items,a)&&r.AddIndex(c))}function Bq(e,r,n,o,i,a){let c=oi(i)?i.prefixItems.length:0;return s.EveryAll(a,c,(l,d)=>{let f=`${n}/items`,g=`${o}/${d}`;return W(e,r,f,g,i.items,l)&&r.AddIndex(d)})}function CA(e,r,n,o){return fm(n)?$q(e,r,n,o):qq(e,r,n,o)}function PA(e,r,n,o,i,a){return fm(i)?jq(e,r,n,o,i,a):Bq(e,r,n,o,i,a)}function Fq(e){return zn(e)}function td(e,r,n,o){if(!Fq(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 UA(e,r,n,o,i,a){let c=Vn(i)?i.minContains:1;return td(e,r,i,a)||r.AddError({keyword:"contains",schemaPath:n,instancePath:o,params:{minContains:c,maxContains:i.maxContains}})}function rd(e,r,n,o){return s.IsLessEqualThan(o,n.maximum)}function wA(e,r,n,o,i,a){return rd(e,r,i,a)||r.AddError({keyword:"maximum",schemaPath:n,instancePath:o,params:{comparison:"<=",limit:i.maximum}})}function nd(e,r,n,o){return s.IsLessEqualThan(o.length,n.maxItems)}function NA(e,r,n,o,i,a){return nd(e,r,i,a)||r.AddError({keyword:"maxItems",schemaPath:n,instancePath:o,params:{limit:i.maxItems}})}function od(e,r,n,o){return s.IsMaxLength(o,n.maxLength)}function LA(e,r,n,o,i,a){return od(e,r,i,a)||r.AddError({keyword:"maxLength",schemaPath:n,instancePath:o,params:{limit:i.maxLength}})}function id(e,r,n,o){return s.IsLessEqualThan(s.Keys(o).length,n.maxProperties)}function vA(e,r,n,o,i,a){return id(e,r,i,a)||r.AddError({keyword:"maxProperties",schemaPath:n,instancePath:o,params:{limit:i.maxProperties}})}function Hq(e){return zn(e)}function ad(e,r,n,o){if(!Hq(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 kA(e,r,n,o,i,a){return ad(e,r,i,a)||r.AddError({keyword:"contains",schemaPath:n,instancePath:o,params:{minContains:i.minContains}})}function sd(e,r,n,o){return s.IsGreaterEqualThan(o,n.minimum)}function MA(e,r,n,o,i,a){return sd(e,r,i,a)||r.AddError({keyword:"minimum",schemaPath:n,instancePath:o,params:{comparison:">=",limit:i.minimum}})}function cd(e,r,n,o){return s.IsGreaterEqualThan(o.length,n.minItems)}function DA(e,r,n,o,i,a){return cd(e,r,i,a)||r.AddError({keyword:"minItems",schemaPath:n,instancePath:o,params:{limit:i.minItems}})}function pd(e,r,n,o){return s.IsMinLength(o,n.minLength)}function GA(e,r,n,o,i,a){return pd(e,r,i,a)||r.AddError({keyword:"minLength",schemaPath:n,instancePath:o,params:{limit:i.minLength}})}function ud(e,r,n,o){return s.IsGreaterEqualThan(s.Keys(o).length,n.minProperties)}function $A(e,r,n,o,i,a){return ud(e,r,i,a)||r.AddError({keyword:"minProperties",schemaPath:n,instancePath:o,params:{limit:i.minProperties}})}function ld(e,r,n,o){return s.IsMultipleOf(o,n.multipleOf)}function jA(e,r,n,o,i,a){return ld(e,r,i,a)||r.AddError({keyword:"multipleOf",schemaPath:n,instancePath:o,params:{multipleOf:i.multipleOf}})}function md(e,r,n,o){let i=new yt;return!G(e,i,n.not,o)&&r.Merge([i])}function qA(e,r,n,o,i,a){return md(e,r,i,a)||r.AddError({keyword:"not",schemaPath:n,instancePath:o,params:{}})}function BA(e,r,n,o){let i=n.oneOf.reduce((a,c)=>{let l=new yt;return G(e,l,c,o)?[...a,l]:a},[]);return s.IsEqual(i.length,1)&&r.Merge(i)}function FA(e,r,n,o,i,a){let c=[],l=[],d=i.oneOf.reduce((g,T,_)=>{let ae=new Qe,fe=`${n}/oneOf/${_}`,Gr=W(e,ae,fe,o,T,a);return Gr&&l.push(_),Gr||c.push(ae),Gr?[...g,ae]:g},[]),f=s.IsEqual(d.length,1)&&r.Merge(d);return!f&&s.IsEqual(l.length,0)&&c.forEach(g=>g.GetErrors().forEach(T=>r.AddError(T))),f||r.AddError({keyword:"oneOf",schemaPath:n,instancePath:o,params:{passingSchemas:l}})}function dd(e,r,n,o){return(s.IsString(n.pattern)?new RegExp(n.pattern):n.pattern).test(o)}function HA(e,r,n,o,i,a){return dd(e,r,i,a)||r.AddError({keyword:"pattern",schemaPath:n,instancePath:o,params:{pattern:i.pattern}})}function KA(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,([l,d])=>!c.test(l)||G(e,r,a,d)&&r.AddKey(l))})}function zA(e,r,n,o,i,a){return s.EveryAll(s.Entries(i.patternProperties),0,([c,l])=>{let d=`${n}/patternProperties/${c}`,f=new RegExp(c);return s.EveryAll(s.Entries(a),0,([g,T])=>{let _=`${o}/${g}`;return!f.test(g)||W(e,r,d,_,l,T)&&r.AddKey(g)})})}function YA(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 VA(e,r,n,o,i,a){return s.IsEqual(a.length,0)||s.EveryAll(i.prefixItems,0,(c,l)=>{let d=`${n}/prefixItems/${l}`,f=`${o}/${l}`;return s.IsLessEqualThan(a.length,l)||W(e,r,d,f,c,a[l])&&r.AddIndex(l)})}function fd(e,r){return e.includes(r)||Pt.Get().exactOptionalPropertyTypes}function gd(e,r){return s.IsUndefined(e[r])}function QA(e,r,n,o){let i=Qn(n)?n.required:[];return s.Every(s.Entries(n.properties),0,([c,l])=>{let d=!s.HasPropertyKey(o,c)||G(e,r,l,o[c])&&r.AddKey(c);return fd(i,c)?d:gd(o,c)||d})}function WA(e,r,n,o,i,a){let c=Qn(i)?i.required:[];return s.EveryAll(s.Entries(i.properties),0,([d,f])=>{let g=`${n}/properties/${d}`,T=`${o}/${d}`,_=()=>!s.HasPropertyKey(a,d)||W(e,r,g,T,f,a[d])&&r.AddKey(d);return fd(c,d)?_():gd(a,d)||_()})}function ZA(e,r,n,o){return s.Every(s.Keys(o),0,(i,a)=>G(e,r,n.propertyNames,i))}function XA(e,r,n,o,i,a){let c=[];return s.EveryAll(s.Keys(a),0,(d,f)=>{let g=`${o}/${d}`,T=`${n}/propertyNames`,_=new Qe,ae=W(e,_,T,g,i.propertyNames,d);return ae||c.push(d),ae})||r.AddError({keyword:"propertyNames",schemaPath:n,instancePath:o,params:{propertyNames:c}})}function JA(e,r,n,o){let i=e.RecursiveRef(n.$recursiveRef)??!1;return j(i)&&G(e,r,i,o)}function ex(e,r,n,o,i,a){let c=e.RecursiveRef(i.$recursiveRef)??!1;return j(c)&&W(e,r,"#",o,c,a)}function nx(e,r,n,o){let i=e.Ref(n.$ref)??!1,a=new yt,c=j(i)&&G(e,a,i,o);return c&&r.Merge([a]),c}function ox(e,r,n,o,i,a){let c=e.Ref(i.$ref)??!1,l=new Qe,d=j(c)&&W(e,l,"#",o,c,a);return d&&r.Merge([l]),d||l.GetErrors().forEach(f=>r.AddError(f)),d}function ix(e,r,n,o){return s.Every(n.required,0,i=>s.HasPropertyKey(o,i))}function ax(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 yd(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 sx(e,r,n,o,i){return n.some(a=>yd(e,r,a,o,i))}function cx(e,r,n,o){return s.IsArray(n.type)?sx(e,r,n.type,n,o):yd(e,r,n.type,n,o)}function px(e,r,n,o,i,a){return(s.IsArray(i.type)?sx(e,r,i.type,i,a):yd(e,r,i.type,i,a))||r.AddError({keyword:"type",schemaPath:n,instancePath:o,params:{type:i.type}})}function ux(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 lx(e,r,n,o,i,a){let c=r.GetIndices(),l=[];return s.EveryAll(a,0,(f,g)=>{let T=new Qe,_=(c.has(g)||W(e,T,n,o,i.unevaluatedItems,f))&&r.AddIndex(g);return _||l.push(g),_})||r.AddError({keyword:"unevaluatedItems",schemaPath:n,instancePath:o,params:{unevaluatedItems:l}})}function mx(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 dx(e,r,n,o,i,a){let c=r.GetKeys(),l=[];return s.EveryAll(s.Entries(a),0,([f,g])=>{let T=new Qe,_=c.has(f)||W(e,T,n,o,i.unevaluatedProperties,g)&&r.AddKey(f);return _||l.push(f),_})||r.AddError({keyword:"unevaluatedProperties",schemaPath:n,instancePath:o,params:{unevaluatedProperties:l}})}function fx(e){return!s.IsEqual(e.uniqueItems,!1)}function gx(e,r,n,o){if(!fx(n))return!0;let i=new Set(o.map(Vr.Hash)).size,a=o.length;return s.IsEqual(i,a)}function yx(e,r,n,o,i,a){if(!fx(i))return!0;let c=new Set,l=a.reduce((f,g,T)=>{let _=Vr.Hash(g);return c.has(_)?[...f,T]:(c.add(_),f)},[]);return s.IsEqual(l.length,0)||r.AddError({keyword:"uniqueItems",schemaPath:n,instancePath:o,params:{duplicateItems:l}})}function G(e,r,n,o){e.Push(n);let i=pp(n)?Cm(e,r,n,o):(!xm(n)||cx(e,r,n,o))&&(!(s.IsObject(o)&&!s.IsArray(o))||(!Qn(n)||ix(e,r,n,o))&&(!Rr(n)||oA(e,r,n,o))&&(!am(n)||dA(e,r,n,o))&&(!sm(n)||gA(e,r,n,o))&&(!cm(n)||hA(e,r,n,o))&&(!Ba(n)||KA(e,r,n,o))&&(!Fa(n)||QA(e,r,n,o))&&(!bm(n)||ZA(e,r,n,o))&&(!ja(n)||ud(e,r,n,o))&&(!Tm(n)||id(e,r,n,o)))&&(!s.IsArray(o)||(!rm(n)||tA(e,r,n,o))&&(!zn(n)||Um(e,r,n,o))&&(!ri(n)||CA(e,r,n,o))&&(!ym(n)||td(e,r,n,o))&&(!up(n)||nd(e,r,n,o))&&(!Vn(n)||ad(e,r,n,o))&&(!ni(n)||cd(e,r,n,o))&&(!oi(n)||YA(e,r,n,o))&&(!ii(n)||gx(e,r,n,o)))&&(!s.IsString(o)||(!Ga(n)||ed(e,r,n,o))&&(!hm(n)||od(e,r,n,o))&&(!$a(n)||pd(e,r,n,o))&&(!qa(n)||dd(e,r,n,o)))&&(!(s.IsNumber(o)||s.IsBigInt(o))||(!mm(n)||Nm(e,r,n,o))&&(!Cr(n)||Lm(e,r,n,o))&&(!gm(n)||rd(e,r,n,o))&&(!Pr(n)||sd(e,r,n,o))&&(!Em(n)||ld(e,r,n,o)))&&(!Sm(n)||JA(e,r,n,o))&&(!Om(n)||nx(e,r,n,o))&&(!em(n)||WO(e,r,n,o))&&(!im(n)||Pm(e,r,n,o))&&(!lm(n)||wm(e,r,n,o))&&(!dm(n)||xA(e,r,n,o))&&(!_m(n)||md(e,r,n,o))&&(!nm(n)||aA(e,r,n,o))&&(!om(n)||cA(e,r,n,o))&&(!Im(n)||BA(e,r,n,o))&&(!mp(n)||!s.IsArray(o)||ux(e,r,n,o))&&(!dp(n)||!s.IsObject(o)||mx(e,r,n,o))&&(!tm(n)||XO(e,r,n,o));return e.Pop(n),i}function W(e,r,n,o,i,a){e.Push(i);let c=pp(i)?uA(e,r,n,o,i,a):!!(+(!xm(i)||px(e,r,n,o,i,a))&+(!(s.IsObject(a)&&!s.IsArray(a))||!!(+(!Qn(i)||ax(e,r,n,o,i,a))&+(!Rr(i)||iA(e,r,n,o,i,a))&+(!am(i)||fA(e,r,n,o,i,a))&+(!sm(i)||yA(e,r,n,o,i,a))&+(!cm(i)||TA(e,r,n,o,i,a))&+(!Ba(i)||zA(e,r,n,o,i,a))&+(!Fa(i)||WA(e,r,n,o,i,a))&+(!bm(i)||XA(e,r,n,o,i,a))&+(!ja(i)||$A(e,r,n,o,i,a))&+(!Tm(i)||vA(e,r,n,o,i,a))))&+(!s.IsArray(a)||!!(+(!rm(i)||rA(e,r,n,o,i,a))&+(!zn(i)||mA(e,r,n,o,i,a))&+(!ri(i)||PA(e,r,n,o,i,a))&+(!ym(i)||UA(e,r,n,o,i,a))&+(!up(i)||NA(e,r,n,o,i,a))&+(!Vn(i)||kA(e,r,n,o,i,a))&+(!ni(i)||DA(e,r,n,o,i,a))&+(!oi(i)||VA(e,r,n,o,i,a))&+(!ii(i)||yx(e,r,n,o,i,a))))&+(!s.IsString(a)||!!(+(!Ga(i)||AA(e,r,n,o,i,a))&+(!hm(i)||LA(e,r,n,o,i,a))&+(!$a(i)||GA(e,r,n,o,i,a))&+(!qa(i)||HA(e,r,n,o,i,a))))&+(!(s.IsNumber(a)||s.IsBigInt(a))||!!(+(!mm(i)||_A(e,r,n,o,i,a))&+(!Cr(i)||IA(e,r,n,o,i,a))&+(!gm(i)||wA(e,r,n,o,i,a))&+(!Pr(i)||MA(e,r,n,o,i,a))&+(!Em(i)||jA(e,r,n,o,i,a))))&+(!Sm(i)||ex(e,r,n,o,i,a))&+(!Om(i)||ox(e,r,n,o,i,a))&+(!em(i)||ZO(e,r,n,o,i,a))&+(!im(i)||lA(e,r,n,o,i,a))&+(!lm(i)||EA(e,r,n,o,i,a))&+(!dm(i)||RA(e,r,n,o,i,a))&+(!_m(i)||qA(e,r,n,o,i,a))&+(!nm(i)||sA(e,r,n,o,i,a))&+(!om(i)||pA(e,r,n,o,i,a))&+(!Im(i)||FA(e,r,n,o,i,a))&+(!mp(i)||!s.IsArray(a)||lx(e,r,n,o,i,a))&+(!dp(i)||!s.IsObject(a)||dx(e,r,n,o,i,a)))&&(!tm(i)||JO(e,r,n,o,i,a));return e.Pop(i),c}var Zn={};Mt(Zn,{Ref:()=>nB});var Ur={};Mt(Ur,{Delete:()=>Zq,Get:()=>Qq,Has:()=>Vq,Indices:()=>Ya,Set:()=>Wq});function hx(e){if(e.length===0)throw Error("Cannot set root")}function Tx(e){if(!s.IsObject(e))throw Error("Cannot set value")}function Kq(e){return/^(0|[1-9]\d*)$/.test(e)}function Ex(e){return[e.slice(0,e.length-1),e.slice(e.length-1)[0]]}function zq(e,r){return s.IsObject(r)&&s.HasPropertyKey(r,e)}function Yq(e,r){return s.IsObject(r)?r[e]:void 0}function hd(e,r){return e.reduce((n,o)=>Yq(o,n),r)}function Ya(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 Vq(e,r){let n=e;return Ya(r).every(o=>zq(o,n)?(n=n[o],!0):!1)}function Qq(e,r){let n=Ya(r);return hd(n,e)}function Wq(e,r,n){let o=Ya(r);hx(o);let[i,a]=Ex(o),c=hd(i,e);return Tx(c),c[a]=n,e}function Zq(e,r){let n=Ya(r);hx(n);let[o,i]=Ex(n),a=hd(o,e);return Tx(a),s.IsArray(a)&&Kq(i)?a.splice(+i,1):delete a[i],e}function Xq(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("#")?_x(e,r,n):e}function Jq(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 _x(e,r,n){return n.href.endsWith("#")?e:n.hash.startsWith("#")?Ur.Get(e,decodeURIComponent(n.hash.slice(1))):void 0}function eB(e,r,n){if(Yn(e)){let o=Xq(e,r,n);if(!s.IsUndefined(o))return o}if(Da(e)){let o=Jq(e,r,n);if(!s.IsUndefined(o))return o}return _x(e,r,n)}function tB(e,r,n){return e.reduce((o,i)=>{let a=Td(i,r,n);return s.IsUndefined(a)?o:a},void 0)}function rB(e,r,n){return s.Keys(e).reduce((o,i)=>{let a=Td(e[i],r,n);return s.IsUndefined(a)?o:a},void 0)}function Td(e,r,n){if(r=xr(e)&&Yn(e)?new URL(e.$id,r.href):r,xr(e)){let o=eB(e,r,n);if(!s.IsUndefined(o))return o}if(s.IsArray(e))return tB(e,r,n);if(s.IsObject(e))return rB(e,r,n)}function nB(e,r){let n=new URL("http://unknown"),o=Yn(e)?new URL(e.$id,n.href):n,i=new URL(r,o.href);return Td(e,o,i)}var Xn=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){xr(r)&&(Yn(r)&&this.ids.push(r),Da(r)&&this.anchors.push(r),lp(r)&&this.recursiveAnchors.push(r),pm(r)&&this.dynamicAnchors.push(r))}Pop(r){xr(r)&&(Yn(r)&&this.ids.pop(),Da(r)&&this.anchors.pop(),lp(r)&&this.recursiveAnchors.pop(),pm(r)&&this.dynamicAnchors.pop())}FromContext(r){return s.HasPropertyKey(this.context,r)?this.context[r]:void 0}FromRef(r){return r.startsWith("#")?Zn.Ref(this.Base(),r):Zn.Ref(this.schema,r)}Ref(r){return this.FromContext(r)??this.FromRef(r)}RecursiveRef(r){return lp(this.Base())?Zn.Ref(this.recursiveAnchors[0],r):Zn.Ref(this.Base(),r)}};function Ix(...e){let[r,n,o]=ie.Match(e,{3:(c,l,d)=>[c,l,d],2:(c,l)=>[{},c,l]}),i=new Xn(r,n),a=new yt;return G(i,a,n,o)}function bx(...e){let[r,n,o]=ie.Match(e,{3:(g,T,_)=>[g,T,_],2:(g,T)=>[{},g,T]}),i=Pt.Get(),a=Hg(),c=[],l=new Xn(r,n),d=new Ha(g=>{if(!s.IsGreaterEqualThan(c.length,i.maxErrors))return c.push({...g,message:a(g)})});return[W(l,d,"#","",n,o),c]}function de(...e){let[r,n,o]=ie.Match(e,{3:(i,a,c)=>[i,a,c],2:(i,a)=>[{},i,a]});return Ix(r,n,o)}function dn(...e){let[r,n,o]=ie.Match(e,{3:(c,l,d)=>[c,l,d],2:(c,l)=>[{},c,l]}),[i,a]=bx(r,n,o);return a}var fn=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 Sx(e,r,n){return s.IsArray(n)?n.map(o=>Ze(e,r.items,o)):n}function Ox(e,r,n){return r.Clean(n)}function Ax(e,r,n){return Ze({...e,...r.$defs},Le(r.$ref),n)}function iB(e){let r=s.HasPropertyKey(e,"unevaluatedProperties")?{additionalProperties:e.unevaluatedProperties}:{},n=Kt(e);return k(n)?Dc(n,r):n}function xx(e,r,n){let o=iB(r);return Ze(e,o,n)}function fp(e){return s.HasPropertyKey(e,"additionalProperties")?e.additionalProperties:void 0}function Rx(e,r,n){if(!s.IsObject(n)||s.IsArray(n))return n;let o=fp(r);for(let i of s.Keys(n)){if(s.HasPropertyKey(r.properties,i)){n[i]=Ze(e,r.properties[i],n[i]);continue}if(s.IsBoolean(o)&&s.IsEqual(o,!0)||A(o)&&de(e,o,n[i])){n[i]=Ze(e,o,n[i]);continue}delete n[i]}return n}function Cx(e,r,n){if(!s.IsObject(n))return n;let o=fp(r),[i,a]=[new RegExp(xt(r)),rt(r)];for(let c of s.Keys(n)){if(i.test(c)){n[c]=Ze(e,a,n[c]);continue}if(s.IsBoolean(o)&&s.IsEqual(o,!0)||A(o)&&de(e,o,n[c])){n[c]=Ze(e,o,n[c]);continue}delete n[c]}return n}function Px(e,r,n){return s.HasPropertyKey(e,r.$ref)?Ze(e,e[r.$ref],n):n}function Ux(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]=Ze(e,r.items[i],n[i]);return s.IsGreaterThan(n.length,o)?n.slice(0,o):n}function aB(e){let r={};for(let n of Object.getOwnPropertyNames(e))r[n]=ge(e[n]);for(let n of Object.getOwnPropertySymbols(e))r[n]=ge(e[n]);return r}function sB(e){return s.IsClassInstance(e)?e:aB(e)}function cB(e){return e.map(r=>ge(r))}function pB(e){return e.slice()}function uB(e){return new Map(ge([...e.entries()]))}function lB(e){return new Set(ge([...e.values()]))}function ge(e){return ct.IsTypeArray(e)?pB(e):ct.IsMap(e)?uB(e):ct.IsSet(e)?lB(e):s.IsArray(e)?cB(e):s.IsObject(e)?sB(e):e}function wx(e,r,n){for(let o of r.anyOf){let i=Ze(e,o,ge(n));if(de(e,o,i))return i}return n}function Ze(e,r,n){return te(r)?Sx(e,r,n):Ut(r)?Ox(e,r,n):me(r)?Ax(e,r,n):w(r)?xx(e,r,n):k(r)?Rx(e,r,n):Se(r)?Cx(e,r,n):pe(r)?Px(e,r,n):V(r)?Ux(e,r,n):O(r)?wx(e,r,n):n}function eo(...e){let[r,n,o]=ie.Match(e,{3:(i,a,c)=>[i,a,c],2:(i,a)=>[{},i,a]});return Ze(r,n,o)}function Nx(e,r,n){return s.IsArray(n)?n.map(o=>De(e,r.items,o)):n}function Lx(e,r,n){return r.Convert(n)}var ne={};Mt(ne,{Fail:()=>to,IsOk:()=>_d,Ok:()=>U,TryBigInt:()=>Id,TryBoolean:()=>UB,TryNull:()=>DB,TryNumber:()=>zB,TryString:()=>JB,TryUndefined:()=>aF});function _d(e){return s.IsObject(e)&&s.HasPropertyKey(e,"value")}function U(e){return{value:e}}function to(){}function mB(e){return U(e)}function dB(e){return s.IsEqual(e,!0)?U(BigInt(1)):U(BigInt(0))}function fB(e){return U(BigInt(Math.trunc(e)))}function gB(e){return U(BigInt(0))}var yB=/^-?(0|[1-9]\d*)n$/,hB=/^-?(0|[1-9]\d*)\.\d+$/,TB=/^-?(0|[1-9]\d*)$/;function EB(e){return yB.test(e)}function _B(e){return hB.test(e)}function IB(e){return TB.test(e)}function bB(e){let r=e.toLowerCase();return EB(e)?U(BigInt(e.slice(0,e.length-1))):_B(e)?U(BigInt(e.split(".")[0])):IB(e)?U(BigInt(e)):s.IsEqual(r,"false")?U(BigInt(0)):s.IsEqual(r,"true")?U(BigInt(1)):void 0}function SB(e){return U(BigInt(0))}function Id(e){return s.IsBigInt(e)?mB(e):s.IsBoolean(e)?dB(e):s.IsNumber(e)?fB(e):s.IsNull(e)?gB(e):s.IsString(e)?bB(e):s.IsUndefined(e)?SB(e):void 0}function OB(e){return s.IsEqual(e,BigInt(0))?U(!1):s.IsEqual(e,BigInt(1))?U(!0):void 0}function AB(e){return U(e)}function xB(e){return s.IsEqual(e,0)?U(!1):s.IsEqual(e,1)?U(!0):void 0}function RB(e){return U(!1)}function CB(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 PB(e){return U(!1)}function UB(e){return s.IsBigInt(e)?OB(e):s.IsBoolean(e)?AB(e):s.IsNumber(e)?xB(e):s.IsNull(e)?RB(e):s.IsString(e)?CB(e):s.IsUndefined(e)?PB(e):void 0}function wB(e){return s.IsEqual(e,BigInt(0))?U(null):void 0}function NB(e){return s.IsEqual(e,!1)?U(null):void 0}function LB(e){return s.IsEqual(e,0)?U(null):void 0}function vB(e){return U(null)}function kB(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 MB(e){return U(null)}function DB(e){return s.IsBigInt(e)?wB(e):s.IsBoolean(e)?NB(e):s.IsNumber(e)?LB(e):s.IsNull(e)?vB(e):s.IsString(e)?kB(e):s.IsUndefined(e)?MB(e):void 0}var GB=BigInt(Number.MAX_SAFE_INTEGER),$B=BigInt(Number.MIN_SAFE_INTEGER);function jB(e){return e<=GB&&e>=$B}function vx(e){return jB(e)?U(Number(e)):void 0}function qB(e){return e?U(1):U(0)}function BB(e){return U(e)}function FB(e){return U(0)}function HB(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=Id(e);return _d(o)?vx(o.value):void 0}function KB(e){return U(0)}function zB(e){return s.IsBigInt(e)?vx(e):s.IsBoolean(e)?qB(e):s.IsNumber(e)?BB(e):s.IsNull(e)?FB(e):s.IsString(e)?HB(e):s.IsUndefined(e)?KB(e):void 0}function YB(e){return U(e.toString())}function VB(e){return U(e.toString())}function QB(e){return U(e.toString())}function WB(e){return U("null")}function ZB(e){return U(e)}function XB(e){return U("")}function JB(e){return s.IsBigInt(e)?YB(e):s.IsBoolean(e)?VB(e):s.IsNumber(e)?QB(e):s.IsNull(e)?WB(e):s.IsString(e)?ZB(e):s.IsUndefined(e)?XB(e):void 0}function eF(e){return s.IsEqual(e,BigInt(0))?U(void 0):void 0}function tF(e){return s.IsEqual(e,!1)?U(void 0):void 0}function rF(e){return s.IsEqual(e,0)?U(void 0):void 0}function nF(e){return U(void 0)}function oF(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 iF(e){return U(void 0)}function aF(e){return s.IsBigInt(e)?eF(e):s.IsBoolean(e)?tF(e):s.IsNumber(e)?rF(e):s.IsNull(e)?nF(e):s.IsString(e)?oF(e):s.IsUndefined(e)?iF(e):void 0}function kx(e,r,n){if(s.IsBigInt(n))return n;let o=ne.TryBigInt(n);return ne.IsOk(o)?o.value:n}function Mx(e,r,n){if(s.IsBoolean(n))return n;let o=ne.TryBoolean(n);return ne.IsOk(o)?o.value:n}function Dx(e,r,n){return De({...e,...r.$defs},Le(r.$ref),n)}function gp(e,r,n){if(r.anyOf.some(c=>de(e,c,n)))return n;let a=r.anyOf.map(c=>De(e,c,ge(n))).find(c=>de(e,r,c));return s.IsUndefined(a)?n:a}function Gx(e,r,n){let o=Ln(r);return gp(e,o,n)}function $x(e,r,n){if(s.IsInteger(n))return n;let o=ne.TryNumber(n);return ne.IsOk(o)?Math.trunc(o.value):n}function jx(e,r,n){let o=Kt(r);return De(e,o,n)}function sF(e,r,n){let o=ne.TryBigInt(n);return ne.IsOk(o)&&s.IsEqual(r.const,o.value)?o.value:n}function cF(e,r,n){let o=ne.TryBoolean(n);return ne.IsOk(o)&&s.IsEqual(r.const,o.value)?o.value:n}function pF(e,r,n){let o=ne.TryNumber(n);return ne.IsOk(o)&&s.IsEqual(r.const,o.value)?o.value:n}function uF(e,r,n){let o=ne.TryString(n);return ne.IsOk(o)&&s.IsEqual(r.const,o.value)?o.value:n}function qx(e,r,n){return s.IsEqual(r.const,n)?n:Xg(r)?sF(e,r,n):Jg(r)?cF(e,r,n):ho(r)?pF(e,r,n):To(r)?uF(e,r,n):H()}function Bx(e,r,n){if(s.IsNull(n))return n;let o=ne.TryNull(n);return ne.IsOk(o)?o.value:n}function Fx(e,r,n){if(s.IsNumber(n))return n;let o=ne.TryNumber(n);return ne.IsOk(o)?o.value:n}function yp(e,r,n,o){let i=s.Keys(o);for(let[a,c]of r)for(let l of i)a.test(l)||(o[l]=De(e,n,o[l]));return o}function Va(e,r,n){return Ge(e)&&s.IsUndefined(n[r])}function lF(e,r,n){let o=s.EntriesRegExp(r.properties),i=s.Keys(n);for(let[a,c]of o)for(let l of i)!a.test(l)||Va(c,l,n)||(n[l]=De(e,c,n[l]));return s.HasPropertyKey(r,"additionalProperties")&&s.IsObject(r.additionalProperties)?yp(e,o,r.additionalProperties,n):n}function Hx(e,r,n){return s.IsObjectNotArray(n)?lF(e,r,n):n}function mF(e,r,n){let o=s.EntriesRegExp(r.patternProperties),i=s.Keys(n);for(let[a,c]of o)for(let l of i)a.test(l)&&(n[l]=De(e,c,n[l]));return s.HasPropertyKey(r,"additionalProperties")&&s.IsObject(r.additionalProperties)?yp(e,o,r.additionalProperties,n):n}function Kx(e,r,n){return s.IsObjectNotArray(n)?mF(e,r,n):n}function zx(e,r,n){return s.HasPropertyKey(e,r.$ref)?De(e,e[r.$ref],n):n}function Yx(e,r,n){if(s.IsString(n))return n;let o=ne.TryString(n);return ne.IsOk(o)?o.value:n}function Vx(e,r,n){let o=nt(r.pattern);return De(e,o,n)}function Qx(e,r,n){if(!s.IsArray(n))return n;for(let o=0;o<Math.min(r.items.length,n.length);o++)n[o]=De(e,r.items[o],n[o]);return n}function Wx(e,r,n){if(s.IsUndefined(n))return n;let o=ne.TryUndefined(n);return ne.IsOk(o)?o.value:n}function Zx(e,r,n){if(s.IsUndefined(n))return n;let o=ne.TryUndefined(n);return ne.IsOk(o)?void 0:n}function De(e,r,n){return te(r)?Nx(e,r,n):Ut(r)?Lx(e,r,n):At(r)?kx(e,r,n):lt(r)?Mx(e,r,n):me(r)?Dx(e,r,n):Ue(r)?Gx(e,r,n):He(r)?$x(e,r,n):w(r)?jx(e,r,n):X(r)?qx(e,r,n):tr(r)?Bx(e,r,n):be(r)?Fx(e,r,n):k(r)?Hx(e,r,n):Se(r)?Kx(e,r,n):pe(r)?zx(e,r,n):ve(r)?Yx(e,r,n):we(r)?Vx(e,r,n):V(r)?Qx(e,r,n):or(r)?Wx(e,r,n):O(r)?gp(e,r,n):Rt(r)?Zx(e,r,n):n}function gn(...e){let[r,n,o]=ie.Match(e,{3:(i,a,c)=>[i,a,c],2:(i,a)=>[{},i,a]});return De(r,n,o)}function Xx(e,r,n){if(!s.IsArray(n))return n;for(let o=0;o<n.length;o++)n[o]=Fe(e,r.items,n[o]);return n}function Jx(e,r,n){return r.Default(n)}function eR(e,r,n){return Fe({...e,...r.$defs},Le(r.$ref),n)}function tR(e,r){return s.IsUndefined(r)?s.IsFunction(e.default)?e.default():ge(e.default):r}function rR(e,r,n){let o=Kt(r);return Fe(e,o,n)}function nR(e,r,n){if(!s.IsObject(n))return n;let o=s.Keys(r.properties);for(let i of o){let a=Fe(e,r.properties[i],n[i]);s.IsUndefined(a)&&(Ge(r.properties[i])||!s.HasPropertyKey(r.properties[i],"default"))||(n[i]=Fe(e,r.properties[i],n[i]))}if(!Rr(r)||s.IsBoolean(r.additionalProperties))return n;for(let i of s.Keys(n))o.includes(i)||(n[i]=Fe(e,r.additionalProperties,n[i]));return n}function oR(e,r,n){if(!s.IsObject(n))return n;let[o,i]=[new RegExp(xt(r)),rt(r)];for(let a of s.Keys(n))o.test(a)&&vt(i)&&(n[a]=Fe(e,i,n[a]));if(!Rr(r))return n;for(let a of s.Keys(n))o.test(a)||(n[a]=Fe(e,r.additionalProperties,n[a]));return n}function iR(e,r,n){return s.HasPropertyKey(e,r.$ref)?Fe(e,e[r.$ref],n):n}function aR(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]=Fe(e,o[a],n[a]));return n}function sR(e,r,n){for(let o of r.anyOf){let i=Fe(e,o,ge(n));if(de(e,o,i))return i}return n}function Fe(e,r,n){let o=vt(r)?tR(r,n):n;return te(r)?Xx(e,r,o):Ut(r)?Jx(e,r,o):me(r)?eR(e,r,o):w(r)?rR(e,r,o):k(r)?nR(e,r,o):Se(r)?oR(e,r,o):pe(r)?iR(e,r,o):V(r)?aR(e,r,o):O(r)?sR(e,r,o):o}function ro(...e){let[r,n,o]=ie.Match(e,{3:(i,a,c)=>[i,a,c],2:(i,a)=>[{},i,a]});return Fe(r,n,o)}function ci(e){return(...r)=>{let[n,o,i]=ie.Match(r,{3:(a,c,l)=>[a,c,l],2:(a,c)=>[{},a,c]});return e.reduce((a,c)=>c(n,o,a),i)}}function dF(e,r,n){return r["~codec"].decode(n)}function fF(e,r,n){return r["~codec"].encode(n)}function Re(e,r,n,o){return Cn(n)?s.IsEqual(e,"Decode")?dF(r,n,o):fF(r,n,o):o}function gF(e,r,n,o){if(!s.IsArray(o))return H();for(let i=0;i<o.length;i++)o[i]=Te(e,r,n.items,o[i]);return Re(e,r,n,o)}function yF(e,r,n,o){let i=Re(e,r,n,o);if(!s.IsArray(i))return i;for(let a=0;a<i.length;a++)i[a]=Te(e,r,n.items,i[a]);return i}function cR(e,r,n,o){return s.IsEqual(e,"Decode")?gF(e,r,n,o):yF(e,r,n,o)}function pR(e,r,n,o){return o=Te(e,{...r,...n.$defs},Le(n.$ref),o),Re(e,r,n,o)}function hF(e,r,n,o){for(let i of n.allOf)o=Te(e,r,i,o);return Re(e,r,n,o)}function TF(e,r,n,o){let i=Re(e,r,n,o);for(let a of n.allOf)i=Te(e,r,a,i);return i}function uR(e,r,n,o){return s.IsEqual(e,"Decode")?hF(e,r,n,o):TF(e,r,n,o)}function EF(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]=Te(e,r,n.properties[i],o[i]));return Re(e,r,n,o)}function _F(e,r,n,o){let i=Re(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]=Te(e,r,n.properties[a],i[a]));return i}function lR(e,r,n,o){return s.IsEqual(e,"Decode")?EF(e,r,n,o):_F(e,r,n,o)}function IF(e,r,n,o){if(!s.IsObjectNotArray(o))return H();let i=new RegExp(xt(n));for(let a of s.Keys(o))i.test(a)||H(),o[a]=Te(e,r,rt(n),o[a]);return Re(e,r,n,o)}function bF(e,r,n,o){let i=Re(e,r,n,o);if(!s.IsObjectNotArray(i))return i;let a=new RegExp(xt(n));for(let c of s.Keys(i))a.test(c)&&(i[c]=Te(e,r,rt(n),i[c]));return i}function mR(e,r,n,o){return s.IsEqual(e,"Decode")?IF(e,r,n,o):bF(e,r,n,o)}function dR(e,r,n,o){return o=s.HasPropertyKey(r,n.$ref)?Te(e,r,r[n.$ref],o):o,Re(e,r,n,o)}function SF(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]=Te(e,r,n.items[i],o[i]);return Re(e,r,n,o)}function OF(e,r,n,o){let i=Re(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]=Te(e,r,n.items[a],i[a]);return i}function fR(e,r,n,o){return s.IsEqual(e,"Decode")?SF(e,r,n,o):OF(e,r,n,o)}function AF(e,r,n,o){for(let i of n.anyOf){if(!de(r,i,o))continue;let a=Te(e,r,i,o);return Re(e,r,n,a)}return H()}function xF(e,r,n,o){let i=Re(e,r,n,o);for(let a of n.anyOf){let c=Te(e,r,a,ge(i));if(de(r,a,c))return c}return i}function gR(e,r,n,o){return s.IsEqual(e,"Decode")?AF(e,r,n,o):xF(e,r,n,o)}function Te(e,r,n,o){return te(n)?cR(e,r,n,o):me(n)?pR(e,r,n,o):w(n)?uR(e,r,n,o):k(n)?lR(e,r,n,o):Se(n)?mR(e,r,n,o):pe(n)?dR(e,r,n,o):V(n)?fR(e,r,n,o):O(n)?gR(e,r,n,o):Re(e,r,n,o)}var bd=class extends fn{constructor(r,n){super("Decode",r,n)}};function RF(e,r,n){if(!de(e,r,n))throw new bd(n,dn(e,r,n));return n}function CF(e,r,n){return Te("Decode",e,r,n)}var AFe=ci([(e,r,n)=>ge(n),(e,r,n)=>ro(e,r,n),(e,r,n)=>gn(e,r,n),(e,r,n)=>eo(e,r,n),(e,r,n)=>RF(e,r,n),(e,r,n)=>CF(e,r,n)]);var Sd=class extends fn{constructor(r,n){super("Encode",r,n)}};function PF(e,r,n){if(!de(e,r,n))throw new Sd(n,dn(e,r,n));return n}function UF(e,r,n){return Te("Encode",e,r,n)}var DFe=ci([(e,r,n)=>ge(n),(e,r,n)=>UF(e,r,n),(e,r,n)=>ro(e,r,n),(e,r,n)=>gn(e,r,n),(e,r,n)=>eo(e,r,n),(e,r,n)=>PF(e,r,n)]);var $t=class extends Error{constructor(r,n){super(n),this.type=r}};function yR(e,r){return s.IsFunction(r.default)?r.default(r):s.IsObject(r.default)?ge(r.default):r.default}function hR(e,r){if(ii(r)&&!vt(r))throw new $t(r,"Arrays with uniqueItems constraints must specify a default annotation");let n=ni(r)?r.minItems:0;return Array.from({length:n},()=>Ee(e,r.items))}async function*wF(){}function TR(e,r){return wF()}function ER(e,r){return r.Create()}function _R(e,r){return Cr(r)?BigInt(r.exclusiveMinimum)+BigInt(1):Pr(r)?BigInt(r.minimum):BigInt(0)}function IR(e,r){return!1}function bR(e,r){let n=Ee(e,r.instanceType);return class{constructor(){Object.assign(this,n)}}}function SR(e,r){return Ee({...e,...r.$defs},Le(r.$ref))}function OR(e,r){return Ee(e,Ln(r))}function AR(e,r){let n=Ee(e,r.returnType);return()=>n}function xR(e,r){return Cr(r)&&s.IsNumber(r.exclusiveMinimum)?r.exclusiveMinimum+1:Pr(r)?r.minimum:0}function RR(e,r){return Ee(e,Kt(r))}function*NF(){}function CR(e,r){return NF()}function PR(e,r){return r.const}function UR(e,r){throw new $t(r,"Cannot create TNever types")}function wR(e,r){return null}function NR(e,r){return Cr(r)&&s.IsNumber(r.exclusiveMinimum)?r.exclusiveMinimum+1:Pr(r)?r.minimum:0}function LR(e,r){return(s.IsUndefined(r.required)?[]:r.required).reduce((o,i)=>({...o,[i]:Ee(e,r.properties[i])}),{})}function vR(e,r){return Promise.resolve(Ee(e,r.item))}function kR(e,r){if(ja(r)&&!vt(r))throw new $t(r,"Record with the minProperties constraint must have a default annotation");return{}}function MR(e,r){return s.HasPropertyKey(e,r.$ref)?Ee(e,e[r.$ref]):(()=>{throw new $t(r,"Unable to deref Ref")})()}function DR(e,r){if((qa(r)||Ga(r))&&!vt(r))throw Error("Strings with format or pattern constraints must specify default");let o=$a(r)?r.minLength:0;return"".padEnd(o)}function GR(e,r){return Symbol()}function $R(e,r){let n=nt(r.pattern);if(ve(n))throw new $t(r,"Unable to create TemplateLiteral due to infinite type expansion");return Ee(e,n)}function jR(e,r){return Array.from({length:r.minItems},(n,o)=>Ee(e,r.items[o]))}function qR(e,r){if(s.IsEqual(r.anyOf.length,0))throw Error("Unable to create Union with no variants");return Ee(e,r.anyOf[0])}function Ee(e,r){return vt(r)?yR(e,r):te(r)?hR(e,r):at(r)?TR(e,r):Ut(r)?ER(e,r):At(r)?_R(e,r):lt(r)?IR(e,r):$e(r)?bR(e,r):me(r)?SR(e,r):Ue(r)?OR(e,r):je(r)?AR(e,r):He(r)?xR(e,r):w(r)?RR(e,r):st(r)?CR(e,r):X(r)?PR(e,r):gr(r)?UR(e,r):tr(r)?wR(e,r):be(r)?NR(e,r):k(r)?LR(e,r):tt(r)?vR(e,r):Se(r)?kR(e,r):pe(r)?MR(e,r):ve(r)?DR(e,r):rr(r)?GR(e,r):we(r)?$R(e,r):V(r)?jR(e,r):or(r)?void 0:O(r)?qR(e,r):Rt(r)?void 0:void 0}function ur(...e){let[r,n]=ie.Match(e,{2:(o,i)=>[o,i],1:o=>[{},o]});return Ee(r,n)}var Od=class extends fn{constructor(r,n){super("Parse",r,n)}};function LF(e,r,n){if(!de(e,r,n))throw new Od(n,dn(e,r,n));return n}var BKe=ci([(e,r,n)=>ge(n),(e,r,n)=>ro(e,r,n),(e,r,n)=>gn(e,r,n),(e,r,n)=>eo(e,r,n),(e,r,n)=>LF(e,r,n)]);var kF=N({type:Y("insert"),path:bt(),value:Je()}),MF=Object({type:Y("update"),path:bt(),value:Je()}),DF=N({type:Y("delete"),path:bt()}),QKe=q([kF,MF,DF]);function pi(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]:ur(r)}function no(e,r,n,o,i){e.command(r).description(n).option("-f, --file <FILE_PATH>","Read body from file (use - for stdin)").option("-d, --data <JSON>","Inline JSON body").option("--generate-skeleton","Print a JSON skeleton for the request body and exit").action(async a=>{if(a.generateSkeleton){Q(pi(o));return}let c=ti(a),l=await i()(o,{body:c});Q(l)})}function HR(e,r){let n=e.command("grok").description("Test and preview grok parsing rules");no(n,"parse","Parse sample log lines with grok rules and return the extracted fields",VO,r)}var KR=require("node:child_process"),zR=require("node:fs"),YR=require("node:os"),Ep=require("node:path");var oo=require("node:fs");function Qa(e,r){let n=`${e}.tmp.${process.pid}`;(0,oo.writeFileSync)(n,r),(0,oo.renameSync)(n,e)}function Wa(e){try{return(0,oo.readFileSync)(e,"utf8")}catch(r){if(r.code==="ENOENT")return;throw r}}function Za(e,r){if(r===void 0)return;let n=`${e}.bak.${new Date().toISOString().replaceAll(":","-")}`;return(0,oo.writeFileSync)(n,r),n}function io(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var xd="tsuga-dev/agent-plugins",hp="tsuga";function Tp(e,r){B(` $ ${e} ${r.join(" ")}`);try{(0,KR.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 qF(e,r){B("Claude Code \u2192 installing Tsuga plugin"),Tp("claude",["plugin","marketplace","add",xd]),Tp("claude",["plugin","install",`tsuga@${hp}`]),r.autoUpdate&&BF(e)}function BF(e){let r=(0,Ep.join)(e,".claude","settings.json");B(`Claude Code \u2192 ${r} (autoUpdate)`),(0,zR.mkdirSync)((0,Ep.dirname)(r),{recursive:!0});let n=Wa(r),o=JSON.parse(n??"{}");if(!io(o))throw new Error(`${r} must contain a JSON object`);let i=o.extraKnownMarketplaces??{};if(!io(i))throw new Error(`${r} "extraKnownMarketplaces" must be a JSON object`);let a=i[hp],c=io(a)?a:{};o.extraKnownMarketplaces={...i,[hp]:{source:{source:"github",repo:xd},...c,autoUpdate:!0}};let l=Za(r,n);Qa(r,`${JSON.stringify(o,null,2)}
139
- `),B(l===void 0?" created":` patched (backup: ${l})`)}function FF(){B("Codex \u2192 installing Tsuga plugin"),Tp("codex",["plugin","marketplace","add",xd]),Tp("codex",["plugin","add",`tsuga@${hp}`])}function VR(e){let r=e.command("install").description("Install Tsuga plugins into local LLM CLIs").command("plugin").description("Install the Tsuga plugin into a specific LLM CLI");r.command("claude-code").description("Install the Tsuga plugin into Claude Code (requires the claude CLI in PATH)").option("--no-auto-update","Skip patching ~/.claude/settings.json with autoUpdate=true").action(n=>{qF((0,YR.homedir)(),n),B("Restart your claude session to load the new plugins.")}),r.command("codex").description("Install the Tsuga plugin into Codex (requires the codex CLI in PATH)").action(()=>{FF(),B("Restart your codex session to load the new plugins.")})}var Qt="/v0/kubernetes-explorer",HF="^[a-z0-9.-]+$",KF="^[A-Za-z0-9._-]+$",QR=256,WR=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 lr=e=>t.Optional(t.Array(p({allowEmpty:!1}),{description:e})),ZR={clusterId:WR,search:t.Optional(t.String({pattern:HF,minLength:1,maxLength:QR,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."}))},XR={clusterId:WR,search:t.Optional(t.String({pattern:KF,minLength:1,maxLength:QR,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."}))},JR=t.Object(ZR),eC=t.Object(XR),Xa={...ZR,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:lr("Restrict results to these Kubernetes cluster names."),namespaces:lr("Restrict results to these namespaces."),teams:lr("Restrict results to these team names."),envs:lr("Restrict results to these environments."),...ye},tC=["Pending","Running","Succeeded","Failed","Unknown","CrashLoopBackOff","Error"],zF={...Xa,nodes:lr("Restrict results to pods scheduled on these nodes."),deployments:lr("Restrict results to pods owned by these Deployments."),statefulsets:lr("Restrict results to pods owned by these StatefulSets."),daemonsets:lr("Restrict results to pods owned by these DaemonSets."),podStatus:t.Optional(t.Array(t.Enum(tC),{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."}))},ui=t.Enum(["asc","desc"],{description:"Sort direction. Defaults to ascending."}),YF=["deployment","statefulset","daemonset"],rC=t.Object({kind:t.Enum(YF,{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."}),nC=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(tC,{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(E({description:"Timestamp from pod start time telemetry for the selected pod instance. Present when pod start time telemetry is observed."}))}),Rd=t.Object({...nC.properties,workload:t.Optional(rC),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."}))}),VF=["podName","namespace","cluster","team","env","node","phase","restarts","cpuUsageMilli","cpuUtilization","cpuRequestUtilization","memoryUsageBytes","memoryUtilization","memoryRequestUtilization","createdAt"],B9e=m({tags:["kubernetes-explorer"],method:"GET",url:`${Qt}/pods`,query:t.Object({...zF,sortBy:t.Optional(t.Enum(VF,{description:"Field to sort pods by."})),sortDirection:t.Optional(ui)}),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."}))}),QF=["cluster","teams","envs","cpuUsageMilli","memoryUsageBytes","readyNodes"],F9e=m({tags:["kubernetes-explorer"],method:"GET",url:`${Qt}/clusters`,query:t.Object({...XR,teams:lr("Restrict to clusters that host workloads from these team names."),envs:lr("Restrict to clusters that host workloads in these environments."),sortBy:t.Optional(t.Enum(QF,{description:"Field to sort clusters by."})),sortDirection:t.Optional(ui),...ye}),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."}))}),WF=["namespace","cluster","teams","envs","pods","cpuUsageMilli","memoryUsageBytes"],H9e=m({tags:["kubernetes-explorer"],method:"GET",url:`${Qt}/namespaces`,query:t.Object({...Xa,sortBy:t.Optional(t.Enum(WF,{description:"Field to sort namespaces by."})),sortDirection:t.Optional(ui)}),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."}))}),ZF=["deployment","namespace","cluster","team","env","pods","availableReplicas","cpuUsageMilli","memoryUsageBytes"],K9e=m({tags:["kubernetes-explorer"],method:"GET",url:`${Qt}/deployments`,query:t.Object({...Xa,sortBy:t.Optional(t.Enum(ZF,{description:"Field to sort deployments by."})),sortDirection:t.Optional(ui)}),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."}))}),XF=["statefulSet","namespace","cluster","team","env","pods","cpuUsageMilli","memoryUsageBytes"],z9e=m({tags:["kubernetes-explorer"],method:"GET",url:`${Qt}/statefulsets`,query:t.Object({...Xa,sortBy:t.Optional(t.Enum(XF,{description:"Field to sort StatefulSets by."})),sortDirection:t.Optional(ui)}),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."}))}),JF=["daemonSet","namespace","cluster","team","env","pods","readyNodes","cpuUsageMilli","memoryUsageBytes"],Y9e=m({tags:["kubernetes-explorer"],method:"GET",url:`${Qt}/daemonsets`,query:t.Object({...Xa,sortBy:t.Optional(t.Enum(JF,{description:"Field to sort DaemonSets by."})),sortDirection:t.Optional(ui)}),paginated:!0,response:t.Array(Nd)}),Ld=t.Object({overview:t.Object({...nC.properties,workload:t.Optional(rC)},{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."})}),oC=t.Object({clusterId:t.Optional(p({allowEmpty:!1})),k8sCluster:p({allowEmpty:!1}),k8sNamespace:p({allowEmpty:!1}),podName:p({allowEmpty:!1})}),V9e=m({tags:["kubernetes-explorer"],method:"GET",url:`${Qt}/pod-details`,query:oC,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:E({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(E({description:"Timestamp when Tsuga last observed the pod deletion event. Present when the latest observed pod event is deleted."}))}),Q9e=m({tags:["kubernetes-explorer"],method:"GET",url:`${Qt}/pod-manifest`,query:oC,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(E({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(E({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."})}),W9e=m({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:Md}),eH=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(E())}),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(E())}))}),Z9e=m({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:eH}),tH=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(E())}),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(E())}))}),X9e=m({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:tH});var Nr=`/${"v1"}/kubernetes-explorer`,iC=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."}),rH={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(iC,{examples:[rH]});var aC=t.Pick(Cd,["cluster","teams","envs","cpuUsageMilli","memoryUsageBytes","readyNodes","podPhaseCounts"],{description:"A Kubernetes cluster with aggregate resource usage, node readiness, and pod phase counts."}),nH={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(aC,{examples:[nH]});var sC=t.Pick(Pd,["namespace","cluster","teams","envs","pods","cpuUsageMilli","memoryUsageBytes"],{description:"A Kubernetes namespace with pod count and aggregate resource usage."}),oH={namespace:"production",cluster:"prod-us-east",teams:["platform"],envs:["production"],pods:24,cpuUsageMilli:1800,memoryUsageBytes:3221225472};Object.assign(sC,{examples:[oH]});var cC=t.Pick(Ud,["deployment","namespace","cluster","team","env","pods","availableReplicas","desiredReplicas","cpuUsageMilli","memoryUsageBytes"],{description:"A Kubernetes deployment with replica counts and aggregate resource usage."}),iH={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(cC,{examples:[iH]});var pC=t.Pick(wd,["statefulSet","namespace","cluster","team","env","pods","readyReplicas","desiredReplicas","cpuUsageMilli","memoryUsageBytes"],{description:"A Kubernetes StatefulSet with replica counts and aggregate resource usage."}),aH={statefulSet:"postgres",namespace:"production",cluster:"prod-us-east",team:"platform",env:"production",pods:3,readyReplicas:3,desiredReplicas:3,cpuUsageMilli:900,memoryUsageBytes:2147483648};Object.assign(pC,{examples:[aH]});var uC=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."}),sH={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(uC,{examples:[sH]});var lC=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."}),cH={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:[cH]});var mC=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."}),pH={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(mC,{examples:[pH]});var dC=t.Pick(Md,["overview","podReplicas","revisions"],{description:"Detailed information for a single Kubernetes deployment: replica status, backing pods, and rollout revisions."}),uH={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(dC,{examples:[uH]});var fC=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."}))}),Ja=t.Pick(JR,["clusterId","search"]),lH=t.Pick(eC,["clusterId","search"]),gC=m({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:`${Nr}/pods`,query:Ja,response:t.Array(iC)}),yC=m({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:`${Nr}/clusters`,query:lH,response:t.Array(aC)}),hC=m({description:"Lists Kubernetes namespaces observed across the organization with pod counts and aggregate resource usage.",operationId:"listKubernetesNamespaces",tags:["public","kubernetes-explorer"],method:"GET",url:`${Nr}/namespaces`,query:Ja,response:t.Array(sC)}),TC=m({description:"Lists Kubernetes deployments observed across the organization with replica counts and aggregate resource usage.",operationId:"listKubernetesDeployments",tags:["public","kubernetes-explorer"],method:"GET",url:`${Nr}/deployments`,query:Ja,response:t.Array(cC)}),EC=m({description:"Lists Kubernetes StatefulSets observed across the organization with replica counts and aggregate resource usage.",operationId:"listKubernetesStatefulSets",tags:["public","kubernetes-explorer"],method:"GET",url:`${Nr}/statefulsets`,query:Ja,response:t.Array(pC)}),_C=m({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:`${Nr}/daemonsets`,query:Ja,response:t.Array(uC)}),IC=t.Object({...fC.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."})}),bC=m({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:`${Nr}/pod-details`,query:IC,response:lC}),SC=m({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:`${Nr}/pod-manifest`,query:IC,response:mC}),OC=m({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:`${Nr}/deployment-details`,query:t.Object({...fC.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:dC});var mH="clusterId";function AC(e,r,n){let o=r.query.properties??{},i=Object.keys(o).filter(a=>a!==mH);for(let a of i){let c=a.replace(/([A-Z])/g,"-$1").toLowerCase(),l=c.replace(/-/g,"_").toUpperCase(),d=o[a]?.description??"";n?e.requiredOption(`--${c} <${l}>`,d):e.option(`--${c} <${l}>`,d)}return i}function li(e,r,n,o){let i=e.command(r).description(n.description??`List Kubernetes ${r}`),a=AC(i,n,!1);i.action(async c=>{let l={};for(let d of a)c[d]!==void 0&&(l[d]=c[d]);Q(Object.keys(l).length>0?await o()(n,{query:l}):await o()(n))})}function Dd(e,r,n,o){let i=e.command(r).description(n.description??`Get Kubernetes ${r}`),a=AC(i,n,!0);i.action(async c=>{let l={};for(let d of a)l[d]=c[d];Q(await o()(n,{query:l}))})}function xC(e,r){let n=e.command("kubernetes").description("Explore Kubernetes resources observed across the organization");li(n,"pods",gC,r),li(n,"clusters",yC,r),li(n,"namespaces",hC,r),li(n,"deployments",TC,r),li(n,"statefulsets",EC,r),li(n,"daemonsets",_C,r),Dd(n,"pod-details",bC,r),Dd(n,"pod-manifest",SC,r),Dd(n,"deployment-details",OC,r)}var dH=t.Union([t.Literal("scalar"),t.Literal("timeseries")]),fH="/v0/promql",_p=t.Object({query:p({type:"long",allowEmpty:!1,description:"PromQL expression to evaluate."}),timeRange:zo,step:p({allowEmpty:!1,description:"Evaluation step interval (e.g. `1m`, `5m`, `1h`). Must be a valid Prometheus duration string."}),returnType:t.Optional(dH),executionOptions:gl,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."}))}),gH={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(_p,{examples:[gH]});var g4e=m({tags:["promql"],url:fH,method:"POST",body:_p,response:Vc});var RC=`/${"v1"}/aggregation`,CC=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."})}),PC=t.Object({results:t.Array(t.Object({...CC.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."}),yH={results:[{id:"q1",group:{host:"server-1"},value:123.45}]};Object.assign(PC,{examples:[yH]});var Ip=t.Object({series:t.Array(t.Object({...CC.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."}),hH={series:[{id:"q1",group:{host:"server-1"},points:[{timestamp:16094592e5,value:123.45},{timestamp:160945926e4,value:456.78}]}]};Object.assign(Ip,{examples:[hH]});var TH=t.Omit(Pa.items,["fill"],{title:"AggregationQuery",description:"Aggregation query. Omit `filter` for an unfiltered query and omit `functions` when no post-processing is needed."}),EH=t.Optional(Sr),UC={timeRange:mt,queries:t.Array(TH,{maxItems:Xc,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 ${Xc} 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:EH,dataSource:LS,formula:t.Optional(Bn)},wC=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."}))}),NC=t.Object(UC,{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."}),_H={timeRange:{from:1782201500,to:1782203400},dataSource:"logs",queries:[{aggregate:{type:"count"},filter:"context.service.name:checkout"}],groupBy:[{fields:["level"],limit:5}]};Object.assign(NC,{examples:[_H]});var LC=m({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:`${RC}/multi-query/scalar`,method:"POST",body:NC,query:wC,response:PC}),vC=t.Object({...UC,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."}),IH={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(vC,{examples:[IH]});var kC=m({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:`${RC}/multi-query/timeseries`,method:"POST",body:vC,query:wC,response:Ip});var bH=`/${"v1"}/promql`,SH=t.Object({...t.Pick(_p,["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"}]}),OH=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."}))}),MC=m({description:"Runs a PromQL range query over Tsuga metric data and returns timeseries results. Authenticate with a bearer operation API key or OAuth access token that can read metrics. Send clusterId as a query parameter; multi-cluster organizations must provide it. See [How to write PromQL queries](/documentation/visualize/guides/how-to-write-promql-queries) for query syntax and examples.",operationId:"queryPromql",tags:["public","promql"],url:bH,method:"POST",body:SH,query:OH,response:Ip});function DC(e,r){no(e,"promql","Run a PromQL range query over metric data",MC,r)}var Lr="/v0/dashboards",$C=["white","gray.100","amber.200","lime.200","emerald.200","cyan.200","blue.200","violet.200","fuchsia.200","pink.200","red.200"],AH=["bar","distribution","gauge","heatmap","list","pie","query-value","table","timeseries","top-list"],K4e=[...AH,"note"];var xH=["ns","us","ms","s","m","h","days"];var RH=["B","KB","MB","GB","TB","PB"];var CH=20;var jC=t.Object({type:t.Literal("cpu",{description:"Normalizes values as CPU usage"})},{$id:"DataNormalizerCpu",title:"CPU"}),qC=t.Object({type:t.Literal("duration",{description:"Normalizes values as durations using standard time units"}),unit:t.Enum(xH,{description:"Time unit used to present the normalized values"})},{$id:"DataNormalizerDuration",title:"Duration"}),BC=t.Object({type:t.Literal("data",{description:"Normalizes values as data sizes using byte units"}),unit:t.Enum(RH,{description:"Data size unit used to present the normalized values"})},{$id:"DataNormalizerData",title:"Data"}),FC=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"}),HC=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"}),KC=t.Object({type:t.Literal("date",{description:"Formats values as calendar dates"})},{$id:"DataNormalizerDate",title:"Date"}),zC=t.Object({type:t.Literal("level",{description:"Displays values using their log level name"})},{$id:"DataNormalizerLevel",title:"Level"}),YC=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"}),PH=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"}),UH=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:CH})},{$id:"InputDataNormalizerCustom",title:"Custom"}),ht=b("type",[qC,BC,FC,HC,KC,zC,jC,YC,PH],{title:"Normalizer",description:"Display-value formatter for widget values or list/table columns."}),Tt=b("type",[qC,BC,FC,HC,KC,zC,jC,YC,UH],{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(ht)},{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(Tt)},{title:"WidgetListColumn",description:"List column pairing a displayed attribute with the formatting applied to its values."}),mi=["background","no-background"],wH=["table","legend-only","no-legend"];var NH=["greater_than","less_than","equal","not_equal","greater_than_or_equal","less_than_or_equal"],VC=["alert","warning","success"],mr=t.Object({operator:t.Enum(NH,{description:"Comparator used to evaluate the metric value"}),value:t.Number({description:"Threshold value used when evaluating the operator"}),color:t.Enum(VC,{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."}),LH=t.Object({value:t.Number({description:"Y-axis value where the threshold marker is placed"}),level:t.Enum(VC,{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"],hn=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 yn=t.Enum(["flex-start","center","flex-end"],{description:"Flex alignment keyword used for widget layout"}),di=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."}),fi=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."}),Sp={source:zt,queries:YS,formula:t.Optional(Jc),aliases:t.Optional(di),visibleSeries:t.Optional(t.Array(t.Boolean(),{description:"Flags indicating whether each query or formula series is visible"}))},Op={source:zt,queries:Pa,formula:t.Optional(Bn),aliases:t.Optional(fi),visibleSeries:t.Optional(t.Array(t.Boolean(),{description:"Flags indicating whether each query or formula series is visible"}))},gi={...Sp,groupBy:t.Optional(Yo)},yi={...Op,groupBy:t.Optional(Sr)},Ce=t.Enum(wH,{description:"Controls whether and how the widget displays legend or series details (e.g. table, legend-only, or no legend)"}),le=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(LH,{description:"Threshold markers displayed on the chart"})),kH=t.Object({name:t.String({description:"Display name of the table column"}),...Sp,source:zt,normalizer:t.Optional(ht),precision:le},{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`."}),MH=t.Object({name:p({description:"Display name of the table column"}),...Op,source:zt,normalizer:t.Optional(Tt),precision:le},{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`."}),DH=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."}),GH=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."}),QC=["horizontal","vertical"],$H=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"}),jH=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"}),bp=b("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"}),hi=t.Object({min:bp,max:bp,scale:b("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."}),Ti=t.Object({min:bp,max:bp,scale:b("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."}),qH=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"}),BH=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 FH=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(Ce),thresholds:jt,yAxisSettings:t.Optional(hi)},{$id:"GraphVisualizationTimeseriesConnection",title:"TimeseriesConnection"}),HH=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(Ce),thresholds:jt,yAxisSettings:t.Optional(Ti)},{$id:"InputGraphVisualizationTimeseriesConnection",title:"TimeseriesConnection"}),KH=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"}),zH=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"}),YH=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"}),VH=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"}),QH=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(Ce)},{$id:"GraphVisualizationPieConnection",title:"PieConnection"}),WH=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(Ce)},{$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(Ce),thresholds:jt,yAxisSettings:t.Optional(hi)},{$id:"GraphVisualizationBarConnection",title:"BarConnection"}),XH=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(Ce),thresholds:jt,yAxisSettings:t.Optional(Ti)},{$id:"InputGraphVisualizationBarConnection",title:"BarConnection"}),JH=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(mi,{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:le,normalizer:t.Optional(ht),legendMode:t.Optional(Ce)},{$id:"GraphVisualizationQueryValueConnection",title:"QueryValueConnection"}),e2=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(mi,{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:le,normalizer:t.Optional(Tt),legendMode:t.Optional(Ce)},{$id:"InputGraphVisualizationQueryValueConnection",title:"QueryValueConnection"}),t2=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(QC,{description:"Layout used to render log patterns"}))},{$id:"GraphVisualizationListLogPatterns",title:"ListLogPatterns"}),r2=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(QC,{description:"Layout used to render log patterns"}))},{$id:"InputGraphVisualizationListLogPatterns",title:"ListLogPatterns"}),n2=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"}),o2=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"}),es=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."}),ts=t.Array(p({allowEmpty:!1,type:"long",description:"Raw PromQL expression for this widget."}),{minItems:1,description:"PromQL expressions configured for this widget."}),i2=t.Object({type:t.Literal("timeseries-promql",{description:"Displays PromQL metrics query-based aggregation as a time series chart"}),queries:es,aliases:t.Optional(di),timeBucket:t.Optional(hn),normalizer:t.Optional(ht),precision:le,legendMode:t.Optional(Ce),thresholds:jt,yAxisSettings:t.Optional(hi),smoothing:t.Optional(t.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"}))},{$id:"GraphVisualizationTimeseriesPromql",title:"TimeseriesPromql"}),a2=t.Object({type:t.Literal("timeseries-promql",{description:"Displays PromQL metrics query-based aggregation as a time series chart"}),queries:ts,aliases:t.Optional(fi),timeBucket:t.Optional(hn),normalizer:t.Optional(Tt),precision:le,legendMode:t.Optional(Ce),thresholds:jt,yAxisSettings:t.Optional(Ti),smoothing:t.Optional(t.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"}))},{$id:"InputGraphVisualizationTimeseriesPromql",title:"TimeseriesPromql"}),s2=t.Object({type:t.Literal("query-value-promql",{description:"Configures a PromQL metrics query-based aggregation as a single value"}),queries:es,aliases:t.Optional(di),backgroundMode:t.Optional(t.Enum(mi,{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:le,normalizer:t.Optional(ht),legendMode:t.Optional(Ce)},{$id:"GraphVisualizationQueryValuePromql",title:"QueryValuePromql"}),c2=t.Object({type:t.Literal("query-value-promql",{description:"Configures a PromQL metrics query-based aggregation as a single value"}),queries:ts,aliases:t.Optional(fi),backgroundMode:t.Optional(t.Enum(mi,{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:le,normalizer:t.Optional(Tt),legendMode:t.Optional(Ce)},{$id:"InputGraphVisualizationQueryValuePromql",title:"QueryValuePromql"}),p2=t.Object({type:t.Literal("top-list-promql",{description:"Displays PromQL metrics query-based aggregation as a ranked top list"}),queries:es,aliases:t.Optional(di),normalizer:t.Optional(ht),precision:le,conditions:t.Optional(t.Array(mr,{description:"Conditional formatting rules applied to the displayed value"}))},{$id:"GraphVisualizationTopListPromql",title:"TopListPromql"}),u2=t.Object({type:t.Literal("top-list-promql",{description:"Displays PromQL metrics query-based aggregation as a ranked top list"}),queries:ts,aliases:t.Optional(fi),normalizer:t.Optional(Tt),precision:le,conditions:t.Optional(t.Array(mr,{description:"Conditional formatting rules applied to the displayed value"}))},{$id:"InputGraphVisualizationTopListPromql",title:"TopListPromql"}),l2=t.Object({type:t.Literal("pie-promql",{description:"Displays PromQL metrics query-based aggregation as a pie chart"}),queries:es,aliases:t.Optional(di),normalizer:t.Optional(ht),precision:le,legendMode:t.Optional(Ce)},{$id:"GraphVisualizationPiePromql",title:"PiePromql"}),m2=t.Object({type:t.Literal("pie-promql",{description:"Displays PromQL metrics query-based aggregation as a pie chart"}),queries:ts,aliases:t.Optional(fi),normalizer:t.Optional(Tt),precision:le,legendMode:t.Optional(Ce)},{$id:"InputGraphVisualizationPiePromql",title:"PiePromql"}),d2=t.Object({type:t.Literal("bar-promql",{description:"Displays PromQL metrics query-based aggregation as a bar chart"}),queries:es,aliases:t.Optional(di),timeBucket:t.Optional(hn),precision:le,normalizer:t.Optional(ht),thresholds:jt,legendMode:t.Optional(Ce),yAxisSettings:t.Optional(hi)},{$id:"GraphVisualizationBarPromql",title:"BarPromql"}),f2=t.Object({type:t.Literal("bar-promql",{description:"Displays PromQL metrics query-based aggregation as a bar chart"}),queries:ts,aliases:t.Optional(fi),timeBucket:t.Optional(hn),precision:le,normalizer:t.Optional(Tt),thresholds:jt,legendMode:t.Optional(Ce),yAxisSettings:t.Optional(Ti)},{$id:"InputGraphVisualizationBarPromql",title:"BarPromql"}),g2=t.Object({type:t.Literal("timeseries",{description:"Displays the aggregation as a time series chart"}),...gi,timeBucket:t.Optional(hn),normalizer:t.Optional(ht),precision:le,legendMode:t.Optional(Ce),thresholds:jt,yAxisSettings:t.Optional(hi),smoothing:t.Optional(t.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"}))},{$id:"GraphVisualizationTimeseries",title:"Timeseries"}),y2=t.Object({type:t.Literal("timeseries",{description:"Displays the aggregation as a time series chart"}),...yi,timeBucket:t.Optional(hn),normalizer:t.Optional(Tt),precision:le,legendMode:t.Optional(Ce),thresholds:jt,yAxisSettings:t.Optional(Ti),smoothing:t.Optional(t.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"}))},{$id:"InputGraphVisualizationTimeseries",title:"Timeseries"}),h2=t.Object({type:t.Literal("top-list",{description:"Displays the aggregation as a ranked list of top results"}),...gi,normalizer:t.Optional(ht),precision:le,conditions:t.Optional(t.Array(mr,{description:"Conditional formatting rules applied to the displayed value"}))},{$id:"GraphVisualizationTopList",title:"TopList"}),T2=t.Object({type:t.Literal("top-list",{description:"Displays the aggregation as a ranked list of top results"}),...yi,normalizer:t.Optional(Tt),precision:le,conditions:t.Optional(t.Array(mr,{description:"Conditional formatting rules applied to the displayed value"}))},{$id:"InputGraphVisualizationTopList",title:"TopList"}),E2=t.Object({type:t.Literal("pie",{description:"Displays the aggregation as a pie chart"}),...gi,normalizer:t.Optional(ht),precision:le,legendMode:t.Optional(Ce)},{$id:"GraphVisualizationPie",title:"Pie"}),_2=t.Object({type:t.Literal("pie",{description:"Displays the aggregation as a pie chart"}),...yi,normalizer:t.Optional(Tt),precision:le,legendMode:t.Optional(Ce)},{$id:"InputGraphVisualizationPie",title:"Pie"}),I2=t.Object({type:t.Literal("query-value",{description:"Displays the aggregation as a single value"}),...Sp,backgroundMode:t.Optional(t.Enum(mi,{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:le,normalizer:t.Optional(ht),legendMode:t.Optional(Ce)},{$id:"GraphVisualizationQueryValue",title:"QueryValue"}),b2=t.Object({type:t.Literal("query-value",{description:"Displays the aggregation as a single value"}),...Op,backgroundMode:t.Optional(t.Enum(mi,{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:le,normalizer:t.Optional(Tt),legendMode:t.Optional(Ce)},{$id:"InputGraphVisualizationQueryValue",title:"QueryValue"}),S2=t.Object({type:t.Literal("bar",{description:"Displays the aggregation as a bar chart"}),...gi,timeBucket:t.Optional(hn),precision:le,normalizer:t.Optional(ht),thresholds:jt,legendMode:t.Optional(Ce),yAxisSettings:t.Optional(hi)},{$id:"GraphVisualizationBar",title:"Bar"}),O2=t.Object({type:t.Literal("bar",{description:"Displays the aggregation as a bar chart"}),...yi,timeBucket:t.Optional(hn),precision:le,normalizer:t.Optional(Tt),thresholds:jt,legendMode:t.Optional(Ce),yAxisSettings:t.Optional(Ti)},{$id:"InputGraphVisualizationBar",title:"Bar"}),A2=t.Object({type:t.Literal("distribution",{description:"Displays the aggregation as a distribution chart"}),...gi,precision:le,normalizer:t.Optional(ht),percentileMarkers:t.Optional(qH),boundsScale:t.Optional(Zc)},{$id:"GraphVisualizationDistribution",title:"Distribution"}),x2=t.Object({type:t.Literal("distribution",{description:"Displays the aggregation as a distribution chart"}),...yi,precision:le,normalizer:t.Optional(Tt),percentileMarkers:t.Optional(BH),boundsScale:t.Optional(Zc)},{$id:"InputGraphVisualizationDistribution",title:"Distribution"}),WC=["red","pink","violet","blue","cyan","green","yellow","orange"],ZC=t.Enum(WC,{description:"Color palette used to render the heatmap intensity gradient"}),R2=t.Object({type:t.Literal("heatmap",{description:"Displays the aggregation as a heatmap chart"}),...gi,precision:le,normalizer:t.Optional(ht),palette:t.Optional(ZC)},{$id:"GraphVisualizationHeatmap",title:"Heatmap"}),C2=t.Object({type:t.Literal("heatmap",{description:"Displays the aggregation as a heatmap chart"}),...yi,precision:le,normalizer:t.Optional(Tt),palette:t.Optional(ZC)},{$id:"InputGraphVisualizationHeatmap",title:"Heatmap"}),XC=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(WC,{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."}),P2=t.Object({type:t.Literal("gauge",{description:"Displays the aggregation as a gauge"}),...Sp,max:t.Optional(t.Number({description:"Gauge maximum value"})),colorThresholds:t.Optional(t.Array(XC,{description:"Color thresholds inside the gauge range"})),precision:le,normalizer:t.Optional(ht)},{$id:"GraphVisualizationGauge",title:"Gauge"}),U2=t.Object({type:t.Literal("gauge",{description:"Displays the aggregation as a gauge"}),...Op,max:t.Optional(t.Number({description:"Gauge maximum value"})),colorThresholds:t.Optional(t.Array(XC,{description:"Color thresholds inside the gauge range"})),precision:le,normalizer:t.Optional(Tt)},{$id:"InputGraphVisualizationGauge",title:"Gauge"}),w2=t.Object({type:t.Literal("table",{description:"Displays the aggregation as a table with multi-level grouping"}),columns:t.Array(kH,{description:"Each column defines an independent aggregation displayed as a table column"}),groupBy:t.Optional(Yo),defaultSorting:t.Optional(DH),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"}),N2=t.Object({type:t.Literal("table",{description:"Displays the aggregation as a table with multi-level grouping"}),columns:t.Array(MH,{minItems:1,description:"Each column defines an independent aggregation displayed as a table column"}),groupBy:t.Optional(Sr),defaultSorting:t.Optional(GH),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"}),L2=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($C,{description:"Background color used to render the note"})),noteAlign:t.Optional(yn),noteJustifyContent:t.Optional(yn)},{$id:"GraphVisualizationNote",title:"Note"}),v2=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($C,{description:"Background color used to render the note"})),noteAlign:t.Optional(yn),noteJustifyContent:t.Optional(yn)},{$id:"InputGraphVisualizationNote",title:"Note"}),k2=b("type",[FH,KH,YH,QH,ZH,JH,i2,s2,p2,l2,d2,g2,h2,E2,I2,P2,S2,A2,R2,w2,$H,L2,t2,n2],{description:"Widget visualization configuration. The `type` discriminator selects the widget kind and its required fields."}),M2=b("type",[HH,zH,VH,WH,XH,e2,a2,c2,u2,m2,f2,y2,T2,_2,b2,U2,O2,x2,C2,N2,jH,v2,r2,o2],{description:"Widget visualization configuration. The `type` discriminator selects the widget kind and its required fields."}),Ap=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(yn),descriptionJustifyContent:t.Optional(yn),visualization:k2,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."}),xp=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(yn),descriptionJustifyContent:t.Optional(yn),visualization:M2,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."}),GC=10,D2=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."}),G2=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:GC,description:`Dashboard-wide filters applied to every widget on the dashboard. Up to ${GC} filters are allowed.`}),Ei=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(Ap,{description:"Ordered widgets that compose the dashboard"}),filters:t.Optional(D2),createdAt:E({description:"Timestamp when Tsuga created the dashboard."}),updatedAt:E({description:"Timestamp when Tsuga last updated the dashboard."}),creator:t.Optional(ue),updater:t.Optional(ue),tags:Me,timePreset:t.Optional(t.Enum(nu,{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."}))}),Rp=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(xp,{description:"Ordered widgets that compose the dashboard"}),filters:t.Optional(G2),tags:Ve,timePreset:t.Optional(t.Enum(nu,{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"},JC=[Wt.OWNER,Wt.TAGS,Wt.WIDGET_COUNT,Wt.UPDATED_AT,Wt.NAME],Cp=t.Partial(t.Object({owners:Be(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:Be(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"})),$2=t.Partial(t.Object({...ye,filters:Cp,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"})})),z4e=m({tags:["dashboards"],url:`${Lr}/query`,method:"POST",paginated:!0,response:t.Array(Ei),body:$2}),Y4e=m({tags:["dashboards"],url:`${Lr}/tags/query`,method:"POST",body:t.Object({filters:t.Optional(t.Omit(Cp,["tags"]))}),response:Yt}),V4e=m({tags:["dashboards"],url:`${Lr}/:id`,method:"GET",params:t.Object({id:p()}),response:Ei}),Q4e=m({tags:["dashboards"],url:Lr,method:"POST",body:Rp,response:Ei}),W4e=m({tags:["dashboards"],url:`${Lr}/:id`,method:"PUT",params:t.Object({id:p()}),body:t.Partial(Rp),response:Ei}),Z4e=m({tags:["dashboards"],url:`${Lr}/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({})}),X4e=m({tags:["dashboards"],url:`${Lr}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),J4e=m({tags:["dashboards"],url:`${Lr}/:id/graphs/:graphId`,method:"PUT",params:t.Object({id:p({allowEmpty:!1}),graphId:p({allowEmpty:!1})}),body:t.Omit(xp,["id"]),response:Ap}),eYe=m({tags:["dashboards"],url:`${Lr}/bulk-delete`,method:"DELETE",body:t.Object({ids:t.Array(p())}),response:t.Object({})});var _i=`/${"v1"}/dashboards`,rs=t.Pick(Ei,["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)."}),j2={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(rs,{examples:[j2]});var q2=t.Object({by:t.Enum([...JC],{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"}),eP=t.Object({...ze,filters:t.Optional(t.Pick(Cp,["owners","searchQuery","tags","folderId"])),sort:t.Optional(q2)},{description:"Dashboard query request. Use filters, sorting, limit, and offset to page through visible dashboards."}),B2={filters:{owners:{values:["team-123-abc"]},searchQuery:{value:"API"},tags:{values:[{key:"service",value:"api-gateway"}]},folderId:"folder-123-abc"},sort:{by:"name",direction:"asc"},limit:10,offset:0};Object.assign(eP,{examples:[B2]});var tP=m({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:`${_i}/query`,method:"POST",paginated:!0,body:eP,response:t.Array(rs)}),rP=m({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:`${_i}/: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:rs}),Bd=t.Pick(Rp,["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."}),F2={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:[F2]});var H2=t.Omit(xp,["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."}),nP=m({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:_i,method:"POST",body:Bd,response:rs}),oP=m({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:`${_i}/: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:rs}),K2=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."})}),iP=m({description:"Deletes a dashboard by ID. Use only after confirming no users or automation still rely on the dashboard.",operationId:"deleteDashboard",tags:["dashboards"],url:`${_i}/:id`,method:"DELETE",params:K2,response:R}),cYe=m({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:`${_i}/: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:H2,response:Ap});var aP=100,sP=3,Ii=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:E({description:"Timestamp when Tsuga last updated the key metadata."}),createdAt:E({description:"Timestamp when Tsuga created the key."}),creator:t.Optional(ue),updater:t.Optional(ue),assetUpdatedAt:E({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})}),ns=t.Object({name:t.String({format:$o,minLength:1,maxLength:aP,description:`Kebab-case name for the ingestion API key. Maximum length is ${aP} 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:sP,description:`Array form. Up to ${sP} 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."})}),os="/v0/ingestion-api-keys",hYe=m({tags:["ingestion-api-keys"],url:os,method:"POST",body:ns,response:t.Intersect([Ii,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."})})])}),TYe=m({tags:["ingestion-api-keys"],url:os,method:"GET",paginated:!0,query:t.Object(ye),response:t.Array(Ii)}),EYe=m({tags:["ingestion-api-keys"],url:`${os}/:id`,method:"GET",params:t.Object({id:p({allowEmpty:!1})}),response:Ii}),_Ye=m({tags:["ingestion-api-keys"],url:`${os}/:id`,method:"PUT",params:t.Object({id:p({allowEmpty:!1})}),body:ns,response:Ii}),IYe=m({tags:["ingestion-api-keys"],url:`${os}/:id`,method:"DELETE",params:t.Object({id:p({allowEmpty:!1})}),response:R});var is=`/${"v1"}/ingestion-api-keys`,as=t.Pick(Ii,["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)."}),cP={id:"123-456-abc",name:"production-logs-ingestion",keyLastCharacters:"x7Qm",owner:"team-123-abc",tags:[{key:"env",value:"production"}],teamOverrideFields:["service"]};Object.assign(as,{examples:[cP]});var pP=t.Pick(ns,["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."}),uP=t.Pick(ns,["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."}),lP={name:"production-logs-ingestion",owner:"team-123-abc",tags:[{key:"env",value:"production"}],teamOverrideFields:["service"]};Object.assign(pP,{examples:[lP]});Object.assign(uP,{examples:[lP]});var z2={...cP,key:"tsuga_in:v1:abc123xyx7Qm"},mP=m({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:is,method:"GET",paginated:!0,query:t.Object(ze),response:t.Array(as)}),PYe=m({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:`${is}/: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:as}),Y2=t.Intersect([t.Pick(as,["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:z2}),dP=m({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:is,method:"POST",body:pP,response:Y2}),fP=m({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:`${is}/: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:uP,response:as}),gP=m({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:`${is}/: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 V2={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"]}},[LYe,Kd,ss]=Q2(V2);function Q2(e){let r=[],n=[],o=[],i=Object.keys(e);for(let a of i){r.push(a);let c=e[a];for(let l in c){n.push(l);let d=c[l];Array.isArray(d)&&o.push(...d)}}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"]),W2=t.Object({versioningStatus:t.Optional(t.Enum(["Enabled","Disabled","Suspended","Not configured"]))}),Z2=t.Object({domainName:t.Optional(t.String()),origins:t.Optional(t.Array(t.String()))}),X2=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())}),J2=t.Object({version:t.Optional(t.String()),virtualNetworkId:t.Optional(t.String()),subnets:t.Optional(t.Array(t.String()))}),eK=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())}),tK=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()))}),rK=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(E())}),nK=t.Object({isEncrypted:t.Optional(t.Boolean()),ownerId:t.Optional(t.String()),state:t.Optional(t.Enum(["creating","available","deleting","deleted","error","updating"]))}),oK=t.Object({type:t.Optional(t.String()),osType:t.Optional(t.String()),subnetIds:t.Optional(t.Array(t.String())),nbContainers:t.Optional(t.Number())}),iK=t.Object({digest:t.String(),imageTags:t.Array(t.String()),imageSizeBytes:t.Optional(t.Number()),imagePushedAt:t.Optional(E()),mediaType:t.Optional(t.String()),repositoryName:t.String(),repositoryId:t.Optional(t.String()),scanStatus:t.Optional(t.String())}),aK=t.Object({url:t.Optional(t.String()),maxMessageSizeBytes:t.Optional(t.Number()),messageRetentionHours:t.Optional(t.Number())}),sK=t.Object({runtime:t.Optional(t.String()),memoryAllocationMib:t.Optional(t.Number()),timeoutMs:t.Optional(t.Number()),codeSha256:t.Optional(t.String())}),cK=t.Object({kind:t.Optional(t.String())}),pK=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())}),uK=t.Object({id:t.Optional(t.String()),ipCidrBlocks:t.Array(t.String())}),lK=t.Object({protocol:t.Optional(Hd),port:t.Optional(t.Number()),instanceProtocol:t.Optional(Hd),instancePort:t.Optional(t.Number())}),mK=t.Object({protocol:t.Optional(t.String()),ports:t.Optional(t.Array(t.String())),portRange:t.Optional(t.String()),allPorts:t.Optional(t.Boolean())}),dK=t.Object({name:t.String(),ip:t.Optional(t.String()),type:t.Enum(["public","private"])}),fK=t.Object({type:t.String(),name:t.String()}),gK=t.Object({frontendIp:t.Optional(dK),backendIpPools:t.Array(fK)}),yK=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())}),hK=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(yK)),targetCount:t.Optional(t.Number()),healthyTargetCount:t.Optional(t.Number()),loadBalancerArns:t.Optional(t.Array(t.String()))}),TK=t.Object({first:t.Optional(t.String()),last:t.Optional(t.String()),scope:t.Optional(t.Number())}),EK=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(),TK]))),target:t.Optional(t.String()),weight:t.Optional(t.Number()),priority:t.Optional(t.Number()),status:t.Optional(t.String())}),_K=t.Object({instanceId:t.Optional(t.String()),state:t.Optional(t.String()),reasonCode:t.Optional(t.String()),description:t.Optional(t.String())}),IK=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(lK),t.Array(mK)])),targets:t.Optional(t.Union([t.Array(t.String()),t.Array(_K),t.Array(EK)])),azureLoadBalancingRules:t.Optional(t.Array(gK))}),bK=t.Object({domainName:t.Optional(t.String()),expiresAt:t.Optional(E()),inUseBy:t.Optional(t.Array(t.String())),renewalEligibility:t.Optional(t.String()),revokedAt:t.Optional(E()),status:t.Optional(t.String()),type:t.Optional(t.String())}),SK=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"]))}),OK=t.Object({osType:t.Optional(t.Enum(["Windows","Linux"]))}),AK=t.Object({state:t.Optional(t.String()),volumeType:t.Optional(t.String())}),xK=t.Intersect([t.Object({isEncrypted:t.Optional(t.Boolean()),sizeGib:t.Optional(t.Number())}),t.Union([SK,AK,OK])]),RK=t.Object({instanceCount:t.Optional(t.Number()),hostnames:t.Optional(t.Array(t.String())),runtime:t.Optional(t.String())}),Pp=t.Union([t.Object({category:t.Literal("application"),resourceType:t.Literal("webService"),attributes:t.Optional(RK)}),t.Object({category:t.Literal("data"),resourceType:t.Literal("bucket"),attributes:t.Optional(W2)}),t.Object({category:t.Literal("data"),resourceType:t.Literal("messagingService"),attributes:t.Optional(aK)}),t.Object({category:t.Literal("data"),resourceType:t.Literal("fileSystem"),attributes:t.Optional(nK)}),t.Object({category:t.Literal("data"),resourceType:t.Literal("contentDeliveryNetwork"),attributes:t.Optional(Z2)}),t.Object({category:t.Literal("data"),resourceType:t.Literal("database"),attributes:t.Optional(X2)}),t.Object({category:t.Literal("data"),resourceType:t.Literal("storageAccount"),attributes:t.Optional(cK)}),t.Object({category:t.Literal("data"),resourceType:t.Literal("volume"),attributes:t.Optional(xK)}),t.Object({category:t.Literal("compute"),resourceType:t.Literal("virtualMachine"),attributes:t.Optional(pK)}),t.Object({category:t.Literal("compute"),resourceType:t.Literal("serverless"),attributes:t.Optional(sK)}),t.Object({category:t.Literal("container"),resourceType:t.Literal("kubernetesCluster"),attributes:t.Optional(J2)}),t.Object({category:t.Literal("container"),resourceType:t.Literal("containerRepository"),attributes:t.Optional(eK)}),t.Object({category:t.Literal("container"),resourceType:t.Literal("containerCluster"),attributes:t.Optional(tK)}),t.Object({category:t.Literal("container"),resourceType:t.Literal("containerServiceTask"),attributes:t.Optional(rK)}),t.Object({category:t.Literal("container"),resourceType:t.Literal("containerService"),attributes:t.Optional(oK)}),t.Object({category:t.Literal("container"),resourceType:t.Literal("containerImage"),attributes:t.Optional(iK)}),t.Object({category:t.Literal("network"),resourceType:t.Literal("virtualNetwork"),attributes:t.Optional(uK)}),t.Object({category:t.Literal("network"),resourceType:t.Literal("loadBalancer"),attributes:IK}),t.Object({category:t.Literal("network"),resourceType:t.Literal("targetGroup"),attributes:t.Optional(hK)}),t.Object({category:t.Literal("network"),resourceType:t.Literal("certificate"),attributes:t.Optional(bK)})],{description:"Normalized public inventory category, resource type, and category-specific attributes. Attribute shape depends on the category and resourceType combination."});var ao="/v0/inventory",cs=["aws","gcp","azure"],yP=["scan_in_progress","success","failure","partial"],Yd=t.Object({id:t.String({description:"Identifier of the inventory resource. Generated by Tsuga."}),cloudPlatform:t.Enum(cs,{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(E({description:"Timestamp when the resource was created in the cloud, when known."})),resourceUpdatedAt:t.Optional(E({description:"Timestamp when the resource was last updated in the cloud, when known."})),resourceLastSeenAt:E({description:"Timestamp when Tsuga last observed this resource during an inventory scan."}),tags:Me,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"}))}),bi={DISPLAY_NAME:"displayName",CLOUD_ACCOUNT:"cloudAccount",NATIVE_RESOURCE_TYPE:"nativeResourceType",CLOUD_REGION:"cloudRegion",RESOURCE_TYPE:"resourceType",RESOURCE_CREATED_AT:"resourceCreatedAt"},hP=t.Object({cloudPlatforms:Be(t.Enum(cs),{description:"Restrict results to resources discovered on any of these cloud platforms",maxItems:cs.length}),cloudAccounts:Be(p({allowEmpty:!1}),{description:"Restrict results to resources in any of these cloud accounts",maxItems:500}),cloudRegions:Be(p({allowEmpty:!1}),{description:"Restrict results to resources in any of these cloud regions",maxItems:500}),nativeResourceTypes:Be(t.Enum(ss),{description:"Restrict results to resources of any of these cloud-native resource types",maxItems:ss.length}),resourceTypes:Be(t.Enum(Kd),{description:"Restrict results to resources of any of these normalized resource types",maxItems:Kd.length}),tags:Be(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"}),Vd=t.Partial(t.Object({...ye,filters:t.Partial(hP,{description:"Filters applied to narrow the returned resources."}),sort:t.Object({by:t.Enum([bi.DISPLAY_NAME,bi.CLOUD_ACCOUNT,bi.NATIVE_RESOURCE_TYPE,bi.CLOUD_REGION,bi.RESOURCE_TYPE,bi.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."})})),qYe=m({tags:["inventory"],method:"POST",url:`${ao}/resources/query`,paginated:!0,body:Vd,response:t.Array(t.Intersect([Yd,Pp]))}),CK=["resourceType","cloudAccount","isIacManaged"],BYe=m({tags:["inventory"],method:"POST",url:`${ao}/resources/counts`,body:t.Object({filters:t.Optional(t.Partial(hP)),groupBy:t.Enum(CK,{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."})}))}),FYe=m({tags:["inventory"],method:"GET",url:`${ao}/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})}),HYe=b("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."})})]),PK="^[0-9]{12}$",UK="^arn:aws[a-z-]*:iam::[0-9]{12}:role/.+$",wK="^[a-z][a-z0-9-]{4,28}[a-z0-9]$",NK="^[^@\\s]+@[^@\\s]+\\.iam\\.gserviceaccount\\.com$",LK="^//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}$",vK=t.Object({type:t.Literal("aws",{description:"Discriminator identifying AWS connection settings."}),accountId:t.String({pattern:PK,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:UK,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"}),kK=t.Object({type:t.Literal("gcp",{description:"Discriminator identifying GCP connection settings."}),projectId:t.String({pattern:wK,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:NK,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:LK,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"}),MK=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"}),TP=b("type",[vK,kK,MK],{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`."}),Si=t.Object({id:t.String({description:"Identifier of the cloud account. Generated by Tsuga."}),cloudType:t.Enum(cs,{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:E({description:"Timestamp when the account was registered in Tsuga."}),lastScanStartedAt:t.Optional(E({description:"Timestamp when the most recent inventory scan started."})),lastScanFinishedAt:t.Optional(E({description:"Timestamp when the most recent inventory scan finished."})),lastScanStatus:t.Optional(t.Enum(yP,{description:"Status of the most recent inventory scan."}))}),Qd=t.Object({cloudType:t.Enum(cs,{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:TP,lastScanStatus:t.Optional(t.Enum(yP,{description:"Status of the most recent inventory scan."}))}),so=`${ao}/cloud-accounts`,KYe=m({tags:["inventory"],url:so,method:"GET",response:t.Array(Si)}),zYe=m({tags:["inventory"],url:`${so}/:id`,method:"GET",params:t.Object({id:p()}),response:Si}),YYe=m({tags:["inventory"],url:so,method:"POST",body:Qd,response:Si}),Wd=t.Object({accountFriendlyName:p({description:"Human-readable name for the account shown in Tsuga."})}),VYe=m({tags:["inventory"],url:`${so}/:id`,method:"PUT",params:t.Object({id:p()}),body:Wd,response:Si}),QYe=m({tags:["inventory"],url:`${so}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),WYe=m({tags:["inventory"],url:`${ao}/trigger-scan`,method:"POST",body:t.Object({}),response:t.Object({success:t.Literal(!0)})}),ZYe=m({tags:["inventory"],url:`${so}/azure/onboarding`,method:"POST",body:t.Object({tenantId:p()}),response:t.Object({subjectId:t.String(),audience:t.String()})}),XYe=m({tags:["inventory"],method:"POST",url:`${so}/validate/:type`,params:t.Object({type:p()}),body:t.Object({data:TP,id:t.Optional(p())}),response:t.Object({areAccountSettingsValid:t.Boolean(),message:t.Optional(t.String())})}),EP=`${ao}/settings`,JYe=m({tags:["inventory"],url:EP,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())}))}))})}),DK=50,eVe=m({tags:["inventory"],url:EP,method:"POST",body:t.Object({infrastructureIdentifiers:t.Array(t.Object({name:p({allowEmpty:!1}),value:t.Optional(p({allowEmpty:!1}))}),{maxItems:DK})}),response:t.Object({})}),tVe=m({tags:["inventory"],url:`${ao}/iac-tags-proposal`,method:"GET",response:t.Array(t.Object({name:t.String(),value:t.Optional(t.String())}))});var _P=`/${"v1"}/inventory`,GK=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)."}),IP=t.Intersect([GK,Pp],{$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)."}),$K={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(IP,{examples:[$K]});var bP=t.Object({...Vd.properties,...ze},{description:"Inventory resource query request. Use filters, sorting, limit, and offset to page through discovered resources."}),jK={filters:{cloudPlatforms:{values:["aws"]},cloudAccounts:{values:["123456789012"]},cloudRegions:{values:["us-east-1"]},resourceTypes:{values:["bucket"]},nativeResourceTypes:{values:["aws_s3_bucket"]},tags:{values:[{key:"team",value:"platform"}]},isIacManaged:!0,searchQuery:{value:"tsuga-example"}},sort:{by:"displayName",direction:"asc"},limit:10,offset:0};Object.assign(bP,{examples:[jK]});var SP=m({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:`${_P}/resources/query`,method:"POST",paginated:!0,body:bP,response:t.Array(IP)}),ps=`${_P}/cloud-accounts`,us=t.Pick(Si,["id","cloudType","cloudAccountId","accountFriendlyName"],{$id:"CloudAccount"}),qK={id:"123-456-abc",cloudType:"aws",cloudAccountId:"123456789012",accountFriendlyName:"Production AWS"};Object.assign(us,{examples:[qK]});var OP=t.Pick(Qd,["cloudType","cloudAccountId","accountFriendlyName","connectionSettings"]),BK={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(OP,{examples:[BK]});var FK=t.Pick(Wd,["accountFriendlyName"]),uVe=m({description:"Lists cloud accounts connected to Tsuga that the authenticated operation key can read.",operationId:"listCloudAccounts",tags:["inventory"],url:ps,method:"GET",response:t.Array(us)}),lVe=m({description:"Retrieves one cloud account by ID.",operationId:"getCloudAccount",tags:["inventory"],url:`${ps}/: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:us}),mVe=m({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:ps,method:"POST",body:OP,response:us}),dVe=m({description:"Updates the friendly name of a cloud account by ID.",operationId:"updateCloudAccount",tags:["inventory"],url:`${ps}/: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:FK,response:us}),fVe=m({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:`${ps}/: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 ls="/v0/investigations",HK=["dashboard","monitor","service","slo","log-route"],KK=t.Object({type:t.String({description:'Kind of linked asset, e.g. "dashboard"'}),id:t.String({description:"Identifier of the linked asset"})}),zK=t.Object({type:t.Enum(HK,{description:"Kind of linked asset"}),id:p({allowEmpty:!1,description:"Identifier of the linked asset"})}),vr=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:Me,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(KK,{description:"Assets (dashboards, monitors, \u2026) referenced by this investigation"}),creator:t.Optional(ue),updater:t.Optional(ue),createdAt:E({description:"Timestamp the investigation was created at."}),updatedAt:E({description:"Timestamp the investigation was last updated at."})},{title:"Investigation"}),Up=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(zK,{maxItems:100,description:"Assets (dashboards, monitors, \u2026) referenced by this investigation"}))}),Zd=t.Object(t.Omit(Up,["slug"]).properties),bVe=m({tags:["investigations"],url:ls,method:"GET",paginated:!0,query:t.Object(ye),response:t.Array(vr)}),SVe=m({tags:["investigations"],url:`${ls}/:id`,params:t.Object({id:p()}),method:"GET",response:vr}),OVe=m({tags:["investigations"],url:ls,method:"POST",body:Up,response:vr}),AVe=m({tags:["investigations"],url:`${ls}/:id`,method:"PUT",body:Zd,params:t.Object({id:p()}),response:vr}),xVe=m({tags:["investigations"],url:`${ls}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R});var ms=`/${"v1"}/investigations`,AP=m({description:"Retrieve all investigations",tags:["private"],url:ms,method:"GET",paginated:!0,query:t.Object(ze),response:t.Array(vr)}),xP=m({description:"Retrieve an investigation by its id",tags:["private"],url:`${ms}/:id`,method:"GET",params:t.Object({id:p({allowEmpty:!1})}),response:vr}),RP=m({description:"Create a new investigation",tags:["private"],url:ms,method:"POST",body:Up,response:vr}),CP=m({description:"Update an investigation by its id",tags:["private"],url:`${ms}/:id`,method:"PUT",body:Zd,params:t.Object({id:p({allowEmpty:!1})}),response:vr}),PP=m({description:"Delete an investigation by its id",tags:["private"],url:`${ms}/:id`,method:"DELETE",params:t.Object({id:p({allowEmpty:!1})}),response:R});var UP=15,wp={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:Me,updatedAt:t.Optional(E({description:"Timestamp when Tsuga last updated the processor."}))},Np={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(E({description:"Backend-maintained timestamp for this processor. Omit this field on create and update requests; Tsuga sets or preserves it based on processor changes."}))},wP={...wp,type:t.Literal("creator",{description:"Create processor. It writes a new attribute from a format string, formula, or category rule."})},NP={...Np,type:t.Literal("creator",{description:"Create processor. It writes a new attribute from a format string, formula, or category rule."})},YK=b("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."}),VK=b("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:UP,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."}),QK=t.Object({...wP,params:YK}),WK=t.Object({...NP,params:VK}),LP={...wp,type:t.Literal("mapper",{description:"Map processor. It moves, copies, or normalizes existing log attributes."})},vP={...Np,type:t.Literal("mapper",{description:"Map processor. It moves, copies, or normalizes existing log attributes."})},ZK=b("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."}),XK=b("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."}),JK=t.Object({...vP,params:XK}),ez=t.Object({...LP,params:ZK}),kP={...wp,type:t.Literal("parse-attribute",{description:"Parse processor. It extracts structured fields from a text attribute."})},MP={...Np,type:t.Literal("parse-attribute",{description:"Parse processor. It extracts structured fields from a text attribute."})},DP=5,tz=b("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."}),rz=b("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:DP,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."}),nz=t.Object({...kP,params:tz}),oz=t.Object({...MP,params:rz}),iz=t.Object({...NP,params:b("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:UP,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")})])}),az=t.Object({...vP,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")})}),sz=t.Object({...MP,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:DP,description:"Example log lines for validating the Grok rules."})),subtype:t.Literal("grok")})}),$Ve=b("type",[az,sz,iz]),cz=t.Object({...wP,params:b("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")})])}),pz=t.Object({...LP,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")})}),uz=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=b("type",[pz,uz,cz]),lz=11,GP=t.Cyclic({OutputProcessor:t.Union([ez,nz,QK,t.Object({...wp,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"}),$P=t.Cyclic({InputProcessor:t.Union([JK,oz,WK,t.Object({...Np,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:lz,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 mz="/v0/logs",Tn=`${mz}/routes`,En=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:Me,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(GP,{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:E({description:"Timestamp when Tsuga last updated the route."}),createdAt:E({description:"Timestamp when Tsuga created the route."}),assetUpdatedAt:E({description:"Timestamp when Tsuga last changed route behavior. This can differ from `updatedAt` when only metadata such as `description` or `tags` changed."})},{title:"LogRoute"}),ds=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:Ve,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($P,{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=m({tags:["routes"],url:Tn,method:"GET",paginated:!0,query:t.Object(ye),response:t.Array(En)}),WVe=m({tags:["routes"],url:`${Tn}/:id`,params:t.Object({id:p()}),method:"GET",response:En}),ZVe=m({tags:["routes"],url:Tn,method:"POST",body:ds,response:En}),XVe=m({tags:["routes"],url:`${Tn}/:id`,method:"PUT",body:ds,params:t.Object({id:p()}),response:En}),JVe=m({tags:["routes"],url:`${Tn}/:id/clone`,method:"POST",params:t.Object({id:p()}),body:ds,response:En}),e5e=m({tags:["routes"],url:`${Tn}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),t5e=m({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:`${Tn}/: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=m({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:`${Tn}/: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:En});var fs=`/${"v1"}/routes`,jP={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}"]}}]},qP={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}}]},gs=t.Pick(En,["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)."}),dz={id:"123-456-abc",...jP},fz={id:"456-789-def",...qP};Object.assign(gs,{examples:[dz,fz]});var BP=m({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:fs,method:"GET",paginated:!0,query:t.Object(ze),response:t.Array(gs)}),FP=m({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:`${fs}/: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:gs}),Xd=t.Pick(ds,["name","description","isEnabled","query","tags","owner","processors"],{description:"Log route create or update request. Provide the route metadata, source query, owner team, enabled state, tags, and ordered processors."});Object.assign(Xd,{examples:[jP,qP]});var HP=m({description:"Creates a log route at the end of the evaluation order. Routes affect only newly ingested logs after the cluster receives the updated configuration.",operationId:"createRoute",tags:["routes"],url:fs,method:"POST",body:Xd,response:gs}),KP=m({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:`${fs}/:id`,method:"PUT",body:Xd,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:gs}),zP=m({description:"Deletes a log route by ID and compacts the evaluation order for remaining routes. The route stops processing future logs after the cluster receives the updated configuration.",operationId:"deleteRoute",tags:["routes"],url:`${fs}/:id`,method:"DELETE",params: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 ys=`/${"v1"}/monitors`,hs=t.Pick(Or,["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)."}),VP={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:[]},QP={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:[]},WP={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:[]},ZP={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:[]},gz={id:"123-456-abc",...VP},yz={id:"234-567-bcd",...QP},hz={id:"345-678-cde",...WP},Tz={id:"456-789-def",...ZP};Object.assign(hs,{examples:[gz,yz,hz,Tz]});var YP=t.Pick(vl,["filters","sort","limit","offset"]),XP=t.Object({...YP.properties,...ze,filters:YP.properties.filters},{description:"Monitor query request. Use filters, sorting, limit, and offset to page through visible monitors."}),Ez={filters:{owners:{values:["team-123-abc"]},searchQuery:{value:"service:api-gateway"},tags:{values:[{key:"paging",value:"true"}]},priorities:{values:[4,5],exclude:!0},types:{values:["threshold"]},activity:"active",clusterIds:{values:["cluster-123-abc"]}},sort:{by:"name",direction:"asc"},limit:10,offset:0};Object.assign(XP,{examples:[Ez]});var JP=m({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:`${ys}/query`,method:"POST",paginated:!0,body:XP,response:t.Array(hs)}),eU=m({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:`${ys}/:id`,method:"GET",params:t.Object({id:p({allowEmpty:!1,description:"Monitor ID returned by monitor query, create, or update operations."})}),response:hs}),tU=["name","message","tags","configuration","priority","owner","dashboardId","permissions","clusterIds"],rU=t.Pick(wa,tU,{$id:"CreateMonitorRequest",description:"Monitor creation request. Provide ownership, data access, alert configuration, priority, tags, and optional dashboard or cluster scope."}),nU=t.Pick(wa,tU,{$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."}),oU=VP,iU=QP,aU=WP,sU=ZP;Object.assign(rU,{examples:[oU,iU,aU,sU]});Object.assign(nU,{examples:[oU,iU,aU,sU]});var cU=m({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:ys,method:"POST",body:rU,response:hs}),pU=m({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:`${ys}/: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:nU,response:hs}),_z=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."})}),uU=m({description:"Deletes a monitor by ID. Deleting a monitor stops future evaluations and alert transitions for that monitor.",operationId:"deleteMonitor",tags:["monitors"],url:`${ys}/:id`,method:"DELETE",params:_z,response:R});var Ts=`/${"v1"}/notification-rules`,Es=t.Pick(ei,["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)."}),lU={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"]}}]},Iz={id:"123-456-abc",...lU};Object.assign(Es,{examples:[Iz]});var mU=m({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:Ts,method:"GET",paginated:!0,query:t.Object(ze),response:t.Array(Es)}),dU=m({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:`${Ts}/: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:Es}),Jd=t.Pick(va,["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."}),bz=lU;Object.assign(Jd,{examples:[bz]});var fU=m({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:Ts,method:"POST",body:Jd,response:Es}),gU=m({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:`${Ts}/: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:Jd,response:Es}),Sz=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."})}),yU=m({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:`${Ts}/:id`,method:"DELETE",params:Sz,response:R});var Oi=`${Xo}/silences`,hU=t.Union([t.Literal("monday"),t.Literal("tuesday"),t.Literal("wednesday"),t.Literal("thursday"),t.Literal("friday"),t.Literal("saturday"),t.Literal("sunday")]),Oz=t.Partial(t.Record(hU,t.Array(t.Object({startTime:t.String({format:Vu,description:"Local start time for this recurring silence window on this day, using the schedule time zone."}),endTime:t.String({format:Vu,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`."}),Az=t.Partial(t.Record(hU,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`."}),Lp='IANA timezone identifier (e.g. "America/New_York"). Defaults to UTC if omitted.',TU="One-time silence schedule with specific start and end times",EU="Recurring weekly silence schedule",xz=b("type",[t.Object({type:t.Literal("one-time",{description:"Silence active once between the configured start and end times."}),startTime:t.String({format:Qu,description:"Local start date and time for the one-time silence, interpreted in `timeZone` when provided."}),endTime:t.String({format:Qu,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:Yu,description:Lp}))},{$id:"InputSilenceScheduleOneTime",description:TU}),t.Object({type:t.Literal("recurring",{description:"Silence active on a recurring weekly schedule."}),weeklySchedule:Oz,timeZone:t.Optional(t.String({format:Yu,description:Lp}))},{$id:"InputSilenceScheduleRecurring",description:EU})],{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."}),Rz=b("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:Lp}))},{$id:"OutputSilenceScheduleOneTime",description:TU}),t.Object({type:t.Literal("recurring",{description:"Silence active on a recurring weekly schedule."}),weeklySchedule:Az,timeZone:t.Optional(t.String({description:Lp}))},{$id:"OutputSilenceScheduleRecurring",description:EU})],{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."}),vp=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:xz,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:Fl,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(Hn),{maxItems:Hn.length,description:"Alert state transitions that must match for this silence to apply. An empty array matches every transition type."})}),Ai=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:Me,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:Rz,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:Bl,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(Hn),{description:"Alert state transitions that must match for this silence to apply. An empty array matches every transition type."}),createdAt:E(),updatedAt:E(),creator:t.Optional(ue),updater:t.Optional(ue)}),v5e=m({tags:["notification-silences"],url:Oi,method:"GET",response:t.Array(Ai)}),k5e=m({tags:["notification-silences"],url:`${Oi}/:id`,params:t.Object({id:p()}),method:"GET",response:Ai}),M5e=m({tags:["notification-silences"],url:Oi,method:"POST",body:vp,response:Ai}),D5e=m({tags:["notification-silences"],url:`${Oi}/:id`,method:"PUT",params:t.Object({id:p()}),body:vp,response:Ai}),G5e=m({tags:["notification-silences"],url:`${Oi}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),$5e=m({tags:["notification-silences"],url:`${Oi}/bulk-delete`,method:"DELETE",body:t.Object({ids:t.Array(p())}),response:t.Object({})});var _s=`/${"v1"}/notification-silences`,Is=t.Pick(Ai,["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)."}),Cz={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"]},Pz={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(Is,{examples:[Cz,Pz]});var _U=m({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:_s,method:"GET",response:t.Array(Is)}),IU=m({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:`${_s}/: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:Is}),ef=t.Pick(vp,["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."}),Uz={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"]},wz={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(ef,{examples:[Uz,wz]});var bU=m({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:_s,method:"POST",body:ef,response:Is}),SU=m({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:`${_s}/: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:ef,response:Is}),Nz=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."})}),OU=m({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:`${_s}/:id`,method:"DELETE",params:Nz,response:R});var Lz={critical:3,important:2,normal:1},oe=e=>({label:e,weight:Lz[e]}),vz={"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:`${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:oe("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: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:`${Ua} presence`,summary:`Logs and spans must populate ${Ua} with a non-empty value.`,rationale:"Core identifier used to correlate telemetry across services.",objectType:"resource",category:"telemetry-hygiene",impact:oe("important"),recommendation:`Populate ${Ua} 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 ${ZS} 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"}},kz=new Set(["azure_container_registry","azure_container_registry_image","azure_app_service_certificate","azure_virtual_network"]),Mz=ss.filter(e=>e.startsWith("azure_")&&!kz.has(e)),AU={"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:Mz,metricPrefixes:["azure_"]}},Dz=Object.fromEntries(Object.keys(AU).map(e=>{let{label:r,source:n}=AU[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"}]})),Gz={...vz,...Dz},xU=Object.values(Gz);var RU=["passed","failed","ignored"],$z=t.Enum(RU,{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."}),jz=["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"],rf=["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",...jz],qz=t.Enum(rf),Bz=["log","metric","resource","span","api-key","dashboard","monitor","route"],Fz=["collection-coverage","telemetry-hygiene","observability-assets","telemetry-adoption"],Hz=["critical","important","normal"],Kz=["team","global"],nf=t.Object({key:t.Enum(rf),title:t.String(),summary:t.String(),rationale:t.String(),objectType:t.Enum(Bz),category:t.Enum(Fz),impact:t.Object({label:t.Enum(Hz),weight:t.Number()}),recommendation:t.String(),scope:t.Optional(t.Enum(Kz))}),CU=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"})}),tf=t.Intersect([nf,t.Object({status:$z,normalizedScore:t.Number(),details:t.Optional(t.Record(t.String(),t.Unknown())),recommendation:t.Optional(t.String()),examples:t.Optional(t.Array(CU))})]),zz=t.Object({generatedAt:t.String(),overallScore:t.Optional(t.Number()),rules:t.Array(nf),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(tf)})),globalResults:t.Optional(t.Object({score:t.Optional(t.Number()),ruleResults:t.Array(tf)}))}),of=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(rf,{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(RU,{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(CU,{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=m({tags:["quality-reports"],url:"/v0/quality-reports",method:"POST",response:zz}),af=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=m({tags:["quality-reports"],url:"/v0/quality-reports/latest",method:"GET",query:t.Object({clusterId:af,team:t.Optional(p({allowEmpty:!1}))}),response:t.Array(of,{description:"Latest persisted rule evaluation rows for the cluster"})}),n6e=m({tags:["quality-reports"],url:"/v0/quality-reports/preview",method:"POST",body:t.Object({ruleKey:qz,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:nf,result:tf,teamId:t.Optional(t.String()),teamName:t.Optional(t.String())})}),o6e=new Map(xU.map(e=>[e.key,e]));var Yz=`/${"v1"}/quality-reports`,PU=t.Pick(of,["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)."}),Vz={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(PU,{examples:[Vz]});var Qz=t.Object({clusterId:af,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."}),UU=m({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:`${Yz}/latest`,method:"GET",query:Qz,response:t.Array(PU)});var bs="/v0/admin-center";var dr=`${bs}/retention-policies`,wU=3650,Wz=t.Integer({description:"Number of days Tsuga retains matching telemetry."}),NU=t.Integer({minimum:1,maximum:wU,description:`Number of days Tsuga should retain matching telemetry. Valid values are 1 through ${wU}.`}),kr=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(pr,{description:"Telemetry signal retained by this policy: logs, metrics, traces or rum."}),durationDays:Wz,isEnabled:t.Boolean({description:"Whether this policy participates in retention resolution."}),createdAt:E({description:"Timestamp when Tsuga created the retention policy."}),updatedAt:E({description:"Timestamp when Tsuga last updated the retention policy."})}),kp=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(pr,{description:"Telemetry signal retained by this policy: logs, metrics, traces or rum."}),durationDays:NU,isEnabled:t.Boolean({description:"Set to true for the policy to participate in retention resolution."})}),LU=t.Array(t.Object({env:p(),dataSource:t.Enum(pr),durationDays:t.Union([NU,t.Null()]),isEnabled:t.Boolean()})),vU=t.Object({inserted:t.Array(kr),updated:t.Array(kr),deleted:t.Array(kr)}),E6e=m({tags:["retention-policies"],url:dr,method:"POST",body:kp,response:kr}),_6e=m({tags:["retention-policies"],url:dr,method:"GET",response:t.Array(kr)}),I6e=m({tags:["retention-policies"],url:`${dr}/:id`,method:"GET",params:t.Object({id:p()}),response:kr}),b6e=m({tags:["retention-policies"],url:`${dr}/:id`,method:"PUT",params:t.Object({id:p()}),body:kp,response:kr}),S6e=m({tags:["retention-policies"],url:`${dr}/bulk-update`,method:"POST",body:LU,response:vU}),O6e=m({tags:["retention-policies"],url:`${dr}/bulk-update-for-team`,method:"POST",body:t.Object({teamId:p(),policies:LU}),response:vU}),A6e=m({tags:["retention-policies"],url:`${dr}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),Ss=["past-24-hours","past-7-days","past-30-days"],x6e=m({tags:["retention-policies"],url:`${dr}/requested-history-percentile/:teamId`,method:"POST",params:t.Object({teamId:p()}),body:t.Object({percentile:t.Number({minimum:0,maximum:1}),observationWindow:t.Enum(Ss),dataSource:t.Enum(pr)}),response:t.Object({percentile:t.Number(),observationWindow:t.Enum(Ss),dataSource:t.Enum(pr),teamId:t.String(),requestedHistoryDays:t.Number()})}),Zz=["1-day","3-days","7-days","1-month","6-months","more-than-6-months"];var Xz=t.Array(t.Object({bucket:t.Enum(Zz),count:t.Number()})),R6e=m({tags:["retention-policies"],url:`${dr}/requested-history-histogram/:teamId`,method:"POST",params:t.Object({teamId:p()}),body:t.Object({observationWindow:t.Enum(Ss),dataSource:t.Enum(pr)}),response:t.Object({observationWindow:t.Enum(Ss),dataSource:t.Enum(pr),teamId:t.String(),histogram:Xz})}),C6e=m({tags:["retention-policies"],url:`${dr}/top-teams-with-retention-surplus`,method:"POST",body:t.Object({dataSource:t.Enum(pr),observationWindow:t.Enum(Ss),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 Os=`/${"v1"}/retention-policies`,As=t.Pick(kr,["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)."}),Jz={id:"123-456-abc",env:"production",teamId:"team-123-abc",dataSource:"logs",durationDays:30,isEnabled:!0};Object.assign(As,{examples:[Jz]});var kU=m({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:Os,method:"GET",response:t.Array(As)}),MU=m({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:`${Os}/: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:As}),sf=t.Pick(kp,["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."}),e3={env:"production",teamId:"team-123-abc",dataSource:"logs",durationDays:30,isEnabled:!0};Object.assign(sf,{examples:[e3]});var DU=m({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:Os,method:"POST",body:sf,response:As}),GU=m({description:"Replaces an existing retention policy by ID, including signal, scope fields, duration, and enabled state.",operationId:"updateRetentionPolicy",tags:["retention-policies"],url:`${Os}/: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:sf,response:As}),$U=m({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:`${Os}/: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 xs=`/${"v1"}/slos`,t3=t.Pick(Gl,["id","sloId","priority","configuration"],{$id:"SloAlert",description:"Alert attached to an SLO, triggered on a burn-rate multiplier or an SLO target threshold"}),Rs=t.Object({...t.Pick(Zo,["id","name","description","tags","configuration","target","timeframeDays","owner","permissions","clusterIds"]).properties,alerts:t.Array(t3,{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"}),r3={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(Rs,{examples:[r3]});var jU=t.Pick(jl,["filters","sort","limit","offset"]),qU=t.Object({...jU.properties,...ze,filters:jU.properties.filters},{description:"SLO query request. Use filters, sorting, limit, and offset to page through visible SLOs."}),n3={filters:{owners:{values:["team-123-abc"]},searchQuery:{value:"availability"},tags:{values:[{key:"team",value:"platform"}]},statuses:{values:["breached"]},clusterIds:{values:["cluster-123-abc"]}},sort:{by:"name",direction:"asc"},limit:10,offset:0};Object.assign(qU,{examples:[n3]});var BU=m({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:`${xs}/query`,method:"POST",paginated:!0,body:qU,response:t.Array(Rs)}),FU=m({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:`${xs}/:id`,method:"GET",params:t.Object({id:p({allowEmpty:!1,description:"SLO ID returned by SLO query, create, or update operations."})}),response:Rs}),HU=["name","description","tags","configuration","target","timeframeDays","owner","permissions","clusterIds","alerts"],KU=t.Pick(sp,HU,{$id:"CreateSloRequest",description:"SLO creation request. Provide ownership, data access, SLI configuration, target, timeframe, optional cluster scope, and the alerts to create."}),zU=t.Pick($l,HU,{$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."}),YU={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(KU,{examples:[YU]});Object.assign(zU,{examples:[YU]});var VU=m({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:xs,method:"POST",body:KU,response:Rs}),QU=m({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:`${xs}/: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:zU,response:Rs}),WU=m({description:"Deletes an SLO by ID. Deleting an SLO stops future evaluations and removes its attached alerts.",operationId:"deleteSlo",tags:["slos"],url:`${xs}/: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 co=`${bs}/tag-policies`;var o3=["logs","metrics","traces"],cf=t.Array(t.Enum(o3,{description:"Telemetry signal covered by a data tag policy."}),{description:"Telemetry signals covered by the policy. An empty array means logs, metrics, and traces."}),i3=t.Union([$c,cf]),a3=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."}),s3=b("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:$c},{title:"TsugaAssetTagPolicy"})]),c3=b("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:$c},{title:"TsugaAssetTagPolicy"})]),ZU="Policy surface and enforcement behavior. Use `telemetry` for telemetry data or `tsuga_asset` for Tsuga-managed resources.",p3=t.Unsafe({...s3,description:ZU}),u3=t.Unsafe({...c3,description:ZU}),xi=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(a3),configuration:p3,creator:t.Optional(ue),updater:t.Optional(ue),owner:t.Optional(t.String({description:"Team ID that owns and manages the policy."})),createdAt:E({description:"Timestamp when Tsuga created the tag policy."}),updatedAt:E({description:"Timestamp when Tsuga last updated the tag policy."}),assetUpdatedAt:E({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})});var Cs=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:u3,owner:p({allowEmpty:!1,description:"Team ID that will own and manage the policy."})}),Z6e=m({tags:["tag-policies"],url:co,method:"GET",query:t.Object({teamIds:t.Optional(t.Array(p(),{maxItems:100})),assetTypes:t.Optional(i3),searchQuery:t.Optional(p())}),response:t.Array(xi)}),X6e=m({tags:["tag-policies"],url:`${co}/:id`,method:"GET",params:t.Object({id:p()}),response:xi}),J6e=m({tags:["tag-policies"],url:co,method:"POST",body:Cs,response:xi}),e8e=m({tags:["tag-policies"],url:`${co}/:id`,method:"PUT",params:t.Object({id:p()}),body:Cs,response:xi}),t8e=m({tags:["tag-policies"],url:`${co}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),r8e=m({tags:["tag-policies"],url:`${bs}/applicable-tag-rules`,method:"GET",query:t.Object({assetType:t.Enum(Ea),teamId:p()}),response:t.Array(t.Object({tagKey:t.String(),allowedTagValues:t.Array(t.String()),isRequired:t.Boolean(),tagPolicyId:t.String()}))}),XU=t.Object({total:t.Number(),totalNonCompliant:t.Number(),idsNonCompliant:t.Array(t.String())}),JU=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")]),l3=t.Object({total:t.Number(),totalNonCompliant:t.Number(),byAssetType:t.Record(JU,XU)}),m3=t.Omit(XU,["total"]),d3=t.Object({totalNonCompliant:t.Number(),byAssetType:t.Record(JU,m3)}),ew=t.Object({totals:l3,byTeam:t.Record(t.String(),d3)}),n8e=m({tags:["tag-policies"],url:`${co}/:id/stats`,method:"GET",params:t.Object({id:p()}),response:ew}),o8e=m({tags:["tag-policies"],url:`${co}/new-policy-stats`,method:"POST",body:Cs,response:ew});var Ps=`/${"v1"}/tag-policies`,tw={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"},rw={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"},f3={id:"123-456-abc",...tw},g3={id:"456-789-def",...rw},Us=t.Pick(xi,["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)."}),y3=f3,h3=g3;Object.assign(Us,{examples:[y3,h3]});var pf=t.Pick(Cs,["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."}),T3=tw,E3=rw;Object.assign(pf,{examples:[T3,E3]});var nw=m({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:Ps,method:"GET",response:t.Array(Us)}),ow=m({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:`${Ps}/: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:Us}),iw=m({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:Ps,method:"POST",body:pf,response:Us}),aw=m({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:`${Ps}/: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:Us}),sw=m({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:`${Ps}/: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 ws=`/${"v1"}/teams`,Ns=t.Pick(Vo,["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)."}),_3={id:"team-123-abc",name:"platform-engineering",visibility:"public",tags:[{key:"department",value:"engineering"}]};Object.assign(Ns,{examples:[_3]});var cw=m({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:ws,method:"GET",paginated:!0,query:t.Object(ze),response:t.Array(Ns)}),pw=m({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:`${ws}/: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:Ns}),uf=t.Pick(np,["name","description","visibility","tags"],{description:"Team create or update request. Provide the team name, optional description, visibility, and tags."}),I3={name:"platform-engineering",visibility:"public",tags:[{key:"department",value:"engineering"}]};Object.assign(uf,{examples:[I3]});var uw=m({description:"Creates a team for ownership and access control. Use this before assigning resources to a new owner team.",operationId:"createTeam",tags:["teams"],url:ws,method:"POST",body:uf,response:Ns}),lw=m({description:"Replaces a team definition by ID, including name, description, visibility, and tags.",operationId:"updateTeam",tags:["teams"],url:`${ws}/: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:Ns}),mw=m({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:`${ws}/: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 b3(e){return/^[aeiou]/i.test(e)||e==="SLO"?"an":"a"}function dw(e,r){let n=Number(r);if(Number.isNaN(n))throw new Error(`--${e} must be a number (got: ${r})`);return n}function fw(e){let r={};return e.limit!==void 0&&(r.limit=dw("limit",e.limit)),e.offset!==void 0&&(r.offset=dw("offset",e.offset)),r}function lf(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 gw(e,r,n){let o=e.command(r.commandName).description(r.description),i=r.singularOverride??JS(r.commandName).replace(/-/g," "),a=r.pluralOverride??r.commandName.replace(/-/g," "),c=b3(i),l=o.command("list").description(r.listDescription??`List all ${a}`);if(r.listOptions)for(let d of r.listOptions)l.option(d.flag,d.description);if(r.endpoints.list.paginated===!0&&l.option("--limit <n>",`Maximum number of items to return, up to ${qo} (default: ${Gc})`).option("--offset <n>","Number of items to skip, to request a later page"),r.enableListBody?l.option("-d, --data <JSON>","Inline JSON body").option("--generate-skeleton","Print a JSON skeleton for the request body and exit").action(async d=>{if(d.generateSkeleton){Q(pi(r.endpoints.list));return}let f=d.data?ti({data:d.data}):{},g=await n()(r.endpoints.list,{body:{...f,...fw(d)}});Q(g)}):l.action(async d=>{let f=fw(d);if(r.listOptions)for(let T of r.listOptions){let _=d[T.queryParam];_!==void 0&&(f[T.queryParam]=_)}let g=await n()(r.endpoints.list,Object.keys(f).length>0?{query:f}:void 0);Q(g)}),r.endpoints.get){let d=r.endpoints.get,f=lf(d);o.command("get <ID>").description(`Get ${c} ${i} by ID`).action(async g=>{let T=await n()(d,{params:{[f]:g}});Q(T)})}if(r.endpoints.create){let d=r.endpoints.create;o.command("create").description(`Create a new ${i}`).option("-f, --file <FILE_PATH>","Read body from file (use - for stdin)").option("-d, --data <JSON>","Inline JSON body").option("--generate-skeleton","Print a JSON skeleton for the request body and exit").action(async f=>{if(f.generateSkeleton){Q(pi(d));return}let g=ti(f),T=await n()(d,{body:g});Q(T)})}if(r.endpoints.update){let d=r.endpoints.update,f=lf(d);o.command("update <ID>").description(`Update ${c} ${i} by ID`).option("-f, --file <FILE_PATH>","Read body from file (use - for stdin)").option("-d, --data <JSON>","Inline JSON body").option("--generate-skeleton","Print a JSON skeleton for the request body and exit").action(async(g,T)=>{if(T.generateSkeleton){Q(pi(d));return}let _=ti(T),ae=await n()(d,{params:{[f]:g},body:_});Q(ae)})}if(r.endpoints.delete){let d=r.endpoints.delete,f=lf(d);o.command("delete <ID>").description(`Delete ${c} ${i} by ID`).action(async g=>{let T=await n()(d,{params:{[f]:g}});Q(T)})}}var S3=[{commandName:"cloud-resources",description:"List cloud resources discovered by inventory scans",endpoints:{list:SP},enableListBody:!0},{commandName:"dashboards",description:"Manage dashboards",endpoints:{list:tP,get:rP,create:nP,update:oP,delete:iP},enableListBody:!0},{commandName:"ingestion-api-keys",description:"Manage ingestion API keys",singularOverride:"ingestion API key",pluralOverride:"ingestion API keys",endpoints:{list:mP,create:dP,update:fP,delete:gP}},{commandName:"investigations",description:"Manage investigations (beta)",endpoints:{list:AP,get:xP,create:RP,update:CP,delete:PP}},{commandName:"monitors",description:"Manage monitors",endpoints:{list:JP,get:eU,create:cU,update:pU,delete:uU},enableListBody:!0},{commandName:"notification-rules",description:"Manage notification rules",endpoints:{list:mU,get:dU,create:fU,update:gU,delete:yU}},{commandName:"notification-silences",description:"Manage notification silences",endpoints:{list:_U,get:IU,create:bU,update:SU,delete:OU}},{commandName:"quality-reports",description:"Get the latest quality report rows for a cluster",listDescription:"Get the latest quality report rows for a cluster (pass --cluster <CLUSTER_ID> when the org has more than one cluster)",endpoints:{list:UU},listOptions:[{flag:"--team <TEAM_NAME>",description:"Only return rows for this team by name (omits cluster-wide global rows)",queryParam:"team"}]},{commandName:"retention-policies",description:"Manage retention policies",endpoints:{list:kU,get:MU,create:DU,update:GU,delete:$U}},{commandName:"log-routes",description:"Manage log routes",endpoints:{list:BP,get:FP,create:HP,update:KP,delete:zP}},{commandName:"services",description:"List and inspect services (read-only; services are inferred from telemetry)",endpoints:{list:qO,get:BO}},{commandName:"slos",description:"Manage SLOs",singularOverride:"SLO",pluralOverride:"SLOs",endpoints:{list:BU,get:FU,create:VU,update:QU,delete:WU},enableListBody:!0},{commandName:"tag-policies",description:"Manage tag policies",endpoints:{list:nw,get:ow,create:iw,update:aw,delete:sw}},{commandName:"teams",description:"Manage teams",endpoints:{list:cw,get:pw,create:uw,update:lw,delete:mw}}];function yw(e,r){for(let n of S3)gw(e,n,r)}var hw=require("node:child_process");var Mp="@tsuga/cli@latest";function O3(){B(`Updating ${Mp}`),B(` $ npm install -g ${Mp}`);try{(0,hw.execFileSync)("npm",["install","-g",Mp],{stdio:["ignore","inherit","inherit"]})}catch(e){let r=e.status??1;throw new Error(`npm install -g ${Mp} exited ${r}`,{cause:e})}B("Updated. Run `tsuga --version` to confirm the new version.")}function Tw(e){e.command("self-update").description("Update the Tsuga CLI to the latest version via npm").action(()=>{O3()})}var Tf=require("node:fs"),hf=require("node:os"),Ci=require("node:path");function A3(e,r){let n=e.slice(0,r).split(/\r\n|\n|\r/g);return[n.length,n.pop().length+1]}function x3(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 l=o[c-1];l&&(i+=c.toString().padEnd(a," "),i+=": ",i+=l,i+=`
138
+ -----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}"}],s1=WS.map(e=>e.key);var rOe=new Set(s1),nOe=WS.map(e=>e.key);var M="context";var ZS="trace_id",dOe=`${M}.team`,fOe=`${M}.env`,gOe=`${M}.api_key_id`,ep=`${M}.service.name`,yOe=`${M}.service.version`,El=`${M}.span.kind`,_l=`${M}.span.name`,Il=`${M}.status.code`,XS=["SPAN_KIND_UNSPECIFIED","SPAN_KIND_INTERNAL","SPAN_KIND_SERVER","SPAN_KIND_CLIENT","SPAN_KIND_PRODUCER","SPAN_KIND_CONSUMER"];var Ua=`${M}.host.name`,c1=`${M}.instance`,p1=`${M}.instanceid`,u1=`${M}.instance_name`,hOe=`${M}.telemetry.sdk.language`,TOe=`${M}.process.runtime.name`,EOe=`${M}.scope.name`,_Oe=`${M}.cloud.provider`,IOe=`${M}.cloud.platform`,bOe=`${M}.aws.ecs.task.arn`,SOe=`${M}.k8s.cluster.name`,OOe=`${M}.k8s.cluster.uid`,AOe=`${M}.k8s.namespace.name`,l1=`${M}.k8s.pod.name`,xOe=`${M}.k8s.pod.uid`,ROe=`${M}.k8s.container.name`,COe=`${M}.k8s.node.name`,POe=`${M}.k8s.node.uid`,m1=`${M}.k8s.deployment.name`,UOe=`${M}.k8s.deployment.uid`,d1=`${M}.k8s.replicaset.name`,wOe=`${M}.k8s.replicaset.uid`,f1=`${M}.k8s.statefulset.name`,NOe=`${M}.k8s.statefulset.uid`,g1=`${M}.k8s.daemonset.name`,LOe=`${M}.k8s.daemonset.uid`,vOe=`${M}.k8s.job.name`,kOe=`${M}.k8s.job.uid`,MOe=`${M}.k8s.cronjob.name`,DOe=`${M}.k8s.cronjob.uid`,bl="status_code",Sl="span.name";var Ol="span.kind";var y1="db.system.name",h1="db.system",T1="db.namespace",E1="db.name";var GOe=`span_attributes.${T1}`,$Oe=`span_attributes.${E1}`,jOe=`span_attributes.${y1}`,qOe=`span_attributes.${h1}`;var BOe={name:"tsuga.internal.processing_tag_policy_violations_total",attributes:{tagPolicyId:`${M}.tag_policy_id`,dataSource:`${M}.data_source`}};var FOe={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 Al="__tsuga_metadata__",HOe=`${Al}.signature`,KOe=`${Al}.routes`,zOe=`${Al}.trace_id_bucket`;var ZOe={[El]:Ol,[El.replace(`${M}.`,"")]:Ol,[_l]:Sl,[_l.replace(`${M}.`,"")]:Sl,[Il]:bl,[Il.replace(`${M}.`,"")]:bl};function JS(e){return e.replace(/ies$/,"y").replace(/s$/,"")}var eO=["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"],tO=["alert_queries","alert_thresholds","alert_values"],_1=[...eO,...tO],rO=["alert_event_name","alert_message"],SAe=[..._1,...rO],OAe=new Set([...eO,...rO]),AAe=new Set(tO);var I1="^\\S(.*\\S)?$",b1=128,S1=256,O1=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"}),A1=t.Object({key:t.String({maxLength:b1,description:"Tag key to attach to the resource."}),value:t.String({maxLength:S1,pattern:I1,description:"Tag value to attach to the resource. Leading or trailing whitespace is rejected."})},{title:"Tag"}),Yt=t.Array(O1,{title:"Tags",description:"Key/value tags applied to the resource. Use them to organize resources and to satisfy tag policies."}),Vt=t.Array(A1,{title:"Tags",maxItems:50,description:"Key/value tags to apply to the resource. Tag policies may require specific keys or values."}),Me=t.Optional(Yt),Ve=t.Optional(Vt);var un="/v0/teams",rp=["public","private"],tp={NAME:"name",CREATED_AT:"createdAt",MEMBER_COUNT:"memberCount",VISIBILITY:"visibility"},x1=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`."}),iO=t.Object({color:t.Enum(hl,{description:"Color token used by Tsuga when rendering the team avatar."}),mode:t.Enum(Tl,{description:"Avatar rendering mode selected for the team."}),iconName:t.Enum(QS,{description:"Icon name rendered inside the team avatar when icon mode is used."})}),xl=t.Object({color:t.Enum(hl),mode:t.Enum(Tl)}),nO=100,oO=250,Vo=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:Me,createdAt:E({description:"Timestamp when Tsuga created the team."}),updatedAt:E({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(iO)}),np=t.Object({name:t.String({minLength:1,maxLength:nO,format:$o,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 ${nO} characters.`}),description:t.Optional(t.String({maxLength:oO,description:`Optional team description. Maximum length is ${oO} 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(iO)}),R1=t.Object({id:t.String(),name:t.String(),email:t.String(),role:t.Enum(Ho),joinedTeamAt:E(),orgRole:t.Enum(Fc),avatar:t.Optional(xl)}),Ixe=m({tags:["teams"],url:un,method:"GET",paginated:!0,response:t.Array(Vo),query:t.Object({...ye,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(x1),sortDirection:t.Optional(t.Enum(["asc","desc"],{description:"Sort direction: ascending or descending."}))})}),bxe=m({tags:["teams"],url:`${un}/:id`,method:"GET",params:t.Object({id:p()}),response:Vo}),Sxe=m({tags:["teams"],url:`${un}/:id/members`,method:"GET",params:t.Object({id:p()}),response:t.Array(R1)}),Oxe=m({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()})}),Axe=m({tags:["teams"],url:un,method:"POST",body:np,response:Vo}),xxe=m({tags:["teams"],url:`${un}/:id`,method:"PUT",params:t.Object({id:p()}),body:np,response:Vo}),Rxe=m({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({})}),Cxe=m({tags:["teams"],url:`${un}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R});var C1=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=b("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(C1)})],{description:"User or operation API key responsible for creating or updating a resource. Returned by Tsuga for audit context."});var ft="/v0/monitors",Qo=["alert","resolve","keep_last_status","consider_zero"],Wo=["alert","resolve","keep_last_status"];var sO=["no_aggregation","all","any","each","proportion"],cO=["greater_than","less_than","equal","not_equal","greater_than_or_equal","less_than_or_equal"];var P1=t.Object({formula:t.String({description:"Formula result to compare against the threshold, usually `q1` or a formula alias."}),operator:t.Enum(cO,{description:"Comparison operator used to evaluate the threshold condition."}),threshold:t.Number({description:"Numeric threshold value used by the comparison."})}),U1=t.Object({formula:p({type:"tsuga-formula",description:"Formula result to compare against the threshold, usually `q1` or a formula alias."}),operator:t.Enum(cO,{description:"Comparison operator used to evaluate the threshold condition."}),threshold:t.Number({description:"Numeric threshold value used by the comparison."})}),w1=5,Rl=t.Array(P1,{description:"Threshold conditions evaluated against query and formula results. All listed conditions must match for a non-grouped threshold monitor to alert."}),Cl=t.Array(U1,{minItems:1,maxItems:w1,description:"Threshold conditions evaluated against query and formula results. All listed conditions must match for a non-grouped threshold monitor to alert."}),Pl=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`."}),Ul=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(sO,{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(sO,{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`."}))},wl={...op,timeframe:t.Number({description:"Lookback window, in minutes, that each anomaly monitor evaluation aggregates over. Always a whole number from 5 through 1440."})},Nl={...ip,timeframe:t.Integer({minimum:5,maximum:1440,description:"Lookback window, in minutes, that each anomaly monitor evaluation aggregates over."})},pO=t.Object({type:t.Literal("metric",{description:"Threshold monitor over metric aggregations."}),conditions:Rl,noDataBehavior:t.Enum(Qo,{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:Ir},{$id:"MonitorConfigurationMetric"}),uO=t.Object({type:t.Literal("metric",{description:"Threshold monitor over metric aggregations."}),conditions:Cl,noDataBehavior:t.Enum(Qo,{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:br},{$id:"InputMonitorConfigurationMetric"}),lO=t.Object({type:t.Literal("log",{description:"Threshold monitor over log aggregations."}),conditions:Rl,noDataBehavior:t.Enum(Qo,{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:Ir},{$id:"MonitorConfigurationLog"}),mO=t.Object({type:t.Literal("log",{description:"Threshold monitor over log aggregations."}),conditions:Cl,noDataBehavior:t.Enum(Qo,{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:br},{$id:"InputMonitorConfigurationLog"}),dO=t.Object({type:t.Literal("trace",{description:"Threshold monitor over trace aggregations."}),conditions:Rl,noDataBehavior:t.Enum(Qo,{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:Ir},{$id:"MonitorConfigurationTrace"}),N1=t.Object({type:t.Literal("trace",{description:"Threshold monitor over trace aggregations."}),conditions:Cl,noDataBehavior:t.Enum(Qo,{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:br},{$id:"InputMonitorConfigurationTrace"}),fO=t.Object({type:t.Literal("anomaly-log",{description:"Anomaly monitor over log aggregations."}),condition:Pl,noDataBehavior:t.Enum(Wo,{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."}),...wl,queries:Ir},{$id:"MonitorConfigurationAnomalyLog"}),gO=t.Object({type:t.Literal("anomaly-log",{description:"Anomaly monitor over log aggregations."}),condition:Ul,noDataBehavior:t.Enum(Wo,{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."}),...Nl,queries:br},{$id:"InputMonitorConfigurationAnomalyLog"}),yO=t.Object({type:t.Literal("anomaly-metric",{description:"Anomaly monitor over metric aggregations."}),condition:Pl,noDataBehavior:t.Enum(Wo,{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."}),...wl,queries:Ir},{$id:"MonitorConfigurationAnomalyMetric"}),hO=t.Object({type:t.Literal("anomaly-metric",{description:"Anomaly monitor over metric aggregations."}),condition:Ul,noDataBehavior:t.Enum(Wo,{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."}),...Nl,queries:br},{$id:"InputMonitorConfigurationAnomalyMetric"}),TO=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:Pl,noDataBehavior:t.Enum(Wo,{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."}),...wl,queries:Ir},{$id:"MonitorConfigurationAnomalyTrace"}),L1=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:Ul,noDataBehavior:t.Enum(Wo,{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."}),...Nl,queries:br},{$id:"InputMonitorConfigurationAnomalyTrace"}),EO=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"}),v1=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"}),k1=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"}),M1=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"}),D1=b("type",[pO,lO,dO,fO,yO,k1,TO,EO],{description:"Monitor evaluation configuration. The `type` discriminator determines which telemetry source, condition shape, and evaluation rules Tsuga uses."}),G1=b("type",[uO,mO,N1,gO,hO,L1,M1,v1],{description:"Monitor evaluation configuration. The `type` discriminator determines which telemetry source, condition shape, and evaluation rules Tsuga uses."});var Or=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:Me,configuration:D1,priority:t.Enum(dt,{description:"Monitor priority from 1 through 5, where 1 is highest priority."}),permissions:pn,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(E({description:"Timestamp until which the monitor is snoozed."})),creator:t.Optional(ue),updater:t.Optional(ue),createdAt:E({description:"Timestamp when Tsuga created the monitor."}),updatedAt:E({description:"Timestamp when Tsuga last updated the monitor."}),assetUpdatedAt:E({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."}),clusterIds:t.Array(t.String(),{description:"Cluster IDs where the monitor is deployed. Empty means all eligible clusters."})},{title:"Monitor"}),$1=b("type",[pO,lO,dO,fO,yO,TO,EO]),Vxe=t.Object({...Or.properties,configuration:$1},{title:"Monitor"}),Qxe=t.Object({...Or.properties,configuration:b("type",[uO,mO,gO,hO])},{title:"Monitor"}),wa=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:G1,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:pn,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."}))}),aO=["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 Ll=t.Object({owners:Be(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:Be(Vt.items,{description:"Restrict results to monitors that have at least one of the listed key/value tags",maxItems:50}),priorities:Be(t.Enum(dt),{description:"Restrict results to monitors with one of these priorities",maxItems:dt.length}),types:Be(t.Enum(aO),{description:"Restrict results to monitors with these types",maxItems:aO.length}),activity:t.Enum(["active","snoozed"],{description:"Restrict results by activity status: active monitors or currently snoozed monitors"}),clusterIds:Be(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"}),vl=t.Partial(t.Object({...ye,filters:t.Partial(Ll),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."})})),Wxe=m({tags:["monitors"],url:`${ft}/query`,method:"POST",paginated:!0,response:t.Array(Or),body:vl}),Zxe=m({tags:["monitors"],url:`${ft}/tags/query`,method:"POST",body:t.Object({filters:t.Optional(t.Partial(t.Omit(Ll,["tags"])))}),response:Yt}),Xxe=m({tags:["monitors"],url:`${ft}/counts/query`,method:"POST",body:t.Object({filters:t.Optional(t.Partial(t.Omit(Ll,["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."})})}),Jxe=m({tags:["monitors"],url:`${ft}/:id`,method:"GET",params:t.Object({id:p()}),response:Or}),eRe=m({tags:["monitors"],url:ft,method:"POST",body:wa,response:Or}),tRe=m({tags:["monitors"],url:`${ft}/:id`,method:"PUT",params:t.Object({id:p()}),body:wa,response:Or}),rRe=m({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({})}),nRe=m({tags:["monitors"],url:`${ft}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),oRe=m({tags:["monitors"],url:`${ft}/bulk-delete`,method:"DELETE",body:t.Object({ids:t.Array(p())}),response:t.Object({})}),iRe=m({tags:["monitors"],url:`${ft}/:id/snooze`,method:"POST",params:t.Object({id:p()}),body:t.Object({pauseUntil:p({allowEmpty:!1,type:"date-time"})}),response:Or}),aRe=m({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({})}),j1=["alert","alert_consider_zero","alert_no_data","keep_last_status_alert"],q1=["ok","ok_consider_zero","ok_no_data","keep_last_status_ok"],B1=[...j1,...q1],Fn=t.Enum(B1),F1=b("type",[t.Object({type:t.Literal("each"),subStates:t.Record(t.String(),t.Object({stateValue:t.Union([Fn,t.Null()]),lastChangedAt:E()}))}),t.Object({type:t.Literal("no_aggregation"),stateValue:t.Optional(Fn)}),t.Object({type:t.Literal("any"),stateValue:t.Optional(Fn)}),t.Object({type:t.Literal("all"),stateValue:t.Optional(Fn)}),t.Object({type:t.Literal("proportion"),stateValue:t.Optional(Fn)})]),H1=t.Object({monitorId:t.String(),currentState:F1,lastChangedAt:t.Optional(E())}),sRe=m({tags:["monitors"],url:`${ft}/states/:id`,method:"GET",params:t.Object({id:p()}),response:H1}),cRe=m({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:E(),fromState:t.Optional(Fn),toState:t.Optional(Fn),dimension:t.Optional(t.String())}))}),K1=["unprocessed","processed","failed-to-process"],pRe=m({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:E(),formulaResult:t.Object({groups:t.Array(t.Object({groupKey:t.Record(t.String(),Ca),results:t.Array(t.Union([t.Number(),t.Null()])),conditionMet:t.Enum(["true","false","nan-no-data"])}))}),createdAt:E(),status:t.Enum(K1)}))})});var Ar="/v0/slos",z1=[7,30,90],Y1=["good","bad"],SO=t.Enum(Y1,{description:"How to treat SLO with no data: good (count as meeting the SLO), bad (count as breaching it)"}),V1=["good","bad","ignore"],OO=t.Enum(V1,{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)"}),_O=30,IO=1440,AO=["greater_than","less_than","greater_than_or_equal","less_than_or_equal"],Q1=["healthy","breached","no_data"],ap=t.Enum(Q1,{description:"SLO status: healthy (meeting the target), breached (breaching it), or no_data (not evaluated yet)"}),bO={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},W1=t.Object({overall:t.Object(bO,{description:"Latest overall evaluation for the cluster"}),perGroup:t.Array(t.Object({groupKey:t.Record(t.String(),Ca,{description:"Group-by field values identifying this group, keyed by field name. Present only when the SLO configuration sets `groupByFields`."}),...bO}),{description:"Latest evaluation for each group produced by the SLO configuration's `groupByFields`. Empty when the SLO is not grouped."})},{title:"SloClusterResults"}),xO=t.Record(t.String(),W1,{description:"Latest evaluation results keyed by cluster ID."}),kl=t.Object({queries:Ir,formula:Jc},{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."}),Ml=t.Object({queries:br,formula:Bn},{title:"SloQueryFormula",description:"Aggregation queries combined by a formula to produce the SLO signal. Formulas reference queries as q1, q2, and so on."}),Z1=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"}),X1=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 J1=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"}),ej=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"}),tj=b("type",[Z1,J1],{description:"Alert trigger configuration: burn-rate or threshold"}),RO=b("type",[X1,ej],{description:"Alert trigger configuration: burn-rate or threshold"}),Dl=t.Enum(dt,{description:"Alert priority (1 is highest, 5 is lowest)"}),Gl=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:Dl,configuration:tj,createdAt:E({description:"Timestamp when Tsuga created the alert."}),updatedAt:E({description:"Timestamp when Tsuga last updated the alert."}),assetUpdatedAt:E({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})},{title:"SloAlert"}),rj=t.Object({priority:Dl,configuration:RO}),nj=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:Dl,configuration:RO}),oj=b("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:kl,totalQuery:kl,groupByFields:t.Optional(Yo),noDataBehavior:SO},{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:kl,sliceSizeMinutes:t.Integer({description:"Length of each time-SLO evaluation slice in minutes. Required for `type: time`."}),threshold:t.Object({operator:t.Enum(AO,{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(Yo),noDataBehavior:OO},{title:"TimeSliceSloConfiguration"})],{description:"SLI configuration for this SLO. Use `event` for good/total event-ratio SLOs or `time` for thresholded time-slice SLOs."}),ij=b("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:Ml,totalQuery:Ml,groupByFields:t.Optional(Sr),noDataBehavior:SO},{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:Ml,sliceSizeMinutes:t.Integer({minimum:_O,maximum:IO,description:`Length of each time-SLO evaluation slice in minutes. Required for \`type: time\`. Valid input is ${_O} through ${IO}.`}),threshold:t.Object({operator:t.Enum(AO,{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(Sr),noDataBehavior:OO},{title:"TimeSliceSloConfiguration"})],{description:"SLI configuration for this SLO. Use `event` for good/total event-ratio SLOs or `time` for thresholded time-slice SLOs."}),aj=t.Number({exclusiveMinimum:0,exclusiveMaximum:100,description:"Target percentage (0 < target < 100, e.g. 99.9)"}),CO=t.Enum(z1,{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."}),sj=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."}),cj=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."}),Zo=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:Me,configuration:oj,target:t.Number({description:"Target percentage (0 < target < 100, e.g. 99.9)"}),timeframeDays:CO,owner:t.String({description:"Team ID that owns the SLO"}),permissions:pn,clusterIds:sj,creator:t.Optional(ue),updater:t.Optional(ue),alerts:t.Array(Gl,{description:"Alerts attached to this SLO"}),createdAt:E({description:"Timestamp when Tsuga created the SLO."}),updatedAt:E({description:"Timestamp when Tsuga last updated the SLO."}),assetUpdatedAt:E({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})},{title:"Slo"}),pj=t.Object({...Zo.properties,results:xO},{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:ij,target:aj,timeframeDays:CO,owner:p({allowEmpty:!1,description:"Team ID that owns the SLO"}),permissions:pn,clusterIds:t.Optional(cj),alerts:t.Array(rj,{description:"Alerts to create on this SLO. Send an empty array for none."})}),$l=t.Object({...t.Omit(sp,["alerts"]).properties,alerts:t.Array(nj,{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."})}),PO=t.Object({owners:Be(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:Be(Vt.items,{description:"Restrict results to SLOs that have at least one of the listed key/value tags",maxItems:50}),clusterIds:Be(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:Be(ap,{description:"Restrict results to SLOs whose status is one of these values",maxItems:3})},{description:"Optional filters applied to narrow the returned SLOs"}),jl=t.Partial(t.Object({...ye,filters:t.Partial(PO),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"})})),IRe=m({tags:["slos"],url:`${Ar}/query`,method:"POST",paginated:!0,response:t.Array(pj),body:jl}),bRe=m({tags:["slos"],url:`${Ar}/tags/query`,method:"POST",body:t.Object({filters:t.Optional(t.Partial(t.Omit(PO,["tags","statuses"])))}),response:Yt}),SRe=m({tags:["slos"],url:`${Ar}/:id`,method:"GET",params:t.Object({id:p()}),response:Zo}),ORe=m({tags:["slos"],url:`${Ar}/:id/results`,method:"GET",params:t.Object({id:p()}),response:xO}),ARe=m({tags:["slos"],url:Ar,method:"POST",body:sp,response:Zo}),xRe=m({tags:["slos"],url:`${Ar}/:id`,method:"PUT",params:t.Object({id:p()}),body:$l,response:Zo}),RRe=m({tags:["slos"],url:`${Ar}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),CRe=m({tags:["slos"],url:`${Ar}/bulk-delete`,method:"DELETE",body:t.Object({ids:t.Array(p())}),response:t.Object({})}),PRe=m({tags:["slos"],url:`${Ar}/bulk-update`,method:"PUT",body:t.Object({sloIds:t.Array(p()),owner:p({allowEmpty:!1})}),response:t.Object({})});var Xo="/v0/notifications",Kn=`${Xo}/rules`,UO=`${Xo}/slack/setup`,Na=`${Xo}/integrations`,Hn=["triggered","resolved","no-data"],uj=["sent","stale","pending","rate-limited","failed","silenced"],lj=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."})),ql=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."}),mj=t.Optional(ql),dj=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."})),fj=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."})),La=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:lj,renotifyConfig:dj,config:b("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".'}),openStatus:t.Optional(t.String({description:"Jira status the alert ticket is moved to right after it is filed for a firing alert. A later transition between two firing states leaves the ticket status alone."})),closedStatus:t.Optional(t.String({description:"Jira status the alert ticket is moved to when the alert resolves. Only takes effect when the rule delivers recovery transitions."}))},{$id:"RuleTargetConfigJira"})],{description:"Destination that received the notification. The `type` field discriminates the variant: `email` sends directly to the listed addresses, and every other type routes through the named integration referenced by `integrationId`."})}),Jo=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:mj,config:b("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".'}),openStatus:t.Optional(p({allowEmpty:!1,description:"Jira status the alert ticket is moved to right after it is filed for a firing alert. A later transition between two firing states leaves the ticket status alone."})),closedStatus:t.Optional(p({allowEmpty:!1,description:"Jira status the alert ticket is moved to when the alert resolves. Only takes effect when the rule delivers recovery transitions."}))},{$id:"RuleTargetInputJira"})],{description:"Destination that should receive the notification. The `type` field discriminates the variant: `email` sends directly to the listed addresses and needs no integration; every other type routes through the integration identified by `integrationId`, which must already exist (create it first with the notification integration endpoints)."}),renotifyConfig:fj}),Bl=b("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."}),Fl=b("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."}),ei=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:Bl,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(Hn),{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:E({description:"Timestamp when Tsuga created the rule."}),updatedAt:E({description:"Timestamp when Tsuga last updated the rule."}),isActive:t.Boolean({description:"Whether the rule currently sends notifications when its filters match."}),tags:Me,targets:t.Array(La,{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)}),va=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:Fl,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(Hn),{maxItems:Hn.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(Jo,{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:E({description:"Timestamp when Tsuga created the rule."}),updatedAt:E({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:Me,monitorIds:t.Array(t.String(),{description:"Monitors this rule reacts to."}),fallbackTarget:La,creator:t.Optional(ue),updater:t.Optional(ue)}),wO=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:Jo}),GRe=m({tags:["notification-rules"],url:Kn,method:"GET",paginated:!0,query:t.Object(ye),response:t.Array(ei)}),$Re=m({tags:["notification-rules"],url:`${Kn}/:id`,params:t.Object({id:p()}),method:"GET",response:ei}),jRe=m({tags:["notification-rules"],url:Kn,method:"POST",body:va,response:ei}),qRe=m({tags:["notification-rules"],url:`${Kn}/:id`,method:"PUT",params:t.Object({id:p()}),body:va,response:ei}),BRe=m({tags:["notification-rules"],url:`${Kn}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),ka=`${Xo}/adaptive-rules`,FRe=m({tags:["notification-rules"],url:ka,method:"GET",paginated:!0,query:t.Object(ye),response:t.Array(cp)}),HRe=m({tags:["notification-rules"],url:`${ka}/:id`,params:t.Object({id:p()}),method:"GET",response:cp}),KRe=m({tags:["notification-rules"],url:ka,method:"POST",body:wO,response:cp}),zRe=m({tags:["notification-rules"],url:`${ka}/:id`,method:"PUT",params:t.Object({id:p()}),body:wO,response:cp}),YRe=m({tags:["notification-rules"],url:`${ka}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),VRe=m({tags:["notification-integrations"],url:`${UO}/start`,method:"POST",response:t.Object({redirectUrl:t.String()})}),gj=["google-chat","grafana-irm","incident-io","jira","microsoft-teams","pagerduty","servicenow","slack","squadcast","webhook"],yj=t.Object({id:t.String(),name:t.String(),type:t.Enum(gj),createdAt:E(),ruleCount:t.Number(),creator:t.Optional(ue)}),QRe=m({tags:["notification-integrations"],url:`${Kn}/integrations`,method:"GET",paginated:!0,query:t.Object(ye),response:t.Array(yj)}),WRe=m({tags:["notification-integrations"],url:`${UO}/callback`,method:"GET",query:t.Object({code:p()}),response:t.Object({success:t.Boolean()})}),Hl=["POST","PUT"],hj=t.Record(t.String(),t.String()),Tj=t.Record(t.String(),t.Unknown()),Ej=t.Record(t.String(),t.Union([t.String(),t.Number(),t.Boolean(),t.Null(),t.Array(t.Union([t.String(),t.Number(),t.Boolean()]))])),_j=b("type",[t.Object({type:t.Literal("json"),value:Tj}),t.Object({type:t.Literal("form"),value:Ej})]),Ij=t.Object({ok:t.String(),alert:t.String()}),Kl=t.Object({id:t.String(),name:t.String(),setting:b("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(Hl),authentication:b("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(hj),payloadTemplate:_j,eventNameMapping:t.Optional(Ij)}),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:Me}),bj=t.Object({type:t.Literal("webhook"),url:p({type:"uri"}),method:t.Enum(Hl),authentication:b("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:b("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})}))}),NO=t.Object({type:t.Literal("incident-io"),alertSourceConfigId:p(),token:p()}),LO=t.Object({type:t.Literal("grafana-irm"),url:p({type:"uri"})}),vO=t.Object({type:t.Literal("pagerduty"),integrationKey:p()}),kO=t.Object({type:t.Literal("microsoft-teams"),webhookUrl:p({type:"uri"})}),Sj=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})}),Oj=t.Object({type:t.Literal("google-chat"),webhookUrl:p({type:"uri"})}),Aj=t.Object({type:t.Literal("squadcast"),webhookUrl:p({type:"uri"})}),xj=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."})}),Rj=t.Object({name:p(),setting:b("type",[NO,LO,vO,kO,bj,Sj,Oj,Aj,xj]),tags:Ve}),Cj=t.Object({type:t.Literal("webhook"),url:t.Optional(p({type:"uri"})),method:t.Optional(t.Enum(Hl)),authentication:t.Optional(b("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(b("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}))}))}),Pj=t.Object({type:t.Literal("servicenow"),instanceName:t.Optional(p({allowEmpty:!1})),username:t.Optional(p({allowEmpty:!1})),password:t.Optional(p({allowEmpty:!1}))}),Uj=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}))}),wj=t.Object({type:t.Literal("google-chat"),webhookUrl:p({type:"uri"})}),Nj=t.Object({type:t.Literal("squadcast"),webhookUrl:p({type:"uri"})}),Lj=t.Object({name:t.Optional(p()),setting:t.Optional(b("type",[NO,LO,vO,kO,Cj,Pj,wj,Nj,Uj]))}),ZRe=m({tags:["notification-integrations"],url:Na,method:"POST",body:Rj,response:Kl}),XRe=m({tags:["notification-integrations"],url:`${Na}/:id`,method:"GET",params:t.Object({id:p()}),response:Kl}),JRe=m({tags:["notification-integrations"],url:`${Na}/:id`,method:"PUT",params:t.Object({id:p()}),body:Lj,response:Kl}),eCe=m({tags:["notification-integrations"],url:`${Na}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),vj=b("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.Optional(t.Array(t.String(),{description:"Status names an issue in this project can be transitioned to. Omitted when Jira refused the status lookup for this project."}))}),{description:"Projects the connected Jira account can file issues into."})},{title:"JiraMetadataOk"}),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."}),tCe=m({tags:["notification-integrations"],url:`${Na}/:id/jira-metadata`,method:"GET",params:t.Object({id:p()}),response:vj}),rCe=m({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(uj),tryCount:t.Number(),nextTryAt:E(),createdAt:E(),updatedAt:E(),sentAt:t.Optional(E())})),isTruncated:t.Boolean()})}),kj=["slack","incident-io","pagerduty","email","grafana-irm","microsoft-teams","webhook","servicenow","google-chat","squadcast","jira"],nCe=m({tags:["notification-rules"],url:`${Kn}/test`,method:"POST",body:t.Object({notificationRule:va,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(kj,{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 Mj=t.Object({team:t.String({description:"Team name observed on telemetry for this service."}),lastSeenAt:E({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."}),Dj=t.Object({ingestionApiKey:t.String({description:"Ingestion API key name or identifier observed on telemetry for this service."}),lastSeenAt:E({description:"Most recent time this ingestion key was observed for the service."})},{description:"An ingestion API key observed on telemetry for this service, with the last time it was seen."}),Gj=t.Object({version:t.String({description:"Service version value observed in telemetry."}),firstSeenAt:E({description:"First time this version was observed for the service."}),lastSeenAt:E({description:"Most recent time this version was observed for the service."}),faulty: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."}),$j=t.Object({language:t.String({description:"Programming language observed for this service."}),lastSeenAt:E({description:"Most recent time this language was observed."})},{description:"A programming language observed for this service, with the last time it was seen."}),jj=t.Object({runtime:t.String({description:"Runtime observed for this service."}),lastSeenAt:E({description:"Most recent time this runtime was observed."})},{description:"A runtime observed for this service, with the last time it was seen."}),MO=t.Object({protocol:t.String({description:"Observed API protocol (e.g. 'http', 'grpc', 'graphql')"}),lastSeenAt:E({description:"Most recent observation timestamp"})},{description:"An API protocol observed for this service, with the last time it was seen."}),qj=t.Object({framework:t.String({description:"Observed application framework (e.g. 'express', 'fastify', 'django', 'rails')"}),lastSeenAt:E({description:"Most recent observation timestamp"})},{description:"An application framework detected from OpenTelemetry instrumentation scope, with the last time it was seen."}),Bj=t.Object({platform:t.String({description:"Observed cloud or orchestration platform (e.g. 'aws_eks', 'kubernetes')"}),lastSeenAt:E({description:"Most recent observation timestamp"})},{description:"A cloud or orchestration platform this service runs on, with the last time it was seen."}),Fj=t.Object({provider:t.String({description:"Observed cloud provider (e.g. 'aws', 'gcp', 'azure')"}),lastSeenAt:E({description:"Most recent observation timestamp"})},{description:"A cloud provider this service runs on, with the last time it was seen."}),Ma=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(Mj,{description:"Team names observed on telemetry for this service and when each was last seen."}),ingestionApiKeys:t.Array(Dj,{description:"Ingestion API keys observed on telemetry for this service and when each was last seen."}),versions:t.Array(Gj,{description:"Service version values observed in telemetry, including first and last seen timestamps."}),languages:t.Array($j,{description:"Programming languages observed for this service."}),runtimes:t.Array(jj,{description:"Runtime values observed for this service."}),serverProtocols:t.Array(MO,{description:"API protocols this service exposes (from server-kind spans)"}),clientProtocols:t.Array(MO,{description:"API protocols this service calls out over (from client-kind spans)"}),frameworks:t.Array(qj,{description:"Application frameworks detected from OTel instrumentation scope"}),cloudPlatforms:t.Array(Bj,{description:"Cloud platforms this service is running on"}),cloudProviders:t.Array(Fj,{description:"Cloud providers this service is running on"}),lastSeenAt:E({description:"Most recent time Tsuga observed telemetry for this service."}),firstSeenAt:E({description:"First time Tsuga observed telemetry for this service."}),sources: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:E({description:"Timestamp when Tsuga created this service catalog entry."}),updatedAt:E({description:"Timestamp when Tsuga last updated this service catalog entry."})}),fCe=m({tags:["service-catalog"],query:t.Object({...ye,clusterId:t.Optional(p())}),method:"GET",paginated:!0,url:`${Lt}/services`,response:t.Array(Ma)}),Hj=t.Object({spanKind:t.Enum(XS),count:t.Number()}),DO=t.Object({...Ma.properties,spanKindCounts:t.Array(Hj),envs:t.Object({primaryEnv:t.String(),allEnvs:t.Array(t.String())})}),gCe=m({tags:["service-catalog"],query:t.Object({...ye,clusterId:t.Optional(p()),env:t.Optional(p())}),method:"GET",paginated:!0,url:`${Lt}/v2/services`,response:t.Array(DO)}),yCe=m({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:DO}),hCe=m({tags:["service-catalog"],method:"GET",url:`${Lt}/services/:serviceId`,params:t.Object({serviceId:p()}),response:Ma}),zl=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:La.properties.config,rateLimit:La.properties.rateLimit,createdAt:E({description:"Timestamp when user created this service target."}),updatedAt:E({description:"Timestamp when user last updated this service target."})}),Kj=t.Object({config:Jo.properties.config,rateLimit:Jo.properties.rateLimit}),zj=t.Object({config:Jo.properties.config,rateLimit:t.Union([ql,t.Null()])}),TCe=m({tags:["service-catalog"],method:"GET",url:`${Lt}/services/:serviceId/targets`,params:t.Object({serviceId:p()}),response:t.Array(zl)}),ECe=m({tags:["service-catalog"],method:"POST",url:`${Lt}/services/:serviceId/targets`,params:t.Object({serviceId:p()}),body:Kj,response:zl}),_Ce=m({tags:["service-catalog"],method:"PUT",url:`${Lt}/services/:serviceId/targets/:targetId`,params:t.Object({serviceId:p(),targetId:p()}),body:zj,response:zl}),ICe=m({tags:["service-catalog"],method:"DELETE",url:`${Lt}/services/:serviceId/targets/:targetId`,params:t.Object({serviceId:p(),targetId:p()}),response:R}),Yj=["otel_kube","otel_host_kube","otel_host","prometheus","aws_ec2","gcp_compute_engine"];var GO=t.Object({id:t.String(),hostName:t.String(),env:t.Optional(t.String()),cpuUtilizationAverage:t.Number(),hostType:t.Enum(Yj),teams:t.Array(t.String()),tags:t.Array(t.String()),firstSeenAt:E(),lastSeenAt:E(),clusterId:t.String()}),bCe=m({tags:["service-catalog"],method:"GET",url:`${Lt}/hosts`,response:t.Array(GO)}),SCe=m({tags:["service-catalog"],method:"GET",url:`${Lt}/hosts/:hostId`,params:t.Object({hostId:p()}),response:GO}),Vj=["http","rpc","messaging","genai","object_store"],$O={name:t.String({description:"Service or inferred dependency name shown in the graph."}),env:t.Optional(t.String({description:"Environment observed from spans."}))},Yl=t.Object({...$O,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."})}),jO={...$O,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"}))},Vl=t.Object({...jO,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`."})}),Ql=t.Object({...jO,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(Vj,{description:"Inferred dependency type from span metadata: http, rpc, messaging, genai, or object_store."})}),Qj=b("nodeType",[Yl,Vl,Ql]),Wl=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."}),OCe=m({tags:["service-catalog"],url:`${Lt}/services/:serviceId/graph`,method:"GET",params:t.Object({serviceId:p()}),query:t.Object({...Ye.properties,query:t.Optional(p({type:"tsuga-query"}))}),response:t.Object({clusterId:t.String(),nodes:t.Array(Qj),edges:t.Array(Wl)})}),Wj=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"})}))}),ACe=m({tags:["service-catalog"],method:"GET",url:`${Lt}/services/:serviceId/related-resources`,params:t.Object({serviceId:p()}),response:Wj}),xCe=m({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 Zl=`/${"v1"}/services`,Xl=t.Pick(Ma,["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)."}),Zj={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(Xl,{examples:[Zj]});var qO=m({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:Zl,method:"GET",paginated:!0,query:t.Object({...ze,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(Xl)}),BO=m({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:`${Zl}/: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:Xl}),Xj=t.Pick(Yl,["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."}),Jj=t.Pick(Ql,["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."}),eq=t.Pick(Vl,["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."}),tq=b("nodeType",[Xj,eq,Jj]),rq=t.Pick(Wl,["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."}),nq=t.Optional(t.Integer({...Ye.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."})),oq=t.Optional(t.Integer({...Ye.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."})),iq=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."}),FO=m({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:`${Zl}/: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:nq,to:oq,query:t.Optional(iq)},{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(tq,{description:"Observed and inferred nodes included in the service dependency graph."}),edges:t.Array(rq,{description:"Directed dependency edges between graph nodes."})})});var xe=" (unix seconds, ISO 8601, or relative like -1h/-30m/now)";function HO(e,r){let n=r??Er(e);return n===void 0?void 0:zs(n)}function Jl(e){let r=Er(e);return r===void 0?"":` (default: ${r})`}function KO(e,r){e.command("service-graph").description("Inspect service dependency graphs").command("get <SERVICE_ID>").description("Retrieve the dependency graph for a service").option("--from <TIMESTAMP>",`Start of time range${xe}${Jl("from")}`).option("--to <TIMESTAMP>",`End of time range${xe}${Jl("to")}`).option("--query <TSUGA_QUERY>",`Tsuga query to filter graph spans${Jl("query")}`).action(async(o,i)=>{let a={},c=HO("from",i.from),l=HO("to",i.to);c!==void 0&&(a.from=c),l!==void 0&&(a.to=l),i.query!==void 0&&(a.query=i.query);let d=await r()(FO,{params:{serviceId:o},query:a});Q(d)})}var aq=`/${"v1"}/grok`,sq=25,cq=100,zO=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:sq,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:cq,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."}),pq={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(zO,{examples:[pq]});var YO=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."}),uq={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(YO,{examples:[uq]});var VO=m({url:`${aq}/parse`,method:"POST",operationId:"parseGrok",tags:["public","grok"],body:zO,response:YO,description:"Parses sample log lines with Grok rules and returns extracted fields, using the same Grok engine as the log route processor. Use this endpoint to author and test route Grok rules before saving them. The operation requires public API read access to log routes. A rule that fails to compile returns a 400 response with error code `GROK_RULE_VALIDATION_ERROR` and structured details in `error.details.ruleErrors`."});var QO=In(require("node:fs"));function ti(e){if(e.file){let r=QO.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_PATH> or -d <JSON>. Use --generate-skeleton to get a template.")}function lq(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")&&lq(e["~guard"])}function tm(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 xr(e){return s.IsObject(e)&&!s.IsArray(e)}function pp(e){return s.IsBoolean(e)}function j(e){return xr(e)||pp(e)}function rm(e){return s.HasPropertyKey(e,"additionalItems")&&j(e.additionalItems)}function Rr(e){return s.HasPropertyKey(e,"additionalProperties")&&j(e.additionalProperties)}function nm(e){return s.HasPropertyKey(e,"allOf")&&s.IsArray(e.allOf)&&e.allOf.every(r=>j(r))}function Da(e){return s.HasPropertyKey(e,"$anchor")&&s.IsString(e.$anchor)}function om(e){return s.HasPropertyKey(e,"anyOf")&&s.IsArray(e.anyOf)&&e.anyOf.every(r=>j(r))}function im(e){return s.HasPropertyKey(e,"const")}function zn(e){return s.HasPropertyKey(e,"contains")&&j(e.contains)}function vt(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 sm(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 cm(e){return s.HasPropertyKey(e,"dependentSchemas")&&s.IsObject(e.dependentSchemas)&&Object.values(e.dependentSchemas).every(r=>j(r))}function pm(e){return s.HasPropertyKey(e,"$dynamicAnchor")&&s.IsString(e.$dynamicAnchor)}function um(e){return s.HasPropertyKey(e,"else")&&j(e.else)}function lm(e){return s.HasPropertyKey(e,"enum")&&s.IsArray(e.enum)}function mm(e){return s.HasPropertyKey(e,"exclusiveMaximum")&&(s.IsNumber(e.exclusiveMaximum)||s.IsBigInt(e.exclusiveMaximum))}function Cr(e){return s.HasPropertyKey(e,"exclusiveMinimum")&&(s.IsNumber(e.exclusiveMinimum)||s.IsBigInt(e.exclusiveMinimum))}function Ga(e){return s.HasPropertyKey(e,"format")&&s.IsString(e.format)}function Yn(e){return s.HasPropertyKey(e,"$id")&&s.IsString(e.$id)}function dm(e){return s.HasPropertyKey(e,"if")&&j(e.if)}function ri(e){return s.HasPropertyKey(e,"items")&&(j(e.items)||s.IsArray(e.items)&&e.items.every(r=>j(r)))}function fm(e){return ri(e)&&s.IsArray(e.items)}function gm(e){return s.HasPropertyKey(e,"maximum")&&(s.IsNumber(e.maximum)||s.IsBigInt(e.maximum))}function ym(e){return s.HasPropertyKey(e,"maxContains")&&s.IsNumber(e.maxContains)}function up(e){return s.HasPropertyKey(e,"maxItems")&&s.IsNumber(e.maxItems)}function hm(e){return s.HasPropertyKey(e,"maxLength")&&s.IsNumber(e.maxLength)}function Tm(e){return s.HasPropertyKey(e,"maxProperties")&&s.IsNumber(e.maxProperties)}function Pr(e){return s.HasPropertyKey(e,"minimum")&&(s.IsNumber(e.minimum)||s.IsBigInt(e.minimum))}function Vn(e){return s.HasPropertyKey(e,"minContains")&&s.IsNumber(e.minContains)}function ni(e){return s.HasPropertyKey(e,"minItems")&&s.IsNumber(e.minItems)}function $a(e){return s.HasPropertyKey(e,"minLength")&&s.IsNumber(e.minLength)}function ja(e){return s.HasPropertyKey(e,"minProperties")&&s.IsNumber(e.minProperties)}function Em(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 Im(e){return s.HasPropertyKey(e,"oneOf")&&s.IsArray(e.oneOf)&&e.oneOf.every(r=>j(r))}function qa(e){return s.HasPropertyKey(e,"pattern")&&(s.IsString(e.pattern)||e.pattern instanceof RegExp)}function Ba(e){return s.HasPropertyKey(e,"patternProperties")&&s.IsObject(e.patternProperties)&&Object.values(e.patternProperties).every(r=>j(r))}function oi(e){return s.HasPropertyKey(e,"prefixItems")&&s.IsArray(e.prefixItems)&&e.prefixItems.every(r=>j(r))}function Fa(e){return s.HasPropertyKey(e,"properties")&&s.IsObject(e.properties)&&Object.values(e.properties).every(r=>j(r))}function bm(e){return s.HasPropertyKey(e,"propertyNames")&&(s.IsObject(e.propertyNames)||j(e.propertyNames))}function mq(e){return s.HasPropertyKey(e,"$recursiveAnchor")&&s.IsBoolean(e.$recursiveAnchor)}function lp(e){return mq(e)&&s.IsEqual(e.$recursiveAnchor,!0)}function Sm(e){return s.HasPropertyKey(e,"$recursiveRef")&&s.IsString(e.$recursiveRef)}function Om(e){return s.HasPropertyKey(e,"$ref")&&s.IsString(e.$ref)}function Qn(e){return s.HasPropertyKey(e,"required")&&s.IsArray(e.required)&&e.required.every(r=>s.IsString(r))}function Am(e){return s.HasPropertyKey(e,"then")&&j(e.then)}function xm(e){return s.HasPropertyKey(e,"type")&&(s.IsString(e.type)||s.IsArray(e.type)&&e.type.every(r=>s.IsString(r)))}function ii(e){return s.HasPropertyKey(e,"uniqueItems")&&s.IsBoolean(e.uniqueItems)}function mp(e){return s.HasPropertyKey(e,"unevaluatedItems")&&j(e.unevaluatedItems)}function dp(e){return s.HasPropertyKey(e,"unevaluatedProperties")&&j(e.unevaluatedProperties)}var yt=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}},Ha=class extends yt{constructor(r){super(),this.callback=r}AddError(r){return this.callback(r),!1}},Qe=class extends Ha{constructor(){super(r=>this.errors.push(r)),this.errors=[]}AddError(r){return this.errors.push(r),!1}GetErrors(){return this.errors}};var dq="external_",fq=0,hNe={identifier:`${dq}${fq}`,variables:[]};function WO(e,r,n,o){return n["~guard"].check(o)}function ZO(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 XO(e,r,n,o){return s.Every(n["~refine"],0,(i,a)=>i.refine(o))}function JO(e,r,n,o,i,a){return s.EveryAll(i["~refine"],0,(c,l)=>c.refine(a)||r.AddError({keyword:"~refine",schemaPath:n,instancePath:o,params:{index:l,message:c.message}}))}function eA(e){return ri(e)&&s.IsArray(e.items)}function tA(e,r,n,o){return eA(n)?o.every((a,c)=>s.IsLessThan(c,n.items.length)||G(e,r,n.additionalItems,a)&&r.AddIndex(c)):!0}function rA(e,r,n,o,i,a){return eA(i)?a.every((l,d)=>{let f=`${n}/additionalItems`,g=`${o}/${d}`;return s.IsLessThan(d,i.items.length)||W(e,r,f,g,i.additionalItems,l)&&r.AddIndex(d)}):!0}function gq(e){return`^${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}$`}function nA(e){let r=[];return Ba(e)&&r.push(...s.Keys(e.patternProperties)),Fa(e)&&r.push(...s.Keys(e.properties).map(gq)),s.IsEqual(r.length,0)?"(?!)":`(${r.join("|")})`}function oA(e,r,n,o){let i=new RegExp(nA(n));return s.Every(s.Keys(o),0,(c,l)=>i.test(c)||G(e,r,n.additionalProperties,o[c])&&r.AddKey(c))}function iA(e,r,n,o,i,a){let c=new RegExp(nA(i)),l=[];return s.EveryAll(s.Keys(a),0,(f,g)=>{let T=`${n}/additionalProperties`,_=`${o}/${f}`,ae=new Qe,fe=c.test(f)||W(e,ae,T,_,i.additionalProperties,a[f])&&r.AddKey(f);return fe||l.push(f),fe})||r.AddError({keyword:"additionalProperties",schemaPath:n,instancePath:o,params:{additionalProperties:l}})}function aA(e,r,n,o){let i=n.allOf.reduce((a,c)=>{let l=new yt;return G(e,l,c,o)?[...a,l]:a},[]);return s.IsEqual(i.length,n.allOf.length)&&r.Merge(i)}function sA(e,r,n,o,i,a){let c=[],l=i.allOf.reduce((f,g,T)=>{let _=`${n}/allOf/${T}`,ae=new Qe,fe=W(e,ae,_,o,g,a);return fe||c.push(ae),fe?[...f,ae]:f},[]),d=s.IsEqual(l.length,i.allOf.length)&&r.Merge(l);return d||c.forEach(f=>f.GetErrors().forEach(g=>r.AddError(g))),d}function cA(e,r,n,o){let i=n.anyOf.reduce((a,c,l)=>{let d=new yt;return G(e,d,c,o)?[...a,d]:a},[]);return s.IsGreaterThan(i.length,0)&&r.Merge(i)}function pA(e,r,n,o,i,a){let c=[],l=i.anyOf.reduce((f,g,T)=>{let _=new Qe,ae=`${n}/anyOf/${T}`,fe=W(e,_,ae,o,g,a);return fe||c.push(_),fe?[...f,_]:f},[]),d=s.IsGreaterThan(l.length,0)&&r.Merge(l);return d||c.forEach(f=>f.GetErrors().forEach(g=>r.AddError(g))),d||r.AddError({keyword:"anyOf",schemaPath:n,instancePath:o,params:{}})}function Cm(e,r,n,o){return n}function uA(e,r,n,o,i,a){return Cm(e,r,i,a)||r.AddError({keyword:"boolean",schemaPath:n,instancePath:o,params:{}})}function Pm(e,r,n,o){return s.IsValueLike(n.const)?s.IsEqual(o,n.const):s.IsDeepEqual(o,n.const)}function lA(e,r,n,o,i,a){return Pm(e,r,i,a)||r.AddError({keyword:"const",schemaPath:n,instancePath:o,params:{allowedValue:i.const}})}function yq(e){return!(Vn(e)&&s.IsEqual(e.minContains,0))}function Um(e,r,n,o){return yq(n)?!s.IsEqual(o.length,0)&&o.some(i=>G(e,r,n.contains,i)):!0}function mA(e,r,n,o,i,a){return Um(e,r,i,a)||r.AddError({keyword:"contains",schemaPath:n,instancePath:o,params:{minContains:1}})}function dA(e,r,n,o){let i=s.IsEqual(s.Keys(o).length,0),a=s.Every(s.Entries(n.dependencies),0,([c,l])=>!s.HasPropertyKey(o,c)||(s.IsArray(l)?l.every(d=>s.HasPropertyKey(o,d)):G(e,r,l,o)));return i||a}function fA(e,r,n,o,i,a){let c=s.IsEqual(s.Keys(a).length,0),l=s.EveryAll(s.Entries(i.dependencies),0,([d,f])=>{let g=`${n}/dependencies/${d}`;return!s.HasPropertyKey(a,d)||(s.IsArray(f)?f.every(T=>s.HasPropertyKey(a,T)||r.AddError({keyword:"dependencies",schemaPath:n,instancePath:o,params:{property:d,dependencies:f}})):W(e,r,g,o,f,a))});return c||l}function gA(e,r,n,o){let i=s.IsEqual(s.Keys(o).length,0),a=s.Every(s.Entries(n.dependentRequired),0,([c,l])=>!s.HasPropertyKey(o,c)||l.every(d=>s.HasPropertyKey(o,d)));return i||a}function yA(e,r,n,o,i,a){let c=s.IsEqual(s.Keys(a).length,0),l=s.EveryAll(s.Entries(i.dependentRequired),0,([d,f])=>!s.HasPropertyKey(a,d)||s.EveryAll(f,0,g=>s.HasPropertyKey(a,g)||r.AddError({keyword:"dependentRequired",schemaPath:n,instancePath:o,params:{property:d,dependencies:f}})));return c||l}function hA(e,r,n,o){let i=s.IsEqual(s.Keys(o).length,0),a=s.Every(s.Entries(n.dependentSchemas),0,([c,l])=>!s.HasPropertyKey(o,c)||G(e,r,l,o));return i||a}function TA(e,r,n,o,i,a){let c=s.IsEqual(s.Keys(a).length,0),l=s.EveryAll(s.Entries(i.dependentSchemas),0,([d,f])=>{let g=`${n}/dependentSchemas/${d}`;return!s.HasPropertyKey(a,d)||W(e,r,g,o,f,a)});return c||l}function wm(e,r,n,o){return n.enum.some(i=>s.IsValueLike(i)?s.IsEqual(o,i):s.IsDeepEqual(o,i))}function EA(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 Nm(e,r,n,o){return s.IsLessThan(o,n.exclusiveMaximum)}function _A(e,r,n,o,i,a){return Nm(e,r,i,a)||r.AddError({keyword:"exclusiveMaximum",schemaPath:n,instancePath:o,params:{comparison:"<",limit:i.exclusiveMaximum}})}function Lm(e,r,n,o){return s.IsGreaterThan(o,n.exclusiveMinimum)}function IA(e,r,n,o,i,a){return Lm(e,r,i,a)||r.AddError({keyword:"exclusiveMinimum",schemaPath:n,instancePath:o,params:{comparison:">",limit:i.exclusiveMinimum}})}var si={};Mt(si,{Clear:()=>SA,Entries:()=>kq,Get:()=>Gq,Has:()=>Dq,IsDate:()=>Ka,IsDateTime:()=>vm,IsDuration:()=>km,IsEmail:()=>Mm,IsHostname:()=>Dm,IsIPv4:()=>qm,IsIPv6:()=>Bm,IsIdnEmail:()=>Gm,IsIdnHostname:()=>jm,IsIri:()=>Hm,IsIriReference:()=>Fm,IsJsonPointer:()=>zm,IsJsonPointerUriFragment:()=>Km,IsRegex:()=>Ym,IsRelativeJsonPointer:()=>Vm,IsTime:()=>za,IsUri:()=>Zm,IsUriReference:()=>Qm,IsUriTemplate:()=>Wm,IsUrl:()=>Xm,IsUuid:()=>Jm,Reset:()=>OA,Set:()=>Mq,Test:()=>$q});var hq=[0,31,28,31,30,31,30,31,31,30,31,30,31],Tq=/^(\d\d\d\d)-(\d\d)-(\d\d)$/;function Eq(e){return e%4===0&&(e%100!==0||e%400===0)}function Ka(e){let r=Tq.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&&Eq(n)?29:hq[o])}var _q=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(?:Z|([+-])(\d\d):(\d\d))?$/i;function za(e,r=!0){let n=_q.exec(e);if(!n)return!1;let o=+n[1],i=+n[2],a=+n[3],c=n[4]==="-"?-1:1,l=+(n[5]||0),d=+(n[6]||0);if(l>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,g=o-l*c-(f<0?1:0);return(g===23||g===-1)&&(f===59||f===-1)&&a<61}function vm(e,r=!0){let n=e.split(/T/i);return n.length===2&&Ka(n[0])&&za(n[1],r)}var Iq=/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/;function km(e){return Iq.test(e)}var bq=/^(?!.*\.\.)[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 Mm(e){return bq.test(e)}var Sq=/^(?=.{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 Dm(e){return Sq.test(e)}var Oq=/^(?!.*\.\.)[\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 Gm(e){return Oq.test(e)}function $m(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 jm(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 g=i.charAt(d-1),T=i.charAt(d+1);if(!/^[lL]$/.test(g)||!/^[lL]$/.test(T))return!1}if(f==="\u30FB"){if(i.length===1)return!1;if(d===0){let g=i.charAt(d+1);if(!$m(g))return!1}else{let g=i.charAt(d-1),T=i.charAt(d+1);if(!$m(g)||!$m(T))return!1}}if(f==="\u0375"){if(d===i.length-1)return!1;let g=i.charAt(d+1);if(!/[\u0370-\u03FF]/.test(g))return!1}if(f==="\u05F3"||f==="\u05F4"){if(d===0)return!1;let g=i.charAt(d-1);if(!/[\u05D0-\u05EA]/.test(g))return!1}if(f==="\u200D"&&(d===0||i.charAt(d-1)!=="\u094D"))return!1}let c=!1,l=!1;for(let d=0;d<i.length;d++){let f=i.charAt(d);/[\u0660-\u0669]/.test(f)&&(c=!0),/[\u06F0-\u06F9]/.test(f)&&(l=!0)}if(c&&l)return!1}return!0}var Aq=/^(?:(?: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 qm(e){return Aq.test(e)}var xq=/^((([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 Bm(e){return xq.test(e)}function bA(e){try{return new URL(e,"http://example.com"),!0}catch{return!1}}function Fm(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))?bA(e):e.match(/^([a-zA-Z][a-zA-Z0-9+\-.]*)(\/\/)/)&&r===-1?!1:bA(e)}function Hm(e){try{return new URL(e),!0}catch{return!1}}var Rq=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;function Km(e){return Rq.test(e)}var Cq=/^(?:\/(?:[^~/]|~0|~1)*)*$/;function zm(e){return Cq.test(e)}function Ym(e){if(e.length===0)return!1;try{return new RegExp(e),!0}catch{return!1}}var Pq=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function Vm(e){return Pq.test(e)}var Uq=/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i;function Qm(e){return Uq.test(e)}var wq=/^(?:(?:[^\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 Wm(e){return wq.test(e)}var Nq=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i;function Zm(e){return Nq.test(e)}var Lq=/^(?: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 Xm(e){return Lq.test(e)}var vq=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;function Jm(e){return vq.test(e)}var he=new Map;function SA(){he.clear()}function kq(){return[...he.entries()]}function Mq(e,r){he.set(e,r)}function Dq(e){return he.has(e)}function Gq(e){return he.get(e)}function $q(e,r){return he.get(e)?.(r)??!0}function OA(){SA(),he.set("date-time",vm),he.set("date",Ka),he.set("duration",km),he.set("email",Mm),he.set("hostname",Dm),he.set("idn-email",Gm),he.set("idn-hostname",jm),he.set("ipv4",qm),he.set("ipv6",Bm),he.set("iri-reference",Fm),he.set("iri",Hm),he.set("json-pointer-uri-fragment",Km),he.set("json-pointer",zm),he.set("regex",Ym),he.set("relative-json-pointer",Vm),he.set("time",za),he.set("uri-reference",Qm),he.set("uri-template",Wm),he.set("uri",Zm),he.set("url",Xm),he.set("uuid",Jm)}OA();function ed(e,r,n,o){return si.Test(n.format,o)}function AA(e,r,n,o,i,a){return ed(e,r,i,a)||r.AddError({keyword:"format",schemaPath:n,instancePath:o,params:{format:i.format}})}function xA(e,r,n,o){let i=Am(n)?n.then:!0,a=um(n)?n.else:!0;return G(e,r,n.if,o)?G(e,r,i,o):G(e,r,a,o)}function RA(e,r,n,o,i,a){let c=Am(i)?i.then:!0,l=um(i)?i.else:!0,d=new Qe,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,l,a)||r.AddError({keyword:"if",schemaPath:n,instancePath:o,params:{failingKeyword:"else"}});return f&&r.Merge([d]),f}function jq(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 qq(e,r,n,o,i,a){return s.EveryAll(i.items,0,(c,l)=>{let d=`${n}/items/${l}`,f=`${o}/${l}`;return s.IsLessEqualThan(a.length,l)||W(e,r,d,f,c,a[l])&&r.AddIndex(l)})}function Bq(e,r,n,o){let i=oi(n)?n.prefixItems.length:0;return s.Every(o,i,(a,c)=>G(e,r,n.items,a)&&r.AddIndex(c))}function Fq(e,r,n,o,i,a){let c=oi(i)?i.prefixItems.length:0;return s.EveryAll(a,c,(l,d)=>{let f=`${n}/items`,g=`${o}/${d}`;return W(e,r,f,g,i.items,l)&&r.AddIndex(d)})}function CA(e,r,n,o){return fm(n)?jq(e,r,n,o):Bq(e,r,n,o)}function PA(e,r,n,o,i,a){return fm(i)?qq(e,r,n,o,i,a):Fq(e,r,n,o,i,a)}function Hq(e){return zn(e)}function td(e,r,n,o){if(!Hq(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 UA(e,r,n,o,i,a){let c=Vn(i)?i.minContains:1;return td(e,r,i,a)||r.AddError({keyword:"contains",schemaPath:n,instancePath:o,params:{minContains:c,maxContains:i.maxContains}})}function rd(e,r,n,o){return s.IsLessEqualThan(o,n.maximum)}function wA(e,r,n,o,i,a){return rd(e,r,i,a)||r.AddError({keyword:"maximum",schemaPath:n,instancePath:o,params:{comparison:"<=",limit:i.maximum}})}function nd(e,r,n,o){return s.IsLessEqualThan(o.length,n.maxItems)}function NA(e,r,n,o,i,a){return nd(e,r,i,a)||r.AddError({keyword:"maxItems",schemaPath:n,instancePath:o,params:{limit:i.maxItems}})}function od(e,r,n,o){return s.IsMaxLength(o,n.maxLength)}function LA(e,r,n,o,i,a){return od(e,r,i,a)||r.AddError({keyword:"maxLength",schemaPath:n,instancePath:o,params:{limit:i.maxLength}})}function id(e,r,n,o){return s.IsLessEqualThan(s.Keys(o).length,n.maxProperties)}function vA(e,r,n,o,i,a){return id(e,r,i,a)||r.AddError({keyword:"maxProperties",schemaPath:n,instancePath:o,params:{limit:i.maxProperties}})}function Kq(e){return zn(e)}function ad(e,r,n,o){if(!Kq(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 kA(e,r,n,o,i,a){return ad(e,r,i,a)||r.AddError({keyword:"contains",schemaPath:n,instancePath:o,params:{minContains:i.minContains}})}function sd(e,r,n,o){return s.IsGreaterEqualThan(o,n.minimum)}function MA(e,r,n,o,i,a){return sd(e,r,i,a)||r.AddError({keyword:"minimum",schemaPath:n,instancePath:o,params:{comparison:">=",limit:i.minimum}})}function cd(e,r,n,o){return s.IsGreaterEqualThan(o.length,n.minItems)}function DA(e,r,n,o,i,a){return cd(e,r,i,a)||r.AddError({keyword:"minItems",schemaPath:n,instancePath:o,params:{limit:i.minItems}})}function pd(e,r,n,o){return s.IsMinLength(o,n.minLength)}function GA(e,r,n,o,i,a){return pd(e,r,i,a)||r.AddError({keyword:"minLength",schemaPath:n,instancePath:o,params:{limit:i.minLength}})}function ud(e,r,n,o){return s.IsGreaterEqualThan(s.Keys(o).length,n.minProperties)}function $A(e,r,n,o,i,a){return ud(e,r,i,a)||r.AddError({keyword:"minProperties",schemaPath:n,instancePath:o,params:{limit:i.minProperties}})}function ld(e,r,n,o){return s.IsMultipleOf(o,n.multipleOf)}function jA(e,r,n,o,i,a){return ld(e,r,i,a)||r.AddError({keyword:"multipleOf",schemaPath:n,instancePath:o,params:{multipleOf:i.multipleOf}})}function md(e,r,n,o){let i=new yt;return!G(e,i,n.not,o)&&r.Merge([i])}function qA(e,r,n,o,i,a){return md(e,r,i,a)||r.AddError({keyword:"not",schemaPath:n,instancePath:o,params:{}})}function BA(e,r,n,o){let i=n.oneOf.reduce((a,c)=>{let l=new yt;return G(e,l,c,o)?[...a,l]:a},[]);return s.IsEqual(i.length,1)&&r.Merge(i)}function FA(e,r,n,o,i,a){let c=[],l=[],d=i.oneOf.reduce((g,T,_)=>{let ae=new Qe,fe=`${n}/oneOf/${_}`,Gr=W(e,ae,fe,o,T,a);return Gr&&l.push(_),Gr||c.push(ae),Gr?[...g,ae]:g},[]),f=s.IsEqual(d.length,1)&&r.Merge(d);return!f&&s.IsEqual(l.length,0)&&c.forEach(g=>g.GetErrors().forEach(T=>r.AddError(T))),f||r.AddError({keyword:"oneOf",schemaPath:n,instancePath:o,params:{passingSchemas:l}})}function dd(e,r,n,o){return(s.IsString(n.pattern)?new RegExp(n.pattern):n.pattern).test(o)}function HA(e,r,n,o,i,a){return dd(e,r,i,a)||r.AddError({keyword:"pattern",schemaPath:n,instancePath:o,params:{pattern:i.pattern}})}function KA(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,([l,d])=>!c.test(l)||G(e,r,a,d)&&r.AddKey(l))})}function zA(e,r,n,o,i,a){return s.EveryAll(s.Entries(i.patternProperties),0,([c,l])=>{let d=`${n}/patternProperties/${c}`,f=new RegExp(c);return s.EveryAll(s.Entries(a),0,([g,T])=>{let _=`${o}/${g}`;return!f.test(g)||W(e,r,d,_,l,T)&&r.AddKey(g)})})}function YA(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 VA(e,r,n,o,i,a){return s.IsEqual(a.length,0)||s.EveryAll(i.prefixItems,0,(c,l)=>{let d=`${n}/prefixItems/${l}`,f=`${o}/${l}`;return s.IsLessEqualThan(a.length,l)||W(e,r,d,f,c,a[l])&&r.AddIndex(l)})}function fd(e,r){return e.includes(r)||Pt.Get().exactOptionalPropertyTypes}function gd(e,r){return s.IsUndefined(e[r])}function QA(e,r,n,o){let i=Qn(n)?n.required:[];return s.Every(s.Entries(n.properties),0,([c,l])=>{let d=!s.HasPropertyKey(o,c)||G(e,r,l,o[c])&&r.AddKey(c);return fd(i,c)?d:gd(o,c)||d})}function WA(e,r,n,o,i,a){let c=Qn(i)?i.required:[];return s.EveryAll(s.Entries(i.properties),0,([d,f])=>{let g=`${n}/properties/${d}`,T=`${o}/${d}`,_=()=>!s.HasPropertyKey(a,d)||W(e,r,g,T,f,a[d])&&r.AddKey(d);return fd(c,d)?_():gd(a,d)||_()})}function ZA(e,r,n,o){return s.Every(s.Keys(o),0,(i,a)=>G(e,r,n.propertyNames,i))}function XA(e,r,n,o,i,a){let c=[];return s.EveryAll(s.Keys(a),0,(d,f)=>{let g=`${o}/${d}`,T=`${n}/propertyNames`,_=new Qe,ae=W(e,_,T,g,i.propertyNames,d);return ae||c.push(d),ae})||r.AddError({keyword:"propertyNames",schemaPath:n,instancePath:o,params:{propertyNames:c}})}function JA(e,r,n,o){let i=e.RecursiveRef(n.$recursiveRef)??!1;return j(i)&&G(e,r,i,o)}function ex(e,r,n,o,i,a){let c=e.RecursiveRef(i.$recursiveRef)??!1;return j(c)&&W(e,r,"#",o,c,a)}function nx(e,r,n,o){let i=e.Ref(n.$ref)??!1,a=new yt,c=j(i)&&G(e,a,i,o);return c&&r.Merge([a]),c}function ox(e,r,n,o,i,a){let c=e.Ref(i.$ref)??!1,l=new Qe,d=j(c)&&W(e,l,"#",o,c,a);return d&&r.Merge([l]),d||l.GetErrors().forEach(f=>r.AddError(f)),d}function ix(e,r,n,o){return s.Every(n.required,0,i=>s.HasPropertyKey(o,i))}function ax(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 yd(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 sx(e,r,n,o,i){return n.some(a=>yd(e,r,a,o,i))}function cx(e,r,n,o){return s.IsArray(n.type)?sx(e,r,n.type,n,o):yd(e,r,n.type,n,o)}function px(e,r,n,o,i,a){return(s.IsArray(i.type)?sx(e,r,i.type,i,a):yd(e,r,i.type,i,a))||r.AddError({keyword:"type",schemaPath:n,instancePath:o,params:{type:i.type}})}function ux(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 lx(e,r,n,o,i,a){let c=r.GetIndices(),l=[];return s.EveryAll(a,0,(f,g)=>{let T=new Qe,_=(c.has(g)||W(e,T,n,o,i.unevaluatedItems,f))&&r.AddIndex(g);return _||l.push(g),_})||r.AddError({keyword:"unevaluatedItems",schemaPath:n,instancePath:o,params:{unevaluatedItems:l}})}function mx(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 dx(e,r,n,o,i,a){let c=r.GetKeys(),l=[];return s.EveryAll(s.Entries(a),0,([f,g])=>{let T=new Qe,_=c.has(f)||W(e,T,n,o,i.unevaluatedProperties,g)&&r.AddKey(f);return _||l.push(f),_})||r.AddError({keyword:"unevaluatedProperties",schemaPath:n,instancePath:o,params:{unevaluatedProperties:l}})}function fx(e){return!s.IsEqual(e.uniqueItems,!1)}function gx(e,r,n,o){if(!fx(n))return!0;let i=new Set(o.map(Vr.Hash)).size,a=o.length;return s.IsEqual(i,a)}function yx(e,r,n,o,i,a){if(!fx(i))return!0;let c=new Set,l=a.reduce((f,g,T)=>{let _=Vr.Hash(g);return c.has(_)?[...f,T]:(c.add(_),f)},[]);return s.IsEqual(l.length,0)||r.AddError({keyword:"uniqueItems",schemaPath:n,instancePath:o,params:{duplicateItems:l}})}function G(e,r,n,o){e.Push(n);let i=pp(n)?Cm(e,r,n,o):(!xm(n)||cx(e,r,n,o))&&(!(s.IsObject(o)&&!s.IsArray(o))||(!Qn(n)||ix(e,r,n,o))&&(!Rr(n)||oA(e,r,n,o))&&(!am(n)||dA(e,r,n,o))&&(!sm(n)||gA(e,r,n,o))&&(!cm(n)||hA(e,r,n,o))&&(!Ba(n)||KA(e,r,n,o))&&(!Fa(n)||QA(e,r,n,o))&&(!bm(n)||ZA(e,r,n,o))&&(!ja(n)||ud(e,r,n,o))&&(!Tm(n)||id(e,r,n,o)))&&(!s.IsArray(o)||(!rm(n)||tA(e,r,n,o))&&(!zn(n)||Um(e,r,n,o))&&(!ri(n)||CA(e,r,n,o))&&(!ym(n)||td(e,r,n,o))&&(!up(n)||nd(e,r,n,o))&&(!Vn(n)||ad(e,r,n,o))&&(!ni(n)||cd(e,r,n,o))&&(!oi(n)||YA(e,r,n,o))&&(!ii(n)||gx(e,r,n,o)))&&(!s.IsString(o)||(!Ga(n)||ed(e,r,n,o))&&(!hm(n)||od(e,r,n,o))&&(!$a(n)||pd(e,r,n,o))&&(!qa(n)||dd(e,r,n,o)))&&(!(s.IsNumber(o)||s.IsBigInt(o))||(!mm(n)||Nm(e,r,n,o))&&(!Cr(n)||Lm(e,r,n,o))&&(!gm(n)||rd(e,r,n,o))&&(!Pr(n)||sd(e,r,n,o))&&(!Em(n)||ld(e,r,n,o)))&&(!Sm(n)||JA(e,r,n,o))&&(!Om(n)||nx(e,r,n,o))&&(!em(n)||WO(e,r,n,o))&&(!im(n)||Pm(e,r,n,o))&&(!lm(n)||wm(e,r,n,o))&&(!dm(n)||xA(e,r,n,o))&&(!_m(n)||md(e,r,n,o))&&(!nm(n)||aA(e,r,n,o))&&(!om(n)||cA(e,r,n,o))&&(!Im(n)||BA(e,r,n,o))&&(!mp(n)||!s.IsArray(o)||ux(e,r,n,o))&&(!dp(n)||!s.IsObject(o)||mx(e,r,n,o))&&(!tm(n)||XO(e,r,n,o));return e.Pop(n),i}function W(e,r,n,o,i,a){e.Push(i);let c=pp(i)?uA(e,r,n,o,i,a):!!(+(!xm(i)||px(e,r,n,o,i,a))&+(!(s.IsObject(a)&&!s.IsArray(a))||!!(+(!Qn(i)||ax(e,r,n,o,i,a))&+(!Rr(i)||iA(e,r,n,o,i,a))&+(!am(i)||fA(e,r,n,o,i,a))&+(!sm(i)||yA(e,r,n,o,i,a))&+(!cm(i)||TA(e,r,n,o,i,a))&+(!Ba(i)||zA(e,r,n,o,i,a))&+(!Fa(i)||WA(e,r,n,o,i,a))&+(!bm(i)||XA(e,r,n,o,i,a))&+(!ja(i)||$A(e,r,n,o,i,a))&+(!Tm(i)||vA(e,r,n,o,i,a))))&+(!s.IsArray(a)||!!(+(!rm(i)||rA(e,r,n,o,i,a))&+(!zn(i)||mA(e,r,n,o,i,a))&+(!ri(i)||PA(e,r,n,o,i,a))&+(!ym(i)||UA(e,r,n,o,i,a))&+(!up(i)||NA(e,r,n,o,i,a))&+(!Vn(i)||kA(e,r,n,o,i,a))&+(!ni(i)||DA(e,r,n,o,i,a))&+(!oi(i)||VA(e,r,n,o,i,a))&+(!ii(i)||yx(e,r,n,o,i,a))))&+(!s.IsString(a)||!!(+(!Ga(i)||AA(e,r,n,o,i,a))&+(!hm(i)||LA(e,r,n,o,i,a))&+(!$a(i)||GA(e,r,n,o,i,a))&+(!qa(i)||HA(e,r,n,o,i,a))))&+(!(s.IsNumber(a)||s.IsBigInt(a))||!!(+(!mm(i)||_A(e,r,n,o,i,a))&+(!Cr(i)||IA(e,r,n,o,i,a))&+(!gm(i)||wA(e,r,n,o,i,a))&+(!Pr(i)||MA(e,r,n,o,i,a))&+(!Em(i)||jA(e,r,n,o,i,a))))&+(!Sm(i)||ex(e,r,n,o,i,a))&+(!Om(i)||ox(e,r,n,o,i,a))&+(!em(i)||ZO(e,r,n,o,i,a))&+(!im(i)||lA(e,r,n,o,i,a))&+(!lm(i)||EA(e,r,n,o,i,a))&+(!dm(i)||RA(e,r,n,o,i,a))&+(!_m(i)||qA(e,r,n,o,i,a))&+(!nm(i)||sA(e,r,n,o,i,a))&+(!om(i)||pA(e,r,n,o,i,a))&+(!Im(i)||FA(e,r,n,o,i,a))&+(!mp(i)||!s.IsArray(a)||lx(e,r,n,o,i,a))&+(!dp(i)||!s.IsObject(a)||dx(e,r,n,o,i,a)))&&(!tm(i)||JO(e,r,n,o,i,a));return e.Pop(i),c}var Zn={};Mt(Zn,{Ref:()=>oB});var Ur={};Mt(Ur,{Delete:()=>Xq,Get:()=>Wq,Has:()=>Qq,Indices:()=>Ya,Set:()=>Zq});function hx(e){if(e.length===0)throw Error("Cannot set root")}function Tx(e){if(!s.IsObject(e))throw Error("Cannot set value")}function zq(e){return/^(0|[1-9]\d*)$/.test(e)}function Ex(e){return[e.slice(0,e.length-1),e.slice(e.length-1)[0]]}function Yq(e,r){return s.IsObject(r)&&s.HasPropertyKey(r,e)}function Vq(e,r){return s.IsObject(r)?r[e]:void 0}function hd(e,r){return e.reduce((n,o)=>Vq(o,n),r)}function Ya(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 Qq(e,r){let n=e;return Ya(r).every(o=>Yq(o,n)?(n=n[o],!0):!1)}function Wq(e,r){let n=Ya(r);return hd(n,e)}function Zq(e,r,n){let o=Ya(r);hx(o);let[i,a]=Ex(o),c=hd(i,e);return Tx(c),c[a]=n,e}function Xq(e,r){let n=Ya(r);hx(n);let[o,i]=Ex(n),a=hd(o,e);return Tx(a),s.IsArray(a)&&zq(i)?a.splice(+i,1):delete a[i],e}function Jq(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("#")?_x(e,r,n):e}function eB(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 _x(e,r,n){return n.href.endsWith("#")?e:n.hash.startsWith("#")?Ur.Get(e,decodeURIComponent(n.hash.slice(1))):void 0}function tB(e,r,n){if(Yn(e)){let o=Jq(e,r,n);if(!s.IsUndefined(o))return o}if(Da(e)){let o=eB(e,r,n);if(!s.IsUndefined(o))return o}return _x(e,r,n)}function rB(e,r,n){return e.reduce((o,i)=>{let a=Td(i,r,n);return s.IsUndefined(a)?o:a},void 0)}function nB(e,r,n){return s.Keys(e).reduce((o,i)=>{let a=Td(e[i],r,n);return s.IsUndefined(a)?o:a},void 0)}function Td(e,r,n){if(r=xr(e)&&Yn(e)?new URL(e.$id,r.href):r,xr(e)){let o=tB(e,r,n);if(!s.IsUndefined(o))return o}if(s.IsArray(e))return rB(e,r,n);if(s.IsObject(e))return nB(e,r,n)}function oB(e,r){let n=new URL("http://unknown"),o=Yn(e)?new URL(e.$id,n.href):n,i=new URL(r,o.href);return Td(e,o,i)}var Xn=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){xr(r)&&(Yn(r)&&this.ids.push(r),Da(r)&&this.anchors.push(r),lp(r)&&this.recursiveAnchors.push(r),pm(r)&&this.dynamicAnchors.push(r))}Pop(r){xr(r)&&(Yn(r)&&this.ids.pop(),Da(r)&&this.anchors.pop(),lp(r)&&this.recursiveAnchors.pop(),pm(r)&&this.dynamicAnchors.pop())}FromContext(r){return s.HasPropertyKey(this.context,r)?this.context[r]:void 0}FromRef(r){return r.startsWith("#")?Zn.Ref(this.Base(),r):Zn.Ref(this.schema,r)}Ref(r){return this.FromContext(r)??this.FromRef(r)}RecursiveRef(r){return lp(this.Base())?Zn.Ref(this.recursiveAnchors[0],r):Zn.Ref(this.Base(),r)}};function Ix(...e){let[r,n,o]=ie.Match(e,{3:(c,l,d)=>[c,l,d],2:(c,l)=>[{},c,l]}),i=new Xn(r,n),a=new yt;return G(i,a,n,o)}function bx(...e){let[r,n,o]=ie.Match(e,{3:(g,T,_)=>[g,T,_],2:(g,T)=>[{},g,T]}),i=Pt.Get(),a=Hg(),c=[],l=new Xn(r,n),d=new Ha(g=>{if(!s.IsGreaterEqualThan(c.length,i.maxErrors))return c.push({...g,message:a(g)})});return[W(l,d,"#","",n,o),c]}function de(...e){let[r,n,o]=ie.Match(e,{3:(i,a,c)=>[i,a,c],2:(i,a)=>[{},i,a]});return Ix(r,n,o)}function dn(...e){let[r,n,o]=ie.Match(e,{3:(c,l,d)=>[c,l,d],2:(c,l)=>[{},c,l]}),[i,a]=bx(r,n,o);return a}var fn=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 Sx(e,r,n){return s.IsArray(n)?n.map(o=>Ze(e,r.items,o)):n}function Ox(e,r,n){return r.Clean(n)}function Ax(e,r,n){return Ze({...e,...r.$defs},Le(r.$ref),n)}function aB(e){let r=s.HasPropertyKey(e,"unevaluatedProperties")?{additionalProperties:e.unevaluatedProperties}:{},n=Kt(e);return k(n)?Dc(n,r):n}function xx(e,r,n){let o=aB(r);return Ze(e,o,n)}function fp(e){return s.HasPropertyKey(e,"additionalProperties")?e.additionalProperties:void 0}function Rx(e,r,n){if(!s.IsObject(n)||s.IsArray(n))return n;let o=fp(r);for(let i of s.Keys(n)){if(s.HasPropertyKey(r.properties,i)){n[i]=Ze(e,r.properties[i],n[i]);continue}if(s.IsBoolean(o)&&s.IsEqual(o,!0)||A(o)&&de(e,o,n[i])){n[i]=Ze(e,o,n[i]);continue}delete n[i]}return n}function Cx(e,r,n){if(!s.IsObject(n))return n;let o=fp(r),[i,a]=[new RegExp(xt(r)),rt(r)];for(let c of s.Keys(n)){if(i.test(c)){n[c]=Ze(e,a,n[c]);continue}if(s.IsBoolean(o)&&s.IsEqual(o,!0)||A(o)&&de(e,o,n[c])){n[c]=Ze(e,o,n[c]);continue}delete n[c]}return n}function Px(e,r,n){return s.HasPropertyKey(e,r.$ref)?Ze(e,e[r.$ref],n):n}function Ux(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]=Ze(e,r.items[i],n[i]);return s.IsGreaterThan(n.length,o)?n.slice(0,o):n}function sB(e){let r={};for(let n of Object.getOwnPropertyNames(e))r[n]=ge(e[n]);for(let n of Object.getOwnPropertySymbols(e))r[n]=ge(e[n]);return r}function cB(e){return s.IsClassInstance(e)?e:sB(e)}function pB(e){return e.map(r=>ge(r))}function uB(e){return e.slice()}function lB(e){return new Map(ge([...e.entries()]))}function mB(e){return new Set(ge([...e.values()]))}function ge(e){return ct.IsTypeArray(e)?uB(e):ct.IsMap(e)?lB(e):ct.IsSet(e)?mB(e):s.IsArray(e)?pB(e):s.IsObject(e)?cB(e):e}function wx(e,r,n){for(let o of r.anyOf){let i=Ze(e,o,ge(n));if(de(e,o,i))return i}return n}function Ze(e,r,n){return te(r)?Sx(e,r,n):Ut(r)?Ox(e,r,n):me(r)?Ax(e,r,n):w(r)?xx(e,r,n):k(r)?Rx(e,r,n):Se(r)?Cx(e,r,n):pe(r)?Px(e,r,n):V(r)?Ux(e,r,n):O(r)?wx(e,r,n):n}function eo(...e){let[r,n,o]=ie.Match(e,{3:(i,a,c)=>[i,a,c],2:(i,a)=>[{},i,a]});return Ze(r,n,o)}function Nx(e,r,n){return s.IsArray(n)?n.map(o=>De(e,r.items,o)):n}function Lx(e,r,n){return r.Convert(n)}var ne={};Mt(ne,{Fail:()=>to,IsOk:()=>_d,Ok:()=>U,TryBigInt:()=>Id,TryBoolean:()=>wB,TryNull:()=>GB,TryNumber:()=>YB,TryString:()=>eF,TryUndefined:()=>sF});function _d(e){return s.IsObject(e)&&s.HasPropertyKey(e,"value")}function U(e){return{value:e}}function to(){}function dB(e){return U(e)}function fB(e){return s.IsEqual(e,!0)?U(BigInt(1)):U(BigInt(0))}function gB(e){return U(BigInt(Math.trunc(e)))}function yB(e){return U(BigInt(0))}var hB=/^-?(0|[1-9]\d*)n$/,TB=/^-?(0|[1-9]\d*)\.\d+$/,EB=/^-?(0|[1-9]\d*)$/;function _B(e){return hB.test(e)}function IB(e){return TB.test(e)}function bB(e){return EB.test(e)}function SB(e){let r=e.toLowerCase();return _B(e)?U(BigInt(e.slice(0,e.length-1))):IB(e)?U(BigInt(e.split(".")[0])):bB(e)?U(BigInt(e)):s.IsEqual(r,"false")?U(BigInt(0)):s.IsEqual(r,"true")?U(BigInt(1)):void 0}function OB(e){return U(BigInt(0))}function Id(e){return s.IsBigInt(e)?dB(e):s.IsBoolean(e)?fB(e):s.IsNumber(e)?gB(e):s.IsNull(e)?yB(e):s.IsString(e)?SB(e):s.IsUndefined(e)?OB(e):void 0}function AB(e){return s.IsEqual(e,BigInt(0))?U(!1):s.IsEqual(e,BigInt(1))?U(!0):void 0}function xB(e){return U(e)}function RB(e){return s.IsEqual(e,0)?U(!1):s.IsEqual(e,1)?U(!0):void 0}function CB(e){return U(!1)}function PB(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 UB(e){return U(!1)}function wB(e){return s.IsBigInt(e)?AB(e):s.IsBoolean(e)?xB(e):s.IsNumber(e)?RB(e):s.IsNull(e)?CB(e):s.IsString(e)?PB(e):s.IsUndefined(e)?UB(e):void 0}function NB(e){return s.IsEqual(e,BigInt(0))?U(null):void 0}function LB(e){return s.IsEqual(e,!1)?U(null):void 0}function vB(e){return s.IsEqual(e,0)?U(null):void 0}function kB(e){return U(null)}function MB(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 DB(e){return U(null)}function GB(e){return s.IsBigInt(e)?NB(e):s.IsBoolean(e)?LB(e):s.IsNumber(e)?vB(e):s.IsNull(e)?kB(e):s.IsString(e)?MB(e):s.IsUndefined(e)?DB(e):void 0}var $B=BigInt(Number.MAX_SAFE_INTEGER),jB=BigInt(Number.MIN_SAFE_INTEGER);function qB(e){return e<=$B&&e>=jB}function vx(e){return qB(e)?U(Number(e)):void 0}function BB(e){return e?U(1):U(0)}function FB(e){return U(e)}function HB(e){return U(0)}function KB(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=Id(e);return _d(o)?vx(o.value):void 0}function zB(e){return U(0)}function YB(e){return s.IsBigInt(e)?vx(e):s.IsBoolean(e)?BB(e):s.IsNumber(e)?FB(e):s.IsNull(e)?HB(e):s.IsString(e)?KB(e):s.IsUndefined(e)?zB(e):void 0}function VB(e){return U(e.toString())}function QB(e){return U(e.toString())}function WB(e){return U(e.toString())}function ZB(e){return U("null")}function XB(e){return U(e)}function JB(e){return U("")}function eF(e){return s.IsBigInt(e)?VB(e):s.IsBoolean(e)?QB(e):s.IsNumber(e)?WB(e):s.IsNull(e)?ZB(e):s.IsString(e)?XB(e):s.IsUndefined(e)?JB(e):void 0}function tF(e){return s.IsEqual(e,BigInt(0))?U(void 0):void 0}function rF(e){return s.IsEqual(e,!1)?U(void 0):void 0}function nF(e){return s.IsEqual(e,0)?U(void 0):void 0}function oF(e){return U(void 0)}function iF(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 aF(e){return U(void 0)}function sF(e){return s.IsBigInt(e)?tF(e):s.IsBoolean(e)?rF(e):s.IsNumber(e)?nF(e):s.IsNull(e)?oF(e):s.IsString(e)?iF(e):s.IsUndefined(e)?aF(e):void 0}function kx(e,r,n){if(s.IsBigInt(n))return n;let o=ne.TryBigInt(n);return ne.IsOk(o)?o.value:n}function Mx(e,r,n){if(s.IsBoolean(n))return n;let o=ne.TryBoolean(n);return ne.IsOk(o)?o.value:n}function Dx(e,r,n){return De({...e,...r.$defs},Le(r.$ref),n)}function gp(e,r,n){if(r.anyOf.some(c=>de(e,c,n)))return n;let a=r.anyOf.map(c=>De(e,c,ge(n))).find(c=>de(e,r,c));return s.IsUndefined(a)?n:a}function Gx(e,r,n){let o=Ln(r);return gp(e,o,n)}function $x(e,r,n){if(s.IsInteger(n))return n;let o=ne.TryNumber(n);return ne.IsOk(o)?Math.trunc(o.value):n}function jx(e,r,n){let o=Kt(r);return De(e,o,n)}function cF(e,r,n){let o=ne.TryBigInt(n);return ne.IsOk(o)&&s.IsEqual(r.const,o.value)?o.value:n}function pF(e,r,n){let o=ne.TryBoolean(n);return ne.IsOk(o)&&s.IsEqual(r.const,o.value)?o.value:n}function uF(e,r,n){let o=ne.TryNumber(n);return ne.IsOk(o)&&s.IsEqual(r.const,o.value)?o.value:n}function lF(e,r,n){let o=ne.TryString(n);return ne.IsOk(o)&&s.IsEqual(r.const,o.value)?o.value:n}function qx(e,r,n){return s.IsEqual(r.const,n)?n:Xg(r)?cF(e,r,n):Jg(r)?pF(e,r,n):ho(r)?uF(e,r,n):To(r)?lF(e,r,n):H()}function Bx(e,r,n){if(s.IsNull(n))return n;let o=ne.TryNull(n);return ne.IsOk(o)?o.value:n}function Fx(e,r,n){if(s.IsNumber(n))return n;let o=ne.TryNumber(n);return ne.IsOk(o)?o.value:n}function yp(e,r,n,o){let i=s.Keys(o);for(let[a,c]of r)for(let l of i)a.test(l)||(o[l]=De(e,n,o[l]));return o}function Va(e,r,n){return Ge(e)&&s.IsUndefined(n[r])}function mF(e,r,n){let o=s.EntriesRegExp(r.properties),i=s.Keys(n);for(let[a,c]of o)for(let l of i)!a.test(l)||Va(c,l,n)||(n[l]=De(e,c,n[l]));return s.HasPropertyKey(r,"additionalProperties")&&s.IsObject(r.additionalProperties)?yp(e,o,r.additionalProperties,n):n}function Hx(e,r,n){return s.IsObjectNotArray(n)?mF(e,r,n):n}function dF(e,r,n){let o=s.EntriesRegExp(r.patternProperties),i=s.Keys(n);for(let[a,c]of o)for(let l of i)a.test(l)&&(n[l]=De(e,c,n[l]));return s.HasPropertyKey(r,"additionalProperties")&&s.IsObject(r.additionalProperties)?yp(e,o,r.additionalProperties,n):n}function Kx(e,r,n){return s.IsObjectNotArray(n)?dF(e,r,n):n}function zx(e,r,n){return s.HasPropertyKey(e,r.$ref)?De(e,e[r.$ref],n):n}function Yx(e,r,n){if(s.IsString(n))return n;let o=ne.TryString(n);return ne.IsOk(o)?o.value:n}function Vx(e,r,n){let o=nt(r.pattern);return De(e,o,n)}function Qx(e,r,n){if(!s.IsArray(n))return n;for(let o=0;o<Math.min(r.items.length,n.length);o++)n[o]=De(e,r.items[o],n[o]);return n}function Wx(e,r,n){if(s.IsUndefined(n))return n;let o=ne.TryUndefined(n);return ne.IsOk(o)?o.value:n}function Zx(e,r,n){if(s.IsUndefined(n))return n;let o=ne.TryUndefined(n);return ne.IsOk(o)?void 0:n}function De(e,r,n){return te(r)?Nx(e,r,n):Ut(r)?Lx(e,r,n):At(r)?kx(e,r,n):lt(r)?Mx(e,r,n):me(r)?Dx(e,r,n):Ue(r)?Gx(e,r,n):He(r)?$x(e,r,n):w(r)?jx(e,r,n):X(r)?qx(e,r,n):tr(r)?Bx(e,r,n):be(r)?Fx(e,r,n):k(r)?Hx(e,r,n):Se(r)?Kx(e,r,n):pe(r)?zx(e,r,n):ve(r)?Yx(e,r,n):we(r)?Vx(e,r,n):V(r)?Qx(e,r,n):or(r)?Wx(e,r,n):O(r)?gp(e,r,n):Rt(r)?Zx(e,r,n):n}function gn(...e){let[r,n,o]=ie.Match(e,{3:(i,a,c)=>[i,a,c],2:(i,a)=>[{},i,a]});return De(r,n,o)}function Xx(e,r,n){if(!s.IsArray(n))return n;for(let o=0;o<n.length;o++)n[o]=Fe(e,r.items,n[o]);return n}function Jx(e,r,n){return r.Default(n)}function eR(e,r,n){return Fe({...e,...r.$defs},Le(r.$ref),n)}function tR(e,r){return s.IsUndefined(r)?s.IsFunction(e.default)?e.default():ge(e.default):r}function rR(e,r,n){let o=Kt(r);return Fe(e,o,n)}function nR(e,r,n){if(!s.IsObject(n))return n;let o=s.Keys(r.properties);for(let i of o){let a=Fe(e,r.properties[i],n[i]);s.IsUndefined(a)&&(Ge(r.properties[i])||!s.HasPropertyKey(r.properties[i],"default"))||(n[i]=Fe(e,r.properties[i],n[i]))}if(!Rr(r)||s.IsBoolean(r.additionalProperties))return n;for(let i of s.Keys(n))o.includes(i)||(n[i]=Fe(e,r.additionalProperties,n[i]));return n}function oR(e,r,n){if(!s.IsObject(n))return n;let[o,i]=[new RegExp(xt(r)),rt(r)];for(let a of s.Keys(n))o.test(a)&&vt(i)&&(n[a]=Fe(e,i,n[a]));if(!Rr(r))return n;for(let a of s.Keys(n))o.test(a)||(n[a]=Fe(e,r.additionalProperties,n[a]));return n}function iR(e,r,n){return s.HasPropertyKey(e,r.$ref)?Fe(e,e[r.$ref],n):n}function aR(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]=Fe(e,o[a],n[a]));return n}function sR(e,r,n){for(let o of r.anyOf){let i=Fe(e,o,ge(n));if(de(e,o,i))return i}return n}function Fe(e,r,n){let o=vt(r)?tR(r,n):n;return te(r)?Xx(e,r,o):Ut(r)?Jx(e,r,o):me(r)?eR(e,r,o):w(r)?rR(e,r,o):k(r)?nR(e,r,o):Se(r)?oR(e,r,o):pe(r)?iR(e,r,o):V(r)?aR(e,r,o):O(r)?sR(e,r,o):o}function ro(...e){let[r,n,o]=ie.Match(e,{3:(i,a,c)=>[i,a,c],2:(i,a)=>[{},i,a]});return Fe(r,n,o)}function ci(e){return(...r)=>{let[n,o,i]=ie.Match(r,{3:(a,c,l)=>[a,c,l],2:(a,c)=>[{},a,c]});return e.reduce((a,c)=>c(n,o,a),i)}}function fF(e,r,n){return r["~codec"].decode(n)}function gF(e,r,n){return r["~codec"].encode(n)}function Re(e,r,n,o){return Cn(n)?s.IsEqual(e,"Decode")?fF(r,n,o):gF(r,n,o):o}function yF(e,r,n,o){if(!s.IsArray(o))return H();for(let i=0;i<o.length;i++)o[i]=Te(e,r,n.items,o[i]);return Re(e,r,n,o)}function hF(e,r,n,o){let i=Re(e,r,n,o);if(!s.IsArray(i))return i;for(let a=0;a<i.length;a++)i[a]=Te(e,r,n.items,i[a]);return i}function cR(e,r,n,o){return s.IsEqual(e,"Decode")?yF(e,r,n,o):hF(e,r,n,o)}function pR(e,r,n,o){return o=Te(e,{...r,...n.$defs},Le(n.$ref),o),Re(e,r,n,o)}function TF(e,r,n,o){for(let i of n.allOf)o=Te(e,r,i,o);return Re(e,r,n,o)}function EF(e,r,n,o){let i=Re(e,r,n,o);for(let a of n.allOf)i=Te(e,r,a,i);return i}function uR(e,r,n,o){return s.IsEqual(e,"Decode")?TF(e,r,n,o):EF(e,r,n,o)}function _F(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]=Te(e,r,n.properties[i],o[i]));return Re(e,r,n,o)}function IF(e,r,n,o){let i=Re(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]=Te(e,r,n.properties[a],i[a]));return i}function lR(e,r,n,o){return s.IsEqual(e,"Decode")?_F(e,r,n,o):IF(e,r,n,o)}function bF(e,r,n,o){if(!s.IsObjectNotArray(o))return H();let i=new RegExp(xt(n));for(let a of s.Keys(o))i.test(a)||H(),o[a]=Te(e,r,rt(n),o[a]);return Re(e,r,n,o)}function SF(e,r,n,o){let i=Re(e,r,n,o);if(!s.IsObjectNotArray(i))return i;let a=new RegExp(xt(n));for(let c of s.Keys(i))a.test(c)&&(i[c]=Te(e,r,rt(n),i[c]));return i}function mR(e,r,n,o){return s.IsEqual(e,"Decode")?bF(e,r,n,o):SF(e,r,n,o)}function dR(e,r,n,o){return o=s.HasPropertyKey(r,n.$ref)?Te(e,r,r[n.$ref],o):o,Re(e,r,n,o)}function OF(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]=Te(e,r,n.items[i],o[i]);return Re(e,r,n,o)}function AF(e,r,n,o){let i=Re(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]=Te(e,r,n.items[a],i[a]);return i}function fR(e,r,n,o){return s.IsEqual(e,"Decode")?OF(e,r,n,o):AF(e,r,n,o)}function xF(e,r,n,o){for(let i of n.anyOf){if(!de(r,i,o))continue;let a=Te(e,r,i,o);return Re(e,r,n,a)}return H()}function RF(e,r,n,o){let i=Re(e,r,n,o);for(let a of n.anyOf){let c=Te(e,r,a,ge(i));if(de(r,a,c))return c}return i}function gR(e,r,n,o){return s.IsEqual(e,"Decode")?xF(e,r,n,o):RF(e,r,n,o)}function Te(e,r,n,o){return te(n)?cR(e,r,n,o):me(n)?pR(e,r,n,o):w(n)?uR(e,r,n,o):k(n)?lR(e,r,n,o):Se(n)?mR(e,r,n,o):pe(n)?dR(e,r,n,o):V(n)?fR(e,r,n,o):O(n)?gR(e,r,n,o):Re(e,r,n,o)}var bd=class extends fn{constructor(r,n){super("Decode",r,n)}};function CF(e,r,n){if(!de(e,r,n))throw new bd(n,dn(e,r,n));return n}function PF(e,r,n){return Te("Decode",e,r,n)}var xFe=ci([(e,r,n)=>ge(n),(e,r,n)=>ro(e,r,n),(e,r,n)=>gn(e,r,n),(e,r,n)=>eo(e,r,n),(e,r,n)=>CF(e,r,n),(e,r,n)=>PF(e,r,n)]);var Sd=class extends fn{constructor(r,n){super("Encode",r,n)}};function UF(e,r,n){if(!de(e,r,n))throw new Sd(n,dn(e,r,n));return n}function wF(e,r,n){return Te("Encode",e,r,n)}var GFe=ci([(e,r,n)=>ge(n),(e,r,n)=>wF(e,r,n),(e,r,n)=>ro(e,r,n),(e,r,n)=>gn(e,r,n),(e,r,n)=>eo(e,r,n),(e,r,n)=>UF(e,r,n)]);var $t=class extends Error{constructor(r,n){super(n),this.type=r}};function yR(e,r){return s.IsFunction(r.default)?r.default(r):s.IsObject(r.default)?ge(r.default):r.default}function hR(e,r){if(ii(r)&&!vt(r))throw new $t(r,"Arrays with uniqueItems constraints must specify a default annotation");let n=ni(r)?r.minItems:0;return Array.from({length:n},()=>Ee(e,r.items))}async function*NF(){}function TR(e,r){return NF()}function ER(e,r){return r.Create()}function _R(e,r){return Cr(r)?BigInt(r.exclusiveMinimum)+BigInt(1):Pr(r)?BigInt(r.minimum):BigInt(0)}function IR(e,r){return!1}function bR(e,r){let n=Ee(e,r.instanceType);return class{constructor(){Object.assign(this,n)}}}function SR(e,r){return Ee({...e,...r.$defs},Le(r.$ref))}function OR(e,r){return Ee(e,Ln(r))}function AR(e,r){let n=Ee(e,r.returnType);return()=>n}function xR(e,r){return Cr(r)&&s.IsNumber(r.exclusiveMinimum)?r.exclusiveMinimum+1:Pr(r)?r.minimum:0}function RR(e,r){return Ee(e,Kt(r))}function*LF(){}function CR(e,r){return LF()}function PR(e,r){return r.const}function UR(e,r){throw new $t(r,"Cannot create TNever types")}function wR(e,r){return null}function NR(e,r){return Cr(r)&&s.IsNumber(r.exclusiveMinimum)?r.exclusiveMinimum+1:Pr(r)?r.minimum:0}function LR(e,r){return(s.IsUndefined(r.required)?[]:r.required).reduce((o,i)=>({...o,[i]:Ee(e,r.properties[i])}),{})}function vR(e,r){return Promise.resolve(Ee(e,r.item))}function kR(e,r){if(ja(r)&&!vt(r))throw new $t(r,"Record with the minProperties constraint must have a default annotation");return{}}function MR(e,r){return s.HasPropertyKey(e,r.$ref)?Ee(e,e[r.$ref]):(()=>{throw new $t(r,"Unable to deref Ref")})()}function DR(e,r){if((qa(r)||Ga(r))&&!vt(r))throw Error("Strings with format or pattern constraints must specify default");let o=$a(r)?r.minLength:0;return"".padEnd(o)}function GR(e,r){return Symbol()}function $R(e,r){let n=nt(r.pattern);if(ve(n))throw new $t(r,"Unable to create TemplateLiteral due to infinite type expansion");return Ee(e,n)}function jR(e,r){return Array.from({length:r.minItems},(n,o)=>Ee(e,r.items[o]))}function qR(e,r){if(s.IsEqual(r.anyOf.length,0))throw Error("Unable to create Union with no variants");return Ee(e,r.anyOf[0])}function Ee(e,r){return vt(r)?yR(e,r):te(r)?hR(e,r):at(r)?TR(e,r):Ut(r)?ER(e,r):At(r)?_R(e,r):lt(r)?IR(e,r):$e(r)?bR(e,r):me(r)?SR(e,r):Ue(r)?OR(e,r):je(r)?AR(e,r):He(r)?xR(e,r):w(r)?RR(e,r):st(r)?CR(e,r):X(r)?PR(e,r):gr(r)?UR(e,r):tr(r)?wR(e,r):be(r)?NR(e,r):k(r)?LR(e,r):tt(r)?vR(e,r):Se(r)?kR(e,r):pe(r)?MR(e,r):ve(r)?DR(e,r):rr(r)?GR(e,r):we(r)?$R(e,r):V(r)?jR(e,r):or(r)?void 0:O(r)?qR(e,r):Rt(r)?void 0:void 0}function ur(...e){let[r,n]=ie.Match(e,{2:(o,i)=>[o,i],1:o=>[{},o]});return Ee(r,n)}var Od=class extends fn{constructor(r,n){super("Parse",r,n)}};function vF(e,r,n){if(!de(e,r,n))throw new Od(n,dn(e,r,n));return n}var FKe=ci([(e,r,n)=>ge(n),(e,r,n)=>ro(e,r,n),(e,r,n)=>gn(e,r,n),(e,r,n)=>eo(e,r,n),(e,r,n)=>vF(e,r,n)]);var MF=N({type:Y("insert"),path:bt(),value:Je()}),DF=Object({type:Y("update"),path:bt(),value:Je()}),GF=N({type:Y("delete"),path:bt()}),WKe=q([MF,DF,GF]);function pi(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]:ur(r)}function no(e,r,n,o,i){e.command(r).description(n).option("-f, --file <FILE_PATH>","Read body from file (use - for stdin)").option("-d, --data <JSON>","Inline JSON body").option("--generate-skeleton","Print a JSON skeleton for the request body and exit").action(async a=>{if(a.generateSkeleton){Q(pi(o));return}let c=ti(a),l=await i()(o,{body:c});Q(l)})}function HR(e,r){let n=e.command("grok").description("Test and preview grok parsing rules");no(n,"parse","Parse sample log lines with grok rules and return the extracted fields",VO,r)}var KR=require("node:child_process"),zR=require("node:fs"),YR=require("node:os"),Ep=require("node:path");var oo=require("node:fs");function Qa(e,r){let n=`${e}.tmp.${process.pid}`;(0,oo.writeFileSync)(n,r),(0,oo.renameSync)(n,e)}function Wa(e){try{return(0,oo.readFileSync)(e,"utf8")}catch(r){if(r.code==="ENOENT")return;throw r}}function Za(e,r){if(r===void 0)return;let n=`${e}.bak.${new Date().toISOString().replaceAll(":","-")}`;return(0,oo.writeFileSync)(n,r),n}function io(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var xd="tsuga-dev/agent-plugins",hp="tsuga";function Tp(e,r){B(` $ ${e} ${r.join(" ")}`);try{(0,KR.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 BF(e,r){B("Claude Code \u2192 installing Tsuga plugin"),Tp("claude",["plugin","marketplace","add",xd]),Tp("claude",["plugin","install",`tsuga@${hp}`]),r.autoUpdate&&FF(e)}function FF(e){let r=(0,Ep.join)(e,".claude","settings.json");B(`Claude Code \u2192 ${r} (autoUpdate)`),(0,zR.mkdirSync)((0,Ep.dirname)(r),{recursive:!0});let n=Wa(r),o=JSON.parse(n??"{}");if(!io(o))throw new Error(`${r} must contain a JSON object`);let i=o.extraKnownMarketplaces??{};if(!io(i))throw new Error(`${r} "extraKnownMarketplaces" must be a JSON object`);let a=i[hp],c=io(a)?a:{};o.extraKnownMarketplaces={...i,[hp]:{source:{source:"github",repo:xd},...c,autoUpdate:!0}};let l=Za(r,n);Qa(r,`${JSON.stringify(o,null,2)}
139
+ `),B(l===void 0?" created":` patched (backup: ${l})`)}function HF(){B("Codex \u2192 installing Tsuga plugin"),Tp("codex",["plugin","marketplace","add",xd]),Tp("codex",["plugin","add",`tsuga@${hp}`])}function VR(e){let r=e.command("install").description("Install Tsuga plugins into local LLM CLIs").command("plugin").description("Install the Tsuga plugin into a specific LLM CLI");r.command("claude-code").description("Install the Tsuga plugin into Claude Code (requires the claude CLI in PATH)").option("--no-auto-update","Skip patching ~/.claude/settings.json with autoUpdate=true").action(n=>{BF((0,YR.homedir)(),n),B("Restart your claude session to load the new plugins.")}),r.command("codex").description("Install the Tsuga plugin into Codex (requires the codex CLI in PATH)").action(()=>{HF(),B("Restart your codex session to load the new plugins.")})}var Qt="/v0/kubernetes-explorer",KF="^[a-z0-9.-]+$",zF="^[A-Za-z0-9._-]+$",QR=256,WR=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 lr=e=>t.Optional(t.Array(p({allowEmpty:!1}),{description:e})),ZR={clusterId:WR,search:t.Optional(t.String({pattern:KF,minLength:1,maxLength:QR,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."}))},XR={clusterId:WR,search:t.Optional(t.String({pattern:zF,minLength:1,maxLength:QR,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."}))},JR=t.Object(ZR),eC=t.Object(XR),Xa={...ZR,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:lr("Restrict results to these Kubernetes cluster names."),namespaces:lr("Restrict results to these namespaces."),teams:lr("Restrict results to these team names."),envs:lr("Restrict results to these environments."),...ye},tC=["Pending","Running","Succeeded","Failed","Unknown","CrashLoopBackOff","Error"],YF={...Xa,nodes:lr("Restrict results to pods scheduled on these nodes."),deployments:lr("Restrict results to pods owned by these Deployments."),statefulsets:lr("Restrict results to pods owned by these StatefulSets."),daemonsets:lr("Restrict results to pods owned by these DaemonSets."),podStatus:t.Optional(t.Array(t.Enum(tC),{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."}))},ui=t.Enum(["asc","desc"],{description:"Sort direction. Defaults to ascending."}),VF=["deployment","statefulset","daemonset"],rC=t.Object({kind:t.Enum(VF,{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."}),nC=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(tC,{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(E({description:"Timestamp from pod start time telemetry for the selected pod instance. Present when pod start time telemetry is observed."}))}),Rd=t.Object({...nC.properties,workload:t.Optional(rC),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."}))}),QF=["podName","namespace","cluster","team","env","node","phase","restarts","cpuUsageMilli","cpuUtilization","cpuRequestUtilization","memoryUsageBytes","memoryUtilization","memoryRequestUtilization","createdAt"],F9e=m({tags:["kubernetes-explorer"],method:"GET",url:`${Qt}/pods`,query:t.Object({...YF,sortBy:t.Optional(t.Enum(QF,{description:"Field to sort pods by."})),sortDirection:t.Optional(ui)}),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."}))}),WF=["cluster","teams","envs","cpuUsageMilli","memoryUsageBytes","readyNodes"],H9e=m({tags:["kubernetes-explorer"],method:"GET",url:`${Qt}/clusters`,query:t.Object({...XR,teams:lr("Restrict to clusters that host workloads from these team names."),envs:lr("Restrict to clusters that host workloads in these environments."),sortBy:t.Optional(t.Enum(WF,{description:"Field to sort clusters by."})),sortDirection:t.Optional(ui),...ye}),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."}))}),ZF=["namespace","cluster","teams","envs","pods","cpuUsageMilli","memoryUsageBytes"],K9e=m({tags:["kubernetes-explorer"],method:"GET",url:`${Qt}/namespaces`,query:t.Object({...Xa,sortBy:t.Optional(t.Enum(ZF,{description:"Field to sort namespaces by."})),sortDirection:t.Optional(ui)}),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."}))}),XF=["deployment","namespace","cluster","team","env","pods","availableReplicas","cpuUsageMilli","memoryUsageBytes"],z9e=m({tags:["kubernetes-explorer"],method:"GET",url:`${Qt}/deployments`,query:t.Object({...Xa,sortBy:t.Optional(t.Enum(XF,{description:"Field to sort deployments by."})),sortDirection:t.Optional(ui)}),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."}))}),JF=["statefulSet","namespace","cluster","team","env","pods","cpuUsageMilli","memoryUsageBytes"],Y9e=m({tags:["kubernetes-explorer"],method:"GET",url:`${Qt}/statefulsets`,query:t.Object({...Xa,sortBy:t.Optional(t.Enum(JF,{description:"Field to sort StatefulSets by."})),sortDirection:t.Optional(ui)}),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."}))}),eH=["daemonSet","namespace","cluster","team","env","pods","readyNodes","cpuUsageMilli","memoryUsageBytes"],V9e=m({tags:["kubernetes-explorer"],method:"GET",url:`${Qt}/daemonsets`,query:t.Object({...Xa,sortBy:t.Optional(t.Enum(eH,{description:"Field to sort DaemonSets by."})),sortDirection:t.Optional(ui)}),paginated:!0,response:t.Array(Nd)}),Ld=t.Object({overview:t.Object({...nC.properties,workload:t.Optional(rC)},{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."})}),oC=t.Object({clusterId:t.Optional(p({allowEmpty:!1})),k8sCluster:p({allowEmpty:!1}),k8sNamespace:p({allowEmpty:!1}),podName:p({allowEmpty:!1})}),Q9e=m({tags:["kubernetes-explorer"],method:"GET",url:`${Qt}/pod-details`,query:oC,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:E({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(E({description:"Timestamp when Tsuga last observed the pod deletion event. Present when the latest observed pod event is deleted."}))}),W9e=m({tags:["kubernetes-explorer"],method:"GET",url:`${Qt}/pod-manifest`,query:oC,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(E({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(E({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."})}),Z9e=m({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:Md}),tH=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(E())}),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(E())}))}),X9e=m({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:tH}),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(E())}),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(E())}))}),J9e=m({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 Nr=`/${"v1"}/kubernetes-explorer`,iC=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."}),nH={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(iC,{examples:[nH]});var aC=t.Pick(Cd,["cluster","teams","envs","cpuUsageMilli","memoryUsageBytes","readyNodes","podPhaseCounts"],{description:"A Kubernetes cluster with aggregate resource usage, node readiness, and pod phase counts."}),oH={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(aC,{examples:[oH]});var sC=t.Pick(Pd,["namespace","cluster","teams","envs","pods","cpuUsageMilli","memoryUsageBytes"],{description:"A Kubernetes namespace with pod count and aggregate resource usage."}),iH={namespace:"production",cluster:"prod-us-east",teams:["platform"],envs:["production"],pods:24,cpuUsageMilli:1800,memoryUsageBytes:3221225472};Object.assign(sC,{examples:[iH]});var cC=t.Pick(Ud,["deployment","namespace","cluster","team","env","pods","availableReplicas","desiredReplicas","cpuUsageMilli","memoryUsageBytes"],{description:"A Kubernetes deployment with replica counts and aggregate resource usage."}),aH={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(cC,{examples:[aH]});var pC=t.Pick(wd,["statefulSet","namespace","cluster","team","env","pods","readyReplicas","desiredReplicas","cpuUsageMilli","memoryUsageBytes"],{description:"A Kubernetes StatefulSet with replica counts and aggregate resource usage."}),sH={statefulSet:"postgres",namespace:"production",cluster:"prod-us-east",team:"platform",env:"production",pods:3,readyReplicas:3,desiredReplicas:3,cpuUsageMilli:900,memoryUsageBytes:2147483648};Object.assign(pC,{examples:[sH]});var uC=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."}),cH={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(uC,{examples:[cH]});var lC=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."}),pH={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:[pH]});var mC=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."}),uH={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(mC,{examples:[uH]});var dC=t.Pick(Md,["overview","podReplicas","revisions"],{description:"Detailed information for a single Kubernetes deployment: replica status, backing pods, and rollout revisions."}),lH={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(dC,{examples:[lH]});var fC=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."}))}),Ja=t.Pick(JR,["clusterId","search"]),mH=t.Pick(eC,["clusterId","search"]),gC=m({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:`${Nr}/pods`,query:Ja,response:t.Array(iC)}),yC=m({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:`${Nr}/clusters`,query:mH,response:t.Array(aC)}),hC=m({description:"Lists Kubernetes namespaces observed across the organization with pod counts and aggregate resource usage.",operationId:"listKubernetesNamespaces",tags:["public","kubernetes-explorer"],method:"GET",url:`${Nr}/namespaces`,query:Ja,response:t.Array(sC)}),TC=m({description:"Lists Kubernetes deployments observed across the organization with replica counts and aggregate resource usage.",operationId:"listKubernetesDeployments",tags:["public","kubernetes-explorer"],method:"GET",url:`${Nr}/deployments`,query:Ja,response:t.Array(cC)}),EC=m({description:"Lists Kubernetes StatefulSets observed across the organization with replica counts and aggregate resource usage.",operationId:"listKubernetesStatefulSets",tags:["public","kubernetes-explorer"],method:"GET",url:`${Nr}/statefulsets`,query:Ja,response:t.Array(pC)}),_C=m({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:`${Nr}/daemonsets`,query:Ja,response:t.Array(uC)}),IC=t.Object({...fC.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."})}),bC=m({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:`${Nr}/pod-details`,query:IC,response:lC}),SC=m({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:`${Nr}/pod-manifest`,query:IC,response:mC}),OC=m({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:`${Nr}/deployment-details`,query:t.Object({...fC.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:dC});var dH="clusterId";function AC(e,r,n){let o=r.query.properties??{},i=Object.keys(o).filter(a=>a!==dH);for(let a of i){let c=a.replace(/([A-Z])/g,"-$1").toLowerCase(),l=c.replace(/-/g,"_").toUpperCase(),d=o[a]?.description??"";n?e.requiredOption(`--${c} <${l}>`,d):e.option(`--${c} <${l}>`,d)}return i}function li(e,r,n,o){let i=e.command(r).description(n.description??`List Kubernetes ${r}`),a=AC(i,n,!1);i.action(async c=>{let l={};for(let d of a)c[d]!==void 0&&(l[d]=c[d]);Q(Object.keys(l).length>0?await o()(n,{query:l}):await o()(n))})}function Dd(e,r,n,o){let i=e.command(r).description(n.description??`Get Kubernetes ${r}`),a=AC(i,n,!0);i.action(async c=>{let l={};for(let d of a)l[d]=c[d];Q(await o()(n,{query:l}))})}function xC(e,r){let n=e.command("kubernetes").description("Explore Kubernetes resources observed across the organization");li(n,"pods",gC,r),li(n,"clusters",yC,r),li(n,"namespaces",hC,r),li(n,"deployments",TC,r),li(n,"statefulsets",EC,r),li(n,"daemonsets",_C,r),Dd(n,"pod-details",bC,r),Dd(n,"pod-manifest",SC,r),Dd(n,"deployment-details",OC,r)}var fH=t.Union([t.Literal("scalar"),t.Literal("timeseries")]),gH="/v0/promql",_p=t.Object({query:p({type:"long",allowEmpty:!1,description:"PromQL expression to evaluate."}),timeRange:zo,step:p({allowEmpty:!1,description:"Evaluation step interval (e.g. `1m`, `5m`, `1h`). Must be a valid Prometheus duration string."}),returnType:t.Optional(fH),executionOptions:gl,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."}))}),yH={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(_p,{examples:[yH]});var y4e=m({tags:["promql"],url:gH,method:"POST",body:_p,response:Vc});var RC=`/${"v1"}/aggregation`,CC=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."})}),PC=t.Object({results:t.Array(t.Object({...CC.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."}),hH={results:[{id:"q1",group:{host:"server-1"},value:123.45}]};Object.assign(PC,{examples:[hH]});var Ip=t.Object({series:t.Array(t.Object({...CC.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."}),TH={series:[{id:"q1",group:{host:"server-1"},points:[{timestamp:16094592e5,value:123.45},{timestamp:160945926e4,value:456.78}]}]};Object.assign(Ip,{examples:[TH]});var EH=t.Omit(Pa.items,["fill"],{title:"AggregationQuery",description:"Aggregation query. Omit `filter` for an unfiltered query and omit `functions` when no post-processing is needed."}),_H=t.Optional(Sr),UC={timeRange:mt,queries:t.Array(EH,{maxItems:Xc,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 ${Xc} 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:_H,dataSource:LS,formula:t.Optional(Bn)},wC=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."}))}),NC=t.Object(UC,{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."}),IH={timeRange:{from:1782201500,to:1782203400},dataSource:"logs",queries:[{aggregate:{type:"count"},filter:"context.service.name:checkout"}],groupBy:[{fields:["level"],limit:5}]};Object.assign(NC,{examples:[IH]});var LC=m({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:`${RC}/multi-query/scalar`,method:"POST",body:NC,query:wC,response:PC}),vC=t.Object({...UC,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."}),bH={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(vC,{examples:[bH]});var kC=m({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:`${RC}/multi-query/timeseries`,method:"POST",body:vC,query:wC,response:Ip});var SH=`/${"v1"}/promql`,OH=t.Object({...t.Pick(_p,["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"}]}),AH=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."}))}),MC=m({description:"Runs a PromQL range query over Tsuga metric data and returns timeseries results. Authenticate with a bearer operation API key or OAuth access token that can read metrics. Send clusterId as a query parameter; multi-cluster organizations must provide it. See [How to write PromQL queries](/documentation/visualize/guides/how-to-write-promql-queries) for query syntax and examples.",operationId:"queryPromql",tags:["public","promql"],url:SH,method:"POST",body:OH,query:AH,response:Ip});function DC(e,r){let n=e.command("promql").description("Run PromQL queries over metric data");no(n,"query","Run a PromQL range query over metric data",MC,r)}var Lr="/v0/dashboards",$C=["white","gray.100","amber.200","lime.200","emerald.200","cyan.200","blue.200","violet.200","fuchsia.200","pink.200","red.200"],xH=["bar","distribution","gauge","heatmap","list","pie","query-value","table","timeseries","top-list"],z4e=[...xH,"note"];var RH=["ns","us","ms","s","m","h","days"];var CH=["B","KB","MB","GB","TB","PB"];var PH=20;var jC=t.Object({type:t.Literal("cpu",{description:"Normalizes values as CPU usage"})},{$id:"DataNormalizerCpu",title:"CPU"}),qC=t.Object({type:t.Literal("duration",{description:"Normalizes values as durations using standard time units"}),unit:t.Enum(RH,{description:"Time unit used to present the normalized values"})},{$id:"DataNormalizerDuration",title:"Duration"}),BC=t.Object({type:t.Literal("data",{description:"Normalizes values as data sizes using byte units"}),unit:t.Enum(CH,{description:"Data size unit used to present the normalized values"})},{$id:"DataNormalizerData",title:"Data"}),FC=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"}),HC=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"}),KC=t.Object({type:t.Literal("date",{description:"Formats values as calendar dates"})},{$id:"DataNormalizerDate",title:"Date"}),zC=t.Object({type:t.Literal("level",{description:"Displays values using their log level name"})},{$id:"DataNormalizerLevel",title:"Level"}),YC=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"}),UH=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"}),wH=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:PH})},{$id:"InputDataNormalizerCustom",title:"Custom"}),ht=b("type",[qC,BC,FC,HC,KC,zC,jC,YC,UH],{title:"Normalizer",description:"Display-value formatter for widget values or list/table columns."}),Tt=b("type",[qC,BC,FC,HC,KC,zC,jC,YC,wH],{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(ht)},{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(Tt)},{title:"WidgetListColumn",description:"List column pairing a displayed attribute with the formatting applied to its values."}),mi=["background","no-background"],NH=["table","legend-only","no-legend"];var LH=["greater_than","less_than","equal","not_equal","greater_than_or_equal","less_than_or_equal"],VC=["alert","warning","success"],mr=t.Object({operator:t.Enum(LH,{description:"Comparator used to evaluate the metric value"}),value:t.Number({description:"Threshold value used when evaluating the operator"}),color:t.Enum(VC,{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."}),vH=t.Object({value:t.Number({description:"Y-axis value where the threshold marker is placed"}),level:t.Enum(VC,{description:"Level applied to the threshold marker"})},{title:"ThresholdMarker",description:"Marker line drawn across the chart at a fixed value, colored by its level."}),kH=["sec","min","hour","day"],hn=t.Object({time:t.Number({description:"Numeric count of `metric` units in each bucket. Required when `timeBucket` is present."}),metric:t.Enum(kH,{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 yn=t.Enum(["flex-start","center","flex-end"],{description:"Flex alignment keyword used for widget layout"}),di=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."}),fi=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."}),Sp={source:zt,queries:YS,formula:t.Optional(Jc),aliases:t.Optional(di),visibleSeries:t.Optional(t.Array(t.Boolean(),{description:"Flags indicating whether each query or formula series is visible"}))},Op={source:zt,queries:Pa,formula:t.Optional(Bn),aliases:t.Optional(fi),visibleSeries:t.Optional(t.Array(t.Boolean(),{description:"Flags indicating whether each query or formula series is visible"}))},gi={...Sp,groupBy:t.Optional(Yo)},yi={...Op,groupBy:t.Optional(Sr)},Ce=t.Enum(NH,{description:"Controls whether and how the widget displays legend or series details (e.g. table, legend-only, or no legend)"}),le=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(vH,{description:"Threshold markers displayed on the chart"})),MH=t.Object({name:t.String({description:"Display name of the table column"}),...Sp,source:zt,normalizer:t.Optional(ht),precision:le},{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`."}),DH=t.Object({name:p({description:"Display name of the table column"}),...Op,source:zt,normalizer:t.Optional(Tt),precision:le},{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`."}),GH=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."}),$H=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."}),QC=["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(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"}),qH=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"}),bp=b("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"}),hi=t.Object({min:bp,max:bp,scale:b("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."}),Ti=t.Object({min:bp,max:bp,scale:b("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."}),BH=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"}),FH=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 HH=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(Ce),thresholds:jt,yAxisSettings:t.Optional(hi)},{$id:"GraphVisualizationTimeseriesConnection",title:"TimeseriesConnection"}),KH=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(Ce),thresholds:jt,yAxisSettings:t.Optional(Ti)},{$id:"InputGraphVisualizationTimeseriesConnection",title:"TimeseriesConnection"}),zH=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"}),YH=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"}),VH=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"}),QH=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"}),WH=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(Ce)},{$id:"GraphVisualizationPieConnection",title:"PieConnection"}),ZH=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(Ce)},{$id:"InputGraphVisualizationPieConnection",title:"PieConnection"}),XH=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(Ce),thresholds:jt,yAxisSettings:t.Optional(hi)},{$id:"GraphVisualizationBarConnection",title:"BarConnection"}),JH=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(Ce),thresholds:jt,yAxisSettings:t.Optional(Ti)},{$id:"InputGraphVisualizationBarConnection",title:"BarConnection"}),e2=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(mi,{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:le,normalizer:t.Optional(ht),legendMode:t.Optional(Ce)},{$id:"GraphVisualizationQueryValueConnection",title:"QueryValueConnection"}),t2=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(mi,{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:le,normalizer:t.Optional(Tt),legendMode:t.Optional(Ce)},{$id:"InputGraphVisualizationQueryValueConnection",title:"QueryValueConnection"}),r2=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(QC,{description:"Layout used to render log patterns"}))},{$id:"GraphVisualizationListLogPatterns",title:"ListLogPatterns"}),n2=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(QC,{description:"Layout used to render log patterns"}))},{$id:"InputGraphVisualizationListLogPatterns",title:"ListLogPatterns"}),o2=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"}),i2=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"}),es=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."}),ts=t.Array(p({allowEmpty:!1,type:"long",description:"Raw PromQL expression for this widget."}),{minItems:1,description:"PromQL expressions configured for this widget."}),a2=t.Object({type:t.Literal("timeseries-promql",{description:"Displays PromQL metrics query-based aggregation as a time series chart"}),queries:es,aliases:t.Optional(di),timeBucket:t.Optional(hn),normalizer:t.Optional(ht),precision:le,legendMode:t.Optional(Ce),thresholds:jt,yAxisSettings:t.Optional(hi),smoothing:t.Optional(t.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"}))},{$id:"GraphVisualizationTimeseriesPromql",title:"TimeseriesPromql"}),s2=t.Object({type:t.Literal("timeseries-promql",{description:"Displays PromQL metrics query-based aggregation as a time series chart"}),queries:ts,aliases:t.Optional(fi),timeBucket:t.Optional(hn),normalizer:t.Optional(Tt),precision:le,legendMode:t.Optional(Ce),thresholds:jt,yAxisSettings:t.Optional(Ti),smoothing:t.Optional(t.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"}))},{$id:"InputGraphVisualizationTimeseriesPromql",title:"TimeseriesPromql"}),c2=t.Object({type:t.Literal("query-value-promql",{description:"Configures a PromQL metrics query-based aggregation as a single value"}),queries:es,aliases:t.Optional(di),backgroundMode:t.Optional(t.Enum(mi,{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:le,normalizer:t.Optional(ht),legendMode:t.Optional(Ce)},{$id:"GraphVisualizationQueryValuePromql",title:"QueryValuePromql"}),p2=t.Object({type:t.Literal("query-value-promql",{description:"Configures a PromQL metrics query-based aggregation as a single value"}),queries:ts,aliases:t.Optional(fi),backgroundMode:t.Optional(t.Enum(mi,{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:le,normalizer:t.Optional(Tt),legendMode:t.Optional(Ce)},{$id:"InputGraphVisualizationQueryValuePromql",title:"QueryValuePromql"}),u2=t.Object({type:t.Literal("top-list-promql",{description:"Displays PromQL metrics query-based aggregation as a ranked top list"}),queries:es,aliases:t.Optional(di),normalizer:t.Optional(ht),precision:le,conditions:t.Optional(t.Array(mr,{description:"Conditional formatting rules applied to the displayed value"}))},{$id:"GraphVisualizationTopListPromql",title:"TopListPromql"}),l2=t.Object({type:t.Literal("top-list-promql",{description:"Displays PromQL metrics query-based aggregation as a ranked top list"}),queries:ts,aliases:t.Optional(fi),normalizer:t.Optional(Tt),precision:le,conditions:t.Optional(t.Array(mr,{description:"Conditional formatting rules applied to the displayed value"}))},{$id:"InputGraphVisualizationTopListPromql",title:"TopListPromql"}),m2=t.Object({type:t.Literal("pie-promql",{description:"Displays PromQL metrics query-based aggregation as a pie chart"}),queries:es,aliases:t.Optional(di),normalizer:t.Optional(ht),precision:le,legendMode:t.Optional(Ce)},{$id:"GraphVisualizationPiePromql",title:"PiePromql"}),d2=t.Object({type:t.Literal("pie-promql",{description:"Displays PromQL metrics query-based aggregation as a pie chart"}),queries:ts,aliases:t.Optional(fi),normalizer:t.Optional(Tt),precision:le,legendMode:t.Optional(Ce)},{$id:"InputGraphVisualizationPiePromql",title:"PiePromql"}),f2=t.Object({type:t.Literal("bar-promql",{description:"Displays PromQL metrics query-based aggregation as a bar chart"}),queries:es,aliases:t.Optional(di),timeBucket:t.Optional(hn),precision:le,normalizer:t.Optional(ht),thresholds:jt,legendMode:t.Optional(Ce),yAxisSettings:t.Optional(hi)},{$id:"GraphVisualizationBarPromql",title:"BarPromql"}),g2=t.Object({type:t.Literal("bar-promql",{description:"Displays PromQL metrics query-based aggregation as a bar chart"}),queries:ts,aliases:t.Optional(fi),timeBucket:t.Optional(hn),precision:le,normalizer:t.Optional(Tt),thresholds:jt,legendMode:t.Optional(Ce),yAxisSettings:t.Optional(Ti)},{$id:"InputGraphVisualizationBarPromql",title:"BarPromql"}),y2=t.Object({type:t.Literal("timeseries",{description:"Displays the aggregation as a time series chart"}),...gi,timeBucket:t.Optional(hn),normalizer:t.Optional(ht),precision:le,legendMode:t.Optional(Ce),thresholds:jt,yAxisSettings:t.Optional(hi),smoothing:t.Optional(t.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"}))},{$id:"GraphVisualizationTimeseries",title:"Timeseries"}),h2=t.Object({type:t.Literal("timeseries",{description:"Displays the aggregation as a time series chart"}),...yi,timeBucket:t.Optional(hn),normalizer:t.Optional(Tt),precision:le,legendMode:t.Optional(Ce),thresholds:jt,yAxisSettings:t.Optional(Ti),smoothing:t.Optional(t.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"}))},{$id:"InputGraphVisualizationTimeseries",title:"Timeseries"}),T2=t.Object({type:t.Literal("top-list",{description:"Displays the aggregation as a ranked list of top results"}),...gi,normalizer:t.Optional(ht),precision:le,conditions:t.Optional(t.Array(mr,{description:"Conditional formatting rules applied to the displayed value"}))},{$id:"GraphVisualizationTopList",title:"TopList"}),E2=t.Object({type:t.Literal("top-list",{description:"Displays the aggregation as a ranked list of top results"}),...yi,normalizer:t.Optional(Tt),precision:le,conditions:t.Optional(t.Array(mr,{description:"Conditional formatting rules applied to the displayed value"}))},{$id:"InputGraphVisualizationTopList",title:"TopList"}),_2=t.Object({type:t.Literal("pie",{description:"Displays the aggregation as a pie chart"}),...gi,normalizer:t.Optional(ht),precision:le,legendMode:t.Optional(Ce)},{$id:"GraphVisualizationPie",title:"Pie"}),I2=t.Object({type:t.Literal("pie",{description:"Displays the aggregation as a pie chart"}),...yi,normalizer:t.Optional(Tt),precision:le,legendMode:t.Optional(Ce)},{$id:"InputGraphVisualizationPie",title:"Pie"}),b2=t.Object({type:t.Literal("query-value",{description:"Displays the aggregation as a single value"}),...Sp,backgroundMode:t.Optional(t.Enum(mi,{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:le,normalizer:t.Optional(ht),legendMode:t.Optional(Ce)},{$id:"GraphVisualizationQueryValue",title:"QueryValue"}),S2=t.Object({type:t.Literal("query-value",{description:"Displays the aggregation as a single value"}),...Op,backgroundMode:t.Optional(t.Enum(mi,{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:le,normalizer:t.Optional(Tt),legendMode:t.Optional(Ce)},{$id:"InputGraphVisualizationQueryValue",title:"QueryValue"}),O2=t.Object({type:t.Literal("bar",{description:"Displays the aggregation as a bar chart"}),...gi,timeBucket:t.Optional(hn),precision:le,normalizer:t.Optional(ht),thresholds:jt,legendMode:t.Optional(Ce),yAxisSettings:t.Optional(hi)},{$id:"GraphVisualizationBar",title:"Bar"}),A2=t.Object({type:t.Literal("bar",{description:"Displays the aggregation as a bar chart"}),...yi,timeBucket:t.Optional(hn),precision:le,normalizer:t.Optional(Tt),thresholds:jt,legendMode:t.Optional(Ce),yAxisSettings:t.Optional(Ti)},{$id:"InputGraphVisualizationBar",title:"Bar"}),x2=t.Object({type:t.Literal("distribution",{description:"Displays the aggregation as a distribution chart"}),...gi,precision:le,normalizer:t.Optional(ht),percentileMarkers:t.Optional(BH),boundsScale:t.Optional(Zc)},{$id:"GraphVisualizationDistribution",title:"Distribution"}),R2=t.Object({type:t.Literal("distribution",{description:"Displays the aggregation as a distribution chart"}),...yi,precision:le,normalizer:t.Optional(Tt),percentileMarkers:t.Optional(FH),boundsScale:t.Optional(Zc)},{$id:"InputGraphVisualizationDistribution",title:"Distribution"}),WC=["red","pink","violet","blue","cyan","green","yellow","orange"],ZC=t.Enum(WC,{description:"Color palette used to render the heatmap intensity gradient"}),C2=t.Object({type:t.Literal("heatmap",{description:"Displays the aggregation as a heatmap chart"}),...gi,precision:le,normalizer:t.Optional(ht),palette:t.Optional(ZC)},{$id:"GraphVisualizationHeatmap",title:"Heatmap"}),P2=t.Object({type:t.Literal("heatmap",{description:"Displays the aggregation as a heatmap chart"}),...yi,precision:le,normalizer:t.Optional(Tt),palette:t.Optional(ZC)},{$id:"InputGraphVisualizationHeatmap",title:"Heatmap"}),XC=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(WC,{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."}),U2=t.Object({type:t.Literal("gauge",{description:"Displays the aggregation as a gauge"}),...Sp,max:t.Optional(t.Number({description:"Gauge maximum value"})),colorThresholds:t.Optional(t.Array(XC,{description:"Color thresholds inside the gauge range"})),precision:le,normalizer:t.Optional(ht)},{$id:"GraphVisualizationGauge",title:"Gauge"}),w2=t.Object({type:t.Literal("gauge",{description:"Displays the aggregation as a gauge"}),...Op,max:t.Optional(t.Number({description:"Gauge maximum value"})),colorThresholds:t.Optional(t.Array(XC,{description:"Color thresholds inside the gauge range"})),precision:le,normalizer:t.Optional(Tt)},{$id:"InputGraphVisualizationGauge",title:"Gauge"}),N2=t.Object({type:t.Literal("table",{description:"Displays the aggregation as a table with multi-level grouping"}),columns:t.Array(MH,{description:"Each column defines an independent aggregation displayed as a table column"}),groupBy:t.Optional(Yo),defaultSorting:t.Optional(GH),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"}),L2=t.Object({type:t.Literal("table",{description:"Displays the aggregation as a table with multi-level grouping"}),columns:t.Array(DH,{minItems:1,description:"Each column defines an independent aggregation displayed as a table column"}),groupBy:t.Optional(Sr),defaultSorting:t.Optional($H),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"}),v2=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($C,{description:"Background color used to render the note"})),noteAlign:t.Optional(yn),noteJustifyContent:t.Optional(yn)},{$id:"GraphVisualizationNote",title:"Note"}),k2=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($C,{description:"Background color used to render the note"})),noteAlign:t.Optional(yn),noteJustifyContent:t.Optional(yn)},{$id:"InputGraphVisualizationNote",title:"Note"}),M2=b("type",[HH,zH,VH,WH,XH,e2,a2,c2,u2,m2,f2,y2,T2,_2,b2,U2,O2,x2,C2,N2,jH,v2,r2,o2],{description:"Widget visualization configuration. The `type` discriminator selects the widget kind and its required fields."}),D2=b("type",[KH,YH,QH,ZH,JH,t2,s2,p2,l2,d2,g2,h2,E2,I2,S2,w2,A2,R2,P2,L2,qH,k2,n2,i2],{description:"Widget visualization configuration. The `type` discriminator selects the widget kind and its required fields."}),Ap=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(yn),descriptionJustifyContent:t.Optional(yn),visualization:M2,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."}),xp=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(yn),descriptionJustifyContent:t.Optional(yn),visualization:D2,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."}),GC=10,G2=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."}),$2=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:GC,description:`Dashboard-wide filters applied to every widget on the dashboard. Up to ${GC} filters are allowed.`}),Ei=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(Ap,{description:"Ordered widgets that compose the dashboard"}),filters:t.Optional(G2),createdAt:E({description:"Timestamp when Tsuga created the dashboard."}),updatedAt:E({description:"Timestamp when Tsuga last updated the dashboard."}),creator:t.Optional(ue),updater:t.Optional(ue),tags:Me,timePreset:t.Optional(t.Enum(nu,{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."}))}),Rp=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(xp,{description:"Ordered widgets that compose the dashboard"}),filters:t.Optional($2),tags:Ve,timePreset:t.Optional(t.Enum(nu,{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"},JC=[Wt.OWNER,Wt.TAGS,Wt.WIDGET_COUNT,Wt.UPDATED_AT,Wt.NAME],Cp=t.Partial(t.Object({owners:Be(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:Be(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"})),j2=t.Partial(t.Object({...ye,filters:Cp,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"})})),Y4e=m({tags:["dashboards"],url:`${Lr}/query`,method:"POST",paginated:!0,response:t.Array(Ei),body:j2}),V4e=m({tags:["dashboards"],url:`${Lr}/tags/query`,method:"POST",body:t.Object({filters:t.Optional(t.Omit(Cp,["tags"]))}),response:Yt}),Q4e=m({tags:["dashboards"],url:`${Lr}/:id`,method:"GET",params:t.Object({id:p()}),response:Ei}),W4e=m({tags:["dashboards"],url:Lr,method:"POST",body:Rp,response:Ei}),Z4e=m({tags:["dashboards"],url:`${Lr}/:id`,method:"PUT",params:t.Object({id:p()}),body:t.Partial(Rp),response:Ei}),X4e=m({tags:["dashboards"],url:`${Lr}/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({})}),J4e=m({tags:["dashboards"],url:`${Lr}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),eYe=m({tags:["dashboards"],url:`${Lr}/:id/graphs/:graphId`,method:"PUT",params:t.Object({id:p({allowEmpty:!1}),graphId:p({allowEmpty:!1})}),body:t.Omit(xp,["id"]),response:Ap}),tYe=m({tags:["dashboards"],url:`${Lr}/bulk-delete`,method:"DELETE",body:t.Object({ids:t.Array(p())}),response:t.Object({})});var _i=`/${"v1"}/dashboards`,rs=t.Pick(Ei,["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)."}),q2={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(rs,{examples:[q2]});var B2=t.Object({by:t.Enum([...JC],{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"}),eP=t.Object({...ze,filters:t.Optional(t.Pick(Cp,["owners","searchQuery","tags","folderId"])),sort:t.Optional(B2)},{description:"Dashboard query request. Use filters, sorting, limit, and offset to page through visible dashboards."}),F2={filters:{owners:{values:["team-123-abc"]},searchQuery:{value:"API"},tags:{values:[{key:"service",value:"api-gateway"}]},folderId:"folder-123-abc"},sort:{by:"name",direction:"asc"},limit:10,offset:0};Object.assign(eP,{examples:[F2]});var tP=m({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:`${_i}/query`,method:"POST",paginated:!0,body:eP,response:t.Array(rs)}),rP=m({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:`${_i}/: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:rs}),Bd=t.Pick(Rp,["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."}),H2={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:[H2]});var K2=t.Omit(xp,["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."}),nP=m({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:_i,method:"POST",body:Bd,response:rs}),oP=m({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:`${_i}/: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:rs}),z2=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."})}),iP=m({description:"Deletes a dashboard by ID. Use only after confirming no users or automation still rely on the dashboard.",operationId:"deleteDashboard",tags:["dashboards"],url:`${_i}/:id`,method:"DELETE",params:z2,response:R}),pYe=m({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:`${_i}/: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:K2,response:Ap});var aP=100,sP=3,Ii=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:E({description:"Timestamp when Tsuga last updated the key metadata."}),createdAt:E({description:"Timestamp when Tsuga created the key."}),creator:t.Optional(ue),updater:t.Optional(ue),assetUpdatedAt:E({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})}),ns=t.Object({name:t.String({format:$o,minLength:1,maxLength:aP,description:`Kebab-case name for the ingestion API key. Maximum length is ${aP} 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:sP,description:`Array form. Up to ${sP} 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."})}),os="/v0/ingestion-api-keys",TYe=m({tags:["ingestion-api-keys"],url:os,method:"POST",body:ns,response:t.Intersect([Ii,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."})})])}),EYe=m({tags:["ingestion-api-keys"],url:os,method:"GET",paginated:!0,query:t.Object(ye),response:t.Array(Ii)}),_Ye=m({tags:["ingestion-api-keys"],url:`${os}/:id`,method:"GET",params:t.Object({id:p({allowEmpty:!1})}),response:Ii}),IYe=m({tags:["ingestion-api-keys"],url:`${os}/:id`,method:"PUT",params:t.Object({id:p({allowEmpty:!1})}),body:ns,response:Ii}),bYe=m({tags:["ingestion-api-keys"],url:`${os}/:id`,method:"DELETE",params:t.Object({id:p({allowEmpty:!1})}),response:R});var is=`/${"v1"}/ingestion-api-keys`,as=t.Pick(Ii,["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)."}),cP={id:"123-456-abc",name:"production-logs-ingestion",keyLastCharacters:"x7Qm",owner:"team-123-abc",tags:[{key:"env",value:"production"}],teamOverrideFields:["service"]};Object.assign(as,{examples:[cP]});var pP=t.Pick(ns,["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."}),uP=t.Pick(ns,["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."}),lP={name:"production-logs-ingestion",owner:"team-123-abc",tags:[{key:"env",value:"production"}],teamOverrideFields:["service"]};Object.assign(pP,{examples:[lP]});Object.assign(uP,{examples:[lP]});var Y2={...cP,key:"tsuga_in:v1:abc123xyx7Qm"},mP=m({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:is,method:"GET",paginated:!0,query:t.Object(ze),response:t.Array(as)}),UYe=m({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:`${is}/: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:as}),V2=t.Intersect([t.Pick(as,["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:Y2}),dP=m({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:is,method:"POST",body:pP,response:V2}),fP=m({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:`${is}/: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:uP,response:as}),gP=m({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:`${is}/: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 Q2={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"]}},[vYe,Kd,ss]=W2(Q2);function W2(e){let r=[],n=[],o=[],i=Object.keys(e);for(let a of i){r.push(a);let c=e[a];for(let l in c){n.push(l);let d=c[l];Array.isArray(d)&&o.push(...d)}}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"]),Z2=t.Object({versioningStatus:t.Optional(t.Enum(["Enabled","Disabled","Suspended","Not configured"]))}),X2=t.Object({domainName:t.Optional(t.String()),origins:t.Optional(t.Array(t.String()))}),J2=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())}),eK=t.Object({version:t.Optional(t.String()),virtualNetworkId:t.Optional(t.String()),subnets:t.Optional(t.Array(t.String()))}),tK=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())}),rK=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()))}),nK=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(E())}),oK=t.Object({isEncrypted:t.Optional(t.Boolean()),ownerId:t.Optional(t.String()),state:t.Optional(t.Enum(["creating","available","deleting","deleted","error","updating"]))}),iK=t.Object({type:t.Optional(t.String()),osType:t.Optional(t.String()),subnetIds:t.Optional(t.Array(t.String())),nbContainers:t.Optional(t.Number())}),aK=t.Object({digest:t.String(),imageTags:t.Array(t.String()),imageSizeBytes:t.Optional(t.Number()),imagePushedAt:t.Optional(E()),mediaType:t.Optional(t.String()),repositoryName:t.String(),repositoryId:t.Optional(t.String()),scanStatus:t.Optional(t.String())}),sK=t.Object({url:t.Optional(t.String()),maxMessageSizeBytes:t.Optional(t.Number()),messageRetentionHours:t.Optional(t.Number())}),cK=t.Object({runtime:t.Optional(t.String()),memoryAllocationMib:t.Optional(t.Number()),timeoutMs:t.Optional(t.Number()),codeSha256:t.Optional(t.String())}),pK=t.Object({kind:t.Optional(t.String())}),uK=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())}),lK=t.Object({id:t.Optional(t.String()),ipCidrBlocks:t.Array(t.String())}),mK=t.Object({protocol:t.Optional(Hd),port:t.Optional(t.Number()),instanceProtocol:t.Optional(Hd),instancePort:t.Optional(t.Number())}),dK=t.Object({protocol:t.Optional(t.String()),ports:t.Optional(t.Array(t.String())),portRange:t.Optional(t.String()),allPorts:t.Optional(t.Boolean())}),fK=t.Object({name:t.String(),ip:t.Optional(t.String()),type:t.Enum(["public","private"])}),gK=t.Object({type:t.String(),name:t.String()}),yK=t.Object({frontendIp:t.Optional(fK),backendIpPools:t.Array(gK)}),hK=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())}),TK=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(hK)),targetCount:t.Optional(t.Number()),healthyTargetCount:t.Optional(t.Number()),loadBalancerArns:t.Optional(t.Array(t.String()))}),EK=t.Object({first:t.Optional(t.String()),last:t.Optional(t.String()),scope:t.Optional(t.Number())}),_K=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(),EK]))),target:t.Optional(t.String()),weight:t.Optional(t.Number()),priority:t.Optional(t.Number()),status:t.Optional(t.String())}),IK=t.Object({instanceId:t.Optional(t.String()),state:t.Optional(t.String()),reasonCode:t.Optional(t.String()),description:t.Optional(t.String())}),bK=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(mK),t.Array(dK)])),targets:t.Optional(t.Union([t.Array(t.String()),t.Array(IK),t.Array(_K)])),azureLoadBalancingRules:t.Optional(t.Array(yK))}),SK=t.Object({domainName:t.Optional(t.String()),expiresAt:t.Optional(E()),inUseBy:t.Optional(t.Array(t.String())),renewalEligibility:t.Optional(t.String()),revokedAt:t.Optional(E()),status:t.Optional(t.String()),type:t.Optional(t.String())}),OK=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"]))}),AK=t.Object({osType:t.Optional(t.Enum(["Windows","Linux"]))}),xK=t.Object({state:t.Optional(t.String()),volumeType:t.Optional(t.String())}),RK=t.Intersect([t.Object({isEncrypted:t.Optional(t.Boolean()),sizeGib:t.Optional(t.Number())}),t.Union([OK,xK,AK])]),CK=t.Object({instanceCount:t.Optional(t.Number()),hostnames:t.Optional(t.Array(t.String())),runtime:t.Optional(t.String())}),Pp=t.Union([t.Object({category:t.Literal("application"),resourceType:t.Literal("webService"),attributes:t.Optional(CK)}),t.Object({category:t.Literal("data"),resourceType:t.Literal("bucket"),attributes:t.Optional(Z2)}),t.Object({category:t.Literal("data"),resourceType:t.Literal("messagingService"),attributes:t.Optional(sK)}),t.Object({category:t.Literal("data"),resourceType:t.Literal("fileSystem"),attributes:t.Optional(oK)}),t.Object({category:t.Literal("data"),resourceType:t.Literal("contentDeliveryNetwork"),attributes:t.Optional(X2)}),t.Object({category:t.Literal("data"),resourceType:t.Literal("database"),attributes:t.Optional(J2)}),t.Object({category:t.Literal("data"),resourceType:t.Literal("storageAccount"),attributes:t.Optional(pK)}),t.Object({category:t.Literal("data"),resourceType:t.Literal("volume"),attributes:t.Optional(RK)}),t.Object({category:t.Literal("compute"),resourceType:t.Literal("virtualMachine"),attributes:t.Optional(uK)}),t.Object({category:t.Literal("compute"),resourceType:t.Literal("serverless"),attributes:t.Optional(cK)}),t.Object({category:t.Literal("container"),resourceType:t.Literal("kubernetesCluster"),attributes:t.Optional(eK)}),t.Object({category:t.Literal("container"),resourceType:t.Literal("containerRepository"),attributes:t.Optional(tK)}),t.Object({category:t.Literal("container"),resourceType:t.Literal("containerCluster"),attributes:t.Optional(rK)}),t.Object({category:t.Literal("container"),resourceType:t.Literal("containerServiceTask"),attributes:t.Optional(nK)}),t.Object({category:t.Literal("container"),resourceType:t.Literal("containerService"),attributes:t.Optional(iK)}),t.Object({category:t.Literal("container"),resourceType:t.Literal("containerImage"),attributes:t.Optional(aK)}),t.Object({category:t.Literal("network"),resourceType:t.Literal("virtualNetwork"),attributes:t.Optional(lK)}),t.Object({category:t.Literal("network"),resourceType:t.Literal("loadBalancer"),attributes:bK}),t.Object({category:t.Literal("network"),resourceType:t.Literal("targetGroup"),attributes:t.Optional(TK)}),t.Object({category:t.Literal("network"),resourceType:t.Literal("certificate"),attributes:t.Optional(SK)})],{description:"Normalized public inventory category, resource type, and category-specific attributes. Attribute shape depends on the category and resourceType combination."});var ao="/v0/inventory",cs=["aws","gcp","azure"],yP=["scan_in_progress","success","failure","partial"],Yd=t.Object({id:t.String({description:"Identifier of the inventory resource. Generated by Tsuga."}),cloudPlatform:t.Enum(cs,{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(E({description:"Timestamp when the resource was created in the cloud, when known."})),resourceUpdatedAt:t.Optional(E({description:"Timestamp when the resource was last updated in the cloud, when known."})),resourceLastSeenAt:E({description:"Timestamp when Tsuga last observed this resource during an inventory scan."}),tags:Me,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"}))}),bi={DISPLAY_NAME:"displayName",CLOUD_ACCOUNT:"cloudAccount",NATIVE_RESOURCE_TYPE:"nativeResourceType",CLOUD_REGION:"cloudRegion",RESOURCE_TYPE:"resourceType",RESOURCE_CREATED_AT:"resourceCreatedAt"},hP=t.Object({cloudPlatforms:Be(t.Enum(cs),{description:"Restrict results to resources discovered on any of these cloud platforms",maxItems:cs.length}),cloudAccounts:Be(p({allowEmpty:!1}),{description:"Restrict results to resources in any of these cloud accounts",maxItems:500}),cloudRegions:Be(p({allowEmpty:!1}),{description:"Restrict results to resources in any of these cloud regions",maxItems:500}),nativeResourceTypes:Be(t.Enum(ss),{description:"Restrict results to resources of any of these cloud-native resource types",maxItems:ss.length}),resourceTypes:Be(t.Enum(Kd),{description:"Restrict results to resources of any of these normalized resource types",maxItems:Kd.length}),tags:Be(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"}),Vd=t.Partial(t.Object({...ye,filters:t.Partial(hP,{description:"Filters applied to narrow the returned resources."}),sort:t.Object({by:t.Enum([bi.DISPLAY_NAME,bi.CLOUD_ACCOUNT,bi.NATIVE_RESOURCE_TYPE,bi.CLOUD_REGION,bi.RESOURCE_TYPE,bi.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."})})),BYe=m({tags:["inventory"],method:"POST",url:`${ao}/resources/query`,paginated:!0,body:Vd,response:t.Array(t.Intersect([Yd,Pp]))}),PK=["resourceType","cloudAccount","isIacManaged"],FYe=m({tags:["inventory"],method:"POST",url:`${ao}/resources/counts`,body:t.Object({filters:t.Optional(t.Partial(hP)),groupBy:t.Enum(PK,{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."})}))}),HYe=m({tags:["inventory"],method:"GET",url:`${ao}/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})}),KYe=b("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."})})]),UK="^[0-9]{12}$",wK="^arn:aws[a-z-]*:iam::[0-9]{12}:role/.+$",NK="^[a-z][a-z0-9-]{4,28}[a-z0-9]$",LK="^[^@\\s]+@[^@\\s]+\\.iam\\.gserviceaccount\\.com$",vK="^//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}$",kK=t.Object({type:t.Literal("aws",{description:"Discriminator identifying AWS connection settings."}),accountId:t.String({pattern:UK,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:wK,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"}),MK=t.Object({type:t.Literal("gcp",{description:"Discriminator identifying GCP connection settings."}),projectId:t.String({pattern:NK,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:LK,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:vK,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"}),DK=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"}),TP=b("type",[kK,MK,DK],{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`."}),Si=t.Object({id:t.String({description:"Identifier of the cloud account. Generated by Tsuga."}),cloudType:t.Enum(cs,{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:E({description:"Timestamp when the account was registered in Tsuga."}),lastScanStartedAt:t.Optional(E({description:"Timestamp when the most recent inventory scan started."})),lastScanFinishedAt:t.Optional(E({description:"Timestamp when the most recent inventory scan finished."})),lastScanStatus:t.Optional(t.Enum(yP,{description:"Status of the most recent inventory scan."}))}),Qd=t.Object({cloudType:t.Enum(cs,{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:TP,lastScanStatus:t.Optional(t.Enum(yP,{description:"Status of the most recent inventory scan."}))}),so=`${ao}/cloud-accounts`,zYe=m({tags:["inventory"],url:so,method:"GET",response:t.Array(Si)}),YYe=m({tags:["inventory"],url:`${so}/:id`,method:"GET",params:t.Object({id:p()}),response:Si}),VYe=m({tags:["inventory"],url:so,method:"POST",body:Qd,response:Si}),Wd=t.Object({accountFriendlyName:p({description:"Human-readable name for the account shown in Tsuga."})}),QYe=m({tags:["inventory"],url:`${so}/:id`,method:"PUT",params:t.Object({id:p()}),body:Wd,response:Si}),WYe=m({tags:["inventory"],url:`${so}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),ZYe=m({tags:["inventory"],url:`${ao}/trigger-scan`,method:"POST",body:t.Object({}),response:t.Object({success:t.Literal(!0)})}),XYe=m({tags:["inventory"],url:`${so}/azure/onboarding`,method:"POST",body:t.Object({tenantId:p()}),response:t.Object({subjectId:t.String(),audience:t.String()})}),JYe=m({tags:["inventory"],method:"POST",url:`${so}/validate/:type`,params:t.Object({type:p()}),body:t.Object({data:TP,id:t.Optional(p())}),response:t.Object({areAccountSettingsValid:t.Boolean(),message:t.Optional(t.String())})}),EP=`${ao}/settings`,eVe=m({tags:["inventory"],url:EP,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())}))}))})}),GK=50,tVe=m({tags:["inventory"],url:EP,method:"POST",body:t.Object({infrastructureIdentifiers:t.Array(t.Object({name:p({allowEmpty:!1}),value:t.Optional(p({allowEmpty:!1}))}),{maxItems:GK})}),response:t.Object({})}),rVe=m({tags:["inventory"],url:`${ao}/iac-tags-proposal`,method:"GET",response:t.Array(t.Object({name:t.String(),value:t.Optional(t.String())}))});var _P=`/${"v1"}/inventory`,$K=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)."}),IP=t.Intersect([$K,Pp],{$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)."}),jK={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(IP,{examples:[jK]});var bP=t.Object({...Vd.properties,...ze},{description:"Inventory resource query request. Use filters, sorting, limit, and offset to page through discovered resources."}),qK={filters:{cloudPlatforms:{values:["aws"]},cloudAccounts:{values:["123456789012"]},cloudRegions:{values:["us-east-1"]},resourceTypes:{values:["bucket"]},nativeResourceTypes:{values:["aws_s3_bucket"]},tags:{values:[{key:"team",value:"platform"}]},isIacManaged:!0,searchQuery:{value:"tsuga-example"}},sort:{by:"displayName",direction:"asc"},limit:10,offset:0};Object.assign(bP,{examples:[qK]});var SP=m({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:`${_P}/resources/query`,method:"POST",paginated:!0,body:bP,response:t.Array(IP)}),ps=`${_P}/cloud-accounts`,us=t.Pick(Si,["id","cloudType","cloudAccountId","accountFriendlyName"],{$id:"CloudAccount"}),BK={id:"123-456-abc",cloudType:"aws",cloudAccountId:"123456789012",accountFriendlyName:"Production AWS"};Object.assign(us,{examples:[BK]});var OP=t.Pick(Qd,["cloudType","cloudAccountId","accountFriendlyName","connectionSettings"]),FK={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(OP,{examples:[FK]});var HK=t.Pick(Wd,["accountFriendlyName"]),lVe=m({description:"Lists cloud accounts connected to Tsuga that the authenticated operation key can read.",operationId:"listCloudAccounts",tags:["inventory"],url:ps,method:"GET",response:t.Array(us)}),mVe=m({description:"Retrieves one cloud account by ID.",operationId:"getCloudAccount",tags:["inventory"],url:`${ps}/: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:us}),dVe=m({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:ps,method:"POST",body:OP,response:us}),fVe=m({description:"Updates the friendly name of a cloud account by ID.",operationId:"updateCloudAccount",tags:["inventory"],url:`${ps}/: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:HK,response:us}),gVe=m({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:`${ps}/: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 ls="/v0/investigations",KK=["dashboard","monitor","service","slo","log-route"],zK=t.Object({type:t.String({description:'Kind of linked asset, e.g. "dashboard"'}),id:t.String({description:"Identifier of the linked asset"})}),YK=t.Object({type:t.Enum(KK,{description:"Kind of linked asset"}),id:p({allowEmpty:!1,description:"Identifier of the linked asset"})}),vr=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:Me,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(zK,{description:"Assets (dashboards, monitors, \u2026) referenced by this investigation"}),creator:t.Optional(ue),updater:t.Optional(ue),createdAt:E({description:"Timestamp the investigation was created at."}),updatedAt:E({description:"Timestamp the investigation was last updated at."})},{title:"Investigation"}),Up=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(YK,{maxItems:100,description:"Assets (dashboards, monitors, \u2026) referenced by this investigation"}))}),Zd=t.Object(t.Omit(Up,["slug"]).properties),SVe=m({tags:["investigations"],url:ls,method:"GET",paginated:!0,query:t.Object(ye),response:t.Array(vr)}),OVe=m({tags:["investigations"],url:`${ls}/:id`,params:t.Object({id:p()}),method:"GET",response:vr}),AVe=m({tags:["investigations"],url:ls,method:"POST",body:Up,response:vr}),xVe=m({tags:["investigations"],url:`${ls}/:id`,method:"PUT",body:Zd,params:t.Object({id:p()}),response:vr}),RVe=m({tags:["investigations"],url:`${ls}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R});var ms=`/${"v1"}/investigations`,AP=m({description:"Retrieve all investigations",tags:["private"],url:ms,method:"GET",paginated:!0,query:t.Object(ze),response:t.Array(vr)}),xP=m({description:"Retrieve an investigation by its id",tags:["private"],url:`${ms}/:id`,method:"GET",params:t.Object({id:p({allowEmpty:!1})}),response:vr}),RP=m({description:"Create a new investigation",tags:["private"],url:ms,method:"POST",body:Up,response:vr}),CP=m({description:"Update an investigation by its id",tags:["private"],url:`${ms}/:id`,method:"PUT",body:Zd,params:t.Object({id:p({allowEmpty:!1})}),response:vr}),PP=m({description:"Delete an investigation by its id",tags:["private"],url:`${ms}/:id`,method:"DELETE",params:t.Object({id:p({allowEmpty:!1})}),response:R});var UP=15,wp={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:Me,updatedAt:t.Optional(E({description:"Timestamp when Tsuga last updated the processor."}))},Np={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(E({description:"Backend-maintained timestamp for this processor. Omit this field on create and update requests; Tsuga sets or preserves it based on processor changes."}))},wP={...wp,type:t.Literal("creator",{description:"Create processor. It writes a new attribute from a format string, formula, or category rule."})},NP={...Np,type:t.Literal("creator",{description:"Create processor. It writes a new attribute from a format string, formula, or category rule."})},VK=b("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."}),QK=b("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:UP,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."}),WK=t.Object({...wP,params:VK}),ZK=t.Object({...NP,params:QK}),LP={...wp,type:t.Literal("mapper",{description:"Map processor. It moves, copies, or normalizes existing log attributes."})},vP={...Np,type:t.Literal("mapper",{description:"Map processor. It moves, copies, or normalizes existing log attributes."})},XK=b("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."}),JK=b("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."}),ez=t.Object({...vP,params:JK}),tz=t.Object({...LP,params:XK}),kP={...wp,type:t.Literal("parse-attribute",{description:"Parse processor. It extracts structured fields from a text attribute."})},MP={...Np,type:t.Literal("parse-attribute",{description:"Parse processor. It extracts structured fields from a text attribute."})},DP=5,rz=b("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."}),nz=b("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:DP,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."}),oz=t.Object({...kP,params:rz}),iz=t.Object({...MP,params:nz}),az=t.Object({...NP,params:b("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:UP,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")})])}),sz=t.Object({...vP,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")})}),cz=t.Object({...MP,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:DP,description:"Example log lines for validating the Grok rules."})),subtype:t.Literal("grok")})}),jVe=b("type",[sz,cz,az]),pz=t.Object({...wP,params:b("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")})])}),uz=t.Object({...LP,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")})}),lz=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")})}),qVe=b("type",[uz,lz,pz]),mz=11,GP=t.Cyclic({OutputProcessor:t.Union([tz,oz,WK,t.Object({...wp,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"}),$P=t.Cyclic({InputProcessor:t.Union([ez,iz,ZK,t.Object({...Np,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:mz,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 dz="/v0/logs",Tn=`${dz}/routes`,En=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:Me,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(GP,{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:E({description:"Timestamp when Tsuga last updated the route."}),createdAt:E({description:"Timestamp when Tsuga created the route."}),assetUpdatedAt:E({description:"Timestamp when Tsuga last changed route behavior. This can differ from `updatedAt` when only metadata such as `description` or `tags` changed."})},{title:"LogRoute"}),ds=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:Ve,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($P,{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 WVe=m({tags:["routes"],url:Tn,method:"GET",paginated:!0,query:t.Object(ye),response:t.Array(En)}),ZVe=m({tags:["routes"],url:`${Tn}/:id`,params:t.Object({id:p()}),method:"GET",response:En}),XVe=m({tags:["routes"],url:Tn,method:"POST",body:ds,response:En}),JVe=m({tags:["routes"],url:`${Tn}/:id`,method:"PUT",body:ds,params:t.Object({id:p()}),response:En}),e5e=m({tags:["routes"],url:`${Tn}/:id/clone`,method:"POST",params:t.Object({id:p()}),body:ds,response:En}),t5e=m({tags:["routes"],url:`${Tn}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),r5e=m({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:`${Tn}/: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({})}),n5e=m({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:`${Tn}/: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:En});var fs=`/${"v1"}/routes`,jP={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}"]}}]},qP={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}}]},gs=t.Pick(En,["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)."}),fz={id:"123-456-abc",...jP},gz={id:"456-789-def",...qP};Object.assign(gs,{examples:[fz,gz]});var BP=m({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:fs,method:"GET",paginated:!0,query:t.Object(ze),response:t.Array(gs)}),FP=m({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:`${fs}/: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:gs}),Xd=t.Pick(ds,["name","description","isEnabled","query","tags","owner","processors"],{description:"Log route create or update request. Provide the route metadata, source query, owner team, enabled state, tags, and ordered processors."});Object.assign(Xd,{examples:[jP,qP]});var HP=m({description:"Creates a log route at the end of the evaluation order. Routes affect only newly ingested logs after the cluster receives the updated configuration.",operationId:"createRoute",tags:["routes"],url:fs,method:"POST",body:Xd,response:gs}),KP=m({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:`${fs}/:id`,method:"PUT",body:Xd,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:gs}),zP=m({description:"Deletes a log route by ID and compacts the evaluation order for remaining routes. The route stops processing future logs after the cluster receives the updated configuration.",operationId:"deleteRoute",tags:["routes"],url:`${fs}/:id`,method:"DELETE",params: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 ys=`/${"v1"}/monitors`,hs=t.Pick(Or,["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)."}),VP={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:[]},QP={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:[]},WP={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:[]},ZP={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:[]},yz={id:"123-456-abc",...VP},hz={id:"234-567-bcd",...QP},Tz={id:"345-678-cde",...WP},Ez={id:"456-789-def",...ZP};Object.assign(hs,{examples:[yz,hz,Tz,Ez]});var YP=t.Pick(vl,["filters","sort","limit","offset"]),XP=t.Object({...YP.properties,...ze,filters:YP.properties.filters},{description:"Monitor query request. Use filters, sorting, limit, and offset to page through visible monitors."}),_z={filters:{owners:{values:["team-123-abc"]},searchQuery:{value:"service:api-gateway"},tags:{values:[{key:"paging",value:"true"}]},priorities:{values:[4,5],exclude:!0},types:{values:["threshold"]},activity:"active",clusterIds:{values:["cluster-123-abc"]}},sort:{by:"name",direction:"asc"},limit:10,offset:0};Object.assign(XP,{examples:[_z]});var JP=m({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:`${ys}/query`,method:"POST",paginated:!0,body:XP,response:t.Array(hs)}),eU=m({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:`${ys}/:id`,method:"GET",params:t.Object({id:p({allowEmpty:!1,description:"Monitor ID returned by monitor query, create, or update operations."})}),response:hs}),tU=["name","message","tags","configuration","priority","owner","dashboardId","permissions","clusterIds"],rU=t.Pick(wa,tU,{$id:"CreateMonitorRequest",description:"Monitor creation request. Provide ownership, data access, alert configuration, priority, tags, and optional dashboard or cluster scope."}),nU=t.Pick(wa,tU,{$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."}),oU=VP,iU=QP,aU=WP,sU=ZP;Object.assign(rU,{examples:[oU,iU,aU,sU]});Object.assign(nU,{examples:[oU,iU,aU,sU]});var cU=m({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:ys,method:"POST",body:rU,response:hs}),pU=m({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:`${ys}/: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:nU,response:hs}),Iz=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."})}),uU=m({description:"Deletes a monitor by ID. Deleting a monitor stops future evaluations and alert transitions for that monitor.",operationId:"deleteMonitor",tags:["monitors"],url:`${ys}/:id`,method:"DELETE",params:Iz,response:R});var Ts=`/${"v1"}/notification-rules`,Es=t.Pick(ei,["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)."}),lU={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"]}}]},bz={id:"123-456-abc",...lU};Object.assign(Es,{examples:[bz]});var mU=m({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:Ts,method:"GET",paginated:!0,query:t.Object(ze),response:t.Array(Es)}),dU=m({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:`${Ts}/: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:Es}),Jd=t.Pick(va,["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."}),Sz=lU;Object.assign(Jd,{examples:[Sz]});var fU=m({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:Ts,method:"POST",body:Jd,response:Es}),gU=m({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:`${Ts}/: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:Jd,response:Es}),Oz=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."})}),yU=m({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:`${Ts}/:id`,method:"DELETE",params:Oz,response:R});var Oi=`${Xo}/silences`,hU=t.Union([t.Literal("monday"),t.Literal("tuesday"),t.Literal("wednesday"),t.Literal("thursday"),t.Literal("friday"),t.Literal("saturday"),t.Literal("sunday")]),Az=t.Partial(t.Record(hU,t.Array(t.Object({startTime:t.String({format:Vu,description:"Local start time for this recurring silence window on this day, using the schedule time zone."}),endTime:t.String({format:Vu,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`."}),xz=t.Partial(t.Record(hU,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`."}),Lp='IANA timezone identifier (e.g. "America/New_York"). Defaults to UTC if omitted.',TU="One-time silence schedule with specific start and end times",EU="Recurring weekly silence schedule",Rz=b("type",[t.Object({type:t.Literal("one-time",{description:"Silence active once between the configured start and end times."}),startTime:t.String({format:Qu,description:"Local start date and time for the one-time silence, interpreted in `timeZone` when provided."}),endTime:t.String({format:Qu,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:Yu,description:Lp}))},{$id:"InputSilenceScheduleOneTime",description:TU}),t.Object({type:t.Literal("recurring",{description:"Silence active on a recurring weekly schedule."}),weeklySchedule:Az,timeZone:t.Optional(t.String({format:Yu,description:Lp}))},{$id:"InputSilenceScheduleRecurring",description:EU})],{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."}),Cz=b("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:Lp}))},{$id:"OutputSilenceScheduleOneTime",description:TU}),t.Object({type:t.Literal("recurring",{description:"Silence active on a recurring weekly schedule."}),weeklySchedule:xz,timeZone:t.Optional(t.String({description:Lp}))},{$id:"OutputSilenceScheduleRecurring",description:EU})],{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."}),vp=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:Rz,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:Fl,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(Hn),{maxItems:Hn.length,description:"Alert state transitions that must match for this silence to apply. An empty array matches every transition type."})}),Ai=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:Me,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:Cz,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:Bl,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(Hn),{description:"Alert state transitions that must match for this silence to apply. An empty array matches every transition type."}),createdAt:E(),updatedAt:E(),creator:t.Optional(ue),updater:t.Optional(ue)}),k5e=m({tags:["notification-silences"],url:Oi,method:"GET",response:t.Array(Ai)}),M5e=m({tags:["notification-silences"],url:`${Oi}/:id`,params:t.Object({id:p()}),method:"GET",response:Ai}),D5e=m({tags:["notification-silences"],url:Oi,method:"POST",body:vp,response:Ai}),G5e=m({tags:["notification-silences"],url:`${Oi}/:id`,method:"PUT",params:t.Object({id:p()}),body:vp,response:Ai}),$5e=m({tags:["notification-silences"],url:`${Oi}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),j5e=m({tags:["notification-silences"],url:`${Oi}/bulk-delete`,method:"DELETE",body:t.Object({ids:t.Array(p())}),response:t.Object({})});var _s=`/${"v1"}/notification-silences`,Is=t.Pick(Ai,["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)."}),Pz={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"]},Uz={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(Is,{examples:[Pz,Uz]});var _U=m({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:_s,method:"GET",response:t.Array(Is)}),IU=m({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:`${_s}/: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:Is}),ef=t.Pick(vp,["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."}),wz={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(ef,{examples:[wz,Nz]});var bU=m({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:_s,method:"POST",body:ef,response:Is}),SU=m({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:`${_s}/: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:ef,response:Is}),Lz=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."})}),OU=m({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:`${_s}/:id`,method:"DELETE",params:Lz,response:R});var vz={critical:3,important:2,normal:1},oe=e=>({label:e,weight:vz[e]}),kz={"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:`${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:oe("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: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:`${Ua} presence`,summary:`Logs and spans must populate ${Ua} with a non-empty value.`,rationale:"Core identifier used to correlate telemetry across services.",objectType:"resource",category:"telemetry-hygiene",impact:oe("important"),recommendation:`Populate ${Ua} 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 ${ZS} 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"}},Mz=new Set(["azure_container_registry","azure_container_registry_image","azure_app_service_certificate","azure_virtual_network"]),Dz=ss.filter(e=>e.startsWith("azure_")&&!Mz.has(e)),AU={"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:Dz,metricPrefixes:["azure_"]}},Gz=Object.fromEntries(Object.keys(AU).map(e=>{let{label:r,source:n}=AU[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"}]})),$z={...kz,...Gz},xU=Object.values($z);var RU=["passed","failed","ignored"],jz=t.Enum(RU,{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."}),qz=["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"],rf=["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",...qz],Bz=t.Enum(rf),Fz=["log","metric","resource","span","api-key","dashboard","monitor","route"],Hz=["collection-coverage","telemetry-hygiene","observability-assets","telemetry-adoption"],Kz=["critical","important","normal"],zz=["team","global"],nf=t.Object({key:t.Enum(rf),title:t.String(),summary:t.String(),rationale:t.String(),objectType:t.Enum(Fz),category:t.Enum(Hz),impact:t.Object({label:t.Enum(Kz),weight:t.Number()}),recommendation:t.String(),scope:t.Optional(t.Enum(zz))}),CU=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"})}),tf=t.Intersect([nf,t.Object({status:jz,normalizedScore:t.Number(),details:t.Optional(t.Record(t.String(),t.Unknown())),recommendation:t.Optional(t.String()),examples:t.Optional(t.Array(CU))})]),Yz=t.Object({generatedAt:t.String(),overallScore:t.Optional(t.Number()),rules:t.Array(nf),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(tf)})),globalResults:t.Optional(t.Object({score:t.Optional(t.Number()),ruleResults:t.Array(tf)}))}),of=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(rf,{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(RU,{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(CU,{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"})}),r6e=m({tags:["quality-reports"],url:"/v0/quality-reports",method:"POST",response:Yz}),af=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."})),n6e=m({tags:["quality-reports"],url:"/v0/quality-reports/latest",method:"GET",query:t.Object({clusterId:af,team:t.Optional(p({allowEmpty:!1}))}),response:t.Array(of,{description:"Latest persisted rule evaluation rows for the cluster"})}),o6e=m({tags:["quality-reports"],url:"/v0/quality-reports/preview",method:"POST",body:t.Object({ruleKey:Bz,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:nf,result:tf,teamId:t.Optional(t.String()),teamName:t.Optional(t.String())})}),i6e=new Map(xU.map(e=>[e.key,e]));var Vz=`/${"v1"}/quality-reports`,PU=t.Pick(of,["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)."}),Qz={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(PU,{examples:[Qz]});var Wz=t.Object({clusterId:af,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."}),UU=m({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:`${Vz}/latest`,method:"GET",query:Wz,response:t.Array(PU)});var bs="/v0/admin-center";var dr=`${bs}/retention-policies`,wU=3650,Zz=t.Integer({description:"Number of days Tsuga retains matching telemetry."}),NU=t.Integer({minimum:1,maximum:wU,description:`Number of days Tsuga should retain matching telemetry. Valid values are 1 through ${wU}.`}),kr=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(pr,{description:"Telemetry signal retained by this policy: logs, metrics, traces or rum."}),durationDays:Zz,isEnabled:t.Boolean({description:"Whether this policy participates in retention resolution."}),createdAt:E({description:"Timestamp when Tsuga created the retention policy."}),updatedAt:E({description:"Timestamp when Tsuga last updated the retention policy."})}),kp=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(pr,{description:"Telemetry signal retained by this policy: logs, metrics, traces or rum."}),durationDays:NU,isEnabled:t.Boolean({description:"Set to true for the policy to participate in retention resolution."})}),LU=t.Array(t.Object({env:p(),dataSource:t.Enum(pr),durationDays:t.Union([NU,t.Null()]),isEnabled:t.Boolean()})),vU=t.Object({inserted:t.Array(kr),updated:t.Array(kr),deleted:t.Array(kr)}),_6e=m({tags:["retention-policies"],url:dr,method:"POST",body:kp,response:kr}),I6e=m({tags:["retention-policies"],url:dr,method:"GET",response:t.Array(kr)}),b6e=m({tags:["retention-policies"],url:`${dr}/:id`,method:"GET",params:t.Object({id:p()}),response:kr}),S6e=m({tags:["retention-policies"],url:`${dr}/:id`,method:"PUT",params:t.Object({id:p()}),body:kp,response:kr}),O6e=m({tags:["retention-policies"],url:`${dr}/bulk-update`,method:"POST",body:LU,response:vU}),A6e=m({tags:["retention-policies"],url:`${dr}/bulk-update-for-team`,method:"POST",body:t.Object({teamId:p(),policies:LU}),response:vU}),x6e=m({tags:["retention-policies"],url:`${dr}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),Ss=["past-24-hours","past-7-days","past-30-days"],R6e=m({tags:["retention-policies"],url:`${dr}/requested-history-percentile/:teamId`,method:"POST",params:t.Object({teamId:p()}),body:t.Object({percentile:t.Number({minimum:0,maximum:1}),observationWindow:t.Enum(Ss),dataSource:t.Enum(pr)}),response:t.Object({percentile:t.Number(),observationWindow:t.Enum(Ss),dataSource:t.Enum(pr),teamId:t.String(),requestedHistoryDays:t.Number()})}),Xz=["1-day","3-days","7-days","1-month","6-months","more-than-6-months"];var Jz=t.Array(t.Object({bucket:t.Enum(Xz),count:t.Number()})),C6e=m({tags:["retention-policies"],url:`${dr}/requested-history-histogram/:teamId`,method:"POST",params:t.Object({teamId:p()}),body:t.Object({observationWindow:t.Enum(Ss),dataSource:t.Enum(pr)}),response:t.Object({observationWindow:t.Enum(Ss),dataSource:t.Enum(pr),teamId:t.String(),histogram:Jz})}),P6e=m({tags:["retention-policies"],url:`${dr}/top-teams-with-retention-surplus`,method:"POST",body:t.Object({dataSource:t.Enum(pr),observationWindow:t.Enum(Ss),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 Os=`/${"v1"}/retention-policies`,As=t.Pick(kr,["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)."}),e3={id:"123-456-abc",env:"production",teamId:"team-123-abc",dataSource:"logs",durationDays:30,isEnabled:!0};Object.assign(As,{examples:[e3]});var kU=m({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:Os,method:"GET",response:t.Array(As)}),MU=m({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:`${Os}/: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:As}),sf=t.Pick(kp,["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."}),t3={env:"production",teamId:"team-123-abc",dataSource:"logs",durationDays:30,isEnabled:!0};Object.assign(sf,{examples:[t3]});var DU=m({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:Os,method:"POST",body:sf,response:As}),GU=m({description:"Replaces an existing retention policy by ID, including signal, scope fields, duration, and enabled state.",operationId:"updateRetentionPolicy",tags:["retention-policies"],url:`${Os}/: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:sf,response:As}),$U=m({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:`${Os}/: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 xs=`/${"v1"}/slos`,r3=t.Pick(Gl,["id","sloId","priority","configuration"],{$id:"SloAlert",description:"Alert attached to an SLO, triggered on a burn-rate multiplier or an SLO target threshold"}),Rs=t.Object({...t.Pick(Zo,["id","name","description","tags","configuration","target","timeframeDays","owner","permissions","clusterIds"]).properties,alerts:t.Array(r3,{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"}),n3={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(Rs,{examples:[n3]});var jU=t.Pick(jl,["filters","sort","limit","offset"]),qU=t.Object({...jU.properties,...ze,filters:jU.properties.filters},{description:"SLO query request. Use filters, sorting, limit, and offset to page through visible SLOs."}),o3={filters:{owners:{values:["team-123-abc"]},searchQuery:{value:"availability"},tags:{values:[{key:"team",value:"platform"}]},statuses:{values:["breached"]},clusterIds:{values:["cluster-123-abc"]}},sort:{by:"name",direction:"asc"},limit:10,offset:0};Object.assign(qU,{examples:[o3]});var BU=m({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:`${xs}/query`,method:"POST",paginated:!0,body:qU,response:t.Array(Rs)}),FU=m({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:`${xs}/:id`,method:"GET",params:t.Object({id:p({allowEmpty:!1,description:"SLO ID returned by SLO query, create, or update operations."})}),response:Rs}),HU=["name","description","tags","configuration","target","timeframeDays","owner","permissions","clusterIds","alerts"],KU=t.Pick(sp,HU,{$id:"CreateSloRequest",description:"SLO creation request. Provide ownership, data access, SLI configuration, target, timeframe, optional cluster scope, and the alerts to create."}),zU=t.Pick($l,HU,{$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."}),YU={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(KU,{examples:[YU]});Object.assign(zU,{examples:[YU]});var VU=m({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:xs,method:"POST",body:KU,response:Rs}),QU=m({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:`${xs}/: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:zU,response:Rs}),WU=m({description:"Deletes an SLO by ID. Deleting an SLO stops future evaluations and removes its attached alerts.",operationId:"deleteSlo",tags:["slos"],url:`${xs}/: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 co=`${bs}/tag-policies`;var i3=["logs","metrics","traces"],cf=t.Array(t.Enum(i3,{description:"Telemetry signal covered by a data tag policy."}),{description:"Telemetry signals covered by the policy. An empty array means logs, metrics, and traces."}),a3=t.Union([$c,cf]),s3=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."}),c3=b("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:$c},{title:"TsugaAssetTagPolicy"})]),p3=b("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:$c},{title:"TsugaAssetTagPolicy"})]),ZU="Policy surface and enforcement behavior. Use `telemetry` for telemetry data or `tsuga_asset` for Tsuga-managed resources.",u3=t.Unsafe({...c3,description:ZU}),l3=t.Unsafe({...p3,description:ZU}),xi=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(s3),configuration:u3,creator:t.Optional(ue),updater:t.Optional(ue),owner:t.Optional(t.String({description:"Team ID that owns and manages the policy."})),createdAt:E({description:"Timestamp when Tsuga created the tag policy."}),updatedAt:E({description:"Timestamp when Tsuga last updated the tag policy."}),assetUpdatedAt:E({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})});var Cs=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:l3,owner:p({allowEmpty:!1,description:"Team ID that will own and manage the policy."})}),X6e=m({tags:["tag-policies"],url:co,method:"GET",query:t.Object({teamIds:t.Optional(t.Array(p(),{maxItems:100})),assetTypes:t.Optional(a3),searchQuery:t.Optional(p())}),response:t.Array(xi)}),J6e=m({tags:["tag-policies"],url:`${co}/:id`,method:"GET",params:t.Object({id:p()}),response:xi}),e8e=m({tags:["tag-policies"],url:co,method:"POST",body:Cs,response:xi}),t8e=m({tags:["tag-policies"],url:`${co}/:id`,method:"PUT",params:t.Object({id:p()}),body:Cs,response:xi}),r8e=m({tags:["tag-policies"],url:`${co}/:id`,method:"DELETE",params:t.Object({id:p()}),response:R}),n8e=m({tags:["tag-policies"],url:`${bs}/applicable-tag-rules`,method:"GET",query:t.Object({assetType:t.Enum(Ea),teamId:p()}),response:t.Array(t.Object({tagKey:t.String(),allowedTagValues:t.Array(t.String()),isRequired:t.Boolean(),tagPolicyId:t.String()}))}),XU=t.Object({total:t.Number(),totalNonCompliant:t.Number(),idsNonCompliant:t.Array(t.String())}),JU=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")]),m3=t.Object({total:t.Number(),totalNonCompliant:t.Number(),byAssetType:t.Record(JU,XU)}),d3=t.Omit(XU,["total"]),f3=t.Object({totalNonCompliant:t.Number(),byAssetType:t.Record(JU,d3)}),ew=t.Object({totals:m3,byTeam:t.Record(t.String(),f3)}),o8e=m({tags:["tag-policies"],url:`${co}/:id/stats`,method:"GET",params:t.Object({id:p()}),response:ew}),i8e=m({tags:["tag-policies"],url:`${co}/new-policy-stats`,method:"POST",body:Cs,response:ew});var Ps=`/${"v1"}/tag-policies`,tw={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"},rw={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"},g3={id:"123-456-abc",...tw},y3={id:"456-789-def",...rw},Us=t.Pick(xi,["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)."}),h3=g3,T3=y3;Object.assign(Us,{examples:[h3,T3]});var pf=t.Pick(Cs,["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."}),E3=tw,_3=rw;Object.assign(pf,{examples:[E3,_3]});var nw=m({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:Ps,method:"GET",response:t.Array(Us)}),ow=m({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:`${Ps}/: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:Us}),iw=m({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:Ps,method:"POST",body:pf,response:Us}),aw=m({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:`${Ps}/: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:Us}),sw=m({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:`${Ps}/: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 ws=`/${"v1"}/teams`,Ns=t.Pick(Vo,["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)."}),I3={id:"team-123-abc",name:"platform-engineering",visibility:"public",tags:[{key:"department",value:"engineering"}]};Object.assign(Ns,{examples:[I3]});var cw=m({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:ws,method:"GET",paginated:!0,query:t.Object(ze),response:t.Array(Ns)}),pw=m({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:`${ws}/: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:Ns}),uf=t.Pick(np,["name","description","visibility","tags"],{description:"Team create or update request. Provide the team name, optional description, visibility, and tags."}),b3={name:"platform-engineering",visibility:"public",tags:[{key:"department",value:"engineering"}]};Object.assign(uf,{examples:[b3]});var uw=m({description:"Creates a team for ownership and access control. Use this before assigning resources to a new owner team.",operationId:"createTeam",tags:["teams"],url:ws,method:"POST",body:uf,response:Ns}),lw=m({description:"Replaces a team definition by ID, including name, description, visibility, and tags.",operationId:"updateTeam",tags:["teams"],url:`${ws}/: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:Ns}),mw=m({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:`${ws}/: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 S3(e){return/^[aeiou]/i.test(e)||e==="SLO"?"an":"a"}function dw(e,r){let n=Number(r);if(Number.isNaN(n))throw new Error(`--${e} must be a number (got: ${r})`);return n}function fw(e){let r={};return e.limit!==void 0&&(r.limit=dw("limit",e.limit)),e.offset!==void 0&&(r.offset=dw("offset",e.offset)),r}function lf(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 gw(e,r,n){let o=e.command(r.commandName).description(r.description),i=r.singularOverride??JS(r.commandName).replace(/-/g," "),a=r.pluralOverride??r.commandName.replace(/-/g," "),c=S3(i),l=o.command("list").description(r.listDescription??`List all ${a}`);if(r.listOptions)for(let d of r.listOptions)l.option(d.flag,d.description);if(r.endpoints.list.paginated===!0&&l.option("--limit <n>",`Maximum number of items to return, up to ${qo} (default: ${Gc})`).option("--offset <n>","Number of items to skip, to request a later page"),r.enableListBody?l.option("-d, --data <JSON>","Inline JSON body").option("--generate-skeleton","Print a JSON skeleton for the request body and exit").action(async d=>{if(d.generateSkeleton){Q(pi(r.endpoints.list));return}let f=d.data?ti({data:d.data}):{},g=await n()(r.endpoints.list,{body:{...f,...fw(d)}});Q(g)}):l.action(async d=>{let f=fw(d);if(r.listOptions)for(let T of r.listOptions){let _=d[T.queryParam];_!==void 0&&(f[T.queryParam]=_)}let g=await n()(r.endpoints.list,Object.keys(f).length>0?{query:f}:void 0);Q(g)}),r.endpoints.get){let d=r.endpoints.get,f=lf(d);o.command("get <ID>").description(`Get ${c} ${i} by ID`).action(async g=>{let T=await n()(d,{params:{[f]:g}});Q(T)})}if(r.endpoints.create){let d=r.endpoints.create;o.command("create").description(`Create a new ${i}`).option("-f, --file <FILE_PATH>","Read body from file (use - for stdin)").option("-d, --data <JSON>","Inline JSON body").option("--generate-skeleton","Print a JSON skeleton for the request body and exit").action(async f=>{if(f.generateSkeleton){Q(pi(d));return}let g=ti(f),T=await n()(d,{body:g});Q(T)})}if(r.endpoints.update){let d=r.endpoints.update,f=lf(d);o.command("update <ID>").description(`Update ${c} ${i} by ID`).option("-f, --file <FILE_PATH>","Read body from file (use - for stdin)").option("-d, --data <JSON>","Inline JSON body").option("--generate-skeleton","Print a JSON skeleton for the request body and exit").action(async(g,T)=>{if(T.generateSkeleton){Q(pi(d));return}let _=ti(T),ae=await n()(d,{params:{[f]:g},body:_});Q(ae)})}if(r.endpoints.delete){let d=r.endpoints.delete,f=lf(d);o.command("delete <ID>").description(`Delete ${c} ${i} by ID`).action(async g=>{let T=await n()(d,{params:{[f]:g}});Q(T)})}}var O3=[{commandName:"cloud-resources",description:"List cloud resources discovered by inventory scans",endpoints:{list:SP},enableListBody:!0},{commandName:"dashboards",description:"Manage dashboards",endpoints:{list:tP,get:rP,create:nP,update:oP,delete:iP},enableListBody:!0},{commandName:"ingestion-api-keys",description:"Manage ingestion API keys",singularOverride:"ingestion API key",pluralOverride:"ingestion API keys",endpoints:{list:mP,create:dP,update:fP,delete:gP}},{commandName:"investigations",description:"Manage investigations (beta)",endpoints:{list:AP,get:xP,create:RP,update:CP,delete:PP}},{commandName:"monitors",description:"Manage monitors",endpoints:{list:JP,get:eU,create:cU,update:pU,delete:uU},enableListBody:!0},{commandName:"notification-rules",description:"Manage notification rules",endpoints:{list:mU,get:dU,create:fU,update:gU,delete:yU}},{commandName:"notification-silences",description:"Manage notification silences",endpoints:{list:_U,get:IU,create:bU,update:SU,delete:OU}},{commandName:"quality-reports",description:"Get the latest quality report rows for a cluster",listDescription:"Get the latest quality report rows for a cluster (pass --cluster <CLUSTER_ID> when the org has more than one cluster)",endpoints:{list:UU},listOptions:[{flag:"--team <TEAM_NAME>",description:"Only return rows for this team by name (omits cluster-wide global rows)",queryParam:"team"}]},{commandName:"retention-policies",description:"Manage retention policies",endpoints:{list:kU,get:MU,create:DU,update:GU,delete:$U}},{commandName:"log-routes",description:"Manage log routes",endpoints:{list:BP,get:FP,create:HP,update:KP,delete:zP}},{commandName:"services",description:"List and inspect services (read-only; services are inferred from telemetry)",endpoints:{list:qO,get:BO}},{commandName:"slos",description:"Manage SLOs",singularOverride:"SLO",pluralOverride:"SLOs",endpoints:{list:BU,get:FU,create:VU,update:QU,delete:WU},enableListBody:!0},{commandName:"tag-policies",description:"Manage tag policies",endpoints:{list:nw,get:ow,create:iw,update:aw,delete:sw}},{commandName:"teams",description:"Manage teams",endpoints:{list:cw,get:pw,create:uw,update:lw,delete:mw}}];function yw(e,r){for(let n of O3)gw(e,n,r)}var hw=require("node:child_process");var Mp="@tsuga/cli@latest";function A3(){B(`Updating ${Mp}`),B(` $ npm install -g ${Mp}`);try{(0,hw.execFileSync)("npm",["install","-g",Mp],{stdio:["ignore","inherit","inherit"]})}catch(e){let r=e.status??1;throw new Error(`npm install -g ${Mp} exited ${r}`,{cause:e})}B("Updated. Run `tsuga --version` to confirm the new version.")}function Tw(e){e.command("self-update").description("Update the Tsuga CLI to the latest version via npm").action(()=>{A3()})}var Tf=require("node:fs"),hf=require("node:os"),Ci=require("node:path");function x3(e,r){let n=e.slice(0,r).split(/\r\n|\n|\r/g);return[n.length,n.pop().length+1]}function R3(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 l=o[c-1];l&&(i+=c.toString().padEnd(a," "),i+=": ",i+=l,i+=`
140
140
  `,c===r&&(i+=" ".repeat(a+n+2),i+=`^
141
- `))}return i}var z=class extends Error{line;column;codeblock;constructor(r,n){let[o,i]=A3(n.toml,n.ptr),a=x3(n.toml,o,i);super(`Invalid TOML document: ${r}
141
+ `))}return i}var z=class extends Error{line;column;codeblock;constructor(r,n){let[o,i]=x3(n.toml,n.ptr),a=R3(n.toml,o,i);super(`Invalid TOML document: ${r}
142
142
 
143
- ${a}`,n),this.line=o,this.column=i,this.codeblock=a}};function R3(e,r){let n=0;for(;e[r-++n]==="\\";);return--n&&n%2}function Dp(e,r=0,n=e.length){let o=e.indexOf(`
143
+ ${a}`,n),this.line=o,this.column=i,this.codeblock=a}};function C3(e,r){let n=0;for(;e[r-++n]==="\\";);return--n&&n%2}function Dp(e,r=0,n=e.length){let o=e.indexOf(`
144
144
  `,r);return e[o-1]==="\r"&&o--,o<=n?o:-1}function Ri(e,r){for(let n=r;n<e.length;n++){let o=e[n];if(o===`
145
145
  `)return n;if(o==="\r"&&e[n+1]===`
146
146
  `)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 kt(e,r,n,o){let i;for(;;){for(;(i=e[r])===" "||i===" "||!n&&(i===`
147
147
  `||i==="\r"&&e[r+1]===`
148
148
  `);)r++;if(o||i!=="#")break;r=Ri(e,r)}return r}function Ew(e,r,n,o,i=!1){if(!o)return r=Dp(e,r),r<0?e.length:r;for(let a=r;a<e.length;a++){let c=e[a];if(c==="#")a=Dp(e,a);else{if(c===n)return a+1;if(c===o||i&&(c===`
149
149
  `||c==="\r"&&e[a+1]===`
150
- `))return a}}throw new z("cannot find end of structure",{toml:e,ptr:r})}function Gp(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!=="'"&&R3(e,r));return r>-1&&(r+=o.length,o.length>1&&(e[r]===n&&r++,e[r]===n&&r++)),r}var C3=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i,Ls=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(C3);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 P3=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,U3=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,w3=/^[+-]?0[0-9_]/,N3=/^[0-9a-f]{2,8}$/i,_w={b:"\b",t:" ",n:`
150
+ `))return a}}throw new z("cannot find end of structure",{toml:e,ptr:r})}function Gp(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!=="'"&&C3(e,r));return r>-1&&(r+=o.length,o.length>1&&(e[r]===n&&r++,e[r]===n&&r++)),r}var P3=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i,Ls=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(P3);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 U3=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,w3=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,N3=/^[+-]?0[0-9_]/,L3=/^[0-9a-f]{2,8}$/i,_w={b:"\b",t:" ",n:`
151
151
  `,f:"\f",r:"\r",e:"\x1B",'"':'"',"\\":"\\"};function $p(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]===`
152
152
  `&&r++);let a=0,c,l="",d=r;for(;r<n-1;){let f=e[r++];if(f===`
153
153
  `||f==="\r"&&e[r]===`
154
- `){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 g=e.slice(r,r+=f==="x"?2:f==="u"?4:8);if(!N3.test(g))throw new z("invalid unicode escape",{toml:e,ptr:a});try{l+=String.fromCodePoint(parseInt(g,16))}catch{throw new z("invalid unicode escape",{toml:e,ptr:a})}}else if(i&&(f===`
154
+ `){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 g=e.slice(r,r+=f==="x"?2:f==="u"?4:8);if(!L3.test(g))throw new z("invalid unicode escape",{toml:e,ptr:a});try{l+=String.fromCodePoint(parseInt(g,16))}catch{throw new z("invalid unicode escape",{toml:e,ptr:a})}}else if(i&&(f===`
155
155
  `||f===" "||f===" "||f==="\r")){if(r=kt(e,r-1,!0),e[r]!==`
156
- `&&e[r]!=="\r")throw new z("invalid escape: only line-ending whitespace may be escaped",{toml:e,ptr:a});r=kt(e,r)}else if(f in _w)l+=_w[f];else throw new z("unrecognized escape sequence",{toml:e,ptr:a});d=r}else!o&&f==="\\"&&(a=r-1,c=!0,l+=e.slice(d,a))}return l+e.slice(d,n-1)}function Iw(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=P3.test(e);if(i||U3.test(e)){if(w3.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 Ls(e);if(!a.isValid())throw new z("invalid value",{toml:r,ptr:n});return a}function L3(e,r,n){let o=e.slice(r,n),i=o.indexOf("#");return i>-1&&(Ri(e,i),o=o.slice(0,i)),[o.trimEnd(),i]}function vs(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==="["?Sw(e,r,o,i):bw(e,r,o,i);if(n){if(f=kt(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=Gp(e,r);let d=$p(e,r,c);if(n){if(c=kt(e,c),e[c]&&e[c]!==","&&e[c]!==n&&e[c]!==`
157
- `&&e[c]!=="\r")throw new z("unexpected character encountered",{toml:e,ptr:c});c+=+(e[c]===",")}return[d,c]}c=Ew(e,r,",",n);let l=L3(e,r,c-+(e[c-1]===","));if(!l[0])throw new z("incomplete key-value declaration: no value specified",{toml:e,ptr:r});return n&&l[1]>-1&&(c=kt(e,r+l[1]),c+=+(e[c]===",")),[Iw(l[0],e,r,i),c]}var v3=/^[a-zA-Z0-9-_]+[ \t]*$/;function jp(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 l=Gp(e,r);if(l<0)throw new z("unfinished string encountered",{toml:e,ptr:r});o=e.indexOf(".",l);let d=e.slice(l,o<0||o>a?a:o),f=Dp(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:l});if(a<l&&(a=e.indexOf(n,l),a<0))throw new z("incomplete key-value: cannot find end of key",{toml:e,ptr:r});i.push($p(e,r,l))}else{o=e.indexOf(".",r);let l=e.slice(r,o<0||o>a?a:o);if(!v3.test(l))throw new z("only letter, numbers, dashes and underscores are allowed in keys",{toml:e,ptr:r});i.push(l.trimEnd())}}while(o+1&&o<a);return[i,kt(e,a+1,!0,!0)]}function bw(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=Ri(e,r);else if(c!==" "&&c!==" "&&c!==`
156
+ `&&e[r]!=="\r")throw new z("invalid escape: only line-ending whitespace may be escaped",{toml:e,ptr:a});r=kt(e,r)}else if(f in _w)l+=_w[f];else throw new z("unrecognized escape sequence",{toml:e,ptr:a});d=r}else!o&&f==="\\"&&(a=r-1,c=!0,l+=e.slice(d,a))}return l+e.slice(d,n-1)}function Iw(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=U3.test(e);if(i||w3.test(e)){if(N3.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 Ls(e);if(!a.isValid())throw new z("invalid value",{toml:r,ptr:n});return a}function v3(e,r,n){let o=e.slice(r,n),i=o.indexOf("#");return i>-1&&(Ri(e,i),o=o.slice(0,i)),[o.trimEnd(),i]}function vs(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==="["?Sw(e,r,o,i):bw(e,r,o,i);if(n){if(f=kt(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=Gp(e,r);let d=$p(e,r,c);if(n){if(c=kt(e,c),e[c]&&e[c]!==","&&e[c]!==n&&e[c]!==`
157
+ `&&e[c]!=="\r")throw new z("unexpected character encountered",{toml:e,ptr:c});c+=+(e[c]===",")}return[d,c]}c=Ew(e,r,",",n);let l=v3(e,r,c-+(e[c-1]===","));if(!l[0])throw new z("incomplete key-value declaration: no value specified",{toml:e,ptr:r});return n&&l[1]>-1&&(c=kt(e,r+l[1]),c+=+(e[c]===",")),[Iw(l[0],e,r,i),c]}var k3=/^[a-zA-Z0-9-_]+[ \t]*$/;function jp(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 l=Gp(e,r);if(l<0)throw new z("unfinished string encountered",{toml:e,ptr:r});o=e.indexOf(".",l);let d=e.slice(l,o<0||o>a?a:o),f=Dp(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:l});if(a<l&&(a=e.indexOf(n,l),a<0))throw new z("incomplete key-value: cannot find end of key",{toml:e,ptr:r});i.push($p(e,r,l))}else{o=e.indexOf(".",r);let l=e.slice(r,o<0||o>a?a:o);if(!k3.test(l))throw new z("only letter, numbers, dashes and underscores are allowed in keys",{toml:e,ptr:r});i.push(l.trimEnd())}}while(o+1&&o<a);return[i,kt(e,a+1,!0,!0)]}function bw(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=Ri(e,r);else if(c!==" "&&c!==" "&&c!==`
158
158
  `&&c!=="\r"){let l,d=i,f=!1,[g,T]=jp(e,r-1);for(let fe=0;fe<g.length;fe++){if(fe&&(d=f?d[l]:d[l]={}),l=g[fe],(f=Object.hasOwn(d,l))&&(typeof d[l]!="object"||a.has(d[l])))throw new z("trying to redefine an already defined value",{toml:e,ptr:r});!f&&l==="__proto__"&&Object.defineProperty(d,l,{enumerable:!0,configurable:!0,writable:!0})}if(f)throw new z("trying to redefine an already defined value",{toml:e,ptr:r});let[_,ae]=vs(e,T,"}",n-1,o);a.add(_),d[l]=_,r=ae}}if(!c)throw new z("unfinished table encountered",{toml:e,ptr:r});return[i,r]}function Sw(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=Ri(e,r);else if(a!==" "&&a!==" "&&a!==`
159
159
  `&&a!=="\r"){let c=vs(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 Ow(e,r,n,o){let i=r,a=n,c,l=!1,d;for(let f=0;f<e.length;f++){if(f){if(i=l?i[c]:i[c]={},a=(d=a[c]).c,o===0&&(d.t===1||d.t===2))return null;if(d.t===2){let g=i.length-1;i=i[g],a=a[g].c}}if(c=e[f],(l=Object.hasOwn(i,c))&&a[c]?.t===0&&a[c]?.d)return null;l||(c==="__proto__"&&(Object.defineProperty(i,c,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(a,c,{enumerable:!0,configurable:!0,writable:!0})),a[c]={t:f<e.length-1&&o===2?3:o,d:!1,i:0,c:{}})}if(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=l?i[c]:i[c]={};else if(o===0&&l)return null;return[c,i,d.c]}function mf(e,{maxDepth:r=1e3,integersAsBigInt:n}={}){let o={},i={},a=o,c=i;for(let l=kt(e,0);l<e.length;){if(e[l]==="["){let d=e[++l]==="[",f=jp(e,l+=+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 g=Ow(f[0],o,i,d?2:1);if(!g)throw new z("trying to redefine an already defined table or value",{toml:e,ptr:l});c=g[2],a=g[1],l=f[1]}else{let d=jp(e,l),f=Ow(d[0],a,c,0);if(!f)throw new z("trying to redefine an already defined table or value",{toml:e,ptr:l});let g=vs(e,d[1],void 0,r,n);f[1][f[0]]=g[0],l=g[1]}if(l=kt(e,l,!0),e[l]&&e[l]!==`
160
- `&&e[l]!=="\r")throw new z("each key-value declaration must be followed by an end-of-line",{toml:e,ptr:l});l=kt(e,l)}return o}var Aw=/^[a-z0-9-_]+$/i;function ks(e){let r=typeof e;if(r==="object"){if(Array.isArray(e))return"array";if(e instanceof Date)return"date"}return r}function k3(e){for(let r=0;r<e.length;r++)if(ks(e[r])!=="object")return!1;return e.length!=0}function df(e){return JSON.stringify(e).replace(/\x7f/g,"\\u007f")}function ff(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 df(e);if(r==="date"){if(isNaN(e.getTime()))throw new TypeError("cannot serialize invalid date");return e.toISOString()}if(r==="object")return M3(e,n,o);if(r==="array")return D3(e,n,o)}function M3(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+=Aw.test(c)?c:df(c),i+=" = ",i+=ff(e[c],ks(e[c]),r-1,n)}return i+" }"}function D3(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+=ff(e[i],ks(e[i]),r-1,n)}return o+" ]"}function G3(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&&`
160
+ `&&e[l]!=="\r")throw new z("each key-value declaration must be followed by an end-of-line",{toml:e,ptr:l});l=kt(e,l)}return o}var Aw=/^[a-z0-9-_]+$/i;function ks(e){let r=typeof e;if(r==="object"){if(Array.isArray(e))return"array";if(e instanceof Date)return"date"}return r}function M3(e){for(let r=0;r<e.length;r++)if(ks(e[r])!=="object")return!1;return e.length!=0}function df(e){return JSON.stringify(e).replace(/\x7f/g,"\\u007f")}function ff(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 df(e);if(r==="date"){if(isNaN(e.getTime()))throw new TypeError("cannot serialize invalid date");return e.toISOString()}if(r==="object")return D3(e,n,o);if(r==="array")return G3(e,n,o)}function D3(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+=Aw.test(c)?c:df(c),i+=" = ",i+=ff(e[c],ks(e[c]),r-1,n)}return i+" }"}function G3(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+=ff(e[i],ks(e[i]),r-1,n)}return o+" ]"}function $3(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&&`
161
161
  `}[[${r}]]
162
- `,i+=gf(0,e[a],r,n,o);return i}function gf(e,r,n,o,i){if(o===0)throw new Error("Could not stringify the object: maximum object depth exceeded");let a="",c="",l=Object.keys(r);for(let d=0;d<l.length;d++){let f=l[d];if(r[f]!==null&&r[f]!==void 0){let g=ks(r[f]);if(g==="symbol"||g==="function")throw new TypeError(`cannot serialize values of type '${g}'`);let T=Aw.test(f)?f:df(f);if(g==="array"&&k3(r[f]))c+=(c&&`
163
- `)+G3(r[f],n?`${n}.${T}`:T,o-1,i);else if(g==="object"){let _=n?`${n}.${T}`:T;c+=(c&&`
162
+ `,i+=gf(0,e[a],r,n,o);return i}function gf(e,r,n,o,i){if(o===0)throw new Error("Could not stringify the object: maximum object depth exceeded");let a="",c="",l=Object.keys(r);for(let d=0;d<l.length;d++){let f=l[d];if(r[f]!==null&&r[f]!==void 0){let g=ks(r[f]);if(g==="symbol"||g==="function")throw new TypeError(`cannot serialize values of type '${g}'`);let T=Aw.test(f)?f:df(f);if(g==="array"&&M3(r[f]))c+=(c&&`
163
+ `)+$3(r[f],n?`${n}.${T}`:T,o-1,i);else if(g==="object"){let _=n?`${n}.${T}`:T;c+=(c&&`
164
164
  `)+gf(_,r[f],_,o-1,i)}else a+=T,a+=" = ",a+=ff(r[f],g,o,i),a+=`
165
165
  `}}return e&&(a||!c)&&(a=a?`[${e}]
166
166
  ${a}`:`[${e}]`),a&&c?`${a}
167
167
  ${c}`:a||c}function yf(e,{maxDepth:r=1e3,numbersAsFloat:n=!1}={}){if(ks(e)!=="object")throw new TypeError("stringify can only be called with an object");let o=gf(0,e,"",r,n);return o[o.length-1]!==`
168
168
  `?o+`
169
- `:o}var $3={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 j3(e,r,n,o){let i=(0,Ci.join)(e,".claude","settings.json");B(`Claude Code \u2192 ${i}`),(0,Tf.mkdirSync)((0,Ci.dirname)(i),{recursive:!0});let a=Wa(i),c;try{c=JSON.parse(a??"{}")}catch{throw new Error(`${i} is not valid JSON. Fix or remove it before re-running.`)}if(!io(c))throw new Error(`${i} must contain a JSON object at the top level.`);let l=c.env??{};if(!io(l))throw new Error(`${i} "env" must be a JSON object.`);let d=o?"1":"0";c.env={...l,...$3,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=Za(i,a);Qa(i,`${JSON.stringify(c,null,2)}
170
- `),B(f===void 0?" created":` patched (backup: ${f})`)}function q3(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 B3(e,r,n,o){let i=(0,Ci.join)(e,".codex"),a=(0,Ci.join)(i,"config.toml");B(`Codex \u2192 ${a}`),(0,Tf.mkdirSync)(i,{recursive:!0});let c=Wa(a),l=c===void 0?{}:mf(c),d="otel"in l;delete l.otel,l.otel=q3(r,n,o);let f=Za(a,c);Qa(a,yf(l)),B(f===void 0?" created":d?` replaced existing [otel] tables (backup: ${f})`:` appended (backup: ${f})`)}function xw(){return new fr("--endpoint <OTLP_ENDPOINT>","OTLP base URL").env("TSUGA_OTLP_ENDPOINT").makeOptionMandatory()}function Rw(){return new fr("--ingestion-api-key <INGESTION_API_KEY>","Tsuga ingestion API key").env("TSUGA_INGESTION_API_KEY").makeOptionMandatory()}var Cw="Restart your claude / codex session to load the new config.";function Pw(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(xw()).addOption(Rw()).option("--no-include-prompts","Strip user prompts + tool content from telemetry (default: include)").action(n=>{j3((0,hf.homedir)(),n.endpoint.replace(/\/+$/,""),n.ingestionApiKey,n.includePrompts),B(Cw)}),r.command("codex").description("Patch ~/.codex/config.toml with Tsuga OTEL settings (replaces any existing [otel] table)").addOption(xw()).addOption(Rw()).option("--no-include-prompts","Strip user prompts from telemetry (default: include)").action(n=>{B3((0,hf.homedir)(),n.endpoint.replace(/\/+$/,""),n.ingestionApiKey,n.includePrompts),B(Cw)})}var qp="/v0/logs";var Ef=["CRITICAL","ERROR","WARN","NOTICE","INFO","DEBUG","TRACE"];var Ms=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`)."}),[OS]:t.Optional(t.String({description:"ID of the cluster this log was read from. Only set when the request spanned several clusters."}))},{additionalProperties:!0}),Uw=100,F3="timestamp",H3=t.Union([t.Literal(F3)]),po=t.Partial(t.Object({...Ye.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:Ms,description:"Result offset used when fetching additional log rows."}),startOffsets:t.Array(t.Number({minimum:Ms}),{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 ${Ms} for every cluster.`}),clusterId:p({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}),clusterIds:Ra,sortBy:H3,sortDirection:t.Union([t.Literal("asc"),t.Literal("desc")],{description:"Timestamp sort direction for log results."})})),PQe=m({tags:["logs"],url:`${qp}/count`,method:"GET",query:t.Pick(po,["from","to","query","clusterId","clusterIds"]),response:t.Object({count:t.Number(),clusterResponses:t.Optional(Ko())})}),Ds=t.Object({value:t.String(),priority:t.Number()}),UQe=m({tags:["logs"],url:`${qp}/search`,method:"GET",query:po,response:t.Object({logs:t.Optional(t.Array(_f)),attributesToHighlight:t.Optional(t.Array(Ds)),clusterResponses:t.Optional(Ko(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})}),K3=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"}),z3=t.Object({id:t.String(),pattern:t.Array(K3),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"}))}),wQe=m({tags:["logs"],url:`${qp}/patterns`,method:"GET",query:t.Object({...Ye.properties,query:p({type:"tsuga-query"}),clusteringThreshold:t.Optional(t.Number()),clusterId:t.Optional(p({allowEmpty:!1}))}),response:t.Object({patterns:t.Array(z3),sampleSize:t.Number()})}),NQe=m({tags:["logs"],url:`${qp}/attributes`,method:"GET",query:t.Object({...Ye.properties,clusterId:t.Optional(p({allowEmpty:!1,description:"Cluster ID"})),clusterIds:t.Optional(Ra)}),response:t.Object({attributes:t.Array(t.String()),clusterResponses:t.Optional(Ko())})});var Gs=`/${"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."}),Y3={context:{team:"platform"},message:"Request completed successfully",timestamp:17040672e5,level:"INFO"};Object.assign(If,{examples:[Y3]});var ww=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:Uw,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."}),V3={query:"level:ERROR",maxResults:100,from:1704067200,to:1704070800};Object.assign(ww,{examples:[V3]});var Nw=m({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:`${Gs}/search`,method:"GET",query:ww,response:t.Object({logs:t.Array(If,{description:"Log events matching the query and time range."})})}),Q3=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`."}))}),Lw=t.Object({patterns:t.Array(Q3,{description:"Log patterns clustered from logs matching the query."}),sampleSize:t.Number({description:"Number of logs sampled while computing patterns."})},{}),W3={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(Lw,{examples:[W3]});var vw=m({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:`${Gs}/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:Lw}),Z3=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."})}),kw=t.Object({newErrorPatterns:t.Array(Z3,{description:"Error patterns first seen in the requested time range."})},{}),X3={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(kw,{examples:[X3]});var Mw=m({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:`${Gs}/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:kw}),J3=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."}))}),Dw=t.Object({errorPatternIncreases:t.Array(J3,{description:"Error patterns with increased occurrence in the requested time range."})},{}),e9={errorPatternIncreases:[{team:"platform",env:"production",pattern:"Non-resolved segment SegmentId(*) from cache",increaseTimestamps:[17041536e5,17042392e5]}]};Object.assign(Dw,{examples:[e9]});var Gw=m({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:`${Gs}/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:Dw}),$w=t.Object({attributes:t.Array(t.String(),{description:"Log attribute dot-paths observed in the time range"})},{}),t9={attributes:["context.env","context.k8s.pod.name","context.service.name","context.team","level","message","timestamp"]};Object.assign($w,{examples:[t9]});var r9=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."}),jw=m({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:`${Gs}/attributes`,method:"GET",query:r9,response:$w});var Mr="/v0/metrics",n9=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}),zQe=m({tags:["metrics"],url:`${Mr}/count`,method:"GET",query:t.Pick(po,["from","to","query","clusterId"]),response:t.Object({count:t.Number()})}),YQe=m({tags:["metrics"],url:`${Mr}/search`,method:"GET",query:po,response:t.Object({logs:t.Optional(t.Array(n9)),totalHits:t.Optional(t.Number()),attributesToHighlight:t.Optional(t.Array(Ds))},{additionalProperties:!0})}),Bp=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."}),o9=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(Bp),unit:t.Optional(t.String({description:"Metric unit reported by instrumentation or inferred metadata."}))}),VQe=m({url:`${Mr}/metadata`,method:"GET",query:t.Object({...Ye.properties,metricName:p({allowEmpty:!1}),clusterId:t.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:o9}),QQe=m({tags:["metrics"],url:Mr,method:"GET",query:t.Object({...Ye.properties,clusterId:t.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:t.Array(t.String())}),Fp=t.Array(t.Object({name:t.String({description:"Metric name observed by Tsuga."}),type:Bp}),{description:"Metrics observed in the requested time range, with the instrument type each was reported as."}),i9=[{name:"http.server.request.duration",type:"histogram"},{name:"http.server.active_requests",type:"gauge"},{name:"http.server.request.count",type:"counter"}];Object.assign(Fp,{examples:[i9]});var WQe=m({tags:["metrics"],url:`${Mr}/names-and-types`,method:"GET",query:t.Object({...Ye.properties,clusterId:t.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:Fp}),$s=t.Array(t.String(),{description:"Attribute names available as dimensions for filtering or grouping the requested metric(s)."}),a9=["service","env","host","method","status_code"];Object.assign($s,{examples:[a9]});var ZQe=m({tags:["metrics"],url:`${Mr}/attributes`,method:"GET",query:t.Object({...Ye.properties,metricName:p({allowEmpty:!1}),clusterId:t.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:$s}),XQe=m({tags:["metrics"],url:`${Mr}/attributes/batch`,method:"GET",query:t.Object({...Ye.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:$s}),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."})}),JQe=m({tags:["metrics"],url:`${Mr}/assets-usage`,method:"GET",query:t.Object({metricName:p({allowEmpty:!1})}),response:Sf}),eWe=m({url:`${Mr}/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`,s9=[{name:"http.server.request.duration",type:"histogram"},{name:"http.server.active_requests",type:"gauge"},{name:"http.server.request.count",type:"counter"}];Object.assign(Fp,{examples:[s9]});var Af=t.Object({name:t.String({description:"Metric name observed by Tsuga. Use this value in metric queries and aggregations."}),type:Bp,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."}))}),c9={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:[c9]});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."}),Bw=m({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:qw,response:t.Array(Af)}),Fw=m({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:qw,response:Af}),p9=["service","env","host","method","status_code"];Object.assign($s,{examples:[p9]});var Hw=t.Pick(Sf,["assets"]),u9={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(Hw,{examples:[u9]});var Kw=m({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:Hw});var Pi="/v0/traces",fWe=m({tags:["traces"],url:`${Pi}/count`,method:"GET",query:t.Pick(po,["from","to","query","clusterId"]),response:t.Object({count:t.Number()})}),l9=["unset","ok","error"],m9=t.Enum(l9),d9=["unspecified","internal","server","client","producer","consumer"],f9=t.Enum(d9),Yw=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:f9,name:t.String()}),status_code:t.Optional(m9),trace_id:t.String()}),Vw=100,g9="start_time",y9="duration_ns",h9=t.Union([t.Literal(g9),t.Literal(y9)]),T9={...Ye.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:Ms})),clusterId:t.Optional(p({allowEmpty:!1,description:"Cluster ID"})),sortBy:t.Optional(h9),sortDirection:t.Optional(t.Union([t.Literal("asc"),t.Literal("desc")]))},gWe=m({tags:["traces"],url:`${Pi}/search`,method:"GET",query:t.Object(T9),response:t.Object({spans:t.Optional(t.Array(Yw)),attributesToHighlight:t.Optional(t.Array(Ds))})});var E9=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."})}),_9=t.Object({...Ye.properties,traceId:p({allowEmpty:!1,description:"Trace ID to summarize"}),clusterId:t.Optional(p({allowEmpty:!1,description:"Cluster ID"})),...t.Partial(E9).properties}),yWe=m({tags:["traces"],url:`${Pi}/summarize`,method:"GET",query:_9,response:t.Object({spans:t.Array(Yw)})}),hWe=m({tags:["traces"],url:`${Pi}/attributes`,method:"GET",query:t.Object({...Ye.properties,clusterId:t.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:t.Object({attributes:t.Array(t.String())})}),I9=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."}))}),b9=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."})}),S9=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."})),Hp=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(I9,{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(b9,{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(S9,{description:"Aggregated wall-clock contribution per service across the fetched trace. Use this for service-level latency ownership without processing the per-range timeline."})}),O9={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(Hp,{examples:[O9]});var TWe=m({tags:["traces"],url:`${Pi}/latency-summary`,method:"GET",query:t.Object({...Ye.properties,traceId:p({allowEmpty:!1,description:"Trace ID to summarize"}),clusterId:t.Optional(p({allowEmpty:!1,description:"Cluster ID"})),minRangeDurationMs:xf,includeRanges:Rf}),response:Hp}),zw=t.Object({filter:p({type:"tsuga-query",description:"TQL filter defining the group"}),timeRange:zo}),A9=t.Object({attr:t.String(),value:t.String()}),x9=t.Object({value:t.String(),supportA:t.Number(),supportB:t.Number()}),R9=t.Object({predicate:A9,supportA:t.Number(),supportB:t.Number(),lift:t.Number(),pValue:t.Number(),attrValues:t.Array(x9)}),EWe=m({tags:["traces"],url:`${Pi}/contrast-sets`,method:"POST",body:t.Object({groupA:zw,groupB:zw,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(R9),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."}),C9={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:[C9]});var P9={from:1704067200,to:1704070800,query:"context.service.name:my-service",maxResults:100},Qw=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:Vw,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(Qw,{examples:[P9]});var Ww=m({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:Qw,response:t.Object({spans:t.Array(Pf,{description:"Spans matching the query and time range."})})}),U9={from:1704067200,to:1704070800,traceId:"78c99c5bb1e4a30297fa134b9dbec64f"},Zw=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(Zw,{examples:[U9]});var Xw=m({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:Zw,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`."})})}),w9={from:1704067200,to:1704070800,traceId:"78c99c5bb1e4a30297fa134b9dbec64f"},Jw=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:xf,includeRanges:Rf},{description:"Trace latency summary query. Provide a trace ID, a time range covering the trace, and optional timeline tuning."});Object.assign(Jw,{examples:[w9]});var eN=m({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:Jw,response:Hp});var nN=["timestamp","level","message"],oN=["count","ratio","team","level","pattern"];function it(e,r){let n=r??Er(e);if(!n)throw new Error(`--${e} is required`);return zs(n)}function tN(e){let r={from:it("from",e.from),to:it("to",e.to)},n=e.query??Er("query");n!==void 0&&(r.query=n);let o=e.maxResults??Er("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 Ie(e){let r=Er(e);return r===void 0?"":` (default: ${r})`}function N9(e){let r=ou(e.output),n=e.fields===void 0?void 0:iu(e.fields);return r==="json"?{format:r,fields:n}:{format:r,fields:n??nN}}function L9(e){let r=ou(e.output),n=e.fields===void 0?void 0:iu(e.fields);return r==="json"?{format:r,fields:n}:{format:r,fields:n??oN}}function rN(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 v9(e,r){if(r.format==="json"){if(r.fields===void 0){Q(e);return}let{fields:i}=r;Q({patterns:e.patterns.map(a=>rN(a,e.sampleSize)).map(a=>au(a,i)),sampleSize:e.sampleSize});return}let n=e.patterns.map(i=>rN(i,e.sampleSize)),o=su(r.format,n,r.fields);o.length>0&&B(o)}function k9(e,r){if(r.format==="json"){if(r.fields===void 0){Q(e);return}let{fields:o}=r;Q({logs:e.logs.map(i=>au(i,o))});return}let n=su(r.format,e.logs,r.fields);n.length>0&&B(n)}function iN(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${xe}${Ie("from")}`).option("--to <TIMESTAMP>",`End of time range${xe}${Ie("to")}`).option("--query <TSUGA_QUERY>",`Tsuga query to filter logs${Ie("query")}`).option("--max-results <COUNT>",`Maximum number of results, 1-1000${Ie("max-results")}`).option("--fields <FIELDS>",`Comma-separated dot-paths to project from each log (default for --output=tsv|csv: ${nN.join(",")})`).option("-o, --output <FORMAT>","Output format: json | tsv | csv","json").action(async c=>{let l=N9(c),d=await r()(Nw,{query:tN(c)});k9(d,l)}),n.command("attributes").description("List log attribute dot-paths observed in the time range").option("--from <TIMESTAMP>",`Start of time range${xe}${Ie("from")}`).option("--to <TIMESTAMP>",`End of time range${xe}${Ie("to")}`).action(async c=>{let l=await r()(jw,{query:{from:it("from",c.from),to:it("to",c.to)}});Q(l)}),n.command("patterns").description("List log patterns").option("--from <TIMESTAMP>",`Start of time range${xe}${Ie("from")}`).option("--to <TIMESTAMP>",`End of time range${xe}${Ie("to")}`).option("--query <TSUGA_QUERY>",`Tsuga query to filter logs before clustering into patterns${Ie("query")}`).option("--fields <FIELDS>",`Comma-separated dot-paths to project from each pattern (default for --output=tsv|csv: ${oN.join(",")})`).option("-o, --output <FORMAT>","Output format: json | tsv | csv","json").action(async c=>{let l=L9(c),d={from:it("from",c.from),to:it("to",c.to)},f=c.query??Er("query");f!==void 0&&(d.query=f);let g=await r()(vw,{query:d});v9(g,l)}),n.command("new-error-patterns").description("List error patterns first seen in this time range").option("--from <TIMESTAMP>",`Start of time range${xe}${Ie("from")}`).option("--to <TIMESTAMP>",`End of time range${xe}${Ie("to")}`).option("--team <TEAM_NAME>","Filter by team").option("--env <ENV_NAME>","Filter by environment").option("--service <SERVICE_NAME>","Filter by service").action(async c=>{let l={from:it("from",c.from),to:it("to",c.to)};c.team!==void 0&&(l.team=c.team),c.env!==void 0&&(l.env=c.env),c.service!==void 0&&(l.service=c.service);let d=await r()(Mw,{query:l});Q(d)}),n.command("error-pattern-increases").description("List error pattern increases for a given team").option("--from <TIMESTAMP>",`Start of time range${xe}${Ie("from")}`).option("--to <TIMESTAMP>",`End of time range${xe}${Ie("to")}`).requiredOption("--team <TEAM_NAME>","Team to query").option("--env <ENV_NAME>","Filter by environment").action(async c=>{let l={from:it("from",c.from),to:it("to",c.to),team:c.team};c.env!==void 0&&(l.env=c.env);let d=await r()(Gw,{query:l});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${xe}${Ie("from")}`).option("--to <TIMESTAMP>",`End of time range${xe}${Ie("to")}`).action(async c=>{let l=await r()(Bw,{query:{from:it("from",c.from),to:it("to",c.to)}});Q(l)}),o.command("get <METRIC_NAME>").description("Retrieve a metric by name with its metadata").option("--from <TIMESTAMP>",`Start of time range${xe}${Ie("from")}`).option("--to <TIMESTAMP>",`End of time range${xe}${Ie("to")}`).action(async(c,l)=>{let d=await r()(Fw,{params:{name:c},query:{from:it("from",l.from),to:it("to",l.to)}});Q(d)}),o.command("assets-usage <METRIC_NAME>").description("List dashboards and monitors that use a specific metric").action(async c=>{let l=await r()(Kw,{query:{metricName:c}});Q(l)});let i=e.command("traces").description("Search and summarize traces");i.command("search").description("Search spans").option("--from <TIMESTAMP>",`Start of time range${xe}${Ie("from")}`).option("--to <TIMESTAMP>",`End of time range${xe}${Ie("to")}`).option("--query <TSUGA_QUERY>",`Tsuga query to filter spans${Ie("query")}`).option("--max-results <COUNT>",`Maximum number of results, 1-10000${Ie("max-results")}`).action(async c=>{let l=await r()(Ww,{query:tN(c)});Q(l)}),i.command("summarize").description("Summarize a trace by aggregating groups of similar spans into summary spans").requiredOption("--trace-id <TRACE_ID>","Trace ID to summarize").option("--from <TIMESTAMP>",`Start of time range${xe}${Ie("from")}`).option("--to <TIMESTAMP>",`End of time range${xe}${Ie("to")}`).action(async c=>{let l=await r()(Xw,{query:{traceId:c.traceId,from:it("from",c.from),to:it("to",c.to)}});Q(l)}),i.command("latency-summary").description("Summarize where wall-clock time is spent in a trace, attributed per service").requiredOption("--trace-id <TRACE_ID>","Trace ID to summarize").option("--from <TIMESTAMP>",`Start of time range${xe}${Ie("from")}`).option("--to <TIMESTAMP>",`End of time range${xe}${Ie("to")}`).option("--min-range-duration-ms <MILLISECONDS>","Collapse timeline ranges shorter than this (default: max(1ms, 1% of trace duration); 0 disables collapsing)").option("--no-ranges","Omit the per-range timeline; return only services and serviceTotals").action(async c=>{let l={traceId:c.traceId,from:it("from",c.from),to:it("to",c.to)};if(c.minRangeDurationMs!==void 0){let f=Number(c.minRangeDurationMs);if(Number.isNaN(f))throw new Error(`--min-range-duration-ms must be a number (got: ${c.minRangeDurationMs})`);l.minRangeDurationMs=f}c.ranges||(l.includeRanges=!1);let d=await r()(eN,{query:l});Q(d)});let a=e.command("aggregation").description("Run aggregation queries");no(a,"scalar","Run aggregation queries and return scalar results",LC,r),no(a,"timeseries","Run aggregation queries and return timeseries results",kC,r)}var M9="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",D9="x-tsuga-dashboard-id",G9="x-tsuga-widget-id",$9="x-request-id",GWe={[M9]:"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",[D9]:"ID of the dashboard a query is issued from, when the request originates from a dashboard widget",[G9]:"ID of the dashboard widget (graph) a query is issued from, when the request originates from a dashboard widget",[$9]:"Unique identifier for this API request, useful for debugging and support"};var _n=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 aN(e){if(e instanceof _n){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(`
171
- `)}return e instanceof Error?`Error: ${e.message}`:String(e)}function j9(e){return e.replace(/\s+/g," ").replace(/[^\x20-\x7e\x80-\xff]/g,"").trim()}function sN(e,r,n,o){return async function(a,c={}){let{body:l,params:d,query:f}=c,g;if(a.url!==void 0)g=a.url;else if(a.buildUrl){if(!d)throw new _n("Internal error: params required for this endpoint");g=a.buildUrl(d)}else throw new _n("Internal error: endpoint has neither url nor buildUrl");let T=n===void 0?f:{clusterId:n,...f},_=Tb(`${e}${g}`,T),ae={Accept:"application/json",Authorization:`Bearer ${r}`,[Uf]:"cli",[wf]:"1.12.0",[Nf]:"15586a4e5",[Lf]:"2026-08-06T14:37:29.027Z"};l&&(ae["Content-Type"]="application/json");let fe=o?.(),Gr=fe?j9(fe):"";Gr&&(ae[vf]=Gr);let uo=await fetch(_,{method:a.method,headers:ae,body:l?JSON.stringify(l):null}),$r;try{$r=await uo.json()}catch{throw new _n(uo.status===504?"The server timed out (504). Try a smaller time range.":`Server returned a non-JSON response (HTTP ${uo.status}).`,uo.status)}if($r.error)throw _n.fromErrorResponse($r.error,$r.requestId);return B9($r,q9(c)),$r.data}}function q9({body:e,query:r}){let n=r?.offset??e?.offset;return typeof n=="number"?n:0}function B9(e,r){let n=e.metadata?.pagination;if(n===void 0||!Array.isArray(e.data))return;let o=r+e.data.length;o>=n.totalCount||Zf(`Showing ${e.data.length} of ${n.totalCount} (offset ${r}). Use --limit (max ${qo}) and --offset ${o} for the next page.`)}function kf(e,r=n=>{process.exit(n)}){e.on("error",n=>{if(n.code==="EPIPE"){r(process.exitCode);return}throw n})}var F9=3e3,H9="https://registry.npmjs.org/@tsuga/cli/latest";function K9(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 cN(e){try{let r=Db();if(r&&Date.now()-new Date(r).getTime()<Ks)return;let n=await fetch(H9,{signal:AbortSignal.timeout(F9)});if(!n.ok)return;let i=(await n.json()).version;K9(i,e)&&(process.stderr.write(`
169
+ `:o}var j3={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 q3(e,r,n,o){let i=(0,Ci.join)(e,".claude","settings.json");B(`Claude Code \u2192 ${i}`),(0,Tf.mkdirSync)((0,Ci.dirname)(i),{recursive:!0});let a=Wa(i),c;try{c=JSON.parse(a??"{}")}catch{throw new Error(`${i} is not valid JSON. Fix or remove it before re-running.`)}if(!io(c))throw new Error(`${i} must contain a JSON object at the top level.`);let l=c.env??{};if(!io(l))throw new Error(`${i} "env" must be a JSON object.`);let d=o?"1":"0";c.env={...l,...j3,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=Za(i,a);Qa(i,`${JSON.stringify(c,null,2)}
170
+ `),B(f===void 0?" created":` patched (backup: ${f})`)}function B3(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 F3(e,r,n,o){let i=(0,Ci.join)(e,".codex"),a=(0,Ci.join)(i,"config.toml");B(`Codex \u2192 ${a}`),(0,Tf.mkdirSync)(i,{recursive:!0});let c=Wa(a),l=c===void 0?{}:mf(c),d="otel"in l;delete l.otel,l.otel=B3(r,n,o);let f=Za(a,c);Qa(a,yf(l)),B(f===void 0?" created":d?` replaced existing [otel] tables (backup: ${f})`:` appended (backup: ${f})`)}function xw(){return new fr("--endpoint <OTLP_ENDPOINT>","OTLP base URL").env("TSUGA_OTLP_ENDPOINT").makeOptionMandatory()}function Rw(){return new fr("--ingestion-api-key <INGESTION_API_KEY>","Tsuga ingestion API key").env("TSUGA_INGESTION_API_KEY").makeOptionMandatory()}var Cw="Restart your claude / codex session to load the new config.";function Pw(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(xw()).addOption(Rw()).option("--no-include-prompts","Strip user prompts + tool content from telemetry (default: include)").action(n=>{q3((0,hf.homedir)(),n.endpoint.replace(/\/+$/,""),n.ingestionApiKey,n.includePrompts),B(Cw)}),r.command("codex").description("Patch ~/.codex/config.toml with Tsuga OTEL settings (replaces any existing [otel] table)").addOption(xw()).addOption(Rw()).option("--no-include-prompts","Strip user prompts from telemetry (default: include)").action(n=>{F3((0,hf.homedir)(),n.endpoint.replace(/\/+$/,""),n.ingestionApiKey,n.includePrompts),B(Cw)})}var qp="/v0/logs";var Ef=["CRITICAL","ERROR","WARN","NOTICE","INFO","DEBUG","TRACE"];var Ms=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`)."}),[OS]:t.Optional(t.String({description:"ID of the cluster this log was read from. Only set when the request spanned several clusters."}))},{additionalProperties:!0}),Uw=100,H3="timestamp",K3=t.Union([t.Literal(H3)]),po=t.Partial(t.Object({...Ye.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:Ms,description:"Result offset used when fetching additional log rows."}),startOffsets:t.Array(t.Number({minimum:Ms}),{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 ${Ms} for every cluster.`}),clusterId:p({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}),clusterIds:Ra,sortBy:K3,sortDirection:t.Union([t.Literal("asc"),t.Literal("desc")],{description:"Timestamp sort direction for log results."})})),UQe=m({tags:["logs"],url:`${qp}/count`,method:"GET",query:t.Pick(po,["from","to","query","clusterId","clusterIds"]),response:t.Object({count:t.Number(),clusterResponses:t.Optional(Ko())})}),Ds=t.Object({value:t.String(),priority:t.Number()}),wQe=m({tags:["logs"],url:`${qp}/search`,method:"GET",query:po,response:t.Object({logs:t.Optional(t.Array(_f)),attributesToHighlight:t.Optional(t.Array(Ds)),clusterResponses:t.Optional(Ko(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})}),z3=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"}),Y3=t.Object({id:t.String(),pattern:t.Array(z3),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"}))}),NQe=m({tags:["logs"],url:`${qp}/patterns`,method:"GET",query:t.Object({...Ye.properties,query:p({type:"tsuga-query"}),clusteringThreshold:t.Optional(t.Number()),clusterId:t.Optional(p({allowEmpty:!1}))}),response:t.Object({patterns:t.Array(Y3),sampleSize:t.Number()})}),LQe=m({tags:["logs"],url:`${qp}/attributes`,method:"GET",query:t.Object({...Ye.properties,clusterId:t.Optional(p({allowEmpty:!1,description:"Cluster ID"})),clusterIds:t.Optional(Ra)}),response:t.Object({attributes:t.Array(t.String()),clusterResponses:t.Optional(Ko())})});var Gs=`/${"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."}),V3={context:{team:"platform"},message:"Request completed successfully",timestamp:17040672e5,level:"INFO"};Object.assign(If,{examples:[V3]});var ww=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:Uw,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."}),Q3={query:"level:ERROR",maxResults:100,from:1704067200,to:1704070800};Object.assign(ww,{examples:[Q3]});var Nw=m({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:`${Gs}/search`,method:"GET",query:ww,response:t.Object({logs:t.Array(If,{description:"Log events matching the query and time range."})})}),W3=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`."}))}),Lw=t.Object({patterns:t.Array(W3,{description:"Log patterns clustered from logs matching the query."}),sampleSize:t.Number({description:"Number of logs sampled while computing patterns."})},{}),Z3={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(Lw,{examples:[Z3]});var vw=m({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:`${Gs}/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:Lw}),X3=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."})}),kw=t.Object({newErrorPatterns:t.Array(X3,{description:"Error patterns first seen in the requested time range."})},{}),J3={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(kw,{examples:[J3]});var Mw=m({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:`${Gs}/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:kw}),e9=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."}))}),Dw=t.Object({errorPatternIncreases:t.Array(e9,{description:"Error patterns with increased occurrence in the requested time range."})},{}),t9={errorPatternIncreases:[{team:"platform",env:"production",pattern:"Non-resolved segment SegmentId(*) from cache",increaseTimestamps:[17041536e5,17042392e5]}]};Object.assign(Dw,{examples:[t9]});var Gw=m({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:`${Gs}/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:Dw}),$w=t.Object({attributes:t.Array(t.String(),{description:"Log attribute dot-paths observed in the time range"})},{}),r9={attributes:["context.env","context.k8s.pod.name","context.service.name","context.team","level","message","timestamp"]};Object.assign($w,{examples:[r9]});var n9=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."}),jw=m({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:`${Gs}/attributes`,method:"GET",query:n9,response:$w});var Mr="/v0/metrics",o9=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}),YQe=m({tags:["metrics"],url:`${Mr}/count`,method:"GET",query:t.Pick(po,["from","to","query","clusterId"]),response:t.Object({count:t.Number()})}),VQe=m({tags:["metrics"],url:`${Mr}/search`,method:"GET",query:po,response:t.Object({logs:t.Optional(t.Array(o9)),totalHits:t.Optional(t.Number()),attributesToHighlight:t.Optional(t.Array(Ds))},{additionalProperties:!0})}),Bp=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."}),i9=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(Bp),unit:t.Optional(t.String({description:"Metric unit reported by instrumentation or inferred metadata."}))}),QQe=m({url:`${Mr}/metadata`,method:"GET",query:t.Object({...Ye.properties,metricName:p({allowEmpty:!1}),clusterId:t.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:i9}),WQe=m({tags:["metrics"],url:Mr,method:"GET",query:t.Object({...Ye.properties,clusterId:t.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:t.Array(t.String())}),Fp=t.Array(t.Object({name:t.String({description:"Metric name observed by Tsuga."}),type:Bp}),{description:"Metrics observed in the requested time range, with the instrument type each was reported as."}),a9=[{name:"http.server.request.duration",type:"histogram"},{name:"http.server.active_requests",type:"gauge"},{name:"http.server.request.count",type:"counter"}];Object.assign(Fp,{examples:[a9]});var ZQe=m({tags:["metrics"],url:`${Mr}/names-and-types`,method:"GET",query:t.Object({...Ye.properties,clusterId:t.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:Fp}),$s=t.Array(t.String(),{description:"Attribute names available as dimensions for filtering or grouping the requested metric(s)."}),s9=["service","env","host","method","status_code"];Object.assign($s,{examples:[s9]});var XQe=m({tags:["metrics"],url:`${Mr}/attributes`,method:"GET",query:t.Object({...Ye.properties,metricName:p({allowEmpty:!1}),clusterId:t.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:$s}),JQe=m({tags:["metrics"],url:`${Mr}/attributes/batch`,method:"GET",query:t.Object({...Ye.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:$s}),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."})}),eWe=m({tags:["metrics"],url:`${Mr}/assets-usage`,method:"GET",query:t.Object({metricName:p({allowEmpty:!1})}),response:Sf}),tWe=m({url:`${Mr}/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`,c9=[{name:"http.server.request.duration",type:"histogram"},{name:"http.server.active_requests",type:"gauge"},{name:"http.server.request.count",type:"counter"}];Object.assign(Fp,{examples:[c9]});var Af=t.Object({name:t.String({description:"Metric name observed by Tsuga. Use this value in metric queries and aggregations."}),type:Bp,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."}))}),p9={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:[p9]});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."}),Bw=m({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:qw,response:t.Array(Af)}),Fw=m({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:qw,response:Af}),u9=["service","env","host","method","status_code"];Object.assign($s,{examples:[u9]});var Hw=t.Pick(Sf,["assets"]),l9={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(Hw,{examples:[l9]});var Kw=m({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:Hw});var Pi="/v0/traces",gWe=m({tags:["traces"],url:`${Pi}/count`,method:"GET",query:t.Pick(po,["from","to","query","clusterId"]),response:t.Object({count:t.Number()})}),m9=["unset","ok","error"],d9=t.Enum(m9),f9=["unspecified","internal","server","client","producer","consumer"],g9=t.Enum(f9),Yw=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:g9,name:t.String()}),status_code:t.Optional(d9),trace_id:t.String()}),Vw=100,y9="start_time",h9="duration_ns",T9=t.Union([t.Literal(y9),t.Literal(h9)]),E9={...Ye.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:Ms})),clusterId:t.Optional(p({allowEmpty:!1,description:"Cluster ID"})),sortBy:t.Optional(T9),sortDirection:t.Optional(t.Union([t.Literal("asc"),t.Literal("desc")]))},yWe=m({tags:["traces"],url:`${Pi}/search`,method:"GET",query:t.Object(E9),response:t.Object({spans:t.Optional(t.Array(Yw)),attributesToHighlight:t.Optional(t.Array(Ds))})});var _9=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."})}),I9=t.Object({...Ye.properties,traceId:p({allowEmpty:!1,description:"Trace ID to summarize"}),clusterId:t.Optional(p({allowEmpty:!1,description:"Cluster ID"})),...t.Partial(_9).properties}),hWe=m({tags:["traces"],url:`${Pi}/summarize`,method:"GET",query:I9,response:t.Object({spans:t.Array(Yw)})}),TWe=m({tags:["traces"],url:`${Pi}/attributes`,method:"GET",query:t.Object({...Ye.properties,clusterId:t.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:t.Object({attributes:t.Array(t.String())})}),b9=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."}))}),S9=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."})}),O9=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."})),Hp=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(b9,{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(S9,{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(O9,{description:"Aggregated wall-clock contribution per service across the fetched trace. Use this for service-level latency ownership without processing the per-range timeline."})}),A9={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(Hp,{examples:[A9]});var EWe=m({tags:["traces"],url:`${Pi}/latency-summary`,method:"GET",query:t.Object({...Ye.properties,traceId:p({allowEmpty:!1,description:"Trace ID to summarize"}),clusterId:t.Optional(p({allowEmpty:!1,description:"Cluster ID"})),minRangeDurationMs:xf,includeRanges:Rf}),response:Hp}),zw=t.Object({filter:p({type:"tsuga-query",description:"TQL filter defining the group"}),timeRange:zo}),x9=t.Object({attr:t.String(),value:t.String()}),R9=t.Object({value:t.String(),supportA:t.Number(),supportB:t.Number()}),C9=t.Object({predicate:x9,supportA:t.Number(),supportB:t.Number(),lift:t.Number(),pValue:t.Number(),attrValues:t.Array(R9)}),_We=m({tags:["traces"],url:`${Pi}/contrast-sets`,method:"POST",body:t.Object({groupA:zw,groupB:zw,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(C9),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."}),P9={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:[P9]});var U9={from:1704067200,to:1704070800,query:"context.service.name:my-service",maxResults:100},Qw=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:Vw,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(Qw,{examples:[U9]});var Ww=m({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:Qw,response:t.Object({spans:t.Array(Pf,{description:"Spans matching the query and time range."})})}),w9={from:1704067200,to:1704070800,traceId:"78c99c5bb1e4a30297fa134b9dbec64f"},Zw=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(Zw,{examples:[w9]});var Xw=m({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:Zw,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`."})})}),N9={from:1704067200,to:1704070800,traceId:"78c99c5bb1e4a30297fa134b9dbec64f"},Jw=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:xf,includeRanges:Rf},{description:"Trace latency summary query. Provide a trace ID, a time range covering the trace, and optional timeline tuning."});Object.assign(Jw,{examples:[N9]});var eN=m({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:Jw,response:Hp});var nN=["timestamp","level","message"],oN=["count","ratio","team","level","pattern"];function it(e,r){let n=r??Er(e);if(!n)throw new Error(`--${e} is required`);return zs(n)}function tN(e){let r={from:it("from",e.from),to:it("to",e.to)},n=e.query??Er("query");n!==void 0&&(r.query=n);let o=e.maxResults??Er("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 Ie(e){let r=Er(e);return r===void 0?"":` (default: ${r})`}function L9(e){let r=ou(e.output),n=e.fields===void 0?void 0:iu(e.fields);return r==="json"?{format:r,fields:n}:{format:r,fields:n??nN}}function v9(e){let r=ou(e.output),n=e.fields===void 0?void 0:iu(e.fields);return r==="json"?{format:r,fields:n}:{format:r,fields:n??oN}}function rN(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 k9(e,r){if(r.format==="json"){if(r.fields===void 0){Q(e);return}let{fields:i}=r;Q({patterns:e.patterns.map(a=>rN(a,e.sampleSize)).map(a=>au(a,i)),sampleSize:e.sampleSize});return}let n=e.patterns.map(i=>rN(i,e.sampleSize)),o=su(r.format,n,r.fields);o.length>0&&B(o)}function M9(e,r){if(r.format==="json"){if(r.fields===void 0){Q(e);return}let{fields:o}=r;Q({logs:e.logs.map(i=>au(i,o))});return}let n=su(r.format,e.logs,r.fields);n.length>0&&B(n)}function iN(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${xe}${Ie("from")}`).option("--to <TIMESTAMP>",`End of time range${xe}${Ie("to")}`).option("--query <TSUGA_QUERY>",`Tsuga query to filter logs${Ie("query")}`).option("--max-results <COUNT>",`Maximum number of results, 1-1000${Ie("max-results")}`).option("--fields <FIELDS>",`Comma-separated dot-paths to project from each log (default for --output=tsv|csv: ${nN.join(",")})`).option("-o, --output <FORMAT>","Output format: json | tsv | csv","json").action(async c=>{let l=L9(c),d=await r()(Nw,{query:tN(c)});M9(d,l)}),n.command("attributes").description("List log attribute dot-paths observed in the time range").option("--from <TIMESTAMP>",`Start of time range${xe}${Ie("from")}`).option("--to <TIMESTAMP>",`End of time range${xe}${Ie("to")}`).action(async c=>{let l=await r()(jw,{query:{from:it("from",c.from),to:it("to",c.to)}});Q(l)}),n.command("patterns").description("List log patterns").option("--from <TIMESTAMP>",`Start of time range${xe}${Ie("from")}`).option("--to <TIMESTAMP>",`End of time range${xe}${Ie("to")}`).option("--query <TSUGA_QUERY>",`Tsuga query to filter logs before clustering into patterns${Ie("query")}`).option("--fields <FIELDS>",`Comma-separated dot-paths to project from each pattern (default for --output=tsv|csv: ${oN.join(",")})`).option("-o, --output <FORMAT>","Output format: json | tsv | csv","json").action(async c=>{let l=v9(c),d={from:it("from",c.from),to:it("to",c.to)},f=c.query??Er("query");f!==void 0&&(d.query=f);let g=await r()(vw,{query:d});k9(g,l)}),n.command("new-error-patterns").description("List error patterns first seen in this time range").option("--from <TIMESTAMP>",`Start of time range${xe}${Ie("from")}`).option("--to <TIMESTAMP>",`End of time range${xe}${Ie("to")}`).option("--team <TEAM_NAME>","Filter by team").option("--env <ENV_NAME>","Filter by environment").option("--service <SERVICE_NAME>","Filter by service").action(async c=>{let l={from:it("from",c.from),to:it("to",c.to)};c.team!==void 0&&(l.team=c.team),c.env!==void 0&&(l.env=c.env),c.service!==void 0&&(l.service=c.service);let d=await r()(Mw,{query:l});Q(d)}),n.command("error-pattern-increases").description("List error pattern increases for a given team").option("--from <TIMESTAMP>",`Start of time range${xe}${Ie("from")}`).option("--to <TIMESTAMP>",`End of time range${xe}${Ie("to")}`).requiredOption("--team <TEAM_NAME>","Team to query").option("--env <ENV_NAME>","Filter by environment").action(async c=>{let l={from:it("from",c.from),to:it("to",c.to),team:c.team};c.env!==void 0&&(l.env=c.env);let d=await r()(Gw,{query:l});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${xe}${Ie("from")}`).option("--to <TIMESTAMP>",`End of time range${xe}${Ie("to")}`).action(async c=>{let l=await r()(Bw,{query:{from:it("from",c.from),to:it("to",c.to)}});Q(l)}),o.command("get <METRIC_NAME>").description("Retrieve a metric by name with its metadata").option("--from <TIMESTAMP>",`Start of time range${xe}${Ie("from")}`).option("--to <TIMESTAMP>",`End of time range${xe}${Ie("to")}`).action(async(c,l)=>{let d=await r()(Fw,{params:{name:c},query:{from:it("from",l.from),to:it("to",l.to)}});Q(d)}),o.command("assets-usage <METRIC_NAME>").description("List dashboards and monitors that use a specific metric").action(async c=>{let l=await r()(Kw,{query:{metricName:c}});Q(l)});let i=e.command("traces").description("Search and summarize traces");i.command("search").description("Search spans").option("--from <TIMESTAMP>",`Start of time range${xe}${Ie("from")}`).option("--to <TIMESTAMP>",`End of time range${xe}${Ie("to")}`).option("--query <TSUGA_QUERY>",`Tsuga query to filter spans${Ie("query")}`).option("--max-results <COUNT>",`Maximum number of results, 1-10000${Ie("max-results")}`).action(async c=>{let l=await r()(Ww,{query:tN(c)});Q(l)}),i.command("summarize").description("Summarize a trace by aggregating groups of similar spans into summary spans").requiredOption("--trace-id <TRACE_ID>","Trace ID to summarize").option("--from <TIMESTAMP>",`Start of time range${xe}${Ie("from")}`).option("--to <TIMESTAMP>",`End of time range${xe}${Ie("to")}`).action(async c=>{let l=await r()(Xw,{query:{traceId:c.traceId,from:it("from",c.from),to:it("to",c.to)}});Q(l)}),i.command("latency-summary").description("Summarize where wall-clock time is spent in a trace, attributed per service").requiredOption("--trace-id <TRACE_ID>","Trace ID to summarize").option("--from <TIMESTAMP>",`Start of time range${xe}${Ie("from")}`).option("--to <TIMESTAMP>",`End of time range${xe}${Ie("to")}`).option("--min-range-duration-ms <MILLISECONDS>","Collapse timeline ranges shorter than this (default: max(1ms, 1% of trace duration); 0 disables collapsing)").option("--no-ranges","Omit the per-range timeline; return only services and serviceTotals").action(async c=>{let l={traceId:c.traceId,from:it("from",c.from),to:it("to",c.to)};if(c.minRangeDurationMs!==void 0){let f=Number(c.minRangeDurationMs);if(Number.isNaN(f))throw new Error(`--min-range-duration-ms must be a number (got: ${c.minRangeDurationMs})`);l.minRangeDurationMs=f}c.ranges||(l.includeRanges=!1);let d=await r()(eN,{query:l});Q(d)});let a=e.command("aggregation").description("Run aggregation queries");no(a,"scalar","Run aggregation queries and return scalar results",LC,r),no(a,"timeseries","Run aggregation queries and return timeseries results",kC,r)}var D9="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",G9="x-tsuga-dashboard-id",$9="x-tsuga-widget-id",j9="x-request-id",$We={[D9]:"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",[G9]:"ID of the dashboard a query is issued from, when the request originates from a dashboard widget",[$9]:"ID of the dashboard widget (graph) a query is issued from, when the request originates from a dashboard widget",[j9]:"Unique identifier for this API request, useful for debugging and support"};var _n=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 aN(e){if(e instanceof _n){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(`
171
+ `)}return e instanceof Error?`Error: ${e.message}`:String(e)}function q9(e){return e.replace(/\s+/g," ").replace(/[^\x20-\x7e\x80-\xff]/g,"").trim()}function sN(e,r,n,o){return async function(a,c={}){let{body:l,params:d,query:f}=c,g;if(a.url!==void 0)g=a.url;else if(a.buildUrl){if(!d)throw new _n("Internal error: params required for this endpoint");g=a.buildUrl(d)}else throw new _n("Internal error: endpoint has neither url nor buildUrl");let T=n===void 0?f:{clusterId:n,...f},_=Tb(`${e}${g}`,T),ae={Accept:"application/json",Authorization:`Bearer ${r}`,[Uf]:"cli",[wf]:"1.14.0",[Nf]:"427a63f7e",[Lf]:"2026-08-07T09:24:12.130Z"};l&&(ae["Content-Type"]="application/json");let fe=o?.(),Gr=fe?q9(fe):"";Gr&&(ae[vf]=Gr);let uo=await fetch(_,{method:a.method,headers:ae,body:l?JSON.stringify(l):null}),$r;try{$r=await uo.json()}catch{throw new _n(uo.status===504?"The server timed out (504). Try a smaller time range.":`Server returned a non-JSON response (HTTP ${uo.status}).`,uo.status)}if($r.error)throw _n.fromErrorResponse($r.error,$r.requestId);return F9($r,B9(c)),$r.data}}function B9({body:e,query:r}){let n=r?.offset??e?.offset;return typeof n=="number"?n:0}function F9(e,r){let n=e.metadata?.pagination;if(n===void 0||!Array.isArray(e.data))return;let o=r+e.data.length;o>=n.totalCount||Zf(`Showing ${e.data.length} of ${n.totalCount} (offset ${r}). Use --limit (max ${qo}) and --offset ${o} for the next page.`)}function kf(e,r=n=>{process.exit(n)}){e.on("error",n=>{if(n.code==="EPIPE"){r(process.exitCode);return}throw n})}var H9=3e3,K9="https://registry.npmjs.org/@tsuga/cli/latest";function z9(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 cN(e){try{let r=Db();if(r&&Date.now()-new Date(r).getTime()<Ks)return;let n=await fetch(K9,{signal:AbortSignal.timeout(H9)});if(!n.ok)return;let i=(await n.json()).version;z9(i,e)&&(process.stderr.write(`
172
172
  Update available: ${e} \u2192 ${i}
173
- `),process.stderr.write("Run `tsuga self-update` to update\n")),Gb(new Date().toISOString())}catch{}}kf(process.stdout);kf(process.stderr);var _e=new lo().name("tsuga").description("Manage Tsuga resources, telemetry, and configuration from the command line").version("1.12.0").addHelpText("before",()=>`${Kf()}
174
- `).configureHelp({sortSubcommands:!0}).helpOption("-h, --help","Display help for command").helpCommand("help [command]","Display help for command").option("--operation-api-key <OPERATION_API_KEY>","Operation API key (overrides config and TSUGA_OPERATION_API_KEY)").option("--cluster <CLUSTER_ID>","Target cluster (overrides config and TSUGA_CLUSTER_ID)"),Kp,pN;function Dr(){if(Kp)return Kp;let e=_e.opts(),r=Fo({operationApiKey:e.operationApiKey,clusterId:e.cluster});Fs(r.credential,new Date)&&(console.error("Your session expired. Run `tsuga auth login` to sign in again."),process.exit(1));let n=Cb(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)),Kp=sN(r.apiUrl,n,r.clusterId,()=>pN),Kp}var uN="Setup & config:",lN="Documentation, help & feedback:";_e.commandsGroup(uN);jb(_e);mS(_e);var z9=new Set(_e.commands);_e.commandsGroup("Resources:");yw(_e,Dr);_e.commandsGroup("Query & explore:");iN(_e,Dr);KO(_e,Dr);HR(_e,Dr);xC(_e,Dr);DC(_e,Dr);_e.commandsGroup(lN);TS(_e,Dr);bS(_e,Dr);_e.commandsGroup(uN);cS(_e,Dr);Pw(_e);VR(_e);Tw(_e);lS(_e);_e.commandsGroup(lN).helpCommand("help [command]");function mN(e){if(e.commands.length===0){e.option("--rationale <RATIONALE>",'Why you are making this call, e.g. "confirming the deploy caused the error spike". Recorded to explain intent; does not affect the result.');return}for(let r of e.commands)mN(r)}var Y9=new Set(["completion","self-update","install","setup","feedback"]);for(let e of _e.commands)!z9.has(e)&&!Y9.has(e.name())&&mN(e);_e.hook("preAction",(e,r)=>{let{rationale:n}=r.opts();pN=n});_e.parseAsync().then(()=>cN("1.12.0")).catch(e=>{console.error(aN(e)),process.exitCode=1});
173
+ `),process.stderr.write("Run `tsuga self-update` to update\n")),Gb(new Date().toISOString())}catch{}}kf(process.stdout);kf(process.stderr);var _e=new lo().name("tsuga").description("Manage Tsuga resources, telemetry, and configuration from the command line").version("1.14.0").addHelpText("before",()=>`${Kf()}
174
+ `).configureHelp({sortSubcommands:!0}).helpOption("-h, --help","Display help for command").helpCommand("help [command]","Display help for command").option("--operation-api-key <OPERATION_API_KEY>","Operation API key (overrides config and TSUGA_OPERATION_API_KEY)").option("--cluster <CLUSTER_ID>","Target cluster (overrides config and TSUGA_CLUSTER_ID)"),Kp,pN;function Dr(){if(Kp)return Kp;let e=_e.opts(),r=Fo({operationApiKey:e.operationApiKey,clusterId:e.cluster});Fs(r.credential,new Date)&&(console.error("Your session expired. Run `tsuga auth login` to sign in again."),process.exit(1));let n=Cb(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)),Kp=sN(r.apiUrl,n,r.clusterId,()=>pN),Kp}var uN="Setup & config:",lN="Documentation, help & feedback:";_e.commandsGroup(uN);jb(_e);mS(_e);var Y9=new Set(_e.commands);_e.commandsGroup("Resources:");yw(_e,Dr);_e.commandsGroup("Query & explore:");iN(_e,Dr);KO(_e,Dr);HR(_e,Dr);xC(_e,Dr);DC(_e,Dr);_e.commandsGroup(lN);TS(_e,Dr);bS(_e,Dr);_e.commandsGroup(uN);cS(_e,Dr);Pw(_e);VR(_e);Tw(_e);lS(_e);_e.commandsGroup(lN).helpCommand("help [command]");function mN(e){if(e.commands.length===0){e.option("--rationale <RATIONALE>",'Why you are making this call, e.g. "confirming the deploy caused the error spike". Recorded to explain intent; does not affect the result.');return}for(let r of e.commands)mN(r)}var V9=new Set(["completion","self-update","install","setup","feedback"]);for(let e of _e.commands)!Y9.has(e)&&!V9.has(e.name())&&mN(e);_e.hook("preAction",(e,r)=>{let{rationale:n}=r.opts();pN=n});_e.parseAsync().then(()=>cN("1.14.0")).catch(e=>{console.error(aN(e)),process.exitCode=1});
175
175
  /**
176
176
  * The following is a list of HTTP status codes and their meanings.
177
177
  *