@tsuga/cli 1.196.0 → 1.198.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 (2) hide show
  1. package/dist/cli.js +3 -3
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -270,7 +270,7 @@ ${cr(e,"Wizard cancelled.",cx)}`,p4=(e,t,r,o,i=Dl)=>{let s=KAe(t);return[cr(r,e,
270
270
  `,e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>[]))),([t,r])=>[t,r]),f6=(e,t=[])=>m(m(m6(e),([r,o])=>m(nL(o),([i,s])=>[[r,i],s])),([r,o])=>f6(o,[...t,r]),()=>[t,e]),xwe=e=>m(m(m(nL(e),([t,r])=>m(f6(r),([o,i])=>m(m(m6(i),([s,a])=>[[s],a],()=>[[],i]),([s,a])=>[[t,o,s],a]))),([t,r])=>[t,r],()=>m([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[lQ(t),r]),nL=e=>m(m(bwe(e),([t,r])=>m(m(Twe(r),([o,i])=>[o,i],()=>m(Swe(r),([o,i])=>[o,i],()=>m(_we(r),([o,i])=>[o,i],()=>m(Iwe(r),([o,i])=>[o,i],()=>[])))),([o,i])=>m($Q(i),([s,a])=>[[t,o,s],a]))),([t,r])=>[dQ(t),r]),Owe=e=>m(m(nL(e),([t,r])=>m(xwe(r),([o,i])=>[[t,o],i])),([t,r])=>[mQ(t),r]),g6=e=>m(m(Owe(e),([t,r])=>[t,r],()=>m(NUe(e),([t,r])=>[t,r],()=>m(ut(e),([t,r])=>[t,r],()=>[]))),([t,r])=>[t,r]);function h6(e){let t=Jk(`\`${e}\``);return c.IsEqual(t.length,2)?t[0]:br()}function Cwe(e){return e.join("|")}function Rwe(e){return e.slice(1,e.length-1)}function Pwe(e,t,r){return pp(t,`${r}${e}`)}function Uwe(e,t){return pp(e,`${t}${N3}`)}function wwe(e,t){return pp(e,`${t}${yO}`)}function vwe(e,t){return pp(e,`${t}${_O}`)}function Nwe(e,t){return BE(we([qe("false"),qe("true")]),e,t)}function kwe(e,t){return pp(e,`${t}${IO}`)}function Lwe(e,t,r){return pp(t,`${r}${Rwe(e)}`)}function Mwe(e,t,r){let o=jE(e,{});return BE(o,t,r)}function Dwe(e,t,r){let o=yo(e);return BE(o,t,r)}function y6(e,t,r,o=[]){return c.ShiftLeft(e,(i,s)=>y6(s,t,r,[...o,BE(i,[],"")]),()=>pp(t,`${r}(${Cwe(o)})`))}function BE(e,t,r){return Fr(e)?Dwe(e.enum,t,r):mn(e)?wwe(t,r):We(e)?Pwe(e.const,t,r):Ho(e)?Uwe(t,r):ho(e)?Nwe(t,r):lr(e)?vwe(t,r):zr(e)?kwe(t,r):Gt(e)?Lwe(e.pattern,t,r):T6(e)?Mwe(e.parameters[0],t,r):Y(e)?y6(e.anyOf,t,r):a3}function pp(e,t){return c.ShiftLeft(e,(r,o)=>BE(r,o,t),()=>t)}function Fwe(e){return`^${pp(e,"")}$`}function E6(e){let t=Fwe(e);return xO(t)}function jE(e,t){return De(e)?O.Update(E6(e),{},t):NO(e,t)}function S6(e,t,r,o){let i=hi(e,t,r);return jE(i,o)}function NO(e,t={}){return oe("TemplateLiteral",[e],t)}function T6(e){return pr(e)&&c.HasPropertyKey(e,"action")&&c.IsEqual(e.action,"TemplateLiteral")}function _6(e){return jE(e,{})}function $we(e){let t=h6(e);return _6(t)}function I6(e,t={}){let r=c.IsString(e)?$we(e):_6(e);return O.Update(r,{},t)}function Gt(e){return Z(e,"TemplateLiteral")}var Ae={};Ci(Ae,{ExtendsFalse:()=>Me,ExtendsTrue:()=>V,ExtendsUnion:()=>oL,IsExtendsFalse:()=>Gwe,IsExtendsTrue:()=>x6,IsExtendsTrueLike:()=>Ia,IsExtendsUnion:()=>b6,Match:()=>Cr});function oL(e){return O.Create({"~kind":"ExtendsUnion"},{inferred:e})}function b6(e){return c.IsObject(e)&&c.HasPropertyKey(e,"~kind")&&c.HasPropertyKey(e,"inferred")&&c.IsEqual(e["~kind"],"ExtendsUnion")&&c.IsObject(e.inferred)}function V(e){return O.Create({"~kind":"ExtendsTrue"},{inferred:e})}function x6(e){return c.IsObject(e)&&c.HasPropertyKey(e,"~kind")&&c.HasPropertyKey(e,"inferred")&&c.IsEqual(e["~kind"],"ExtendsTrue")&&c.IsObject(e.inferred)}function Me(){return O.Create({"~kind":"ExtendsFalse"},{})}function Gwe(e){return c.IsObject(e)&&c.HasPropertyKey(e,"~kind")&&c.IsEqual(e["~kind"],"ExtendsFalse")}function Ia(e){return b6(e)||x6(e)}function Cr(e,t,r){return Ia(e)?t(e.inferred):r()}function Bwe(e,t,r,o){return Cr(rt(e,r,o),i=>V(O.Assign(O.Assign(e,i),{[t]:r})),()=>Me())}function jwe(e,t){return V(e)}function qwe(e,t,r,o,i){return Cr(rt(e,t,r),s=>Cr(rt(s,t,o),a=>V(a),()=>Me()),()=>Cr(rt(e,t,i),s=>V(s),()=>Me()))}function Hwe(e,t,r){let o=yo(r);return rt(e,t,o)}function O6(e,t,r){return c.ShiftLeft(r,(o,i)=>Cr(rt(e,t,o),s=>O6(s,t,i),()=>Me()),()=>V(e))}function Kwe(e,t,r){let o=Zn(r);return rt(e,t,o)}function A6(e,t,r){return c.ShiftLeft(r,(o,i)=>Cr(rt(e,t,o),s=>V(s),()=>A6(e,t,i)),()=>Me())}function ft(e,t,r){return hr(r)?jwe(e,t):Ir(r)?qwe(e,t,r.if,r.then,r.else):Fr(r)?Hwe(e,t,r.enum):Dr(r)?Bwe(e,r.name,t,r.extends):Te(r)?O6(e,t,r.allOf):Gt(r)?Kwe(e,t,r.pattern):Y(r)?A6(e,t,r.anyOf):Mr(r)?V(e):Me()}function C6(e,t,r){return Dr(r)?ft(e,t,r):hr(r)?V(e):Mr(r)?V(e):oL(e)}function zwe(e,t){let r=Ql(e),o=Ql(t);return r&&o||!r&&o?!0:!(r&&!o)}function R6(e,t,r,o){return et(o)?zwe(t,o)?rt(e,r,o.items):Me():ft(e,t,o)}function P6(e,t,r){return Ho(r)?V(e):ft(e,t,r)}function U6(e,t,r){return ho(r)?V(e):ft(e,t,r)}function Ywe(e,t,r,o,i){let s=Dr(o)?t:o,a=Dr(o)?o:t,u=Lr(t),l=Lr(o);return!u&&l?Me():Cr(rt(e,s,a),d=>qE(d,r,i),()=>Me())}function Vwe(e,t,r,o){return c.ShiftLeft(o,(i,s)=>Ywe(e,t,r,i,s),()=>Lr(t)?V(e):Me())}function Wwe(e,t,r){return c.ShiftLeft(t,(o,i)=>Vwe(e,o,i,r),()=>V(e))}function qE(e,t,r){return Wwe(e,t,r)}function aA(e,t,r){return zo(r)?V(e):rt(e,t,r)}function w6(e,t,r,o){return hr(o)?V(e):Mr(o)?V(e):Nr(o)?Cr(qE(e,t,o.parameters),i=>aA(i,r,o.instanceType),()=>Me()):Me()}function v6(e,t,r,o,i){return Cr(rt(e,t,i),()=>rt(e,r,i),()=>rt(e,o,i))}function N6(e,t,r){let o=yo(t);return rt(e,o,r)}function k6(e,t,r,o){return hr(o)?V(e):Mr(o)?V(e):kr(o)?Cr(qE(e,t,o.parameters),i=>aA(i,r,o.returnType),()=>Me()):Me()}function L6(e,t,r){return mn(r)?V(e):lr(r)?V(e):ft(e,t,r)}function M6(e,t,r){let o=Or(t);return rt(e,o,r)}function cA(e,t,r){return t===r?V(e):Me()}function Qwe(e,t,r){return We(r)?cA(e,t,r.const):Ho(r)?V(e):ft(e,qe(t),r)}function Zwe(e,t,r){return We(r)?cA(e,t,r.const):ho(r)?V(e):ft(e,qe(t),r)}function Xwe(e,t,r){return We(r)?cA(e,t,r.const):lr(r)?V(e):ft(e,qe(t),r)}function Jwe(e,t,r){return We(r)?cA(e,t,r.const):zr(r)?V(e):ft(e,qe(t),r)}function D6(e,t,r){return c.IsBigInt(t.const)?Qwe(e,t.const,r):c.IsBoolean(t.const)?Zwe(e,t.const,r):c.IsNumber(t.const)?Xwe(e,t.const,r):c.IsString(t.const)?Jwe(e,t.const,r):br()}function F6(e,t,r){return Dr(r)?ft(e,t,r):V(e)}function $6(e,t,r){return Sa(r)?V(e):ft(e,t,r)}function G6(e,t,r){return lr(r)?V(e):ft(e,t,r)}function eve(e,t,r){return Lr(t)?Lr(r)?V(e):Me():V(e)}function tve(e,t,r){return Dr(r)&&jo(r.extends)?Me():Cr(rt(e,t,r),o=>eve(o,t,r),()=>Me())}function rve(e,t){return e.reduce((r,o)=>o in t?Ia(t[o])?{...r,...t[o].inferred}:br():br(),{})}function nve(e,t,r){let o={};for(let a of c.Keys(r))o[a]=a in t?tve({},t[a],r[a]):Lr(r[a])?Dr(r[a])?V(O.Assign(e,{[r[a].name]:r[a].extends})):V(e):Me();let i=c.Values(o).every(a=>Ia(a)),s=i?rve(c.Keys(o),o):{};return i?V(s):Me()}function ove(e,t,r){let o=nve(e,t,r);return Ia(o)?V(O.Assign(e,o.inferred)):Me()}function ive(e,t,r){return ove(e,t,r)}function sve(e,t){return c.Keys(t).reduce((r,o)=>({...r,[o]:c.HasPropertyKey(e,o)?Y(r[o])?we([...r[o].anyOf,t[o]]):we([e[o],t[o]]):t[o]}),e)}function B6(e,t,r,o){return c.ShiftLeft(t,(i,s)=>Cr(rt({},e[i],r),a=>B6(e,s,r,sve(o,a)),()=>Me()),()=>V(o))}function ave(e,t,r,o){let i=c.Keys(t);return B6(t,i,o,e)}function j6(e,t,r){return Ot(r)?ave(e,t,Yr(r),tr(r)):Ie(r)?ive(e,t,r.properties):ft(e,ge(t),r)}function cve(e,t){return c.IsEqual(c.Keys(t).length,0)?V(e):Me()}function uve(e,t,r,o,i){return rt(e,r,i)}function q6(e,t,r,o){return Ot(o)?uve(e,PO(t),r,PO(Yr(o)),tr(o)):Ie(o)?cve(e,o.properties):hr(o)?V(e):Mr(o)?V(e):Me()}function H6(e,t,r){return zr(r)?V(e):ft(e,t,r)}function K6(e,t,r){return _a(r)?V(e):ft(e,t,r)}function z6(e,t,r){let o=Zn(t);return rt(e,o,r)}function iL(e,t){return O.Create({"~kind":"Inferrable"},{name:e,type:t},{})}function HE(e){return c.IsObject(e)&&c.HasPropertyKey(e,"~kind")&&c.HasPropertyKey(e,"name")&&c.HasPropertyKey(e,"type")&&c.IsEqual(e["~kind"],"Inferrable")&&c.IsString(e.name)&&c.IsObject(e.type)}function sL(e){return ap(e)?Dr(e.items)?et(e.items.extends)?iL(e.items.name,e.items.extends.items):Mr(e.items.extends)?iL(e.items.name,e.items.extends):void 0:br():void 0}function uA(e){return Dr(e)?iL(e.name,e.extends):void 0}function Y6(e,t){let r=[];for(let o of e){if(!Ia(rt({},o,t)))return;r.push(o)}return r}function V6(e,t,r,o){let i=Y6(r,o);return c.IsArray(i)?V(O.Assign(e,{[t]:xr(i)})):Me()}function pA(e,t,r,o){let i=Y6(r,o);return c.IsArray(i)?V(O.Assign(e,{[t]:we(i)})):Me()}function pve(e){return[...e].reverse()}function aL(e,t){return t?pve(e):e}function lve(e){let t=e.length>0?e[0]:void 0,r=pr(t)?sL(t):void 0;return pr(r)}function dve(e,t,r,o,i,s){return Cr(rt(e,r,i),a=>W6(a,t,o,s),()=>Me())}function mve(e,t,r,o,i){let s=sL(o);return HE(s)?V6(e,s.name,aL(r,t),s.type):c.ShiftLeft(r,(a,u)=>dve(e,t,a,u,o,i),()=>Me())}function fve(e,t,r,o){return c.ShiftLeft(o,(i,s)=>mve(e,t,r,i,s),()=>c.IsEqual(r.length,0)?V(e):Me())}function W6(e,t,r,o){return fve(e,t,r,o)}function gve(e,t,r){let o=lp(e,Zt([],[]),r),i=lve(o);return W6(e,i,aL(t,i),aL(o,i))}function hve(e,t,r){for(let o of t){let i=rt(e,o,r);if(!Ia(i))return i;e=i.inferred}return V(e)}function yve(e,t,r){let o=uA(r);return HE(o)?pA(e,o.name,t,o.type):hve(e,t,r)}function Q6(e,t,r){let o=lp(e,Zt([],[]),t);return He(r)?gve(e,o,r.items):et(r)?yve(e,o,r.items):ft(e,xr(o),r)}function Z6(e,t,r){return zo(r)?V(e):Rs(r)?V(e):ft(e,t,r)}function X6(e,t,r){return c.ShiftLeft(r,(o,i)=>Cr(rt(e,t,o),s=>V(s),()=>X6(e,t,i)),()=>Me())}function cL(e,t,r){return c.ShiftLeft(t,(o,i)=>Cr(X6(e,o,r),s=>cL(s,i,r),()=>Me()),()=>V(e))}function J6(e,t,r){let o=uA(r);return HE(o)?pA(e,o.name,t,o.type):Y(r)?cL(e,t,r.anyOf):cL(e,t,[r])}function e5(e,t,r){return Dr(r)?ft(e,t,r):hr(r)?V(e):Mr(r)?V(e):Me()}function t5(e,t,r){return zo(r)?V(e):ft(e,t,r)}function rt(e,t,r){return hr(t)?C6(e,t,r):et(t)?R6(e,t,t.items,r):Ho(t)?P6(e,t,r):ho(t)?U6(e,t,r):Nr(t)?w6(e,t.parameters,t.instanceType,r):Ir(t)?v6(e,t.if,t.then,t.else,r):Fr(t)?N6(e,t.enum,r):kr(t)?k6(e,t.parameters,t.returnType,r):mn(t)?L6(e,t,r):Te(t)?M6(e,t.allOf,r):We(t)?D6(e,t,r):jo(t)?F6(e,t,r):Sa(t)?$6(e,t,r):lr(t)?G6(e,t,r):Ie(t)?j6(e,t.properties,r):Ot(t)?q6(e,Yr(t),tr(t),r):zr(t)?H6(e,t,r):_a(t)?K6(e,t,r):Gt(t)?z6(e,t.pattern,r):He(t)?Q6(e,t.items,r):Rs(t)?Z6(e,t,r):Y(t)?J6(e,t.anyOf,r):Mr(t)?e5(e,t,r):zo(t)?t5(e,t,r):Me()}function Eve(e,t){return Or([...e,ge(t)])}function uL(e,t,r){return De(e)?O.Update(Eve(e,t),{},r):ME(e,t,r)}function r5(e,t,r,o,i){let s=hi(e,t,r),a=KE(e,t,o);return uL(s,a,i)}function ME(e,t,r={}){return oe("Interface",[e,t],r)}function Df(e){return pr(e)&&c.HasPropertyKey(e,"action")&&c.IsEqual(e.action,"Interface")}function n5(e,t,r={}){return uL(e,t,r)}function Tve(e,t,r){return e.includes(r)?!0:zE([...e,r],t,t[r])}function o5(e,t,r){let o=aO(r);return nd(e,t,o)}function nd(e,t,r){return c.ShiftLeft(r,(o,i)=>zE(e,t,o)?!0:nd(e,t,i),()=>!1)}function zE(e,t,r){return Tt(r)?Tve(e,t,r.$ref):et(r)?zE(e,t,r.items):Nr(r)?nd(e,t,[...r.parameters,r.instanceType]):kr(r)?nd(e,t,[...r.parameters,r.returnType]):Df(r)?o5(e,t,r.parameters[1]):Te(r)?nd(e,t,r.allOf):Ie(r)?o5(e,t,r.properties):Y(r)?nd(e,t,r.anyOf):He(r)?nd(e,t,r.items):Ot(r)?zE(e,t,tr(r)):!1}function i5(e,t,r){return zE(e,t,r)}function Sve(e,t){return t.reduce((r,o)=>i5([o],e,e[o])?[...r,o]:r,[])}function s5(e){let t=sO(e);return Sve(e,t)}function _ve(e,t,r){return r.includes(t)?r:t in e?YE(e,e[t],[...r,t]):br()}function a5(e,t,r){let o=aO(t);return Ff(e,o,r)}function Ff(e,t,r){return t.reduce((o,i)=>YE(e,i,o),r)}function YE(e,t,r){return Tt(t)?_ve(e,t.$ref,r):et(t)?YE(e,t.items,r):Nr(t)?Ff(e,[...t.parameters,t.instanceType],r):kr(t)?Ff(e,[...t.parameters,t.returnType],r):Df(t)?a5(e,t.parameters[1],r):Te(t)?Ff(e,t.allOf,r):Ie(t)?a5(e,t.properties,r):Y(t)?Ff(e,t.anyOf,r):He(t)?Ff(e,t.items,r):Ot(t)?YE(e,tr(t),r):r}function c5(e,t,r){return YE(e,r,[t])}function Ive(e){return xf()}function bve(e){return c.Keys(e).reduce((t,r)=>({...t,[r]:od(e[r])}),{})}function VE(e){return e.reduce((t,r)=>[...t,od(r)],[])}function od(e){return Tt(e)?Ive(e.$ref):et(e)?Ro(od(e.items),If(e)):Nr(e)?ga(VE(e.parameters),od(e.instanceType)):kr(e)?ha(VE(e.parameters),od(e.returnType)):Te(e)?Qn(VE(e.allOf)):Ie(e)?ge(bve(e.properties)):Ot(e)?wf(vf(e),od(tr(e))):Y(e)?we(VE(e.anyOf)):He(e)?xr(VE(e.items)):e}function xve(e,t){return t in e?od(e[t]):Kr()}function u5(e){return xve(e.$defs,e.$ref)}function Ove(e,t,r){let o=hi(e,Zt([],[]),t),i=KE({},Zt([],[]),r);return Or([...o,ge(i)])}function Ave(e,t){return c.Keys(e).filter(o=>t.includes(o)).reduce((o,i)=>{let s=e[i],a=Df(s)?Ove(e,s.parameters[0],s.parameters[1]):s;return{...o,[i]:a}},{})}function p5(e,t,r){let o=c5(e,t,r),i=Ave(e,o);return Ea(i,t)}function l5(e,t){return t in e?Tt(e[t])?l5(e,e[t].$ref):e[t]:xt()}function ba(e,t){return l5(e,t)}function d5(e){return $t(e)?u5(e):cO(e)?Kr():e}function Fn(e,t,r){let o=d5(t),i=d5(r);return rt(e,o,i)}var wE=0,WE=1,vE=2,NE=3;function Pf(e,t){let r=[Fn({},e,t),Fn({},t,e)];return Ae.IsExtendsTrueLike(r[0])&&Ae.IsExtendsTrueLike(r[1])?wE:Ae.IsExtendsTrueLike(r[0])&&Ae.IsExtendsFalse(r[1])?vE:Ae.IsExtendsFalse(r[0])&&Ae.IsExtendsTrueLike(r[1])?NE:WE}function pL(e,t,r=[],o=t){return c.ShiftLeft(t,(i,s)=>{let a=Pf(e,i);return c.IsEqual(a,vE)||c.IsEqual(a,wE)?o:c.IsEqual(a,WE)?pL(e,s,[...r,i],o):pL(e,s,r,o)},()=>[...r,e])}function Cve(e,t,r){let o=Vi(e);return hr(o)?[o]:Mr(o)?[o]:jo(o)?lA(t,r):Ie(o)?lA(t,[...r,o]):lA(t,pL(o,r))}function lA(e,t=[]){return c.ShiftLeft(e,(r,o)=>Cve(r,o,t),()=>t)}function jk(e){let t=lA(e);return ed(t)}function lL(e,t){return O.Update(Vi(e),{},t)}function m5(e,t,r,o){let i=G(e,t,r);return lL(i,o)}function QE(e,t=[]){return ep(e)&&c.IsEqual(e.action,"Conditional")?Tt(e.parameters[0])?QE(e.parameters[2],QE(e.parameters[3],[...t,e.parameters[0].$ref])):QE(e.parameters[2],QE(e.parameters[3],t)):ep(e)&&c.IsEqual(e.action,"Mapped")&&ep(e.parameters[1])&&c.IsEqual(e.parameters[1].action,"KeyOf")&&Tt(e.parameters[1].parameters[0])?[...t,e.parameters[1].parameters[0].$ref]:t}function Rve(e,t){return e.reduce((r,o)=>[...r,t.includes(o.name)],[])}function h5(e,t,r=[]){return c.ShiftLeft(e,(o,i)=>c.ShiftLeft(t,(s,a)=>h5(i,a,[...r,[s,o]]),()=>r),()=>r)}function Pve(e){return Gt(e)?Zn(e.pattern):Fr(e)?yo(e.enum):e}function Uve(e){let t=Pve(e);return Y(t)?[...t.anyOf]:[t]}function wve(e,t){return e.reduce((r,o)=>[...r,[...o,t]],[])}function f5(e,t){return t.reduce((r,o)=>[...r,...wve(e,o)],[])}function g5(e){return e.reduce((t,r)=>c.IsEqual(r[0],!0)?f5(t,Uve(r[1])):f5(t,[r[1]]),[[]])}function y5(e,t,r){let o=QE(r),i=Rve(e,o),s=h5(t,i);return ep(r)&&c.IsEqual(r.action,"Conditional")||ep(r)&&c.IsEqual(r.action,"Mapped")?g5(s):[t]}function vve(){return["(not-resolvable)",xt()]}function Nve(){return["(not-generic)",xt()]}function kve(e,t,r){return[e,tp(t,r)]}function Lve(e,t,r){return t in e?E5(e,t,e[t],r):vve()}function E5(e,t,r,o){return bf(r)?kve(t,r.parameters,r.expression):Tt(r)?Lve(e,r.$ref,o):Nve()}function T5(e,t,r){return E5(e,"(anonymous)",t,r)}function Mve(e,t,r){if(Dr(t)||$f(t)||Ae.IsExtendsTrueLike(Fn({},t,r)))return;let o={parameter:e,expect:r,actual:t};throw new Error(`Argument for parameter ${e} does not satisfy constraint`,{cause:o})}function S5(e,t,r,o,i){let s=G(e,t,i);return Mve(r,s,o),O.Assign(e,{[r]:s})}function Dve(e,t,r,o,i){let s=G(e,t,r.extends),a=G(e,t,r.equals);return c.ShiftLeft(i,(u,l)=>dL(S5(e,t,r.name,s,u),t,o,l),()=>dL(S5(e,t,r.name,s,a),t,o,[]))}function dL(e,t,r,o){return c.ShiftLeft(r,(i,s)=>Dve(e,t,i,s,o),()=>e)}function _5(e,t,r,o){return dL(e,t,r,o)}var mL=0,fL=0;function Fve(){if(!c.IsLessThan(fL,Hr.Get().maxInstantiationCount))throw Error("Type instantiation is excessively deep and possibly infinite")}function $ve(){Fve(),fL++,mL++}function Gve(){mL--,c.IsEqual(mL,0)&&(fL=0)}function Bve(e){return c.IsGreaterThan(e.callstack.length,0)?e.callstack[e.callstack.length-1]:""}function jve(e,t){return c.IsEqual(Bve(e),t)}function qve(e,t,r,o,i,s){$ve();try{let a=_5(e,t,o,s),u=G(a,Zt([...t.callstack,r.$ref],t.visited),i);return G(a,Zt([],[]),u)}finally{Gve()}}function Hve(e,t,r,o,i,s){return s.reduce((a,u)=>{let l=qve(e,t,r,o,i,u);return[...a,l]},[])}function Kve(e,t,r,o,i,s){let a=y5(o,s,i),u=Hve(e,t,r,o,i,a);return c.IsEqual(u.length,1)?u[0]:Uo(u)}function dA(e,t,r,o){let i=hi(e,t,o),s=T5(e,r,o),a=s[0],u=s[1];return bf(u)?jve(t,a)?DE(ln(a),i):Kve(e,t,ln(a),u.parameters,u.expression,i):DE(r,i)}function DE(e,t){return O.Create({"~kind":"Call"},{type:"call",target:e,arguments:t},{})}function I5(e,t){return dA({},Zt([],[]),e,t)}function $f(e){return Z(e,"Call")}function zve(e){return O.Discard(e,["~immutable"])}function b5(e,t){return O.Update(zve(e),{},t)}function x5(e,t,r,o){let i=G(e,t,r);return b5(i,o)}function O5(e,t){return e(t)}function A5(e,t){return c.IsString(t)?qe(O5(e,t)):qe(t)}function C5(e,t){let r=Zn(t);return Bc(e,r)}function R5(e,t){let r=t.map(o=>Bc(e,o));return we(r)}function Bc(e,t){return We(t)?A5(e,t.const):Gt(t)?C5(e,t.pattern):Y(t)?R5(e,t.anyOf):t}function kO(e,t={}){return oe("Capitalize",[e],t)}function P5(e,t={}){return gL(e,t)}function LO(e,t={}){return oe("Lowercase",[e],t)}function U5(e,t={}){return hL(e,t)}function MO(e,t={}){return oe("Uncapitalize",[e],t)}function w5(e,t={}){return yL(e,t)}function DO(e,t={}){return oe("Uppercase",[e],t)}function v5(e,t={}){return EL(e,t)}var Yve=e=>e[0].toUpperCase()+e.slice(1),Vve=e=>e.toLowerCase(),Wve=e=>e[0].toLowerCase()+e.slice(1),Qve=e=>e.toUpperCase();function gL(e,t){return De([e])?O.Update(Bc(Yve,e),{},t):kO(e,t)}function hL(e,t){return De([e])?O.Update(Bc(Vve,e),{},t):LO(e,t)}function yL(e,t){return De([e])?O.Update(Bc(Wve,e),{},t):MO(e,t)}function EL(e,t){return De([e])?O.Update(Bc(Qve,e),{},t):DO(e,t)}function N5(e,t,r,o){let i=G(e,t,r);return gL(i,o)}function k5(e,t,r,o){let i=G(e,t,r);return hL(i,o)}function L5(e,t,r,o){let i=G(e,t,r);return yL(i,o)}function M5(e,t,r,o){let i=G(e,t,r);return EL(i,o)}function FO(e,t,r,o,i={}){return oe("Conditional",[e,t,r,o],i)}function D5(e,t,r,o,i={}){return TL({},Zt([],[]),e,t,r,o,i)}function Zve(e,t,r,o,i,s){let a=Fn(e,r,o);return Ae.IsExtendsUnion(a)?we([G(a.inferred,t,i),G(e,t,s)]):Ae.IsExtendsTrue(a)?G(a.inferred,t,i):G(e,t,s)}function TL(e,t,r,o,i,s,a){return De([r,o])?O.Update(Zve(e,t,r,o,i,s),{},a):FO(r,o,i,s,a)}function F5(e,t,r,o,i,s,a){let u=G(e,t,r),l=G(e,t,o);return TL(e,t,u,l,i,s,a)}function $O(e,t={}){return oe("ConstructorParameters",[e],t)}function $5(e,t={}){return SL(e,t)}function Xve(e){let t=Nr(e)?e.parameters:[],r=lp({},Zt([],[]),t);return xr(r)}function SL(e,t){return De([e])?O.Update(Xve(e),{},t):$O(e,t)}function G5(e,t,r,o){let i=G(e,t,r);return SL(i,o)}function GO(e,t,r={}){return oe("Exclude",[e,t],r)}function B5(e,t,r={}){return ZE(e,t,r)}function ZE(e,t,r){return De([e,t])?O.Update(AO(e,t),{},r):GO(e,t,r)}function j5(e,t,r,o,i){let s=G(e,t,r),a=G(e,t,o);return ZE(s,a,i)}function BO(e,t,r={}){return oe("Extract",[e,t],r)}function q5(e,t,r={}){return _L(e,t,r)}function Jve(e,t){let r=Fn({},e,t);return Ae.IsExtendsTrueLike(r)?[e]:[]}function H5(e,t,r=[]){return c.ShiftLeft(e,(o,i)=>H5(i,t,[...r,...Jve(o,t)]),()=>r)}function K5(e,t){let r=Vi(e),o=Y(r)?r.anyOf:[r],i=H5(o,t);return Uo(i)}function _L(e,t,r){return De([e,t])?O.Update(K5(e,t),{},r):BO(e,t,r)}function z5(e,t,r,o,i){let s=G(e,t,r),a=G(e,t,o);return _L(s,a,i)}function eNe(e){return e.reduce((t,r)=>EO(r)?[...t,qe(r)]:t,[])}function Gf(e){let t=eNe(e);return we(t)}function FE(e,t,r={}){return oe("Index",[e,t],r)}function Y5(e,t,r={}){let o=c.IsArray(t)?Gf(t):t;return IL(e,o,r)}function V5(e,t){let r=ba(e,t);return yi(r)}function W5(e,t,r){let o=Cs(e,t,r);return yi(o)}function tNe(e,t){let r=c.Keys(e).filter(g=>!c.HasPropertyKey(t,g)),o=c.Keys(t).filter(g=>!c.HasPropertyKey(e,g)),i=c.Keys(e).filter(g=>c.HasPropertyKey(t,g)),s=r.reduce((g,y)=>({...g,[y]:e[y]}),{}),a=o.reduce((g,y)=>({...g,[y]:t[y]}),{}),u=i.reduce((g,y)=>({...g,[y]:OO(e[y],t[y])}),{}),l=O.Assign(s,a);return O.Assign(l,u)}function Q5(e){return e.reduce((t,r)=>tNe(t,yi(r)),{})}function Z5(e){let t=W3(xr(e));return yi(t)}function rNe(e,t){return c.Keys(e).filter(i=>i in t).reduce((i,s)=>({...i,[s]:X3(e[s],t[s])}),{})}function X5(e,t){return c.ShiftLeft(e,(r,o)=>X5(o,rNe(t,yi(r))),()=>t)}function J5(e){return c.ShiftLeft(e,(t,r)=>X5(r,yi(t)),()=>br())}function yi(e){return $t(e)?V5(e.$defs,e.$ref):Ir(e)?W5(e.if,e.then,e.else):Te(e)?Q5(e.allOf):Y(e)?J5(e.anyOf):He(e)?Z5(e.items):Ie(e)?e.properties:{}}function Bf(e){let t=yi(e);return ge(t)}var nNe=new RegExp("^(?:0|[1-9][0-9]*)$");function jf(e){let t=`${e}`;return nNe.test(t)?parseInt(t):e}function oNe(e){return qe(jf(e))}function e8(e){return e.map(t=>t8(t))}function t8(e){return Te(e)?Qn(e8(e.allOf)):Y(e)?we(e8(e.anyOf)):We(e)?oNe(e.const):e}function r8(e,t){let r=t8(t),o=Fn({},r,Ko());return Ae.IsExtendsTrueLike(o)?e:We(t)&&c.IsEqual(t.const,"length")?Ko():xt()}function n8(e,t){let r=ba(e,t);return Yo(r)}function o8(e,t,r){let o=Cs(e,t,r);return Yo(o)}function i8(e){let t=yo(e);return Yo(t)}function s8(e){let t=Or(e);return Yo(t)}function a8(e){return[`${e}`]}function c8(e){let t=Zn(e);return Yo(t)}function u8(e){return e.reduce((t,r)=>[...t,...Yo(r)],[])}function Yo(e){return $t(e)?n8(e.$defs,e.$ref):Ir(e)?o8(e.if,e.then,e.else):Fr(e)?i8(e.enum):Te(e)?s8(e.allOf):We(e)?a8(e.const):Gt(e)?c8(e.pattern):Y(e)?u8(e.anyOf):[]}function qf(e){return Yo(e)}function XE(e,t){return t.map(r=>JE(e,r))}function JE(e,t){return et(t)?Ro(JE(e,t.items)):Nr(t)?ga(XE(e,t.parameters),JE(e,t.instanceType)):kr(t)?ha(XE(e,t.parameters),JE(e,t.returnType)):He(t)?xr(XE(e,t.items)):Y(t)?we(XE(e,t.anyOf)):Te(t)?Qn(XE(e,t.allOf)):wO(t)?ge(e):t}function p8(e,t){return JE(e,t)}function iNe(e,t){let r=t in e?e[t]:xt();return p8(e,r)}function l8(e,t){return t.reduce((r,o)=>[...r,iNe(e,o)],[])}function sNe(e,t){let r=qf(t),o=l8(e,r);return Uo(o)}var aNe=new RegExp(sp);function cNe(e){return e.filter(r=>aNe.test(r))}function uNe(e){let t=sO(e),r=cNe(t),o=l8(e,r);return Uo(o)}function d8(e,t){return lr(t)?uNe(e):sNe(e,t)}function pNe(e){return qe(jf(e))}function m8(e){return e.map(t=>bL(t))}function bL(e){return Te(e)?Qn(m8(e.allOf)):Y(e)?we(m8(e.anyOf)):We(e)?pNe(e.const):e}function lNe(e,t){return e.reduceRight((r,o,i)=>{let s=Fn({},qe(i),t);return Ae.IsExtendsTrueLike(s)?[o,...r]:r},[])}function dNe(e,t){let r=bL(t),o=lNe(e,r);return op(o)}function mNe(e){return op(e)}function f8(e,t){return We(t)&&c.IsEqual(t.const,"length")?qe(e.length):lr(t)||mn(t)?mNe(e):dNe(e,t)}function g8(e,t){return et(e)?r8(e.items,t):Ie(e)?d8(e.properties,t):He(e)?f8(e.items,t):xt()}function fNe(e){return $t(e)||Ir(e)||Te(e)||Y(e)?Bf(e):e}function IL(e,t,r){return De([e,t])?O.Update(g8(fNe(e),t),{},r):FE(e,t,r)}function h8(e,t,r,o,i){let s=G(e,t,r),a=G(e,t,o);return IL(s,a,i)}function jO(e,t={}){return oe("InstanceType",[e],t)}function y8(e,t={}){return xL(e,t)}function gNe(e){return Nr(e)?e.instanceType:xt()}function xL(e,t){return De([e])?O.Update(gNe(e),{},t):jO(e,t)}function E8(e,t,r,o={}){let i=G(e,t,r);return xL(i,o)}function $E(e,t={}){return oe("KeyOf",[e],t)}function T8(e,t={}){return OL(e,t)}function S8(){return we([Ko(),Dn(),Cf()])}function _8(e){return Ko()}function hNe(e){return e.reduce((r,o)=>EO(o)?[...r,qe(jf(o))]:br(),[])}function I8(e){let t=c.Keys(e),r=hNe(t);return op(r)}function b8(e){return vf(e)}function x8(e){let t=e.map((r,o)=>qe(o));return op(t)}function O8(e){return hr(e)?S8():et(e)?_8(e.items):Ie(e)?I8(e.properties):Ot(e)?b8(e):He(e)?x8(e.items):xt()}function yNe(e){return $t(e)||Ir(e)||Te(e)||Y(e)?Bf(e):e}function OL(e,t){return De([e])?O.Update(O8(yNe(e)),{},t):$E(e,t)}function A8(e,t,r,o){let i=G(e,t,r);return OL(i,o)}function LE(e,t,r,o,i={}){return oe("Mapped",[e,t,r,o],i)}function C8(e,t,r,o,i={}){return AL({},Zt([],[]),e,t,r,o,i)}function ENe(e){let t=Zn(e);return mA(t)}function TNe(e){return e.reduce((t,r)=>[...t,...mA(r)],[])}function SNe(e){let t=yo(e);return mA(t)}function _Ne(e){return c.IsNumber(e)?[qe(`${e}`)]:[qe(e)]}function mA(e){return Fr(e)?SNe(e.enum):We(e)?_Ne(e.const):Gt(e)?ENe(e.pattern):Y(e)?TNe(e.anyOf):[e]}function R8(e){return mA(e)}function INe(e){return Gt(e)?Zn(e.pattern):e}function bNe(e,t,r,o,i,s){let a=O.Assign(e,{[r.name]:o}),u=G(a,t,i),l=INe(u),d=G(a,t,s);return TO(l)||SO(l)?{[l.const]:d}:{}}function xNe(e,t,r,o,i,s){return o.reduce((a,u)=>[...a,bNe(e,t,r,u,i,s)],[])}function ONe(e){return e.reduce((t,r)=>[...t,ge(r)],[])}function P8(e,t,r,o,i,s){let a=R8(o),u=xNe(e,t,r,a,i,s),l=ONe(u);return Or(l)}function AL(e,t,r,o,i,s,a){return De([o])?O.Update(P8(e,t,r,o,i,s),{},a):LE(r,o,i,s,a)}function U8(e,t,r,o,i,s,a){let u=G(e,t,o);return AL(e,t,r,u,i,s,a)}function ANe(e,t,r){let o=O.Assign(e,t);return c.Keys(t).filter(s=>r.includes(s)).reduce((s,a)=>({...s,[a]:p5(o,a,t[a])}),{})}function CNe(e,t,r){let o=O.Assign(e,t);return c.Keys(t).filter(s=>!r.includes(s)).reduce((s,a)=>({...s,[a]:G(o,Zt([],[]),t[a])}),{})}function RNe(e,t,r){let o=s5(t),i=ANe(e,t,o),s=CNe(e,t,o),a={...i,...s};return O.Update(a,{},r)}function fA(e,t,r,o){return RNe(e,r,o)}function qO(e,t={}){return oe("NonNullable",[e],t)}function w8(e,t={}){return CL(e,t)}function PNe(e){let t=we([Af(),Nf()]);return ZE(e,t,{})}function CL(e,t){return De([e])?O.Update(PNe(e),{},t):qO(e,t)}function v8(e,t,r,o){let i=G(e,t,r);return CL(i,o)}function HO(e,t,r={}){return oe("Omit",[e,t],r)}function N8(e,t,r={}){let o=c.IsArray(t)?Gf(t):t;return RL(e,o,r)}function gA(e){let t=Bf(e);return Ie(t)?t.properties:br()}function UNe(e,t){return c.Keys(e).reduce((o,i)=>t.includes(i)?o:{...o,[i]:e[i]},{})}function k8(e,t){let r=gA(e),o=qf(t),i=UNe(r,o);return ge(i)}function RL(e,t,r){return De([e,t])?O.Update(k8(e,t),{},r):HO(e,t,r)}function L8(e,t,r,o,i){let s=G(e,t,r),a=G(e,t,o);return RL(s,a,i)}function KO(e,t={}){return oe("Parameters",[e],t)}function M8(e,t={}){return PL(e,t)}function wNe(e){let t=kr(e)?e.parameters:[],r=lp({},Zt([],[]),t);return xr(r)}function PL(e,t){return De([e])?O.Update(wNe(e),{},t):KO(e,t)}function D8(e,t,r,o){let i=G(e,t,r);return PL(i,o)}function zO(e,t={}){return oe("Partial",[e],t)}function F8(e,t={}){return UL(e,t)}function $8(e,t){let r=ba(e,t),o=xa(r);return Ea(O.Assign(e,{[t]:o}),t)}function G8(e,t,r){let o=Cs(e,t,r);return xa(o)}function B8(e){let t=Or(e);return xa(t)}function j8(e){let t=e.map(r=>xa(r));return we(t)}function q8(e){let t=c.Keys(e).reduce((o,i)=>({...o,[i]:iO(e[i])}),{});return ge(t)}function xa(e){return $t(e)?$8(e.$defs,e.$ref):Ir(e)?G8(e.if,e.then,e.else):Te(e)?B8(e.allOf):Y(e)?j8(e.anyOf):Ie(e)?q8(e.properties):ge({})}function UL(e,t){return De([e])?O.Update(xa(e),{},t):zO(e,t)}function H8(e,t,r,o){let i=G(e,t,r);return UL(i,o)}function YO(e,t,r={}){return oe("Pick",[e,t],r)}function K8(e,t,r={}){let o=c.IsArray(t)?Gf(t):t;return wL(e,o,r)}function vNe(e,t){return c.Keys(e).reduce((o,i)=>t.includes(i)?O.Assign(o,{[i]:e[i]}):o,{})}function z8(e,t){let r=gA(e),o=qf(t),i=vNe(r,o);return ge(i)}function wL(e,t,r){return De([e,t])?O.Update(z8(e,t),{},r):YO(e,t,r)}function Y8(e,t,r,o,i){let s=G(e,t,r),a=G(e,t,o);return wL(s,a,i)}function VO(e,t={}){return oe("ReadonlyObject",[e],t)}function vL(e,t={}){return NL(e,t)}var V8=vL;function W8(e){return Of(Ro(e))}function Q8(e,t){let r=ba(e,t),o=Oa(r);return Ea(O.Assign(e,{[t]:o}),t)}function Z8(e,t,r){let o=Cs(e,t,r);return Oa(o)}function X8(e){let t=Or(e);return Oa(t)}function J8(e){let t=c.Keys(e).reduce((o,i)=>({...o,[i]:fO(e[i])}),{});return ge(t)}function e7(e){return Of(xr(e))}function t7(e){let t=e.map(r=>Oa(r));return we(t)}function Oa(e){return et(e)?W8(e.items):$t(e)?Q8(e.$defs,e.$ref):Ir(e)?Z8(e.if,e.then,e.else):Te(e)?X8(e.allOf):Ie(e)?J8(e.properties):He(e)?e7(e.items):Y(e)?t7(e.anyOf):e}function NL(e,t){return De([e])?O.Update(Oa(e),{},t):VO(e)}function r7(e,t,r,o){let i=G(e,t,r);return NL(i,o)}function n7(e,t,r,o){return t.visited.includes(o)?r:o in e?G(e,Zt(t.callstack,[...t.visited,o]),e[o]):r}function o7(e,t){let r=ba(e,t),o=Aa(r);return Ea(O.Assign(e,{[t]:o}),t)}function i7(e,t,r){let o=Cs(e,t,r);return Aa(o)}function s7(e){let t=Or(e);return Aa(t)}function a7(e){let t=e.map(r=>Aa(r));return we(t)}function fQ(e,t={}){return oe("RemoveOptional",[e],t)}function c7(e,t={}){return Jl(e,t)}function u7(e){let t=c.Keys(e).reduce((o,i)=>({...o,[i]:c7(e[i])}),{});return ge(t)}function Aa(e){return $t(e)?o7(e.$defs,e.$ref):Ir(e)?i7(e.if,e.then,e.else):Te(e)?s7(e.allOf):Y(e)?a7(e.anyOf):Ie(e)?u7(e.properties):ge({})}function WO(e,t={}){return oe("Required",[e],t)}function p7(e,t={}){return kL(e,t)}function kL(e,t){return De([e])?O.Update(Aa(e),{},t):WO(e,t)}function l7(e,t,r,o){let i=G(e,t,r);return kL(i,o)}function QO(e,t={}){return oe("ReturnType",[e],t)}function d7(e,t={}){return LL(e,t)}function NNe(e){return kr(e)?e.returnType:xt()}function LL(e,t){return De([e])?O.Update(NNe(e),{},t):QO(e,t)}function m7(e,t,r,o={}){let i=G(e,t,r);return LL(i,o)}function ZO(e,t){return oe("With",[e,t],{})}function hA(e,t){return ML(e,t)}function ML(e,t){return De([e])?O.Update(e,{},t):ZO(e,t)}function f7(e,t,r,o){let i=G(e,t,r);return ML(i,o)}function kNe(e){return ap(e)?He(e.items)?DL(e.items.items):Dr(e.items)?[e]:Tt(e.items)?[e]:[xt()]:[e]}function DL(e){return e.reduce((r,o)=>[...r,...kNe(o)],[])}function Zt(e,t){return{callstack:e,visited:t}}function De(e){return c.ShiftLeft(e,(t,r)=>Tt(t)?!1:De(r),()=>!0)}function KE(e,t,r){return c.Keys(r).reduce((o,i)=>({...o,[i]:G(e,t,r[i])}),{})}function lp(e,t,r){let o=hi(e,t,r);return DL(o)}function hi(e,t,r){return r.map(o=>G(e,t,o))}function LNe(e,t){let r=Lr(e)?fa(t,{}):t,o=$c(e)?ma(r,{}):r;return Ql(e)?eT(o,{}):o}function MNe(e,t,r,o,i){return c.IsEqual(r,"AddImmutable")?g7(e,t,o[0],i):c.IsEqual(r,"RemoveImmutable")?x5(e,t,o[0],i):c.IsEqual(r,"AddReadonly")?n3(e,t,o[0],i):c.IsEqual(r,"RemoveReadonly")?Z3(e,t,o[0],i):c.IsEqual(r,"AddOptional")?o3(e,t,o[0],i):c.IsEqual(r,"RemoveOptional")?Q3(e,t,o[0],i):c.IsEqual(r,"Capitalize")?N5(e,t,o[0],i):c.IsEqual(r,"Conditional")?F5(e,t,o[0],o[1],o[2],o[3],i):c.IsEqual(r,"ConstructorParameters")?G5(e,t,o[0],i):c.IsEqual(r,"Evaluate")?m5(e,t,o[0],i):c.IsEqual(r,"Exclude")?j5(e,t,o[0],o[1],i):c.IsEqual(r,"Extract")?z5(e,t,o[0],o[1],i):c.IsEqual(r,"Index")?h8(e,t,o[0],o[1],i):c.IsEqual(r,"InstanceType")?E8(e,t,o[0],i):c.IsEqual(r,"Interface")?r5(e,t,o[0],o[1],i):c.IsEqual(r,"KeyOf")?A8(e,t,o[0],i):c.IsEqual(r,"Lowercase")?k5(e,t,o[0],i):c.IsEqual(r,"Mapped")?U8(e,t,o[0],o[1],o[2],o[3],i):c.IsEqual(r,"Module")?fA(e,t,o[0],i):c.IsEqual(r,"NonNullable")?v8(e,t,o[0],i):c.IsEqual(r,"Pick")?Y8(e,t,o[0],o[1],i):c.IsEqual(r,"Parameters")?D8(e,t,o[0],i):c.IsEqual(r,"Partial")?H8(e,t,o[0],i):c.IsEqual(r,"Omit")?L8(e,t,o[0],o[1],i):c.IsEqual(r,"ReadonlyObject")?r7(e,t,o[0],i):c.IsEqual(r,"Record")?f9(e,t,o[0],o[1],i):c.IsEqual(r,"Required")?l7(e,t,o[0],i):c.IsEqual(r,"ReturnType")?m7(e,t,o[0],i):c.IsEqual(r,"TemplateLiteral")?S6(e,t,o[0],i):c.IsEqual(r,"Uncapitalize")?L5(e,t,o[0],i):c.IsEqual(r,"Uppercase")?M5(e,t,o[0],i):c.IsEqual(r,"With")?f7(e,t,o[0],o[1]):oe(r,o,i)}function DNe(e,t,r){let o=Tt(r)?n7(e,t,r,r.$ref):et(r)?Ro(G(e,t,r.items),If(r)):$f(r)?dA(e,t,r.target,r.arguments):Nr(r)?ga(hi(e,t,r.parameters),G(e,t,r.instanceType),i3(r)):kr(r)?ha(hi(e,t,r.parameters),G(e,t,r.returnType),s3(r)):Ir(r)?Vl(G(e,t,r.if),G(e,t,r.then),G(e,t,r.else),d3(r)):Te(r)?Qn(hi(e,t,r.allOf),y3(r)):Ie(r)?ge(KE(e,t,r.properties),p3(r)):Ot(r)?RO(Yr(r),G(e,t,tr(r))):ap(r)?td(G(e,t,r.items)):He(r)?xr(lp(e,t,r.items),V3(r)):Y(r)?we(hi(e,t,r.anyOf),F3(r)):r;return LNe(r,o)}function G(e,t,r){return ep(r)?MNe(e,t,r.action,r.parameters,r.options):DNe(e,t,r)}function Wi(e,t){return G(e,Zt([],[]),t)}function eT(e,t){return O.Update(e,{"~immutable":!0},t)}function g7(e,t,r,o){let i=G(e,t,r);return eT(i,o)}function gQ(e,t={}){return oe("AddImmutable",[e],t)}function Of(e,t={}){return eT(e,t)}function hQ(e,t={}){return oe("RemoveReadonly",[e],t)}function yQ(e,t={}){return oe("Evaluate",[e],t)}function $n(e,t={}){return lL(e,t)}function EQ(e,t={}){return oe("Module",[e],t)}function h7(e,t={}){return fA({},Zt([],[]),e,t)}function FNe(e,t){let r=Pf(e,t);return c.IsEqual(r,NE)||c.IsEqual(r,WE)?1:0}function y7(e,t,r=[]){return c.ShiftLeft(t,(o,i)=>c.IsEqual(FNe(e,o),1)?y7(e,i,[...r,o]):[...r,e,...t],()=>[...r,e])}function E7(e,t=[]){return c.ShiftLeft(e,(r,o)=>E7(o,y7(r,t)),()=>t)}function T7(e){return E7(e)}function S7(...e){let[t,r,o]=ct.Match(e,{2:(a,u)=>c.IsString(a)?[{},a,u]:[a,u,{}],3:(a,u,l)=>[a,u,l],1:a=>[{},a,{}]}),i=g6(r),s=c.IsArray(i)&&c.IsEqual(i.length,2)?G(t,Zt([],[]),i[0]):xt();return O.Update(s,{},o)}var n={};Ci(n,{Any:()=>xf,Array:()=>Ro,BigInt:()=>CE,Boolean:()=>hO,Call:()=>I5,Capitalize:()=>P5,Codec:()=>mO,Conditional:()=>D5,Constructor:()=>ga,ConstructorParameters:()=>$5,Cyclic:()=>Ea,Decode:()=>R3,DecodeBuilder:()=>AE,Dependent:()=>Vl,Encode:()=>P3,EncodeBuilder:()=>OE,Enum:()=>h3,Evaluate:()=>$n,Exclude:()=>B5,Extends:()=>Fn,ExtendsResult:()=>Ae,Extract:()=>q5,Function:()=>ha,Generic:()=>tp,Identifier:()=>RE,Immutable:()=>U3,Index:()=>Y5,Infer:()=>bE,InstanceType:()=>y8,Instantiate:()=>Wi,Integer:()=>Zl,Interface:()=>n5,Intersect:()=>Qn,IsAny:()=>hr,IsArray:()=>et,IsBigInt:()=>Ho,IsBoolean:()=>ho,IsCall:()=>$f,IsCodec:()=>Wl,IsConstructor:()=>Nr,IsCyclic:()=>$t,IsDependent:()=>Ir,IsEnum:()=>Fr,IsEnumValue:()=>g3,IsFunction:()=>kr,IsGeneric:()=>bf,IsIdentifier:()=>k3,IsImmutable:()=>Ql,IsInfer:()=>Dr,IsInteger:()=>mn,IsIntersect:()=>Te,IsKind:()=>Z,IsLiteral:()=>We,IsNever:()=>jo,IsNull:()=>Sa,IsNumber:()=>lr,IsObject:()=>Ie,IsOptional:()=>Lr,IsParameter:()=>D3,IsReadonly:()=>$c,IsRecord:()=>Ot,IsRef:()=>Tt,IsRefine:()=>gO,IsRest:()=>ap,IsSchema:()=>pr,IsString:()=>zr,IsSymbol:()=>_a,IsTemplateLiteral:()=>Gt,IsThis:()=>wO,IsTuple:()=>He,IsUndefined:()=>Rs,IsUnion:()=>Y,IsUnknown:()=>Mr,IsUnsafe:()=>cO,IsVoid:()=>zo,KeyOf:()=>T8,Literal:()=>qe,Lowercase:()=>U5,Mapped:()=>C8,Module:()=>h7,Never:()=>xt,NonNullable:()=>w8,Null:()=>Af,Number:()=>Ko,Object:()=>ge,Omit:()=>N8,Optional:()=>c3,Parameter:()=>Xl,Parameters:()=>M8,Partial:()=>F8,Pick:()=>K8,Readonly:()=>w3,ReadonlyObject:()=>vL,ReadonlyType:()=>V8,Record:()=>wf,RecordKey:()=>vf,RecordPattern:()=>Yr,RecordValue:()=>tr,Ref:()=>ln,Refine:()=>v3,Required:()=>p7,Rest:()=>td,ReturnType:()=>d7,Script:()=>S7,String:()=>Dn,Symbol:()=>Cf,TemplateLiteral:()=>I6,This:()=>UO,Tuple:()=>xr,Uncapitalize:()=>w5,Undefined:()=>Nf,Union:()=>we,Unknown:()=>Kr,Unsafe:()=>l3,Uppercase:()=>v5,Void:()=>vO,With:()=>hA});function Nt(e){throw new Error(`assertUnreachable: ${JSON.stringify(e,null,2)}`)}var _7="Must be a valid tags query: only tag:value searches (no wildcards), boolean operators, and parentheses are supported.";var $Ne=za(b7());var x7="lowercase-email",id="iana-timezone",FL="simple-time",$L="simple-date-time";var O7="lowercase-domain";var Qi="kebab-case";var A7="camel-case";var C7="upper-snake-case";var R7="http-url";var P7="^https://[^/?#@]*([/?#]|$)";var GNe="x-tsuga-internal",BNe=new Set;function D(e,t,r={}){let o=t.map(s=>{let a=s;return a.$id?(BNe.add(s),n.Ref(a.$id)):s}),i=t.flatMap(s=>{if(s[GNe]===!0)return[];let a=s.properties?.[e];return typeof a?.const=="string"?[a.const]:a?.enum?.filter(u=>typeof u=="string")??[]});return n.Unsafe({...r,type:"object",discriminator:{propertyName:e},required:[e],oneOf:o,...i.length>0&&{errorMessage:{discriminator:`value of tag "${e}" must be one of: ${i.join(", ")}`}}})}function he(e,t){return n.Object({values:n.Array(e,{...t.minItems!==void 0&&{minItems:t.minItems},...t.maxItems!==void 0&&{maxItems:t.maxItems},...t.uniqueItems&&{uniqueItems:!0},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:n.Optional(n.Boolean({description:"If true, exclude rows matching these values instead of including them"}))},{description:t.description})}function Ti(e,t={}){return D("type",[n.Object({type:n.Literal("ids"),ids:n.Array(p({allowEmpty:!1}),{minItems:1,uniqueItems:!0,...t.maxIds!==void 0&&{maxItems:t.maxIds}})}),n.Object({type:n.Literal("all"),filters:n.Optional(e)})])}function wo(e){return n.Object({value:p({allowEmpty:!1,description:e.valueDescription}),exclude:n.Optional(n.Boolean({description:"If true, exclude rows matching this value instead of including them"}))},{description:e.description})}var dp=1e3,EA=100,ye={limit:n.Optional(n.Integer({minimum:1,maximum:dp,description:"Maximum number of items to return in this page."})),offset:n.Optional(n.Integer({minimum:0,description:"Zero-based index of the first matching item to return. Increase it with `limit` to request later pages. If `limit` is provided without `offset`, the offset defaults to 0."}))},jNe=["asc","desc"],me=n.Enum(jNe,{description:"Sort direction: ascending or descending."}),Ye={...ye,limit:n.Optional(n.Integer({minimum:1,maximum:dp,default:EA,description:`Maximum number of items to return in this page. Omit to use the public API default of ${EA}.`}))},qNe=n.Object({totalCount:n.Integer({description:"Total number of items matching the query before `limit` and `offset` are applied."}),pageCount:n.Integer({description:"Total number of pages available for the requested `limit`."})},{description:"Counts describing the full result set that the returned page was taken from, for computing how many further pages remain."}),ukt=n.Object({pagination:qNe},{$id:"ResponseMetadata",description:"Metadata accompanying `data` on paginated operations, describing the full result set the page was taken from."});function Qe(e,t={}){return n.Optional(n.Union([n.Null(),e],t))}function U7(e){return{...e,method:"PUT"}}function v(e={}){return n.Unsafe({...e,type:"string"})}var Ei=250,HNe=1e4;function p({allowEmpty:e=!0,type:t="short",description:r,default:o}={}){let i=e?0:1,s={...r===void 0?{}:{description:r},...o===void 0?{}:{default:o}};switch(t){case"camel-case":return n.String({format:A7,minLength:i,maxLength:Ei,...s});case"kebab-case":return n.String({format:Qi,minLength:i,maxLength:Ei,...s});case"upper-snake-case":return n.String({format:C7,minLength:i,maxLength:Ei,...s});case"email":return n.String({format:x7,minLength:i,maxLength:254,errorMessage:{format:"Must be a valid lowercase email address."},...s});case"lowercase-domain":return n.String({format:O7,minLength:i,maxLength:Ei,...s});case"tsuga-query":return n.String({format:"tsuga-query",minLength:i,maxLength:HNe,...s});case"tags-query":return n.String({format:"tags-query",minLength:i,maxLength:1e4,errorMessage:{format:`${_7} The query you provided is invalid: \${0}`},...s});case"date-time":return n.String({format:"date-time",...s});case"uri":return n.String({format:"uri",pattern:P7,errorMessage:{pattern:"Must be an HTTPS URL without credentials (user:password@)."},...s});case"user-password":return n.String({format:"user-password",minLength:12,maxLength:Ei,...s});case"long":return n.String({minLength:i,maxLength:5e4,...s});case"short":return n.String({minLength:i,maxLength:Ei,...s});case"tsuga-formula":return n.String({format:"tsuga-formula",minLength:i,maxLength:Ei,errorMessage:{format:"Must be a simple mathematical formula, and all variables in it should refer to queries (q1, q2, etc.). The formula you provided is invalid: ${0}"},...s});case"time":return n.String({format:"time",...s});case"readonly-sql-query":return n.String({format:"readonly-sql-query",minLength:i,maxLength:5e4,errorMessage:{format:"Must be a readonly SQL query - only SELECT statements are allowed."},...s});default:Nt(t)}}var tT=["ingestion-api-key","operation-api-key","rum-public-token","dashboard","log-route","metric-route","monitor","notification-rule","notification-silence","slo","span-route"],TA=n.Array(n.Enum(tT,{description:"Tsuga-managed asset type."}),{description:"Tsuga-managed asset types covered by the policy. An empty array means all supported asset types."});var GL=["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","CLUSTER_DB_QUERY_CONNECTION_TIMEOUT","CLUSTER_DB_QUERY_CONNECTION_POOL_TIMEOUT"],Ikt=n.Enum(GL),KNe=["CLUSTER_AGGREGATION_BUCKET_LIMIT_EXCEEDED","CLUSTER_AGGREGATION_FORMULA","CLUSTER_AGGREGATION_INTERVAL_PARSE_ERROR","CLUSTER_AGGREGATION_PROMQL","CLUSTER_AGGREGATION_STRUCTURE","CLUSTER_AGGREGATION_SYNTAX"];var bkt=n.Object({code:n.Enum(GL),message:n.String()}),N7=[...GL,...KNe,"ABORT_ERROR","BAD_REQUEST","CUSTOM_ROLE_IN_USE","CUSTOM_ROLE_NAME_CONFLICT","DATA_DELETION_LIMIT_EXCEEDED","DATA_DELETION_REQUEST_NOT_ACTIVE","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"],k7=["INTERNAL_ERROR","INVALID_QUERY_TO_CLUSTER","CLUSTER_DB_QUERY_CONNECTION_POOL_TIMEOUT"];var zNe=["NETWORK_ERROR","RESPONSE_PARSE_ERROR"],YNe=[...N7,...k7,...zNe],VNe=n.Object({assetId:n.Optional(n.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:n.String({description:"Name of the asset that violated the policy. Set from submitted data or the existing asset row. Returned for every violation."}),assetType:n.Enum(tT,{description:"Type of Tsuga asset validated by the policy. Set by the route that ran tag-policy validation. Returned for every violation."}),tagPolicyId:n.String({description:"Identifier of the active tag policy that was violated. Generated by Tsuga when the policy is created. Returned for every violation."}),tagKey:n.String({description:"Tag key required or constrained by the violated policy. Set by the tag policy. Returned for every violation."}),message:n.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."}),WNe=D("type",[n.Object({type:n.Literal("invalid-syntax",{description:"Discriminator identifying a rule the grok parser could not parse at all."}),error:n.Object({offset:n.Integer({description:"Byte offset in the rule where parsing failed."}),detail:n.String({description:"Parser detail message."})},{description:"Position and parser message for the syntax failure."})},{$id:"GrokInvalidSyntax"}),n.Object({type:n.Literal("unknown-pattern",{description:"Discriminator identifying a rule that references a pattern name the grok engine does not provide."}),error:n.Object({offset:n.Integer({description:"Byte offset of the unknown pattern."}),unknownPattern:n.String({description:"The pattern name that is not supported."})},{description:"Position and name of the unsupported pattern."})},{$id:"GrokUnknownPattern"}),n.Object({type:n.Literal("invalid-filter",{description:"Discriminator identifying a rule whose filter is a known filter used incorrectly."}),error:n.Object({offset:n.Integer({description:"Byte offset of the invalid filter."}),invalidFilter:n.String({description:"The filter that is invalid."}),message:n.String({description:"Why the filter is invalid."})},{description:"Position, text, and reason for the invalid filter."})},{$id:"GrokInvalidFilter"}),n.Object({type:n.Literal("unknown-filter",{description:"Discriminator identifying a rule that references a filter name the grok engine does not implement."}),error:n.Object({offset:n.Integer({description:"Byte offset of the unknown filter."}),unknownFilter:n.String({description:"The filter name that is not implemented."}),message:n.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`."}),QNe=n.Object({rule:n.String({description:"The rule that failed to compile."}),ruleIndex:n.Integer({description:"0-based index of the failing rule in the submitted `rules` array."}),error:WNe},{description:"A single grok rule that failed to compile, with its position in the submitted rules and the structured compile error."}),L7=D("type",[n.Object({type:n.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:n.Array(VNe,{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"}),n.Object({type:n.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:n.Array(QNe,{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."}),BL={hint:n.Optional(n.String({description:"One next step that fixes the error, such as the field to change or how long to wait. Omitted when the code covers too many cases for one step, and the message then says what to change."})),docUrl:n.Optional(n.String({description:"Absolute URL of the public documentation section that explains this error and how to fix it."}))},xkt=n.Object({code:n.Optional(n.Enum(YNe,{description:"Machine readable error code describing what went wrong"})),message:n.String({description:"Human readable explanation of the error"}),statusCode:n.Number({description:"HTTP status code that was returned"}),details:n.Optional(L7),...BL},{$id:"ErrorResponse",description:"Standard envelope for API errors"}),Okt=n.Object({code:n.Optional(n.Enum(N7,{description:"Machine readable error code describing what went wrong"})),message:n.String({description:"Human readable explanation of the error"}),statusCode:n.Number({description:"HTTP status code that was returned"}),details:n.Optional(L7),...BL},{$id:"ClientErrorResponse",description:"Standard envelope for client (4XX) API errors"}),Akt=n.Object({code:n.Optional(n.Enum(k7,{description:"Machine readable error code describing what went wrong"})),message:n.String({description:"Human readable explanation of the error"}),statusCode:n.Number({description:"HTTP status code that was returned"}),...BL},{$id:"ServerErrorResponse",description:"Standard envelope for server (5XX) API errors"}),Ckt=n.Object({requestId:n.String({description:"Identifier used to trace the lifecycle of this API request"}),error:n.Ref("ClientErrorResponse")},{$id:"ClientErrorEnvelope",description:"Standard envelope wrapping all client (4XX) error responses"}),Rkt=n.Object({requestId:n.String({description:"Identifier used to trace the lifecycle of this API request"}),error:n.Ref("ServerErrorResponse")},{$id:"ServerErrorEnvelope",description:"Standard envelope wrapping all server (5XX) error responses"});var ZNe="x-tsuga-session-id",SA="x-tsuga-source",jL="x-tsuga-source-version",qL="x-tsuga-source-commit",HL="x-tsuga-source-date",KL="x-tsuga-rationale",XNe="x-tsuga-dashboard-id",JNe="x-tsuga-widget-id",e0e="x-tsuga-widget-slot",t0e="x-request-id",Ukt={[ZNe]:"Session identifier for request correlation",[SA]:"SDK or client source identifier (e.g., web-frontend, terraform-provider)",[jL]:"SDK version",[qL]:"SDK commit hash",[HL]:"SDK commit date",[KL]:"Optional caller-supplied rationale for this request, recorded for telemetry",[XNe]:"ID of the dashboard a query is issued from, when the request originates from a dashboard widget",[JNe]:"ID of the dashboard widget (graph) a query is issued from, when the request originates from a dashboard widget",[e0e]:"Identifies which of a multi-query widget's queries this request is for, such as `col-0` for the first column of a table",[t0e]:"Unique identifier for this API request, useful for debugging and support"};function f({body:e,description:t,method:r,operationId:o,params:i,tags:s,query:a,paginated:u,response:l,url:d}){return i?{buildUrl:y=>d.replace(/:[a-zA-Z_]+/g,E=>encodeURIComponent(y[E.slice(1)])),method:r,params:i,response:l,templateUrl:d,...e===void 0?{}:{body:e},...t===void 0?{}:{description:t},...o===void 0?{}:{operationId:o},...a===void 0?{}:{query:a},...u===void 0?{}:{paginated:u},...s===void 0?{}:{tags:s}}:{method:r,response:l,url:d,templateUrl:d,...e===void 0?{}:{body:e},...t===void 0?{}:{description:t},...o===void 0?{}:{operationId:o},...a===void 0?{}:{query:a},...u===void 0?{}:{paginated:u},...s===void 0?{}:{tags:s}}}function M7(e,t){if(!t||typeof t!="object")return e;let r=new URLSearchParams;return Object.entries(t).forEach(([o,i])=>{Array.isArray(i)?i.length>0&&i.forEach(s=>{s!==void 0&&(typeof s=="string"||typeof s=="number"||typeof s=="boolean")&&r.append(o,String(s))}):(typeof i=="boolean"||typeof i=="string"||typeof i=="number")&&r.append(o,String(i))}),`${e}?${r.toString()}`}var pe="context";var mp="trace_id",_A=`${pe}.team`,Bkt=`${pe}.env`,jkt=`${pe}.api_key_id`,IA=`${pe}.service.name`,qkt=`${pe}.service.namespace`,Hkt=`${pe}.service.version`,bA=`${pe}.span.kind`,xA=`${pe}.span.name`,fp=`${pe}.status.code`,Kkt=`${pe}.stack_trace`,r0e="STATUS_CODE_ERROR",zkt=`${fp}:${r0e}`,zL="resource.attributes.team",D7=["SPAN_KIND_UNSPECIFIED","SPAN_KIND_INTERNAL","SPAN_KIND_SERVER","SPAN_KIND_CLIENT","SPAN_KIND_PRODUCER","SPAN_KIND_CONSUMER"];var gp="span_id",sd="parent_span_id",rT="service.version",Ca="process.exit.code",nT="process.runtime.version",oT="os.type",ad="error.type",OA="http.response.status_code",iT="cli.command",sT="cli.duration_ms",AA="cli.error.code",Hf="cli.flags",aT="cli.output_format",cT="cli.caller",F7="cli.auth.method",$7="cli.has_config_file",CA="cli.signal",G7="cli.query.data_source",B7="cli.query.type",j7="cli.query.time_range_seconds",YL="cli.query.has_filter",q7="cli.query.group_by_count",H7="cli.query.result_count",K7="cli.query.series_count",z7="cli.query.datapoint_count",Y7="cli.docs.search_result_count",V7="cli.docs.path",W7="cli.docs.search_query",RA="cli.agent.session.id",PA=`${pe}.host.name`,Ykt=`${pe}.telemetry.sdk.language`,Vkt=`${pe}.scope.name`,Wkt=`${pe}.page.id`,Qkt=`${pe}.app.name`,Zkt=`${pe}.page.attributes.view_id`,Xkt=`${pe}.session.id`,Jkt=`${pe}.cloud.provider`,eLt=`${pe}.cloud.platform`,tLt=`${pe}.aws.ecs.task.arn`,rLt=`${pe}.aws.ecs.task.id`,nLt=`${pe}.aws.ecs.task.family`,oLt=`${pe}.aws.ecs.cluster.arn`,iLt=`${pe}.faas.name`,sLt=`${pe}.faas.invoked_provider`,aLt=`${pe}.gcp.label.service_name`,cLt=`${pe}.k8s.cluster.name`,uLt=`${pe}.k8s.cluster.uid`,pLt=`${pe}.k8s.namespace.name`,n0e=`${pe}.k8s.pod.name`,lLt=`${pe}.k8s.pod.uid`,dLt=`${pe}.k8s.container.name`,mLt=`${pe}.k8s.node.name`,fLt=`${pe}.k8s.node.uid`,o0e=`${pe}.k8s.deployment.name`,gLt=`${pe}.k8s.deployment.uid`,i0e=`${pe}.k8s.replicaset.name`,hLt=`${pe}.k8s.replicaset.uid`,s0e=`${pe}.k8s.statefulset.name`,yLt=`${pe}.k8s.statefulset.uid`,a0e=`${pe}.k8s.daemonset.name`,ELt=`${pe}.k8s.daemonset.uid`,TLt=`${pe}.k8s.job.name`,SLt=`${pe}.k8s.job.uid`,_Lt=`${pe}.k8s.cronjob.name`,ILt=`${pe}.k8s.cronjob.uid`,Kf="status_code",UA="span.name";var wA="span.kind";var c0e="db.system.name",u0e="db.system",p0e="db.namespace",l0e="db.name";var bLt=`span_attributes.${p0e}`,xLt=`span_attributes.${l0e}`,OLt=`span_attributes.${c0e}`,ALt=`span_attributes.${u0e}`;var d0e="messaging.system",m0e="messaging.destination.name";var CLt=`span_attributes.${d0e}`;var f0e="messaging.consumer.group.name",RLt=`span_attributes.${m0e}`,PLt=`span_attributes.${f0e}`;var ULt={name:"tsuga.internal.processing_tag_policy_violations_total",attributes:{tagPolicyId:`${pe}.tag_policy_id`,dataSource:`${pe}.data_source`,sourceTeam:`${pe}.source_team`}};var wLt={name:"tsuga.internal.event_size_bytes",attributes:{batchKind:`${pe}.batch_kind`,batchKindMetricsFilter:`${pe}.batch_kind:metrics`,sourceApiKeyId:`${pe}.source_api_key_id`,sourceEnv:`${pe}.source_env`,sourceTeam:`${pe}.source_team`}};var VL="traces.span.metrics.calls",WL="traces.span.metrics.duration",QL="__tsuga_metadata__",vLt=`${QL}.signature`,NLt=`${QL}.routes`,kLt=`${QL}.trace_id_bucket`;var g0e=Math.pow(10,8)*24*60*60*1e3,MLt=-g0e;var Q7=864e5,Z7=6e4,X7=36e5;var h0e=3600;var J7=h0e*24,DLt=J7*7,y0e=J7*365.2425,E0e=y0e/12,FLt=E0e*3,ZL=Symbol.for("constructDateFrom");function Ps(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&ZL in e?e[ZL](t):e instanceof Date?new e.constructor(t):new Date(t)}function Vr(e,t){return Ps(t||e,e)}function eZ(e,t,r){let o=Vr(e,r?.in);return isNaN(t)?Ps(r?.in||e,NaN):(t&&o.setDate(o.getDate()+t),o)}function tZ(e,t,r){let o=Vr(e,r?.in);if(isNaN(t))return Ps(r?.in||e,NaN);if(!t)return o;let i=o.getDate(),s=Ps(r?.in||e,o.getTime());s.setMonth(o.getMonth()+t+1,0);let a=s.getDate();return i>=a?s:(o.setFullYear(s.getFullYear(),s.getMonth(),i),o)}function zf(e,t,r){let{years:o=0,months:i=0,weeks:s=0,days:a=0,hours:u=0,minutes:l=0,seconds:d=0}=t,g=Vr(e,r?.in),y=i||o?tZ(g,i+o*12):g,E=a||s?eZ(y,a+s*7):y,h=l+u*60,_=(d+h*60)*1e3;return Ps(r?.in||e,+E+_)}var T0e={};function rZ(){return T0e}function XL(e){let t=Vr(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function Eo(e,...t){let r=Ps.bind(null,e||t.find(o=>typeof o=="object"));return t.map(r)}function JL(e,t){let r=Vr(e,t?.in);return r.setHours(0,0,0,0),r}function nZ(e,t,r){let[o,i]=Eo(r?.in,e,t),s=JL(o),a=JL(i),u=+s-XL(s),l=+a-XL(a);return Math.round((u-l)/Q7)}function cd(e,t){let r=+Vr(e)-+Vr(t);return r<0?-1:r>0?1:r}function oZ(e,t,r){let[o,i]=Eo(r?.in,e,t),s=o.getFullYear()-i.getFullYear(),a=o.getMonth()-i.getMonth();return s*12+a}function iZ(e,t,r){let[o,i]=Eo(r?.in,e,t);return o.getFullYear()-i.getFullYear()}function aZ(e,t,r){let[o,i]=Eo(r?.in,e,t),s=sZ(o,i),a=Math.abs(nZ(o,i));o.setDate(o.getDate()-s*a);let u=+(sZ(o,i)===-s),l=s*(a-u);return l===0?0:l}function sZ(e,t){let r=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return r<0?-1:r>0?1:r}function Yf(e){return t=>{let o=(e?Math[e]:Math.trunc)(t);return o===0?0:o}}function cZ(e,t,r){let[o,i]=Eo(r?.in,e,t),s=(+o-+i)/X7;return Yf(r?.roundingMethod)(s)}function vA(e,t){return+Vr(e)-+Vr(t)}function uZ(e,t,r){let o=vA(e,t)/Z7;return Yf(r?.roundingMethod)(o)}function pZ(e,t){let r=Vr(e,t?.in);return r.setHours(23,59,59,999),r}function lZ(e,t){let r=Vr(e,t?.in),o=r.getMonth();return r.setFullYear(r.getFullYear(),o+1,0),r.setHours(23,59,59,999),r}function dZ(e,t){let r=Vr(e,t?.in);return+pZ(r,t)==+lZ(r,t)}function mZ(e,t,r){let[o,i,s]=Eo(r?.in,e,e,t),a=cd(i,s),u=Math.abs(oZ(i,s));if(u<1)return 0;i.getMonth()===1&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-a*u);let l=cd(i,s)===-a;dZ(o)&&u===1&&cd(o,s)===1&&(l=!1);let d=a*(u-+l);return d===0?0:d}function fZ(e,t,r){let o=vA(e,t)/1e3;return Yf(r?.roundingMethod)(o)}function gZ(e,t,r){let[o,i]=Eo(r?.in,e,t),s=cd(o,i),a=Math.abs(iZ(o,i));o.setFullYear(1584),i.setFullYear(1584);let u=cd(o,i)===-s,l=s*(a-+u);return l===0?0:l}function hZ(e,t){let[r,o]=Eo(e,t.start,t.end);return{start:r,end:o}}var S0e={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},yZ=(e,t,r)=>{let o,i=S0e[e];return typeof i=="string"?o=i:t===1?o=i.one:o=i.other.replace("{{count}}",t.toString()),r?.addSuffix?r.comparison&&r.comparison>0?"in "+o:o+" ago":o};function NA(e){return(t={})=>{let r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}var _0e={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},I0e={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},b0e={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},EZ={date:NA({formats:_0e,defaultWidth:"full"}),time:NA({formats:I0e,defaultWidth:"full"}),dateTime:NA({formats:b0e,defaultWidth:"full"})};var x0e={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},TZ=(e,t,r,o)=>x0e[e];function Vf(e){return(t,r)=>{let o=r?.context?String(r.context):"standalone",i;if(o==="formatting"&&e.formattingValues){let a=e.defaultFormattingWidth||e.defaultWidth,u=r?.width?String(r.width):a;i=e.formattingValues[u]||e.formattingValues[a]}else{let a=e.defaultWidth,u=r?.width?String(r.width):e.defaultWidth;i=e.values[u]||e.values[a]}let s=e.argumentCallback?e.argumentCallback(t):t;return i[s]}}var O0e={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},A0e={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},C0e={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},R0e={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},P0e={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},U0e={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},w0e=(e,t)=>{let r=Number(e),o=r%100;if(o>20||o<10)switch(o%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},SZ={ordinalNumber:w0e,era:Vf({values:O0e,defaultWidth:"wide"}),quarter:Vf({values:A0e,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Vf({values:C0e,defaultWidth:"wide"}),day:Vf({values:R0e,defaultWidth:"wide"}),dayPeriod:Vf({values:P0e,defaultWidth:"wide",formattingValues:U0e,defaultFormattingWidth:"wide"})};function Wf(e){return(t,r={})=>{let o=r.width,i=o&&e.matchPatterns[o]||e.matchPatterns[e.defaultMatchWidth],s=t.match(i);if(!s)return null;let a=s[0],u=o&&e.parsePatterns[o]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(u)?N0e(u,y=>y.test(a)):v0e(u,y=>y.test(a)),d;d=e.valueCallback?e.valueCallback(l):l,d=r.valueCallback?r.valueCallback(d):d;let g=t.slice(a.length);return{value:d,rest:g}}}function v0e(e,t){for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function N0e(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}function _Z(e){return(t,r={})=>{let o=t.match(e.matchPattern);if(!o)return null;let i=o[0],s=t.match(e.parsePattern);if(!s)return null;let a=e.valueCallback?e.valueCallback(s[0]):s[0];a=r.valueCallback?r.valueCallback(a):a;let u=t.slice(i.length);return{value:a,rest:u}}}var k0e=/^(\d+)(th|st|nd|rd)?/i,L0e=/\d+/i,M0e={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},D0e={any:[/^b/i,/^(a|c)/i]},F0e={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},$0e={any:[/1/i,/2/i,/3/i,/4/i]},G0e={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},B0e={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},j0e={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},q0e={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},H0e={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},K0e={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},IZ={ordinalNumber:_Z({matchPattern:k0e,parsePattern:L0e,valueCallback:e=>parseInt(e,10)}),era:Wf({matchPatterns:M0e,defaultMatchWidth:"wide",parsePatterns:D0e,defaultParseWidth:"any"}),quarter:Wf({matchPatterns:F0e,defaultMatchWidth:"wide",parsePatterns:$0e,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Wf({matchPatterns:G0e,defaultMatchWidth:"wide",parsePatterns:B0e,defaultParseWidth:"any"}),day:Wf({matchPatterns:j0e,defaultMatchWidth:"wide",parsePatterns:q0e,defaultParseWidth:"any"}),dayPeriod:Wf({matchPatterns:H0e,defaultMatchWidth:"any",parsePatterns:K0e,defaultParseWidth:"any"})};var eM={code:"en-US",formatDistance:yZ,formatLong:EZ,formatRelative:TZ,localize:SZ,match:IZ,options:{weekStartsOn:0,firstWeekContainsDate:1}};var z0e=["years","months","weeks","days","hours","minutes","seconds"];function bZ(e,t){let r=rZ(),o=t?.locale??r.locale??eM,i=t?.format??z0e,s=t?.zero??!1,a=t?.delimiter??" ";return o.formatDistance?i.reduce((l,d)=>{let g=`x${d.replace(/(^.)/,E=>E.toUpperCase())}`,y=e[d];return y!==void 0&&(s||e[d])?l.concat(o.formatDistance(g,y)):l},[]).join(a):""}function xZ(e,t){let{start:r,end:o}=hZ(t?.in,e),i={},s=gZ(o,r);s&&(i.years=s);let a=zf(r,{years:i.years}),u=mZ(o,a);u&&(i.months=u);let l=zf(a,{months:i.months}),d=aZ(o,l);d&&(i.days=d);let g=zf(l,{days:i.days}),y=cZ(o,g);y&&(i.hours=y);let E=zf(g,{hours:i.hours}),h=uZ(o,E);h&&(i.minutes=h);let T=zf(E,{minutes:i.minutes}),_=fZ(o,T);return _&&(i.seconds=_),i}var LDt=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 KDt=60*1e3;var CFt=1/1e6,ud=1e3,pd=60*ud,rM=60*pd,Ra=24*rM,RFt=7*Ra,PFt=30*Ra;var LA=86400;var nM=["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-15-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 X0e={s:1,m:60,h:3600,d:86400,w:604800};function J0e(e){let t=X0e[e.at(-1)??""],r=e.slice(0,-1);return t&&r.length>0&&AZ(r)?parseInt(r,10)*t:void 0}function AZ(e){for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r<48||r>57)return!1}return!0}function eke(){return Math.floor(Date.now()/1e3)}function MA(e,t=eke()){if(typeof e=="number")return e;if(e==="now")return t;if(e.startsWith("-")){let o=J0e(e.slice(1));if(o!==void 0)return t-o}if(AZ(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.`)}var tke=`/${"v1"}/cli-runs`,rke=["json","tsv","csv","pretty","text"],nke=["claude-code","codex","opencode","gemini-cli","cline","agent","ci","terminal","script"],DA=["SIGINT","SIGTERM"],iM=32,sM=100,aM=64,Qf=4096,oM="^(?!0+$)[0-9a-f]{16}$",oke=n.Object({name:n.String({minLength:1,maxLength:200}),kind:n.Enum(["internal","server","client","producer","consumer"]),[gp]:n.String({pattern:oM}),[sd]:n.String({pattern:oM,description:"The run span for a span the CLI started at its top level."}),start_offset_ms:n.Number({minimum:0,maximum:Ra,description:"Start of the span, from the start of the run."}),duration_ms:n.Number({minimum:0,maximum:Ra}),status_code:n.Enum(["unset","error"]),attributes:n.Record(n.String({maxLength:200}),n.Union([n.String({maxLength:Qf}),n.Number(),n.Boolean()]),{maxProperties:aM})}),CZ=n.Object({[rT]:n.String({pattern:"^[0-9A-Za-z.+-]{1,40}$",description:"Version of the CLI that ran."}),[iT]:n.String({pattern:"^[a-z0-9 -]{0,120}$",description:"Command path without its arguments, e.g. `monitors list`."}),[sT]:n.Integer({minimum:0,maximum:Ra,description:"Run duration."}),[Ca]:n.Integer({minimum:0,maximum:255,description:"Process exit code."}),[ad]:n.Optional(n.String({pattern:"^[A-Za-z]{1,64}$",description:"Kind of failure, e.g. `TransportError`."})),[OA]:n.Optional(n.Integer({minimum:100,maximum:599,description:"HTTP status of the API response that failed the run, when the API answered."})),[AA]:n.Optional(n.String({pattern:"^[A-Z0-9_]{1,64}$",description:"Machine-readable code of the API error that failed the run, e.g. `RESOURCE_NOT_FOUND`."})),[Hf]:n.Optional(n.Array(n.String({maxLength:Qf}),{maxItems:iM,description:"Command-line arguments from the first flag on, with their values, e.g. `--query`, `level:ERROR`."})),[aT]:n.Optional(n.Enum(rke,{description:"`pretty` when `--pretty` was passed. Older CLI versions report the `-o` value."})),[cT]:n.Optional(n.Enum(nke,{description:"What ran the command: a known coding agent (from the environment variable it sets), `agent` (another agent that sets `AGENT` or `AI_AGENT`), `ci` (`CI` was set), `terminal` (a person at an interactive terminal), or `script` (anything else)."})),[RA]:n.Optional(n.String({pattern:"^[0-9a-f]{64}$",description:"Stable hash of a coding agent session ID, when one is available."})),[CA]:n.Optional(n.Enum(DA,{description:"Signal that interrupted the run."})),[oT]:n.String({pattern:"^[a-z0-9]{1,20}$",description:"e.g. `darwin`."}),[nT]:n.String({pattern:"^[0-9.]{1,20}$",description:"e.g. `24.1.0`."}),[mp]:n.String({pattern:"^(?!0+$)[0-9a-f]{32}$",description:"W3C trace ID the CLI sent with its API calls during the run."}),[gp]:n.String({pattern:oM,description:"W3C span ID of the run span, the parent of the spans the CLI started at its top level."}),spans:n.Optional(n.Array(oke,{maxItems:sM,description:"Spans the CLI recorded during the run, API calls included."}))}),ike={[rT]:"1.40.0",[iT]:"monitors list",[sT]:412,[Ca]:0,[Hf]:["--fields","name","-o","tsv"],[aT]:"tsv",[cT]:"terminal",[oT]:"darwin",[nT]:"24.1.0",[mp]:"4bf92f3577b34da6a3ce929d0e0e4736",[gp]:"00f067aa0ba902b7"};Object.assign(CZ,{examples:[ike]});var RZ=n.Object({id:n.String({description:"API request ID the run was recorded under."})},{description:"Acknowledgement of a recorded CLI run"});Object.assign(RZ,{examples:[{id:"request-123-abc"}]});var PZ=f({description:"Record one Tsuga CLI run, sent only by CLIs that opted in with `TSUGA_TELEMETRY=1`. Unauthenticated, so that runs which failed before or during authentication are recorded too.",tags:["private"],url:tke,method:"POST",body:CZ,response:RZ});function cM(e,t){if(e!==null&&typeof e=="object"&&Object.hasOwn(e,t))return e[t];let r=e;for(let o of t.split(".")){if(r===null||typeof r!="object"||!Object.hasOwn(r,o))return;r=r[o]}return r}function uM(e,t){let r=Object.create(null);for(let o of t){let i=cM(e,o);if(i===void 0)continue;if(Object.hasOwn(e,o)){r[o]=i;continue}let s=o.split("."),a=s.pop();if(a===void 0)continue;let u=r;for(let l of s)(typeof u[l]!="object"||u[l]===null)&&(u[l]=Object.create(null)),u=u[l];u[a]=i}return r}var Zf=class extends Fe("OAuthTokenError"){},Pa=class extends Fe("TransportError"){},Xf=class extends Fe("ResponseDecodeError"){},jc=class extends Fe("LoginFailed"){},Jf=class extends Fe("ConfigCorrupted"){},eg=class extends Fe("ConfigUnreadable"){},hp=class extends Fe("NoCredentials"){},ld=class extends Fe("SessionExpired"){},tg=class extends Fe("KeychainUnwritable"){},dd=class extends Fe("ExternalCommandError"){},qc=class extends Fe("UntrustedApiUrl"){},rg=class extends Fe("FieldsNotFound"){},yp=class extends Fe("NonJsonResponse"){},Us=class e extends Fe("ApiError"){static fromErrorResponse(t,r){return new e({message:t.message,...t.statusCode===void 0?{}:{statusCode:t.statusCode},...t.code===void 0?{}:{code:t.code},...r===void 0?{}:{requestId:r},...t.details===void 0?{}:{details:t.details},...t.suggestions===void 0?{}:{suggestions:t.suggestions}})}};function md(e){return ske()?`\x1B[2m${e}\x1B[0m`:e}function ske(){return process.stdout.isTTY&&!process.env.NO_COLOR}var ake=120;function UZ(){return process.stdout.columns||ake}var wZ=" ",cke=8,uke=3,vZ=/\u001b\[[0-9;]*m/g;function NZ(e){return e.map(t=>({header:t,value:t}))}function kZ(e,t,r){let o=t.map(a=>{let u=e.map(l=>fke(l,a));return{column:a,cells:u,width:Math.max(a.header.length,...u.map(pM))}});r.truncate&&pke(o,r.width);let i=a=>o.map((u,l)=>lke(mke(a[l]??"",u.width),u.width,u.column.align??"left")).join(wZ).trimEnd();return[i(o.map(a=>md(a.column.header.toUpperCase()))),...e.map((a,u)=>i(o.map(l=>l.cells[u]??"")))].join(`
271
271
  `)}function pke(e,t){let r=()=>e.reduce((o,i)=>o+i.width,0)+wZ.length*(e.length-1);for(;r()>t;){let i=e.filter(s=>(s.column.priority??1)>0&&s.width>cke).sort((s,a)=>(a.column.priority??1)-(s.column.priority??1)||a.width-s.width)[0];if(!i)return;i.width-=1}}function lke(e,t,r){let o=" ".repeat(Math.max(0,t-pM(e)));return r==="right"?`${o}${e}`:`${e}${o}`}var dke=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/;function mke(e,t){return pM(e)<=t?e:`${e.replace(vZ,"").slice(0,Math.max(0,t-1))}\u2026`}function pM(e){return e.replace(vZ,"").length}function fke(e,t){let r=typeof t.value=="function"?t.value(e):cM(e,t.value);return t.format?t.format(r):LZ(r)}function LZ(e){if(e==null||e==="")return md("-");if(typeof e=="boolean")return e?"yes":"no";if(typeof e=="string")return dke.test(e)?gke(e):e;if(typeof e=="number"||typeof e=="bigint")return String(e);if(Array.isArray(e)){if(e.length===0)return md("-");let t=e.slice(0,uke).map(o=>LZ(o)),r=e.length-t.length;return r>0?`${t.join(", ")} ${md(`+${r} more`)}`:t.join(", ")}return typeof e=="object"?md(`{${Object.keys(e).length} keys}`):md("-")}function gke(e){let t=Date.parse(e);if(Number.isNaN(t))return e;let r=Fm(Es(t));return`${`${r.getFullYear()}-${FA(r.getMonth()+1)}-${FA(r.getDate())}`} ${FA(r.getHours())}:${FA(r.getMinutes())}`}function FA(e){return String(e).padStart(2,"0")}var $A=Ee("common-cli/OutputFields",{defaultValue:()=>{}}),pT=Ee("common-cli/StdoutIsTTY",{defaultValue:()=>process.stdout.isTTY}),lM=Ee("common-cli/IsInteractive",{defaultValue:()=>!process.env.CI&&process.stdin.isTTY&&process.stdout.isTTY&&process.stderr.isTTY}),$e=e=>jr(e),Si=k(function*(e,t){yield*jr(JSON.stringify(yield*MZ(e,t),null,2))}),Oe=k(function*(e,t){yield*jr(JSON.stringify({...e,data:yield*MZ(e.data,t)},null,2))}),MZ=k(function*(e,t){let r=t??(yield*$A);if(r===void 0||!uT(e))return e;let o=Array.isArray(e)?e.map(i=>uT(i)?uM(i,r):i):uM(e,r);return hke(e,o)?yield*new rg({message:`--fields ${r.join(",")} selected nothing from the response. Top-level fields: ${yke(e).join(", ")}`,suggestions:["Pick paths from the fields listed above, with dots for nested fields","For any other shape, omit --fields and pipe the JSON to jq"]}):o});function hke(e,t){if(!Array.isArray(e))return Object.keys(t).length===0;let r=t;return e.some(uT)&&r.every(o=>!uT(o)||Object.keys(o).length===0)}function yke(e){let t=Array.isArray(e)?e.find(uT):e;return t===void 0?[]:Object.keys(t).sort()}function uT(e){return e!==null&&typeof e=="object"}var DZ=k(function*(e,t){if(e.length===0){yield*Xn("No results.");return}let r=t.fields??(yield*$A),o={truncate:yield*pT,width:UZ()};yield*$e(r===void 0&&t.prettyFormat!==void 0?t.prettyFormat(e,o):kZ(e,NZ(r??t.defaultFields),o))}),Xn=e=>Jm(e);function dM(e,t=r=>{process.exit(r)}){e.on("error",r=>{if(r.code==="EPIPE"){t(process.exitCode);return}throw r})}var B=n.Object({success:n.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 mM="tsuga-cli";var fd="/v0/oauth",FZ=f({description:"OAuth 2.1 authorization endpoint: validates the client and redirect URI, then redirects to the consent page",url:`${fd}/authorize`,method:"GET",query:n.Partial(n.Object({response_type:n.String({description:"Must be `code`"}),client_id:n.String({description:"First-party client id or CIMD document URL"}),redirect_uri:n.String({description:"Client redirect URI"}),code_challenge:n.String({description:"PKCE code challenge"}),code_challenge_method:n.String({description:"Must be `S256`"}),state:n.String({description:"Opaque client state, echoed back"}),resource:n.String({description:"RFC 8707 resource indicator"})})),response:n.Object({},{description:"Never returned: this endpoint redirects (302) or renders an HTML error (400)"})}),$Z=f({description:"OAuth 2.1 token endpoint: exchanges an authorization code (PKCE) or refresh token for a token pair",url:`${fd}/token`,method:"POST",body:n.Partial(n.Object({grant_type:n.String({description:"`authorization_code` or `refresh_token`"}),code:n.String({description:"Authorization code being exchanged"}),code_verifier:n.String({description:"PKCE code verifier"}),redirect_uri:n.String({description:"Must match the redirect URI used on /authorize"}),client_id:n.String({description:"Client id, when sent by the client"}),refresh_token:n.String({description:"Refresh token, for `grant_type=refresh_token`"})})),response:n.Object({access_token:n.String(),token_type:n.Literal("Bearer"),expires_in:n.Number({description:"Access token lifetime in seconds"}),refresh_token:n.String()})}),t$t=f({description:"Resolve a signed authorization request handle for the consent page",url:`${fd}/authorization-request`,method:"GET",query:n.Object({handle:n.String()}),response:n.Object({clientId:n.String(),clientName:n.String(),redirectUri:n.String()})}),r$t=f({description:"Approve or deny an OAuth authorization request from the consent page",url:`${fd}/approve`,method:"POST",body:n.Object({handle:n.String({description:"The signed authorization request handle"}),approve:n.Boolean()}),response:n.Object({redirectTo:n.String({description:"The client's redirect URI carrying either the code or the denial"})})}),n$t=f({description:"Validate an OAuth access token (internal, for the MCP resource server)",url:`${fd}/introspect`,method:"POST",body:n.Object({token:n.String()}),response:n.Object({active:n.Boolean(),userId:n.Optional(n.String()),orgId:n.Optional(n.String())})}),Eke=["pending","active","revoked"],Tke=n.Object({id:n.String(),createdAt:v(),clientId:n.String({description:"Client ID Metadata Document URL or first-party client id"}),clientName:n.String({description:"Display name derived from the client identity"}),userId:n.String(),status:n.Enum(Eke),lastUsedAt:n.Optional(v())}),o$t=f({tags:["oauth"],description:"List OAuth grants: your own, or all users for admins",url:`${fd}/grants`,method:"GET",query:n.Object({allUsers:n.Optional(n.Boolean({description:"Admins only: list grants of every user in the org"}))}),response:n.Array(Tke)}),i$t=f({tags:["oauth"],description:"Delete an OAuth grant (own grant, or any grant for admins)",url:`${fd}/grants/:id`,method:"DELETE",params:n.Object({id:n.String()}),response:B});function GZ(e,t,r){let o=new URL(FZ.url,t);return o.search=new URLSearchParams({response_type:"code",client_id:e,redirect_uri:r.redirectUri,code_challenge:r.challenge,code_challenge_method:"S256",state:r.state}).toString(),o.href}var Ske=pn({access_token:bt(Se),refresh_token:bt(Se),expires_in:bt(Nc),error:bt(Se),error_description:bt(Se)}),_ke=Go(Ske),BZ=k(function*(e){let t=yield*Yl,r=N("oauth.token")(function*(o,i){let s=yield*t.post(new URL($Z.url,o).href,{headers:{Accept:"application/json"},body:_k(i,"application/x-www-form-urlencoded")}).pipe(st(l=>new Pa({message:`OAuth token request failed (${l.message})`,cause:l}))),a=yield*s.json.pipe(q(_ke),pi(()=>({})));if(s.status!==200){let l=a.error??`HTTP ${s.status}`;return yield*new Zf({message:`OAuth token request failed (${l}${a.error_description?`: ${a.error_description}`:""})`,code:l})}if(!a.access_token||!a.refresh_token||a.expires_in===void 0)return yield*new Xf({message:"OAuth token response was missing required fields"});let u=yield*Kn;return{accessToken:a.access_token,refreshToken:a.refresh_token,expiresAt:Fm(Es(u+a.expires_in*ud))}});return{exchangeCode:N("oauth.exchangeCode")(function*(o,i){return yield*r(o,{grant_type:"authorization_code",client_id:e,code:i.code,code_verifier:i.verifier,redirect_uri:i.redirectUri})}),refreshTokens:N("oauth.refreshTokens")(function*(o,i){return yield*r(o,{grant_type:"refresh_token",client_id:e,refresh_token:i})})}});function jZ(e,t){return GZ(mM,e,t)}var Ep=class extends it()("cli/OAuth",{make:BZ(mM)}){static layer=Do(this,this.make)};var qZ=require("node:fs");var GA=k(function*(e,t={}){let r=yield*aa;return k(function*(o,i){let s=yield*Hi(e,o,{...t.env===void 0?{}:{env:t.env},...i===void 0?{}:{stdin:{stream:dH(new TextEncoder().encode(i))}}}),{stdout:a,stderr:u,status:l}=yield*ds({stdout:s.stdout.pipe(bl,xl),stderr:s.stderr.pipe(bl,xl),status:s.exitCode},{concurrency:"unbounded"});return{status:Number(l),stdout:a,stderr:u}},co,$i(aa,r),pi(()=>({status:1,stdout:"",stderr:`${e} did not run`})))});var HZ="/usr/bin/security",Ike=44;function bke(e){return e===0||e===Ike}function fM(){return process.platform==="darwin"&&gM(HZ)}function gM(e){try{return(0,qZ.lstatSync)(e).isFile()}catch{return!1}}function xke(e,t){return["find-generic-password","-s",e,"-a",t,"-w"]}function Oke(e,t){return["delete-generic-password","-s",e,"-a",t]}function Ake(e,t,r){let o=Buffer.from(r,"utf-8").toString("hex");return`add-generic-password -U -s ${e} -a ${t} -X ${o}
272
272
  `}var KZ=k(function*(e){let t=yield*GA(HZ,{env:{}}),r=k(function*(o){if(!fM())return;let{status:i,stdout:s}=yield*t(xke(e,o));return i===0&&s.trim()||void 0});return{location:"the macOS Keychain",read:r,save:N("keychain.save")(function*(o,i){return fM()?(yield*t(["-i"],Ake(e,o,i))).status===0:!1}),remove:N("keychain.remove")(function*(o){if(!fM())return!0;let{status:i}=yield*t(Oke(e,o));return bke(i)?(yield*r(o))===void 0:!1})}});var Zi=e=>eE(e).pipe(Fl(t=>t.trim()||void 0),l0(void 0));var zZ="/usr/bin/secret-tool",Cke=tf({DBUS_SESSION_BUS_ADDRESS:Zi("DBUS_SESSION_BUS_ADDRESS"),XDG_RUNTIME_DIR:Zi("XDG_RUNTIME_DIR")}).pipe(Fl(e=>Object.fromEntries(Object.entries(e).flatMap(([t,r])=>r===void 0?[]:[[t,r]]))));function Rke(e){return["lookup","service",e.service,"account",e.account]}function Pke(e,t){return["store","--label",t,"service",e.service,"account",e.account]}function Uke(e){return["clear","service",e.service,"account",e.account]}function wke(e){return["search","--all","service",e.service,"account",e.account]}function vke(e){return e.status===0&&e.stdout.trim()===""}function hM(){return process.platform==="linux"&&gM(zZ)}var YZ=k(function*({service:e,label:t}){let r=yield*Cke.pipe(pi(()=>({}))),o=yield*GA(zZ,{env:r});return{location:"the login keyring",read:k(function*(s){if(!hM())return;let{status:a,stdout:u}=yield*o(Rke({service:e,account:s}));return a===0&&u.trim()||void 0}),save:N("secretTool.save")(function*(s,a){return hM()?(yield*o(Pke({service:e,account:s},t),a)).status===0:!1}),remove:N("secretTool.remove")(function*(s){return hM()?(yield*o(Uke({service:e,account:s})),vke(yield*o(wke({service:e,account:s})))):!0})}});var VZ=require("node:os");var At=class extends Fe("RequestBodyError"){},Gn=class extends Fe("LocalFileError"){},gd=class extends Fe("InvalidLink"){},lT=class extends Fe("SessionCorrupted"){},Nke=[Us,Jf,eg,dd,rg,gd,tg,Gn,jc,hp,yp,Zf,At,Xf,lT,ld,Pa,qc],Rr={success:0,failure:1,usage:2,auth:3,api:4,network:5,localState:6},kke={ApiError:Rr.api,ConfigCorrupted:Rr.localState,ConfigUnreadable:Rr.localState,ExternalCommandError:Rr.failure,FieldsNotFound:Rr.usage,InvalidLink:Rr.usage,KeychainUnwritable:Rr.localState,LocalFileError:Rr.localState,LoginFailed:Rr.auth,NoCredentials:Rr.auth,NonJsonResponse:Rr.network,OAuthTokenError:Rr.auth,RequestBodyError:Rr.usage,ResponseDecodeError:Rr.network,SessionCorrupted:Rr.auth,SessionExpired:Rr.auth,TransportError:Rr.network,UntrustedApiUrl:Rr.usage};function BA(e){return kke[e._tag]}function jA(e){return 128+VZ.constants.signals[e??"SIGINT"]}function qA(e){return Nke.some(t=>e instanceof t)}function HA(e){return Tx(e)&&e._tag==="ShowHelp"}var KA=["Sign in with your browser: tsuga auth login","Save an operation API key: tsuga auth operation-key <OPERATION_API_KEY>"];function WZ(e){let t=[`Error: ${e.message}`];return e._tag==="ApiError"&&(e.statusCode&&t.push(`Status: ${e.statusCode}`),e.requestId&&t.push(`Request ID: ${e.requestId}`),e.details&&t.push(`Details: ${JSON.stringify(e.details,null,2)}`)),e.suggestions&&e.suggestions.length>0&&t.push("","Suggestions:",...e.suggestions.map(r=>` - ${r}`)),t.join(`
273
- `)}var zA=pn({accessToken:ix,accessExpiresAt:ix,refreshToken:bt(Se)}),Lke=Go(Ki(zA)),QZ=e=>Lke(e.trim()).pipe(st(()=>new lT({message:"The saved session is unreadable.",suggestions:["Sign in again to replace it: tsuga auth login"]}))),Mke=5*pd;function yM(e,t){let r=Date.parse(e.accessExpiresAt);return Number.isNaN(r)?!0:r<=t+Mke}function ZZ(e){if(e.flagKey)return{kind:"operation-api-key",token:e.flagKey,source:"flag"};if(e.environmentKey)return{kind:"operation-api-key",token:e.environmentKey,source:"environment"};if(e.operationApiKey)return{kind:"operation-api-key",token:e.operationApiKey,source:"config"};if(e.userAuth)return{kind:"user-session",userAuth:e.userAuth}}var XZ="tsuga-cli",Dke="Tsuga CLI session",ng=class extends it()("SecretStore",{make:mt(function*(){let t=process.platform==="linux"?yield*YZ({service:XZ,label:Dke}):yield*KZ(XZ);return{location:t.location,read:k(function*(r){let o=yield*t.read(r);return o===void 0?void 0:yield*QZ(o)}),save:(r,o)=>t.save(r,JSON.stringify(o)),remove:t.remove}})}){static layer=Do(this,this.make)};var fn=class e extends it()("common-cli/OutputFormatter"){static layer=lc(e)(JZ("rows"));static pageLayer=lc(e)(JZ("page"))};function JZ(e){return{rows:(t,r)=>mt(function*(){if(r.pretty??(yield*pT))return yield*DZ(t,r);yield*e==="page"?Oe({data:t,metadata:r.metadata},r.fields):Si(t,r.fields)})}}var Ua=class extends it()("GlobalFlags"){},eX=Ee("cli/Argv",{defaultValue:()=>process.argv.slice(2)});var tX="__tsuga_cluster_id__",Fke=n.Object({}),$ke=n.Object({status:n.Literal("error"),message:n.String({description:"Why this cluster failed to answer the query."})});function og(e=Fke){let t=D("status",[n.Object({...e.properties,status:n.Literal("ok")}),$ke]);return Object.assign(RO(gi,t),{description:'Outcome per cluster, keyed by cluster ID. A cluster that failed reports `status: "error"`.'})}var Gke=5,Hc=n.Array(p({allowEmpty:!1}),{minItems:1,maxItems:Gke,uniqueItems:!0,description:"IDs of the clusters to query, without duplicates. Mutually exclusive with `clusterId`. Omit both to use the default cluster."});var rX=n.Object({type:n.Literal("number"),number:n.String()}),Bke=n.Object({type:n.Literal("string"),string:n.String()}),jke=n.Object({type:n.Literal("timestamp"),timestamp:n.String()}),dT=D("type",[rX,Bke,jke]),qke=n.Object({by:n.Record(n.String(),dT),computed:n.Record(n.String(),rX)}),Hke=n.Object({type:n.Literal("buckets"),buckets:n.Array(qke),clusterResponses:n.Optional(og())}),Kke=n.Object({type:n.Literal("distribution"),bounds:n.Array(n.Number()),buckets:n.Array(n.Object({timestamp:n.Number(),counts:n.Array(n.Number())})),percentiles:n.Optional(n.Array(n.Number()))}),ig=D("type",[Hke,Kke]);var EM=["all","owning-team-and-public","owning-team-only"],ws=n.Enum(EM,{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 oX=1456444800,iX=4927737600,zke=oX*1e3,Yke=iX*1e3,YA=1704067200,VA=YA+3600,sX=YA*1e3,aX=VA*1e3,cX={title:"TimeRange",description:"Inclusive time range for telemetry queries. Use Unix timestamps in seconds unless the field description says milliseconds.",examples:[{from:YA,to:VA}]},Vke={title:"V2TimeRange",description:"Inclusive time range for telemetry queries using Unix timestamps in milliseconds.",examples:[{from:sX,to:aX}]},hd=(e,t=YA)=>n.Integer({description:e,examples:[t],minimum:oX,maximum:iX,format:"int64"}),nX=(e,t=sX)=>n.Integer({description:e,examples:[t],minimum:zke,maximum:Yke,format:"int64"}),Pr=n.Object({from:n.Optional(hd("Start of the query window as a Unix timestamp in seconds")),to:n.Optional(hd("End of the query window as a Unix timestamp in seconds",VA))},cX),nn=n.Object({from:hd("Start of the query window as a Unix timestamp in seconds"),to:hd("End of the query window as a Unix timestamp in seconds",VA)},cX),vo=n.Object({from:nX("Start of the query window as a Unix timestamp in milliseconds"),to:nX("End of the query window as a Unix timestamp in milliseconds",aX)},Vke);var Kc="/v0/logs";var WA=["CRITICAL","ERROR","WARN","NOTICE","INFO","DEBUG","TRACE"];var mT=0,TM=n.Object({__tsuga_metadata__:n.Object({id:n.String(),source:n.Optional(n.String())},{additionalProperties:!0}),context:n.Optional(n.Object({team:n.Optional(n.String({description:"Team name associated with this log."})),tag_policy_warnings:n.Optional(n.Record(n.String(),n.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:n.Optional(n.Unknown({description:"Log message after ingestion and route processing. It can be any JSON value because processors may map arbitrary data into `message`."})),timestamp:n.Number({description:"Log timestamp as a Unix timestamp in milliseconds."}),level:n.Enum(WA,{description:"Log severity, normalized from the source severity into one of the fixed Tsuga levels (ordered `CRITICAL` to `TRACE`)."}),[tX]:n.Optional(n.String({description:"ID of the cluster this log was read from. Only set when the request spanned several clusters."}))},{additionalProperties:!0}),pX=100,Wke="timestamp",Tp=n.Partial(n.Object({...Pr.properties,query:p({type:"tsuga-query",description:"Tsuga query used to filter logs in the selected time range."}),maxResults:n.Integer({minimum:1,maximum:1e3,description:"Maximum number of logs to return. Valid values are 1 through 1000."}),shouldRecommendAttributes:n.Boolean({description:"Whether Tsuga should return suggested attributes to highlight in results."}),triggeredBy:n.Literal("refresh",{description:"Indicates the query was triggered by a refresh action."}),startOffset:n.Number({minimum:mT,description:"Result offset used when fetching additional log rows."}),startOffsets:n.Array(n.Number({minimum:mT}),{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 ${mT} for every cluster.`}),clusterId:p({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}),clusterIds:Hc,sortBy:p({allowEmpty:!1,default:Wke,description:"Attribute to sort by. Attributes other than `timestamp` sort numerically; logs where the attribute is missing or not a number come last."}),sortDirection:me,useCanopy:n.Boolean()})),Z$t=f({tags:["logs"],url:`${Kc}/count`,method:"GET",query:n.Pick(Tp,["from","to","query","clusterId","clusterIds","useCanopy"]),response:n.Object({count:n.Number(),clusterResponses:n.Optional(og())})}),fT=n.Object({value:n.String(),priority:n.Number()}),X$t=f({tags:["logs"],url:`${Kc}/search`,method:"GET",query:Tp,response:n.Object({logs:n.Optional(n.Array(TM)),attributesToHighlight:n.Optional(n.Array(fT)),incomplete:n.Optional(n.Boolean({description:"True when attribute highlighting stopped early because too many distinct attributes were found."})),clusterResponses:n.Optional(og(n.Object({nextStartOffset:n.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})}),Qke=n.Cyclic({TokenOutput:n.Union([n.Object({type:n.Literal("top"),values:n.Array(n.String())}),n.Object({type:n.Literal("ip"),value:n.String()}),n.Object({type:n.Literal("range"),min:n.Number(),max:n.Number()}),n.Object({type:n.Literal("variable"),value:n.String()}),n.Object({type:n.Literal("text"),value:n.String()}),n.Object({type:n.Literal("date"),value:n.String()}),n.Object({type:n.Literal("url"),value:n.String()}),n.Object({type:n.Literal("structure"),key:n.Array(n.String()),value:n.Array(n.Ref("TokenOutput"))})])},"TokenOutput",{description:"A token identified as part of the pattern"}),lX=n.Object({id:n.String(),pattern:n.Array(Qke),size:n.Integer({description:"Number of logs that matched the pattern"}),examples:n.Array(n.Object({id:n.String(),timestampUnix:n.Number()})),timeDistribution:n.Array(n.Number()),staticFeatures:n.Array(n.Object({key:n.String(),value:n.String()},{description:"Fixed groups present in all logs matching the pattern"}))}),SM=n.Object({...Pr.properties,query:p({type:"tsuga-query"}),clusteringThreshold:n.Optional(n.Number()),clusterId:n.Optional(p({allowEmpty:!1})),useCanopy:n.Optional(n.Boolean())}),J$t=f({tags:["logs"],url:`${Kc}/patterns`,method:"GET",query:SM,response:n.Object({patterns:n.Array(lX),sampleSize:n.Number()})}),dX=n.Object({id:n.String(),volume:n.Integer({description:"Number of logs in the cluster"}),levels:n.Array(n.Enum(WA)),signatures:n.Array(n.Object({signature:n.String(),volume:n.Integer()}))}),e1t=f({tags:["logs"],url:`${Kc}/patterns/clusters`,method:"GET",query:SM,response:n.Object({clusters:n.Array(dX),totalVolume:n.Integer()})}),Zke=50,t1t=f({tags:["logs"],url:`${Kc}/patterns/details`,method:"POST",body:n.Object({...SM.properties,clusters:n.Array(dX,{maxItems:Zke})}),response:n.Object({patterns:n.Array(lX),sampleSize:n.Number()})}),r1t=f({tags:["logs"],url:`${Kc}/attributes`,method:"GET",query:n.Object({...Pr.properties,clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"})),clusterIds:n.Optional(Hc),useCanopy:n.Optional(n.Boolean()),search:n.Optional(p({allowEmpty:!1,description:"Return only attribute dot-paths containing this text, case-insensitively"}))}),response:n.Object({attributes:n.Array(n.String()),clusterResponses:n.Optional(og())})});var mX="timestamp";var uX=`${mX}_iso`;var Xke=["pending","running","completed","incomplete","failed"],fX=n.Object({id:n.String({description:"ID of the export."}),status:n.Enum(Xke,{description:"Lifecycle of the export. `pending` until the download is claimed, `running` while the CSV streams, then `completed`, `incomplete` when the file is usable but some matched logs could not be reached, or `failed` if the export was interrupted."}),rowsWritten:n.Number({description:"Logs written to the CSV so far. Updated periodically while the download streams, so it lags slightly behind the bytes on the wire."}),totalRows:n.Number({description:"Logs this export will write, already clamped to the export maximum. Use it as the denominator for progress."}),isTruncated:n.Boolean({description:"Whether the query matched more logs than the export maximum, so the CSV holds only the first logs in the requested sort order."}),errorMessage:n.Optional(n.String({description:"Why the export is incomplete or failed."}))}),n1t=f({tags:["logs"],url:`${Kc}/exports`,method:"POST",body:n.Object({...n.Pick(Tp,["from","to","query","clusterId","clusterIds","sortBy","sortDirection"]).properties,columns:n.Array(p({allowEmpty:!1}),{minItems:1,description:`Log attributes to write as CSV columns, in order. Each becomes one column, resolved against the log with dotted-path lookup. Including \`${mX}\` also writes a \`${uX}\` column next to it, holding the same instant in ISO 8601.`}),timezone:n.Optional(n.String({format:id,description:`IANA timezone the \`${uX}\` column is offset to (e.g. \`Europe/Paris\`). Defaults to UTC.`}))}),response:n.Object({...fX.properties,downloadUrl:n.String({description:"Relative URL to fetch the CSV from. It carries a single-use token that expires shortly after creation, so the caller must start the download immediately."})})}),o1t=f({tags:["logs"],url:`${Kc}/exports/:exportId`,method:"GET",params:n.Object({exportId:n.String()}),response:fX}),i1t=f({tags:["logs"],url:`${Kc}/exports/:exportId/download`,method:"GET",params:n.Object({exportId:n.String()}),query:n.Object({token:p({allowEmpty:!1,type:"long",description:"Single-use token minted when the export was created."})}),response:n.String({description:"CSV file, streamed as it is produced."})});var zc="/v0/metrics",Jke=n.Object({__tsuga_metadata__:n.Object({},{additionalProperties:!0}),context:n.Optional(n.Object({},{additionalProperties:!0})),message:n.Optional(n.String()),timestamp:n.Number(),level:n.Enum(WA)},{additionalProperties:!0}),d1t=f({tags:["metrics"],url:`${zc}/count`,method:"GET",query:n.Pick(Tp,["from","to","query","clusterId"]),response:n.Object({count:n.Number()})}),m1t=f({tags:["metrics"],url:`${zc}/search`,method:"GET",query:Tp,response:n.Object({logs:n.Optional(n.Array(Jke)),totalHits:n.Optional(n.Number()),attributesToHighlight:n.Optional(n.Array(fT))},{additionalProperties:!0})}),QA=n.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."}),ZA=n.Enum(["delta","cumulative","none"],{description:"Metric temporality. `delta` reports changes per collection interval, `cumulative` reports running totals, and `none` means temporality is not applicable or unknown."}),_M=["gauge","cumulative-counter","delta-counter","cumulative-histogram","delta-histogram","summary"],gX=n.Enum(_M,{description:"Type and temporality of one variant of a metric. The same metric name can be reported under several kinds, for instance by two services instrumented differently."}),hX=n.Number({description:"Timestamp of the most recent data point recorded for this metric, in milliseconds since the Unix epoch. Omitted when Tsuga has no record of it. Computed from a periodically refreshed metadata snapshot, so it can lag ingestion by a few minutes and should not be used to detect sub-minute gaps."}),yX=n.Array(n.String(),{description:"Team values observed on this metric across the most recent data generations kept by the metric catalog. Omitted when the catalog has no team statistics for the metric yet."}),XA=n.Number({description:"Estimated number of distinct series for this metric across the most recent data generations kept by the metric catalog. Omitted when the catalog has no statistics for the metric yet."}),eLe=n.Record(n.String(),n.Number(),{description:"Estimated number of distinct values per attribute over the same window as `seriesCardinality`, keyed like `tags`."}),tLe=n.Object({capabilities:n.Optional(n.Array(n.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:n.Optional(n.String({description:"Human-readable description of the metric"})),tags:n.Optional(n.Array(n.String(),{description:"Attribute names available as dimensions for filtering or grouping this metric. Exposed publicly as `attributes`."})),temporality:n.Optional(ZA),type:n.Optional(QA),unit:n.Optional(n.String({description:"Metric unit reported by instrumentation or inferred metadata."})),lastSeen:n.Optional(hX),teams:n.Optional(yX),seriesCardinality:n.Optional(XA),attributeCardinalities:n.Optional(eLe)}),f1t=f({url:`${zc}/metadata`,method:"GET",query:n.Object({...Pr.properties,metricName:p({allowEmpty:!1}),kind:n.Optional(gX),clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:tLe}),g1t=f({tags:["metrics"],url:zc,method:"GET",query:n.Object({...Pr.properties,clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:n.Array(n.String())}),EX=n.Array(n.Object({name:n.String({description:"Metric name observed by Tsuga."}),kind:gX,type:QA,temporality:n.Optional(ZA),lastSeen:n.Optional(hX),teams:n.Optional(yX),seriesCardinality:n.Optional(XA)}),{description:"Metric variants observed in the requested time range. A name appears once per kind it was reported as."}),rLe=[{name:"http.server.request.duration",kind:"cumulative-histogram",type:"histogram"},{name:"http.server.request.duration",kind:"delta-histogram",type:"histogram"},{name:"http.server.active_requests",kind:"gauge",type:"gauge"},{name:"http.server.request.count",kind:"delta-counter",type:"counter"}];Object.assign(EX,{examples:[rLe]});var h1t=f({tags:["metrics"],url:`${zc}/names-and-types`,method:"GET",query:n.Object({...Pr.properties,clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:EX}),gT=n.Array(n.String(),{description:"Attribute names available as dimensions for filtering or grouping the requested metric(s)."}),nLe=["service","env","host","method","status_code"];Object.assign(gT,{examples:[nLe]});var y1t=f({tags:["metrics"],url:`${zc}/attributes`,method:"GET",query:n.Object({...Pr.properties,metricName:p({allowEmpty:!1}),clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:gT}),E1t=f({tags:["metrics"],url:`${zc}/attributes/batch`,method:"GET",query:n.Object({...Pr.properties,metricNames:n.Array(p({allowEmpty:!1}),{minItems:1,description:"Metric names to fetch attributes for"}),clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:gT}),IM=n.Object({assets:n.Array(n.Object({type:n.Enum(["dashboard","monitor"],{description:"Kind of asset referencing the metric."}),id:n.String({description:"Dashboard or monitor ID for the asset that queries this metric."}),name:n.String({description:"Display name of the referencing dashboard or monitor."}),owner:n.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."})}),T1t=f({tags:["metrics"],url:`${zc}/assets-usage`,method:"GET",query:n.Object({metricName:p({allowEmpty:!1})}),response:IM}),S1t=f({url:`${zc}/per-attribute`,method:"GET",query:n.Object({from:n.Optional(n.Number()),to:n.Optional(n.Number()),attribute:p(),clusterId:n.Optional(p({allowEmpty:!1}))}),response:n.Array(n.String())});var sLe="/v0/aggregation",aLe=n.Union([n.Literal("a"),n.Literal("d"),n.Literal("q"),n.Literal("w"),n.Literal("t")]),yT=n.Object({parallelism:n.Number(),engine:aLe,recordBatchCache:n.Optional(n.Boolean()),includeNullGroups:n.Optional(n.Boolean()),restartAwareGaugeSum:n.Optional(n.Boolean())}),bM=["logs","metrics","traces"];var _X={logs:"Logs",metrics:"Metrics",traces:"Spans"},cLe=[...bM,"connections","log-patterns","spans","rum"];var v1t={..._X,connections:"Connections","log-patterns":"Log Patterns",spans:"Spans",rum:"RUM events"},wa=[...bM,"rum"];var N1t={..._X,rum:"RUM events"};var k1t=n.Enum(cLe,{description:"Data source being queried"}),L1t=n.Enum(bM,{description:"Telemetry source queried by this aggregation: `logs`, `metrics`, or `traces`."}),_i=n.Enum(wa,{description:"Telemetry source queried by this aggregation: `logs`, `metrics`, `traces`, or `rum`."}),yd=n.String({description:"Attribute containing the values to aggregate"}),sg=p({description:"Attribute containing the values to aggregate"}),uLe=D("type",[n.Object({type:n.Literal("count",{description:"Counts the total number of records"}),field:n.Optional(yd)},{$id:"AggregateCount",title:"Count"}),n.Object({type:n.Literal("unique-count",{description:"Counts the distinct values of the field"}),field:yd},{$id:"AggregateUniqueCount",title:"UniqueCount"}),n.Object({type:n.Literal("average",{description:"Calculates the average value of the selected field"}),field:yd},{$id:"AggregateAverage",title:"Average"}),n.Object({type:n.Literal("max",{description:"Finds the largest value of the field"}),field:yd},{$id:"AggregateMax",title:"Max"}),n.Object({type:n.Literal("min",{description:"Finds the smallest value of the field"}),field:yd},{$id:"AggregateMin",title:"Min"}),n.Object({type:n.Literal("sum",{description:"Sums the values of the selected field"}),field:yd},{$id:"AggregateSum",title:"Sum"}),n.Object({type:n.Literal("percentile",{description:"Calculates a percentile of the selected field"}),field:yd,percentile:n.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`, which needs it only when `dataSource` is `metrics`."}),pLe=D("type",[n.Object({type:n.Literal("count",{description:"Counts the total number of records"}),field:n.Optional(p({description:"Metric to count when `dataSource` is `metrics`, where it is required: without it the query fails with `count aggregate requires a non-empty field`. On `logs`, `traces` and `rum`, `count` counts records and ignores this field."}))},{$id:"InputAggregateCount",title:"Count"}),n.Object({type:n.Literal("unique-count",{description:"Counts the distinct values of the field"}),field:sg},{$id:"InputAggregateUniqueCount",title:"UniqueCount"}),n.Object({type:n.Literal("average",{description:"Calculates the average value of the selected field"}),field:sg},{$id:"InputAggregateAverage",title:"Average"}),n.Object({type:n.Literal("max",{description:"Finds the largest value of the field"}),field:sg},{$id:"InputAggregateMax",title:"Max"}),n.Object({type:n.Literal("min",{description:"Finds the smallest value of the field"}),field:sg},{$id:"InputAggregateMin",title:"Min"}),n.Object({type:n.Literal("sum",{description:"Sums the values of the selected field"}),field:sg},{$id:"InputAggregateSum",title:"Sum"}),n.Object({type:n.Literal("percentile",{description:"Calculates a percentile of the selected field"}),field:sg,percentile:n.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`, which needs it only when `dataSource` is `metrics`."}),IX=n.Object({type:n.Literal("per-second",{description:"Normalizes the metric to events per second"})},{$id:"FunctionPerSecond",title:"PerSecond"}),bX=n.Object({type:n.Literal("per-minute",{description:"Normalizes the metric to events per minute"})},{$id:"FunctionPerMinute",title:"PerMinute"}),xX=n.Object({type:n.Literal("per-hour",{description:"Normalizes the metric to events per hour"})},{$id:"FunctionPerHour",title:"PerHour"}),OX=n.Object({type:n.Literal("rate",{description:"Calculates the rate of change"})},{$id:"FunctionRate",title:"Rate"}),AX=n.Object({type:n.Literal("increase",{description:"`Increase` is designed for cumulative metrics. It computes the increase of cumulative metrics by automatically handling counter resets. When used with an aggregation such as `sum` it combines all series without requiring an explicit group-by."})},{$id:"FunctionIncrease",title:"Increase"}),CX=n.Object({type:n.Literal("power",{description:"Raises values to a specified power"}),exponent:n.Integer({description:"The exponent to raise values to"})},{$id:"FunctionPower",title:"Power"}),RX=n.Object({type:n.Literal("sqrt",{description:"Applies a square root transformation to the values"})},{$id:"FunctionSqrt",title:"Sqrt"}),PX=n.Object({type:n.Literal("last",{description:"Takes the last value of the metric for the selected time frame"})},{$id:"FunctionLast",title:"Last"}),UX=n.Object({type:n.Literal("cumsum",{description:"Cumulative sum of the values over the time frame. Computed by the Tsuga web app only: the aggregation API ignores it and returns the raw values."})},{$id:"FunctionCumsum",title:"Cumsum"}),lLe=n.Object({type:n.Literal("log",{description:"Applies a logarithm transformation to the values"}),base:n.Integer({description:"The base of the logarithm"})},{$id:"FunctionLog",title:"Log"}),dLe=n.Object({type:n.Literal("log",{description:"Applies a logarithm transformation to the values"}),base:n.Integer({description:"The base of the logarithm",minimum:2})},{$id:"InputFunctionLog",title:"Log"}),mLe=n.Object({type:n.Literal("time-offset",{description:"Shifts a query's data backward by a specified duration for easy comparison over different periods of time."}),seconds:n.Integer({description:"Number of seconds to offset"})},{$id:"FunctionTimeOffset",title:"TimeOffset"}),fLe=n.Object({type:n.Literal("time-offset",{description:"Shifts a query's data backward by a specified duration for easy comparison over different periods of time."}),seconds:n.Integer({description:"Number of seconds to offset",minimum:1})},{$id:"InputFunctionTimeOffset",title:"TimeOffset"}),gLe=D("type",[IX,bX,xX,OX,AX,lLe,CX,RX,PX,mLe,UX],{title:"Function",description:"Post-processing function applied to an aggregation query result after the aggregate is computed, selected by `type`."}),hLe=D("type",[IX,bX,xX,OX,AX,dLe,CX,RX,PX,fLe,UX],{title:"InputFunction",description:"Post-processing function applied to an aggregation query result after the aggregate is computed, selected by `type`."});var TX=n.Object({min:n.Number({description:"Lower bound of the distribution range."}),max:n.Number({description:"Upper bound of the distribution range."})}),yLe=["linear","log"],hT=n.Enum(yLe,{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."}),ELe=1e3,SX=n.Integer({minimum:1,maximum:ELe}),JA={pattern:"^0*[1-9]\\d*[smhdw]$",errorMessage:{pattern:'must be a positive whole number followed by s, m, h, d or w, such as "10s", "1m" or "1h".'}},TLe=D("type",[n.Object({type:n.Literal("scalar")},{title:"Scalar",description:"Returns a single value"}),n.Object({type:n.Literal("timeseries"),aggregationWindow:n.String({...JA,description:'Time bucket size for aggregation (e.g. "10s", "60s", "1m")'})},{title:"Timeseries",description:"Returns a time series"}),n.Object({type:n.Literal("histogram"),by:n.Optional(p()),bucketCount:n.Optional(SX),bounds:n.Optional(TX),boundsScale:n.Optional(hT),percentiles:n.Optional(n.Array(n.Integer({minimum:0,maximum:100}),{minItems:1,maxItems:100}))},{title:"Histogram",description:"Returns a single distribution over the entire time range"}),n.Object({type:n.Literal("heatmap"),aggregationWindow:n.String({...JA,description:'Time bucket size for the heatmap (e.g. "10s", "60s", "1m")'}),by:n.Optional(p()),bucketCount:n.Optional(SX),bounds:n.Optional(TX),boundsScale:n.Optional(hT)},{title:"Heatmap",description:"Returns a distribution per time window"})]),eC=15,M1t=128*1024,SLe=["zero","null"],_Le=n.Enum(SLe,{description:"`zero` fills missing points with zero. `null` keeps missing points null."}),wX=n.Object({mode:n.Object({type:_Le},{description:"How missing aggregation points should be filled."})},{description:"Missing-point fill behavior for aggregation results. Optional; omit to keep missing points null."}),ILe=["avg","sum","min","max","last"],vX=n.Enum(ILe,{description:"Per-series rollup applied within each time bucket before the cross-series aggregate. Use it on metric queries when `aggregate.type` is `sum` and no `rate`, `increase`, or `last` function is present. When omitted, Tsuga derives the rollup from the metric type."});var NX=n.Enum(_M,{description:"Variant of the metric in `aggregate.field` to query, for metric names reported under several kinds (for instance both cumulative and delta). When omitted, Tsuga picks one variant by type and temporality precedence."}),kX={aggregate:uLe,functions:n.Optional(n.Array(gLe,{description:"Post-processing functions applied to aggregation results"})),fill:n.Optional(wX),timeAggregate:n.Optional(vX),metricKind:n.Optional(NX)},LX={aggregate:pLe,functions:n.Optional(n.Array(hLe,{maxItems:10,description:"Post-processing functions applied to aggregation results. Defaults to an empty array when omitted."})),fill:n.Optional(wX),timeAggregate:n.Optional(vX),metricKind:n.Optional(NX)},bLe={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."},MX={minItems:1,maxItems:eC,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").'},DX=n.Array(n.Object({...kX,filter:n.Optional(n.String({description:"Filter to apply to the aggregation"}))},{title:"AggregationQuery"}),bLe),ET=n.Array(n.Object({...LX,filter:n.Optional(p({type:"tsuga-query",description:"Tsuga query filter to apply to the aggregation. Defaults to an empty string when omitted."}))},{title:"AggregationQuery"}),MX),TT=n.Array(n.Object({...kX,filter:n.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."}),tC=n.Array(n.Object({...LX,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."}),{...MX,description:"Aggregation queries used by alerting. Each query is referenced from formulas as q1, q2, and so on."}),FX=n.Array(n.Omit(tC.items,["fill"],{title:"SloAggregationQuery",description:"Single aggregation query evaluated by an SLO."}),{minItems:1,maxItems:eC,description:"Aggregation queries used by SLO evaluation. Each query is referenced from formulas as q1, q2, and so on."});var rC=n.String({description:"Formula referencing submitted query outputs, such as `q1 + q2`. References must be within `q1` through `qN` for the submitted queries."}),Ed=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. Only `+`, `-`, `*`, `/` and parentheses over query references and numbers are supported, with no functions such as `max()`."}),xLe=n.Object({fields:n.Array(n.String(),{description:"Telemetry attribute names used to group aggregation results."}),limit:n.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:n.Optional(me),replaceNullWith:n.Optional(n.String({description:"Value used to group documents that have no value for a grouped field."}))},{title:"AggregationGroupBy"}),OLe=n.Object({fields:n.Array(p(),{maxItems:1,description:"Telemetry attribute name to group aggregation results by at this grouping level. To group by several attributes, send one `groupBy` entry per attribute: entries nest, outermost first.",errorMessage:{maxItems:'must hold one field. To group by several fields, send one groupBy entry per field: they nest, outermost first, such as [{"fields": ["context.service.name"], "limit": 10}, {"fields": ["level"], "limit": 5}].'}}),limit:n.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:n.Optional(me),replaceNullWith:n.Optional(p({allowEmpty:!1,description:"Value used to group documents that have no value for a grouped field."}))},{title:"AggregationGroupBy"}),$X=7;var ag=n.Array(xLe,{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."}),Yc=n.Array(OLe,{maxItems:$X,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 D1t=f({tags:["aggregation"],url:`${sLe}/multi-query`,method:"POST",body:n.Object({timeRange:vo,queries:ET,groupBy:n.Optional(Yc),returnType:TLe,dataSource:_i,formula:Ed,executionOptions:yT,triggeredBy:n.Optional(n.Literal("refresh")),shouldStreamResults:n.Optional(n.Boolean()),clusterId:n.Optional(p({allowEmpty:!1})),clusterIds:n.Optional(Hc),viewAs:n.Optional(n.Object({owner:p({allowEmpty:!1,description:"Team ID to fetch data as"}),permissions:ws}))}),response:ig});var GX=`/${"v1"}/aggregation`,BX=`/${"v2"}/aggregation`,jX=n.Object({id:n.String({description:"Result identifier. Query results use `q1`, `q2`, and so on; formula results use `value`."}),group:n.Record(n.String(),n.Union([n.String(),n.Number()]),{description:"Group-by field values for this result. Empty when no group-by is requested."})}),qX=n.Object({results:n.Array(n.Object({...jX.properties,value:n.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."}),ALe={results:[{id:"q1",group:{host:"server-1"},value:123.45}]};Object.assign(qX,{examples:[ALe]});var nC=n.Object({series:n.Array(n.Object({...jX.properties,points:n.Array(n.Object({timestamp:n.Integer({description:"Unix timestamp in milliseconds for this point, spaced by `aggregationWindow`."}),value:n.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."}),CLe={series:[{id:"q1",group:{host:"server-1"},points:[{timestamp:16094592e5,value:123.45},{timestamp:160945926e4,value:456.78}]}]};Object.assign(nC,{examples:[CLe]});var HX=n.Record(n.String(),n.Union([n.String(),n.Number()]),{description:"Group-by field values for this row, keyed by field name. Empty when no group-by is requested."}),KX="Keyed by result id: `q1`, `q2`, and so on for each query in submission order, plus `f1`, `f2`, and so on for each entry of `formulas` in submission order, or `value` for a PromQL query. Every row has the same keys.",zX=n.Object({results:n.Array(n.Object({group:HX,values:n.Record(n.String(),n.Union([n.Number(),n.Null()]),{description:`Aggregated values over the full time range, \`null\` where the group has none. ${KX}`})},{title:"ScalarResultV2"}),{description:"One row per group, in group-by sort order (largest first unless `sortOrder` says otherwise)."})},{$id:"ScalarAggregationResponseV2",title:"ScalarAggregationResponseV2",description:"Scalar aggregation response with one row per group."}),RLe={results:[{group:{"context.host.name":"web-1"},values:{q1:12,q2:1e3,f1:1.2}},{group:{"context.host.name":"web-2"},values:{q1:3,q2:500,f1:.6}}]};Object.assign(zX,{examples:[RLe]});var oC=n.Object({timestamps:n.Array(n.Integer(),{description:"Start of each time bucket as a Unix timestamp in milliseconds, ascending, spaced by `aggregationWindow` (`step` for PromQL) from the first bucket with data to the last. Every `values` array in `series` aligns with it index by index."}),series:n.Array(n.Object({group:HX,values:n.Record(n.String(),n.Array(n.Union([n.Number(),n.Null()])),{description:`One value per entry of \`timestamps\`, \`null\` where the bucket has none. ${KX}`})},{title:"SeriesV2"}),{description:"One series per group, in group-by sort order for aggregation queries and in no particular order for PromQL."})},{$id:"TimeseriesAggregationResponseV2",title:"TimeseriesAggregationResponseV2",description:"Timeseries aggregation response: a shared time axis and one series per group aligned to it."}),PLe={timestamps:[16094592e5,160945926e4,160945932e4],series:[{group:{"context.host.name":"web-1"},values:{q1:[12,null,7],q2:[1e3,900,1400],f1:[1.2,null,.5]}}]};Object.assign(oC,{examples:[PLe]});var ULe=n.Omit(ET.items,["fill"],{title:"AggregationQuery",description:"Aggregation query. Omit `filter` for an unfiltered query and omit `functions` when no post-processing is needed."}),wLe=n.Optional(Yc),YX={timeRange:nn,queries:n.Array(ULe,{maxItems:eC,description:'Aggregations that may be combined together in the same query. Each item is referenced from formulas 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").'}),groupBy:wLe,dataSource:_i},VX={...YX,formula:n.Optional(Ed)},WX={...YX,timeRange:vo,formulas:n.Optional(n.Array(p({type:"tsuga-formula",allowEmpty:!1,description:"Formula over the query results, such as `q1 / q2 * 100`. Only `+`, `-`, `*`, `/` and parentheses over query references (`q1` through `qN`) and numbers are supported; an undefined query reference returns 400."}),{maxItems:1,description:"Formulas computed from the query results, returned beside them as `f1`, `f2`, and so on in submission order. At most one for now."}))},Xi=n.Object({clusterId:n.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))}),QX=n.Object(VX,{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."}),vLe={timeRange:{from:1782201500,to:1782203400},dataSource:"logs",queries:[{aggregate:{type:"count"},filter:"context.service.name:checkout"}],groupBy:[{fields:["level"],limit:5}]};Object.assign(QX,{examples:[vLe]});var ZX=n.Object(WX,{description:"Scalar aggregation request. Provide a time range in milliseconds, one or more queries, a telemetry data source, and optional grouping or formulas. Omit `groupBy` for ungrouped results. Send `clusterId` as a query parameter, not in the JSON body."}),XX={timeRange:{from:17822015e5,to:17822034e5},dataSource:"logs",queries:[{aggregate:{type:"count"},filter:"context.service.name:checkout AND level:error"},{aggregate:{type:"count"},filter:"context.service.name:checkout"}],groupBy:[{fields:["context.host.name"],limit:5}],formulas:["q1 / q2 * 100"]};Object.assign(ZX,{examples:[XX]});var iC=f({description:"Computes counts, unique counts, sums, averages, min/max or percentiles (p50, p95, p99), one value per group. Runs over logs, traces (spans), metrics or RUM (real user monitoring) events filtered with Tsuga query syntax, and supports group-by on any attribute, top-N breakdowns, per-second or per-minute rates and formulas. For values over time, use the timeseries aggregation. See [Analytics queries](/documentation/visualize/analytics/queries).",operationId:"aggregateScalar",tags:["public","aggregation"],url:`${GX}/multi-query/scalar`,method:"POST",body:QX,query:Xi,response:qX}),K1t=f({description:"Runs one or more aggregation queries over logs, metrics, traces, or RUM events and returns one row per group with every query result in it. Same request as `POST /v1/aggregation/multi-query/scalar`, with `timeRange` in milliseconds and formulas given as the `formulas` list and returned as `f1`. See [Analytics queries](/documentation/visualize/analytics/queries).",operationId:"aggregateScalarV2",tags:["public","aggregation"],url:`${BX}/multi-query/scalar`,method:"POST",body:ZX,query:Xi,response:zX}),JX=n.String({...JA,maxLength:Ei,description:"Time bucket size for timeseries aggregation, such as `10s`, `1m`, or `1h`."}),eJ=n.Object({...VX,aggregationWindow:JX},{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."}),NLe={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(eJ,{examples:[NLe]});var tJ=n.Object({...WX,aggregationWindow:JX},{description:"Timeseries aggregation request. Provide a time range in milliseconds, bucket size, one or more queries, a telemetry data source, and optional grouping or formulas. Omit `groupBy` for ungrouped series. Send `clusterId` as a query parameter, not in the JSON body."}),kLe={...XX,aggregationWindow:"1m"};Object.assign(tJ,{examples:[kLe]});var sC=f({description:"Charts counts, unique counts, sums, averages, min/max or percentiles (p50, p95, p99) over time, one series per group. Runs over logs, traces (spans), metrics or RUM (real user monitoring) events filtered with Tsuga query syntax, bucketed by `aggregationWindow`, with group-by on any attribute, per-second or per-minute rates and formulas. For one value per group, use the scalar aggregation. See [Analytics queries](/documentation/visualize/analytics/queries).",operationId:"aggregateTimeseries",tags:["public","aggregation"],url:`${GX}/multi-query/timeseries`,method:"POST",body:eJ,query:Xi,response:nC}),z1t=f({description:"Runs one or more aggregation queries over logs, metrics, traces, or RUM events and returns one shared time axis in milliseconds with one series per group aligned to it. Use `aggregationWindow` to choose the time bucket size. Same request as `POST /v1/aggregation/multi-query/timeseries`, with `timeRange` in milliseconds and formulas given as the `formulas` list and returned as `f1`. See [Analytics queries](/documentation/visualize/analytics/queries).",operationId:"aggregateTimeseriesV2",tags:["public","aggregation"],url:`${BX}/multi-query/timeseries`,method:"POST",body:tJ,query:Xi,response:oC});var LLe=["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS","TRACE"],rJ=k(function*(e,t,r,o,i){let{body:s,params:a,query:u}=o,l=r.url??(r.buildUrl&&a?r.buildUrl(a):void 0),d=LLe.find(g=>g===r.method);return l===void 0||d===void 0?yield*new Us({message:`Internal error: endpoint ${r.operationId??r.method} is not callable`}):Vx(d)(M7(`${e}${l}`,u),{headers:{Accept:"application/json","User-Agent":MLe(t),[SA]:t,[jL]:"1.196.0",[qL]:"a23f5a2f50",[HL]:"2026-11-13T13:45:40.524Z",...i},...s?{body:Sk(s)}:{}})});function MLe(e){return`${e==="cli"?"tsuga-cli":"tadmin"}/1.196.0 (${process.platform}; node ${process.versions.node})`}var DLe=["allowed-domains","audit-log-stream-destination","billing","cluster-integration-config","custom-role","custom-usage-tag","database","databricks-connection","explorer-saved-view","github-connection","inventory","llm-provider","monitor-alert","monitor-debugging","oauth-grant","org","queue","retention-policy","saml-config","sensitive-data-scanner-rule","service","service-target","team-remap-config","user-self","widget-share"],FLe=["adaptive-notification-rule","audit-log","cloud-account","dashboard-folder","monitor-folder","dashboard-report","dashboard-share","dashboard","data-deletion-request","ingestion-api-key","investigation","log-route","metric-route","monitor","notebook","notification-integration","notification-rule","notification-silence","operation-api-key","quality-report","rum-public-token","sandbox-configuration","slo","span-route","synthetic-test","synthetic-variable","tag-policy","team","user-data","user-invitation","user-permissions"],OM=["log","metric","trace","rum"],AM=[...FLe,...OM],$Le=[...DLe,...AM];var cg=["admin","public_editor","public_viewer","teams_only"],nJ=[...cg,"custom"],Ji=["admin","editor","viewer"];var Td="/v0/team-membership",CM="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.",ST=n.Object({id:n.String({description:"Tsuga-generated team membership ID assigned when the membership is created."}),userId:n.String({description:"User ID that belongs to the team."}),teamId:n.String({description:"Team ID that contains the user."}),roleKey:n.Enum(Ji,{description:CM})}),cC=n.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:n.Enum(Ji,{description:CM})}),RM=n.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."})}),GLe=n.Optional(n.Object({userId:n.Optional(p({allowEmpty:!1,description:"Restrict results to memberships for this user ID."})),teamId:n.Optional(p({allowEmpty:!1,description:"Restrict results to memberships for this team ID."}))})),nGt=f({tags:["access-control"],url:Td,method:"GET",query:GLe,response:n.Array(ST)}),oGt=f({tags:["access-control"],url:Td,method:"POST",body:cC,response:ST}),iGt=f({tags:["access-control"],url:Td,method:"PUT",body:cC,response:ST}),sGt=f({tags:["access-control"],url:Td,method:"DELETE",body:RM,response:B}),aC=500,uC=n.Object({teamId:p({allowEmpty:!1,description:"Team ID receiving all requested memberships."}),members:n.Array(n.Object({userId:n.Optional(p({allowEmpty:!1,description:"Existing user ID to add to the team."})),userEmail:n.Optional(p({allowEmpty:!1,type:"email",description:"Existing user email to resolve and add to the team."})),roleKey:n.Enum(Ji,{description:CM})},{oneOf:[{required:["userId"]},{required:["userEmail"]}]}),{minItems:1,maxItems:aC,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."}),BLe={teamId:"team-123-abc",members:[{userId:"user-123-abc",roleKey:"viewer"},{userEmail:"sam@example.com",roleKey:"editor"}]};Object.assign(uC,{examples:[BLe]});var pC=n.Object({results:n.Array(n.Object({userId:n.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:n.Enum(["added","already_member","user_not_found"],{description:"`added` means the membership was created, `already_member` means no change was needed, and `user_not_found` means Tsuga could not resolve the requested user."})}))},{description:"Per-user result summary for a bulk team-membership add request."}),jLe={results:[{userId:"user-123-abc",status:"added"},{userId:"sam@example.com",status:"user_not_found"}]};Object.assign(pC,{examples:[jLe]});var aGt=f({tags:["access-control"],url:`${Td}/bulk-add`,method:"POST",body:uC,response:pC}),cGt=f({tags:["access-control"],url:`${Td}/bulk-update-user-roles`,method:"PUT",body:n.Object({userIds:n.Array(p({allowEmpty:!1}),{minItems:1,maxItems:aC}),teamId:p({allowEmpty:!1}),role:n.Enum(Ji)}),response:n.Object({})}),lC=n.Object({teamId:p({allowEmpty:!1,description:"Team ID to remove the requested users from."}),userIds:n.Optional(n.Array(p({allowEmpty:!1}),{minItems:1,maxItems:aC,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:n.Optional(n.Array(p({allowEmpty:!1,type:"email"}),{minItems:1,maxItems:aC,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."}),qLe={teamId:"team-123-abc",userIds:["user-123-abc"]};Object.assign(lC,{examples:[qLe]});var dC=n.Object({results:n.Array(n.Object({userId:n.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:n.Enum(["removed","not_member","user_not_found"],{description:"`removed` means the membership was deleted, `not_member` means no membership existed, and `user_not_found` means Tsuga could not resolve the requested user."})}))},{description:"Per-user result summary for a bulk team-membership removal request."}),HLe={results:[{userId:"user-123-abc",status:"removed"},{userId:"missing@example.com",status:"user_not_found"}]};Object.assign(dC,{examples:[HLe]});var uGt=f({tags:["access-control"],url:`${Td}/bulk-remove`,method:"DELETE",body:lC,response:dC});var KLe={"sandbox-configuration":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"github-connection":{read:["admin"],write:["admin"]},"llm-provider":{read:["admin"],write:["admin"]},investigation:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"ingestion-api-key":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"rum-public-token":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"widget-share":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"dashboard-share":{read:["public_viewer","public_editor","admin"],write:["admin"]},"audit-log":{read:["public_viewer","public_editor","admin"],write:[]},"custom-role":{read:["public_viewer","public_editor","admin"],write:["admin"]},"custom-usage-tag":{read:["public_viewer","public_editor","admin"],write:["admin"]},"cluster-integration-config":{read:["admin"],write:["admin"]},"explorer-saved-view":{read:["public_viewer","public_editor","admin"],write:["public_viewer","public_editor","admin"]},"operation-api-key":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"cloud-account":{read:["public_viewer","public_editor","admin"],write:["admin"]},dashboard:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"dashboard-folder":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"monitor-folder":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"dashboard-report":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},notebook:{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"]},"span-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"]},"audit-log-stream-destination":{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"]},billing:{read:["admin"],write:[]},"data-deletion-request":{read:["admin"],write:["admin"]},"sensitive-data-scanner-rule":{read:["public_viewer","public_editor","admin"],write:["admin"]},slo:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"synthetic-test":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"synthetic-variable":{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"]},database:{read:["public_viewer","public_editor","admin"],write:[]},queue:{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-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:[]}},zLe={"sandbox-configuration":{read:["viewer","editor","admin"],write:["editor","admin"]},"github-connection":{read:["admin"],write:[]},"llm-provider":{read:[],write:[]},investigation:{read:["viewer","editor","admin"],write:["editor","admin"]},"ingestion-api-key":{read:["viewer","editor","admin"],write:["editor","admin"]},"rum-public-token":{read:["viewer","editor","admin"],write:["editor","admin"]},"widget-share":{read:["viewer","editor","admin"],write:["viewer","editor","admin"]},"dashboard-share":{read:["viewer","editor","admin"],write:["admin"]},"audit-log":{read:["viewer","editor","admin"],write:[]},"custom-role":{read:["viewer","editor","admin"],write:[]},"custom-usage-tag":{read:[],write:[]},"cluster-integration-config":{read:[],write:[]},"explorer-saved-view":{read:["viewer","editor","admin"],write:["viewer","editor","admin"]},"operation-api-key":{read:["viewer","editor","admin"],write:["admin"]},"cloud-account":{read:["viewer","editor","admin"],write:[]},dashboard:{read:["viewer","editor","admin"],write:["editor","admin"]},"dashboard-folder":{read:["viewer","editor","admin"],write:["editor","admin"]},"monitor-folder":{read:["viewer","editor","admin"],write:["editor","admin"]},"dashboard-report":{read:["viewer","editor","admin"],write:["editor","admin"]},notebook:{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"]},"span-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:[]},"audit-log-stream-destination":{read:[],write:[]},org:{read:["viewer","editor","admin"],write:[]},"allowed-domains":{read:["viewer","editor","admin"],write:[]},"quality-report":{read:["viewer","editor","admin"],write:["editor","admin"]},billing:{read:[],write:[]},"data-deletion-request":{read:[],write:[]},"sensitive-data-scanner-rule":{read:["viewer","editor","admin"],write:[]},slo:{read:["viewer","editor","admin"],write:["editor","admin"]},"synthetic-test":{read:["viewer","editor","admin"],write:["editor","admin"]},"synthetic-variable":{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"]},database:{read:["viewer","editor","admin"],write:[]},queue:{read:["viewer","editor","admin"],write:[]},"tag-policy":{read:[],write:[]},team:{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:[]}},YLe={user:KLe,team:zLe};function PM(e){return oJ(e,"team")}function UM(e){return oJ(e,"user")}function oJ(e,t){let r=[],o=YLe[t];for(let[i,s]of Object.entries(o))for(let[a,u]of Object.entries(s))u.includes(e)&&r.push({actionType:a,resourceType:i});return r}var VLe={admin:{name:"Global admin",description:"Full control across the organization. Can view and modify everything, including private teams.",permissions:UM("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:UM("public_editor"),roleKey:"public_editor"},public_viewer:{name:"Public viewer",description:"Read-only access to public team data. Cannot make changes.",permissions:UM("public_viewer"),roleKey:"public_viewer"},teams_only:{name:"Teams only",description:"Only access data and assets in their own teams.",permissions:[],roleKey:"teams_only"}},gGt=Object.values(VLe).map(e=>({value:e.roleKey,label:e.name,description:e.description})),hGt={admin:{name:"Team admin",description:"Full team control, manage assets, members, and settings.",permissions:PM("admin"),roleKey:"admin"},editor:{name:"Team editor",description:"Can view and update most assets (like dashboards, monitors).",permissions:PM("editor"),roleKey:"editor"},viewer:{name:"Team viewer",description:"Can view all team data but cannot make changes.",permissions:PM("viewer"),roleKey:"viewer"}};var yGt=new Set(AM);var WLe={documentation:void 0,investigations:"investigation",logs:"log",metrics:"metric",traces:"trace",user:"user-data","allowed-domains":"allowed-domains",billing:"billing","cloud-account":"cloud-account","custom-role":"custom-role","custom-usage-tag":"custom-usage-tag","data-deletion-request":"data-deletion-request",dashboard:"dashboard","dashboard-folder":"dashboard-folder","monitor-folder":"monitor-folder","ingestion-api-key":"ingestion-api-key",inventory:"inventory","log-route":"log-route","metric-route":"metric-route","span-route":"span-route",monitor:"monitor","notification-integration":"notification-integration","notification-rule":"notification-rule","adaptive-notification-rule":"adaptive-notification-rule","notification-silence":"notification-silence","operation-api-key":"operation-api-key","quality-report":"quality-report",queue:"queue","retention-policy":"retention-policy",rum:"rum","rum-public-token":"rum-public-token","sandbox-configuration":"sandbox-configuration",service:"service","service-target":"service-target",slo:"slo","tag-policy":"tag-policy",team:"team","user-invitation":"user-invitation"},QLe=Object.entries(WLe),EGt=new Map(QLe.flatMap(([e,t])=>t?[[t,e]]:[]));var bGt=[Kf,fp,fp.replace(`${pe}.`,"")];var wM=["red","orange","amber","yellow","green","emerald","teal","cyan","sky","blue","indigo","purple","pink"],vM=["light","dark"];var ZLe={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)"}},iJ=["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 PGt=ZLe.light.red.background;var sJ=12,aJ=2,cJ=2;var uJ=[{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:"188073512757127",isUsingLuhnAlgorithm:!1,regexp:"\\b[12](?:[0-9]{2}(?:0[1-9]|1[0-2])(?:2[AB]|[0-9]{2})[0-9]{6}[0-9]{2}| [0-9]{2} (?:0[1-9]|1[0-2]) (?:2[AB]|[0-9]{2}) [0-9]{3} [0-9]{3} [0-9]{2})\\b"},{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-----
273
+ `)}var zA=pn({accessToken:ix,accessExpiresAt:ix,refreshToken:bt(Se)}),Lke=Go(Ki(zA)),QZ=e=>Lke(e.trim()).pipe(st(()=>new lT({message:"The saved session is unreadable.",suggestions:["Sign in again to replace it: tsuga auth login"]}))),Mke=5*pd;function yM(e,t){let r=Date.parse(e.accessExpiresAt);return Number.isNaN(r)?!0:r<=t+Mke}function ZZ(e){if(e.flagKey)return{kind:"operation-api-key",token:e.flagKey,source:"flag"};if(e.environmentKey)return{kind:"operation-api-key",token:e.environmentKey,source:"environment"};if(e.operationApiKey)return{kind:"operation-api-key",token:e.operationApiKey,source:"config"};if(e.userAuth)return{kind:"user-session",userAuth:e.userAuth}}var XZ="tsuga-cli",Dke="Tsuga CLI session",ng=class extends it()("SecretStore",{make:mt(function*(){let t=process.platform==="linux"?yield*YZ({service:XZ,label:Dke}):yield*KZ(XZ);return{location:t.location,read:k(function*(r){let o=yield*t.read(r);return o===void 0?void 0:yield*QZ(o)}),save:(r,o)=>t.save(r,JSON.stringify(o)),remove:t.remove}})}){static layer=Do(this,this.make)};var fn=class e extends it()("common-cli/OutputFormatter"){static layer=lc(e)(JZ("rows"));static pageLayer=lc(e)(JZ("page"))};function JZ(e){return{rows:(t,r)=>mt(function*(){if(r.pretty??(yield*pT))return yield*DZ(t,r);yield*e==="page"?Oe({data:t,metadata:r.metadata},r.fields):Si(t,r.fields)})}}var Ua=class extends it()("GlobalFlags"){},eX=Ee("cli/Argv",{defaultValue:()=>process.argv.slice(2)});var tX="__tsuga_cluster_id__",Fke=n.Object({}),$ke=n.Object({status:n.Literal("error"),message:n.String({description:"Why this cluster failed to answer the query."})});function og(e=Fke){let t=D("status",[n.Object({...e.properties,status:n.Literal("ok")}),$ke]);return Object.assign(RO(gi,t),{description:'Outcome per cluster, keyed by cluster ID. A cluster that failed reports `status: "error"`.'})}var Gke=5,Hc=n.Array(p({allowEmpty:!1}),{minItems:1,maxItems:Gke,uniqueItems:!0,description:"IDs of the clusters to query, without duplicates. Mutually exclusive with `clusterId`. Omit both to use the default cluster."});var rX=n.Object({type:n.Literal("number"),number:n.String()}),Bke=n.Object({type:n.Literal("string"),string:n.String()}),jke=n.Object({type:n.Literal("timestamp"),timestamp:n.String()}),dT=D("type",[rX,Bke,jke]),qke=n.Object({by:n.Record(n.String(),dT),computed:n.Record(n.String(),rX)}),Hke=n.Object({type:n.Literal("buckets"),buckets:n.Array(qke),clusterResponses:n.Optional(og())}),Kke=n.Object({type:n.Literal("distribution"),bounds:n.Array(n.Number()),buckets:n.Array(n.Object({timestamp:n.Number(),counts:n.Array(n.Number())})),percentiles:n.Optional(n.Array(n.Number()))}),ig=D("type",[Hke,Kke]);var EM=["all","owning-team-and-public","owning-team-only"],ws=n.Enum(EM,{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 oX=1456444800,iX=4927737600,zke=oX*1e3,Yke=iX*1e3,YA=1704067200,VA=YA+3600,sX=YA*1e3,aX=VA*1e3,cX={title:"TimeRange",description:"Inclusive time range for telemetry queries. Use Unix timestamps in seconds unless the field description says milliseconds.",examples:[{from:YA,to:VA}]},Vke={title:"V2TimeRange",description:"Inclusive time range for telemetry queries using Unix timestamps in milliseconds.",examples:[{from:sX,to:aX}]},hd=(e,t=YA)=>n.Integer({description:e,examples:[t],minimum:oX,maximum:iX,format:"int64"}),nX=(e,t=sX)=>n.Integer({description:e,examples:[t],minimum:zke,maximum:Yke,format:"int64"}),Pr=n.Object({from:n.Optional(hd("Start of the query window as a Unix timestamp in seconds")),to:n.Optional(hd("End of the query window as a Unix timestamp in seconds",VA))},cX),nn=n.Object({from:hd("Start of the query window as a Unix timestamp in seconds"),to:hd("End of the query window as a Unix timestamp in seconds",VA)},cX),vo=n.Object({from:nX("Start of the query window as a Unix timestamp in milliseconds"),to:nX("End of the query window as a Unix timestamp in milliseconds",aX)},Vke);var Kc="/v0/logs";var WA=["CRITICAL","ERROR","WARN","NOTICE","INFO","DEBUG","TRACE"];var mT=0,TM=n.Object({__tsuga_metadata__:n.Object({id:n.String(),source:n.Optional(n.String())},{additionalProperties:!0}),context:n.Optional(n.Object({team:n.Optional(n.String({description:"Team name associated with this log."})),tag_policy_warnings:n.Optional(n.Record(n.String(),n.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:n.Optional(n.Unknown({description:"Log message after ingestion and route processing. It can be any JSON value because processors may map arbitrary data into `message`."})),timestamp:n.Number({description:"Log timestamp as a Unix timestamp in milliseconds."}),level:n.Enum(WA,{description:"Log severity, normalized from the source severity into one of the fixed Tsuga levels (ordered `CRITICAL` to `TRACE`)."}),[tX]:n.Optional(n.String({description:"ID of the cluster this log was read from. Only set when the request spanned several clusters."}))},{additionalProperties:!0}),pX=100,Wke="timestamp",Tp=n.Partial(n.Object({...Pr.properties,query:p({type:"tsuga-query",description:"Tsuga query used to filter logs in the selected time range."}),maxResults:n.Integer({minimum:1,maximum:1e3,description:"Maximum number of logs to return. Valid values are 1 through 1000."}),shouldRecommendAttributes:n.Boolean({description:"Whether Tsuga should return suggested attributes to highlight in results."}),triggeredBy:n.Literal("refresh",{description:"Indicates the query was triggered by a refresh action."}),startOffset:n.Number({minimum:mT,description:"Result offset used when fetching additional log rows."}),startOffsets:n.Array(n.Number({minimum:mT}),{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 ${mT} for every cluster.`}),clusterId:p({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}),clusterIds:Hc,sortBy:p({allowEmpty:!1,default:Wke,description:"Attribute to sort by. Attributes other than `timestamp` sort numerically; logs where the attribute is missing or not a number come last."}),sortDirection:me,useCanopy:n.Boolean()})),Z$t=f({tags:["logs"],url:`${Kc}/count`,method:"GET",query:n.Pick(Tp,["from","to","query","clusterId","clusterIds","useCanopy"]),response:n.Object({count:n.Number(),clusterResponses:n.Optional(og())})}),fT=n.Object({value:n.String(),priority:n.Number()}),X$t=f({tags:["logs"],url:`${Kc}/search`,method:"GET",query:Tp,response:n.Object({logs:n.Optional(n.Array(TM)),attributesToHighlight:n.Optional(n.Array(fT)),incomplete:n.Optional(n.Boolean({description:"True when attribute highlighting stopped early because too many distinct attributes were found."})),clusterResponses:n.Optional(og(n.Object({nextStartOffset:n.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})}),Qke=n.Cyclic({TokenOutput:n.Union([n.Object({type:n.Literal("top"),values:n.Array(n.String())}),n.Object({type:n.Literal("ip"),value:n.String()}),n.Object({type:n.Literal("range"),min:n.Number(),max:n.Number()}),n.Object({type:n.Literal("variable"),value:n.String()}),n.Object({type:n.Literal("text"),value:n.String()}),n.Object({type:n.Literal("date"),value:n.String()}),n.Object({type:n.Literal("url"),value:n.String()}),n.Object({type:n.Literal("structure"),key:n.Array(n.String()),value:n.Array(n.Ref("TokenOutput"))})])},"TokenOutput",{description:"A token identified as part of the pattern"}),lX=n.Object({id:n.String(),pattern:n.Array(Qke),size:n.Integer({description:"Number of logs that matched the pattern"}),examples:n.Array(n.Object({id:n.String(),timestampUnix:n.Number()})),timeDistribution:n.Array(n.Number()),staticFeatures:n.Array(n.Object({key:n.String(),value:n.String()},{description:"Fixed groups present in all logs matching the pattern"}))}),SM=n.Object({...Pr.properties,query:p({type:"tsuga-query"}),clusteringThreshold:n.Optional(n.Number()),clusterId:n.Optional(p({allowEmpty:!1})),useCanopy:n.Optional(n.Boolean())}),J$t=f({tags:["logs"],url:`${Kc}/patterns`,method:"GET",query:SM,response:n.Object({patterns:n.Array(lX),sampleSize:n.Number()})}),dX=n.Object({id:n.String(),volume:n.Integer({description:"Number of logs in the cluster"}),levels:n.Array(n.Enum(WA)),signatures:n.Array(n.Object({signature:n.String(),volume:n.Integer()}))}),e1t=f({tags:["logs"],url:`${Kc}/patterns/clusters`,method:"GET",query:SM,response:n.Object({clusters:n.Array(dX),totalVolume:n.Integer()})}),Zke=50,t1t=f({tags:["logs"],url:`${Kc}/patterns/details`,method:"POST",body:n.Object({...SM.properties,clusters:n.Array(dX,{maxItems:Zke})}),response:n.Object({patterns:n.Array(lX),sampleSize:n.Number()})}),r1t=f({tags:["logs"],url:`${Kc}/attributes`,method:"GET",query:n.Object({...Pr.properties,clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"})),clusterIds:n.Optional(Hc),useCanopy:n.Optional(n.Boolean()),search:n.Optional(p({allowEmpty:!1,description:"Return only attribute dot-paths containing this text, case-insensitively"}))}),response:n.Object({attributes:n.Array(n.String()),clusterResponses:n.Optional(og())})});var mX="timestamp";var uX=`${mX}_iso`;var Xke=["pending","running","completed","incomplete","failed"],fX=n.Object({id:n.String({description:"ID of the export."}),status:n.Enum(Xke,{description:"Lifecycle of the export. `pending` until the download is claimed, `running` while the CSV streams, then `completed`, `incomplete` when the file is usable but some matched logs could not be reached, or `failed` if the export was interrupted."}),rowsWritten:n.Number({description:"Logs written to the CSV so far. Updated periodically while the download streams, so it lags slightly behind the bytes on the wire."}),totalRows:n.Number({description:"Logs this export will write, already clamped to the export maximum. Use it as the denominator for progress."}),isTruncated:n.Boolean({description:"Whether the query matched more logs than the export maximum, so the CSV holds only the first logs in the requested sort order."}),errorMessage:n.Optional(n.String({description:"Why the export is incomplete or failed."}))}),n1t=f({tags:["logs"],url:`${Kc}/exports`,method:"POST",body:n.Object({...n.Pick(Tp,["from","to","query","clusterId","clusterIds","sortBy","sortDirection"]).properties,columns:n.Array(p({allowEmpty:!1}),{minItems:1,description:`Log attributes to write as CSV columns, in order. Each becomes one column, resolved against the log with dotted-path lookup. Including \`${mX}\` also writes a \`${uX}\` column next to it, holding the same instant in ISO 8601.`}),timezone:n.Optional(n.String({format:id,description:`IANA timezone the \`${uX}\` column is offset to (e.g. \`Europe/Paris\`). Defaults to UTC.`}))}),response:n.Object({...fX.properties,downloadUrl:n.String({description:"Relative URL to fetch the CSV from. It carries a single-use token that expires shortly after creation, so the caller must start the download immediately."})})}),o1t=f({tags:["logs"],url:`${Kc}/exports/:exportId`,method:"GET",params:n.Object({exportId:n.String()}),response:fX}),i1t=f({tags:["logs"],url:`${Kc}/exports/:exportId/download`,method:"GET",params:n.Object({exportId:n.String()}),query:n.Object({token:p({allowEmpty:!1,type:"long",description:"Single-use token minted when the export was created."})}),response:n.String({description:"CSV file, streamed as it is produced."})});var zc="/v0/metrics",Jke=n.Object({__tsuga_metadata__:n.Object({},{additionalProperties:!0}),context:n.Optional(n.Object({},{additionalProperties:!0})),message:n.Optional(n.String()),timestamp:n.Number(),level:n.Enum(WA)},{additionalProperties:!0}),d1t=f({tags:["metrics"],url:`${zc}/count`,method:"GET",query:n.Pick(Tp,["from","to","query","clusterId"]),response:n.Object({count:n.Number()})}),m1t=f({tags:["metrics"],url:`${zc}/search`,method:"GET",query:Tp,response:n.Object({logs:n.Optional(n.Array(Jke)),totalHits:n.Optional(n.Number()),attributesToHighlight:n.Optional(n.Array(fT))},{additionalProperties:!0})}),QA=n.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."}),ZA=n.Enum(["delta","cumulative","none"],{description:"Metric temporality. `delta` reports changes per collection interval, `cumulative` reports running totals, and `none` means temporality is not applicable or unknown."}),_M=["gauge","cumulative-counter","delta-counter","cumulative-histogram","delta-histogram","summary"],gX=n.Enum(_M,{description:"Type and temporality of one variant of a metric. The same metric name can be reported under several kinds, for instance by two services instrumented differently."}),hX=n.Number({description:"Timestamp of the most recent data point recorded for this metric, in milliseconds since the Unix epoch. Omitted when Tsuga has no record of it. Computed from a periodically refreshed metadata snapshot, so it can lag ingestion by a few minutes and should not be used to detect sub-minute gaps."}),yX=n.Array(n.String(),{description:"Team values observed on this metric across the most recent data generations kept by the metric catalog. Omitted when the catalog has no team statistics for the metric yet."}),XA=n.Number({description:"Estimated number of distinct series for this metric across the most recent data generations kept by the metric catalog. Omitted when the catalog has no statistics for the metric yet."}),eLe=n.Record(n.String(),n.Number(),{description:"Estimated number of distinct values per attribute over the same window as `seriesCardinality`, keyed like `tags`."}),tLe=n.Object({capabilities:n.Optional(n.Array(n.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:n.Optional(n.String({description:"Human-readable description of the metric"})),tags:n.Optional(n.Array(n.String(),{description:"Attribute names available as dimensions for filtering or grouping this metric. Exposed publicly as `attributes`."})),temporality:n.Optional(ZA),type:n.Optional(QA),unit:n.Optional(n.String({description:"Metric unit reported by instrumentation or inferred metadata."})),lastSeen:n.Optional(hX),teams:n.Optional(yX),seriesCardinality:n.Optional(XA),attributeCardinalities:n.Optional(eLe)}),f1t=f({url:`${zc}/metadata`,method:"GET",query:n.Object({...Pr.properties,metricName:p({allowEmpty:!1}),kind:n.Optional(gX),clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:tLe}),g1t=f({tags:["metrics"],url:zc,method:"GET",query:n.Object({...Pr.properties,clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:n.Array(n.String())}),EX=n.Array(n.Object({name:n.String({description:"Metric name observed by Tsuga."}),kind:gX,type:QA,temporality:n.Optional(ZA),lastSeen:n.Optional(hX),teams:n.Optional(yX),seriesCardinality:n.Optional(XA)}),{description:"Metric variants observed in the requested time range. A name appears once per kind it was reported as."}),rLe=[{name:"http.server.request.duration",kind:"cumulative-histogram",type:"histogram"},{name:"http.server.request.duration",kind:"delta-histogram",type:"histogram"},{name:"http.server.active_requests",kind:"gauge",type:"gauge"},{name:"http.server.request.count",kind:"delta-counter",type:"counter"}];Object.assign(EX,{examples:[rLe]});var h1t=f({tags:["metrics"],url:`${zc}/names-and-types`,method:"GET",query:n.Object({...Pr.properties,clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:EX}),gT=n.Array(n.String(),{description:"Attribute names available as dimensions for filtering or grouping the requested metric(s)."}),nLe=["service","env","host","method","status_code"];Object.assign(gT,{examples:[nLe]});var y1t=f({tags:["metrics"],url:`${zc}/attributes`,method:"GET",query:n.Object({...Pr.properties,metricName:p({allowEmpty:!1}),clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:gT}),E1t=f({tags:["metrics"],url:`${zc}/attributes/batch`,method:"GET",query:n.Object({...Pr.properties,metricNames:n.Array(p({allowEmpty:!1}),{minItems:1,description:"Metric names to fetch attributes for"}),clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:gT}),IM=n.Object({assets:n.Array(n.Object({type:n.Enum(["dashboard","monitor"],{description:"Kind of asset referencing the metric."}),id:n.String({description:"Dashboard or monitor ID for the asset that queries this metric."}),name:n.String({description:"Display name of the referencing dashboard or monitor."}),owner:n.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."})}),T1t=f({tags:["metrics"],url:`${zc}/assets-usage`,method:"GET",query:n.Object({metricName:p({allowEmpty:!1})}),response:IM}),S1t=f({url:`${zc}/per-attribute`,method:"GET",query:n.Object({from:n.Optional(n.Number()),to:n.Optional(n.Number()),attribute:p(),clusterId:n.Optional(p({allowEmpty:!1}))}),response:n.Array(n.String())});var sLe="/v0/aggregation",aLe=n.Union([n.Literal("a"),n.Literal("d"),n.Literal("q"),n.Literal("w"),n.Literal("t")]),yT=n.Object({parallelism:n.Number(),engine:aLe,recordBatchCache:n.Optional(n.Boolean()),includeNullGroups:n.Optional(n.Boolean()),restartAwareGaugeSum:n.Optional(n.Boolean())}),bM=["logs","metrics","traces"];var _X={logs:"Logs",metrics:"Metrics",traces:"Spans"},cLe=[...bM,"connections","log-patterns","spans","rum"];var v1t={..._X,connections:"Connections","log-patterns":"Log Patterns",spans:"Spans",rum:"RUM events"},wa=[...bM,"rum"];var N1t={..._X,rum:"RUM events"};var k1t=n.Enum(cLe,{description:"Data source being queried"}),L1t=n.Enum(bM,{description:"Telemetry source queried by this aggregation: `logs`, `metrics`, or `traces`."}),_i=n.Enum(wa,{description:"Telemetry source queried by this aggregation: `logs`, `metrics`, `traces`, or `rum`."}),yd=n.String({description:"Attribute containing the values to aggregate"}),sg=p({description:"Attribute containing the values to aggregate"}),uLe=D("type",[n.Object({type:n.Literal("count",{description:"Counts the total number of records"}),field:n.Optional(yd)},{$id:"AggregateCount",title:"Count"}),n.Object({type:n.Literal("unique-count",{description:"Counts the distinct values of the field"}),field:yd},{$id:"AggregateUniqueCount",title:"UniqueCount"}),n.Object({type:n.Literal("average",{description:"Calculates the average value of the selected field"}),field:yd},{$id:"AggregateAverage",title:"Average"}),n.Object({type:n.Literal("max",{description:"Finds the largest value of the field"}),field:yd},{$id:"AggregateMax",title:"Max"}),n.Object({type:n.Literal("min",{description:"Finds the smallest value of the field"}),field:yd},{$id:"AggregateMin",title:"Min"}),n.Object({type:n.Literal("sum",{description:"Sums the values of the selected field"}),field:yd},{$id:"AggregateSum",title:"Sum"}),n.Object({type:n.Literal("percentile",{description:"Calculates a percentile of the selected field"}),field:yd,percentile:n.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`, which needs it only when `dataSource` is `metrics`."}),pLe=D("type",[n.Object({type:n.Literal("count",{description:"Counts the total number of records"}),field:n.Optional(p({description:"Metric to count when `dataSource` is `metrics`, where it is required: without it the query fails with `count aggregate requires a non-empty field`. On `logs`, `traces` and `rum`, `count` counts records and ignores this field."}))},{$id:"InputAggregateCount",title:"Count"}),n.Object({type:n.Literal("unique-count",{description:"Counts the distinct values of the field"}),field:sg},{$id:"InputAggregateUniqueCount",title:"UniqueCount"}),n.Object({type:n.Literal("average",{description:"Calculates the average value of the selected field"}),field:sg},{$id:"InputAggregateAverage",title:"Average"}),n.Object({type:n.Literal("max",{description:"Finds the largest value of the field"}),field:sg},{$id:"InputAggregateMax",title:"Max"}),n.Object({type:n.Literal("min",{description:"Finds the smallest value of the field"}),field:sg},{$id:"InputAggregateMin",title:"Min"}),n.Object({type:n.Literal("sum",{description:"Sums the values of the selected field"}),field:sg},{$id:"InputAggregateSum",title:"Sum"}),n.Object({type:n.Literal("percentile",{description:"Calculates a percentile of the selected field"}),field:sg,percentile:n.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`, which needs it only when `dataSource` is `metrics`."}),IX=n.Object({type:n.Literal("per-second",{description:"Normalizes the metric to events per second"})},{$id:"FunctionPerSecond",title:"PerSecond"}),bX=n.Object({type:n.Literal("per-minute",{description:"Normalizes the metric to events per minute"})},{$id:"FunctionPerMinute",title:"PerMinute"}),xX=n.Object({type:n.Literal("per-hour",{description:"Normalizes the metric to events per hour"})},{$id:"FunctionPerHour",title:"PerHour"}),OX=n.Object({type:n.Literal("rate",{description:"Calculates the rate of change"})},{$id:"FunctionRate",title:"Rate"}),AX=n.Object({type:n.Literal("increase",{description:"`Increase` is designed for cumulative metrics. It computes the increase of cumulative metrics by automatically handling counter resets. When used with an aggregation such as `sum` it combines all series without requiring an explicit group-by."})},{$id:"FunctionIncrease",title:"Increase"}),CX=n.Object({type:n.Literal("power",{description:"Raises values to a specified power"}),exponent:n.Integer({description:"The exponent to raise values to"})},{$id:"FunctionPower",title:"Power"}),RX=n.Object({type:n.Literal("sqrt",{description:"Applies a square root transformation to the values"})},{$id:"FunctionSqrt",title:"Sqrt"}),PX=n.Object({type:n.Literal("last",{description:"Takes the last value of the metric for the selected time frame"})},{$id:"FunctionLast",title:"Last"}),UX=n.Object({type:n.Literal("cumsum",{description:"Cumulative sum of the values over the time frame. Computed by the Tsuga web app only: the aggregation API ignores it and returns the raw values."})},{$id:"FunctionCumsum",title:"Cumsum"}),lLe=n.Object({type:n.Literal("log",{description:"Applies a logarithm transformation to the values"}),base:n.Integer({description:"The base of the logarithm"})},{$id:"FunctionLog",title:"Log"}),dLe=n.Object({type:n.Literal("log",{description:"Applies a logarithm transformation to the values"}),base:n.Integer({description:"The base of the logarithm",minimum:2})},{$id:"InputFunctionLog",title:"Log"}),mLe=n.Object({type:n.Literal("time-offset",{description:"Shifts a query's data backward by a specified duration for easy comparison over different periods of time."}),seconds:n.Integer({description:"Number of seconds to offset"})},{$id:"FunctionTimeOffset",title:"TimeOffset"}),fLe=n.Object({type:n.Literal("time-offset",{description:"Shifts a query's data backward by a specified duration for easy comparison over different periods of time."}),seconds:n.Integer({description:"Number of seconds to offset",minimum:1})},{$id:"InputFunctionTimeOffset",title:"TimeOffset"}),gLe=D("type",[IX,bX,xX,OX,AX,lLe,CX,RX,PX,mLe,UX],{title:"Function",description:"Post-processing function applied to an aggregation query result after the aggregate is computed, selected by `type`."}),hLe=D("type",[IX,bX,xX,OX,AX,dLe,CX,RX,PX,fLe,UX],{title:"InputFunction",description:"Post-processing function applied to an aggregation query result after the aggregate is computed, selected by `type`."});var TX=n.Object({min:n.Number({description:"Lower bound of the distribution range."}),max:n.Number({description:"Upper bound of the distribution range."})}),yLe=["linear","log"],hT=n.Enum(yLe,{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."}),ELe=1e3,SX=n.Integer({minimum:1,maximum:ELe}),JA={pattern:"^0*[1-9]\\d*[smhdw]$",errorMessage:{pattern:'must be a positive whole number followed by s, m, h, d or w, such as "10s", "1m" or "1h".'}},TLe=D("type",[n.Object({type:n.Literal("scalar")},{title:"Scalar",description:"Returns a single value"}),n.Object({type:n.Literal("timeseries"),aggregationWindow:n.String({...JA,description:'Time bucket size for aggregation (e.g. "10s", "60s", "1m")'})},{title:"Timeseries",description:"Returns a time series"}),n.Object({type:n.Literal("histogram"),by:n.Optional(p()),bucketCount:n.Optional(SX),bounds:n.Optional(TX),boundsScale:n.Optional(hT),percentiles:n.Optional(n.Array(n.Integer({minimum:0,maximum:100}),{minItems:1,maxItems:100}))},{title:"Histogram",description:"Returns a single distribution over the entire time range"}),n.Object({type:n.Literal("heatmap"),aggregationWindow:n.String({...JA,description:'Time bucket size for the heatmap (e.g. "10s", "60s", "1m")'}),by:n.Optional(p()),bucketCount:n.Optional(SX),bounds:n.Optional(TX),boundsScale:n.Optional(hT)},{title:"Heatmap",description:"Returns a distribution per time window"})]),eC=15,M1t=128*1024,SLe=["zero","null"],_Le=n.Enum(SLe,{description:"`zero` fills missing points with zero. `null` keeps missing points null."}),wX=n.Object({mode:n.Object({type:_Le},{description:"How missing aggregation points should be filled."})},{description:"Missing-point fill behavior for aggregation results. Optional; omit to keep missing points null."}),ILe=["avg","sum","min","max","last"],vX=n.Enum(ILe,{description:"Per-series rollup applied within each time bucket before the cross-series aggregate. Use it on metric queries when `aggregate.type` is `sum` and no `rate`, `increase`, or `last` function is present. When omitted, Tsuga derives the rollup from the metric type."});var NX=n.Enum(_M,{description:"Variant of the metric in `aggregate.field` to query, for metric names reported under several kinds (for instance both cumulative and delta). When omitted, Tsuga picks one variant by type and temporality precedence."}),kX={aggregate:uLe,functions:n.Optional(n.Array(gLe,{description:"Post-processing functions applied to aggregation results"})),fill:n.Optional(wX),timeAggregate:n.Optional(vX),metricKind:n.Optional(NX)},LX={aggregate:pLe,functions:n.Optional(n.Array(hLe,{maxItems:10,description:"Post-processing functions applied to aggregation results. Defaults to an empty array when omitted."})),fill:n.Optional(wX),timeAggregate:n.Optional(vX),metricKind:n.Optional(NX)},bLe={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."},MX={minItems:1,maxItems:eC,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").'},DX=n.Array(n.Object({...kX,filter:n.Optional(n.String({description:"Filter to apply to the aggregation"}))},{title:"AggregationQuery"}),bLe),ET=n.Array(n.Object({...LX,filter:n.Optional(p({type:"tsuga-query",description:"Tsuga query filter to apply to the aggregation. Defaults to an empty string when omitted."}))},{title:"AggregationQuery"}),MX),TT=n.Array(n.Object({...kX,filter:n.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."}),tC=n.Array(n.Object({...LX,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."}),{...MX,description:"Aggregation queries used by alerting. Each query is referenced from formulas as q1, q2, and so on."}),FX=n.Array(n.Omit(tC.items,["fill"],{title:"SloAggregationQuery",description:"Single aggregation query evaluated by an SLO."}),{minItems:1,maxItems:eC,description:"Aggregation queries used by SLO evaluation. Each query is referenced from formulas as q1, q2, and so on."});var rC=n.String({description:"Formula referencing submitted query outputs, such as `q1 + q2`. References must be within `q1` through `qN` for the submitted queries."}),Ed=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. Only `+`, `-`, `*`, `/` and parentheses over query references and numbers are supported, with no functions such as `max()`."}),xLe=n.Object({fields:n.Array(n.String(),{description:"Telemetry attribute names used to group aggregation results."}),limit:n.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:n.Optional(me),replaceNullWith:n.Optional(n.String({description:"Value used to group documents that have no value for a grouped field."}))},{title:"AggregationGroupBy"}),OLe=n.Object({fields:n.Array(p(),{maxItems:1,description:"Telemetry attribute name to group aggregation results by at this grouping level. To group by several attributes, send one `groupBy` entry per attribute: entries nest, outermost first.",errorMessage:{maxItems:'must hold one field. To group by several fields, send one groupBy entry per field: they nest, outermost first, such as [{"fields": ["context.service.name"], "limit": 10}, {"fields": ["level"], "limit": 5}].'}}),limit:n.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:n.Optional(me),replaceNullWith:n.Optional(p({allowEmpty:!1,description:"Value used to group documents that have no value for a grouped field."}))},{title:"AggregationGroupBy"}),$X=7;var ag=n.Array(xLe,{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."}),Yc=n.Array(OLe,{maxItems:$X,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 D1t=f({tags:["aggregation"],url:`${sLe}/multi-query`,method:"POST",body:n.Object({timeRange:vo,queries:ET,groupBy:n.Optional(Yc),returnType:TLe,dataSource:_i,formula:Ed,executionOptions:yT,triggeredBy:n.Optional(n.Literal("refresh")),shouldStreamResults:n.Optional(n.Boolean()),clusterId:n.Optional(p({allowEmpty:!1})),clusterIds:n.Optional(Hc),viewAs:n.Optional(n.Object({owner:p({allowEmpty:!1,description:"Team ID to fetch data as"}),permissions:ws}))}),response:ig});var GX=`/${"v1"}/aggregation`,BX=`/${"v2"}/aggregation`,jX=n.Object({id:n.String({description:"Result identifier. Query results use `q1`, `q2`, and so on; formula results use `value`."}),group:n.Record(n.String(),n.Union([n.String(),n.Number()]),{description:"Group-by field values for this result. Empty when no group-by is requested."})}),qX=n.Object({results:n.Array(n.Object({...jX.properties,value:n.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."}),ALe={results:[{id:"q1",group:{host:"server-1"},value:123.45}]};Object.assign(qX,{examples:[ALe]});var nC=n.Object({series:n.Array(n.Object({...jX.properties,points:n.Array(n.Object({timestamp:n.Integer({description:"Unix timestamp in milliseconds for this point, spaced by `aggregationWindow`."}),value:n.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."}),CLe={series:[{id:"q1",group:{host:"server-1"},points:[{timestamp:16094592e5,value:123.45},{timestamp:160945926e4,value:456.78}]}]};Object.assign(nC,{examples:[CLe]});var HX=n.Record(n.String(),n.Union([n.String(),n.Number()]),{description:"Group-by field values for this row, keyed by field name. Empty when no group-by is requested."}),KX="Keyed by result id: `q1`, `q2`, and so on for each query in submission order, plus `f1`, `f2`, and so on for each entry of `formulas` in submission order, or `value` for a PromQL query. Every row has the same keys.",zX=n.Object({results:n.Array(n.Object({group:HX,values:n.Record(n.String(),n.Union([n.Number(),n.Null()]),{description:`Aggregated values over the full time range, \`null\` where the group has none. ${KX}`})},{title:"ScalarResultV2"}),{description:"One row per group, in group-by sort order (largest first unless `sortOrder` says otherwise)."})},{$id:"ScalarAggregationResponseV2",title:"ScalarAggregationResponseV2",description:"Scalar aggregation response with one row per group."}),RLe={results:[{group:{"context.host.name":"web-1"},values:{q1:12,q2:1e3,f1:1.2}},{group:{"context.host.name":"web-2"},values:{q1:3,q2:500,f1:.6}}]};Object.assign(zX,{examples:[RLe]});var oC=n.Object({timestamps:n.Array(n.Integer(),{description:"Start of each time bucket as a Unix timestamp in milliseconds, ascending, spaced by `aggregationWindow` (`step` for PromQL) from the first bucket with data to the last. Every `values` array in `series` aligns with it index by index."}),series:n.Array(n.Object({group:HX,values:n.Record(n.String(),n.Array(n.Union([n.Number(),n.Null()])),{description:`One value per entry of \`timestamps\`, \`null\` where the bucket has none. ${KX}`})},{title:"SeriesV2"}),{description:"One series per group, in group-by sort order for aggregation queries and in no particular order for PromQL."})},{$id:"TimeseriesAggregationResponseV2",title:"TimeseriesAggregationResponseV2",description:"Timeseries aggregation response: a shared time axis and one series per group aligned to it."}),PLe={timestamps:[16094592e5,160945926e4,160945932e4],series:[{group:{"context.host.name":"web-1"},values:{q1:[12,null,7],q2:[1e3,900,1400],f1:[1.2,null,.5]}}]};Object.assign(oC,{examples:[PLe]});var ULe=n.Omit(ET.items,["fill"],{title:"AggregationQuery",description:"Aggregation query. Omit `filter` for an unfiltered query and omit `functions` when no post-processing is needed."}),wLe=n.Optional(Yc),YX={timeRange:nn,queries:n.Array(ULe,{maxItems:eC,description:'Aggregations that may be combined together in the same query. Each item is referenced from formulas 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").'}),groupBy:wLe,dataSource:_i},VX={...YX,formula:n.Optional(Ed)},WX={...YX,timeRange:vo,formulas:n.Optional(n.Array(p({type:"tsuga-formula",allowEmpty:!1,description:"Formula over the query results, such as `q1 / q2 * 100`. Only `+`, `-`, `*`, `/` and parentheses over query references (`q1` through `qN`) and numbers are supported; an undefined query reference returns 400."}),{maxItems:1,description:"Formulas computed from the query results, returned beside them as `f1`, `f2`, and so on in submission order. At most one for now."}))},Xi=n.Object({clusterId:n.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))}),QX=n.Object(VX,{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."}),vLe={timeRange:{from:1782201500,to:1782203400},dataSource:"logs",queries:[{aggregate:{type:"count"},filter:"context.service.name:checkout"}],groupBy:[{fields:["level"],limit:5}]};Object.assign(QX,{examples:[vLe]});var ZX=n.Object(WX,{description:"Scalar aggregation request. Provide a time range in milliseconds, one or more queries, a telemetry data source, and optional grouping or formulas. Omit `groupBy` for ungrouped results. Send `clusterId` as a query parameter, not in the JSON body."}),XX={timeRange:{from:17822015e5,to:17822034e5},dataSource:"logs",queries:[{aggregate:{type:"count"},filter:"context.service.name:checkout AND level:error"},{aggregate:{type:"count"},filter:"context.service.name:checkout"}],groupBy:[{fields:["context.host.name"],limit:5}],formulas:["q1 / q2 * 100"]};Object.assign(ZX,{examples:[XX]});var iC=f({description:"Computes counts, unique counts, sums, averages, min/max or percentiles (p50, p95, p99), one value per group. Runs over logs, traces (spans), metrics or RUM (real user monitoring) events filtered with Tsuga query syntax, and supports group-by on any attribute, top-N breakdowns, per-second or per-minute rates and formulas. For values over time, use the timeseries aggregation. See [Analytics queries](/documentation/visualize/analytics/queries).",operationId:"aggregateScalar",tags:["public","aggregation"],url:`${GX}/multi-query/scalar`,method:"POST",body:QX,query:Xi,response:qX}),K1t=f({description:"Runs one or more aggregation queries over logs, metrics, traces, or RUM events and returns one row per group with every query result in it. Same request as `POST /v1/aggregation/multi-query/scalar`, with `timeRange` in milliseconds and formulas given as the `formulas` list and returned as `f1`. See [Analytics queries](/documentation/visualize/analytics/queries).",operationId:"aggregateScalarV2",tags:["public","aggregation"],url:`${BX}/multi-query/scalar`,method:"POST",body:ZX,query:Xi,response:zX}),JX=n.String({...JA,maxLength:Ei,description:"Time bucket size for timeseries aggregation, such as `10s`, `1m`, or `1h`."}),eJ=n.Object({...VX,aggregationWindow:JX},{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."}),NLe={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(eJ,{examples:[NLe]});var tJ=n.Object({...WX,aggregationWindow:JX},{description:"Timeseries aggregation request. Provide a time range in milliseconds, bucket size, one or more queries, a telemetry data source, and optional grouping or formulas. Omit `groupBy` for ungrouped series. Send `clusterId` as a query parameter, not in the JSON body."}),kLe={...XX,aggregationWindow:"1m"};Object.assign(tJ,{examples:[kLe]});var sC=f({description:"Charts counts, unique counts, sums, averages, min/max or percentiles (p50, p95, p99) over time, one series per group. Runs over logs, traces (spans), metrics or RUM (real user monitoring) events filtered with Tsuga query syntax, bucketed by `aggregationWindow`, with group-by on any attribute, per-second or per-minute rates and formulas. For one value per group, use the scalar aggregation. See [Analytics queries](/documentation/visualize/analytics/queries).",operationId:"aggregateTimeseries",tags:["public","aggregation"],url:`${GX}/multi-query/timeseries`,method:"POST",body:eJ,query:Xi,response:nC}),z1t=f({description:"Runs one or more aggregation queries over logs, metrics, traces, or RUM events and returns one shared time axis in milliseconds with one series per group aligned to it. Use `aggregationWindow` to choose the time bucket size. Same request as `POST /v1/aggregation/multi-query/timeseries`, with `timeRange` in milliseconds and formulas given as the `formulas` list and returned as `f1`. See [Analytics queries](/documentation/visualize/analytics/queries).",operationId:"aggregateTimeseriesV2",tags:["public","aggregation"],url:`${BX}/multi-query/timeseries`,method:"POST",body:tJ,query:Xi,response:oC});var LLe=["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS","TRACE"],rJ=k(function*(e,t,r,o,i){let{body:s,params:a,query:u}=o,l=r.url??(r.buildUrl&&a?r.buildUrl(a):void 0),d=LLe.find(g=>g===r.method);return l===void 0||d===void 0?yield*new Us({message:`Internal error: endpoint ${r.operationId??r.method} is not callable`}):Vx(d)(M7(`${e}${l}`,u),{headers:{Accept:"application/json","User-Agent":MLe(t),[SA]:t,[jL]:"1.198.0",[qL]:"bab9341130",[HL]:"2026-11-13T15:20:48.914Z",...i},...s?{body:Sk(s)}:{}})});function MLe(e){return`${e==="cli"?"tsuga-cli":"tadmin"}/1.198.0 (${process.platform}; node ${process.versions.node})`}var DLe=["allowed-domains","audit-log-stream-destination","billing","cluster-integration-config","custom-role","custom-usage-tag","database","databricks-connection","explorer-saved-view","github-connection","inventory","llm-provider","monitor-alert","monitor-debugging","oauth-grant","org","queue","retention-policy","saml-config","sensitive-data-scanner-rule","service","service-target","team-remap-config","user-self","widget-share"],FLe=["adaptive-notification-rule","audit-log","cloud-account","dashboard-folder","monitor-folder","dashboard-report","dashboard-share","dashboard","data-deletion-request","ingestion-api-key","investigation","log-route","metric-route","monitor","notebook","notification-integration","notification-rule","notification-silence","operation-api-key","quality-report","rum-public-token","sandbox-configuration","slo","span-route","synthetic-test","synthetic-variable","tag-policy","team","user-data","user-invitation","user-permissions"],OM=["log","metric","trace","rum"],AM=[...FLe,...OM],$Le=[...DLe,...AM];var cg=["admin","public_editor","public_viewer","teams_only"],nJ=[...cg,"custom"],Ji=["admin","editor","viewer"];var Td="/v0/team-membership",CM="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.",ST=n.Object({id:n.String({description:"Tsuga-generated team membership ID assigned when the membership is created."}),userId:n.String({description:"User ID that belongs to the team."}),teamId:n.String({description:"Team ID that contains the user."}),roleKey:n.Enum(Ji,{description:CM})}),cC=n.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:n.Enum(Ji,{description:CM})}),RM=n.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."})}),GLe=n.Optional(n.Object({userId:n.Optional(p({allowEmpty:!1,description:"Restrict results to memberships for this user ID."})),teamId:n.Optional(p({allowEmpty:!1,description:"Restrict results to memberships for this team ID."}))})),nGt=f({tags:["access-control"],url:Td,method:"GET",query:GLe,response:n.Array(ST)}),oGt=f({tags:["access-control"],url:Td,method:"POST",body:cC,response:ST}),iGt=f({tags:["access-control"],url:Td,method:"PUT",body:cC,response:ST}),sGt=f({tags:["access-control"],url:Td,method:"DELETE",body:RM,response:B}),aC=500,uC=n.Object({teamId:p({allowEmpty:!1,description:"Team ID receiving all requested memberships."}),members:n.Array(n.Object({userId:n.Optional(p({allowEmpty:!1,description:"Existing user ID to add to the team."})),userEmail:n.Optional(p({allowEmpty:!1,type:"email",description:"Existing user email to resolve and add to the team."})),roleKey:n.Enum(Ji,{description:CM})},{oneOf:[{required:["userId"]},{required:["userEmail"]}]}),{minItems:1,maxItems:aC,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."}),BLe={teamId:"team-123-abc",members:[{userId:"user-123-abc",roleKey:"viewer"},{userEmail:"sam@example.com",roleKey:"editor"}]};Object.assign(uC,{examples:[BLe]});var pC=n.Object({results:n.Array(n.Object({userId:n.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:n.Enum(["added","already_member","user_not_found"],{description:"`added` means the membership was created, `already_member` means no change was needed, and `user_not_found` means Tsuga could not resolve the requested user."})}))},{description:"Per-user result summary for a bulk team-membership add request."}),jLe={results:[{userId:"user-123-abc",status:"added"},{userId:"sam@example.com",status:"user_not_found"}]};Object.assign(pC,{examples:[jLe]});var aGt=f({tags:["access-control"],url:`${Td}/bulk-add`,method:"POST",body:uC,response:pC}),cGt=f({tags:["access-control"],url:`${Td}/bulk-update-user-roles`,method:"PUT",body:n.Object({userIds:n.Array(p({allowEmpty:!1}),{minItems:1,maxItems:aC}),teamId:p({allowEmpty:!1}),role:n.Enum(Ji)}),response:n.Object({})}),lC=n.Object({teamId:p({allowEmpty:!1,description:"Team ID to remove the requested users from."}),userIds:n.Optional(n.Array(p({allowEmpty:!1}),{minItems:1,maxItems:aC,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:n.Optional(n.Array(p({allowEmpty:!1,type:"email"}),{minItems:1,maxItems:aC,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."}),qLe={teamId:"team-123-abc",userIds:["user-123-abc"]};Object.assign(lC,{examples:[qLe]});var dC=n.Object({results:n.Array(n.Object({userId:n.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:n.Enum(["removed","not_member","user_not_found"],{description:"`removed` means the membership was deleted, `not_member` means no membership existed, and `user_not_found` means Tsuga could not resolve the requested user."})}))},{description:"Per-user result summary for a bulk team-membership removal request."}),HLe={results:[{userId:"user-123-abc",status:"removed"},{userId:"missing@example.com",status:"user_not_found"}]};Object.assign(dC,{examples:[HLe]});var uGt=f({tags:["access-control"],url:`${Td}/bulk-remove`,method:"DELETE",body:lC,response:dC});var KLe={"sandbox-configuration":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"github-connection":{read:["admin"],write:["admin"]},"llm-provider":{read:["admin"],write:["admin"]},investigation:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"ingestion-api-key":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"rum-public-token":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"widget-share":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"dashboard-share":{read:["public_viewer","public_editor","admin"],write:["admin"]},"audit-log":{read:["public_viewer","public_editor","admin"],write:[]},"custom-role":{read:["public_viewer","public_editor","admin"],write:["admin"]},"custom-usage-tag":{read:["public_viewer","public_editor","admin"],write:["admin"]},"cluster-integration-config":{read:["admin"],write:["admin"]},"explorer-saved-view":{read:["public_viewer","public_editor","admin"],write:["public_viewer","public_editor","admin"]},"operation-api-key":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"cloud-account":{read:["public_viewer","public_editor","admin"],write:["admin"]},dashboard:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"dashboard-folder":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"monitor-folder":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"dashboard-report":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},notebook:{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"]},"span-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"]},"audit-log-stream-destination":{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"]},billing:{read:["admin"],write:[]},"data-deletion-request":{read:["admin"],write:["admin"]},"sensitive-data-scanner-rule":{read:["public_viewer","public_editor","admin"],write:["admin"]},slo:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"synthetic-test":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"synthetic-variable":{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"]},database:{read:["public_viewer","public_editor","admin"],write:[]},queue:{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-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:[]}},zLe={"sandbox-configuration":{read:["viewer","editor","admin"],write:["editor","admin"]},"github-connection":{read:["admin"],write:[]},"llm-provider":{read:[],write:[]},investigation:{read:["viewer","editor","admin"],write:["editor","admin"]},"ingestion-api-key":{read:["viewer","editor","admin"],write:["editor","admin"]},"rum-public-token":{read:["viewer","editor","admin"],write:["editor","admin"]},"widget-share":{read:["viewer","editor","admin"],write:["viewer","editor","admin"]},"dashboard-share":{read:["viewer","editor","admin"],write:["admin"]},"audit-log":{read:["viewer","editor","admin"],write:[]},"custom-role":{read:["viewer","editor","admin"],write:[]},"custom-usage-tag":{read:[],write:[]},"cluster-integration-config":{read:[],write:[]},"explorer-saved-view":{read:["viewer","editor","admin"],write:["viewer","editor","admin"]},"operation-api-key":{read:["viewer","editor","admin"],write:["admin"]},"cloud-account":{read:["viewer","editor","admin"],write:[]},dashboard:{read:["viewer","editor","admin"],write:["editor","admin"]},"dashboard-folder":{read:["viewer","editor","admin"],write:["editor","admin"]},"monitor-folder":{read:["viewer","editor","admin"],write:["editor","admin"]},"dashboard-report":{read:["viewer","editor","admin"],write:["editor","admin"]},notebook:{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"]},"span-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:[]},"audit-log-stream-destination":{read:[],write:[]},org:{read:["viewer","editor","admin"],write:[]},"allowed-domains":{read:["viewer","editor","admin"],write:[]},"quality-report":{read:["viewer","editor","admin"],write:["editor","admin"]},billing:{read:[],write:[]},"data-deletion-request":{read:[],write:[]},"sensitive-data-scanner-rule":{read:["viewer","editor","admin"],write:[]},slo:{read:["viewer","editor","admin"],write:["editor","admin"]},"synthetic-test":{read:["viewer","editor","admin"],write:["editor","admin"]},"synthetic-variable":{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"]},database:{read:["viewer","editor","admin"],write:[]},queue:{read:["viewer","editor","admin"],write:[]},"tag-policy":{read:[],write:[]},team:{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:[]}},YLe={user:KLe,team:zLe};function PM(e){return oJ(e,"team")}function UM(e){return oJ(e,"user")}function oJ(e,t){let r=[],o=YLe[t];for(let[i,s]of Object.entries(o))for(let[a,u]of Object.entries(s))u.includes(e)&&r.push({actionType:a,resourceType:i});return r}var VLe={admin:{name:"Global admin",description:"Full control across the organization. Can view and modify everything, including private teams.",permissions:UM("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:UM("public_editor"),roleKey:"public_editor"},public_viewer:{name:"Public viewer",description:"Read-only access to public team data. Cannot make changes.",permissions:UM("public_viewer"),roleKey:"public_viewer"},teams_only:{name:"Teams only",description:"Only access data and assets in their own teams.",permissions:[],roleKey:"teams_only"}},gGt=Object.values(VLe).map(e=>({value:e.roleKey,label:e.name,description:e.description})),hGt={admin:{name:"Team admin",description:"Full team control, manage assets, members, and settings.",permissions:PM("admin"),roleKey:"admin"},editor:{name:"Team editor",description:"Can view and update most assets (like dashboards, monitors).",permissions:PM("editor"),roleKey:"editor"},viewer:{name:"Team viewer",description:"Can view all team data but cannot make changes.",permissions:PM("viewer"),roleKey:"viewer"}};var yGt=new Set(AM);var WLe={documentation:void 0,investigations:"investigation",logs:"log",metrics:"metric",traces:"trace",user:"user-data","allowed-domains":"allowed-domains",billing:"billing","cloud-account":"cloud-account","custom-role":"custom-role","custom-usage-tag":"custom-usage-tag","data-deletion-request":"data-deletion-request",dashboard:"dashboard","dashboard-folder":"dashboard-folder","monitor-folder":"monitor-folder","ingestion-api-key":"ingestion-api-key",inventory:"inventory","log-route":"log-route","metric-route":"metric-route","span-route":"span-route",monitor:"monitor","notification-integration":"notification-integration","notification-rule":"notification-rule","adaptive-notification-rule":"adaptive-notification-rule","notification-silence":"notification-silence","operation-api-key":"operation-api-key","quality-report":"quality-report",queue:"queue","retention-policy":"retention-policy",rum:"rum","rum-public-token":"rum-public-token","sandbox-configuration":"sandbox-configuration",service:"service","service-target":"service-target",slo:"slo","tag-policy":"tag-policy",team:"team","user-invitation":"user-invitation"},QLe=Object.entries(WLe),EGt=new Map(QLe.flatMap(([e,t])=>t?[[t,e]]:[]));var bGt=[Kf,fp,fp.replace(`${pe}.`,"")];var wM=["red","orange","amber","yellow","green","emerald","teal","cyan","sky","blue","indigo","purple","pink"],vM=["light","dark"];var ZLe={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)"}},iJ=["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 PGt=ZLe.light.red.background;var sJ=12,aJ=2,cJ=2;var uJ=[{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:"188073512757127",isUsingLuhnAlgorithm:!1,regexp:"\\b[12](?:[0-9]{2}(?:0[1-9]|1[0-2])(?:2[AB]|[0-9]{2})[0-9]{6}[0-9]{2}| [0-9]{2} (?:0[1-9]|1[0-2]) (?:2[AB]|[0-9]{2}) [0-9]{3} [0-9]{3} [0-9]{2})\\b"},{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-----
274
274
  MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDAC4AWkdwKYSd8
275
275
  Ks14IReLcYgADhoXk56ZzXI=
276
276
  -----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}"}],XLe=uJ.map(e=>e.key);var DGt=new Set(XLe),FGt=uJ.map(e=>e.key);var JLe={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function NM(e){return e.replace(/[&<>"']/g,t=>JLe[t]??t)}var XGt={[bA]:wA,[bA.replace(`${pe}.`,"")]:wA,[xA]:UA,[xA.replace(`${pe}.`,"")]:UA,[fp]:Kf,[fp.replace(`${pe}.`,"")]:Kf},JGt={[wA]:bA,[UA]:xA,[Kf]:fp};function mC(e,t){let r={};for(let[o,i]of Object.entries(e))t.includes(o)||(r[o]=i);return r}function pJ(e){return e.replace(/ies$/,"y").replace(/s$/,"")}var eMe=["alert_cluster","alert_conditions","alert_data_url","alert_id","alert_owner","alert_pattern_signature","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"],tMe=["alert_queries","alert_thresholds","alert_values"],rMe=["alert_event_name","alert_message"],CBt=new Set([...eMe,...rMe]),RBt=new Set(tMe);var kM={aws:"aws",gcp:"gcp",azure:"azure"},Sp=[kM.aws,kM.gcp,kM.azure];var lJ=n.Object({id:n.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:n.String({description:"Cluster name stored in Tsuga. Usable as a display label when `friendlyName` is not set."}),friendlyName:n.Optional(n.String({description:"Human-readable display name for the cluster. Present when a friendly name is configured."})),clusterType:n.Enum(Sp,{description:"Cloud provider selected for the Tsuga cluster."}),clusterRegion:n.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`."}),dJ="clusterId must be provided when the organization has multiple clusters",nMe={id:"abc-123-def",name:"production",friendlyName:"Production (US)",clusterType:"aws",clusterRegion:"us-east-1"};Object.assign(lJ,{examples:[nMe]});var fC=f({description:"Lists the Tsuga clusters of the organization, with cloud provider and region: the `clusterId` values other requests accept. These are not Kubernetes clusters.",operationId:"listClusters",tags:["clusters"],url:`/${"v1"}/clusters`,method:"GET",response:n.Array(lJ)});function ug(e){return`\u2022\u2022\u2022\u2022${e.slice(-4)}`}function gC(e){return{accessToken:e.accessToken,accessExpiresAt:e.expiresAt.toISOString(),refreshToken:e.refreshToken}}var LM=require("node:os"),Sd=require("node:path");var hC=e=>e.reason._tag==="NotFound";var mJ=new Set(["api.tsuga.com","api.tsuga-staging.com"]),oMe=new Set(["localhost","127.0.0.1","[::1]"]);function fJ(e){let t=e.replace(/\/+$/,"");if(!URL.canParse(t))return $(new qc({message:`TSUGA_API_URL is not a URL: ${t}`}));if(/[\s"'\\]/.test(t))return $(new qc({message:`TSUGA_API_URL holds whitespace, quotes or a backslash: ${JSON.stringify(t)}`}));let r=new URL(t);return r.protocol!=="http:"&&r.protocol!=="https:"?$(new qc({message:`TSUGA_API_URL must use HTTP or HTTPS: ${t}`})):!oMe.has(r.hostname)&&(r.protocol!=="https:"||!mJ.has(r.hostname))?$(new qc({message:`Refusing to send credentials to ${t}. Set TSUGA_API_URL to ${[...mJ].map(o=>`https://${o}`).join(", ")}, or a localhost URL.`})):A(t)}var _T="https://api.tsuga.com",iMe=pn({operationApiKey:bt(Se),userAuth:bt(zA)}),gJ=pn({operationApiKey:bt(Se),userAuth:bt(zA),credentials:bt(rx(Se,iMe)),defaults:bt(rx(Se,Se)),telemetry:bt(XN)}),hJ=pn({lastUpdateCheck:bt(Se)}),sMe=Go(Ki(gJ)),aMe=Go(Ki(hJ)),cMe=kl(Ki(gJ,{space:2})),uMe=kl(Ki(hJ)),MM=["from","to","query","max-results","cluster"],yJ={from:"-30m",to:"now",query:"*","max-results":"100"};function pMe(e){let{operationApiKey:t,userAuth:r,...o}=e;return!t&&!r?e:{...o,credentials:{...e.credentials,[_T]:{...t?{operationApiKey:t}:{},...r?{userAuth:r}:{},...e.credentials?.[_T]}}}}function EJ(e,t){let r=[`API URL: ${e.apiUrl}`],{credential:o}=e;if(o){let s=o.kind;switch(s){case"operation-api-key":r.push(`Operation API key: ${o.token.slice(0,12)}...${o.token.slice(-4)}`);break;case"user-session":r.push(`User session: ${ug(o.userAuth.accessToken)} (expires ${o.userAuth.accessExpiresAt})`);break;default:Nt(s)}}else r.push("Not authenticated. Run `tsuga auth login` or `tsuga auth operation-key <OPERATION_API_KEY>`.");r.push(`Config: ${t}`),r.push(""),r.push("Defaults (custom overrides marked with *):");let i={...yJ,...e.defaults};for(let[s,a]of Object.entries(i)){let u=s in e.defaults?" *":"";r.push(` ${s}: ${a}${u}`)}return`${r.join(`
@@ -280,7 +280,7 @@ Fix its permissions and retry; the CLI will not overwrite a config it cannot rea
280
280
  `,{mode:384})}),E=k(function*(_,S){let I=_.credentials?.[S]??{};if(I.operationApiKey)return I;let b=yield*r.read(S);return b?{...I,userAuth:b}:I}),h=(_,S,I)=>({..._,credentials:{..._.credentials,[I]:S}}),T=N("config.storeUserAuth")(function*(_,S){let I=yield*g,b=yield*l,{operationApiKey:w}=I.credentials?.[b]??{},M=S&&w?{operationApiKey:w}:{};return(yield*r.save(b,_))?(yield*y(h(I,M,b)),r.location):(yield*y(h(I,{...M,userAuth:_},b)),s)});return{configPath:s,resolveApiUrl:l,resolve:k(function*(_){let S=yield*d,I=yield*l,w=_.operationApiKey??o.operationApiKey?{}:yield*E(S,I),M=ZZ({flagKey:_.operationApiKey,environmentKey:o.operationApiKey,operationApiKey:w.operationApiKey,userAuth:w.userAuth});yield*yc({[F7]:M===void 0?"none":M.kind==="user-session"?"user_session":`operation_api_key_${M.source}`,[$7]:yield*t.exists(s).pipe(pi(()=>!1))});let K=S.defaults??{},C=_.clusterId?.trim()||o.clusterId||K.cluster?.trim()||void 0;return{apiUrl:I,credential:M,clusterId:C,defaults:K}}),getUserAuth:mt(function*(){let _=yield*d,S=yield*l;return(yield*E(_,S)).userAuth}),saveUserAuth:_=>T(_,!1),saveRefreshedUserAuth:_=>T(_,!0).pipe(Xs),saveOperationApiKey:N("config.saveOperationApiKey")(function*(_){let S=yield*g,I=yield*l;yield*y(h(S,{operationApiKey:_},I))}),clearUserAuth:mt(function*(){let _=yield*l,S=yield*g,{operationApiKey:I}=S.credentials?.[_]??{},b=yield*r.remove(_);if(yield*y(h(S,I?{operationApiKey:I}:{},_)),!b)return yield*new tg({message:`The session is still in ${r.location}. Unlock it and run \`tsuga auth logout\` again.`})}),getDefault:k(function*(_){return((yield*g).defaults??{})[_]??yJ[_]}),setDefault:N("config.setDefault")(function*(_,S){let I=yield*g,{[_]:b,...w}=I.defaults??{};yield*y({...I,defaults:S===""?w:{...w,[_]:S}})}),resetDefaults:mt(function*(){let{defaults:_,...S}=yield*g;yield*y(S)}),getTelemetryConsent:J(d,_=>_.telemetry),saveTelemetryConsent:N("config.saveTelemetryConsent")(function*(_){let S=yield*g;yield*y({...S,telemetry:_})}),getLastUpdateCheck:t.readFileString(u).pipe(q(aMe),J(_=>_.lastUpdateCheck),pi(()=>{})),saveLastUpdateCheck:N("config.saveLastUpdateCheck")(function*(_){yield*t.makeDirectory(a,{recursive:!0,mode:448});let S=yield*uMe({lastUpdateCheck:_}).pipe(Nn);yield*t.writeFileString(u,`${S}
281
281
  `,{mode:384})})}})}){static layer=Do(this,this.make)};var lMe="Your session expired.",dMe="Your session could not be renewed: the refresh token was already used, revoked or expired. A refresh token is single-use, so the server revokes the whole session when one is replayed.",yC=k(function*(e,t){let r=yield*Kn;if(!yM(t,r))return t;let o=yield*ht,i=yield*Ep,s=(yield*o.getUserAuth.pipe(pi(()=>{})))??t;if(!yM(s,r))return s;if(!s.refreshToken)return yield*new ld({message:lMe,suggestions:["Sign in again: tsuga auth login"]});let a=yield*i.refreshTokens(e,s.refreshToken).pipe(ui("OAuthTokenError",l=>$(l.code==="invalid_grant"?new ld({message:dMe,suggestions:["Sign in again: tsuga auth login"]}):new Pa({message:`Could not renew your session: ${l.message}. Retry the command.`})))),u=gC(a);return yield*o.saveRefreshedUserAuth(u).pipe(Co(l=>Xn(`Warning: could not save the renewed session (${l.message}). Run \`tsuga auth login\` before the next command.`))),u});var AT=require("node:crypto");var DM={kind:n.Enum(["doc","api"],{description:"`doc` for documentation pages (guides, references, release notes); `api` for API-reference endpoints indexed from the OpenAPI spec. Use this to decide how to present or follow up on the result."}),path:n.String({description:"Path identifying the result. Documentation pages use a slug path (e.g. `data-collection/guides/how-to-add-resource-attributes`). API-reference results use `api/<operationId>` (e.g. `api/aggregateScalar`)."}),title:n.String({description:'Title of the result (e.g. "How to Add Resource Attributes" or "POST /v1/aggregation/multi-query/scalar")'}),subsection:n.Optional(n.String({description:'For documentation pages: the heading path inside the page that matched (e.g. "Language setup"). For API results: the matched field or parameter breadcrumb (e.g. "Body \u203A queries"). Absent when the match is the page or endpoint intro.'})),tab:n.Optional(n.String({description:'Tab label inside the page that the result matched. Set when the matching content is inside a <Tabs><Tab label="\u2026"> block. Always absent for API results.'})),anchor:n.Optional(n.String({description:"For documentation pages: the slugified heading ID used as the URL fragment (e.g. `language-setup`). For API results: the Scalar deep-link fragment (`tag/<tag>/<METHOD><path>`). The `link` field already has this baked in."})),score:n.Number({description:"Relevance score between 0 and 1 (higher is more relevant)"}),excerpt:n.String({description:"Short snippet of matching content"}),link:n.String({description:"URL to the result in the Tsuga app. Documentation pages include the section anchor and tab query parameter when applicable. API results deep-link into the API reference at `/documentation/api#tag/\u2026`."})},mMe=n.Object({...DM,breadcrumb:n.Array(n.String(),{description:'Heading path inside the page that matched, followed by the tab label when the match is inside a <Tabs><Tab label="\u2026"> block. Empty for a page intro or endpoint-level match.'})}),Wjt=f({tags:["docs"],url:"/v0/docs/search",method:"GET",query:n.Object({query:p({allowEmpty:!1,description:"Search text to match against documentation and API-reference content."}),limit:n.Optional(n.Integer({minimum:1,maximum:50,description:"Maximum number of results to return."}))}),response:n.Array(mMe)});var TJ=`/${"v1"}/docs`,SJ=n.Object({path:n.String({description:"Path identifying the page. Documentation pages use a slug path (e.g. `getting-started/send-your-first-logs`). API-reference pages use `api/<operationId>` (e.g. `api/aggregateScalar`)."}),title:n.String({description:'Title of the page (e.g. "Send your first logs" or "POST /v1/aggregation/multi-query/scalar")'}),content:n.String({description:"Raw markdown content of the page"})},{$id:"DocPage",description:"A documentation or API-reference page with its raw markdown content"}),fMe={path:"getting-started/send-your-first-logs",title:"Send your first logs",content:`# Send your first logs
282
282
  ...`};Object.assign(SJ,{examples:[fMe]});var _J=n.Object(DM,{$id:"DocSearchResult",description:"A documentation page or API-reference endpoint search result"}),gMe={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://app.tsuga.com/documentation/data-collection/guides/how-to-add-resource-attributes?tab=Python#set-resource-attributes-by-language"};Object.assign(_J,{examples:[gMe]});var IJ=f({description:"Retrieves the raw markdown of a documentation or API-reference page by path or link. Documentation pages use slug paths such as `getting-started/send-your-first-logs`; API-reference pages use `api/<operationId>`.",operationId:"getDocPage",tags:["public","docs"],url:TJ,method:"GET",query:n.Object({path:p({allowEmpty:!1,description:"Page to fetch: a doc slug path, `api/<operationId>`, or a docs link with or without its host. A `/documentation/<path>` link returns the whole page, ignoring `?tab=` and `#anchor`; an API-reference link `/documentation/api#tag/<tag>/<METHOD><path>` returns that operation's page."})},{description:"Documentation page lookup query."}),response:SJ}),EC=f({description:"Searches Tsuga documentation and API reference, covering product behavior, query syntax (Tsuga queries, PromQL), API fields, dashboard and widget schemas, setup, limits, gotchas and more. Results are ranked by relevance; an empty array means nothing matched.",operationId:"searchDocs",tags:["public","docs"],url:`${TJ}/search`,method:"GET",query:n.Object({query:p({allowEmpty:!1,description:"Search text to match against documentation and API-reference content."})},{description:"Documentation search query."}),response:n.Array(_J)});var IT=`/${"v1"}/logs`,FM=n.Object({context:n.Optional(n.Object({team:n.Optional(n.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."})),...n.Pick(TM,["message","timestamp","level"]).properties},{additionalProperties:!0,$id:"LogEvent",description:"Log event including message, timestamp, severity level, and optional enriched context attributes."}),hMe={context:{team:"platform"},message:"Request completed successfully",timestamp:17040672e5,level:"INFO"};Object.assign(FM,{examples:[hMe]});var bJ=n.Object({query:n.Optional(p({type:"tsuga-query",default:"*",description:"Tsuga query selecting logs to return. Omit to search all logs with `*`."})),maxResults:n.Optional(n.Integer({minimum:1,maximum:1e3,default:pX,description:"Maximum number of logs to return. Defaults to 100. Valid values are 1 through 1000."})),clusterId:n.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."})),...nn.properties},{description:"Log search query. Provide a time range, optional Tsuga query, and optional limit."}),yMe={query:"level:ERROR",maxResults:100,from:1704067200,to:1704070800};Object.assign(bJ,{examples:[yMe]});var bT=f({description:"Searches raw log lines in a time range with Tsuga query syntax: error messages, exceptions, stack traces, the logs of one request or pod. For counts or rates, use an aggregation; to group similar messages, use log patterns. See [Logs](/documentation/explore/logs) and [Query syntax](/documentation/explore/query-syntax).",operationId:"searchLogs",tags:["public","logs"],url:`${IT}/search`,method:"GET",query:bJ,response:n.Object({logs:n.Array(FM,{description:"Log events matching the query and time range."})})}),EMe=n.Object({pattern:n.String({description:"Clustered log pattern formatted as a readable string."}),size:n.Integer({description:"Number of logs that matched the pattern"}),groups:n.Array(n.Object({key:n.String({description:"Attribute dot-path shared by all logs in the pattern."}),value:n.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`."}))}),xJ=n.Object({patterns:n.Array(EMe,{description:"Log patterns clustered from logs matching the query."}),sampleSize:n.Number({description:"Sum of the returned patterns' `size` values. It is not the number of logs matching the query: logs outside the returned patterns are not counted."})},{}),TMe={patterns:[{pattern:"Resolved segment SegmentId([0:1]) from cache",size:37004,groups:[{key:"level",value:"DEBUG"},{key:"context.team",value:"infra"}]}],sampleSize:37004};Object.assign(xJ,{examples:[TMe]});var OJ=f({description:"Groups similar log messages into patterns with counts over a time range: the top messages or errors without reading raw lines. For patterns first seen in the range, use new error patterns; for growing ones, error pattern increases. See [Logs](/documentation/explore/logs).",operationId:"getLogPatterns",tags:["public","logs"],url:`${IT}/patterns`,method:"GET",query:n.Object({...nn.properties,query:p({type:"tsuga-query",description:"Tsuga query selecting logs to cluster into patterns."}),clusterId:n.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))}),response:xJ}),SMe=n.Object({exampleLog:n.Optional(FM),team:n.String({description:"Team associated with the new error pattern."}),env:n.String({description:"Environment associated with the new error pattern."}),service:n.String({description:"Service associated with the new error pattern."}),firstSeen:n.Number({description:"Unix timestamp in seconds when this pattern was first seen."}),lastSeen:n.Number({description:"Unix timestamp in seconds when this pattern was last seen."})}),AJ=n.Object({newErrorPatterns:n.Array(SMe,{description:"Error patterns first seen in the requested time range."})},{}),_Me={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(AJ,{examples:[_Me]});var CJ=f({description:"Finds error log patterns first seen in the time range: new errors or exceptions, for example after a change. Optionally filtered by team, environment or service. See [Logs](/documentation/explore/logs).",operationId:"getNewErrorPatterns",tags:["public","logs"],url:`${IT}/patterns/new`,method:"GET",query:n.Object({...nn.properties,team:n.Optional(p({description:"Team name to restrict pattern detection to."})),env:n.Optional(p({description:"Environment to restrict pattern detection to."})),service:n.Optional(p({description:"Service name to restrict pattern detection to."})),clusterId:n.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))}),response:AJ}),IMe=n.Object({team:n.String({description:"Team associated with the error pattern. Set from the log context used during pattern analysis. Returned for every pattern increase."}),env:n.String({description:"Environment associated with the error pattern. Set from the log context used during pattern analysis. Returned for every pattern increase."}),pattern:n.String({description:"Readable representation of the grouped error log pattern. Generated by Tsuga from matching log messages and returned for every pattern increase."}),increaseTimestamps:n.Array(n.Number({description:"Unix timestamp in milliseconds of a detected spike in this pattern. Tsuga computes these timestamps during pattern-increase analysis; one entry is returned for each spike in the requested time range."}))}),RJ=n.Object({errorPatternIncreases:n.Array(IMe,{description:"Error patterns with increased occurrence in the requested time range."})},{}),bMe={errorPatternIncreases:[{team:"platform",env:"production",pattern:"Non-resolved segment SegmentId(*) from cache",increaseTimestamps:[17041536e5,17042392e5]}]};Object.assign(RJ,{examples:[bMe]});var PJ=f({description:"Finds a team's error log patterns whose count increased in the time range: spikes in existing errors. For errors first seen in the range, use new error patterns. See [Logs](/documentation/explore/logs).",operationId:"getErrorPatternIncrease",tags:["public","logs"],url:`${IT}/patterns/increase`,method:"GET",query:n.Object({...nn.properties,team:p({allowEmpty:!1,description:"Team name to analyze for pattern increases. Required; match it to the `context.team` value on the logs you want Tsuga to inspect."}),env:n.Optional(p({allowEmpty:!1,description:"Environment to restrict the analysis to. Optional; match it to the `context.env` value on the logs, or omit it to analyze all environments for the team."})),clusterId:n.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))}),response:RJ}),UJ=n.Object({attributes:n.Array(n.String(),{description:"Log attribute dot-paths observed in the time range"})},{}),xMe={attributes:["context.env","context.k8s.pod.name","context.service.name","context.team","level","message","timestamp"]};Object.assign(UJ,{examples:[xMe]});var OMe=n.Object({...nn.properties,clusterId:n.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."})),search:n.Optional(p({allowEmpty:!1,description:"Return only attribute dot-paths containing this text, case-insensitively, e.g. `k8s` or `http.status`."}))},{description:"Log attribute discovery query. Provide a time range, an optional cluster ID, and an optional search text."}),wJ=f({description:"Lists log attribute (field, key) names seen in a time range, to find the key to filter or group logs by. Requires a credential that can read all teams: attribute discovery is not team-filtered. To rank fields by their use in dashboards and monitors, use interesting fields. See [Logs](/documentation/explore/logs).",operationId:"getLogAttributes",tags:["public","logs"],url:`${IT}/attributes`,method:"GET",query:OMe,response:UJ});var AMe=n.Union([n.Literal("scalar"),n.Literal("timeseries")]),CMe="/v0/promql",TC=n.Object({query:p({type:"long",allowEmpty:!1,description:"PromQL expression to evaluate."}),timeRange:vo,step:p({allowEmpty:!1,description:"Evaluation step interval: a positive whole number followed by one unit, `s`, `m`, `h`, `d`, or `w`, such as `60s`, `1m`, or `1h`. A number without a unit, such as `60`, is not accepted."}),returnType:n.Optional(AMe),executionOptions:yT,shouldStreamResults:n.Optional(n.Boolean()),clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster to target. Mutually exclusive with `clusterIds`. Defaults to the first cluster created in the organization when both are omitted."})),clusterIds:n.Optional(Hc)}),RMe={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(TC,{examples:[RMe]});var y2t=f({tags:["promql"],url:CMe,method:"POST",body:TC,response:ig});var PMe=`/${"v1"}/promql`,UMe=`/${"v2"}/promql`,vJ=n.Object({...n.Pick(TC,["query","step"]).properties,timeRange:nn},{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"}]}),NJ=n.Object({clusterId:n.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."}))}),SC=f({description:'Runs a PromQL (Prometheus query language) range query over metrics and returns timeseries. Use a metric name exactly as the metrics list returns it: names are not translated between OpenTelemetry dots and Prometheus underscores, and a dotted metric or label name must be quoted, as in `{"k8s.pod.memory.working_set"}`. See [How to write PromQL queries](/documentation/visualize/guides/how-to-write-promql-queries).',operationId:"queryPromql",tags:["public","promql"],url:PMe,method:"POST",body:vJ,query:NJ,response:nC}),wMe=n.Object({...vJ.properties,timeRange:vo},{description:"PromQL range-query request with the time range in milliseconds. 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:17822015e5,to:17822034e5},step:"1m"}]}),A2t=f({description:"Runs a PromQL range query over Tsuga metric data and returns one shared time axis in milliseconds with one series per group aligned to it. Same request as `POST /v1/promql`, with `timeRange` in milliseconds. See [How to write PromQL queries](/documentation/visualize/guides/how-to-write-promql-queries) for query syntax and examples.",operationId:"queryPromqlV2",tags:["public","promql"],url:UMe,method:"POST",body:wMe,query:NJ,response:oC});var _d="/v0/traces",N2t=f({tags:["traces"],url:`${_d}/count`,method:"GET",query:n.Pick(Tp,["from","to","query","clusterId","useCanopy"]),response:n.Object({count:n.Number()})}),vMe=["unset","ok","error"],NMe=n.Enum(vMe),kMe=["unspecified","internal","server","client","producer","consumer"],LMe=n.Enum(kMe),MJ=n.Object({__tsuga_metadata__:n.Optional(n.Object({},{additionalProperties:!0})),context:n.Optional(n.Object({telemetry:n.Optional(n.Object({sdk:n.Optional(n.Object({language:n.Optional(n.String())},{additionalProperties:!0}))},{additionalProperties:!0})),tag_policy_warnings:n.Optional(n.Record(n.String(),n.String())),service:n.Optional(n.Object({name:n.Optional(n.String()),version:n.Optional(n.String())},{additionalProperties:!0})),env:n.Optional(n.String())},{additionalProperties:!0})),parent_span_id:n.Optional(n.String()),resource_id:n.Optional(n.String({description:"Key into the `resources` map of a summarized trace, holding the resource context hoisted off this span."})),resource_attributes:n.Object({},{additionalProperties:!0}),span_attributes:n.Object({},{additionalProperties:!0}),duration:n.Number({description:"In milliseconds."}),duration_ns:n.String({description:"In nanoseconds. Transmitted as a string to avoid losing precision, as BigInt is not JSON-compatible."}),start_time:n.String({description:"In nanoseconds. Transmitted as a string to avoid losing precision, as BigInt is not JSON-compatible."}),end_time:n.String({description:"In nanoseconds. Transmitted as a string to avoid losing precision, as BigInt is not JSON-compatible."}),error:n.Optional(n.Object({message:n.String()})),events:n.Optional(n.Array(n.Object({event_attributes:n.Object({},{additionalProperties:!0}),event_name:n.String(),event_timestamp_nanos:n.String({description:"In nanoseconds. Transmitted as a string to avoid losing precision, as BigInt is not JSON-compatible."})}))),links:n.Optional(n.Array(n.Object({},{additionalProperties:!0}))),span_id:n.String(),span:n.Object({kind:LMe,name:n.String()}),status_code:n.Optional(NMe),trace_id:n.String()}),DJ=100;var MMe={...Pr.properties,query:n.Optional(p({type:"tsuga-query"})),maxResults:n.Optional(n.Integer({minimum:1,maximum:1e4})),shouldRecommendAttributes:n.Optional(n.Boolean()),startOffset:n.Optional(n.Number({minimum:mT})),clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"})),sortBy:n.Optional(p({allowEmpty:!1,description:"Attribute to sort by. Attributes other than `start_time` sort numerically; spans where the attribute is missing or not a number come last."})),sortDirection:n.Optional(me),useCanopy:n.Optional(n.Boolean())},k2t=f({tags:["traces"],url:`${_d}/search`,method:"GET",query:n.Object(MMe),response:n.Object({spans:n.Optional(n.Array(MJ)),attributesToHighlight:n.Optional(n.Array(fT)),incomplete:n.Optional(n.Boolean({description:"True when attribute highlighting stopped early because too many distinct attributes were found."}))})}),DMe=n.Object({groupByAttributes:n.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:n.Integer({minimum:2,description:"Minimum leaf-group size before aggregation occurs. Default 5."}),maxParentDepth:n.Integer({minimum:-1,description:"Max depth of recursive parent aggregation. 0 = leaves only, -1 = unlimited (default)."}),aggregationHistogramBucketsSeconds:n.Array(n.Number({minimum:0}),{description:"Upper bounds for the latency histogram in seconds. Empty array disables the histogram attributes."}),sortSpans:n.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."})}),FMe=n.Object({...Pr.properties,traceId:p({allowEmpty:!1,description:"Trace ID to summarize"}),clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"})),...n.Partial(DMe).properties}),L2t=f({tags:["traces"],url:`${_d}/summarize`,method:"GET",query:FMe,response:n.Object({resources:n.Record(n.String(),n.Object({},{additionalProperties:!0})),spans:n.Array(MJ)})}),M2t=f({tags:["traces"],url:`${_d}/attributes`,method:"GET",query:n.Object({...Pr.properties,clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"})),useCanopy:n.Optional(n.Boolean())}),response:n.Object({attributes:n.Array(n.String())})}),$Me=n.Object({key:n.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:n.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:n.Optional(n.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:n.Optional(n.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:n.Optional(n.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."}))}),GMe=n.Object({fromNs:n.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:n.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:n.String({description:"Range duration in nanoseconds, computed as `toNs - fromNs`. Transmitted as a string to avoid losing precision."}),contributions:n.Array(n.Object({serviceKey:n.String({description:"Contributing service key for this range. References `services[].key` in the same response."}),weight:n.Number({description:"Share of this range attributed to the service, from `0` through `1`, computed from active leaf spans in the range. Weights in one range sum to `1`, except on a range merged from shorter ones: each pairwise merge truncates to the microsecond grid, so the loss grows with the number of merges, a few parts in 10,000 on a typical trace but well below `1` after a long run of very short adjacent ranges. `serviceTotals` carries the same loss."}),durationNs:n.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:n.Array(n.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."})}),BMe=n.Object({serviceKey:n.String({description:"Contributing service key for this aggregate total. References `services[].key` in the same response."}),durationNs:n.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:n.Number({description:"Share of total trace duration attributed to this service, `durationNs / totalDurationNs`, from `0` through `1`. Shares sum to less than `1` because time where no span was running is credited to no service, and because of the merge truncation described on `ranges[].contributions[].weight`, which is the whole shortfall on a trace with no gap."})}),$M=n.Optional(n.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."})),GM=n.Optional(n.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."})),_C=n.Object({traceId:n.String({description:"Trace ID summarized by the response. Echoes the required `traceId` query parameter."}),startTimeNs:n.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:n.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:n.String({description:"Total fetched trace duration in nanoseconds, computed as `endTimeNs - startTimeNs`. Transmitted as a string to avoid losing precision."}),truncated:n.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:n.Array($Me,{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:n.Array(GMe,{description:"Sequential trace timeline split into ranges wherever the active leaf-span set changes. Empty when the request sets `includeRanges` to false."}),serviceTotals:n.Array(BMe,{description:"Aggregated wall-clock contribution per service across the fetched trace. Use this for service-level latency ownership without processing the per-range timeline."})}),jMe={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(_C,{examples:[jMe]});var D2t=f({tags:["traces"],url:`${_d}/latency-summary`,method:"GET",query:n.Object({...Pr.properties,traceId:p({allowEmpty:!1,description:"Trace ID to summarize"}),clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"})),minRangeDurationMs:$M,includeRanges:GM}),response:_C}),qMe=n.Object({traceId:n.String(),spanId:n.String()}),F2t=f({tags:["traces"],url:`${_d}/span-backlinks`,method:"GET",query:n.Object({...Pr.properties,traceId:p({allowEmpty:!1,description:"Trace ID referenced by span links"}),clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:n.Object({backlinks:n.Array(n.Object({spanId:n.String(),references:n.Array(qMe)})),truncated:n.Boolean()})}),kJ=n.Object({filter:p({type:"tsuga-query",description:"TQL filter defining the group"}),timeRange:vo}),HMe=n.Object({value:n.String(),targetSupport:n.Number(),baselineSupport:n.Number()}),KMe=n.Object({value:n.String(),targetSupport:n.Number(),baselineSupport:n.Number(),lift:n.Union([n.Number(),n.Null()]),pValue:n.Number()}),zMe=n.Object({bounds:n.Array(n.Number()),targetCounts:n.Array(n.Number()),baselineCounts:n.Array(n.Number())}),YMe=n.Object({quantileLift:n.Number(),ks:n.Number(),pValue:n.Number(),targetSampleCount:n.Number(),baselineSampleCount:n.Number(),histogram:zMe}),VMe=D("type",[n.Object({type:n.Literal("categorical"),attr:n.String(),values:n.Array(KMe),otherValues:n.Array(HMe)}),n.Object({type:n.Literal("distribution"),attr:n.String(),shift:YMe})]),LJ=n.Object({contrastSets:n.Array(VMe),targetGroupCount:n.Number(),baselineGroupCount:n.Number(),failedAttributeCount:n.Number()}),WMe=D("type",[n.Object({type:n.Literal("snapshot"),response:LJ}),n.Object({type:n.Literal("done"),response:LJ}),n.Object({type:n.Literal("error"),message:n.String()})]),QMe=n.Object({targetGroup:kJ,baselineGroup:kJ,candidateAttrs:n.Optional(n.Array(p({allowEmpty:!1}))),topK:n.Optional(n.Integer({minimum:1,maximum:100})),minLift:n.Optional(n.Number({minimum:1})),minSupport:n.Optional(n.Number({minimum:0,maximum:100})),clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),$2t=f({tags:["traces"],url:`${_d}/contrast-sets/stream`,method:"POST",body:QMe,response:WMe});var IC=`/${"v1"}/traces`,BM=n.Object({context:n.Optional(n.Object({service:n.Optional(n.Object({name:n.Optional(n.String({description:"Service name associated with the span."})),version:n.Optional(n.String({description:"Service version associated with the span."}))},{additionalProperties:!0,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."})),parent_span_id:n.Optional(n.String({description:"`span_id` of this span's parent within the same trace. Empty or absent for a root span."})),resource_id:n.Optional(n.String({description:"Only on summarized traces: key into the response `resources` map holding the resource context (host, cloud, process, SDK) hoisted off this span. `context` keeps `service` and `env` inline."})),resource_attributes:n.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."}),span_attributes:n.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:n.Number({description:"Span duration in milliseconds, derived from the nanosecond `start_time` and `end_time` values."}),duration_ns:n.String({description:"Span duration in nanoseconds, encoded as a string to preserve precision."}),start_time:n.String({description:"Span start time as a Unix epoch timestamp in nanoseconds, encoded as a string to preserve precision."}),end_time:n.String({description:"Span end time as a Unix epoch timestamp in nanoseconds, encoded as a string to preserve precision."}),error:n.Optional(n.Object({message:n.String({description:"OpenTelemetry span status description set by the instrumentation, such as the exception message."})},{description:"OpenTelemetry span status description. `message` is set only when `status_code` is `error` and the instrumentation recorded a description."})),events:n.Optional(n.Array(n.Object({event_attributes:n.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:n.String({description:"Name of the span event."}),event_timestamp_nanos:n.String({description:"Event timestamp in nanoseconds, transmitted as a string for precision."})},{description:"A single timestamped event recorded on the span, with its name and attributes."}),{description:"Events recorded on the span."})),links:n.Optional(n.Array(n.Object({},{additionalProperties:!0}),{description:"OpenTelemetry span links to related spans, possibly in other traces."})),span_id:n.String({description:"Unique span ID within the trace."}),span:n.Object({kind:n.String({description:"OpenTelemetry span kind describing the relationship to remote calls: `unspecified`, `internal`, `server`, `client`, `producer`, or `consumer`."}),name:n.String({description:"Operation name recorded on the span."})},{description:"Operation identity for the span, combining the recorded operation name and the OpenTelemetry span kind."}),status_code:n.Optional(n.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."})),trace_id:n.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."}),ZMe={context:{service:{name:"my-service",version:"1.0.0"}},parent_span_id:"187a47da1b2560f8",resource_attributes:{},span_attributes:{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,duration_ns:"23995900",start_time:"1770923469995353600",end_time:"1770923470019349500",span_id:"3df8cc3449378f66",span:{kind:"internal",name:"receive_messages"},status_code:"ok",trace_id:"78c99c5bb1e4a30297fa134b9dbec64f"};Object.assign(BM,{examples:[ZMe]});var XMe={from:1704067200,to:1704070800,query:"context.service.name:my-service",maxResults:100},GJ=n.Object({...nn.properties,query:n.Optional(p({type:"tsuga-query",default:"*",description:"Tsuga query selecting spans to return. Omit to search all spans in the range with `*`."})),maxResults:n.Optional(n.Integer({minimum:1,maximum:1e4,default:DJ,description:"Maximum number of spans to return. Defaults to 100. Valid values are 1 through 10000."})),clusterId:n.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(GJ,{examples:[XMe]});var xT=f({description:"Searches trace spans (APM requests and operations) in a time range with Tsuga query syntax, for example the slow or failing requests of a service. For one whole trace, use the trace summary; for counts or latency percentiles, an aggregation. See [Traces](/documentation/explore/traces) and [Query syntax](/documentation/explore/query-syntax).",operationId:"searchSpans",tags:["public","traces"],url:`${IC}/search`,method:"GET",query:GJ,response:n.Object({spans:n.Array(BM,{description:"Spans matching the query and time range."})})}),JMe={from:1704067200,to:1704070800,traceId:"78c99c5bb1e4a30297fa134b9dbec64f"},BJ=n.Object({...nn.properties,traceId:p({allowEmpty:!1,description:"Trace ID to summarize. Use the `trace_id` returned by span search, the trace details page, or your tracing instrumentation. Required; the requested time range must include the trace."}),clusterId:n.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."})),groupByAttributes:n.Optional(n.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:n.Optional(n.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:n.Optional(n.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:n.Optional(n.Array(n.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:n.Optional(n.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(BJ,{examples:[JMe]});var jJ=f({description:"Returns one trace by trace ID as a compact set of spans: similar spans are merged into summary spans with counts and duration statistics, so large traces fit. Summary spans carry `span_attributes.aggregation.is_summary`. The resource context of each span (host, cloud, process, SDK) is emitted once under `resources`; a span points at its entry with `resource_id` and keeps only `context.service` and `context.env` inline. For where the time went, use the trace latency summary. See [Traces](/documentation/explore/traces).",operationId:"summarizeTrace",tags:["public","traces"],url:`${IC}/summarize`,method:"GET",query:BJ,response:n.Object({resources:n.Record(n.String(),n.Object({},{additionalProperties:!0}),{description:"Distinct resource contexts of the trace, keyed by the `resource_id` each span carries. Emitted once per resource instead of on every span."}),spans:n.Array(BM,{description:"Summarized trace spans, sorted by start time unless `sortSpans` is false. Aggregated groups are replaced by synthetic summary spans marked with `span_attributes.aggregation.is_summary`."})})}),eDe={from:1704067200,to:1704070800,traceId:"78c99c5bb1e4a30297fa134b9dbec64f"},qJ=n.Object({...nn.properties,traceId:p({allowEmpty:!1,description:"Trace ID to summarize. Use the `trace_id` returned by span search, the trace details page, or your tracing instrumentation. Required; the requested time range must include the trace."}),clusterId:n.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."})),minRangeDurationMs:$M,includeRanges:GM},{description:"Trace latency summary query. Provide a trace ID, a time range covering the trace, and optional timeline tuning."});Object.assign(qJ,{examples:[eDe]});var HJ=f({description:"Finds where the time went in one trace (bottleneck, critical path): wall-clock time attributed to the services with active leaf spans, as per-service totals and an optional sequential timeline. For the spans themselves, use the trace summary. See [Traces](/documentation/explore/traces).",operationId:"getTraceLatencySummary",tags:["public","traces"],url:`${IC}/latency-summary`,method:"GET",query:qJ,response:_C}),FJ=e=>n.Object({filter:p({type:"tsuga-query",description:`Tsuga query selecting the ${e} spans. Terms are ANDed by whitespace, as in \`context.service.name:checkout status_code:error\`.`}),timeRange:nn},{description:`The ${e} group: a Tsuga query and the time range it is evaluated over.`}),KJ=n.Object({targetGroup:FJ("target"),baselineGroup:FJ("baseline"),candidateAttrs:n.Optional(n.Array(p({allowEmpty:!1}),{maxItems:20,description:"Span attribute dot-paths to test, such as `context.service.name` or `span_attributes.http.route`. Attributes referenced by either group filter, and their known sibling attributes for the same field, are always excluded, so the contrasted condition does not come back as a finding. Omit or pass an empty array to let Tsuga test the attributes among `span_attributes.*`, `context.*`, `span.name`, `span.kind`, `status_code` and `is_root` that take more than one value across samples of both groups, most frequent in the target first; when none varies, `contrastSets` is empty. Numeric attributes with mostly distinct values, such as `duration_ns`, come back as `distribution` entries. Span duration is excluded when a group filter uses it."})),topK:n.Optional(n.Integer({minimum:1,maximum:100,description:"Maximum number of findings to return, strongest first. A finding is one attribute/value pair, and findings are grouped into one `contrastSets` entry per attribute, so a result carries at most this many `values` rows across possibly fewer entries. Valid values are 1 through 100. Defaults to 10."})),minLift:n.Optional(n.Number({minimum:1,description:"Minimum lift a value must reach to be reported as a finding. Lift is the value's coverage of the target group divided by its coverage of the baseline, so `2` keeps only values at least twice as frequent in the target. Raise it to cut weak findings. Defaults to 1.5."})),minSupport:n.Optional(n.Number({minimum:0,maximum:100,description:"Support floor as a percentage: a value is reported as a finding only when it covers at least this much of the target group or of the baseline group. Valid values are 0 through 100. Raise it to drop findings that explain only a handful of spans. Defaults to 0.5."}))},{description:"Contrast-set request. Provide the target group to explain and the baseline to compare it against, plus optional significance tuning. Send `clusterId` as a query parameter, not in the JSON body."}),tDe={targetGroup:{filter:"context.service.name:checkout status_code:error",timeRange:{from:1704067200,to:1704070800}},baselineGroup:{filter:"context.service.name:checkout NOT status_code:error",timeRange:{from:1704067200,to:1704070800}}};Object.assign(KJ,{examples:[tDe]});var $J={value:n.String({description:"The attribute value this row is about."}),targetSupport:n.Number({description:"Percentage of target spans carrying this value, from 0 to 100."}),baselineSupport:n.Number({description:"Percentage of baseline spans carrying this value, from 0 to 100."})},zJ=n.String({description:"Span attribute dot-path this contrast set is about, such as `context.env`."}),rDe=n.Object({type:n.Literal("categorical",{description:"The attribute is compared value by value."}),attr:zJ,values:n.Array(n.Object({...$J,lift:n.Optional(n.Number({description:"`targetSupport / baselineSupport`: how many times more frequent the value is in the target group. Absent when the value never appears in the baseline, which makes the lift unbounded."})),pValue:n.Number({description:"Probability that a difference this large would occur if the value were unrelated to the split. Smaller is stronger."})},{title:"ContrastSetValue"}),{description:"Values over-represented in the target group that cleared the lift, support, and significance gates, strongest first. These are the findings."}),otherValues:n.Array(n.Object($J,{title:"ContrastSetOtherValue"}),{description:"The attribute's other frequent values in the target group, by target percentage descending, as context for reading `values`. Never overlaps `values`."})},{title:"CategoricalContrastSet"}),nDe=n.Object({type:n.Literal("distribution",{description:"The attribute is numeric, such as a duration, and is compared by the shape of its values."}),attr:zJ,shift:n.Object({quantileLift:n.Number({description:"How far apart the two groups are, as a ratio: 1 means no change, 3 means about three times apart. It does not tell which group is larger. Read `histogram` for the direction."}),ks:n.Number({description:"Kolmogorov-Smirnov statistic, from 0 to 1: the largest gap between the two cumulative distributions."}),pValue:n.Number({description:"Probability that a difference this large would occur if the two groups had the same distribution. Smaller is stronger."}),targetSampleCount:n.Number({description:"Number of target spans that carry the attribute."}),baselineSampleCount:n.Number({description:"Number of baseline spans that carry the attribute."}),histogram:n.Object({bounds:n.Array(n.Number(),{description:"Bin edges, in the unit of the attribute. One more item than each count list. The bins go from the 2nd to the 98th percentile of both groups, so they do not hold all samples."}),targetCounts:n.Array(n.Number(),{description:"Number of target samples in each bin."}),baselineCounts:n.Array(n.Number(),{description:"Number of baseline samples in each bin."})},{title:"ContrastSetHistogram"})},{title:"ContrastSetShift"})},{title:"DistributionContrastSet"}),oDe=D("type",[rDe,nDe]),YJ=n.Object({contrastSets:n.Array(oDe,{description:"One entry per attribute that separates the two groups, strongest first. Read `type` first: a categorical entry lists values, a distribution entry describes how a numeric attribute shifted. An attribute with the same value strings as a stronger entry is left out, so two boolean attributes appear as one entry. Empty when nothing cleared the gates, which means the target and the baseline look alike on the attributes tested."}),targetGroupCount:n.Number({description:"Number of spans matched by the target group filter over its time range. Not a sample: it is a plain count over the whole group."}),baselineGroupCount:n.Number({description:"Number of spans matched by the baseline group filter over its time range. Not a sample: it is a plain count over the whole group."}),failedAttributeCount:n.Number({description:"Number of candidate attributes Tsuga dropped because a query for them failed. Those attributes were not tested at all, so a high count next to an empty `contrastSets` means the comparison was incomplete, not that the two groups are alike."})}),iDe={contrastSets:[{type:"categorical",attr:"span_attributes.http.route",values:[{value:"/checkout/pay",targetSupport:82.4,baselineSupport:11.7,lift:7.04,pValue:1e-4}],otherValues:[{value:"/checkout/cart",targetSupport:9.1,baselineSupport:44.2}]},{type:"distribution",attr:"duration_ns",shift:{quantileLift:4.2,ks:.61,pValue:1e-4,targetSampleCount:1180,baselineSampleCount:8620,histogram:{bounds:[2e6,5e7,2e8,9e8],targetCounts:[40,310,830],baselineCounts:[5100,3200,320]}}}],targetGroupCount:1240,baselineGroupCount:8760,failedAttributeCount:2};Object.assign(YJ,{examples:[iDe]});var VJ=f({description:"Finds what failing or slow requests have in common that healthy ones do not, for example errors against successes, or before and after a change: compares a target span group with a baseline and returns the attribute values over-represented in the target, and the numeric attributes, such as durations, whose distribution shifted. Each group has its own time range, so a before/after comparison is one call. See [Traces](/documentation/explore/traces).",operationId:"findContrastSets",tags:["public","traces"],url:`${IC}/contrast-sets`,method:"POST",body:KJ,query:Xi,response:YJ});function QJ(e,t){let r=[],o=WJ(t);for(let i=0;i<e.length;i+=1){let s=e[i];if(s===void 0||s==="--")break;if(s.startsWith("-")){s.includes("=")||(i+=1);continue}let a=o.get(s);if(a===void 0)break;r.push(s),o=WJ(a)}return r.join(" ")}function WJ(e){let t=new Map;for(let r of e.subcommands)for(let o of r.commands)t.set(o.name,o);return t}var Vc=(e,t)=>r=>st(r,o=>new Gn({message:`Could not ${e} ${t}: ${o.message}`})),pg=N("fs.writeAtomic")(function*(e,t){let r=yield*rn,o=`${e}.tmp.${process.pid}`;yield*r.writeFileString(o,t).pipe(Vc("write",o)),yield*r.rename(o,e).pipe(Vc("write",e))}),lg=N("fs.readOrUndefined")(function*(e){return yield*(yield*rn).readFileString(e).pipe(Ru(hC,()=>Ue),LI({onSuccess:r=>r??void 0,onFailure:r=>new Gn({message:`Could not read ${e}: ${r.message}`})}))}),dg=N("fs.backupIfExists")(function*(e,t,r){if(t===void 0)return;let o=yield*rn,i=`${e}.bak.${r.replaceAll(":","-")}`;return yield*o.writeFileString(i,t).pipe(Vc("back up",e)),i});function Ii(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var bC=N("fs.parseJsonObject")(function*(e,t){let r=yield*sDe(t).pipe(st(()=>new Gn({message:`${e} is not valid JSON. Fix or remove it before re-running.`})));return Ii(r)?r:yield*new Gn({message:`${e} must contain a JSON object at the top level.`})}),sDe=tY(Ki(wc)),xC=N("fs.formatJsonFile")(function*(e){return`${yield*aDe(e).pipe(Nn)}
283
- `}),aDe=kl(Ki(wc,{space:2}));var cDe=kl(Ki(wc)),CT={traceId:(0,AT.randomBytes)(16).toString("hex"),spanId:(0,AT.randomBytes)(8).toString("hex")};function qM(e,t,r){if(e===EC)return Array.isArray(r)?{[Y7]:r.length}:{};let o=e===bT||e===xT,i=e===iC,s=e===SC;if(!(o||i||s||e===sC))return{};let a=t.query??{},u=Ii(t.body)?t.body:{},l=Ii(r)?r:{},d=o?a:Ii(u.timeRange)?u.timeRange:{},g=Array.isArray(u.queries)?u.queries:[],y=Array.isArray(u.groupBy)?u.groupBy:[],E=o?l.logs??l.spans:i?l.results:l.series,h=Array.isArray(l.series)?l.series:void 0,T=e===bT?"logs":e===xT?"traces":s?"metrics":typeof u.dataSource=="string"?u.dataSource:void 0;return{...T===void 0?{}:{[G7]:T},[B7]:o?"search":i?"scalar":s?"promql":"timeseries",...typeof d.from=="number"&&typeof d.to=="number"?{[j7]:d.to-d.from}:{},...o?{[YL]:a.query!==void 0&&a.query!=="*"}:{},...o||s?{}:{[YL]:g.some(_=>Ii(_)&&typeof _.filter=="string"&&_.filter.length>0),[q7]:y.reduce((_,S)=>_+(Ii(S)&&Array.isArray(S.fields)?S.fields.length:0),0)},...Array.isArray(E)?{[H7]:E.length}:{},...h===void 0?{}:{[K7]:h.length,[z7]:h.reduce((_,S)=>_+(Ii(S)&&Array.isArray(S.points)?S.points.length:0),0)}}}var OT=[],jM=class extends Nh{get traceId(){return CT.traceId}end(t,r){super.end(t,r),OT.push({name:this.name.slice(0,200),kind:this.kind,[gp]:this.spanId,[sd]:an(this.parent,{onNone:()=>CT.spanId,onSome:o=>o.spanId}),startTimeMs:Number(this.startTime/1000000n),duration_ms:Number(t-this.startTime)/1e6,status_code:Ou(r)&&!pc(r.cause)?"error":"unset",attributes:Object.fromEntries([...this.attributes].flatMap(([o,i])=>{let s=EDe(i);return s===void 0?[]:[[o.slice(0,200),s]]}).slice(0,aM))}),OT.length>sM&&OT.shift()}},XJ=vU({span:e=>new jM(e)});function uDe(e,t,r){if(io(e))return{...t,[Ca]:Rr.success};if(pc(e.cause))return{...t,[Ca]:jA(r),[ad]:"Interrupted",...r===void 0?{}:{[CA]:r}};let o=bu(e.cause);if(HA(o))return{...t,[Ca]:Rr.usage,[ad]:"Usage"};if(qA(o)){let i="statusCode"in o?o.statusCode:void 0,s=o._tag==="ApiError"?o.code:void 0;return{...t,[Ca]:BA(o),[ad]:o._tag,...i===void 0?{}:{[OA]:i},...s===void 0?{}:{[AA]:s}}}return{...t,[Ca]:Rr.failure,[ad]:"Unhandled"}}var JJ=[["CLAUDECODE","claude-code"],["CLAUDE_CODE_SESSION_ID","claude-code"],["CODEX_THREAD_ID","codex"],["CODEX_SESSION_ID","codex"],["OPENCODE","opencode"],["GEMINI_CLI","gemini-cli"],["CLINE_ACTIVE","cline"],["AGENT","agent"],["AI_AGENT","agent"]],pDe=[...JJ.map(([e])=>e),"CI"],lDe=tf(Object.fromEntries(pDe.map(e=>[e,Zi(e)]))).pipe(Nn);function dDe(e,t,r){let o=e.findIndex(d=>d.startsWith("-")),i=o===-1?[]:e.slice(o,o+iM).map(d=>d.slice(0,Qf)),s=e.indexOf("--"),a=(s===-1?e:e.slice(0,s)).includes("--pretty"),u=JJ.find(([d])=>t[d])?.[1]??(t.CI?"ci":r?"terminal":"script"),l=mDe(u,t);return{...i.length>0?{[Hf]:i}:{},...a?{[aT]:"pretty"}:{},[cT]:u,...l===void 0?{}:{[RA]:l}}}function mDe(e,t){let r=e==="claude-code"?t.CLAUDE_CODE_SESSION_ID:e==="codex"?t.CODEX_SESSION_ID||t.CODEX_THREAD_ID:void 0;if(!(r===void 0||!/^[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}$/i.test(r)))return(0,AT.createHash)("sha256").update(e).update("\0").update(r.toLowerCase()).digest("hex")}var eee=k(function*(e,t,r,o){let i=yield*Kn;return yield*e.pipe(hc(s=>fDe(s,{argv:t,root:r,startedAt:i,receivedSignal:o})))}),fDe=N("cli.telemetry.reportRun")(function*(e,t){let[r,o,i]=yield*ds([lM,lDe,Kn]),s=uDe(e,{[iT]:QJ(t.argv,t.root),[sT]:i-t.startedAt,...dDe(t.argv,o,r)},t.receivedSignal?.());if(!(yield*gDe(s)))return;let a=yield*(yield*ht).resolveApiUrl,u={...s,[rT]:"1.196.0",[oT]:process.platform==="win32"?"windows":process.platform,[nT]:process.versions.node,[mp]:CT.traceId,[gp]:CT.spanId},l=yDe(t.startedAt),d=yield*cDe(l.length>0?{...u,spans:l}:u).pipe(Nn),g=yield*Hi(process.execPath,["-e",_De,`${a}${PZ.url}`,TDe(d,u)],{detached:!0,windowsHide:!0,stdin:"ignore",stdout:"ignore",stderr:"ignore"});yield*Xs(g.unref)},e=>e.pipe(co,fc)),gDe=k(function*(e){let t=yield*HM;if(t!==void 0)return t;let r=yield*ht,o=yield*r.getTelemetryConsent;if(o!==void 0)return o;if(!(yield*lM)||e[Ca]!==0)return!1;yield*Xn(hDe);let i=yield*fo(uE({message:"Send usage data?"}));return yield*r.saveTelemetryConsent(i),i}),HM=Zi("TSUGA_TELEMETRY").pipe(Fl(e=>e===void 0?void 0:["1","true"].includes(e.toLowerCase())),Nn),hDe="\nHelp improve the Tsuga CLI by sending usage data.\nChange it later with `tsuga config set telemetry on|off`.";function yDe(e){let t=new Set(OT.map(r=>r[gp]));return OT.map(({startTimeMs:r,...o})=>({...o,[sd]:t.has(o[sd])?o[sd]:CT.spanId,start_offset_ms:Math.max(0,r-e)}))}function EDe(e){if(typeof e=="boolean"||typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="bigint")return Number(e);if(typeof e=="string")return e.slice(0,Qf);try{return JSON.stringify(e)?.slice(0,Qf)}catch{return}}var ZJ=process.platform==="win32"?15e3:1e5;function TDe(e,t){if(Buffer.byteLength(e)<=ZJ)return e;let r=JSON.stringify(t);return Buffer.byteLength(r)<=ZJ?r:JSON.stringify({...t,[Hf]:void 0})}var SDe=()=>{let[e="",t=""]=process.argv.slice(1);fetch(e,{method:"POST",headers:{"content-type":"application/json"},body:t,signal:AbortSignal.timeout(1e4)}).catch(()=>{})},_De=`(${SDe.toString()})()`;function tee(e){return e.message.includes(dJ)}var ree=["Choose a default cluster: tsuga config set default cluster --value <CLUSTER_ID>","Override it for one command: tsuga --cluster <CLUSTER_ID> <COMMAND>","Set an environment override: export TSUGA_CLUSTER_ID=<CLUSTER_ID>"];function nee(e){let t=e.map(r=>` ${r.id} ${r.friendlyName??r.name}`);return t.length>0?["","Available clusters:",...t].join(`
283
+ `}),aDe=kl(Ki(wc,{space:2}));var cDe=kl(Ki(wc)),CT={traceId:(0,AT.randomBytes)(16).toString("hex"),spanId:(0,AT.randomBytes)(8).toString("hex")};function qM(e,t,r){if(e===EC)return Array.isArray(r)?{[Y7]:r.length}:{};let o=e===bT||e===xT,i=e===iC,s=e===SC;if(!(o||i||s||e===sC))return{};let a=t.query??{},u=Ii(t.body)?t.body:{},l=Ii(r)?r:{},d=o?a:Ii(u.timeRange)?u.timeRange:{},g=Array.isArray(u.queries)?u.queries:[],y=Array.isArray(u.groupBy)?u.groupBy:[],E=o?l.logs??l.spans:i?l.results:l.series,h=Array.isArray(l.series)?l.series:void 0,T=e===bT?"logs":e===xT?"traces":s?"metrics":typeof u.dataSource=="string"?u.dataSource:void 0;return{...T===void 0?{}:{[G7]:T},[B7]:o?"search":i?"scalar":s?"promql":"timeseries",...typeof d.from=="number"&&typeof d.to=="number"?{[j7]:d.to-d.from}:{},...o?{[YL]:a.query!==void 0&&a.query!=="*"}:{},...o||s?{}:{[YL]:g.some(_=>Ii(_)&&typeof _.filter=="string"&&_.filter.length>0),[q7]:y.reduce((_,S)=>_+(Ii(S)&&Array.isArray(S.fields)?S.fields.length:0),0)},...Array.isArray(E)?{[H7]:E.length}:{},...h===void 0?{}:{[K7]:h.length,[z7]:h.reduce((_,S)=>_+(Ii(S)&&Array.isArray(S.points)?S.points.length:0),0)}}}var OT=[],jM=class extends Nh{get traceId(){return CT.traceId}end(t,r){super.end(t,r),OT.push({name:this.name.slice(0,200),kind:this.kind,[gp]:this.spanId,[sd]:an(this.parent,{onNone:()=>CT.spanId,onSome:o=>o.spanId}),startTimeMs:Number(this.startTime/1000000n),duration_ms:Number(t-this.startTime)/1e6,status_code:Ou(r)&&!pc(r.cause)?"error":"unset",attributes:Object.fromEntries([...this.attributes].flatMap(([o,i])=>{let s=EDe(i);return s===void 0?[]:[[o.slice(0,200),s]]}).slice(0,aM))}),OT.length>sM&&OT.shift()}},XJ=vU({span:e=>new jM(e)});function uDe(e,t,r){if(io(e))return{...t,[Ca]:Rr.success};if(pc(e.cause))return{...t,[Ca]:jA(r),[ad]:"Interrupted",...r===void 0?{}:{[CA]:r}};let o=bu(e.cause);if(HA(o))return{...t,[Ca]:Rr.usage,[ad]:"Usage"};if(qA(o)){let i="statusCode"in o?o.statusCode:void 0,s=o._tag==="ApiError"?o.code:void 0;return{...t,[Ca]:BA(o),[ad]:o._tag,...i===void 0?{}:{[OA]:i},...s===void 0?{}:{[AA]:s}}}return{...t,[Ca]:Rr.failure,[ad]:"Unhandled"}}var JJ=[["CLAUDECODE","claude-code"],["CLAUDE_CODE_SESSION_ID","claude-code"],["CODEX_THREAD_ID","codex"],["CODEX_SESSION_ID","codex"],["OPENCODE","opencode"],["GEMINI_CLI","gemini-cli"],["CLINE_ACTIVE","cline"],["AGENT","agent"],["AI_AGENT","agent"]],pDe=[...JJ.map(([e])=>e),"CI"],lDe=tf(Object.fromEntries(pDe.map(e=>[e,Zi(e)]))).pipe(Nn);function dDe(e,t,r){let o=e.findIndex(d=>d.startsWith("-")),i=o===-1?[]:e.slice(o,o+iM).map(d=>d.slice(0,Qf)),s=e.indexOf("--"),a=(s===-1?e:e.slice(0,s)).includes("--pretty"),u=JJ.find(([d])=>t[d])?.[1]??(t.CI?"ci":r?"terminal":"script"),l=mDe(u,t);return{...i.length>0?{[Hf]:i}:{},...a?{[aT]:"pretty"}:{},[cT]:u,...l===void 0?{}:{[RA]:l}}}function mDe(e,t){let r=e==="claude-code"?t.CLAUDE_CODE_SESSION_ID:e==="codex"?t.CODEX_SESSION_ID||t.CODEX_THREAD_ID:void 0;if(!(r===void 0||!/^[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}$/i.test(r)))return(0,AT.createHash)("sha256").update(e).update("\0").update(r.toLowerCase()).digest("hex")}var eee=k(function*(e,t,r,o){let i=yield*Kn;return yield*e.pipe(hc(s=>fDe(s,{argv:t,root:r,startedAt:i,receivedSignal:o})))}),fDe=N("cli.telemetry.reportRun")(function*(e,t){let[r,o,i]=yield*ds([lM,lDe,Kn]),s=uDe(e,{[iT]:QJ(t.argv,t.root),[sT]:i-t.startedAt,...dDe(t.argv,o,r)},t.receivedSignal?.());if(!(yield*gDe(s)))return;let a=yield*(yield*ht).resolveApiUrl,u={...s,[rT]:"1.198.0",[oT]:process.platform==="win32"?"windows":process.platform,[nT]:process.versions.node,[mp]:CT.traceId,[gp]:CT.spanId},l=yDe(t.startedAt),d=yield*cDe(l.length>0?{...u,spans:l}:u).pipe(Nn),g=yield*Hi(process.execPath,["-e",_De,`${a}${PZ.url}`,TDe(d,u)],{detached:!0,windowsHide:!0,stdin:"ignore",stdout:"ignore",stderr:"ignore"});yield*Xs(g.unref)},e=>e.pipe(co,fc)),gDe=k(function*(e){let t=yield*HM;if(t!==void 0)return t;let r=yield*ht,o=yield*r.getTelemetryConsent;if(o!==void 0)return o;if(!(yield*lM)||e[Ca]!==0)return!1;yield*Xn(hDe);let i=yield*fo(uE({message:"Send usage data?"}));return yield*r.saveTelemetryConsent(i),i}),HM=Zi("TSUGA_TELEMETRY").pipe(Fl(e=>e===void 0?void 0:["1","true"].includes(e.toLowerCase())),Nn),hDe="\nHelp improve the Tsuga CLI by sending usage data.\nChange it later with `tsuga config set telemetry on|off`.";function yDe(e){let t=new Set(OT.map(r=>r[gp]));return OT.map(({startTimeMs:r,...o})=>({...o,[sd]:t.has(o[sd])?o[sd]:CT.spanId,start_offset_ms:Math.max(0,r-e)}))}function EDe(e){if(typeof e=="boolean"||typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="bigint")return Number(e);if(typeof e=="string")return e.slice(0,Qf);try{return JSON.stringify(e)?.slice(0,Qf)}catch{return}}var ZJ=process.platform==="win32"?15e3:1e5;function TDe(e,t){if(Buffer.byteLength(e)<=ZJ)return e;let r=JSON.stringify(t);return Buffer.byteLength(r)<=ZJ?r:JSON.stringify({...t,[Hf]:void 0})}var SDe=()=>{let[e="",t=""]=process.argv.slice(1);fetch(e,{method:"POST",headers:{"content-type":"application/json"},body:t,signal:AbortSignal.timeout(1e4)}).catch(()=>{})},_De=`(${SDe.toString()})()`;function tee(e){return e.message.includes(dJ)}var ree=["Choose a default cluster: tsuga config set default cluster --value <CLUSTER_ID>","Override it for one command: tsuga --cluster <CLUSTER_ID> <COMMAND>","Set an environment override: export TSUGA_CLUSTER_ID=<CLUSTER_ID>"];function nee(e){let t=e.map(r=>` ${r.id} ${r.friendlyName??r.name}`);return t.length>0?["","Available clusters:",...t].join(`
284
284
  `):""}var oee={CLUSTER_AGGREGATION_STRUCTURE:["Compare the body with a generated one: tsuga aggregation <scalar|timeseries> --generate-skeleton"],TAG_POLICY_ALREADY_EXISTS_ERROR:["Find the existing policy ID with tsuga tag-policies list, then run tsuga tag-policies update <ID> -f policy.json"],URL_NOT_FOUND:["Update the CLI: tsuga self-update"]};function iee(e){return e!==void 0&&Object.hasOwn(oee,e)?oee[e]??[]:[]}function IDe(e){return e.replace(/\s+/g," ").replace(/[^\x20-\x7e\x80-\xff]/g,"").trim()}function bDe({body:e,query:t}){let r=t?.offset??e?.offset,o=typeof r=="string"?Number(r):r;return typeof o=="number"&&Number.isSafeInteger(o)&&o>=0?o:0}var xDe=pn({data:bt(wc),requestId:bt(Se),error:bt(pn({message:Se,statusCode:bt(Nc),code:bt(Se),details:bt(wc),hint:bt(Se),docUrl:bt(Se)})),metadata:bt(pn({pagination:bt(pn({totalCount:Nc,pageCount:bt(Nc)}))}))}),ODe=Go(xDe);function ADe(e,t,r){let o=e.metadata?.pagination,i=o===void 0?void 0:aee(e.data);if(o===void 0||i===void 0)return;let s=t+i.length;if(!(s>=o.totalCount))return`Showing ${i.length} of ${o.totalCount} (offset ${t}). Next page: ${CDe(r,i.length,s)}`}function aee(e){if(Array.isArray(e))return e;let t=e!==null&&typeof e=="object"?Object.values(e):[],[r]=t;return t.length===1&&Array.isArray(r)?r:void 0}function CDe(e,t,r){let o=[];for(let i=0;i<e.length;i++){let s=e[i]??"";if(s==="--operation-api-key"){o.push(s,"<OPERATION_API_KEY>"),i++;continue}if(s.startsWith("--operation-api-key=")){o.push("--operation-api-key=<OPERATION_API_KEY>");continue}if(s==="--limit"||s==="--offset"){i++;continue}s.startsWith("--limit=")||s.startsWith("--offset=")||o.push(s)}return["tsuga",...o,"--limit",String(t),"--offset",String(r)].map(RDe).join(" ")}function RDe(e){return/^[\w./:=@%+,-]+$/.test(e)?e:`'${e.replace(/'/g,"'\\''")}'`}function PDe(e,t){let r=Math.round(t/ud);switch(e){case 504:return new yp({message:`The API gave up on the request after ${r}s (HTTP 504): it ran longer than the gateway allows.`,statusCode:e,suggestions:["Narrow the time range or add filters to the query","Ask for fewer results"]});case 502:case 503:return new yp({message:`The API gateway could not reach the server (HTTP ${e}).`,statusCode:e,suggestions:["Retry in a few seconds"]});default:return new yp({message:`Server returned a non-JSON response (HTTP ${e}).`,statusCode:e})}}var see=N("api.endpoint")(function*(e,t={}){yield*yc(qM(e,t,void 0));let{data:r,metadata:o}=t.allPages?yield*UDe(e,t):yield*cee(e,t).pipe(Zs(i=>mt(function*(){let s=ADe(i,bDe(t),yield*eX);s!==void 0&&(yield*Xn(s))})));return yield*yc(qM(e,t,r)),{data:r,metadata:o}}),UDe=k(function*(e,t){if(wDe(t))return yield*new At({message:"--all cannot be combined with --limit or --offset"});let r=[];for(;;){let o=yield*cee(e,vDe(e,t,r.length)),i=aee(o.data),s=o.metadata?.pagination?.totalCount;if(i===void 0||s===void 0)return o;if(r.push(...i),i.length===0||r.length>=s)return{data:NDe(o.data,r),metadata:{pagination:{totalCount:r.length,pageCount:1}}}}});function wDe({body:e,query:t}){let r=e??{};return[t?.limit,t?.offset,r.limit,r.offset].some(o=>o!==void 0)}function vDe(e,t,r){let o={limit:dp,offset:r};return e.body!==void 0&&n.IsObject(e.body)&&"offset"in e.body.properties?{...t,body:{...t.body,...o}}:{...t,query:{...t.query,...o}}}function NDe(e,t){if(Array.isArray(e))return t;let[r]=Object.keys(e);return{[r??"data"]:t}}var cee=k(function*(e,t){let r=yield*Ua,o=yield*ht,i=yield*Yl,s=yield*o.resolve({operationApiKey:r.operationApiKey,clusterId:r.cluster}),{credential:a}=s;if(a===void 0)return yield*new hp({message:"No credentials.",suggestions:KA});let u=a.kind==="operation-api-key"?a.token:(yield*yC(s.apiUrl,a.userAuth)).accessToken,l=r.rationale?IDe(r.rationale):"",d=yield*rJ(s.apiUrl,"cli",e,s.clusterId===void 0?t:LDe(e,t,s.clusterId),{Authorization:`Bearer ${u}`,...l?{[KL]:l}:{}}),g=yield*Kn,y=yield*i.execute(d).pipe(st(T=>new Pa({message:`Could not reach ${s.apiUrl}`,cause:T}))),E=(yield*Kn)-g,h=yield*y.json.pipe(q(ODe),st(()=>PDe(y.status,E)));if(yield*L2("API response").pipe(M2({method:d.method,url:d.url,status:y.status,requestId:h.requestId})),h.error){let T=h.error.statusCode??y.status,_;T===401?_=[`Replace the rejected credential: ${a.kind==="operation-api-key"?kDe[a.source]:"tsuga auth login"}`]:T===403?_=[`Inspect your identity and permissions: ${r.operationApiKey?"tsuga --operation-api-key <OPERATION_API_KEY> auth whoami":"tsuga auth whoami"}`]:_=iee(h.error.code);let{hint:S,docUrl:I}=h.error,b=[..._,...S?[S]:[],...I?[`See ${I}`]:[]];return yield*Us.fromErrorResponse({...h.error,...b.length>0?{suggestions:b}:{}},h.requestId)}return h}),kDe={flag:"tsuga --operation-api-key <OPERATION_API_KEY> <COMMAND>",environment:"export TSUGA_OPERATION_API_KEY=<OPERATION_API_KEY>",config:"tsuga auth operation-key <OPERATION_API_KEY>"},rr=k(function*(e,t={}){return(yield*Xe(e,t)).data}),Xe=k(function*(e,t={}){return yield*see(e,t).pipe(ui("ApiError",r=>mt(function*(){if(!tee(r))return yield*r;let o=yield*see(fC).pipe(J(i=>i.data),pi(()=>[]));return yield*Us.fromErrorResponse({message:`${r.message}${nee(o)}`,statusCode:r.statusCode,code:r.code,details:r.details,suggestions:ree},r.requestId)})))});function LDe(e,t,r){return e.body!==void 0&&n.IsObject(e.body)&&"clusterId"in e.body.properties?{...t,body:{clusterId:r,...t.body}}:{...t,query:{clusterId:r,...t.query}}}var MDe="Provide a request body with -f <FILE_PATH> or -d <JSON>. Use --generate-skeleton to get a template.",KM=(e,t)=>Et({try:()=>JSON.parse(t),catch:r=>new At({message:`${e} is not valid JSON: ${r instanceof Error?r.message:String(r)}`})}),Wc=k(function*(e){if(wt(e.file)&&wt(e.data))return yield*new At({message:"-f and -d cannot be combined. Provide the request body with one of them."});let t=ue(e.file);if(t!==void 0){if(t==="-"){let s=yield*Ym,a=yield*bl(s.stdin).pipe(xl,st(u=>new At({message:`Could not read stdin: ${u.message}`})));return yield*KM("stdin",a)}let i=yield*(yield*rn).readFileString(t).pipe(st(s=>new At({message:`Could not read ${t}: ${s.message}`})));return yield*KM(t,i)}let r=ue(e.data);return r!==void 0?yield*KM("--data",r):yield*new At({message:MDe})});function OC(e){return c.HasPropertyKey(e,"~refine")&&c.IsArray(e["~refine"])&&c.Every(e["~refine"],0,t=>c.IsObject(t)&&c.HasPropertyKey(t,"check")&&c.HasPropertyKey(t,"error")&&c.IsFunction(t.check)&&c.IsFunction(t.error))}function No(e){return c.IsObject(e)&&!c.IsArray(e)}function Id(e){return c.IsBoolean(e)}function Re(e){return No(e)||Id(e)}function AC(e){return c.HasPropertyKey(e,"additionalItems")&&Re(e.additionalItems)}function va(e){return c.HasPropertyKey(e,"additionalProperties")&&Re(e.additionalProperties)}function CC(e){return c.HasPropertyKey(e,"allOf")&&c.IsArray(e.allOf)&&e.allOf.every(t=>Re(t))}function uee(e){return c.HasPropertyKey(e,"$anchor")&&c.IsString(e.$anchor)}function RC(e){return c.HasPropertyKey(e,"anyOf")&&c.IsArray(e.anyOf)&&e.anyOf.every(t=>Re(t))}function zM(e){return c.HasPropertyKey(e,"const")}function _p(e){return c.HasPropertyKey(e,"contains")&&Re(e.contains)}function bi(e){return c.HasPropertyKey(e,"default")}function YM(e){return c.HasPropertyKey(e,"dependencies")&&c.IsObject(e.dependencies)&&Object.values(e.dependencies).every(t=>Re(t)||c.IsArray(t)&&t.every(r=>c.IsString(r)))}function VM(e){return c.HasPropertyKey(e,"dependentRequired")&&c.IsObject(e.dependentRequired)&&Object.values(e.dependentRequired).every(t=>c.IsArray(t)&&t.every(r=>c.IsString(r)))}function PC(e){return c.HasPropertyKey(e,"dependentSchemas")&&c.IsObject(e.dependentSchemas)&&Object.values(e.dependentSchemas).every(t=>Re(t))}function Ip(e){return c.HasPropertyKey(e,"$dynamicAnchor")&&c.IsString(e.$dynamicAnchor)}function UC(e){return c.HasPropertyKey(e,"$dynamicRef")&&c.IsString(e.$dynamicRef)}function wC(e){return c.HasPropertyKey(e,"else")&&Re(e.else)}function WM(e){return c.HasPropertyKey(e,"enum")&&c.IsArray(e.enum)}function QM(e){return c.HasPropertyKey(e,"exclusiveMaximum")&&(c.IsNumber(e.exclusiveMaximum)||c.IsBigInt(e.exclusiveMaximum))}function Qc(e){return c.HasPropertyKey(e,"exclusiveMinimum")&&(c.IsNumber(e.exclusiveMinimum)||c.IsBigInt(e.exclusiveMinimum))}function RT(e){return c.HasPropertyKey(e,"format")&&c.IsString(e.format)}function To(e){return c.HasPropertyKey(e,"$id")&&c.IsString(e.$id)}function vC(e){return c.HasPropertyKey(e,"if")&&Re(e.if)}function bd(e){return c.HasPropertyKey(e,"items")&&(Re(e.items)||c.IsArray(e.items)&&e.items.every(t=>Re(t)))}function NC(e){return bd(e)&&c.IsArray(e.items)}function ZM(e){return c.HasPropertyKey(e,"maximum")&&(c.IsNumber(e.maximum)||c.IsBigInt(e.maximum))}function XM(e){return c.HasPropertyKey(e,"maxContains")&&c.IsNumber(e.maxContains)}function kC(e){return c.HasPropertyKey(e,"maxItems")&&c.IsNumber(e.maxItems)}function JM(e){return c.HasPropertyKey(e,"maxLength")&&c.IsNumber(e.maxLength)}function eD(e){return c.HasPropertyKey(e,"maxProperties")&&c.IsNumber(e.maxProperties)}function Zc(e){return c.HasPropertyKey(e,"minimum")&&(c.IsNumber(e.minimum)||c.IsBigInt(e.minimum))}function xd(e){return c.HasPropertyKey(e,"minContains")&&c.IsNumber(e.minContains)}function mg(e){return c.HasPropertyKey(e,"minItems")&&c.IsNumber(e.minItems)}function PT(e){return c.HasPropertyKey(e,"minLength")&&c.IsNumber(e.minLength)}function UT(e){return c.HasPropertyKey(e,"minProperties")&&c.IsNumber(e.minProperties)}function tD(e){return c.HasPropertyKey(e,"multipleOf")&&(c.IsNumber(e.multipleOf)||c.IsBigInt(e.multipleOf))}function LC(e){return c.HasPropertyKey(e,"not")&&Re(e.not)}function MC(e){return c.HasPropertyKey(e,"oneOf")&&c.IsArray(e.oneOf)&&e.oneOf.every(t=>Re(t))}function wT(e){return c.HasPropertyKey(e,"pattern")&&(c.IsString(e.pattern)||e.pattern instanceof RegExp)}function fg(e){return c.HasPropertyKey(e,"patternProperties")&&c.IsObject(e.patternProperties)&&Object.values(e.patternProperties).every(t=>Re(t))}function Od(e){return c.HasPropertyKey(e,"prefixItems")&&c.IsArray(e.prefixItems)&&e.prefixItems.every(t=>Re(t))}function gg(e){return c.HasPropertyKey(e,"properties")&&c.IsObject(e.properties)&&Object.values(e.properties).every(t=>Re(t))}function DC(e){return c.HasPropertyKey(e,"propertyNames")&&(c.IsObject(e.propertyNames)||Re(e.propertyNames))}function DDe(e){return c.HasPropertyKey(e,"$recursiveAnchor")&&c.IsBoolean(e.$recursiveAnchor)}function vT(e){return DDe(e)&&c.IsEqual(e.$recursiveAnchor,!0)}function FC(e){return c.HasPropertyKey(e,"$recursiveRef")&&c.IsString(e.$recursiveRef)}function $C(e){return c.HasPropertyKey(e,"$ref")&&c.IsString(e.$ref)}function Ad(e){return c.HasPropertyKey(e,"required")&&c.IsArray(e.required)&&e.required.every(t=>c.IsString(t))}function GC(e){return c.HasPropertyKey(e,"then")&&Re(e.then)}function rD(e){return c.HasPropertyKey(e,"type")&&(c.IsString(e.type)||c.IsArray(e.type)&&e.type.every(t=>c.IsString(t)))}function hg(e){return c.HasPropertyKey(e,"uniqueItems")&&c.IsBoolean(e.uniqueItems)}function NT(e){return c.HasPropertyKey(e,"unevaluatedItems")&&Re(e.unevaluatedItems)}function kT(e){return c.HasPropertyKey(e,"unevaluatedProperties")&&Re(e.unevaluatedProperties)}var So=class{constructor(){let t=new Set,r=new Set;this.stack=[{indices:t,keys:r}]}Push(){let t=new Set,r=new Set;return this.stack.push({indices:t,keys:r}),!0}Pop(){return this.stack.pop(),!0}AddIndex(t){return this.GetIndices().add(t),!0}AddKey(t){return this.GetKeys().add(t),!0}GetIndices(){return this.stack[this.stack.length-1].indices}GetKeys(){return this.stack[this.stack.length-1].keys}Merge(t){for(let r of t)r.GetIndices().forEach(o=>this.GetIndices().add(o)),r.GetKeys().forEach(o=>this.GetKeys().add(o));return!0}},Bn=class extends So{constructor(){super(),this.errors=[]}AtCapacity(){return this.errors.length>=Hr.Get().maxErrors}AddError(t,r,o,i){return this.AddErrorObject({keyword:t,schemaPath:r,instancePath:o,params:i})}AddErrors(t){return t.forEach(r=>this.AddErrorObject(r)),!1}GetErrors(){return this.errors}AddErrorObject(t){return this.AtCapacity()||this.errors.push(t),!1}};function pee(e,t,r,o){return c.Every(r["~refine"],0,(i,s)=>i.check(o))}function lee(e,t,r,o,i,s){return c.EveryAll(i["~refine"],0,(a,u)=>a.check(s)||t.AddError("~refine",r,o,{index:u,message:a.error(s)}))}var LT="urn:typebox:root";function Xc(e,t){return URL.canParse(e,t)?new URL(e,t):c.IsEqual(t,LT)?new URL(`${t}:${e}`):new URL(`${t.slice(0,t.lastIndexOf(":"))}:${e}`)}function Eg(e,t){let r=No(t)&&To(t)?Xc(t.$id,LT).href:LT;return{context:e,schema:t,lexicalSchema:t,lexicalBase:r,resourceBase:r,referenceBase:r,ids:[],useResourceBaseForReference:!0,recursiveAnchor:void 0,dynamicAnchors:[],resourceEntries:new Map,pendingResource:!0,enteredResource:!1}}function nD(e,t,r=!0){if(Id(t))return e;if(Array.isArray(t))return t.reduce((i,s)=>nD(i,s,!1),e);if(!No(t)||!r&&To(t))return e;let o=!r&&Ip(t)?[...e,t]:e;return Object.keys(t).reduce((i,s)=>nD(i,t[s],!1),o)}function MT(e,t){return e.resourceEntries.get(t)}function dee(e,t){return e.enteredResource||MT(e,t)!==void 0}function FDe(e){return!/^[A-Za-z][A-Za-z0-9+.-]*:/.test(e.$id)}function $De(e,t){return To(t)?[...e.ids,t]:e.ids}function GDe(e,t){return e.recursiveAnchor??(vT(t)?t:void 0)}function BDe(e,t){let r=To(t)?nD(e.dynamicAnchors,t):e.dynamicAnchors;return Ip(t)?[...r,t]:r}function jDe(e,t){return To(t)?!1:e.pendingResource}function mee(e,t){let r=MT(e,t);return r?r.base:To(t)?Xc(t.$id,e.lexicalBase).href:e.lexicalBase}function fee(e,t){let r=MT(e,t);return r?r.base:To(t)&&e.pendingResource?Xc(t.$id,e.resourceBase).href:e.resourceBase}function gee(e,t){return To(t)?!FDe(t):e.useResourceBaseForReference}function qDe(e,t){let r=dee(e,t),o=gee(e,t);return r||o?fee(e,t):mee(e,t)}function HDe(e,t){let r=MT(e,t);return r?r.root:To(t)?t:e.lexicalSchema}function KDe(e,t){return No(t)&&(To(t)||Ip(t)||c.IsUndefined(e.recursiveAnchor)&&vT(t)||!c.IsUndefined(MT(e,t)))}function Tg(e,t){return KDe(e,t)?{...e,ids:$De(e,t),dynamicAnchors:BDe(e,t),recursiveAnchor:GDe(e,t),pendingResource:jDe(e,t),lexicalBase:mee(e,t),resourceBase:fee(e,t),useResourceBaseForReference:gee(e,t),referenceBase:qDe(e,t),lexicalSchema:HDe(e,t),enteredResource:dee(e,t)}:e}function hee(e){return bd(e)&&c.IsArray(e.items)}function yee(e,t,r,o){return hee(r)?c.Every(o,0,(s,a)=>c.IsLessThan(a,r.items.length)||xi(e,t,r.additionalItems,s)&&t.AddIndex(a)):!0}function Eee(e,t,r,o,i,s){return hee(i)?c.Every(s,0,(u,l)=>{let d=`${r}/additionalItems`,g=`${o}/${l}`;return c.IsLessThan(l,i.items.length)||Oi(e,t,d,g,i.additionalItems,u)&&t.AddIndex(l)}):!0}function Vo(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function bp(e){return new RegExp(e,"u")}function zDe(e){return`^${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}$`}function Tee(e){let t=[];return fg(e)&&t.push(...c.Keys(e.patternProperties)),gg(e)&&t.push(...c.Keys(e.properties).map(zDe)),c.IsEqual(t.length,0)?"(?!)":`(${t.join("|")})`}function See(e,t,r,o){let i=bp(Tee(r));return c.Every(c.Keys(o),0,(a,u)=>i.test(a)||xi(e,t,r.additionalProperties,o[a])&&t.AddKey(a))}function _ee(e,t,r,o,i,s){let a=bp(Tee(i)),u=[];return c.EveryAll(c.Keys(s),0,(d,g)=>{let y=`${r}/additionalProperties`,E=`${o}/${Vo(d)}`,h=a.test(d)||Oi(e,t,y,E,i.additionalProperties,s[d])&&t.AddKey(d);return h||u.push(d),h})||t.AddError("additionalProperties",r,o,{additionalProperties:u})}function Iee(e,t,r,o){let i=r.allOf.reduce((s,a)=>{let u=new So;return pt(e,u,a,o)?[...s,u]:s},[]);return c.IsEqual(i.length,r.allOf.length)&&t.Merge(i)}function bee(e,t,r,o,i,s){let a=[],u=i.allOf.reduce((d,g,y)=>{let E=`${r}/allOf/${y}`,h=new Bn,T=Bt(e,h,E,o,g,s);return T||a.push(h),T?[...d,h]:d},[]),l=c.IsEqual(u.length,i.allOf.length)&&t.Merge(u);return l||a.forEach(d=>t.AddErrors(d.GetErrors())),l}function xee(e,t,r,o){let i=r.anyOf.reduce((s,a)=>{let u=new So;return pt(e,u,a,o)?[...s,u]:s},[]);return c.IsGreaterThan(i.length,0)&&t.Merge(i)}function Oee(e,t,r,o,i,s){let a=[],u=i.anyOf.reduce((d,g,y)=>{let E=new Bn,h=`${r}/anyOf/${y}`,T=Bt(e,E,h,o,g,s);return T||a.push(E),T?[...d,E]:d},[]),l=c.IsGreaterThan(u.length,0)&&t.Merge(u);return l||a.forEach(d=>t.AddErrors(d.GetErrors())),l||t.AddError("anyOf",r,o,{})}function sD(e,t,r,o){return r}function Aee(e,t,r,o,i,s){return sD(e,t,i,s)||t.AddError("boolean",r,o,{})}function aD(e,t,r,o){return c.IsValueLike(r.const)?c.IsEqual(o,r.const):c.IsDeepEqual(o,r.const)}function Cee(e,t,r,o,i,s){return aD(e,t,i,s)||t.AddError("const",r,o,{allowedValue:i.const})}function YDe(e){return!(xd(e)&&c.IsEqual(e.minContains,0))}function cD(e,t,r,o){return YDe(r)?!c.IsEqual(o.length,0)&&c.SomeAll(o,(i,s)=>pt(e,t,r.contains,i)&&t.AddIndex(s)):!0}function Ree(e,t,r,o,i,s){return cD(e,t,i,s)||t.AddError("contains",r,o,{minContains:1})}function Pee(e,t,r,o){let i=c.IsEqual(c.Keys(o).length,0),s=c.Every(c.Entries(r.dependencies),0,([a,u])=>!c.HasPropertyKey(o,a)||(c.IsArray(u)?u.every(l=>c.HasPropertyKey(o,l)):pt(e,t,u,o)));return i||s}function Uee(e,t,r,o,i,s){let a=c.IsEqual(c.Keys(s).length,0),u=c.EveryAll(c.Entries(i.dependencies),0,([l,d])=>{let g=`${r}/dependencies/${Vo(l)}`;return!c.HasPropertyKey(s,l)||(c.IsArray(d)?d.every(y=>c.HasPropertyKey(s,y)||t.AddError("dependencies",r,o,{property:l,dependencies:d})):Bt(e,t,g,o,d,s))});return a||u}function wee(e,t,r,o){let i=c.IsEqual(c.Keys(o).length,0),s=c.Every(c.Entries(r.dependentRequired),0,([a,u])=>!c.HasPropertyKey(o,a)||u.every(l=>c.HasPropertyKey(o,l)));return i||s}function vee(e,t,r,o,i,s){let a=c.IsEqual(c.Keys(s).length,0),u=c.EveryAll(c.Entries(i.dependentRequired),0,([l,d])=>!c.HasPropertyKey(s,l)||c.EveryAll(d,0,g=>c.HasPropertyKey(s,g)||t.AddError("dependentRequired",r,o,{property:l,dependencies:d})));return a||u}function Nee(e,t,r,o){let i=c.IsEqual(c.Keys(o).length,0),s=c.Every(c.Entries(r.dependentSchemas),0,([a,u])=>!c.HasPropertyKey(o,a)||pt(e,t,u,o));return i||s}function kee(e,t,r,o,i,s){let a=c.IsEqual(c.Keys(s).length,0),u=c.EveryAll(c.Entries(i.dependentSchemas),0,([l,d])=>{let g=`${r}/dependentSchemas/${Vo(l)}`;return!c.HasPropertyKey(s,l)||Bt(e,t,g,o,d,s)});return a||u}var es={};Ci(es,{DynamicRef:()=>xFe,RecursiveRef:()=>_Fe,Ref:()=>TFe});var _g={};Ci(_g,{Delete:()=>ZDe,Get:()=>WDe,Has:()=>VDe,Indices:()=>FT,Set:()=>QDe});function Mee(e){throw Error(e)}function Lee(){Mee("Pointer contains unsafe property key")}function uD(){Mee("Cannot set value")}function FT(e){let t=e.split("/").map(r=>r.replace(/~1/g,"/").replace(/~0/g,"~"));return t[0]===""?t.slice(1):t}function VDe(e,t){let r=e;for(let o of FT(t)){if(!c.IsObject(r)||!c.HasPropertyKey(r,o))return!1;r=r[o]}return!0}function WDe(e,t){let r=e;for(let o of FT(t)){if(!c.IsObject(r)||c.IsUnsafePropertyKey(o))return;r=r[o]}return r}function Dee(e,t,r){let o=e;for(let i of t)c.IsUnsafePropertyKey(i)&&Lee(),o=c.IsObject(o)?o[i]:void 0;return c.IsUnsafePropertyKey(r)&&Lee(),c.IsObject(o)||uD(),o}function QDe(e,t,r){let o=FT(t),i=o.pop();return c.IsUndefined(i)&&uD(),Dee(e,o,i)[i]=r,e}function ZDe(e,t){let r=FT(t),o=r.pop();c.IsUndefined(o)&&uD();let i=Dee(e,r,o);return c.IsArray(i)&&/^(0|[1-9]\d*)$/.test(o)?i.splice(Number(o),1):delete i[o],e}function dD(e,t){return No(e)&&To(e)?Xc(e.$id,t.href):t}function mD(e){return Xc(e,LT)}function pD(e){return e.href.split("#")[0]}function XDe(e,t,r){return lD(e,mD(t),r)}function JDe(e,t){return t.$ref.startsWith("#")||e.enteredResource?e.lexicalSchema:e.schema}function eFe(e){return e.startsWith("#/")}function Fee(e,t){if(c.IsObject(e)&&Ip(e)&&c.IsEqual(e.$dynamicAnchor,t))return e;if(c.IsObject(e))for(let r of c.Keys(e)){let o=Fee(e[r],t);if(o)return o}}function lD(e,t,r){if(c.IsEqual(e,r))return t.href;let o=dD(e,t);if(c.IsArray(e))for(let i of e){let s=lD(i,o,r);if(!c.IsUndefined(s))return s}else if(c.IsObject(e))for(let i of c.Keys(e)){let s=lD(e[i],o,r);if(!c.IsUndefined(s))return s}}function $ee(e,t){if(t.href.endsWith("#"))return e;if(!t.hash.startsWith("#"))return;let r=decodeURIComponent(t.hash.slice(1));if(r.startsWith("/"))return _g.Get(e,r)}function tFe(e,t,r){if(!To(e))return;if(c.IsEqual(e.$id,r.hash))return e;let o=new URL(r.href,t.href);if(c.IsEqual(t.pathname,o.pathname))return r.hash.startsWith("#")?$ee(e,r):e}function rFe(e,t,r){if(!uee(e))return;let o=new URL(`#${e.$anchor}`,t.href),i=new URL(r.href,t.href);return c.IsEqual(o.href,i.href)?e:void 0}function nFe(e,t,r){if(!Ip(e))return;let o=new URL(`#${e.$dynamicAnchor}`,t.href),i=new URL(r.href,t.href);return c.IsEqual(o.href,i.href)?e:void 0}function oFe(e,t,r){if(No(e))return tFe(e,t,r)??rFe(e,t,r)??nFe(e,t,r)??$ee(e,r)}function iFe(e,t,r){if(c.IsArray(e))return e.reduce((o,i)=>{let s=BC(i,t,r);return c.IsUndefined(s)?o:s},void 0)}function sFe(e,t,r){if(c.IsObject(e))return c.Keys(e).reduce((o,i)=>{if(c.IsEqual(i,"const")||c.IsEqual(i,"enum"))return o;let s=BC(e[i],t,r);return c.IsUndefined(s)?o:s},void 0)}function BC(e,t,r){let o=dD(e,t);return oFe(e,o,r)??iFe(e,o,r)??sFe(e,o,r)}function aFe(e,t,r,o){let i=jC(e,t,r,o);return No(i)&&To(i)?i:void 0}function cFe(e,t,r){if(!t.$ref.startsWith("#")||!No(e.schema)||c.HasPropertyKey(e.schema,"$schema"))return;let o=XDe(e.lexicalSchema,e.referenceBase,r);if(!(c.IsUndefined(o)||c.IsEqual(o,e.referenceBase)))return{target:r,base:o,root:e.lexicalSchema}}function uFe(e,t,r){let o=e.context[t];if(No(o))return{target:r,base:t,root:o}}function pFe(e,t,r,o,i){let s=i?uFe(e,o,r):void 0;return c.IsUndefined(s)?cFe(e,t,r):s}function lFe(e,t,r){if(To(r))return;let o=aFe(e.context,e.schema,e.referenceBase,t);if(!(!o||e.ids.includes(o)))return{resource:o}}function dFe(e,t){return c.HasPropertyKey(e,t)?e[t]:void 0}function mFe(e,t,r){return BC(e,t,r)}function fFe(e,t,r){let o=pD(r);if(!c.HasPropertyKey(e,o)||c.IsEqual(o,pD(t)))return;let i=e[o],s=dD(i,new URL(o));return c.IsEqual(r.hash,"")?i:BC(i,s,r)}function jC(e,t,r,o){let i=mD(r),s=Xc(o,i.href);return dFe(e,o)??mFe(t,i,s)??fFe(e,i,s)}function gFe(e,t){if(!t)return e;let r=new Map(e.resourceEntries);return r.set(t.target,{base:t.base,root:t.root}),{...e,resourceEntries:r}}function hFe(e,t){return t?Tg(e,t.resource):e}function Gee(e,t,r,o){let i=gFe({...e,pendingResource:t},r);return hFe(i,o)}function yFe(e,t,r){let o=pD(Xc(t.$ref,e.referenceBase)),i=!c.IsEqual(o,e.resourceBase),s=pFe(e,t,r,o,i),a=i?lFe(e,o,r):void 0;return{schema:r,stack:Gee(e,!0,s,a)}}function EFe(e,t){return{schema:t,stack:Gee(e,!c.IsUndefined(t))}}function TFe(e,t){let r=jC(e.context,JDe(e,t),e.referenceBase,t.$ref);return No(r)?yFe(e,t,r):EFe(e,r)}function SFe(e){return No(e.lexicalSchema)&&vT(e.lexicalSchema)}function _Fe(e,t){let r=SFe(e)?e.recursiveAnchor:e.lexicalSchema;return jC(e.context,r,e.lexicalBase,t.$recursiveRef)}function Bee(e,t){return Xc(t.$dynamicRef,mD(e.lexicalBase).href).hash}function jee(e,t){return e.dynamicAnchors.find(r=>c.IsEqual(r.$dynamicAnchor,t))??Fee(e.schema,t)}function IFe(e,t,r){if(!No(r)||!Ip(r))return r;let o=Bee(e,t);return eFe(o)?r:jee(e,r.$dynamicAnchor)}function bFe(e,t){let r=Bee(e,t);return jee(e,decodeURIComponent(r.slice(1)))}function xFe(e,t){let r=t.$dynamicRef.startsWith("#")?e.lexicalSchema:e.schema,o=jC(e.context,r,e.lexicalBase,t.$dynamicRef);return c.IsUndefined(o)?bFe(e,t):IFe(e,t,o)}function qee(e,t,r,o){let i=es.DynamicRef(e,r)??!1,s=i?{...e,pendingResource:!0}:e;return Re(i)&&pt(s,t,i,o)}function Hee(e,t,r,o,i,s){let a=es.DynamicRef(e,i)??!1,u=a?{...e,pendingResource:!0}:e;return Re(a)&&Bt(u,t,r,o,a,s)}function hD(e,t,r,o){return c.Some(r.enum,i=>c.IsValueLike(i)?c.IsEqual(o,i):c.IsDeepEqual(o,i))}function Kee(e,t,r,o,i,s){return hD(e,t,i,s)||t.AddError("enum",r,o,{allowedValues:i.enum})}function yD(e,t,r,o){return c.IsLessThan(o,r.exclusiveMaximum)}function zee(e,t,r,o,i,s){return yD(e,t,i,s)||t.AddError("exclusiveMaximum",r,o,{comparison:"<",limit:i.exclusiveMaximum})}function ED(e,t,r,o){return c.IsGreaterThan(o,r.exclusiveMinimum)}function Yee(e,t,r,o,i,s){return ED(e,t,i,s)||t.AddError("exclusiveMinimum",r,o,{comparison:">",limit:i.exclusiveMinimum})}var jT={};Ci(jT,{Clear:()=>Ste,Entries:()=>f$e,Get:()=>y$e,Has:()=>h$e,IsDate:()=>Ig,IsDateTime:()=>qC,IsDuration:()=>HC,IsEmail:()=>KC,IsHostname:()=>JC,IsIPv4:()=>rR,IsIPv6:()=>nR,IsIdnEmail:()=>eR,IsIdnHostname:()=>tR,IsIri:()=>oR,IsIriReference:()=>Og,IsJsonPointer:()=>sR,IsJsonPointerUriFragment:()=>iR,IsRegex:()=>aR,IsRelativeJsonPointer:()=>cR,IsTime:()=>bg,IsUri:()=>lR,IsUriReference:()=>uR,IsUriTemplate:()=>pR,IsUrl:()=>dR,IsUuid:()=>mR,Reset:()=>_te,Set:()=>g$e,Test:()=>E$e});var OFe=[0,31,28,31,30,31,30,31,31,30,31,30,31],AFe=/^(\d\d\d\d)-(\d\d)-(\d\d)$/;function CFe(e){return e%4===0&&(e%100!==0||e%400===0)}function Ig(e){let t=AFe.exec(e);if(!t)return!1;let r=+t[1],o=+t[2],i=+t[3];return o>=1&&o<=12&&i>=1&&i<=(o===2&&CFe(r)?29:OFe[o])}var RFe=/^(\d\d):(\d\d):(\d\d)(?:\.\d+)?(?:([Zz])|([+-])(\d\d):(\d\d))?$/;function bg(e,t=!0){let r=RFe.exec(e);if(!r||t&&!r[4]&&!r[5])return!1;let o=+r[1],i=+r[2],s=+r[3];if(o>23||i>59||s>60)return!1;if(r[5]){let g=+r[6],y=+r[7];if(g>23||y>59)return!1}if(s<60)return!0;let a=r[5]==="-"?-1:1,u=+(r[6]||0),l=+(r[7]||0);return((o*60+i-a*(u*60+l))%1440+1440)%1440===1439}var PFe=/^(?:\[!?(?:(?!\.{1,2}[/\]])[A-Za-z._][A-Za-z._0-9+-]{0,13}(?:\/(?!\.{1,2}[/\]])[A-Za-z._][A-Za-z._0-9+-]{0,13})*|[+-](?:[01][0-9]|2[0-3]):[0-5][0-9])\](?:\[!?[a-z_][a-z_0-9-]*=[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*\])*|(?:\[!?[a-z_][a-z_0-9-]*=[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*\])*)$/;function qC(e){let t=e.indexOf("["),r=t===-1?e:e.slice(0,t);if(t!==-1&&!PFe.test(e.slice(t)))return!1;let o=r.split(/T/i);return o.length===2&&Ig(o[0])&&bg(o[1])}var UFe=/^P((\d+Y(\d+M(\d+D)?)?|\d+M(\d+D)?|\d+D)(T(\d+H(\d+M(\d+S)?)?|\d+M(\d+S)?|\d+S))?|T(\d+H(\d+M(\d+S)?)?|\d+M(\d+S)?|\d+S)|\d+W)$/;function HC(e){return UFe.test(e)}var wFe=/^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[^"\\]|\\[\x20-\x7e])*")@(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*|\[(?:IPv6:[a-f0-9:]+|(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(?:\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3})\])$/i;function KC(e){return wFe.test(e)}var Vee=/^(?!-).*(?<!-)$/,Wee=/^(?!..--)/,Qee=/^[a-zA-Z0-9-]*$/,tVt=new RegExp("^\\p{ASCII}*$","u"),xg=/[^\p{ASCII}]/u;var vFe=/[0-9]/,Zee=/[\u{0660}-\u{0669}]/u,NFe=/[\u{06f0}-\u{06f9}]/u,kFe=/[\u{002e}\u{002c}\u{003a}\u{002f}]/u,LFe=/[\u{002d}\u{002b}]/u,TD=new RegExp("\\p{Mn}","u"),MFe=new RegExp("\\p{Mc}","u"),rVt=new RegExp("\\p{Me}","u"),Xee=/[\p{Mn}\p{Mc}\p{Me}]/u,SD=new RegExp("\\p{L}","u"),DFe=new RegExp("\\p{Nd}","u"),Jee=new RegExp("\\p{Script=Greek}","u"),zC=new RegExp("\\p{Script=Hebrew}","u"),ete=/[\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Han}]/u,tte=/[\p{Script=Arabic}\p{Script=Syriac}\p{Script=Thaana}\p{Script=Mandaic}]/u,_D=/[\u{094d}\u{09cd}\u{0a4d}\u{0acd}\u{0b4d}\u{0bcd}\u{0c4d}\u{0ccd}\u{0d3b}\u{0d3c}\u{0d4d}\u{0dca}\u{1b44}\u{1baa}\u{1bab}\u{a9c0}\u{11046}\u{1107f}\u{110b9}\u{11133}\u{11134}\u{111c0}\u{11235}\u{1134d}\u{11442}\u{114c2}\u{115bf}\u{1163f}\u{116b6}\u{11c3f}\u{11d44}\u{11d45}]/u,rte=/[\u{0640}\u{07fa}\u{302e}\u{302f}\u{3031}\u{3032}\u{3033}\u{3034}\u{3035}\u{303b}]/u,FFe=/[\u{00b7}\u{0375}\u{05f3}\u{05f4}\u{200c}\u{200d}\u{30fb}]/u,$Fe=/[\u{00df}\u{03c2}\u{06fd}\u{06fe}\u{0f0b}\u{3007}]/u,nte=new RegExp([vFe,NFe].map(e=>e.source).join("|"),"u"),ote=new RegExp([SD,LFe,kFe,DFe,TD,MFe,FFe,$Fe].map(e=>e.source).join("|"),"u");function ite(e){return Vee.test(e)&&Wee.test(e)&&Qee.test(e)}var Ns=36,GT=1,BT=26,BFe=38,jFe=700,ate=72,cte=128;function ID(){throw null}function YC(e){return e.toLowerCase().startsWith("xn--")}function ute(e,t,r){e=r?Math.floor(e/jFe):e>>1,e+=Math.floor(e/t);let o=0;for(;e>(Ns-GT)*BT>>1;)e=Math.floor(e/(Ns-GT)),o+=Ns;return o+Math.floor((Ns-GT+1)*e/(e+BFe))}function VC(e){let t=[],r=cte,o=0,i=ate,s=e.lastIndexOf("-");if(s>0)for(let u=0;u<s;u++){let l=e.charCodeAt(u);l>=128&&ID(),t.push(l)}let a=s<0?0:s+1;for(;a<e.length;){let u=o,l=1,d=Ns;for(;;){a>=e.length&&ID();let y=e.charCodeAt(a++),E;y>=97&&y<=122?E=y-97:y>=48&&y<=57?E=y-48+26:ID(),o+=E*l;let h=d<=i?GT:d>=i+BT?BT:d-i;if(E<h)break;l*=Ns-h,d+=Ns}let g=t.length+1;i=ute(o-u,g,u===0),r+=Math.floor(o/g),o%=g,t.splice(o,0,r),o++}return String.fromCodePoint(...t)}function ste(e){return e<26?String.fromCharCode(e+97):String.fromCharCode(e-26+48)}var qFe=new RegExp(xg.source,"gu");function pte(e){let t=e.replace(qFe,""),r=t.length,o=r>0?[t,"-"]:[],i=Array.from(e,d=>d.codePointAt(0)),s=cte,a=0,u=ate,l=r;for(;l<i.length;){let d=1/0;for(let g of i)g>=s&&g<d&&(d=g);a+=(d-s)*(l+1),s=d;for(let g of i)if(g<s&&a++,g===s){let y=a;for(let E=Ns;;E+=Ns){let h=E<=u?GT:E>=u+BT?BT:E-u;if(y<h)break;let T=h+(y-h)%(Ns-h);o.push(ste(T)),y=Math.floor((y-h)/(Ns-h))}o.push(ste(y)),u=ute(a,l+1,l===r),a=0,l++}a++,s++}return o.join("")}var HFe=/^(?:R|AL|AN|EN|ES|CS|ET|ON|BN|NSM)$/,lte=/^(?:L|EN|ES|CS|ET|ON|BN|NSM)$/,KFe=/^(?:R|AL|AN)$/;function dte(e){if(YC(e))try{return WC(VC(e.slice(4).toLowerCase()))}catch{return!1}return WC(e)}function mte(e){let t=String.fromCodePoint(e);return nte.test(t)?"EN":Zee.test(t)?"AN":TD.test(t)?"NSM":zC.test(t)?"R":tte.test(t)?"AL":SD.test(t)?"L":"ON"}function WC(e){for(let t of e)if(KFe.test(mte(t.codePointAt(0))))return!0;return!1}function QC(e){let t=!1,r=lte,o=!1,i=!1,s=!0;for(let a of e){let u=mte(a.codePointAt(0));if(s){if(u!=="L"&&u!=="R"&&u!=="AL")return!1;t=u==="R"||u==="AL",r=t?HFe:lte,s=!1}if(!r.test(u))return!1;u==="EN"?o=!0:u==="AN"&&(i=!0)}return!(t&&o&&i)}function zFe(e){return xg.test(e)&&pte(e).length+4>63}function YFe(e){return e[0]==="-"||e[e.length-1]==="-"?!0:e.slice(2).join("").startsWith("--")}function ZC(e){if(zFe(e)||WC(e)&&!QC(e))return!1;let t=[...e],r=t.map(s=>s.codePointAt(0)),o=r.length;if(YFe(t)||Xee.test(t[0]))return!1;let i=!1;for(let s=0;s<o;s++){let a=r[s],u=t[s];if(rte.test(u)||!ote.test(u))return!1;ete.test(u)&&(i=!0);let l=r[s-1],d=r[s+1];switch(a){case 183:if(l!==108||d!==108)return!1;break;case 885:if(!d||!Jee.test(t[s+1]))return!1;break;case 1523:case 1524:if(!l||!zC.test(t[s-1]))return!1;break;case 8204:if(!l||l<128&&!_D.test(t[s-1]))return!1;break;case 8205:if(!l||!_D.test(t[s-1]))return!1;break;case 12539:break}}return!(e.includes("\u30FB")&&!i)}function XC(e){if(!YC(e))return!1;try{let t=e.slice(4).toLowerCase();if(t.lastIndexOf("-")===0)return!1;let r=VC(t);return xg.test(r)?ZC(r):!1}catch{return!1}}function VFe(e){return e.length>0&&e.length<=63}function WFe(e){return VFe(e)&&(XC(e)||ite(e))}function yte(e){return e.length===0||e.length>253||e.charCodeAt(e.length-1)===46?!1:e.split(".").every(t=>WFe(t))}function QFe(e){return e.length>0&&e.length<=63}function ZFe(e){return QFe(e)&&(XC(e)||ZC(e))}function XFe(e){return e.replace(/[\uff01-\uff5e]/g,t=>String.fromCharCode(t.charCodeAt(0)-65248)).normalize("NFC").replace(/[\u00ad\u034f\u180b-\u180d\u200b\ufe00-\ufe0f\u{e0100}-\u{e01ef}]/gu,"").replace(/[\u002E\u3002\uFF0E\uFF61]/g,".")}function Ete(e){if(e.length===0||e.includes(" "))return!1;let t=XFe(e);if(t.length>253)return!1;let r=t.split("."),o=r.some(i=>dte(i));return r.every(i=>ZFe(i)&&(!o||QC(i)))}function JC(e){return yte(e)}var JFe=/^(?:[A-Za-z0-9!#$%&'*+\/=?^_`{|}~\u{0080}-\u{10FFFF}-]+(?:\.[A-Za-z0-9!#$%&'*+\/=?^_`{|}~\u{0080}-\u{10FFFF}-]+)*|"(?:[^"\\]|\\.)*")@[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,62})(?<!-)(?:\.[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,62})(?<!-))*$/iu;function eR(e){return JFe.test(e.normalize("NFC"))}function tR(e){return Ete(e)}var e$e=/^(?:(?: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 rR(e){return e$e.test(e)}var t$e=/^(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:)?[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?: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))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)$/i;function nR(e){return t$e.test(e)}var r$e=/[\x00-\x20\x7f"<>\^`{|}\\]|%(?![0-9a-fA-F]{2})/,n$e=/^(?:[a-z][a-z\d+\-.]*\/\/|(?!(?:[a-z][a-z\d+\-.]*:))[^/?#]*:)/i,o$e=/^(?:[a-z][a-z\d+\-.]*:)?\/\/[^/?#@]*@[^/?#@]*@/i,i$e=/^(?:[a-z][a-z\d+\-.]*:\/\/[^/?#]*\/|\/\/[^/?#]*\/|[a-z][a-z\d+\-.]*:(?!\/\/)|(?![a-z][a-z\d+\-.]*:|\/\/))[^?#]*[\[\]]/i;function Og(e){return!r$e.test(e)&&!n$e.test(e)&&!o$e.test(e)&&!i$e.test(e)&&URL.canParse(e,"http://example.com")}var s$e=/^[a-z][a-z\d+\-.]*:/i;function oR(e){return s$e.test(e)&&Og(e)}var a$e=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;function iR(e){return a$e.test(e)}var c$e=/^(?:\/(?:[^~/]|~0|~1)*)*$/;function sR(e){return c$e.test(e)}function aR(e){try{return new RegExp(e,"u"),!0}catch{return!1}}var u$e=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function cR(e){return u$e.test(e)}var p$e=/^(?:[a-z][a-z0-9+\-.]*:(?:\/\/(?:(?:[-a-z0-9._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:[\da-f]{1,4}:){6}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?: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))|::(?:[\da-f]{1,4}:){5}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?: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))|(?:[\da-f]{1,4})?::(?:[\da-f]{1,4}:){4}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?: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))|(?:(?:[\da-f]{1,4}:){0,1}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){3}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?: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))|(?:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){2}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?: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))|(?:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4})?::[\da-f]{1,4}:(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?: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))|(?:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4})?::(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?: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))|(?:(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4})?::[\da-f]{1,4}|(?:(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4})?::)|v[0-9a-f]+\.[-a-z0-9._~!$&'()*+,;=:]+)\]|(?:(?: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)|(?:[-a-z0-9._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:\/\/(?:(?:[-a-z0-9._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:[\da-f]{1,4}:){6}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?: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))|::(?:[\da-f]{1,4}:){5}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?: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))|(?:[\da-f]{1,4})?::(?:[\da-f]{1,4}:){4}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?: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))|(?:(?:[\da-f]{1,4}:){0,1}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){3}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?: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))|(?:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){2}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?: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))|(?:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4})?::[\da-f]{1,4}:(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?: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))|(?:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4})?::(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?: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))|(?:(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4})?::[\da-f]{1,4}|(?:(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4})?::)|v[0-9a-f]+\.[-a-z0-9._~!$&'()*+,;=:]+)\]|(?:(?: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)|(?:[-a-z0-9._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[-a-z0-9._~!$&'()*+,;=@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?)(?:\?(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function uR(e){return p$e.test(e)}var l$e=/^(?:(?:[^\x00-\x20"<>%\\^`{|}\x7f]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?:\.(?:[a-z0-9_]|%[0-9a-f]{2})+)*(?::[1-9]\d{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?:\.(?:[a-z0-9_]|%[0-9a-f]{2})+)*(?::[1-9]\d{0,3}|\*)?)*\})*$/i;function pR(e){return l$e.test(e)}var d$e=/^[a-z][a-z0-9+\-.]*:(?:\/\/(?:(?:[-a-z0-9._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:[\da-f]{1,4}:){6}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?: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))|::(?:[\da-f]{1,4}:){5}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?: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))|(?:[\da-f]{1,4})?::(?:[\da-f]{1,4}:){4}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?: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))|(?:(?:[\da-f]{1,4}:){0,1}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){3}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?: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))|(?:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){2}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?: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))|(?:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4})?::[\da-f]{1,4}:(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?: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))|(?:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4})?::(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?: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))|(?:(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4})?::[\da-f]{1,4}|(?:(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4})?::)|v[0-9a-f]+\.[-a-z0-9._~!$&'()*+,;=:]+)\]|(?:(?: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)|(?:[-a-z0-9._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function lR(e){return d$e.test(e)}function dR(e){return URL.canParse(e)}var m$e=/^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;function mR(e){return m$e.test(e)}var nr=new Map;function Ste(){nr.clear()}function f$e(){return[...nr.entries()]}function g$e(e,t){nr.set(e,t)}function h$e(e){return nr.has(e)}function y$e(e){return nr.get(e)}function E$e(e,t){return nr.get(e)?.(t)??!0}function _te(){Ste(),nr.set("date-time",qC),nr.set("date",Ig),nr.set("duration",HC),nr.set("email",KC),nr.set("hostname",JC),nr.set("idn-email",eR),nr.set("idn-hostname",tR),nr.set("ipv4",rR),nr.set("ipv6",nR),nr.set("iri-reference",Og),nr.set("iri",oR),nr.set("json-pointer-uri-fragment",iR),nr.set("json-pointer",sR),nr.set("regex",aR),nr.set("relative-json-pointer",cR),nr.set("time",bg),nr.set("uri-reference",uR),nr.set("uri-template",pR),nr.set("uri",lR),nr.set("url",dR),nr.set("uuid",mR)}_te();function xD(e,t,r,o){return jT.Test(r.format,o)}function Ite(e,t,r,o,i,s){return xD(e,t,i,s)||t.AddError("format",r,o,{format:i.format})}function bte(e,t,r,o){let i=GC(r)?r.then:!0,s=wC(r)?r.else:!0;return pt(e,t,r.if,o)?pt(e,t,i,o):pt(e,t,s,o)}function xte(e,t,r,o,i,s){let a=GC(i)?i.then:!0,u=wC(i)?i.else:!0,l=new Bn,d=Bt(e,l,`${r}/if`,o,i.if,s)?Bt(e,l,`${r}/then`,o,a,s)||t.AddError("if",r,o,{failingKeyword:"then"}):Bt(e,t,`${r}/else`,o,u,s)||t.AddError("if",r,o,{failingKeyword:"else"});return d&&t.Merge([l]),d}function T$e(e,t,r,o){return c.Every(r.items,0,(i,s)=>c.IsLessEqualThan(o.length,s)||xi(e,t,i,o[s])&&t.AddIndex(s))}function S$e(e,t,r,o,i,s){return c.EveryAll(i.items,0,(a,u)=>{let l=`${r}/items/${u}`,d=`${o}/${u}`;return c.IsLessEqualThan(s.length,u)||Oi(e,t,l,d,a,s[u])&&t.AddIndex(u)})}function _$e(e,t,r,o){let i=Od(r)?r.prefixItems.length:0;return c.Every(o,i,(s,a)=>xi(e,t,r.items,s)&&t.AddIndex(a))}function I$e(e,t,r,o,i,s){let a=Od(i)?i.prefixItems.length:0;return c.EveryAll(s,a,(u,l)=>{let d=`${r}/items`,g=`${o}/${l}`;return Oi(e,t,d,g,i.items,u)&&t.AddIndex(l)})}function Ote(e,t,r,o){return NC(r)?T$e(e,t,r,o):_$e(e,t,r,o)}function Ate(e,t,r,o,i,s){return NC(i)?S$e(e,t,r,o,i,s):I$e(e,t,r,o,i,s)}function b$e(e){return _p(e)}function OD(e,t,r,o){if(!b$e(r))return!0;let i=c.Counted(o,s=>pt(e,t,r.contains,s));return c.IsLessEqualThan(i,r.maxContains)}function Cte(e,t,r,o,i,s){let a=xd(i)?i.minContains:1;return OD(e,t,i,s)||t.AddError("contains",r,o,{minContains:a,maxContains:i.maxContains})}function AD(e,t,r,o){return c.IsLessEqualThan(o,r.maximum)}function Rte(e,t,r,o,i,s){return AD(e,t,i,s)||t.AddError("maximum",r,o,{comparison:"<=",limit:i.maximum})}function CD(e,t,r,o){return c.IsLessEqualThan(o.length,r.maxItems)}function Pte(e,t,r,o,i,s){return CD(e,t,i,s)||t.AddError("maxItems",r,o,{limit:i.maxItems})}function RD(e,t,r,o){return c.IsMaxLength(o,r.maxLength)}function Ute(e,t,r,o,i,s){return RD(e,t,i,s)||t.AddError("maxLength",r,o,{limit:i.maxLength})}function PD(e,t,r,o){return c.IsLessEqualThan(c.Keys(o).length,r.maxProperties)}function wte(e,t,r,o,i,s){return PD(e,t,i,s)||t.AddError("maxProperties",r,o,{limit:i.maxProperties})}function x$e(e){return _p(e)}function UD(e,t,r,o){if(!x$e(r))return!0;let i=c.Counted(o,(s,a)=>pt(e,t,r.contains,s)&&t.AddIndex(a));return c.IsGreaterEqualThan(i,r.minContains)}function vte(e,t,r,o,i,s){return UD(e,t,i,s)||t.AddError("contains",r,o,{minContains:i.minContains})}function wD(e,t,r,o){return c.IsGreaterEqualThan(o,r.minimum)}function Nte(e,t,r,o,i,s){return wD(e,t,i,s)||t.AddError("minimum",r,o,{comparison:">=",limit:i.minimum})}function vD(e,t,r,o){return c.IsGreaterEqualThan(o.length,r.minItems)}function kte(e,t,r,o,i,s){return vD(e,t,i,s)||t.AddError("minItems",r,o,{limit:i.minItems})}function ND(e,t,r,o){return c.IsMinLength(o,r.minLength)}function Lte(e,t,r,o,i,s){return ND(e,t,i,s)||t.AddError("minLength",r,o,{limit:i.minLength})}function kD(e,t,r,o){return c.IsGreaterEqualThan(c.Keys(o).length,r.minProperties)}function Mte(e,t,r,o,i,s){return kD(e,t,i,s)||t.AddError("minProperties",r,o,{limit:i.minProperties})}function LD(e,t,r,o){return c.IsMultipleOf(o,r.multipleOf)}function Dte(e,t,r,o,i,s){return LD(e,t,i,s)||t.AddError("multipleOf",r,o,{multipleOf:i.multipleOf})}function MD(e,t,r,o){let i=new So;return!pt(e,i,r.not,o)&&t.Merge([i])}function Fte(e,t,r,o,i,s){return MD(e,t,i,s)||t.AddError("not",r,o,{})}function $te(e,t,r,o){let i=r.oneOf.reduce((s,a)=>{let u=new So;return pt(e,u,a,o)?[...s,u]:s},[]);return c.IsEqual(i.length,1)&&t.Merge(i)}function Gte(e,t,r,o,i,s){let a=[],u=[],l=i.oneOf.reduce((g,y,E)=>{let h=new Bn,T=`${r}/oneOf/${E}`,_=Bt(e,h,T,o,y,s);return _&&u.push(E),_||a.push(h),_?[...g,h]:g},[]),d=c.IsEqual(l.length,1)&&t.Merge(l);return!d&&c.IsEqual(u.length,0)&&a.forEach(g=>t.AddErrors(g.GetErrors())),d||t.AddError("oneOf",r,o,{passingSchemas:u})}function DD(e,t,r,o){return(c.IsString(r.pattern)?bp(r.pattern):r.pattern).test(o)}function Bte(e,t,r,o,i,s){return DD(e,t,i,s)||t.AddError("pattern",r,o,{pattern:i.pattern})}function jte(e,t,r,o){return c.Every(c.Entries(r.patternProperties),0,([i,s])=>{let a=bp(i);return c.Every(c.Entries(o),0,([u,l])=>!a.test(u)||xi(e,t,s,l)&&t.AddKey(u))})}function qte(e,t,r,o,i,s){return c.EveryAll(c.Entries(i.patternProperties),0,([a,u])=>{let l=`${r}/patternProperties/${Vo(a)}`,d=bp(a);return c.EveryAll(c.Entries(s),0,([g,y])=>{let E=`${o}/${Vo(g)}`;return!d.test(g)||Oi(e,t,l,E,u,y)&&t.AddKey(g)})})}function Hte(e,t,r,o){return c.IsEqual(o.length,0)||c.Every(r.prefixItems,0,(i,s)=>c.IsLessEqualThan(o.length,s)||xi(e,t,i,o[s])&&t.AddIndex(s))}function Kte(e,t,r,o,i,s){return c.IsEqual(s.length,0)||c.EveryAll(i.prefixItems,0,(a,u)=>{let l=`${r}/prefixItems/${u}`,d=`${o}/${u}`;return c.IsLessEqualThan(s.length,u)||Oi(e,t,l,d,a,s[u])&&t.AddIndex(u)})}function FD(e,t){return e.includes(t)||Hr.Get().exactOptionalPropertyTypes}function $D(e,t){return c.IsUndefined(e[t])}function zte(e,t,r,o){let i=Ad(r)?r.required:[];return c.Every(c.Entries(r.properties),0,([a,u])=>{let l=!c.HasPropertyKey(o,a)||xi(e,t,u,o[a])&&t.AddKey(a);return FD(i,a)?l:$D(o,a)||l})}function Yte(e,t,r,o,i,s){let a=Ad(i)?i.required:[];return c.EveryAll(c.Entries(i.properties),0,([l,d])=>{let g=`${r}/properties/${Vo(l)}`,y=`${o}/${Vo(l)}`,E=()=>!c.HasPropertyKey(s,l)||Oi(e,t,g,y,d,s[l])&&t.AddKey(l);return FD(a,l)?E():$D(s,l)||E()})}function Vte(e,t,r,o){return c.Every(c.Keys(o),0,(i,s)=>pt(e,t,r.propertyNames,i))}function Wte(e,t,r,o,i,s){let a=[];return c.EveryAll(c.Keys(s),0,(l,d)=>{let g=`${o}/${Vo(l)}`,y=`${r}/propertyNames`,E=Bt(e,t,y,g,i.propertyNames,l);return E||a.push(l),E})||t.AddError("propertyNames",r,o,{propertyNames:a})}function Qte(e,t,r,o){let i=es.RecursiveRef(e,r)??!1,s=i?{...e,pendingResource:!0}:e;return Re(i)&&pt(s,t,i,o)}function Zte(e,t,r,o,i,s){let a=es.RecursiveRef(e,i)??!1,u=a?{...e,pendingResource:!0}:e;return Re(a)&&Bt(u,t,r,o,a,s)}function Xte(e,t,r,o){let i=es.Ref(e,r),s=i.schema??!1,a=new So,u=Re(s)&&pt(i.stack,a,s,o);return u&&t.Merge([a]),u}function Jte(e,t,r,o,i,s){let a=es.Ref(e,i),u=a.schema??!1,l=new Bn,d=Re(u)&&Bt(a.stack,l,r,o,u,s);return d&&t.Merge([l]),d||t.AddErrors(l.GetErrors()),d}function ere(e,t,r,o){return c.Every(r.required,0,i=>c.HasPropertyKey(o,i))}function tre(e,t,r,o,i,s){let a=[];return c.EveryAll(i.required,0,l=>{let d=c.HasPropertyKey(s,l);return d||a.push(l),d})||t.AddError("required",r,o,{requiredProperties:a})}function GD(e,t,r,o,i){return c.IsEqual(r,"object")?c.IsObjectNotArray(i):c.IsEqual(r,"array")?c.IsArray(i):c.IsEqual(r,"boolean")?c.IsBoolean(i):c.IsEqual(r,"integer")?c.IsInteger(i):c.IsEqual(r,"number")?c.IsNumber(i):c.IsEqual(r,"null")?c.IsNull(i):c.IsEqual(r,"string")?c.IsString(i):c.IsEqual(r,"bigint")?c.IsBigInt(i):c.IsEqual(r,"constructor")?c.IsConstructor(i):c.IsEqual(r,"function")?c.IsFunction(i):c.IsEqual(r,"symbol")?c.IsSymbol(i):c.IsEqual(r,"undefined")?c.IsUndefined(i):c.IsEqual(r,"void")?c.IsUndefined(i):!0}function rre(e,t,r,o,i){return c.Some(r,s=>GD(e,t,s,o,i))}function nre(e,t,r,o){return c.IsArray(r.type)?rre(e,t,r.type,r,o):GD(e,t,r.type,r,o)}function ore(e,t,r,o,i,s){return(c.IsArray(i.type)?rre(e,t,i.type,i,s):GD(e,t,i.type,i,s))||t.AddError("type",r,o,{type:i.type})}function ire(e,t,r,o){let i=t.GetIndices();return c.Every(o,0,(s,a)=>(i.has(a)||pt(e,t,r.unevaluatedItems,s))&&t.AddIndex(a))}function sre(e,t,r,o,i,s){let a=t.GetIndices(),u=[];return c.EveryAll(s,0,(d,g)=>{let y=new Bn,E=(a.has(g)||Bt(e,y,r,o,i.unevaluatedItems,d))&&t.AddIndex(g);return E||u.push(g),E})||t.AddError("unevaluatedItems",r,o,{unevaluatedItems:u})}function are(e,t,r,o){let i=t.GetKeys();return c.Every(c.Entries(o),0,([s,a])=>i.has(s)||pt(e,t,r.unevaluatedProperties,a)&&t.AddKey(s))}function cre(e,t,r,o,i,s){let a=t.GetKeys(),u=[];return c.EveryAll(c.Entries(s),0,([d,g])=>{let y=new Bn,E=a.has(d)||Bt(e,y,r,o,i.unevaluatedProperties,g)&&t.AddKey(d);return E||u.push(d),E})||t.AddError("unevaluatedProperties",r,o,{unevaluatedProperties:u})}function ure(e){return!c.IsEqual(e.uniqueItems,!1)}function pre(e,t,r,o){if(!ure(r))return!0;let i=new Set(o.map(np.Hash)).size,s=o.length;return c.IsEqual(i,s)}function lre(e,t,r,o,i,s){if(!ure(i))return!0;let a=new Set,u=s.reduce((d,g,y)=>{let E=np.Hash(g);return a.has(E)?[...d,y]:(a.add(E),d)},[]);return c.IsEqual(u.length,0)||t.AddError("uniqueItems",r,o,{duplicateItems:u})}function xi(e,t,r,o){return t.Push()&&pt(e,t,r,o)&&t.Pop()}function pt(e,t,r,o){let i=Tg(e,r);return Id(r)?sD(i,t,r,o):(!rD(r)||nre(i,t,r,o))&&(!(c.IsObject(o)&&!c.IsArray(o))||(!Ad(r)||ere(i,t,r,o))&&(!va(r)||See(i,t,r,o))&&(!YM(r)||Pee(i,t,r,o))&&(!VM(r)||wee(i,t,r,o))&&(!PC(r)||Nee(i,t,r,o))&&(!fg(r)||jte(i,t,r,o))&&(!gg(r)||zte(i,t,r,o))&&(!DC(r)||Vte(i,t,r,o))&&(!UT(r)||kD(i,t,r,o))&&(!eD(r)||PD(i,t,r,o)))&&(!c.IsArray(o)||(!AC(r)||yee(i,t,r,o))&&(!_p(r)||cD(i,t,r,o))&&(!bd(r)||Ote(i,t,r,o))&&(!xd(r)||UD(i,t,r,o))&&(!XM(r)||OD(i,t,r,o))&&(!mg(r)||vD(i,t,r,o))&&(!kC(r)||CD(i,t,r,o))&&(!Od(r)||Hte(i,t,r,o))&&(!hg(r)||pre(i,t,r,o)))&&(!c.IsString(o)||(!PT(r)||ND(i,t,r,o))&&(!JM(r)||RD(i,t,r,o))&&(!RT(r)||xD(i,t,r,o))&&(!wT(r)||DD(i,t,r,o)))&&(!(c.IsNumber(o)||c.IsBigInt(o))||(!Qc(r)||ED(i,t,r,o))&&(!QM(r)||yD(i,t,r,o))&&(!Zc(r)||wD(i,t,r,o))&&(!ZM(r)||AD(i,t,r,o))&&(!tD(r)||LD(i,t,r,o)))&&(!$C(r)||Xte(i,t,r,o))&&(!FC(r)||Qte(i,t,r,o))&&(!UC(r)||qee(i,t,r,o))&&(!zM(r)||aD(i,t,r,o))&&(!WM(r)||hD(i,t,r,o))&&(!vC(r)||bte(i,t,r,o))&&(!LC(r)||MD(i,t,r,o))&&(!CC(r)||Iee(i,t,r,o))&&(!RC(r)||xee(i,t,r,o))&&(!MC(r)||$te(i,t,r,o))&&(!NT(r)||!c.IsArray(o)||ire(i,t,r,o))&&(!kT(r)||!c.IsObject(o)||are(i,t,r,o))&&(!OC(r)||pee(i,t,r,o))}function Oi(e,t,r,o,i,s){return t.Push()&&Bt(e,t,r,o,i,s)&&t.Pop()}function Bt(e,t,r,o,i,s){if(t.AtCapacity())return!1;let a=Tg(e,i);return Id(i)?Aee(a,t,r,o,i,s):!!(+(!rD(i)||ore(a,t,r,o,i,s))&+(!(c.IsObject(s)&&!c.IsArray(s))||!!(+(!Ad(i)||tre(a,t,r,o,i,s))&+(!va(i)||_ee(a,t,r,o,i,s))&+(!YM(i)||Uee(a,t,r,o,i,s))&+(!VM(i)||vee(a,t,r,o,i,s))&+(!PC(i)||kee(a,t,r,o,i,s))&+(!fg(i)||qte(a,t,r,o,i,s))&+(!gg(i)||Yte(a,t,r,o,i,s))&+(!DC(i)||Wte(a,t,r,o,i,s))&+(!UT(i)||Mte(a,t,r,o,i,s))&+(!eD(i)||wte(a,t,r,o,i,s))))&+(!c.IsArray(s)||!!(+(!AC(i)||Eee(a,t,r,o,i,s))&+(!_p(i)||Ree(a,t,r,o,i,s))&+(!bd(i)||Ate(a,t,r,o,i,s))&+(!xd(i)||vte(a,t,r,o,i,s))&+(!XM(i)||Cte(a,t,r,o,i,s))&+(!mg(i)||kte(a,t,r,o,i,s))&+(!kC(i)||Pte(a,t,r,o,i,s))&+(!Od(i)||Kte(a,t,r,o,i,s))&+(!hg(i)||lre(a,t,r,o,i,s))))&+(!c.IsString(s)||!!(+(!PT(i)||Lte(a,t,r,o,i,s))&+(!JM(i)||Ute(a,t,r,o,i,s))&+(!RT(i)||Ite(a,t,r,o,i,s))&+(!wT(i)||Bte(a,t,r,o,i,s))))&+(!(c.IsNumber(s)||c.IsBigInt(s))||!!(+(!Qc(i)||Yee(a,t,r,o,i,s))&+(!QM(i)||zee(a,t,r,o,i,s))&+(!Zc(i)||Nte(a,t,r,o,i,s))&+(!ZM(i)||Rte(a,t,r,o,i,s))&+(!tD(i)||Dte(a,t,r,o,i,s))))&+(!$C(i)||Jte(a,t,r,o,i,s))&+(!FC(i)||Zte(a,t,r,o,i,s))&+(!UC(i)||Hee(a,t,r,o,i,s))&+(!zM(i)||Cee(a,t,r,o,i,s))&+(!WM(i)||Kee(a,t,r,o,i,s))&+(!vC(i)||xte(a,t,r,o,i,s))&+(!LC(i)||Fte(a,t,r,o,i,s))&+(!CC(i)||bee(a,t,r,o,i,s))&+(!RC(i)||Oee(a,t,r,o,i,s))&+(!MC(i)||Gte(a,t,r,o,i,s))&+(!NT(i)||!c.IsArray(s)||sre(a,t,r,o,i,s))&+(!kT(i)||!c.IsObject(s)||cre(a,t,r,o,i,s)))&&(!OC(i)||lee(a,t,r,o,i,s))}function fR(...e){let[t,r,o]=ct.Match(e,{3:(g,y,E)=>[g,y,E],2:(g,y)=>[{},g,y]}),i=Eg(t,r),s=new Bn,a=Bt(i,s,"#","",r,o),u=s.GetErrors(),l=A3(),d=u.map(g=>({...g,message:l(g)}));return[a,d]}var dre=0;function jD(){let e=oO();dre=e.maxErrors,e.maxErrors=e.maxParseErrors}function qD(){let e=oO();e.maxErrors=dre}function HD(...e){let[t,r,o]=ct.Match(e,{3:(a,u,l)=>[a,u,l],2:(a,u)=>[{},a,u]}),i=Eg(t,r),s=new So;return pt(i,s,r,o)}function Ct(...e){let[t,r,o]=ct.Match(e,{3:(i,s,a)=>[i,s,a],2:(i,s)=>[{},i,s]});return HD(t,r,o)}function ka(...e){let[t,r,o]=ct.Match(e,{3:(a,u,l)=>[a,u,l],2:(a,u)=>[{},a,u]}),[i,s]=fR(t,r,o);return s}var xp=class extends Error{constructor(t,r,o){super(t),Object.defineProperty(this,"cause",{value:{source:t,errors:o,value:r},writable:!1,configurable:!1,enumerable:!1})}};function mre(e,t,r){return c.IsArray(r)?r.map(o=>gn(e,t.items,o)):r}function fre(e,t,r){return gn({...e,...t.$defs},ln(t.$ref),r)}function C$e(e,t){let r=c.HasPropertyKey(t,"unevaluatedProperties")?{additionalProperties:t.unevaluatedProperties}:{},o=Wi(e,t),i=$n(o);return Ie(i)?hA(i,r):i}function gre(e,t,r){let o=C$e(e,t);return gn(e,o,r)}function gR(e){return c.HasPropertyKey(e,"additionalProperties")?e.additionalProperties:void 0}function hre(e,t,r){if(!c.IsObject(r)||c.IsArray(r))return r;let o=gR(t);for(let i of c.Keys(r)){if(c.HasPropertyKey(t.properties,i)&&pr(t.properties[i])){r[i]=gn(e,t.properties[i],r[i]);continue}if(c.IsBoolean(o)&&c.IsEqual(o,!0)||pr(o)&&Ct(e,o,r[i])){r[i]=gn(e,o,r[i]);continue}delete r[i]}return r}function yre(e,t,r){if(!c.IsObject(r))return r;let o=gR(t),[i,s]=[new RegExp(Yr(t)),tr(t)];for(let a of c.Keys(r)){if(i.test(a)){r[a]=gn(e,s,r[a]);continue}if(c.IsBoolean(o)&&c.IsEqual(o,!0)||pr(o)&&Ct(e,o,r[a])){r[a]=gn(e,o,r[a]);continue}delete r[a]}return r}function Ere(e,t,r){return c.HasPropertyKey(e,t.$ref)?gn(e,e[t.$ref],r):r}function Tre(e,t,r){if(!c.IsArray(r))return r;let o=Math.min(r.length,t.items.length);for(let i=0;i<o;i++)r[i]=gn(e,t.items[i],r[i]);return c.IsGreaterThan(r.length,o)?r.slice(0,o):r}function R$e(e){return c.HasPropertyKey(e,"~kind")||c.HasPropertyKey(e,"~unsafe")}function P$e(e){let t={};for(let r of c.Keys(e)){if(c.IsUnsafePropertyKey(r))continue;let o=Object.getOwnPropertyDescriptor(e,r);o.value=Pd(o.value),c.IsEqual(o.enumerable,!0)?t[r]=o.value:Object.defineProperty(t,r,o)}return t}function U$e(e){let t={};for(let r of c.Keys(e))c.IsUnsafePropertyKey(r)||(t[r]=Pd(e[r]));for(let r of c.Symbols(e))t[r]=Pd(e[r]);return t}function w$e(e){return c.IsClassInstance(e)?e:R$e(e)?P$e(e):U$e(e)}function v$e(e){return e.map(t=>Pd(t))}function N$e(e){return e.slice()}function k$e(e){return new RegExp(e.source,e.flags)}function L$e(e){return new Map(Pd([...e.entries()]))}function M$e(e){return new Set(Pd([...e.values()]))}function Pd(e){return go.IsTypeArray(e)?N$e(e):go.IsRegExp(e)?k$e(e):go.IsMap(e)?L$e(e):go.IsSet(e)?M$e(e):c.IsArray(e)?v$e(e):c.IsObject(e)?w$e(e):e}function Sre(e){return Pd(e)}function Ur(e){return Sre(e)}function _re(e,t,r){for(let o of t.anyOf){let i=gn(e,o,Ur(r));if(Ct(e,o,i))return i}return r}function gn(e,t,r){return et(t)?mre(e,t,r):$t(t)?fre(e,t,r):Te(t)?gre(e,t,r):Ie(t)?hre(e,t,r):Ot(t)?yre(e,t,r):Tt(t)?Ere(e,t,r):He(t)?Tre(e,t,r):Y(t)?_re(e,t,r):r}function D$e(e,t){return O.Assign(e,t)}function F$e(e){let t={};for(let r of e3.Keys(e))t[r]=qT(e[r]);return t}function $$e(e){return Dn({pattern:Yr(e)})}function G$e(e){return KD(T7(e))}function KD(e){return e.map(t=>qT(t))}function qT(e){let t=et(e)?Ro(qT(e.items),If(e)):Te(e)?Qn(KD(e.allOf)):Y(e)?we(G$e(e.anyOf)):Ie(e)?ge(F$e(e.properties)):Ot(e)?wf($$e(e),qT(tr(e))):He(e)?xr(KD(e.items)):e;return D$e(e,t)}function Ag(e){return qT(e)}function La(...e){let[t,r,o]=ct.Match(e,{3:(s,a,u)=>[s,a,u],2:(s,a)=>[{},s,a]}),i=Hr.Get().unionPrioritySort?Ag(r):r;return gn(t,i,o)}var dt={};Ci(dt,{Fail:()=>Ud,IsOk:()=>zD,Ok:()=>de,TryArray:()=>B$e,TryBigInt:()=>YD,TryBoolean:()=>J$e,TryNull:()=>o1e,TryNumber:()=>c1e,TryString:()=>u1e,TryUndefined:()=>f1e});function zD(e){return c.IsObject(e)&&c.HasPropertyKey(e,"value")}function de(e){return{value:e}}function Ud(){}function B$e(e){return c.IsArray(e)?de(e):de([e])}function j$e(e){return c.IsEqual(e,!0)?de(BigInt(1)):de(BigInt(0))}var q$e=/^-?(0|[1-9]\d*)n$/,H$e=/^-?(0|[1-9]\d*)\.\d+$/,K$e=/^-?(0|[1-9]\d*)$/;function z$e(e){return q$e.test(e)}function Y$e(e){return H$e.test(e)}function V$e(e){return K$e.test(e)}function W$e(e){let t=e.toLowerCase();return z$e(e)?de(BigInt(e.slice(0,e.length-1))):Y$e(e)?de(BigInt(e.split(".")[0])):V$e(e)?de(BigInt(e)):c.IsEqual(t,"false")?de(BigInt(0)):c.IsEqual(t,"true")?de(BigInt(1)):void 0}function YD(e){return c.IsBigInt(e)?de(e):c.IsBoolean(e)?j$e(e):c.IsNumber(e)?de(BigInt(Math.trunc(e))):c.IsNull(e)?de(BigInt(0)):c.IsString(e)?W$e(e):c.IsUndefined(e)?de(BigInt(0)):void 0}function Q$e(e){return c.IsEqual(e,BigInt(0))?de(!1):c.IsEqual(e,BigInt(1))?de(!0):void 0}function Z$e(e){return c.IsEqual(e,0)?de(!1):c.IsEqual(e,1)?de(!0):void 0}function X$e(e){return c.IsEqual(e.toLowerCase(),"false")?de(!1):c.IsEqual(e.toLowerCase(),"true")?de(!0):c.IsEqual(e,"0")?de(!1):c.IsEqual(e,"1")?de(!0):void 0}function J$e(e){return c.IsBigInt(e)?Q$e(e):c.IsBoolean(e)?de(e):c.IsNumber(e)?Z$e(e):c.IsNull(e)?de(!1):c.IsString(e)?X$e(e):c.IsUndefined(e)?de(!1):void 0}function e1e(e){return c.IsEqual(e,BigInt(0))?de(null):void 0}function t1e(e){return c.IsEqual(e,!1)?de(null):void 0}function r1e(e){return c.IsEqual(e,0)?de(null):void 0}function n1e(e){let t=e.toLowerCase();return c.IsEqual(t,"undefined")||c.IsEqual(t,"null")||c.IsEqual(e,"")||c.IsEqual(e,"0")?de(null):void 0}function o1e(e){return c.IsBigInt(e)?e1e(e):c.IsBoolean(e)?t1e(e):c.IsNumber(e)?r1e(e):c.IsNull(e)?de(null):c.IsString(e)?n1e(e):c.IsUndefined(e)?de(null):void 0}var Ire=BigInt(Number.MAX_SAFE_INTEGER),bre=BigInt(Number.MIN_SAFE_INTEGER);function i1e(e){return e<=Ire&&e>=bre?de(Number(e)):void 0}function s1e(e){return de(e?1:0)}function a1e(e){let t=+e;if(c.IsNumber(t))return de(t);let r=e.toLowerCase();if(c.IsEqual(r,"false"))return de(0);if(c.IsEqual(r,"true"))return de(1);let o=YD(e);return zD(o)?o.value<=Ire&&o.value>=bre?de(Number(o.value)):void 0:void 0}function c1e(e){return c.IsBigInt(e)?i1e(e):c.IsBoolean(e)?s1e(e):c.IsNumber(e)?de(e):c.IsNull(e)?de(0):c.IsString(e)?a1e(e):c.IsUndefined(e)?de(0):void 0}function u1e(e){return c.IsBigInt(e)?de(e.toString()):c.IsBoolean(e)?de(e.toString()):c.IsNumber(e)?de(e.toString()):c.IsNull(e)?de("null"):c.IsString(e)?de(e):c.IsUndefined(e)?de(""):void 0}function p1e(e){return c.IsEqual(e,BigInt(0))?de(void 0):void 0}function l1e(e){return c.IsEqual(e,!1)?de(void 0):void 0}function d1e(e){return c.IsEqual(e,0)?de(void 0):void 0}function m1e(e){let t=e.toLowerCase();return c.IsEqual(t,"undefined")||c.IsEqual(t,"null")||c.IsEqual(e,"")||c.IsEqual(e,"0")?de(void 0):void 0}function f1e(e){return c.IsBigInt(e)?p1e(e):c.IsBoolean(e)?l1e(e):c.IsNumber(e)?d1e(e):c.IsNull(e)?de(void 0):c.IsString(e)?m1e(e):c.IsUndefined(e)?de(e):void 0}function xre(e,t,r){return dt.TryArray(r).value.map(i=>wr(e,t.items,i))}function Ore(e,t,r){let o=dt.TryBigInt(r);return dt.IsOk(o)?o.value:r}function Are(e,t,r){let o=dt.TryBoolean(r);return dt.IsOk(o)?o.value:r}function Cre(e,t,r){return wr({...e,...t.$defs},ln(t.$ref),r)}function Rre(e,t,r){return wr(e,$n(t),r)}function Pre(e,t,r){let o=dt.TryNumber(r);return dt.IsOk(o)?Math.trunc(o.value):r}function Ure(e,t,r){let o=Wi(e,t),i=$n(o);return wr(e,i,r)}function g1e(e,t,r){let o=dt.TryBigInt(r);return dt.IsOk(o)&&c.IsEqual(t.const,o.value)?o.value:r}function h1e(e,t,r){let o=dt.TryBoolean(r);return dt.IsOk(o)&&c.IsEqual(t.const,o.value)?o.value:r}function y1e(e,t,r){let o=dt.TryNumber(r);return dt.IsOk(o)&&c.IsEqual(t.const,o.value)?o.value:r}function E1e(e,t,r){let o=dt.TryString(r);return dt.IsOk(o)&&c.IsEqual(t.const,o.value)?o.value:r}function wre(e,t,r){return c.IsEqual(t.const,r)?r:L3(t)?g1e(e,t,r):M3(t)?h1e(e,t,r):TO(t)?y1e(e,t,r):SO(t)?E1e(e,t,r):br()}function vre(e,t,r){let o=dt.TryNull(r);return dt.IsOk(o)?o.value:r}function Nre(e,t,r){let o=dt.TryNumber(r);return dt.IsOk(o)?o.value:r}function hR(e,t,r,o){let i=c.Keys(o);for(let[s,a]of t)for(let u of i)s.test(u)||(o[u]=wr(e,r,o[u]));return o}function HT(e,t,r){return Lr(e)&&c.IsUndefined(r[t])}function T1e(e,t,r){let o=c.EntriesRegExp(t.properties),i=c.Keys(r);for(let[s,a]of o)for(let u of i)!s.test(u)||HT(a,u,r)||(r[u]=wr(e,a,r[u]));return c.HasPropertyKey(t,"additionalProperties")&&c.IsObject(t.additionalProperties)?hR(e,o,t.additionalProperties,r):r}function kre(e,t,r){return c.IsObjectNotArray(r)?T1e(e,t,r):r}function S1e(e,t,r){let o=c.EntriesRegExp(t.patternProperties),i=c.Keys(r);for(let[s,a]of o)for(let u of i)s.test(u)&&(r[u]=wr(e,a,r[u]));return c.HasPropertyKey(t,"additionalProperties")&&c.IsObject(t.additionalProperties)?hR(e,o,t.additionalProperties,r):r}function Lre(e,t,r){return c.IsObjectNotArray(r)?S1e(e,t,r):r}function Mre(e,t,r){return c.HasPropertyKey(e,t.$ref)?wr(e,e[t.$ref],r):r}function Dre(e,t,r){let o=dt.TryString(r);return dt.IsOk(o)?o.value:r}function Fre(e,t,r){return wr(e,$n(t),r)}function $re(e,t,r){if(!c.IsArray(r))return r;for(let o=0;o<Math.min(t.items.length,r.length);o++)r[o]=wr(e,t.items[o],r[o]);return r}function Gre(e,t,r){let o=dt.TryUndefined(r);return dt.IsOk(o)?o.value:r}function Bre(e,t,r){if(t.anyOf.some(a=>Ct(e,a,r)))return r;let s=t.anyOf.map(a=>wr(e,a,Ur(r))).find(a=>Ct(e,t,a));return c.IsUndefined(s)?r:s}function jre(e,t,r){let o=dt.TryUndefined(r);return dt.IsOk(o)?void 0:r}function wr(e,t,r){return et(t)?xre(e,t,r):Ho(t)?Ore(e,t,r):ho(t)?Are(e,t,r):$t(t)?Cre(e,t,r):Fr(t)?Rre(e,t,r):mn(t)?Pre(e,t,r):Te(t)?Ure(e,t,r):We(t)?wre(e,t,r):Sa(t)?vre(e,t,r):lr(t)?Nre(e,t,r):Ie(t)?kre(e,t,r):Ot(t)?Lre(e,t,r):Tt(t)?Mre(e,t,r):zr(t)?Dre(e,t,r):Gt(t)?Fre(e,t,r):He(t)?$re(e,t,r):Rs(t)?Gre(e,t,r):Y(t)?Bre(e,t,r):zo(t)?jre(e,t,r):r}function Op(...e){let[t,r,o]=ct.Match(e,{3:(i,s,a)=>[i,s,a],2:(i,s)=>[{},i,s]});return wr(t,r,o)}function qre(e,t,r){if(!c.IsArray(r))return r;for(let o=0;o<r.length;o++)r[o]=hn(e,t.items,r[o]);return r}function Hre(e,t,r){return hn({...e,...t.$defs},ln(t.$ref),r)}function Kre(e,t){return c.IsUndefined(t)?c.IsFunction(e.default)?e.default():Ur(e.default):t}function zre(e,t,r){let o=Wi(e,t),i=$n(o);return hn(e,i,r)}function Yre(e,t,r){if(!c.IsObject(r))return r;let o=c.Keys(t.properties);for(let i of o){let s=hn(e,t.properties[i],r[i]);c.IsUndefined(s)&&(Lr(t.properties[i])||!c.HasPropertyKey(t.properties[i],"default"))||(r[i]=s)}if(!va(t)||c.IsBoolean(t.additionalProperties))return r;for(let i of c.Keys(r))o.includes(i)||(r[i]=hn(e,t.additionalProperties,r[i]));return r}function Vre(e,t,r){if(!c.IsObject(r))return r;let[o,i]=[new RegExp(Yr(t)),tr(t)];for(let s of c.Keys(r))o.test(s)&&bi(i)&&(r[s]=hn(e,i,r[s]));if(!va(t))return r;for(let s of c.Keys(r))o.test(s)||(r[s]=hn(e,t.additionalProperties,r[s]));return r}function Wre(e,t,r){return c.HasPropertyKey(e,t.$ref)?hn(e,e[t.$ref],r):r}function Qre(e,t,r){if(!c.IsArray(r))return r;let[o,i]=[t.items,Math.max(t.items.length,r.length)];for(let s=0;s<i;s++)s<o.length&&(r[s]=hn(e,o[s],r[s]));return r}function Zre(e,t,r){for(let o of t.anyOf){let i=hn(e,o,Ur(r));if(Ct(e,o,i))return i}return r}function hn(e,t,r){let o=bi(t)?Kre(t,r):r;return et(t)?qre(e,t,o):$t(t)?Hre(e,t,o):Te(t)?zre(e,t,o):Ie(t)?Yre(e,t,o):Ot(t)?Vre(e,t,o):Tt(t)?Wre(e,t,o):He(t)?Qre(e,t,o):Y(t)?Zre(e,t,o):o}function wd(...e){let[t,r,o]=ct.Match(e,{3:(i,s,a)=>[i,s,a],2:(i,s)=>[{},i,s]});return hn(t,r,o)}function Cg(e){return(...t)=>{let[r,o,i]=ct.Match(t,{3:(s,a,u)=>[s,a,u],2:(s,a)=>[{},s,a]});return e.reduce((s,a)=>a(r,o,s),i)}}function _1e(e,t,r){return t["~codec"].decode(r)}function I1e(e,t,r){return t["~codec"].encode(r)}function or(e,t,r,o){return Wl(r)?c.IsEqual(e,"Decode")?_1e(t,r,o):I1e(t,r,o):o}function b1e(e,t,r,o){if(!c.IsArray(o))return o;for(let i=0;i<o.length;i++)o[i]=dr(e,t,r.items,o[i]);return or(e,t,r,o)}function x1e(e,t,r,o){let i=or(e,t,r,o);if(!c.IsArray(i))return i;for(let s=0;s<i.length;s++)i[s]=dr(e,t,r.items,i[s]);return i}function Xre(e,t,r,o){return c.IsEqual(e,"Decode")?b1e(e,t,r,o):x1e(e,t,r,o)}function Jre(e,t,r,o){return o=dr(e,{...t,...r.$defs},ln(r.$ref),o),or(e,t,r,o)}function ene(e){return e.reduce((t,r)=>({...t,...r}),{})}function tne(e,t){for(let r of t)if(!c.IsDeepEqual(e,r))return r;return e}function O1e(e,t,r,o){if(c.IsEqual(r.allOf.length,0))return or(e,t,r,o);let i=r.allOf.map(u=>dr(e,t,u,La(u,Ur(o)))),a=i.every(u=>c.IsObject(u))?ene(i):tne(o,i);return or(e,t,r,a)}function A1e(e,t,r,o){if(c.IsEqual(r.allOf.length,0))return or(e,t,r,o);let i=or(e,t,r,o),s=r.allOf.map(u=>dr(e,t,u,La(u,Ur(i))));return s.every(u=>c.IsObject(u))?ene(s):tne(i,s)}function rne(e,t,r,o){return c.IsEqual(e,"Decode")?O1e(e,t,r,o):A1e(e,t,r,o)}function C1e(e,t,r,o){if(!c.IsObjectNotArray(o))return o;for(let i of c.Keys(r.properties))!c.HasPropertyKey(o,i)||HT(r.properties[i],i,o)||(o[i]=dr(e,t,r.properties[i],o[i]));return or(e,t,r,o)}function R1e(e,t,r,o){let i=or(e,t,r,o);if(!c.IsObjectNotArray(i))return i;for(let s of c.Keys(r.properties))!c.HasPropertyKey(i,s)||HT(r.properties[s],s,i)||(i[s]=dr(e,t,r.properties[s],i[s]));return i}function nne(e,t,r,o){return c.IsEqual(e,"Decode")?C1e(e,t,r,o):R1e(e,t,r,o)}function P1e(e,t,r,o){if(!c.IsObjectNotArray(o))return o;let i=new RegExp(Yr(r));for(let s of c.Keys(o))i.test(s)&&(o[s]=dr(e,t,tr(r),o[s]));return or(e,t,r,o)}function U1e(e,t,r,o){let i=or(e,t,r,o);if(!c.IsObjectNotArray(i))return i;let s=new RegExp(Yr(r));for(let a of c.Keys(i))s.test(a)&&(i[a]=dr(e,t,tr(r),i[a]));return i}function one(e,t,r,o){return c.IsEqual(e,"Decode")?P1e(e,t,r,o):U1e(e,t,r,o)}function ine(e,t,r,o){return c.HasPropertyKey(t,r.$ref)?dr(e,t,t[r.$ref],o):o}function sne(e,t,r,o){return c.IsEqual(e,"Decode")?or(e,t,r,ine(e,t,r,o)):ine(e,t,r,or(e,t,r,o))}function w1e(e,t,r,o){if(!c.IsArray(o))return o;for(let i=0;i<Math.min(r.items.length,o.length);i++)o[i]=dr(e,t,r.items[i],o[i]);return or(e,t,r,o)}function v1e(e,t,r,o){let i=or(e,t,r,o);if(!c.IsArray(i))return o;for(let s=0;s<Math.min(r.items.length,i.length);s++)i[s]=dr(e,t,r.items[s],i[s]);return i}function ane(e,t,r,o){return c.IsEqual(e,"Decode")?w1e(e,t,r,o):v1e(e,t,r,o)}function N1e(e,t,r,o){for(let i of r.anyOf){if(!Ct(t,i,o))continue;let s=dr(e,t,i,o);return or(e,t,r,s)}return o}function k1e(e,t,r,o){let i=or(e,t,r,o);for(let s of r.anyOf){let a=dr(e,t,s,Ur(i));if(Ct(t,s,a))return a}return i}function cne(e,t,r,o){return c.IsEqual(e,"Decode")?N1e(e,t,r,o):k1e(e,t,r,o)}function dr(e,t,r,o){return et(r)?Xre(e,t,r,o):$t(r)?Jre(e,t,r,o):Te(r)?rne(e,t,r,o):Ie(r)?nne(e,t,r,o):Ot(r)?one(e,t,r,o):Tt(r)?sne(e,t,r,o):He(r)?ane(e,t,r,o):Y(r)?cne(e,t,r,o):or(e,t,r,o)}var VD=class extends xp{constructor(t,r){super("Decode",t,r)}};function L1e(e,t,r){if(!Ct(e,t,r))throw new VD(r,ka(e,t,r));return r}function M1e(e,t,r){let o=Hr.Get().unionPrioritySort?Ag(t):t;return dr("Decode",e,o,r)}var qJt=Cg([(e,t,r)=>Ur(r),(e,t,r)=>wd(e,t,r),(e,t,r)=>Op(e,t,r),(e,t,r)=>La(e,t,r),(e,t,r)=>L1e(e,t,r),(e,t,r)=>M1e(e,t,r)]);var WD=class extends xp{constructor(t,r){super("Encode",t,r)}};function D1e(e,t,r){if(!Ct(e,t,r))throw new WD(r,ka(e,t,r));return r}function F1e(e,t,r){let o=Hr.Get().unionPrioritySort?Ag(t):t;return dr("Encode",e,o,r)}var rer=Cg([(e,t,r)=>Ur(r),(e,t,r)=>F1e(e,t,r),(e,t,r)=>wd(e,t,r),(e,t,r)=>Op(e,t,r),(e,t,r)=>La(e,t,r),(e,t,r)=>D1e(e,t,r)]);var ts=class extends Error{constructor(t,r){super(r),this.type=t}};function une(e,t){return c.IsFunction(t.default)?t.default(t):c.IsObject(t.default)?Ur(t.default):t.default}function pne(e,t){if(hg(t)&&!bi(t))throw new ts(t,"Arrays with uniqueItems constraints must specify a default annotation");let r=mg(t)?t.minItems:0;return Array.from({length:r},()=>vr(e,t.items))}function lne(e,t){return Qc(t)?BigInt(t.exclusiveMinimum)+BigInt(1):Zc(t)?BigInt(t.minimum):BigInt(0)}function dne(e,t){return!1}function mne(e,t){let r=vr(e,t.instanceType);return class{constructor(){Object.assign(this,r)}}}function fne(e,t){return vr({...e,...t.$defs},ln(t.$ref))}function gne(e,t){return vr(e,$n(t))}function hne(e,t){let r=vr(e,t.returnType);return()=>r}function yne(e,t){return Qc(t)&&c.IsNumber(t.exclusiveMinimum)?t.exclusiveMinimum+1:Zc(t)?t.minimum:0}function Ene(e,t){let r=Wi(e,t),o=$n(r);return vr(e,o)}function Tne(e,t){return t.const}function Sne(e,t){throw new ts(t,"Cannot create TNever types")}function _ne(e,t){return null}function Ine(e,t){return Qc(t)&&c.IsNumber(t.exclusiveMinimum)?t.exclusiveMinimum+1:Zc(t)?t.minimum:0}function bne(e,t){return(c.IsUndefined(t.required)?[]:t.required).reduce((o,i)=>({...o,[i]:vr(e,t.properties[i])}),{})}function xne(e,t){if(UT(t)&&!bi(t))throw new ts(t,"Record with the minProperties constraint must have a default annotation");return{}}function One(e,t){return c.HasPropertyKey(e,t.$ref)?vr(e,e[t.$ref]):(()=>{throw new ts(t,"Unable to deref Ref")})()}function Ane(e,t){if((wT(t)||RT(t))&&!bi(t))throw Error("Strings with format or pattern constraints must specify default");let o=PT(t)?t.minLength:0;return"".padEnd(o)}function Cne(e,t){return Symbol()}function Rne(e,t){let r=UE(t.pattern);if(zr(r))throw new ts(t,"Unable to create TemplateLiteral due to infinite type expansion");return vr(e,r)}function Pne(e,t){return Array.from({length:t.minItems},(r,o)=>vr(e,t.items[o]))}function Une(e,t){if(c.IsEqual(t.anyOf.length,0))throw Error("Unable to create Union with no variants");return vr(e,t.anyOf[0])}function vr(e,t){return bi(t)?une(e,t):et(t)?pne(e,t):Ho(t)?lne(e,t):ho(t)?dne(e,t):Nr(t)?mne(e,t):$t(t)?fne(e,t):Fr(t)?gne(e,t):kr(t)?hne(e,t):mn(t)?yne(e,t):Te(t)?Ene(e,t):We(t)?Tne(e,t):jo(t)?Sne(e,t):Sa(t)?_ne(e,t):lr(t)?Ine(e,t):Ie(t)?bne(e,t):Ot(t)?xne(e,t):Tt(t)?One(e,t):zr(t)?Ane(e,t):_a(t)?Cne(e,t):Gt(t)?Rne(e,t):He(t)?Pne(e,t):Rs(t)?void 0:Y(t)?Une(e,t):zo(t)?void 0:void 0}function Ma(...e){let[t,r]=ct.Match(e,{2:(o,i)=>[o,i],1:o=>[{},o]});return vr(t,r)}var QD=class extends xp{constructor(t,r){super("Parse",t,r)}};function $1e(e,t,r){jD();let o=ka(e,t,r);if(qD(),!Ct(e,t,r))throw new QD(r,o);return r}var brr=Cg([(e,t,r)=>Ur(r),(e,t,r)=>wd(e,t,r),(e,t,r)=>Op(e,t,r),(e,t,r)=>La(e,t,r),(e,t,r)=>$1e(e,t,r)]);var B1e=ge({type:qe("insert"),path:Dn(),value:Kr()}),j1e=Object({type:qe("update"),path:Dn(),value:Kr()}),q1e=ge({type:qe("delete"),path:Dn()}),Urr=we([B1e,j1e,q1e]);var eu=k(function*(e){if(!e.body)return yield*new At({message:"This command does not accept a request body"});let t=e.body;return t.examples?.length?t.examples[0]:Ma(t)});var Nne=" (unix seconds, ISO 8601, or relative like -1h/-30m/now)",Ap=je("file").pipe(pa("f"),re("Read body from file (use - for stdin)"),_e("FILE_PATH"),tt),tu=je("data").pipe(pa("d"),re("Inline JSON body"),_e("JSON"),tt),ru=Wn("generate-skeleton").pipe(re("Print a JSON skeleton for the request body and exit"),xn(!1)),Xt={from:je("from").pipe(re(`Start of time range${Nne}. Start narrow and widen step by step only when the result is empty`),_e("TIMESTAMP"),tt),to:je("to").pipe(re(`End of time range${Nne}`),_e("TIMESTAMP"),tt)},Cp=je("query").pipe(re("Tsuga query to filter results"),_e("TSUGA_QUERY"),tt),Rg=lf("max-results").pipe(Zu(e=>Number.isSafeInteger(e)&&e>0,()=>"--max-results must be a positive safe integer"),re("Maximum number of results"),_e("COUNT"),tt),Rp={limit:lf("limit").pipe(Zu(e=>Number.isSafeInteger(e)&&e>=1&&e<=dp,()=>`--limit must be an integer from 1 to ${dp}`),re(`Maximum number of items to return, up to ${dp} (default: ${EA})`),_e("N"),tt),offset:lf("offset").pipe(Zu(e=>Number.isSafeInteger(e)&&e>=0,()=>"--offset must be a non-negative safe integer"),re("Number of items to skip, to request a later page"),_e("N"),tt),all:Wn("all").pipe(re("Follow every page and print all items as one page; cannot be combined with --limit or --offset"),xn(!1))},Wr=k(function*(e){return{from:yield*yR("from",e.from),to:yield*yR("to",e.to)}}),yR=k(function*(e,t){let r=yield*ht,o=ue(t)??(yield*r.getDefault(e));if(!o)return yield*new At({message:`--${e} is required`});let i=Math.floor((yield*Kn)/ud),s=yield*Et({try:()=>MA(o,i),catch:a=>new At({message:a instanceof Error?a.message:String(a)})});return Number.isSafeInteger(s)?s:yield*new At({message:`Invalid time value: ${o}. Unix seconds must be a safe integer.`})}),vd=k(function*(e,t){let r=yield*ht;return ue(t)??(yield*r.getDefault(e))});function kne(e){if(e===null||typeof e!="object"||!("properties"in e))return{};let{properties:t}=e;if(t===null||typeof t!="object")return{};let r={};for(let o of Object.keys(t)){let i=Reflect.get(t,o),s=i!==null&&typeof i=="object"&&"description"in i?Reflect.get(i,"description"):void 0;r[o]=typeof s=="string"?{description:s}:{}}return r}function Lne(e,t){let r=e[t];return typeof r=="string"?r:Oh(r)&&wt(r)&&typeof r.value=="string"?r.value:void 0}function yn(e){let t={};for(let[r,o]of Object.entries(e))o!==void 0&&(t[r]=o);return t}var jn=(e,t,r)=>P(e,{file:Ap,data:tu,generateSkeleton:ru},N(`cli.${e}`)(function*(o){if(o.generateSkeleton){yield*Si(yield*eu(r));return}yield*Oe(yield*Xe(r,{body:yield*Wc(o)}))})).pipe(U(t));var Mne=jn("scalar","Run aggregation queries and return scalar results",iC);var Dne=jn("timeseries","Run aggregation queries and return timeseries results",sC);var Fne=P("aggregation").pipe(U("Run aggregation queries"),xe([Mne,Dne]));var Kne=require("node:crypto");var KT=require("node:crypto");function z1e(e){return(0,KT.createHash)("sha256").update(e).digest("base64url")}function $ne(){let e=(0,KT.randomBytes)(32).toString("base64url");return{verifier:e,challenge:z1e(e)}}var jne=require("node:http"),JD=require("node:os");var Y1e=[":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(""),V1e=['<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 ZD(e,t){let r=NM(e);return['<!doctype html><html lang="en"><head><meta charset="utf-8">','<meta name="viewport" content="width=device-width,initial-scale=1">',`<title>${r}</title><style>${Y1e}</style></head><body><main>`,`<span class="tile">${V1e}</span>`,`<div class="copy"><h1>${r}</h1><p>${NM(t)}</p></div>`,"</main></body></html>"].join("")}var qne="/oauth/callback",Q1e=5*pd,Z1e=ZD("Login complete","You can close this tab and return to the terminal."),Gne=ZD("Login failed","Return to the terminal for details."),{$match:X1e,Code:J1e,Failed:XD,NotACallback:Bne}=M_();function eGe(e){return(0,JD.platform)()==="darwin"?["open",[e]]:(0,JD.platform)()==="win32"?["rundll32",["url.dll,FileProtocolHandler",e]]:["xdg-open",[e]]}var tGe=(e,t,r)=>Be(()=>{let o,i=ie(()=>{o!==void 0&&(e.off("request",o),o=void 0)});return _n(s=>{let a=(u,l,d)=>{u.writeHead(l,{"Content-Type":"text/html"}),u.end(d)};o=(u,l)=>{X1e({NotACallback:()=>a(l,404,Gne),Failed:({message:d})=>{a(l,400,Gne),s($(new jc({message:d})))},Code:({code:d})=>{a(l,200,Z1e),s(A(d))}})(nGe(u.url??"/",r,t))},e.on("request",o)}).pipe(zn(i),sv({duration:Q1e,orElse:()=>new jc({message:"Timed out waiting for the browser to complete login (5 minutes)."})}))}),rGe=N("auth.openBrowser")(function*(e){let[t,r]=eGe(e);return yield*co(q(Hi(t,r,{stdin:"ignore",stdout:{stream:"ignore"},stderr:{stream:"ignore"}}),o=>wn(o.unref,o.exitCode))).pipe(fl({onSuccess:o=>Number(o)===0,onFailure:()=>!1}))});function nGe(e,t,r){let o;try{o=new URL(e,t)}catch{return Bne()}if(o.pathname!==qne)return Bne();let i=o.searchParams.get("error");if(i){let a=o.searchParams.get("error_description")??"";return XD({message:`Authorization failed: ${i}${a?` (${a})`:""}`})}if(o.searchParams.get("state")!==r)return XD({message:"State mismatch on OAuth callback; aborting for safety."});let s=o.searchParams.get("code");return s?J1e({code:s}):XD({message:"OAuth callback did not include an authorization code."})}var Hne=N("auth.captureAuthorizationCode")(function*(e){let t=yield*Fo(ie(()=>{let l=(0,jne.createServer)();return l.on("connection",d=>d.unref()),l}),l=>ie(()=>l.close())),o=`http://127.0.0.1:${yield*_n(l=>{let d=g=>{l(new jc({message:`Could not open a loopback port: ${g.message}`}))};t.once("error",d),t.listen(0,"127.0.0.1",()=>{t.off("error",d);let g=t.address();l(g===null||typeof g=="string"?new jc({message:"Loopback server did not report a usable address."}):A(g.port))})})}`,i=`${o}${qne}`,s=yield*yl(tGe(t,e.state,o),{startImmediately:!0}),a=e.buildAuthorizeUrl(i);return yield*yl(mt(function*(){(yield*rGe(a))?(yield*Xn("Opening your browser to complete login..."),yield*Xn("If it does not open, visit this URL:")):yield*Xn("Visit this URL in your browser to complete login:"),yield*Xn(` ${a}`)}),{startImmediately:!0}),{code:yield*Sl(s),redirectUri:i}},co);var zne=P("login",{},N("cli.auth.login")(function*(){let e=yield*ht,t=yield*Ep,r=yield*e.resolveApiUrl,{verifier:o,challenge:i}=$ne(),s=(0,Kne.randomBytes)(16).toString("base64url"),{code:a,redirectUri:u}=yield*Hne({state:s,buildAuthorizeUrl:g=>jZ(r,{redirectUri:g,challenge:i,state:s})}),l=yield*t.exchangeCode(r,{code:a,verifier:o,redirectUri:u}),d=yield*e.saveUserAuth(gC(l));yield*$e(`Logged in. Session token ${ug(l.accessToken)} saved to ${d}`)})).pipe(U("Log in as a user with a browser authorization flow and save the session (replaces any saved operation API key)"));var Yne=P("logout",{},N("cli.auth.logout")(function*(){yield*(yield*ht).clearUserAuth,yield*$e("Local user session cleared.")})).pipe(U("Clear the saved user session"));var Er=e=>Ix(jl,e);var Vne=(e,t)=>bx(jl,e,t);var jt=x(2,(e,t)=>xx(e,t));var Wne=x(e=>_x(e[0]),(e,t)=>K0(e,t)),Qne=x(2,(e,t)=>pf(e,t));var Zne=(e,t)=>lE(jl,e,t);var Xne=x(3,(e,t,r)=>Cx(e,t,r));var Jne=P("operation-key",{key:Er("OPERATION_API_KEY").pipe(jt("The operation API key to save"),Qne(e=>e.trim()),Xne(e=>e.length>0,()=>"OPERATION_API_KEY must not be empty or whitespace-only"))},N("cli.auth.operationKey")(function*({key:e}){let t=yield*ht;yield*t.saveOperationApiKey(e),yield*$e(`Operation API key saved to ${t.configPath}`)})).pipe(U("Save an operation API key to the config file (replaces any saved user session)"));function eoe(e,t){let r=ug(e.accessToken),o=Date.parse(e.accessExpiresAt),i=!!e.refreshToken;if(Number.isNaN(o))return`Logged in as a user (token ${r}, expires ${e.accessExpiresAt}).`;let s=Fm(Es(o));return s<=t?i?`Logged in as a user (token ${r}). Access token expired ${ER(s,t)} ago, on ${e.accessExpiresAt}; the next command renews it automatically.`:`Logged in as a user (token ${r}). Session expired ${ER(s,t)} ago, on ${e.accessExpiresAt}. Run \`tsuga auth login\` to sign in again.`:i?`Logged in as a user (token ${r}). Access token expires in ${ER(t,s)}, on ${e.accessExpiresAt}; the session renews automatically.`:`Logged in as a user (token ${r}). Session expires in ${ER(t,s)}, on ${e.accessExpiresAt}.`}function ER(e,t){let r=bZ(xZ({start:e,end:t}),{format:["years","months","days","hours","minutes"]});return r===""?"less than a minute":r}var toe=P("status",{},N("cli.auth.status")(function*(){let e=yield*Ua,t=yield*ht,{credential:r}=yield*t.resolve({operationApiKey:e.operationApiKey,clusterId:e.cluster});if(!r){yield*$e("Not authenticated. Run `tsuga auth login` or `tsuga auth operation-key <OPERATION_API_KEY>`.");return}let o=r.kind;switch(o){case"user-session":{let i=yield*kH;yield*$e(eoe(r.userAuth,i));return}case"operation-api-key":yield*$e("Authenticated with an operation API key.");return;default:Nt(o)}})).pipe(U("Show the current authentication method"));var roe=P("token",{},N("cli.auth.token")(function*(){let e=yield*ht,t=yield*e.resolveApiUrl,r=yield*e.getUserAuth;if(!r){let i=t===_T?"":` for ${t}`;return yield*new hp({message:`No user session${i}.`,suggestions:["Sign in with your browser: tsuga auth login"]})}let o=yield*yC(t,r);yield*$e(o.accessToken)})).pipe(U("Print the saved user access token to stdout"));var Nd="/v0/admin-center";var noe="^\\S(.*\\S)?$",Isr=new RegExp(noe,"u"),oGe=50,iGe=128,sGe=256,aGe=n.Object({key:n.String({description:"Tag key attached to the resource. Consumers can use key/value tags for filtering, ownership context, and policy checks."}),value:n.String({description:"Tag value attached to the resource for this key. Tsuga returns the value exactly as stored."})},{title:"Tag"}),cGe=n.Object({key:n.String({maxLength:iGe,description:"Tag key to attach to the resource."}),value:n.String({maxLength:sGe,pattern:noe,description:"Tag value to attach to the resource. Leading or trailing whitespace is rejected."})},{title:"Tag"}),Qr=n.Array(aGe,{title:"Tags",description:"Key/value tags applied to the resource. Use them to organize resources and to satisfy tag policies."}),on=n.Array(cGe,{title:"Tags",maxItems:oGe,description:"Key/value tags to apply to the resource. Tag policies may require specific keys or values."}),kt=n.Optional(Qr),qt=n.Optional(on);var Pp="/v0/teams",_R=["public","private"],TR={NAME:"name",CREATED_AT:"createdAt",MEMBER_COUNT:"memberCount",VISIBILITY:"visibility"},uGe=n.Enum([TR.NAME,TR.CREATED_AT,TR.MEMBER_COUNT,TR.VISIBILITY],{description:"Team field used for sorting list responses. Use `name`, `createdAt`, `memberCount`, or `visibility`."}),IR=n.Object({color:n.Enum(wM,{description:"Color token used by Tsuga when rendering the team avatar."}),mode:n.Enum(vM,{description:"Avatar rendering mode selected for the team."}),iconName:n.Enum(iJ,{description:"Icon name rendered inside the team avatar when icon mode is used."})}),Pg=n.Object({color:n.Enum(wM),mode:n.Enum(vM)}),pGe=100,lGe=250,ooe=n.Object({id:n.String(),name:n.String(),email:n.String(),role:n.Enum(Ji),joinedTeamAt:v(),orgRole:n.Enum(nJ),avatar:n.Optional(Pg)}),eF=3,tF=n.Pick(ooe,["id","name","avatar"]),Up=n.Object({id:n.String({description:"Unique identifier of the team. Generated by Tsuga and stable for the team lifetime."}),name:n.String({description:"Human-readable team name displayed throughout Tsuga and used in team search."}),description:n.Optional(n.String({description:"Optional free-text description of the team."})),visibility:n.Enum(_R,{description:"`public` makes team-owned resources discoverable according to access controls. `private` restricts discovery to team members and authorized users."}),tags:kt,createdAt:v({description:"Timestamp when Tsuga created the team."}),updatedAt:v({description:"Timestamp when Tsuga last updated the team metadata."}),memberCount:n.Optional(n.Number({description:"Number of members currently in the team"})),memberPreview:n.Optional(n.Array(tF,{description:`First ${eF} members of the team, sorted by name.`})),avatar:n.Optional(IR)}),bR=n.Object({name:n.String({minLength:1,maxLength:pGe,format:Qi,description:"Name to assign to the team. Must be kebab-case (lowercase letters, numbers, and dashes only) and unique in the organization."}),description:Qe(n.String({maxLength:lGe}),{description:"Team description."}),visibility:n.Enum(_R,{description:"`public` makes team-owned resources discoverable according to access controls. `private` restricts discovery to team members and authorized users."}),tags:qt,avatar:Qe(IR)}),ioe=n.Object({searchQuery:n.Optional(p({description:"Substring matched against team names, descriptions, and IDs."})),visibility:n.Optional(n.Enum(_R,{description:"Restrict results to teams with this visibility."})),myTeamsOnly:n.Optional(n.Boolean({description:"If true, return only teams that include the authenticated user."}))}),rF=n.Optional(p({allowEmpty:!1,description:"Exact team name to look up. Returns at most one team, since team names are unique."})),vsr=f({tags:["teams"],url:Pp,method:"GET",paginated:!0,response:n.Array(Up),query:n.Object({...ye,includeMemberPreview:n.Optional(n.Boolean({description:"Adds `memberCount` and `memberPreview` to every returned team."})),...ioe.properties,name:rF,sortBy:n.Optional(uGe),sortDirection:n.Optional(me)})}),Nsr=f({tags:["teams"],url:`${Pp}/:id`,method:"GET",params:n.Object({id:p()}),response:Up}),SR={NAME:"name",ROLE:"role",ORG_ROLE:"orgRole",JOINED_TEAM_AT:"joinedTeamAt"},dGe=n.Enum([SR.NAME,SR.ROLE,SR.ORG_ROLE,SR.JOINED_TEAM_AT]),ksr=f({tags:["teams"],url:`${Pp}/:id/members`,method:"GET",paginated:!0,params:n.Object({id:p()}),query:n.Object({...ye,searchQuery:n.Optional(p({description:"Substring matched against member names, emails, and IDs."})),teamRole:n.Optional(n.Array(n.Enum(Ji),{maxItems:Ji.length,uniqueItems:!0,description:"Restrict results to members with one of these team roles."})),sortBy:n.Optional(dGe),sortDirection:n.Optional(me)}),response:n.Array(ooe)}),Lsr=f({tags:["teams"],url:`${Pp}/:id/assets`,method:"GET",params:n.Object({id:p()}),response:n.Object({apiKeyCount:n.Number(),logRouteCount:n.Number(),monitorCount:n.Number(),notificationRuleCount:n.Number(),dashboardCount:n.Number(),sloCount:n.Number()})}),Msr=f({tags:["teams"],url:Pp,method:"POST",body:bR,response:Up}),Dsr=f({tags:["teams"],url:`${Pp}/:id`,method:"PUT",params:n.Object({id:p()}),body:bR,response:Up}),mGe=D("type",[n.Object({type:n.Literal("ids"),teamIds:n.Array(p({allowEmpty:!1}),{minItems:1,maxItems:100})}),n.Object({type:n.Literal("all"),filters:n.Optional(ioe)})]),Fsr=f({tags:["teams"],url:`${Pp}/bulk-update`,method:"POST",body:n.Object({selection:mGe,config:n.Object({visibility:n.Enum(_R)})}),response:n.Object({})}),$sr=f({tags:["teams"],url:`${Pp}/:id`,method:"DELETE",params:n.Object({id:p()}),response:B});var fGe=n.Enum(["agent","billing","cli","mcp-codemode","mcp-server","tadmin","terraform-provider","web-admin","web-frontend"],{description:"Tsuga client surface that performed the operation. Use this to distinguish UI, CLI, MCP, and Terraform-originated changes."}),be=D("type",[n.Object({type:n.Literal("user",{description:"The resource was created or updated by a user."}),id:n.String({description:"Unique identifier of the user actor."}),name:n.String({description:"Display name of the user actor at the time of response."}),avatar:n.Optional(Pg)}),n.Object({type:n.Literal("operation-api-key",{description:"The resource was created or updated by an operation API key."}),id:n.String({description:"Unique identifier of the operation API key actor."}),name:n.String({description:"Display name of the operation API key actor."}),source:n.Optional(fGe)})],{description:"User or operation API key responsible for creating or updating a resource. Returned by Tsuga for audit context."});var YT=`${Nd}/custom-roles`,gGe=50,hGe=3,yGe=20,EGe=["read","write"],zT=n.Enum(["read"],{description:"Access granted on this resource type."}),nt=n.Enum(EGe,{description:"Access granted on this resource type. `write` implies `read`."});var coe="Teams the role grants its asset permissions on. `all` covers every team, `public` covers public teams only, `specific` covers the listed teams, and `all-except` covers every team but the listed ones.",uoe="Team IDs the scope applies to.",soe=n.Array(n.String(),{description:uoe}),TGe=D("type",[n.Object({type:n.Literal("all")},{title:"CustomRoleAllTeams"}),n.Object({type:n.Literal("public")},{title:"CustomRolePublicTeams"}),n.Object({type:n.Literal("specific"),teamIds:soe},{title:"CustomRoleSpecificTeams"}),n.Object({type:n.Literal("all-except"),teamIds:soe},{title:"CustomRoleAllTeamsExcept"})],{description:coe}),aoe=n.Array(p({allowEmpty:!1}),{minItems:1,maxItems:gGe,uniqueItems:!0,description:uoe}),SGe=D("type",[n.Object({type:n.Literal("all")}),n.Object({type:n.Literal("public")}),n.Object({type:n.Literal("specific"),teamIds:aoe}),n.Object({type:n.Literal("all-except"),teamIds:aoe})],{description:coe}),_Ge=n.Object({database:zT,inventory:zT,queue:zT,service:zT,"audit-log":zT}),IGe=n.Object({"allowed-domains":nt,"audit-log-stream-destination":nt,"cluster-integration-config":nt,"custom-usage-tag":nt,"databricks-connection":nt,"github-connection":nt,"llm-provider":nt,"retention-policy":nt,"saml-config":nt,"sensitive-data-scanner-rule":nt,"service-target":nt,"team-remap-config":nt,"adaptive-notification-rule":nt,"cloud-account":nt,"dashboard-folder":nt,"monitor-folder":nt,"dashboard-report":nt,"dashboard-share":nt,dashboard:nt,"ingestion-api-key":nt,investigation:nt,"log-route":nt,"metric-route":nt,"span-route":nt,monitor:nt,notebook:nt,"notification-integration":nt,"notification-rule":nt,"notification-silence":nt,"operation-api-key":nt,"quality-report":nt,"rum-public-token":nt,"sandbox-configuration":nt,slo:nt,"synthetic-test":nt,"synthetic-variable":nt,"tag-policy":nt,"user-invitation":nt}),poe=n.Object({...n.Partial(n.Object({..._Ge.properties,...IGe.properties})).properties,team:nt},{description:"Access level granted per resource type, within the role team scope. An omitted resource type grants no access."});var loe=n.Array(n.Enum(OM),{description:"Telemetry signals the role can read. An empty array grants no telemetry access."}),nF="Additional restriction applied cluster-side to every telemetry query the role holder runs. Each entry keeps only the data points whose `key` matches one of `values`, and entries are combined with AND.",doe="Attribute key matched against telemetry data points, such as `env` or `service.name`.",moe="Values the attribute must equal for a data point to be kept. A data point matching any of them is kept.",bGe=n.Array(n.Object({key:n.String({description:doe}),values:n.Array(n.String(),{description:moe})}),{description:nF}),xGe=n.Array(n.Object({key:p({allowEmpty:!1,description:doe}),values:n.Array(n.String({minLength:1,maxLength:Ei,pattern:"^(?!\\*$)",errorMessage:{pattern:"Must not be '*'."}}),{minItems:1,maxItems:yGe,description:moe})}),{maxItems:hGe,description:nF}),kd=n.Object({id:n.String({description:"Tsuga-generated custom role ID assigned at creation."}),name:n.String({description:"Human-readable custom role name, unique across the account."}),description:n.Optional(n.String({description:"Free-form description of the custom role. Absent when not set."})),teamScope:TGe,assets:poe,telemetry:loe,telemetryQuery:n.Optional(bGe),creator:n.Optional(be),updater:n.Optional(be),createdAt:v({description:"Timestamp when Tsuga created the custom role."}),updatedAt:v({description:"Timestamp when Tsuga last updated the custom role."})}),foe=n.Pick(kd,["teamScope","assets","telemetry","telemetryQuery"],{description:"What the custom role grants its holder."}),OGe=100,xR=n.Object({name:n.String({minLength:1,maxLength:OGe,format:Qi,description:"Human-readable custom role name, unique across the account."}),description:Qe(p({type:"short"}),{description:"Free-form description of the custom role. Omit on update to keep the current description, or pass null to remove it."}),teamScope:SGe,assets:poe,telemetry:loe,telemetryQuery:Qe(xGe,{description:`${nF} Omit on update to keep the current restriction, or pass null to remove it.`})}),ear=f({tags:["custom-roles"],url:YT,method:"GET",response:n.Array(kd)}),tar=f({tags:["custom-roles"],url:`${YT}/:id`,method:"GET",params:n.Object({id:p({allowEmpty:!1})}),response:kd}),rar=f({tags:["custom-roles"],url:YT,method:"POST",body:xR,response:kd}),nar=f({tags:["custom-roles"],url:`${YT}/:id`,method:"PUT",params:n.Object({id:p({allowEmpty:!1})}),body:xR,response:kd}),oar=f({tags:["custom-roles"],url:`${YT}/:id`,method:"DELETE",params:n.Object({id:p({allowEmpty:!1})}),response:B});var AGe={"ai-sandboxes":"AI tasks",analytics:"Analytics","browser-views":"RUM Browser views","dashboard-reports":"Dashboard reports",dashboards:"Dashboards",databases:"Databases",ecs:"ECS","inventory-all-resources":"All cloud resources","inventory-overview":"Cloud resources overview","inventory-settings":"Cloud resources settings",inventory:"Cloud resources",investigations:"Investigations",issues:"Issues",kubernetes:"Kubernetes","log-routes":"Log routes",logs:"Logs","metric-routes":"Metric routes",metrics:"Metrics",mobile:"RUM Mobile",monitor:"Monitors",notebooks:"Notebooks","notification-integrations":"Notification integrations","notification-rules-list":"Notification rules","notification-rules":"Notifications","notification-silences":"Notification silences","ongoing-alerts":"Ongoing alerts",queues:"Queues",routes:"Routes",rum:"RUM views","sensitive-data-scanner":"Sensitive data scanner",serverless:"Serverless",services:"Services",sessions:"Sessions",slo:"SLOs","span-routes":"Span routes",synthetics:"Synthetics","team-map":"Service map",traces:"Traces"},CGe=Object.keys(AGe),oF=n.Enum(CGe,{description:"Stable nav item key within a main sidebar category."}),goe="Nav item keys shown in the primary sidebar for this category, in display order.",hoe="Nav item keys for this category that are folded away (e.g. View more). Omitted or empty means none.",yoe=e=>D("type",[n.Object({type:n.Literal("dashboard"),id:e("Tsuga-generated ID of the dashboard the item opens.")}),n.Object({type:n.Literal("service"),serviceName:e("OpenTelemetry service name of the service whose page the item opens."),serviceNamespace:n.Optional(e("OpenTelemetry service namespace of that service. Omitted for a service without one."))}),n.Object({type:n.Literal("browser-view"),pageId:e("View name identifying the page the item opens."),app:e("Application the view belongs to."),env:e("Environment the view was observed in.")})],{description:"Page the user added to their personal sidebar."}),RGe=yoe(e=>n.String({description:e})),PGe=yoe(e=>p({allowEmpty:!1,description:e}));var UGe=50,Eoe=`Items shown in the primary sidebar for this category, in display order: nav item keys, and pages the user added to their personal sidebar (at most ${UGe} across all categories).`,wGe=n.Array(n.String(),{description:goe}),vGe=n.Optional(n.Array(n.String(),{description:hoe})),NGe=n.Array(oF,{description:goe}),kGe=n.Optional(n.Array(oF,{description:hoe})),Toe="Stable category id. Unknown or renamed ids are ignored by the client catalog.",Soe="Sidebar categories in display order. Unknown or renamed ids are ignored by the client catalog.",_oe=e=>n.Object({categories:n.Array(n.Object({id:n.String({description:Toe}),visible:e,folded:vGe}),{description:Soe})}),Ioe=e=>n.Object({categories:n.Array(n.Object({id:p({allowEmpty:!1,description:Toe}),visible:e,folded:kGe}),{description:Soe})}),uar=_oe(wGe),par=Ioe(NGe),boe=_oe(n.Array(n.Union([n.String(),RGe]),{description:Eoe})),xoe=Ioe(n.Array(n.Union([oF,PGe]),{description:Eoe}));var Coe=["YYYY-MM-DD","DD-MM-YYYY","MM-DD-YYYY"],Roe=["12h","24h"],MGe=n.Union([n.Object({type:n.Literal("home")}),n.Object({type:n.Literal("explorer")}),n.Object({type:n.Literal("metrics")}),n.Object({type:n.Literal("traces")}),n.Object({type:n.Literal("analytics")}),n.Object({type:n.Literal("dashboards"),id:n.String()}),n.Object({type:n.Literal("ongoing-alerts")}),n.Object({type:n.Literal("services")}),n.Object({type:n.Literal("rum-views")}),n.Null()]),DGe=n.Union([D("type",[n.Object({type:n.Literal("home")}),n.Object({type:n.Literal("explorer")}),n.Object({type:n.Literal("metrics")}),n.Object({type:n.Literal("traces")}),n.Object({type:n.Literal("analytics")}),n.Object({type:n.Literal("dashboards"),id:p()}),n.Object({type:n.Literal("ongoing-alerts")}),n.Object({type:n.Literal("services")}),n.Object({type:n.Literal("rum-views")})]),n.Null()]),FGe=p({allowEmpty:!1,description:"Identifier of the custom role to assign. Use the `id` returned by the custom role endpoints."}),Poe=D("type",[n.Object({type:n.Enum(cg,{description:"Built-in organization role: `admin`, `public_editor`, `public_viewer`, or `teams_only`."})}),n.Object({type:n.Literal("custom",{description:"Assigns the custom role `customRoleId`."}),customRoleId:FGe})],{description:"Organization role to assign: a built-in role `type`, or `custom` with the `customRoleId` of a custom role."}),$Ge=D("type",[n.Object({type:n.Enum(cg,{description:"Built-in organization role: `admin`, `public_editor`, `public_viewer`, or `teams_only`."})}),n.Object({type:n.Literal("custom",{description:"The user holds a custom role."}),customRoleId:n.String({description:"Identifier of the custom role. Use it with the custom role endpoints to read what the role grants."})})],{description:"Organization role for the user: a built-in role `type`, or `custom` with the `customRoleId` of the custom role."}),nu=n.Object({email:n.String({description:"Lowercase email address for the user. Use this for display and invitation matching, not as a stable identifier."}),id:n.String({description:"Unique identifier of the user. Generated by Tsuga and stable for the user lifetime."}),name:n.String({description:"Display name of the user."}),role:$Ge,orgId:n.String({description:"Identifier of the Tsuga organization the user belongs to."}),orgName:n.Optional(n.String({description:"Display name of the Tsuga organization the user belongs to. Absent when the organization record cannot be resolved."})),avatar:n.Optional(Pg),defaultView:n.Optional(MGe),timezone:n.Optional(n.Union([n.String(),n.Null()],{description:"IANA timezone used to display dates and times (e.g. `Europe/Paris`). Absent or `null` means the timezone is auto-detected from the browser."})),dateFormat:n.Optional(n.Union([n.Enum(Coe),n.Null()],{description:"Preferred format for displaying dates: `YYYY-MM-DD`, `DD-MM-YYYY`, or `MM-DD-YYYY`. Absent or `null` means the Tsuga default format."})),hourFormat:n.Optional(n.Union([n.Enum(Roe),n.Null()],{description:"Preferred format for displaying times: `12h` (AM/PM) or `24h`. Absent or `null` means the Tsuga default format."})),favoriteDashboards:n.Optional(n.Array(n.String(),{description:"Dashboard IDs the user marked as favorites. Not pruned when a dashboard is deleted, so an ID may no longer resolve."})),favoriteFolders:n.Optional(n.Array(n.String(),{description:"Dashboard folder IDs the user marked as favorites. Not pruned when a folder is deleted, so an ID may no longer resolve."})),filterDataByTeams:n.Optional(n.Boolean({description:"Whether the user wants data across the application filtered to the teams they belong to. Set by the user in their profile settings."})),sidebarNavLayout:n.Optional(boe),fromSso:n.Boolean({description:"Whether the user account was provisioned or authenticated through SSO."}),createdAt:v({description:"Timestamp when Tsuga created the user."}),updatedAt:v({description:"Timestamp when Tsuga last updated the user."}),teamIds:n.Optional(n.Array(n.String(),{description:"Team IDs the user currently belongs to."}))}),{role:Iar,...Ooe}=nu.properties,iF=D("role",[n.Object({...Ooe,role:n.Enum(cg,{description:"Organization role for the user: `admin`, `public_editor`, `public_viewer` or `teams_only`."})}),n.Object({...Ooe,role:n.Literal("custom",{description:"The user holds a custom role."}),customRole:foe})]),Uoe=n.Intersect([Up,n.Object({userRole:n.Enum(Ji)})]),woe=n.Object({status:n.Literal("authenticated"),token:n.String(),user:iF}),voe=D("status",[woe,n.Object({status:n.Literal("mfa-required"),mfaToken:n.String({description:"Short-lived token accepted only by the TOTP login endpoints; it grants no other access."}),totpEnrolled:n.Boolean({description:"False when the user still has to set up an authenticator app."})})]),bar=f({tags:["users"],url:"/v0/login",method:"POST",body:n.Object({email:p({type:"email"}),password:p({type:"long"})}),response:voe}),Noe="/v0/login/totp",xar=f({tags:["users"],url:`${Noe}/setup`,method:"POST",body:n.Object({mfaToken:p({type:"long"})}),response:n.Object({mfaToken:n.String({description:"Replaces the login MFA token; pass it when verifying the first code."}),secret:n.String({description:"Base32 secret for manual entry in the authenticator app."})})}),Oar=f({tags:["users"],url:Noe,method:"POST",body:n.Object({mfaToken:p({type:"long"}),code:n.String({pattern:`^[0-9]{${6}}$`,description:"The 6-digit code shown by the authenticator app."})}),response:woe}),Aar=f({tags:["users"],url:"/v0/forgot-password",method:"POST",body:n.Object({email:p({type:"email"})}),response:n.Object({})}),Car=f({tags:["users"],url:"/v0/reset-password",method:"POST",body:n.Object({resetToken:p(),password:p({type:"user-password"})}),response:n.Object({})}),GGe=["active","expired"],Rar=f({tags:["users"],url:"/v0/reset-password-status/:resetToken",method:"GET",params:n.Object({resetToken:p()}),response:n.Object({status:n.Enum(GGe)})}),Par=f({tags:["users"],url:"/v0/change-password",method:"POST",body:n.Object({currentPassword:p({type:"long"}),newPassword:p({type:"user-password"})}),response:n.Object({})}),wp="/v0/users",sF="/v0/current-user",Uar=f({tags:["users"],url:sF,method:"GET",response:iF}),war=f({tags:["users"],url:`${sF}/teams`,method:"GET",response:n.Array(Uoe)}),Nar=f({tags:["users"],url:"/v0/logout",method:"POST",response:n.Object({})}),kar=f({tags:["users"],method:"PATCH",url:sF,body:n.Partial(n.Object({avatar:n.Union([Pg,n.Null()]),defaultView:DGe,timezone:n.Union([n.String({format:id}),n.Null()]),dateFormat:n.Union([n.Enum(Coe),n.Null()]),hourFormat:n.Union([n.Enum(Roe),n.Null()]),favoriteDashboards:n.Array(p({allowEmpty:!1})),favoriteFolders:n.Array(p({allowEmpty:!1})),filterDataByTeams:n.Boolean(),sidebarNavLayout:n.Union([xoe,n.Null()]),name:p()}),{minProperties:1}),response:iF}),Lar=f({tags:["users"],url:wp,method:"GET",response:n.Array(nu),query:n.Optional(n.Object({includeTeamIds:n.Optional(n.Boolean())}))}),Aoe={count:n.Integer({description:"Number of members holding the role."}),preview:n.Array(tF,{description:`First ${eF} members holding the role, sorted by name.`})},BGe=D("role",[n.Object({role:n.Enum(cg),...Aoe}),n.Object({role:n.Literal("custom"),customRoleId:n.String(),...Aoe})]),Mar=f({tags:["users"],url:`${wp}/role-members`,method:"GET",response:n.Array(BGe,{description:"Member count and preview of every role held by at least one member."})}),VT={NAME:"name",ROLE:"role",LOGIN_METHOD:"fromSso",TEAMS:"teams",CREATED_AT:"createdAt"},koe=n.Partial(n.Object({searchQuery:n.Object({value:p({allowEmpty:!1,description:"Substring to match against the member name, email, or ID."})},{description:"Substring matched against the member name, email, or ID"})},{description:"Optional filters applied to narrow the returned members"})),jGe=n.Partial(n.Object({...ye,includeTeamIds:n.Boolean({description:"When true, include the IDs of the teams each member belongs to."}),filters:koe,sort:n.Object({by:n.Enum([VT.NAME,VT.ROLE,VT.LOGIN_METHOD,VT.TEAMS,VT.CREATED_AT],{description:"Field to sort the returned members by"}),direction:me},{description:"Optional sorting applied to the returned members"})})),Dar=f({tags:["users"],url:`${wp}/query`,method:"POST",paginated:!0,response:n.Array(nu),body:jGe}),{teamIds:Far,...qGe}=nu.properties,HGe=n.Object({...qGe,teams:n.Optional(n.Array(Uoe))}),$ar=f({tags:["users"],url:`${wp}/:id`,method:"GET",params:n.Object({id:p({allowEmpty:!1})}),query:n.Optional(n.Object({includeTeamRoles:n.Optional(n.Boolean())})),response:HGe}),KGe=Ti(koe),Gar=f({tags:["users"],method:"PUT",url:`${wp}/bulk-update-role`,body:n.Object({selection:KGe,role:Poe}),response:n.Object({})}),Bar=f({tags:["users"],url:`${wp}/:id`,method:"DELETE",params:n.Object({id:p()}),response:B}),jar=f({tags:["users"],url:`${wp}/:id/totp`,method:"DELETE",params:n.Object({id:p()}),response:B}),qar=f({tags:["users"],url:`${wp}/all-emails`,method:"GET",response:n.Array(n.String())}),Loe=["pending","accepted","expired","revoked"],zGe=n.Enum(Loe),Ld="/v0/invitations",YGe=10,VGe=n.Object({email:p({type:"email",description:"Lowercase email address to invite into the organization."}),teamId:p({description:"Team ID to add the invited user to after acceptance."}),teamRole:n.Enum(Ji,{description:"Role the invited user receives in the target team once accepted: `admin`, `editor`, or `viewer`."}),userRole:Poe}),Har=f({tags:["invitations"],url:`${Ld}/create`,method:"POST",body:n.Array(VGe,{maxItems:YGe}),response:n.Object({success:n.Boolean(),message:n.String()})}),Kar=f({tags:["invitations"],url:`${Ld}/resend/:id`,params:n.Object({id:p()}),method:"POST",response:n.Object({success:n.Boolean(),message:n.String()})}),Moe=n.Partial(n.Object({searchQuery:n.Object({value:p({allowEmpty:!1,description:"Substring to match against the invitation email, team name, or status."})},{description:"Substring matched against the invitation email, team name, or status"})},{description:"Optional filters applied to narrow the returned invitations"})),WGe=Ti(Moe),zar=f({tags:["invitations"],url:`${Ld}/bulk-resend`,method:"POST",body:n.Object({selection:WGe}),response:n.Object({success:n.Boolean(),message:n.String()})}),Yar=f({tags:["invitations"],url:Ld,method:"POST",body:n.Object({secret:p()}),response:n.Object({status:zGe,email:n.String(),teamName:n.Optional(n.String()),avatar:n.Optional(IR)})}),Var=f({tags:["invitations"],url:`${Ld}/accept`,method:"POST",body:n.Object({name:p({type:"short"}),password:p({type:"user-password"}),secret:p()}),response:voe}),War=f({tags:["invitations"],url:`${Ld}/revoke/:id`,params:n.Object({id:p()}),method:"POST",response:n.Object({success:n.Boolean(),message:n.String()})}),QGe=n.Object({id:n.String({description:"Unique identifier of the invitation. Generated by Tsuga."}),email:n.String({description:"Email address invited to join the organization."}),teamId:n.Optional(n.String({description:"Team ID assigned when the invitation is accepted."})),teamRole:n.Optional(n.Enum(Ji,{description:"Team role assigned when the invitation is accepted: `admin`, `editor`, or `viewer`."})),createdBy:n.Optional(n.String({description:"User ID that created the invitation."})),status:n.Enum(Loe,{description:"Invitation lifecycle status: `pending`, `accepted`, `expired`, or `revoked`. `expired` can be computed from `expiresAt` when invitations are listed."}),expiresAt:v({description:"Timestamp when the invitation expires if not accepted."}),createdAt:v({description:"Timestamp when Tsuga created the invitation."}),updatedAt:v({description:"Timestamp when Tsuga last updated the invitation."})}),OR={EMAIL:"email",TEAM:"team",STATUS:"status",CREATED_AT:"createdAt"},ZGe=n.Partial(n.Object({...ye,filters:Moe,sort:n.Object({by:n.Enum([OR.EMAIL,OR.TEAM,OR.STATUS,OR.CREATED_AT],{description:"Field to sort the returned invitations by"}),direction:me},{description:"Optional sorting applied to the returned invitations"})})),Qar=f({tags:["invitations"],url:`${Ld}/query`,method:"POST",paginated:!0,response:n.Array(QGe),body:ZGe});var Ug="/v0/operation-api-keys",Doe="tsuga_op",Foe="v1";var XGe=100,$oe=n.Enum(EM,{description:"Team-access boundary for the operation API key. Set when the key is created or updated. `all` can reach all teams, `owning-team-and-public` can reach the owning team and public teams, and `owning-team-only` can reach only the owning team."}),ks=e=>n.Literal("read",{description:e}),ir=e=>n.Enum(["read","write"],{description:e}),WT=n.Partial(n.Object({investigations:ir("Investigations, the records collecting the timeline and findings of an incident analysis."),dashboard:ir("Dashboards and the graphs they contain."),"dashboard-folder":ir("Folders organizing dashboards."),"monitor-folder":ir("Folders organizing monitors."),documentation:ks("Tsuga documentation and API reference pages, which are public content rather than account data."),"ingestion-api-key":ir("Ingestion API keys, used to send telemetry data to Tsuga."),"rum-public-token":ir("RUM public tokens, embedded in web and mobile applications to send real user monitoring telemetry."),"operation-api-key":ir("Operation API keys, used to authenticate API, Terraform, MCP, and Tsuga CLI clients."),inventory:ks("Cloud resources discovered by inventory scans."),"cloud-account":ir("Cloud accounts Tsuga scans to discover resources."),"custom-role":ir("Custom global roles, which define what their holders can access across the organization."),"data-deletion-request":ir("Data deletion requests, which delete the telemetry events matching a query on a cluster."),logs:ks("Ingested log events, through search and aggregation endpoints."),"log-route":ir("Log routes, which select newly ingested logs and apply processors to them."),metrics:ks("Ingested metrics, through query and aggregation endpoints."),"metric-route":ir("Metric routes, which select newly ingested metrics by name and apply processors to them."),"span-route":ir("Span routes, which select newly ingested spans and apply processors to them."),monitor:ir("Monitors, the alert definitions evaluated against telemetry."),"allowed-domains":ir("Email domains whose users are allowed to join the organization."),queue:ks("Message queues of the catalog, inferred from telemetry."),"quality-report":ks("Telemetry quality reports."),billing:ks("Ingested data volume billed to the organization."),service:ks("Services of the catalog, inferred from telemetry."),"service-target":ir("Notification targets attached to a service."),slo:ir("Service level objectives and the alerts attached to them."),"notification-rule":ir("Notification rules, which route alert transitions to notification targets."),"adaptive-notification-rule":ir("Adaptive notification rules, which page the owners of the failing service when one of their monitors or SLOs fires."),"notification-integration":ir("Notification integrations, containing the credentials Tsuga uses when sending notifications."),"notification-silence":ir("Notification silences, which suppress matching notification delivery."),"custom-usage-tag":ir("Custom usage tags, the telemetry tag keys tracked as usage dimensions."),"retention-policy":ir("Retention policies applied to logs, metrics, and traces."),"sandbox-configuration":ks("Sandbox agent configurations of the key's teams, and the sandbox agent runs launched with them."),"tag-policy":ir("Tag policies, which enforce tag requirements on Tsuga-managed assets and telemetry data."),team:ir("Teams, their settings and their memberships."),traces:ks("Ingested spans, through search and aggregation endpoints."),rum:ks("Ingested RUM events, through search and aggregation endpoints."),user:ir("User accounts of the organization."),"user-invitation":ir("Invitations for people who do not belong to the organization yet.")}),{description:"Resource types the key can act on, each mapped to `read` or `write`. `write` also grants read access. A resource type absent from the map is not accessible to the key at all."}),wg=n.Object({id:n.String({description:"Unique identifier of the operation API key. Generated by Tsuga when the key is created. Use this as the stable key identifier when correlating API calls with audit logs or key-management records."}),name:n.String({description:"Display name of the operation API key. Set by the user who created or last updated the key. Returned for every operation-key-authenticated request so clients can show which saved key is active."}),owner:n.String({description:"Identifier of the team that owns the operation API key. Set when the key is created or updated. Combined with `scope`, it determines which team-owned resources the key can reach."}),tags:kt,scope:$oe,permissions:WT,keyLastCharacters:n.String({description:"Last characters of the operation API key secret. Set by Tsuga from the generated secret and returned because the full secret is only shown once at creation. Use this to distinguish saved keys without exposing the secret."}),updatedAt:v(),createdAt:v(),creator:n.Optional(be),updater:n.Optional(be),expiresAt:n.Optional(v({description:"Timestamp after which the operation API key stops authenticating. Set when the key is created or updated. Returned only for keys that have an expiration date."})),lastUsedAt:n.Optional(v())}),AR=n.Object({name:n.String({format:Qi,minLength:1,maxLength:XGe,description:"Kebab-case name for the operation API key."}),owner:p({allowEmpty:!1,description:"ID of the team that owns the operation API key. When the caller is an operation API key, the team must be within the caller's scope."}),tags:qt,scope:$oe,permissions:WT,expiresAt:Qe(p({allowEmpty:!1,type:"date-time",description:"Date and time after which the key stops working. Send null for a key that never expires. On update, leave it out to keep the current expiration. When the caller is an operation API key, set a future expiration, no later than the caller's own when the caller expires."}))}),scr=f({tags:["operation-api-keys"],url:Ug,method:"POST",body:AR,response:n.Object({...wg.properties,key:n.String()})}),acr=f({tags:["operation-api-keys"],url:Ug,method:"GET",paginated:!0,query:n.Object(ye),response:n.Array(wg)}),ccr=f({tags:["operation-api-keys"],url:`${Ug}/:id`,method:"GET",params:n.Object({id:p({allowEmpty:!1})}),response:wg}),ucr=f({tags:["operation-api-keys"],url:`${Ug}/:id`,method:"PUT",params:n.Object({id:p()}),body:AR,response:wg}),pcr=f({tags:["operation-api-keys"],url:`${Ug}/:id`,method:"DELETE",params:n.Object({id:p()}),response:B}),lcr=f({tags:["operation-api-keys"],url:`${Ug}/bulk-delete`,method:"DELETE",body:n.Object({ids:n.Array(p({allowEmpty:!1}),{uniqueItems:!0})}),response:n.Object({})});var QT=`/${"v1"}/operation-api-keys`,Md=n.Pick(wg,["id","name","owner","tags","scope","permissions","keyLastCharacters","expiresAt"],{$id:"OperationApiKey",description:"Operation API key used to authenticate API, Terraform, MCP, and Tsuga CLI clients. The full key secret is returned only when the key is created. See [API keys](/documentation/account-and-settings/api-keys)."}),Goe={id:"123-456-abc",name:"terraform-production",owner:"team-123-abc",tags:[{key:"env",value:"production"}],scope:"owning-team-only",permissions:{dashboard:"write",monitor:"write",logs:"read"},keyLastCharacters:"x7Qm"};Object.assign(Md,{examples:[Goe]});var Boe={...n.Pick(AR,["name","owner","tags","scope","permissions"]).properties,expiresAt:p({allowEmpty:!1,type:"date-time",description:"Date and time after which the key stops working. When the caller is an operation API key, set a future expiration, no later than the caller's own when the caller expires."})},joe=n.Object(Boe,{$id:"CreateOperationApiKeyRequest",description:"Operation API key creation request. Provide a kebab-case name, owner team, scope, permissions, expiration date, and optionally tags."}),qoe=n.Object(Boe,{$id:"UpdateOperationApiKeyRequest",description:"Operation API key update request. Provide the full definition, including name, owner team, scope, permissions, and expiration date."}),Hoe={name:"terraform-production",owner:"team-123-abc",tags:[{key:"env",value:"production"}],scope:"owning-team-only",permissions:{dashboard:"write",monitor:"write",logs:"read"},expiresAt:"2027-01-01T00:00:00.000Z"};Object.assign(joe,{examples:[Hoe]});Object.assign(qoe,{examples:[Hoe]});var JGe={...Goe,key:`${Doe}:${Foe}:abc123xyx7Qm`},Koe="When the caller is an operation API key, the resulting key cannot have a wider scope than the caller, cannot have a higher permission level than the caller on any resource, must have an expiration in the future, and cannot expire later than the caller's own expiration.",Tcr=f({description:"Lists operation API keys, the machine credentials of the public API, with their owner team, scope, permissions, tags and expiry. Only the last characters of each secret are returned. Keys that send telemetry are ingestion API keys.",operationId:"listOperationApiKeys",tags:["operation-api-keys"],url:QT,method:"GET",paginated:!0,query:n.Object(Ye),response:n.Array(Md)}),Scr=f({description:"Retrieves one operation API key by ID. The response never includes the full secret key value; only the last visible characters are returned.",operationId:"getOperationApiKey",tags:["operation-api-keys"],url:`${QT}/:id`,method:"GET",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the operation API key to retrieve. Use the `id` returned by operation API key list or create responses."})}),response:Md}),eBe=n.Object({...Md.properties,key:n.String({description:"Full operation API key secret. Returned only in the create response; list, get, and update responses expose only `keyLastCharacters`."})},{title:"OperationApiKeyCreated",example:JGe}),_cr=f({description:`Creates an operation API key. Store the returned \`key\` immediately because Tsuga returns the full secret only in this response. ${Koe}`,operationId:"createOperationApiKey",tags:["operation-api-keys"],url:QT,method:"POST",body:joe,response:eBe}),Icr=f({description:`Updates an operation API key by ID, including name, owner, tags, scope, permissions, and expiration. The secret key value is not rotated by this operation. ${Koe} The key to update must also belong to a team within the scope of the caller.`,operationId:"updateOperationApiKey",tags:["operation-api-keys"],url:`${QT}/:id`,method:"PUT",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the operation API key to update. Use the `id` returned by operation API key list, get, or create responses."})}),body:qoe,response:Md}),bcr=f({description:"Deletes an operation API key by ID. Clients using the deleted key can no longer authenticate with it. When the caller is an operation API key, the key must belong to a team within the scope of the caller.",operationId:"deleteOperationApiKey",tags:["operation-api-keys"],url:`${QT}/:id`,method:"DELETE",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the operation API key to delete. Use the `id` returned by operation API key list, get, or create responses."})}),response:B});var tBe=`/${"v1"}/me`,zoe=n.Object({type:n.Literal("operation-api-key",{description:"Credential type for this response variant. Set by Tsuga from the bearer token used on the request. Returned as `operation-api-key` when the request authenticated with an operation API key."}),...n.Pick(Md,["id","name","owner","scope","permissions","keyLastCharacters","expiresAt"]).properties},{$id:"OperationApiKeyIdentity",description:"Identity and effective access for the operation API key used on the request. Returned when the bearer token is an operation API key. See [API keys](/documentation/account-and-settings/api-keys)."}),rBe={type:"operation-api-key",id:"key-123-abc",name:"ci-deploy",owner:"team-123-abc",scope:"owning-team-and-public",permissions:{dashboard:"write",logs:"read",monitor:"read"},keyLastCharacters:"a9f2",expiresAt:"2026-12-01T00:00:00.000Z"};Object.assign(zoe,{examples:[rBe]});var Yoe=n.Object({type:n.Literal("user",{description:"Credential type for this response variant. Set by Tsuga from the bearer token used on the request. Returned as `user` when the request authenticated with a user OAuth access token."}),...n.Pick(nu,["id","email","name","role","orgId","orgName"]).properties,...n.Required(n.Pick(nu,["favoriteDashboards","favoriteFolders"])).properties},{$id:"UserIdentity",description:"Identity for the user OAuth access token used on the request. Returned when the bearer token is a user access token. Access follows the user organization role rather than an operation-key permission map. See [Members](/documentation/account-and-settings/members)."}),nBe={type:"user",id:"user-123-abc",email:"john@tsuga.com",name:"John Doe",role:{type:"public_viewer"},orgId:"org-123-abc",orgName:"Acme Inc.",favoriteDashboards:["dashboard-123-abc"],favoriteFolders:["folder-123-abc"]};Object.assign(Yoe,{examples:[nBe]});var oBe=D("type",[zoe,Yoe],{description:"Identity and access for the credential used on the request. Returned for any valid public API credential and discriminated by `type` because the API accepts both operation API keys and user OAuth access tokens."}),Voe=f({description:"Returns who the request is authenticated as: for an operation API key, its name, owner team, scope, permissions and expiry; for an OAuth access token, the user, organization and role. Any valid public API credential can call it, without resource permissions.",operationId:"getMe",tags:["public","authentication"],url:tBe,method:"GET",response:oBe});var iBe={all:"all permitted telemetry","owning-team-and-public":"owning team plus public data","owning-team-only":"owning team only"};function sBe(e){switch(e.type){case"operation-api-key":return["Authenticated as an operation API key.",...aF([["Name",e.name],["Key",`\u2022\u2022\u2022\u2022${e.keyLastCharacters}`],["ID",e.id],["Owning team",e.owner],["Data scope",`${e.scope} (${iBe[e.scope]})`],["Expires",e.expiresAt??"never"]]),"",...aBe(e.permissions)].join(`
285
285
  `);case"user":return["Authenticated as a user.",...aF([["Name",e.name],["Email",e.email],["ID",e.id],["Role",e.role.type]]),"","Access follows the organization role, not a per-resource permission map."].join(`
286
286
  `);default:Nt(e)}}function aBe(e){let t=Object.entries(e).sort(([o],[i])=>o.localeCompare(i)),r=["write","read"].map(o=>[o,t.filter(([,i])=>i===o).map(([i])=>i).sort().join(", ")]).filter(([,o])=>o!=="");return r.length===0?["Permissions: none. This key cannot reach any resource."]:["Permissions:",...aF(r)]}function aF(e){let t=Math.max(...e.map(([r])=>r.length));return e.map(([r,o])=>` ${r.padEnd(t)} ${o}`)}var Woe=P("whoami",{output:Nx("output",["text","json"]).pipe(pa("o"),re("Output format: text | json"),xn("text"))},N("cli.auth.whoami")(function*({output:e}){let t=yield*rr(Voe);if(e==="json"){yield*Oe({data:t});return}yield*$e(sBe(t))})).pipe(U("Ask Tsuga which credential this CLI authenticates as, and print its scope and permissions"));var Qoe=P("auth").pipe(U("Manage authentication: user login (OAuth) or operation API key"),xe([zne,Yne,roe,Jne,toe,Woe]));var cBe="/v0/billing/focus",cF="1.4",Dd=31,CR=e=>n.String({description:`${e} UTC, formatted as ISO 8601.`}),ZT=n.Object({BilledCost:n.Literal(0,{description:"Always 0 for now."}),BillingAccountId:n.String({description:"Identifier of the organization."}),BillingAccountName:n.String({description:"Name of the organization."}),BillingCurrency:n.Literal("USD",{description:"Currency of the cost columns."}),BillingPeriodEnd:CR("Exclusive end of the calendar month holding the charge,"),BillingPeriodStart:CR("Inclusive start of the calendar month holding the charge,"),ChargeCategory:n.Literal("Usage",{description:"Charge category."}),ChargeClass:n.Null({default:null,description:"Represents corrections to the charge, if any."}),ChargeDescription:n.String({description:"Human-readable summary of the charge."}),ChargeFrequency:n.Literal("Usage-Based",{description:"Charge frequency."}),ChargePeriodEnd:CR("Exclusive end of the day the data was ingested,"),ChargePeriodStart:CR("Inclusive start of the day the data was ingested,"),ConsumedQuantity:n.Number({description:"Uncompressed ingested volume, in gigabytes."}),ConsumedUnit:n.Literal("GB",{description:"Unit of `ConsumedQuantity`."}),ContractedCost:n.Literal(0,{description:"Always 0 for now."}),EffectiveCost:n.Literal(0,{description:"Always 0 for now."}),HostProviderName:n.Literal("Tsuga",{description:"Entity hosting the infrastructure the service runs on."}),InvoiceIssuerName:n.Literal("Tsuga",{description:"Entity issuing the invoice."}),ListCost:n.Literal(0,{description:"Always 0 for now."}),PricingQuantity:n.Number({description:"Billable volume, in gigabytes."}),PricingUnit:n.Literal("GB",{description:"Unit of `PricingQuantity`."}),ServiceCategory:n.Literal("Management and Governance",{description:"FOCUS service category."}),ServiceName:n.String({description:"Tsuga product the data was ingested into: `Tsuga Logs`, `Tsuga Metrics`, `Tsuga Traces`, `Tsuga RUM`, or `Tsuga Profiling`."}),ServiceProviderName:n.Literal("Tsuga",{description:"Entity providing the service."}),ServiceSubcategory:n.Literal("Observability",{description:"FOCUS service subcategory."})}),uF=n.Object(nn.properties,{description:`Time range to export. It is widened to whole UTC days and must span at most ${Dd} days.`}),Ycr=f({tags:["billing"],url:cBe,method:"GET",query:uF,response:n.Array(ZT)});var Zoe=n.Object(ZT.properties,{$id:"FocusBillingRow",description:`One FOCUS ${cF} cost and usage row: the volume of one telemetry kind ingested on one UTC day.`}),uBe={BilledCost:0,BillingAccountId:"org-123",BillingAccountName:"Acme",BillingCurrency:"USD",BillingPeriodEnd:"2026-10-01T00:00:00Z",BillingPeriodStart:"2026-09-01T00:00:00Z",ChargeCategory:"Usage",ChargeClass:null,ChargeDescription:"Tsuga Logs data ingested",ChargeFrequency:"Usage-Based",ChargePeriodEnd:"2026-09-23T00:00:00Z",ChargePeriodStart:"2026-09-22T00:00:00Z",ConsumedQuantity:12.5,ConsumedUnit:"GB",ContractedCost:0,EffectiveCost:0,HostProviderName:"Tsuga",InvoiceIssuerName:"Tsuga",ListCost:0,PricingQuantity:12.5,PricingUnit:"GB",ServiceCategory:"Management and Governance",ServiceName:"Tsuga Logs",ServiceProviderName:"Tsuga",ServiceSubcategory:"Observability"};Object.assign(Zoe,{examples:[uBe]});var Xoe=f({description:`Exports the ingested data volume of the organization as FOCUS ${cF} cost and usage rows (https://focus.finops.org), one per UTC day and telemetry kind. The time range is widened to whole UTC days and must span at most ${Dd} days. Cost columns are 0 until Tsuga exposes prices. See [Usage overview](/documentation/account-and-settings/usage-overview).`,operationId:"exportFocusBillingData",tags:["billing"],url:`/${"v1"}/billing/focus`,method:"GET",query:uF,response:n.Array(Zoe)});var _o=Wn("pretty").pipe(re("Print an aligned table instead of JSON"),xn(!1)),Joe=je("fields").pipe(re("Comma-separated dot-paths to select from JSON objects or each row of a JSON array; also selects the columns of a --pretty table. Text and binary output are unchanged."),_e("FIELDS"),la(pBe),Zu(e=>e.length>0,()=>"--fields must contain at least one field name"),tt,la(ue));function pBe(e){return e.split(",").map(t=>t.trim()).filter(t=>t.length>0)}var lBe=Object.keys(ZT.properties),eie=P("export",{...Xt,pretty:_o},N("cli.billing.export")(function*(e){let t=yield*fn,{from:r,to:o}=yield*Wr(e),i=Math.ceil(o/LA)-Math.floor(r/LA);if(i>Dd)return yield*new At({message:`--from/--to span ${i} days; a FOCUS export covers at most ${Dd} days. Export one shorter range at a time.`});let s=yield*rr(Xoe,{query:{from:r,to:o}});yield*t.rows(s,{...e,defaultFields:lBe})})).pipe(U(`Export ingested data volume as FOCUS cost and usage rows, at most ${Dd} days per call`));var tie=P("billing").pipe(U("Export billing cost and usage data"),xe([eie]));var rie=P("list",{},N("cli.clusters.list")(function*(){yield*Oe(yield*Xe(fC))})).pipe(U("List all Tsuga clusters available to the operation API key"));var nie=P("clusters").pipe(U("Manage Tsuga cluster selection"),xe([rie]));var oie=P("defaults",{},N("cli.config.resetDefaults")(function*(){yield*(yield*ht).resetDefaults,yield*$e("Custom defaults cleared")})).pipe(U("Clear all custom defaults"));var iie=P("reset").pipe(U("Reset configuration values"),xe([oie]));var sie=P("default",{key:Vne("FLAG_NAME",MM).pipe(jt(`The flag to set a default for. One of: ${MM.join(" | ")}`)),value:je("value").pipe(re("The default value. Use --value=-1h for dash-prefixed values; an empty value clears the default"),_e("VALUE"),la(e=>e.trim()))},N("cli.config.setDefault")(function*({key:e,value:t}){let r=yield*ht;if(t===""){yield*r.setDefault(e,t),yield*$e(`Default cleared: ${e}`);return}yield*dBe(e,t),yield*r.setDefault(e,t),yield*$e(`Default set: ${e} = ${t}`)})).pipe(U("Set a custom default value for a command flag"),$x([{description:"Widen the default log search window",command:"config set default from --value=-1h"},{description:"Go back to the built-in default",command:"config set default from --value ''"}]));function dBe(e,t){switch(e){case"from":case"to":return Xs(yR(e,le(t)));case"max-results":{let r=Number(t);return Number.isSafeInteger(r)&&r>0?Ue:new At({message:`The default for max-results must be a positive safe integer (got: ${t})`})}case"query":case"cluster":return Ue;default:return Nt(e)}}var aie=P("telemetry",{consent:Zne("STATE",[["on",!0],["off",!1]]).pipe(jt("Whether to send usage data"))},N("cli.config.setTelemetry")(function*({consent:e}){yield*(yield*ht).saveTelemetryConsent(e);let t=(yield*HM)===void 0?"":" (TSUGA_TELEMETRY overrides it)";yield*$e(`Usage data: ${e?"on":"off"}${t}`)})).pipe(U("Turn sending anonymous usage data on or off"),$x([{description:"Stop sending usage data",command:"config set telemetry off"}]));var cie=P("set").pipe(U("Set a configuration value"),xe([sie,aie]));var uie=N("cli.config.show")(function*(){let e=yield*Ua,t=yield*ht,r=yield*t.resolve({operationApiKey:e.operationApiKey,clusterId:e.cluster});yield*$e(EJ(r,t.configPath).trimEnd())});var pie=P("config",{},uie).pipe(U("Show or manage configuration"),xe([cie,iie]));var lie=P("get",{path:Er("DOC_PATH").pipe(jt("Path or link of the page to fetch"))},N("cli.docs.get")(function*({path:e}){yield*yc({[V7]:e}),yield*Oe(yield*Xe(IJ,{query:{path:e}}))})).pipe(U("Get a documentation or API-reference page by path or link (e.g. 'getting-started/send-your-first-logs' or 'api/aggregateScalar')"));var die=P("search",{query:Er("SEARCH_TEXT").pipe(jt("Text to search for"))},N("cli.docs.search")(function*({query:e}){yield*yc({[W7]:e}),yield*Oe(yield*Xe(EC,{query:{query:e}}))})).pipe(U("Search Tsuga documentation and the full API reference, ranked by relevance"));var mie=P("docs").pipe(U("Search and fetch Tsuga documentation and API-reference pages"),xe([lie,die]));var XT="/v0/sandbox-runs",mBe=["running","completed","failed","cancelled"],fBe=n.Enum(mBe,{description:"Lifecycle status of the sandbox agent run"}),gBe="^[A-Za-z0-9][A-Za-z0-9._-]*\\.md$",hBe=50,yBe=25e3,EBe=1e5,fie=`Claude Code auto memory files kept across runs of a sandbox configuration, keyed by file name: a MEMORY.md index plus the topic files it links, at most ${EBe} characters in total. Runs rewrite them, so review them like any agent output.`,pF=n.Record(n.String(),n.String(),{description:fie}),lF=n.Record(n.String({pattern:gBe}),n.String({maxLength:yBe}),{additionalProperties:!1,minProperties:1,maxProperties:hBe,description:fie,examples:[{"MEMORY.md":"- [Topic](topic.md) - one-line summary"}]}),gie=30,TBe=D("type",[n.Object({type:n.Literal("quality-report-auto-fix"),ruleKey:n.String({description:"Quality-report rule the run tried to fix."}),teamId:n.Optional(n.String({description:"Team the rule failed for."})),teamName:n.Optional(n.String({description:"Name of that team."})),configurationId:n.Optional(n.String({description:"Sandbox configuration the run used."})),configurationName:n.Optional(n.String({description:"Name of that configuration."}))}),n.Object({type:n.Literal("scheduled"),scheduledRunId:n.String({description:"Scheduled run that launched the run."}),scheduledRunName:n.String({description:"Name of that scheduled run."}),configurationId:n.String({description:"Sandbox configuration the run used."}),configurationName:n.Optional(n.String({description:"Name of that configuration. Missing when the launch failed before the configuration was read."}))})],{description:"What launched the run."}),hie=n.Object({costUsd:n.Number({description:"Estimated cost in USD, computed by Claude Code from Anthropic list prices."}),inputTokens:n.Number({description:"Input tokens sent to the model."}),outputTokens:n.Number({description:"Output tokens generated by the model."}),cacheReadTokens:n.Number({description:"Input tokens served from the prompt cache."}),turns:n.Number({description:"Agent turns taken."}),agentDurationMs:n.Number({description:"Wall-clock time of the agent session."}),modelDurationMs:n.Number({description:"Time spent waiting on model responses."}),sessionId:n.String({description:"Claude Code session ID."})},{description:"Usage reported by the agent's final result event."}),yie=200,JT=n.Object({id:n.String({description:"Tsuga-generated sandbox run ID."}),status:fBe,trigger:TBe,clusterId:n.String({description:"Cluster the agent queried."}),error:n.Optional(n.String({description:"Why the run failed or stopped."})),usage:n.Optional(hie),prompt:n.Optional(n.String({description:"Prompt the agent ran with. Returned by the get endpoint only."})),output:n.Optional(n.String({description:"The agent's final output, once the run finished. Returned by the get endpoint only."})),creator:n.Optional(be),createdAt:v({description:"When the run started."}),completedAt:n.Optional(v({description:"When the run finished."}))}),apr=f({tags:["sandbox-runs"],url:XT,method:"GET",response:n.Array(JT)}),cpr=f({tags:["sandbox-runs"],url:`${XT}/:id`,method:"GET",params:n.Object({id:p()}),response:JT}),upr=f({tags:["sandbox-runs"],url:`${XT}/validate`,method:"POST",body:n.Object({runId:p({allowEmpty:!1,description:"Active sandbox run whose ID identifies the container."}),clusterId:p({allowEmpty:!1,description:"Cluster the run targets; must belong to the operation key's organization."})}),response:n.Object({authorized:n.Boolean({description:"True when the key may execute this sandbox run."})})}),ppr=f({tags:["sandbox-runs"],url:`${XT}/:id/cancel`,method:"POST",params:n.Object({id:p()}),response:n.Object({})}),lpr=f({tags:["sandbox-runs"],url:`${XT}/:id/complete`,method:"POST",params:n.Object({id:p({description:"Sandbox run the agent finished."})}),body:n.Object({status:n.Enum(["completed","failed"],{description:"Completed when the agent exited successfully, failed otherwise."}),output:n.Optional(n.String({description:"The agent's final output."})),error:n.Optional(n.String({description:"Why the run failed."})),usage:n.Optional(hie),memory:n.Optional(lF)}),response:n.Object({})});var vp="/v0/sandbox-configurations",SBe=100,_Be=60,Eie="Full names of the repositories (e.g. `org/repo`) the sandbox agent may work in. An empty array means the agent can reach every repository the GitHub App connection is installed on.",Tie=`Maximum minutes the sandbox agent may run before it is stopped. Defaults to ${gie} when unset.`,Sie="Slack channel told when a run of this configuration finishes, through a Slack notification integration. Omit it to notify no one.",IBe=n.Object({type:n.Literal("slack"),integrationId:n.String({description:"Slack notification integration to post with."}),channel:n.String({description:"Slack channel or user that receives the message."})},{description:Sie}),bBe=n.Object({type:n.Literal("slack"),integrationId:p({allowEmpty:!1,description:"Slack notification integration to post with."}),channel:p({allowEmpty:!1,description:"Slack channel or user that receives the message."})},{description:Sie}),vg=n.Object({id:n.String({description:"Tsuga-generated sandbox configuration ID."}),name:n.String({description:"Human-readable name of the sandbox configuration."}),owner:n.String({description:"ID of the team that owns this sandbox configuration."}),repositories:n.Array(n.String(),{description:Eie}),scope:ws,permissions:WT,systemPrompt:n.Optional(n.String({description:"Extra system prompt prepended to the sandbox agent run for this configuration."})),timeoutMinutes:n.Optional(n.Integer({description:Tie})),memory:n.Optional(pF),notification:n.Optional(IBe),creator:n.Optional(be),updater:n.Optional(be),createdAt:v(),updatedAt:v()}),_ie=n.Object({name:n.String({minLength:1,maxLength:SBe,description:"Human-readable name of the sandbox configuration."}),owner:p({allowEmpty:!1,description:"ID of the team that owns this sandbox configuration."}),repositories:n.Array(p({allowEmpty:!1}),{default:[],description:Eie}),scope:ws,permissions:WT,systemPrompt:n.Optional(p({type:"long",description:"Extra system prompt prepended to the sandbox agent run for this configuration."})),timeoutMinutes:n.Optional(n.Integer({minimum:1,maximum:_Be,description:Tie})),notification:n.Optional(bBe)}),_pr=f({tags:["sandbox-configurations"],url:vp,method:"GET",response:n.Array(vg)}),Ipr=f({tags:["sandbox-configurations"],url:`${vp}/:id`,method:"GET",params:n.Object({id:p()}),response:vg}),bpr=f({tags:["sandbox-configurations"],url:vp,method:"POST",body:_ie,response:vg}),xpr=f({tags:["sandbox-configurations"],url:`${vp}/:id`,method:"PUT",params:n.Object({id:p()}),body:_ie,response:vg}),Opr=f({tags:["sandbox-configurations"],url:`${vp}/:id`,method:"DELETE",params:n.Object({id:p()}),response:B}),eS=n.Object({memory:n.Optional(pF)}),dF=n.Object({memory:lF}),Apr=f({tags:["sandbox-configurations"],url:`${vp}/:id/memory`,method:"GET",params:n.Object({id:p()}),response:eS}),Cpr=f({tags:["sandbox-configurations"],url:`${vp}/:id/memory`,method:"PUT",params:n.Object({id:p()}),body:dF,response:vg}),Rpr=f({tags:["sandbox-configurations"],url:`${vp}/:id/memory`,method:"DELETE",params:n.Object({id:p()}),response:vg});var Iie=`/${"v1"}/sandbox-runs`,mF=`/${"v1"}/sandbox-configurations/:id/memory`,bie="Admin users see every run; other users and operation API keys see only the runs their user started.",fF=n.Object({id:p({allowEmpty:!1,description:"ID of the sandbox configuration."})}),xie=f({description:`Lists the latest ${yie} sandbox agent runs, newest first, without their prompt and output. ${bie}`,tags:["private"],url:Iie,method:"GET",response:n.Array(JT)}),Oie=f({description:`Gets a sandbox agent run with its prompt and output. ${bie}`,tags:["private"],url:`${Iie}/:id`,method:"GET",params:n.Object({id:p({allowEmpty:!1,description:"ID of the sandbox run."})}),response:JT}),Aie=f({description:"Gets the memory sandbox agent runs keep for a sandbox configuration.",tags:["private"],url:mF,method:"GET",params:fF,response:eS}),gF=f({description:"Replaces the memory of a sandbox configuration.",tags:["private"],url:mF,method:"PUT",params:fF,body:dF,response:eS}),Cie=f({description:"Clears the memory of a sandbox configuration.",tags:["private"],url:mF,method:"DELETE",params:fF,response:eS});var Ng=Er("CONFIGURATION_ID").pipe(jt("The sandbox configuration ID"));var Rie=P("clear",{id:Ng},N("cli.sandbox-memory.clear")(function*({id:e}){yield*Oe(yield*Xe(Cie,{params:{id:e}}))})).pipe(U("Clear the memory of a sandbox configuration"));var Pie=P("get",{id:Ng},N("cli.sandbox-memory.get")(function*({id:e}){yield*Oe(yield*Xe(Aie,{params:{id:e}}))})).pipe(U("Get the memory of a sandbox configuration"));var Uie=P("set",{id:Ng,file:Ap,data:tu,generateSkeleton:ru},N("cli.sandbox-memory.set")(function*(e){if(e.generateSkeleton){yield*Si(yield*eu(gF));return}yield*Oe(yield*Xe(gF,{params:{id:e.id},body:yield*Wc(e)}))})).pipe(U("Replace the memory of a sandbox configuration"));var wie=P("sandbox-memory").pipe(U("Read and edit the memory that sandbox agent runs keep per configuration"),xe([Pie,Uie,Rie]));function vie(e){let t={};function r(o,i,s,a){if(n.IsObject(o)){for(let[u,l]of Object.entries(o.properties)){if(i.length===0&&["limit","offset","clusterId"].includes(u))continue;let d=u.replace(/([A-Z])/g,"-$1").toLowerCase(),g=u==="filters"||u==="value"||u==="values"?s:u==="exclude"?`exclude-${s}`:s?`${s}-${d}`:d,y="description"in l&&typeof l.description=="string"?l.description:"";r(l,[...i,u],g,u==="value"||u==="values"?`${a} ${y}`.trim():y||a)}return}t[s]={path:i,flag:xBe(s,o,a)}}return e&&r(e,[],"",""),{flags:Object.fromEntries(Object.entries(t).map(([o,{flag:i}])=>[o,i])),apply:k(function*(o,i={},s={}){if(i===null||typeof i!="object"||Array.isArray(i))return yield*new At({message:"The list request body must be a JSON object"});let a={...i,...s};for(let[l,{path:d}]of Object.entries(t)){let g=o[l];if(!Oh(g)||Sn(g))continue;let y=a;for(let[E,h]of d.entries())if(E===d.length-1)y[h]=g.value;else{let T=y[h],_=T!==null&&typeof T=="object"&&!Array.isArray(T)?{...T}:{};y[h]=_,y=_}}let u=e?ka(e,a):[];return u.length>0?yield*new At({message:`Invalid list request: ${JSON.stringify(u)}`}):a})}}function xBe(e,t,r){let o;if(n.IsString(t))o=je(e);else if(n.IsBoolean(t))o=Wn(e);else if(n.IsEnum(t))o=gE(e,t.enum.map(i=>[String(i),i]));else if(n.IsArray(t)&&(n.IsString(t.items)||n.IsNumber(t.items)||n.IsInteger(t.items)||n.IsEnum(t.items))){let i=n.IsNumber(t.items)||n.IsInteger(t.items)||n.IsEnum(t.items)&&t.items.enum.every(s=>typeof s=="number");o=je(e).pipe(_e("VALUE,..."),la(s=>s.split(",").map(a=>{let u=a.trim();return i&&u!==""?Number(u):u}))),r+=" Pass comma-separated values."}else n.IsUnion(t)&&t.anyOf.some(n.IsNull)&&t.anyOf.every(i=>n.IsString(i)||n.IsNull(i))?(o=je(e).pipe(la(i=>i==="null"?null:i)),r+=" Use null to select resources without a folder."):(o=je(e).pipe(_e("JSON"),GV(i=>JSON.parse(i),()=>`--${e} must be valid JSON`)),r+=n.IsArray(t)?" Pass a JSON array.":" Pass JSON.");return o.pipe(re(r),tt)}function ve(e){let t=e.singularOverride??pJ(e.commandName).replace(/-/g," "),r=e.pluralOverride??e.commandName.replace(/-/g," "),o=OBe(t),{get:i,create:s,update:a,delete:u}=e.endpoints,l=[ABe(e,r),...i?[P("get",{id:hF},N("cli.resource.get")(function*({id:d}){yield*Oe(yield*Xe(i,{params:{[yF(i)]:d}}))})).pipe(U(`Get ${o} ${t} by ID`))]:[],...s?[jn("create",`Create a new ${t}`,s)]:[],...a?[P("update",{id:hF,file:Ap,data:tu,generateSkeleton:ru},N("cli.resource.update")(function*(d){if(d.generateSkeleton){yield*Si(yield*eu(a));return}yield*Oe(yield*Xe(a,{params:{[yF(a)]:d.id},body:yield*Wc(d)}))})).pipe(U(`Update ${o} ${t} by ID`))]:[],...u?[P("delete",{id:hF},N("cli.resource.delete")(function*({id:d}){yield*Oe(yield*Xe(u,{params:{[yF(u)]:d}}))})).pipe(U(`Delete ${o} ${t} by ID`))]:[],...e.extraSubcommands??[]];return P(e.commandName).pipe(U(e.description),xe(l))}function OBe(e){return/^[aeiou]/i.test(e)||e==="SLO"?"an":"a"}var hF=Er("ID").pipe(jt("The resource ID"));function ABe(e,t){let r=e.listDescription??`List all ${t}`,o=vie(e.enableListBody?e.endpoints.list.body:e.endpoints.list.query),i=e.endpoints.list.paginated===!0?{limit:Rp.limit,offset:Rp.offset,all:Rp.all}:{};return e.enableListBody?P("list",{...o.flags,...i,data:tu,generateSkeleton:ru},N("cli.resource.list")(function*(s){if(s.generateSkeleton){yield*Si(yield*eu(e.endpoints.list));return}let a=wt(s.data)?yield*Wc({file:z(),data:s.data}):{};yield*Oe(yield*Xe(e.endpoints.list,{body:yield*o.apply(s,a,Nie(s)),allPages:s.all===!0}))})).pipe(U(r)):P("list",{...o.flags,...i},N("cli.resource.list")(function*(s){let a=yield*o.apply(s,{},Nie(s));yield*Oe(yield*Xe(e.endpoints.list,{query:a,allPages:s.all===!0}))})).pipe(U(r))}function Nie(e){return yn({limit:e.limit&&ue(e.limit),offset:e.offset&&ue(e.offset)})}function yF(e){let t=e.params;if(t!==null&&typeof t=="object"&&"properties"in t){let{properties:r}=t;if(r!==null&&typeof r=="object"){let o=Object.keys(r);if(o.length===1&&o[0])return o[0]}}return"id"}var kie=ve({commandName:"sandbox-runs",description:"Read the history of sandbox agent runs",endpoints:{list:xie,get:Oie}});var Lie=P("experimental").pipe(U("Experimental commands that may change or be removed without notice"),xe([kie,wie]));var CBe=`/${"v1"}/feedback`,Mie=n.Object({id:n.String({description:"API request ID recorded with the feedback."})},{$id:"Feedback",description:"A recorded piece of feedback"}),RBe={id:"request-123-abc"};Object.assign(Mie,{examples:[RBe]});var Die=n.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."})}),PBe={content:"The traces command times out for large services."};Object.assign(Die,{examples:[PBe]});var Fie=f({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:CBe,method:"POST",body:Die,response:Mie});var $ie=P("feedback",{message:Er("MESSAGE").pipe(jt("The feedback to send"),Wne({min:1}))},N("cli.feedback")(function*({message:e}){yield*Oe(yield*Xe(Fie,{body:{content:e.join(" ")}}))})).pipe(U("Send feedback about Tsuga tools or APIs (e.g. a tool that failed or was confusing)"));var UBe=`/${"v1"}/grok`,wBe=25,vBe=100,Gie=n.Object({rules:n.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:wBe,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:n.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:vBe,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."}),NBe={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(Gie,{examples:[NBe]});var Bie=n.Object({results:n.Array(n.Object({sample:n.String({description:"Echo of the submitted log line, so results can be matched to the samples in the request."}),matched:n.Boolean({description:"Whether any submitted rule matched this sample. `true` means `extracted` contains the captured fields; `false` means no rule matched."}),extracted:n.Union([n.Record(n.String(),n.Unknown()),n.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."}),kBe={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(Bie,{examples:[kBe]});var jie=f({url:`${UBe}/parse`,method:"POST",operationId:"parseGrok",tags:["public","grok"],body:Gie,response:Bie,description:"Tests Grok parsing rules on sample log lines and returns the extracted fields, with the engine log routes use. Requires read access to log routes. A rule that fails to compile returns a 400 with error code `GROK_RULE_VALIDATION_ERROR` and per-rule details in `error.details.ruleErrors`."});var qie=jn("parse","Parse sample log lines with grok rules and return the extracted fields",jie);var Hie=P("grok").pipe(U("Test and preview grok parsing rules"),xe([qie]));var Vie=require("node:os"),rS=require("node:path");var EF,Kie=()=>{EF?.release(),EF=void 0},zie=(e,t)=>{let r=[],o=e.write.bind(e),i=!0;e.write=u=>i?(r.push(u),!0):o(u);let s=()=>i?(i=!1,e.write=o,r.splice(0)):[],a={release:()=>{for(let u of s())o(u)},divert:()=>{for(let u of s())t.write(u)}};return EF=a,a},Yie=e=>t=>t.pipe(sy(r=>r._tag==="ShowHelp"?ie(e.divert):Ue),zn(ie(e.release)));function LBe(e){return process.platform==="win32"?`${e}.cmd`:e}var Np=N("external.run")(function*(e,t){yield*$e(` $ ${e} ${t.join(" ")}`),yield*ie(Kie);let r=yield*co(q(Hi(LBe(e),t,{stdin:{stream:"ignore"},stdout:{stream:"inherit"},stderr:{stream:"inherit"}}),o=>o.exitCode)).pipe(st(o=>new dd({message:`Could not run \`${e}\`: ${o.message}. Is it installed and on your PATH?`})));if(Number(r)!==0)return yield*new dd({message:`${e} ${t.join(" ")} exited ${r}`})});var tS="tsuga-dev/agent-plugins",kg="tsuga";var MBe=N("cli.installPlugin.autoUpdate")(function*(e){let t=yield*rn,r=(0,rS.join)(e,".claude","settings.json");yield*$e(`Claude Code \u2192 ${r} (autoUpdate)`),yield*t.makeDirectory((0,rS.dirname)(r),{recursive:!0}).pipe(Vc("create",(0,rS.dirname)(r)));let o=yield*lg(r),i=yield*bC(r,o??"{}"),s=i.extraKnownMarketplaces??{};if(!Ii(s))return yield*new Gn({message:`${r} "extraKnownMarketplaces" must be a JSON object`});let a=s[kg],u=Ii(a)?a:{},l={...i,extraKnownMarketplaces:{...s,[kg]:{source:{source:"github",repo:tS},...u,autoUpdate:!0}}},d=bc(yield*hb),g=yield*dg(r,o,d);yield*pg(r,yield*xC(l)),yield*$e(g===void 0?" created":` patched (backup: ${g})`)}),DBe=N("cli.installPlugin.claude")(function*(e,t){yield*$e("Claude Code \u2192 installing Tsuga plugin"),yield*Np("claude",["plugin","marketplace","add",tS]),yield*Np("claude",["plugin","install",`tsuga@${kg}`]),t&&(yield*MBe(e))}),Wie=P("claude-code",{autoUpdate:Wn("auto-update").pipe(re("Patch ~/.claude/settings.json with autoUpdate=true; --no-auto-update skips it"),xn(!0))},N("cli.installPlugin.claudeCode")(function*({autoUpdate:e}){yield*DBe((0,Vie.homedir)(),e),yield*$e("Restart your claude session to load the new plugins.")})).pipe(U("Install the Tsuga plugin into Claude Code (requires the claude CLI in PATH)"));var FBe=N("cli.installPlugin.codex")(function*(){yield*$e("Codex \u2192 installing Tsuga plugin"),yield*Np("codex",["plugin","marketplace","add",tS]),yield*Np("codex",["plugin","add",`tsuga@${kg}`])}),Qie=P("codex",{},N("cli.installPlugin.codexCli")(function*(){yield*FBe(),yield*$e("Restart your codex session to load the new plugins.")})).pipe(U("Install the Tsuga plugin into Codex (requires the codex CLI in PATH)"));var Zie=P("plugin").pipe(U("Install the Tsuga plugin into a specific LLM CLI"),xe([Wie,Qie]));var Xie=P("install").pipe(U("Install Tsuga plugins into local LLM CLIs"),xe([Zie]));var $Be=10,GBe=n.Object({key:p({allowEmpty:!1,description:"Telemetry attribute key to scope the ranking by: a service, environment, team, route, or other positive equality term in the population you want fields for. Use dot-path keys such as `context.service.name`."}),value:n.Optional(p({allowEmpty:!1,description:"Attribute value the scoped telemetry should match, when the scope is a specific service, environment, team, route, or other known value. When omitted, artifacts that reference the key match this entry at full weight regardless of value."})),valueMustMatch:n.Optional(n.Boolean({description:"When true, this entry is a hard filter rather than a weight: any widget or monitor that does not match it exactly (key = value) contributes no fields at all, instead of contributing at a reduced weight. Other widgets of the same dashboard still contribute if they match. Requires `value`."}))}),TF=n.Object({field:n.String({description:"Field name to use in queries. For `kind: attribute`, this is an attribute dot path. For `kind: metric`, this is either a metric name or a `metricName.context.attribute` path when the metric query used a metric attribute."}),kind:n.Enum(["attribute","metric"],{description:"Whether the field is a telemetry attribute or a metric name. `metric` appears only in the metrics bucket, for fields referenced as the aggregated field of a metrics-source query."}),inferredType:n.Enum(["numeric","categorical","unknown"],{description:"Value type inferred from how the field is used: `numeric` when aggregated with sum/average/percentile, referenced by numeric or range filters, or a metric name; `categorical` when only grouped by or matched with equality/text filters; `unknown` otherwise. Evidence-based \u2014 a numeric field used only in equality filters reads as categorical."}),score:n.Number({description:"Relative relevance score computed by Tsuga from how strongly readable dashboards and monitors use this field for the requested scope, discounted when the field is common across the whole organization. Higher values mean stronger evidence that the field is useful for this scope. Scores are intended for ranking, not for comparison across unrelated scopes."}),artifacts:n.Number({description:"Number of distinct readable dashboards and monitors that reference this field and match the requested scope. Tsuga counts an artifact once per field even if it uses the field in multiple widgets or queries."}),globalArtifacts:n.Number({description:"Number of organization-wide dashboards and monitors that reference this field, regardless of the requested scope or caller permissions. Tsuga uses this anonymous baseline to down-rank fields that are common everywhere."}),usage:n.Object({groupBy:n.Number({description:"Number of distinct readable matching artifacts that use this field as a group-by or split dimension."}),filter:n.Number({description:"Number of distinct readable matching artifacts that filter on this field in widget queries, monitor queries, or dashboard-wide filters."}),measure:n.Number({description:"Number of distinct readable matching artifacts that aggregate this field as `aggregate.field`."}),column:n.Number({description:"Number of distinct readable matching artifacts that pin this field as a list-widget column."})},{description:"Distinct-artifact counts by usage kind, explaining why the field ranked where it did; a dashboard referencing the field the same way in many widgets counts once for that usage kind."})}),SF=n.Object({logs:n.Array(TF,{description:"Top log fields for the requested scope, ranked by score and mined from readable logs-sourced dashboards and monitors."}),traces:n.Array(TF,{description:"Top trace fields for the requested scope, ranked by score and mined from readable traces-sourced dashboards and monitors."}),metrics:n.Array(TF,{description:"Top metric names and metric-attribute fields for the requested scope, ranked by score and mined from readable metrics-sourced dashboards and monitors."}),dashboardsMatched:n.Number({description:"Number of dashboards that matched the requested scope and that the caller can read. Dashboards the caller cannot read are removed before field rankings are returned."}),monitorsMatched:n.Number({description:"Number of monitors that matched the requested scope and that the caller can read. Monitors the caller cannot read are removed before field rankings are returned."})}),_F=n.Object({scope:n.Array(GBe,{minItems:1,maxItems:$Be,description:"Scope entries that define the population to rank fields for, drawn from positive equality pairs in a TQL query, such as service and environment. Tsuga matches entries softly by default: an artifact's contribution is weighted by the fraction of entries it matches."})}),fdr=f({tags:["interesting-fields"],url:"/v0/interesting-fields",method:"POST",body:_F,response:SF});var BBe=`/${"v1"}/interesting-fields`,jBe={scope:[{key:"context.service.name",value:"payments"},{key:"context.env",value:"prod",valueMustMatch:!0}]},qBe=n.Object(_F.properties,{description:"The scope to rank fields for, as attribute key/value pairs such as a service name and an environment. Entries are matched softly by default: a widget contributes in proportion to how many entries it matches, so a broader scope returns a broader ranking. Set `valueMustMatch` on an entry to make it a hard filter instead: a widget that does not match it exactly contributes nothing, even when other entries match.",examples:[jBe]}),Jie=f({url:BBe,method:"POST",operationId:"getInterestingFields",tags:["public","interesting-fields"],body:qBe,response:SF,description:"Ranks the log, trace and metric fields most used for a scope, such as one service, in the organization's dashboards and monitors: which attribute to filter or group by, which metric to chart. Ranking is TF-IDF style, so a field used everywhere scores below one distinctive to the scope. Assets the caller cannot read only feed an anonymous frequency baseline. Requires public API read access to dashboards and monitors."});var ese=jn("list","Rank the log, trace and metric fields most relevant to a scope, mined from dashboards and monitors",Jie);var tse=P("interesting-fields").pipe(U("Discover the telemetry fields an org already uses for a scope"),xe([ese]));var Xo="/v0/kubernetes-explorer",HBe="^[a-z0-9.-]+$",KBe="^[A-Za-z0-9._-]+$",rse=256,nse=n.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 Zo=e=>n.Optional(n.Array(p({allowEmpty:!1}),{description:e})),IF=["clusters","namespaces","teams","envs"],nS="Names of other filter fields in this query whose values exclude rather than include. Set this to a field name to keep only the resources matching none of that field's values; fields left out keep the resources matching any of their values.",bF={clusterId:nse,search:n.Optional(n.String({pattern:HBe,minLength:1,maxLength:rse,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."}))},ose={clusterId:nse,search:n.Optional(n.String({pattern:KBe,minLength:1,maxLength:rse,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."}))},ise=n.Object(bF),sse=n.Object(ose),Lg={...bF,includeInternalNamespaces:n.Optional(n.Boolean({description:"When false or omitted, resources in internal namespaces (kube-system, kube-public, kube-node-lease, local-path-storage, gke-managed-*) are excluded, even when `namespaces` names them."})),clusters:Zo("Restrict results to these Kubernetes cluster names."),namespaces:Zo("Restrict results to these namespaces."),teams:Zo("Restrict results to these team names."),envs:Zo("Restrict results to these environments."),exclusiveFilters:n.Optional(n.Array(n.Enum(IF),{description:nS})),...ye},zBe=["Pending","Running","Succeeded","Failed","Unknown","CrashLoopBackOff","Error"],YBe=[...IF,"nodes","deployments","statefulsets","daemonsets","podStatus"],VBe={...Lg,nodes:Zo("Restrict results to pods scheduled on these nodes."),deployments:Zo("Restrict results to pods owned by these Deployments."),statefulsets:Zo("Restrict results to pods owned by these StatefulSets."),daemonsets:Zo("Restrict results to pods owned by these DaemonSets."),podStatus:Zo("Restrict results to pods whose resolved status matches any of these values. Typical values are 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. When exclusiveFilters includes podStatus, keep pods whose status matches none of these values instead."),exclusiveFilters:n.Optional(n.Array(n.Enum(YBe),{description:`${nS} Excluding podStatus is applied after stitching pod phase and container status reason telemetry, because phase is not a filterable metric attribute.`}))},WBe=["deployment","statefulset","daemonset"],ase=n.Object({kind:n.Enum(WBe,{description:"Kind of Kubernetes workload associated with the pod. Derived from workload attributes in pod telemetry."}),name:n.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."}),cse=n.Object({podName:n.String({description:"Name of the Kubernetes pod. Set when the pod is created."}),namespace:n.Optional(n.String({description:"Kubernetes namespace that contains the pod. Present when namespace telemetry is observed."})),cluster:n.Optional(n.String({description:"Kubernetes cluster name that reported the pod. Present when cluster telemetry is observed."})),team:n.Optional(n.String({description:"Team metadata associated with the pod. Present when a team label or mapping is observed."})),env:n.Optional(n.String({description:"Environment metadata associated with the pod, such as production or staging. Present when an environment label or mapping is observed."})),node:n.Optional(n.String({description:"Kubernetes node currently or most recently running the pod. Present when node telemetry is observed."})),phase:n.Enum(zBe,{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:n.Integer({description:"Number of containers in the pod that are currently ready. From container readiness telemetry. Zero or greater."}),totalContainers:n.Integer({description:"Number of observed containers for the pod based on container readiness telemetry. Zero or greater."}),restarts:n.Integer({description:"Total restart count across containers in the pod. From container restart telemetry. Zero or greater."}),createdAt:n.Optional(v({description:"Timestamp from pod start time telemetry for the selected pod instance. Present when pod start time telemetry is observed."}))}),xF=n.Object({...cse.properties,workload:n.Optional(ase),cpuUsageMilli:n.Optional(n.Number({description:"Recent pod CPU usage in millicores. Present when CPU usage telemetry is observed."})),cpuLimitMilli:n.Optional(n.Number({description:"Configured pod CPU limit in millicores, summed across observed containers. Present when a CPU limit is configured and observed."})),cpuRequestMilli:n.Optional(n.Number({description:"Configured pod CPU request in millicores, summed across observed containers. Present when a CPU request is configured and observed."})),memoryUsageBytes:n.Optional(n.Number({description:"Recent pod memory usage in bytes. Present when memory usage telemetry is observed."})),memoryLimitBytes:n.Optional(n.Number({description:"Configured pod memory limit in bytes, summed across observed containers. Present when a memory limit is configured and observed."})),memoryRequestBytes:n.Optional(n.Number({description:"Configured pod memory request in bytes, summed across observed containers. Present when a memory request is configured and observed."})),cpuUtilization:n.Optional(n.Number({description:"Recent CPU usage divided by the configured CPU limit. Present when both usage and limit are observed."})),memoryUtilization:n.Optional(n.Number({description:"Recent memory usage divided by the configured memory limit. Present when both usage and limit are observed."})),cpuRequestUtilization:n.Optional(n.Number({description:"Recent CPU usage divided by the configured CPU request. Present when both usage and request are observed."})),memoryRequestUtilization:n.Optional(n.Number({description:"Recent memory usage divided by the configured memory request. Present when both usage and request are observed."}))}),OF=["podName","namespace","cluster","team","env","node","phase","restarts","cpuUsageMilli","cpuUtilization","cpuRequestUtilization","memoryUsageBytes","memoryUtilization","memoryRequestUtilization","createdAt"],Udr=f({tags:["kubernetes-explorer"],method:"GET",url:`${Xo}/pods`,query:n.Object({...VBe,sortBy:n.Optional(n.Enum(OF,{description:"Field to sort pods by."})),sortDirection:n.Optional(me)}),paginated:!0,response:n.Array(xF)}),QBe=["teams","envs"],AF=n.Object({cluster:n.String({description:"Kubernetes cluster name from cluster telemetry."}),teams:n.Optional(n.Array(n.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:n.Optional(n.Array(n.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:n.Optional(n.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:n.Optional(n.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:n.Optional(n.Integer({description:"Number of Kubernetes nodes in the cluster that are ready. Present when node readiness telemetry is observed."})),podPhaseCounts:n.Optional(n.Object({Pending:n.Integer({description:"Number of observed pods currently in the Pending phase."}),Running:n.Integer({description:"Number of observed pods currently in the Running phase."}),Succeeded:n.Integer({description:"Number of observed pods currently in the Succeeded phase."}),Failed:n.Integer({description:"Number of observed pods currently in the Failed phase."}),Unknown:n.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."}))}),ZBe=["cluster","teams","envs","cpuUsageMilli","memoryUsageBytes","readyNodes"],wdr=f({tags:["kubernetes-explorer"],method:"GET",url:`${Xo}/clusters`,query:n.Object({...ose,teams:Zo("Restrict to clusters that host workloads from these team names."),envs:Zo("Restrict to clusters that host workloads in these environments."),exclusiveFilters:n.Optional(n.Array(n.Enum(QBe),{description:nS})),sortBy:n.Optional(n.Enum(ZBe,{description:"Field to sort clusters by."})),sortDirection:n.Optional(me),...ye}),paginated:!0,response:n.Array(AF)}),XBe=["clusters"],JBe=["Ready","NotReady","Unknown"],CF=n.Object({node:n.String({description:"Kubernetes node name from node telemetry."}),cluster:n.Optional(n.String({description:"Kubernetes cluster name that contains the node. Present when cluster telemetry is observed."})),status:n.Optional(n.Enum(JBe,{description:"Readiness of the node, derived from its Ready condition. Present when node condition telemetry is observed."})),instanceType:n.Optional(n.String({description:"Cloud instance type backing the node (for example `r7g.2xlarge`). Present when host telemetry is observed."})),pods:n.Optional(n.Integer({description:"Number of observed pods scheduled on the node, including pods in internal namespaces since they occupy node capacity. Present when pod telemetry is observed."})),allocatablePods:n.Optional(n.Integer({description:"Maximum number of pods the node can run. Present when node allocatable telemetry is observed."})),cpuUsageMilli:n.Optional(n.Number({description:"Recent CPU usage for the node, in millicores. Reported by the kubelet, so it is absent on nodes that only report cluster-level telemetry."})),cpuAllocatableMilli:n.Optional(n.Number({description:"CPU available to pods on the node, in millicores. Present when node allocatable telemetry is observed."})),cpuUtilization:n.Optional(n.Number({description:"Node CPU usage divided by allocatable CPU. Present when both usage and allocatable telemetry are observed."})),memoryUsageBytes:n.Optional(n.Number({description:"Recent memory usage for the node, in bytes. Reported by the kubelet, so it is absent on nodes that only report cluster-level telemetry."})),memoryAllocatableBytes:n.Optional(n.Number({description:"Memory available to pods on the node, in bytes. Present when node allocatable telemetry is observed."})),memoryUtilization:n.Optional(n.Number({description:"Node memory usage divided by allocatable memory. Present when both usage and allocatable telemetry are observed."}))}),RF=["node","cluster","status","instanceType","pods","allocatablePods","cpuUsageMilli","cpuAllocatableMilli","cpuUtilization","memoryUsageBytes","memoryAllocatableBytes","memoryUtilization"],vdr=f({tags:["kubernetes-explorer"],method:"GET",url:`${Xo}/nodes`,query:n.Object({...bF,clusters:Zo("Restrict results to these Kubernetes cluster names."),exclusiveFilters:n.Optional(n.Array(n.Enum(XBe),{description:nS})),sortBy:n.Optional(n.Enum(RF,{description:"Field to sort nodes by."})),sortDirection:n.Optional(me),...ye}),paginated:!0,response:n.Array(CF)}),PF=n.Object({namespace:n.String({description:"Kubernetes namespace name from namespace telemetry. Includes namespaces with no observed pods when namespace telemetry is observed."}),cluster:n.Optional(n.String({description:"Kubernetes cluster name that contains the namespace. Present when cluster telemetry is observed."})),teams:n.Optional(n.Array(n.String(),{description:"Team metadata values observed in workloads in the namespace. Present when team labels or mappings are observed."})),envs:n.Optional(n.Array(n.String(),{description:"Environment metadata values observed in workloads in the namespace. Present when environment labels or mappings are observed."})),pods:n.Optional(n.Integer({description:"Number of observed pods in the namespace. Present when pod telemetry is observed."})),cpuUsageMilli:n.Optional(n.Number({description:"Aggregate recent CPU usage for observed pods in the namespace, in millicores. Present when CPU usage telemetry is observed."})),memoryUsageBytes:n.Optional(n.Number({description:"Aggregate recent memory usage for observed pods in the namespace, in bytes. Present when memory usage telemetry is observed."}))}),UF=["namespace","cluster","teams","envs","pods","cpuUsageMilli","memoryUsageBytes"],Ndr=f({tags:["kubernetes-explorer"],method:"GET",url:`${Xo}/namespaces`,query:n.Object({...Lg,sortBy:n.Optional(n.Enum(UF,{description:"Field to sort namespaces by."})),sortDirection:n.Optional(me)}),paginated:!0,response:n.Array(PF)}),wF=n.Object({deployment:n.String({description:"Kubernetes Deployment name from workload telemetry."}),namespace:n.Optional(n.String({description:"Kubernetes namespace that contains the Deployment. Present when namespace telemetry is observed."})),cluster:n.Optional(n.String({description:"Kubernetes cluster name that contains the Deployment. Present when cluster telemetry is observed."})),team:n.Optional(n.String({description:"Team metadata associated with the Deployment. Present when a team label or mapping is observed."})),env:n.Optional(n.String({description:"Environment metadata associated with the Deployment. Present when an environment label or mapping is observed."})),pods:n.Optional(n.Integer({description:"Number of observed pods associated with the Deployment. Present when pod telemetry and workload attributes are observed."})),availableReplicas:n.Optional(n.Integer({description:"Number of available Deployment replicas from Deployment status telemetry. Present when deployment status is observed."})),desiredReplicas:n.Optional(n.Integer({description:"Desired replica count configured for the Deployment. Present when Deployment spec telemetry is observed."})),cpuUsageMilli:n.Optional(n.Number({description:"Recent aggregate CPU usage for observed Deployment pods, in millicores. Present when CPU usage telemetry is observed."})),memoryUsageBytes:n.Optional(n.Number({description:"Recent aggregate memory usage for observed Deployment pods, in bytes. Present when memory usage telemetry is observed."}))}),vF=["deployment","namespace","cluster","team","env","pods","availableReplicas","cpuUsageMilli","memoryUsageBytes"],kdr=f({tags:["kubernetes-explorer"],method:"GET",url:`${Xo}/deployments`,query:n.Object({...Lg,sortBy:n.Optional(n.Enum(vF,{description:"Field to sort deployments by."})),sortDirection:n.Optional(me)}),paginated:!0,response:n.Array(wF)}),NF=n.Object({statefulSet:n.String({description:"Kubernetes StatefulSet name from workload telemetry."}),namespace:n.Optional(n.String({description:"Kubernetes namespace that contains the StatefulSet. Present when namespace telemetry is observed."})),cluster:n.Optional(n.String({description:"Kubernetes cluster name that contains the StatefulSet. Present when cluster telemetry is observed."})),team:n.Optional(n.String({description:"Team metadata associated with the StatefulSet. Present when a team label or mapping is observed."})),env:n.Optional(n.String({description:"Environment metadata associated with the StatefulSet. Present when an environment label or mapping is observed."})),pods:n.Optional(n.Integer({description:"Number of observed pods associated with the StatefulSet. Present when pod telemetry and workload attributes are observed."})),cpuUsageMilli:n.Optional(n.Number({description:"Recent aggregate CPU usage for observed StatefulSet pods, in millicores. Present when CPU usage telemetry is observed."})),memoryUsageBytes:n.Optional(n.Number({description:"Recent aggregate memory usage for observed StatefulSet pods, in bytes. Present when memory usage telemetry is observed."}))}),kF=["statefulSet","namespace","cluster","team","env","pods","cpuUsageMilli","memoryUsageBytes"],Ldr=f({tags:["kubernetes-explorer"],method:"GET",url:`${Xo}/statefulsets`,query:n.Object({...Lg,sortBy:n.Optional(n.Enum(kF,{description:"Field to sort StatefulSets by."})),sortDirection:n.Optional(me)}),paginated:!0,response:n.Array(NF)}),LF=n.Object({daemonSet:n.String({description:"Kubernetes DaemonSet name from workload telemetry."}),namespace:n.Optional(n.String({description:"Kubernetes namespace that contains the DaemonSet. Present when namespace telemetry is observed."})),cluster:n.Optional(n.String({description:"Kubernetes cluster name that contains the DaemonSet. Present when cluster telemetry is observed."})),team:n.Optional(n.String({description:"Team metadata associated with the DaemonSet. Present when a team label or mapping is observed."})),env:n.Optional(n.String({description:"Environment metadata associated with the DaemonSet. Present when an environment label or mapping is observed."})),pods:n.Optional(n.Integer({description:"Number of observed pods associated with the DaemonSet. Present when pod telemetry and workload attributes are observed."})),readyNodes:n.Optional(n.Integer({description:"Number of eligible nodes with a ready DaemonSet pod. Present when DaemonSet status telemetry is observed."})),desiredNodes:n.Optional(n.Integer({description:"Number of eligible nodes where the DaemonSet should run a pod. Present when DaemonSet status telemetry is observed."})),cpuUsageMilli:n.Optional(n.Number({description:"Recent aggregate CPU usage for observed DaemonSet pods, in millicores. Present when CPU usage telemetry is observed."})),memoryUsageBytes:n.Optional(n.Number({description:"Recent aggregate memory usage for observed DaemonSet pods, in bytes. Present when memory usage telemetry is observed."}))}),MF=["daemonSet","namespace","cluster","team","env","pods","readyNodes","cpuUsageMilli","memoryUsageBytes"],Mdr=f({tags:["kubernetes-explorer"],method:"GET",url:`${Xo}/daemonsets`,query:n.Object({...Lg,sortBy:n.Optional(n.Enum(MF,{description:"Field to sort DaemonSets by."})),sortDirection:n.Optional(me)}),paginated:!0,response:n.Array(LF)}),DF=n.Object({overview:n.Object({...cse.properties,workload:n.Optional(ase)},{description:"Pod identity, status, and owning workload, derived from recent pod metrics."}),healthMetrics:n.Object({cpu:n.Object({usage:n.String({description:"Metric name callers can use to query pod CPU usage. This is not the current CPU value."}),limit:n.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:n.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:n.Object({usage:n.String({description:"Metric name callers can use to query pod memory usage. This is not the current memory value."}),limit:n.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:n.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:n.Object({logs:n.String({description:"TQL log search filter scoped to this pod. Built from cluster, namespace, and pod identifiers."}),traces:n.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."})}),use=n.Object({clusterId:n.Optional(p({allowEmpty:!1})),k8sCluster:p({allowEmpty:!1}),k8sNamespace:p({allowEmpty:!1}),podName:p({allowEmpty:!1})}),Ddr=f({tags:["kubernetes-explorer"],method:"GET",url:`${Xo}/pod-details`,query:use,response:DF}),FF=n.Object({configuration:n.Optional(n.Object({spec:n.Record(n.String(),n.Unknown(),{description:"Kubernetes PodSpec from the latest observed pod manifest. Fields outside `object.spec` are stripped."}),lastObservedAt:v({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:n.Record(n.String(),n.String(),{description:"Kubernetes labels on the pod from the latest observed pod manifest. Key-value strings."}),annotations:n.Record(n.String(),n.String(),{description:"Kubernetes annotations on the pod from the latest observed pod manifest. Key-value strings."}),deletedAt:n.Optional(v({description:"Timestamp when Tsuga last observed the pod deletion event. Present when the latest observed pod event is deleted."}))}),Fdr=f({tags:["kubernetes-explorer"],method:"GET",url:`${Xo}/pod-manifest`,query:use,response:FF}),$F=n.Object({podName:n.String({description:"Name of a pod instance associated with the workload. Resolved from recent pod usage telemetry and workload attributes."}),podUid:n.Optional(n.String({description:"Kubernetes UID for the pod replica. Present when UID telemetry is observed."})),cpuUsageMilli:n.Optional(n.Number({description:"Recent CPU usage for the pod replica, in millicores. Present when CPU usage telemetry is observed."})),memoryUsageBytes:n.Optional(n.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."}),GF=n.Object({overview:n.Object({deploymentName:n.String({description:"Kubernetes Deployment name for this detail response."}),namespace:n.Optional(n.String({description:"Kubernetes namespace for this detail response. Present when any deployment signal is found."})),cluster:n.Optional(n.String({description:"Kubernetes cluster name for this detail response. Present when any deployment signal is found."})),team:n.Optional(n.String({description:"Team metadata from the Deployment available-replica metric. Present when the metric includes team metadata."})),env:n.Optional(n.String({description:"Environment metadata from the Deployment available-replica metric. Present when the metric includes environment metadata."})),availableReplicas:n.Optional(n.Integer({description:"Number of available Deployment replicas from Deployment status telemetry. Present when deployment status is observed."})),desiredReplicas:n.Optional(n.Integer({description:"Desired replica count configured for the Deployment. Present when Deployment spec telemetry is observed."})),latestRevisionAt:n.Optional(v({description:"Latest ReplicaSet metadata.creationTimestamp observed for the Deployment. Present when ReplicaSet object telemetry is observed."}))}),podReplicas:n.Array($F,{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:n.Array(n.Object({replicaSetName:n.String({description:"ReplicaSet name for a Deployment revision from workload telemetry."}),revision:n.Integer({description:"Deployment revision number from ReplicaSet annotations. Integer greater than or equal to zero."}),firstSeen:n.Optional(v({description:"ReplicaSet metadata.creationTimestamp from the latest observed ReplicaSet object. Present when creation time is observed."})),faultyReasons:n.Optional(n.Array(n.String(),{description:"Container status reasons the Kubernetes faulty deployment monitor reported for this revision within the revisions lookback. Present only when the revision was flagged as faulty."})),logsSearchFilter:n.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."})}),$dr=f({tags:["kubernetes-explorer"],method:"GET",url:`${Xo}/deployment-details`,query:n.Object({clusterId:n.Optional(p({allowEmpty:!1})),k8sCluster:p({allowEmpty:!1}),k8sNamespace:p({allowEmpty:!1}),deploymentName:p({allowEmpty:!1})}),response:GF}),eje=n.Object({overview:n.Object({statefulSetName:n.String(),namespace:n.Optional(n.String()),cluster:n.Optional(n.String()),team:n.Optional(n.String()),env:n.Optional(n.String()),readyReplicas:n.Optional(n.Integer()),desiredReplicas:n.Optional(n.Integer()),latestRevisionAt:n.Optional(v())}),podReplicas:n.Array($F,{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:n.Array(n.Object({revisionName:n.String(),firstSeen:n.Optional(v()),faultyReasons:n.Optional(n.Array(n.String()))}))}),Gdr=f({tags:["kubernetes-explorer"],method:"GET",url:`${Xo}/statefulset-details`,query:n.Object({clusterId:n.Optional(p({allowEmpty:!1})),k8sCluster:p({allowEmpty:!1}),k8sNamespace:p({allowEmpty:!1}),statefulSetName:p({allowEmpty:!1})}),response:eje}),tje=n.Object({overview:n.Object({daemonSetName:n.String(),namespace:n.Optional(n.String()),cluster:n.Optional(n.String()),team:n.Optional(n.String()),env:n.Optional(n.String()),readyNodes:n.Optional(n.Integer()),desiredNodes:n.Optional(n.Integer()),latestRevisionAt:n.Optional(v())}),podReplicas:n.Array($F,{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:n.Array(n.Object({observedGeneration:n.Integer(),firstSeen:n.Optional(v()),faultyReasons:n.Optional(n.Array(n.String()))}))}),Bdr=f({tags:["kubernetes-explorer"],method:"GET",url:`${Xo}/daemonset-details`,query:n.Object({clusterId:n.Optional(p({allowEmpty:!1})),k8sCluster:p({allowEmpty:!1}),k8sNamespace:p({allowEmpty:!1}),daemonSetName:p({allowEmpty:!1})}),response:tje}),RR=1e3,pse=Ra,PR=n.Object({id:n.String({description:"Identifier of the event, unique across clusters and namespaces."}),name:n.Optional(n.String({description:"Name of the Kubernetes Event object, unique within its namespace."})),timestamp:n.Number({description:"Last time the event was observed, in milliseconds since the Unix epoch."}),type:n.Optional(n.String({description:"Event type, `Normal` or `Warning`."})),reason:n.Optional(n.String({description:"Short, machine-readable reason for the event, such as `BackOff` or `FailedScheduling`."})),message:n.Optional(n.String({description:"Human-readable description of the event."})),resourceName:n.Optional(n.String({description:"Name of the Kubernetes resource the event is about."})),resourceKind:n.Optional(n.String({description:"Kind of the Kubernetes resource the event is about, such as `Pod` or `Node`."})),namespace:n.Optional(n.String({description:"Kubernetes namespace the event was recorded in."})),cluster:n.Optional(n.String({description:"Name of the Kubernetes cluster that emitted the event."})),count:n.Optional(n.Integer({description:"Number of times the event occurred."}))}),rje=["timestamp","type","reason","resourceName","resourceKind","namespace","cluster","count"],nje=[...IF,"resourceKinds","resourceNames"],BF=n.Object({...Lg,resourceKinds:Zo("Restrict results to events about these resource kinds (Pod, Node, Deployment...)."),resourceNames:Zo("Restrict results to events about these resource names."),types:n.Optional(n.Array(n.Enum(["Normal","Warning"]),{description:"Restrict results to events of these types."})),exclusiveFilters:n.Optional(n.Array(n.Enum(nje),{description:nS})),sortBy:n.Optional(n.Enum(rje)),sortDirection:n.Optional(me)}),jdr=f({tags:["kubernetes-explorer"],method:"GET",url:`${Xo}/events`,query:BF,paginated:!0,response:n.Array(PR)}),oje=n.Object({...PR.properties,firstSeen:n.Optional(n.Number({description:"First time the event was observed, in milliseconds since the Unix epoch."})),resourceFieldPath:n.Optional(n.String({description:"Part of the resource the event is about, such as `spec.containers{app}` for one container."})),reportingComponent:n.Optional(n.String({description:"Component that reported the event, such as `kubelet`."})),reportingInstance:n.Optional(n.String({description:"Instance of the reporting component, such as the node name."})),team:n.Optional(n.String()),logsQuery:n.String({description:"TQL log search filter matching every update of the event."})}),qdr=f({tags:["kubernetes-explorer"],method:"GET",url:`${Xo}/event-details`,query:n.Object({clusterId:n.Optional(p({allowEmpty:!1})),k8sCluster:p({allowEmpty:!1}),k8sNamespace:p({allowEmpty:!1}),eventName:p({allowEmpty:!1})}),response:oje});var Ls=`/${"v1"}/kubernetes-explorer`,dse=n.Pick(xF,["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."}),ije={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(dse,{examples:[ije]});var mse=n.Pick(AF,["cluster","teams","envs","cpuUsageMilli","memoryUsageBytes","readyNodes","podPhaseCounts"],{description:"A Kubernetes cluster with aggregate resource usage, node readiness, and pod phase counts."}),sje={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(mse,{examples:[sje]});var fse=n.Pick(PF,["namespace","cluster","teams","envs","pods","cpuUsageMilli","memoryUsageBytes"],{description:"A Kubernetes namespace with pod count and aggregate resource usage."}),aje={namespace:"production",cluster:"prod-us-east",teams:["platform"],envs:["production"],pods:24,cpuUsageMilli:1800,memoryUsageBytes:3221225472};Object.assign(fse,{examples:[aje]});var gse=n.Pick(CF,["node","cluster","status","instanceType","pods","allocatablePods","cpuUsageMilli","cpuAllocatableMilli","cpuUtilization","memoryUsageBytes","memoryAllocatableBytes","memoryUtilization"],{description:"A Kubernetes node with its readiness, instance type, and usage against what it can allocate to pods."}),cje={node:"ip-10-0-1-23.ec2.internal",cluster:"prod-us-east",status:"Ready",instanceType:"r7g.2xlarge",pods:25,allocatablePods:234,cpuUsageMilli:4e3,cpuAllocatableMilli:8e3,cpuUtilization:.5,memoryUsageBytes:4e9,memoryAllocatableBytes:16e9,memoryUtilization:.25};Object.assign(gse,{examples:[cje]});var hse=n.Pick(wF,["deployment","namespace","cluster","team","env","pods","availableReplicas","desiredReplicas","cpuUsageMilli","memoryUsageBytes"],{description:"A Kubernetes deployment with replica counts and aggregate resource usage."}),uje={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(hse,{examples:[uje]});var yse=n.Pick(NF,["statefulSet","namespace","cluster","team","env","pods","cpuUsageMilli","memoryUsageBytes"],{description:"A Kubernetes StatefulSet with replica counts and aggregate resource usage."}),pje={statefulSet:"postgres",namespace:"production",cluster:"prod-us-east",team:"platform",env:"production",pods:3,cpuUsageMilli:900,memoryUsageBytes:2147483648};Object.assign(yse,{examples:[pje]});var Ese=n.Pick(LF,["daemonSet","namespace","cluster","team","env","pods","readyNodes","desiredNodes","cpuUsageMilli","memoryUsageBytes"],{description:"A Kubernetes DaemonSet with eligible-node readiness and aggregate resource usage."}),lje={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(Ese,{examples:[lje]});var Tse=n.Pick(DF,["overview","healthMetrics","searchFilters"],{description:"Metrics-derived information for a single Kubernetes pod: status, owning workload, CPU/memory metric identifiers, and log/trace filters."}),dje={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.working_set",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(Tse,{examples:[dje]});var Sse=n.Pick(FF,["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."}),mje={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(Sse,{examples:[mje]});var _se=n.Pick(GF,["overview","podReplicas","revisions"],{description:"Detailed information for a single Kubernetes deployment: replica status, backing pods, and rollout revisions."}),fje={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",logsSearchFilter:'context.k8s.cluster.name:"prod-us-east" context.k8s.namespace.name:"production" context.k8s.replicaset.name:"api-gateway-7d9f8c6b5"'}]};Object.assign(_se,{examples:[fje]});var Ise=n.Pick(PR,["timestamp","type","reason","message","resourceName","resourceKind","namespace","cluster","count"],{description:"A Kubernetes event with its type, reason, message, and the resource it is about. `timestamp` is the last occurrence in epoch milliseconds and `count` the number of occurrences."}),gje={timestamp:17897328e5,type:"Warning",reason:"BackOff",message:"Back-off restarting failed container api in pod api-gateway-7d9f8c6b5-2xk4p_production",resourceName:"api-gateway-7d9f8c6b5-2xk4p",resourceKind:"Pod",namespace:"production",cluster:"prod-us-east",count:3};Object.assign(Ise,{examples:[gje]});var bse=n.Object({clusterId:n.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."}))}),xse=n.Pick(ise,["clusterId","search"]);function Mg(e){return n.Object({...xse.properties,sortBy:n.Optional(n.Enum(e,{description:"Field to sort results by. Without it the order is not stable between requests, so set it when paging with `offset`."})),sortDirection:n.Optional(me),...Ye})}var hje=n.Pick(sse,["clusterId","search"]),Ose=f({description:"Lists Kubernetes (k8s) pods with phase, ready containers, restarts, node, owning workload and CPU and memory usage against limits: find crashing, pending or restarting pods.",operationId:"listKubernetesPods",tags:["public","kubernetes-explorer"],method:"GET",url:`${Ls}/pods`,paginated:!0,query:Mg(OF),response:n.Array(dse)}),Ase=f({description:"Lists Kubernetes (k8s) clusters with node readiness, pod phase counts and resource usage. These are not Tsuga clusters, which the clusters list returns.",operationId:"listKubernetesClusters",tags:["public","kubernetes-explorer"],method:"GET",url:`${Ls}/clusters`,query:hje,response:n.Array(mse)}),Cse=f({description:"Lists Kubernetes (k8s) namespaces with pod counts and resource usage.",operationId:"listKubernetesNamespaces",tags:["public","kubernetes-explorer"],method:"GET",url:`${Ls}/namespaces`,paginated:!0,query:Mg(UF),response:n.Array(fse)}),Rse=f({description:"Lists Kubernetes (k8s) nodes with readiness, instance type and resource usage against allocatable capacity.",operationId:"listKubernetesNodes",tags:["public","kubernetes-explorer"],method:"GET",url:`${Ls}/nodes`,paginated:!0,query:Mg(RF),response:n.Array(gse)}),Pse=f({description:"Lists Kubernetes (k8s) deployments with replica counts and resource usage. For rollout history, get the deployment details.",operationId:"listKubernetesDeployments",tags:["public","kubernetes-explorer"],method:"GET",url:`${Ls}/deployments`,paginated:!0,query:Mg(vF),response:n.Array(hse)}),Use=f({description:"Lists Kubernetes (k8s) StatefulSets with replica counts and resource usage.",operationId:"listKubernetesStatefulSets",tags:["public","kubernetes-explorer"],method:"GET",url:`${Ls}/statefulsets`,paginated:!0,query:Mg(kF),response:n.Array(yse)}),wse=f({description:"Lists Kubernetes (k8s) DaemonSets with eligible-node readiness and resource usage.",operationId:"listKubernetesDaemonSets",tags:["public","kubernetes-explorer"],method:"GET",url:`${Ls}/daemonsets`,paginated:!0,query:Mg(MF),response:n.Array(Ese)}),lse=100,yje=n.Object({...xse.properties,...n.Pick(BF,["clusters","namespaces","resourceKinds","types","includeInternalNamespaces"]).properties,limit:n.Optional(n.Integer({minimum:1,maximum:RR,default:lse,description:`Maximum number of events to return, newest first. Defaults to ${lse}. Valid values are 1 through ${RR}.`}))}),vse=f({description:`Lists Kubernetes (k8s) events of the last ${pse/rM} hours, newest first, such as BackOff or FailedScheduling warnings, with type, reason, message and the resource concerned. Reads the latest ${RR} event observations; \`search\` matches the resource name.`,operationId:"listKubernetesEvents",tags:["public","kubernetes-explorer"],method:"GET",url:`${Ls}/events`,query:yje,response:n.Array(Ise)}),Nse=n.Object({...bse.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."})}),kse=f({description:"Returns one Kubernetes pod's status, owning workload, CPU and memory metric names, and ready-to-use log and trace filters. The pod manifest endpoint serves its manifest, labels and annotations.",operationId:"getKubernetesPodDetails",tags:["public","kubernetes-explorer"],method:"GET",url:`${Ls}/pod-details`,query:Nse,response:Tse}),Lse=f({description:"Returns one Kubernetes pod's manifest from its latest observation: the pod spec (containers, resource requests and limits), labels and annotations.",operationId:"getKubernetesPodManifest",tags:["public","kubernetes-explorer"],method:"GET",url:`${Ls}/pod-manifest`,query:Nse,response:Sse}),Mse=f({description:"Returns one Kubernetes deployment's replica status, backing pods and rollout revisions, with ready-to-use log filters.",operationId:"getKubernetesDeploymentDetails",tags:["public","kubernetes-explorer"],method:"GET",url:`${Ls}/deployment-details`,query:n.Object({...bse.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:_se});var Eje="clusterId";function Tr(e,t,r){let o=Tje(t,r);return P(e,o,N(`cli.${t.operationId??e}`)(function*(i){let s=i,a={};for(let u of Object.keys(o)){let l=Lne(s,u);l!==void 0&&(a[u]=l)}yield*Oe(yield*Xe(t,Object.keys(a).length>0?{query:a}:void 0))})).pipe(U(t.description??e))}function Tje(e,t){let r=kne(e.query),o={};for(let i of Object.keys(r)){if(i===Eje)continue;let s=i.replace(/([A-Z])/g,"-$1").toLowerCase(),a=s.replace(/-/g,"_").toUpperCase(),u=je(s).pipe(re(r[i]?.description??""),_e(a));o[i]=t?u:u.pipe(tt)}return o}var Dse=Tr("clusters",Ase,!1);var Fse=Tr("daemonsets",wse,!1);var $se=Tr("deployment-details",Mse,!0);var Gse=Tr("deployments",Pse,!1);var Bse=Tr("events",vse,!1);var jse=Tr("namespaces",Cse,!1);var qse=Tr("nodes",Rse,!1);var Hse=Tr("pod-details",kse,!0);var Kse=Tr("pod-manifest",Lse,!0);var zse=Tr("pods",Ose,!1);var Yse=Tr("statefulsets",Use,!1);var Vse=P("kubernetes").pipe(U("Explore Kubernetes resources observed across the organization"),xe([zse,Dse,jse,qse,Gse,Yse,Fse,Bse,Hse,Kse,$se]));var Wse=P("attributes",{...Xt,search:je("search").pipe(re("Only list dot-paths containing this text, case-insensitively (e.g. k8s or http.status)"),_e("TEXT"),tt)},N("cli.logs.attributes")(function*(e){let{attributes:t}=yield*rr(wJ,{query:yn({...yield*Wr(e),search:ue(e.search)})});yield*Oe({data:t})})).pipe(U("List log attribute dot-paths observed in the time range"));var UR=je("env").pipe(re("Filter by environment"),_e("ENV_NAME"),tt);var Sje=["team","env","pattern"],Qse=P("error-pattern-increases",{...Xt,team:je("team").pipe(re("Team to query"),_e("TEAM_NAME")),env:UR,pretty:_o},N("cli.logs.errorPatternIncreases")(function*(e){let t=yield*fn,{errorPatternIncreases:r}=yield*rr(PJ,{query:yn({...yield*Wr(e),team:e.team,env:ue(e.env)})});yield*t.rows(r,{...e,defaultFields:Sje})})).pipe(U("List error pattern increases for a given team"));var _je=["team","env","service","firstSeen","lastSeen"],Ije=je("team").pipe(re("Filter by team"),_e("TEAM_NAME"),tt),Zse=P("new-error-patterns",{...Xt,team:Ije,env:UR,service:je("service").pipe(re("Filter by service"),_e("SERVICE_NAME"),tt),pretty:_o},N("cli.logs.newErrorPatterns")(function*(e){let t=yield*fn,{newErrorPatterns:r}=yield*rr(CJ,{query:yn({...yield*Wr(e),team:ue(e.team),env:ue(e.env),service:ue(e.service)})});yield*t.rows(r,{...e,defaultFields:_je})})).pipe(U("List error patterns first seen in this time range"));var bje=["count","ratio","team","level","pattern"];function xje(e,t){let r={count:e.size,sampleSize:t,ratio:t>0?e.size/t:0,pattern:e.pattern};for(let{key:o,value:i}of e.groups)r[o==="context.team"?"team":o]=i;return r}var Xse=P("patterns",{...Xt,query:Cp.pipe(re("Tsuga query to filter logs before clustering into patterns")),pretty:_o},N("cli.logs.patterns")(function*(e){let t=yield*fn,r=yield*rr(OJ,{query:yn({...yield*Wr(e),query:yield*vd("query",e.query)})}),{patterns:o,sampleSize:i}=r,s=o.map(a=>xje(a,i));yield*t.rows(s,{...e,defaultFields:bje})})).pipe(U("List log patterns"));var Oje=k(function*(e){if(e===void 0)return;let t=ue(e);if(t!==void 0)return t;let r=yield*vd("max-results",z());if(r===void 0)return;let o=Number(r);return!Number.isSafeInteger(o)||o<=0?yield*new At({message:`The saved default for max-results must be a positive safe integer (got: ${r}). Fix it with \`tsuga config set default max-results --value <N>\`.`}):o}),Dg=k(function*(e){let t=e.query===void 0?void 0:yield*vd("query",e.query),r=yield*Oje(e.maxResults);return yn({...yield*Wr(e),query:t,maxResults:r})});var Aje=["timestamp","level","message"],Jse=P("search",{...Xt,query:Cp,maxResults:Rg,pretty:_o},N("cli.logs.search")(function*(e){let t=yield*fn,r=yield*rr(bT,{query:yield*Dg(e)}),{logs:o}=r;yield*t.rows(o,{...e,defaultFields:Aje})})).pipe(U("Search logs"));var eae=P("logs").pipe(U("Search and analyze logs"),xe([Jse,Wse,Xse,Zse,Qse]));var jF=`/${"v1"}/metrics`,qF=n.Object({name:n.String({description:"Metric name observed by Tsuga. Use this value in metric queries and aggregations."}),type:QA,description:n.Optional(n.String({description:"Human-readable description of what the metric measures, set by the reporting instrumentation. Omitted when the instrumentation did not provide one."})),unit:n.Optional(n.String({description:"Metric unit reported by instrumentation or inferred metadata."})),temporality:n.Optional(ZA),capabilities:n.Optional(n.Array(n.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:n.Optional(n.Array(n.String(),{description:"Metric attribute names available as dimensions for filtering or grouping."})),seriesCardinality:n.Optional(XA),attributeCardinalities:n.Optional(n.Record(n.String(),n.Number(),{description:"Estimated number of distinct values per attribute over the same window as `seriesCardinality`, keyed like `attributes`. Omitted when the catalog has no statistics for the metric yet."}))}),tae={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"],seriesCardinality:1250,attributeCardinalities:{"context.team":4,"context.environment":3,"context.region":12}};Object.assign(qF,{examples:[tae]});var rae=n.Omit(qF,["attributes","attributeCardinalities"]);Object.assign(rae,{examples:[mC(tae,["attributes","attributeCardinalities"])]});var nae=n.Object({from:hd("Unix timestamp in seconds. Required, but does not scope the result."),to:hd("Unix timestamp in seconds. Required, but does not scope the result."),clusterId:n.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. The time range is required but does not scope the result, which comes from a cluster-wide catalog of metric names. Optionally takes a cluster ID."}),oae=f({description:"Lists or searches metric names with type, unit, temporality and estimated series cardinality, to find the metric to query. Metrics come from OpenTelemetry, Prometheus or cloud provider integrations (AWS CloudWatch, GCP Cloud Monitoring, Azure Monitor). `search` keeps the names containing a substring. `from` and `to` are required but do not scope the result, and a name stays listed after the metric stops reporting; to check for data in a window, run a `count` aggregation. Get one metric for its attributes. See [Metrics](/documentation/explore/metrics/index).",operationId:"listMetrics",tags:["public","metrics"],url:jF,method:"GET",paginated:!0,query:n.Object({...nae.properties,...Ye,search:n.Optional(p({allowEmpty:!1,description:"Keep only metric names containing this value, matched case-insensitively."}))}),response:n.Array(rae)}),iae=f({description:"Returns one metric's metadata: its attributes (labels, dimensions, tags) with estimated cardinality, type, unit and supported query behavior. `from` and `to` are required but do not scope the result: it reads a cluster-wide catalog whose cardinalities are periodically refreshed estimates. See [Metric details](/documentation/explore/metrics/metric-details).",operationId:"getMetric",tags:["public","metrics"],url:`${jF}/:name`,method:"GET",params:n.Object({name:p({allowEmpty:!1,description:"Metric name to retrieve, for example `http.server.request.duration`."})}),query:nae,response:qF}),Cje=["service","env","host","method","status_code"];Object.assign(gT,{examples:[Cje]});var sae=n.Pick(IM,["assets"]),Rje={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(sae,{examples:[Rje]});var aae=f({description:"Lists the dashboards and monitors whose queries use a metric, before renaming or dropping it. An empty result does not prove the metric unused: PromQL widgets, SLOs and assets the caller cannot read are not covered. See [How to find which assets use a metric](/documentation/explore/guides/how-to-find-which-assets-use-a-metric).",operationId:"getMetricAssetsUsage",tags:["public","metrics"],url:`${jF}/assets-usage`,method:"GET",query:n.Object({metricName:p({allowEmpty:!1,description:"Metric name to look up, for example `http.server.request.duration`."})}),response:sae});var cae=P("assets-usage",{name:Er("METRIC_NAME").pipe(jt("The metric to look up"))},N("cli.metrics.assetsUsage")(function*({name:e}){yield*Oe(yield*Xe(aae,{query:{metricName:e}}))})).pipe(U("List dashboards and monitors that use a specific metric"));var uae=P("get",{name:Er("METRIC_NAME").pipe(jt("The metric to retrieve")),...Xt},N("cli.metrics.get")(function*(e){yield*Oe(yield*Xe(iae,{params:{name:e.name},query:yield*Wr(e)}))})).pipe(U("Retrieve a metric by name with its metadata"));var pae=P("list",{...Xt,...Rp,search:je("search").pipe(re("Keep only metric names containing this text (case-insensitive)"),_e("TEXT"),tt)},N("cli.metrics.list")(function*(e){let t=yn({limit:ue(e.limit),offset:ue(e.offset),search:ue(e.search),...yield*Wr(e)});yield*Oe(yield*Xe(oae,{query:t,allPages:e.all}))})).pipe(U("List metrics with their metadata, sorted by name and paged"));var lae=P("metrics").pipe(U("List and inspect metrics"),xe([pae,uae,cae]));var Pje="/v0/profiles",Uje=["cpu","samples","sample","wall","offcpu","space","inuse_space","objects","inuse_objects","alloc_space","alloc_objects","goroutine"],wje=20,oS={service:p({allowEmpty:!1,description:"Service the profiles belong to, as it appears in `profile.{type}.{service}`."}),type:n.Enum(Uje,{description:"pprof sample type."}),filter:n.Optional(p({type:"tsuga-query",description:"TQL over the profile labels. Only label equality, negation and wildcards are accepted."})),groupBy:n.Optional(n.Array(p({allowEmpty:!1}),{description:"Labels to split the flamegraph by. The stack itself cannot be a group-by."})),limit:n.Optional(n.Integer({minimum:1,default:wje,description:"Maximum number of groups, ranked by total value."})),minFraction:n.Optional(n.Number({minimum:0,maximum:1,description:"Nodes below this share of the root total fold into their parent."}))},dgr=f({tags:["profiles"],url:`${Pje}/query`,method:"POST",body:n.Object({...oS,timeRange:vo,clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster to target. Defaults to the first cluster created in the organization when omitted."}))}),response:ig});var dae=`/${"v1"}/profiles`,mae=n.Object({...oS,timeRange:nn},{description:"Profile query request. Send clusterId as a query parameter, not in this JSON body.",examples:[{service:"api",type:"cpu",timeRange:{from:1782201500,to:1782203400},filter:"context.env:prod"}]}),vje=n.Object({stacks:n.Array(n.Object({stack:n.String({description:"Frames from the root to the leaf, joined with `;` (folded stack format)."}),group:n.Record(n.String(),n.String(),{description:"Group-by label values for this stack. Empty when no group-by is requested."}),value:n.Number({description:"Total sample value of this stack, in the unit of the profile type."})}),{description:"One entry per distinct leaf stack, after folding nodes below minFraction."})},{examples:[{stacks:[{stack:"main;handleRequest;encodeJson",group:{},value:125e7},{stack:"main;handleRequest;queryDb",group:{},value:8e8}]}]}),wR=f({description:"Aggregates continuous profiling samples for a service into folded stacks, optionally split by profile labels.",tags:["private"],url:`${dae}/query`,method:"POST",body:mae,query:Xi,response:vje}),Nje=n.Object({pprof:n.String({description:"Merged pprof profile, base64-encoded (standard alphabet, padded)."})}),fae=f({description:"Merges continuous profiling samples for a service into a single pprof profile.",tags:["private"],url:`${dae}/pprof`,method:"POST",body:mae,query:Xi,response:Nje});var gae=N("output.printBytes")(function*(e){let t=yield*Ym;yield*cb(lH(e),t.stdout()).pipe(st(r=>new Gn({message:`Could not write stdout: ${r.message}`})))});var vR={service:je("service").pipe(re("Service the profiles belong to"),_e("SERVICE_NAME")),type:Nx("type",oS.type.enum).pipe(re("Profile type"),_e("PROFILE_TYPE")),...Xt,filter:je("filter").pipe(re("Tsuga query over profile labels (equality, negation, wildcards)"),_e("TSUGA_QUERY"),tt)},NR=k(function*(e){let t=ue(e.filter);return{service:e.service,type:e.type,timeRange:yield*Wr(e),...t===void 0?{}:{filter:t}}});var hae=P("pprof",{...vR,outputFile:je("output-file").pipe(pa("O"),re("Write the profile to this file instead of stdout"),_e("FILE_PATH"),tt)},N("cli.profiles.pprof")(function*(e){let t=ue(e.outputFile);if(t===void 0&&(yield*pT))return yield*new At({message:"Refusing to write a binary profile to the terminal. Use --output-file <FILE_PATH> or pipe stdout."});let r=yield*rr(fae,{body:yield*NR(e)}),o=Buffer.from(r.pprof,"base64");if(t===void 0){yield*gae(o);return}yield*(yield*rn).writeFile(t,o).pipe(st(s=>new Gn({message:`Could not write ${t}: ${s.message}`})))})).pipe(U("Download a merged pprof profile (raw protobuf, not gzipped)"));var yae=jn("query","Run a raw profile query and print the folded stacks",wR);var kje=30,Lje=["flat","flatPercent","cum","cumPercent","function"],Eae=P("top",{...vR,limit:lf("limit").pipe(re("Maximum number of functions to print"),_e("COUNT"),xn(kje)),pretty:_o},N("cli.profiles.top")(function*(e){let t=yield*fn;if(e.limit<1)return yield*new At({message:`--limit must be a positive integer (got: ${e.limit})`});let r=yield*rr(wR,{body:yield*NR(e)}),{total:o,functions:i}=Mje(r.stacks),s=i.slice(0,e.limit).map(a=>({...a,total:o}));yield*t.rows(s,{...e,defaultFields:Lje})})).pipe(U("Rank functions by self (flat) and inclusive (cum) sample value, like pprof -top"));function Mje(e){let t=new Map,r=new Map,o=0;for(let{stack:a,value:u}of e){let l=a.split(";"),d=l[l.length-1];if(d!==void 0){o+=u,t.set(d,(t.get(d)??0)+u);for(let g of new Set(l))r.set(g,(r.get(g)??0)+u)}}let i=a=>o===0?0:Math.round(a/o*1e4)/100,s=[...r.entries()].map(([a,u])=>{let l=t.get(a)??0;return{function:a,flat:l,flatPercent:i(l),cum:u,cumPercent:i(u)}}).sort((a,u)=>u.flat-a.flat||u.cum-a.cum||a.function.localeCompare(u.function));return{total:o,functions:s}}var Tae=P("profiles").pipe(U("Query continuous profiling data"),xe([Eae,hae,yae]));var Sae=jn("query","Run a PromQL range query over metric data",SC);var _ae=P("promql").pipe(U("Run PromQL queries over metric data"),xe([Sae]));var Io="/v0/monitors",bae=["alert","resolve","keep_last_status","consider_zero"],xae=["alert","resolve","keep_last_status"];var Oae=["no_aggregation","all","any","each","proportion"],Aae=["greater_than","less_than","equal","not_equal","greater_than_or_equal","less_than_or_equal"];var Dje=n.Object({formula:n.String({description:"Formula result to compare against the threshold, usually `q1` or a formula alias."}),operator:n.Enum(Aae,{description:"Comparison operator used to evaluate the threshold condition."}),threshold:n.Number({description:"Numeric threshold value used by the comparison. May be negative when the formula result can be below zero."})}),Fje=n.Object({formula:p({type:"tsuga-formula",description:"Formula result to compare against the threshold, usually `q1` or a formula alias."}),operator:n.Enum(Aae,{description:"Comparison operator used to evaluate the threshold condition."}),threshold:n.Number({description:"Numeric threshold value used by the comparison. May be negative when the formula result can be below zero."})}),$je=5,Gje=n.Array(Dje,{description:"Threshold conditions evaluated against query and formula results. All listed conditions must match for a non-grouped threshold monitor to alert."}),Bje=n.Array(Fje,{minItems:1,maxItems:$je,description:"Threshold conditions evaluated against query and formula results. All listed conditions must match for a non-grouped threshold monitor to alert."}),jje=n.Object({formula:n.String({description:"Formula result analyzed for anomalous behavior, usually `q1` or a formula alias."}),conditionType:n.Enum(["rate","error","cpu","general","to_be_set"],{description:"Anomaly model type 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`."}),qje=n.Object({formula:p({type:"tsuga-formula",description:"Formula result analyzed for anomalous behavior, usually `q1` or a formula alias."}),conditionType:n.Enum(["rate","error","cpu","general","to_be_set"],{description:"Anomaly model type used to classify expected behavior: `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`."}),En=[1,2,3,4,5];var Hje=4;var Cae={timeframe:n.Number({description:"Lookback window, in minutes, that each query-backed threshold monitor evaluation aggregates over. Always a whole number, at least 1."}),groupByFields:n.Array(n.Object({fields:n.Array(n.String(),{description:"Attribute names the monitor splits results by, evaluating each resulting group independently. Empty means the monitor evaluates a single ungrouped series."}),limit:n.Number({description:"Maximum number of groups evaluated per field. Anomaly monitors apply it, capped at 100. Threshold monitors ignore it and evaluate up to 100 groups per field."}),sortOrder:n.Optional(me),replaceNullWith:n.Optional(n.String({description:"Value used to group documents that have no value for a grouped field."}))}),{description:"Monitor group by configuration."}),aggregationAlertLogic:n.Optional(n.Enum(Oae,{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:n.Optional(n.Integer({description:"Percentage threshold used when `aggregationAlertLogic` is `proportion`."}))},Rae={timeframe:n.Integer({minimum:1,description:"Lookback window, in minutes, that each query-backed threshold monitor evaluation aggregates over."}),groupByFields:n.Array(n.Object({fields:n.Array(p(),{maxItems:Hje,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:n.Number({description:"Maximum number of groups evaluated per field. Anomaly monitors apply it, capped at 100. Threshold monitors ignore it and evaluate up to 100 groups per field."}),sortOrder:n.Optional(me),replaceNullWith:n.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."}),aggregationAlertLogic:n.Optional(n.Enum(Oae,{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`. With `groupByFields`, send `each` so every group opens and resolves its own alert, as the app does by default; `all`, `any`, and `proportion` raise one alert for the whole monitor. On create, omitted query-monitor values default to `no_aggregation`; on update, omitted values keep the existing aggregation logic."})),proportionAlertThreshold:n.Optional(n.Integer({minimum:1,maximum:99,description:"Percentage threshold used when `aggregationAlertLogic` is `proportion`."}))},Kje={...Cae,timeframe:n.Number({description:"Lookback window, in minutes, that each anomaly monitor evaluation aggregates over. Always a whole number from 5 through 1440."})},zje={...Rae,timeframe:n.Integer({minimum:5,maximum:1440,description:"Lookback window, in minutes, that each anomaly monitor evaluation aggregates over."})},Yje=10,Vje=4320,Pae=`Number of consecutive \`timeframe\`-minute windows, ending at evaluation time, that must all meet the conditions before the monitor alerts, per group for grouped monitors. 1 or omitted checks a single window. A window that does not meet the conditions breaks the run. An empty window, such as a query with \`fill.mode.type\` \`null\` returning nothing, breaks the run under \`noDataBehavior\` \`alert\` or \`resolve\`, takes the previous window's result under \`keep_last_status\`, and counts as 0 under \`consider_zero\`. A query without \`fill\` counts an empty window as 0. When every window is empty (with \`keep_last_status\`, when the oldest is empty and none breaks the run), \`noDataBehavior\` applies as for a single window. Above 1, \`consecutiveWindows\` \xD7 \`timeframe\` must not exceed ${Vje} minutes (3 days).`,Wje=n.Optional(n.Integer({description:Pae})),Qje=n.Optional(n.Integer({minimum:1,maximum:Yje,description:Pae})),Uae="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.",wae="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.",vae=MR({type:"metric",description:"Threshold monitor over metric aggregations.",$id:"MonitorConfigurationMetric"}),Zje=DR({type:"metric",description:"Threshold monitor over metric aggregations.",$id:"InputMonitorConfigurationMetric"}),Nae=MR({type:"log",description:"Threshold monitor over log aggregations.",$id:"MonitorConfigurationLog"}),Xje=DR({type:"log",description:"Threshold monitor over log aggregations.",$id:"InputMonitorConfigurationLog"}),kae=MR({type:"trace",description:"Threshold monitor over trace aggregations.",$id:"MonitorConfigurationTrace"}),Jje=DR({type:"trace",description:"Threshold monitor over trace aggregations.",$id:"InputMonitorConfigurationTrace"}),Lae=MR({type:"rum",description:"Threshold monitor over RUM aggregations.",$id:"MonitorConfigurationRum"}),e2e=DR({type:"rum",description:"Threshold monitor over RUM aggregations. The monitor reads a single RUM stream: fields in `queries` and `groupByFields` that carry a stream prefix (`events.`, `measurements.` or `exceptions.`) must all name the same stream, and unprefixed fields are read from that stream (`events` when no field names one).",$id:"InputMonitorConfigurationRum"}),Mae=FR({type:"anomaly-log",description:"Anomaly monitor over log aggregations.",$id:"MonitorConfigurationAnomalyLog"}),t2e=$R({type:"anomaly-log",description:"Anomaly monitor over log aggregations.",$id:"InputMonitorConfigurationAnomalyLog"}),Dae=FR({type:"anomaly-metric",description:"Anomaly monitor over metric aggregations.",$id:"MonitorConfigurationAnomalyMetric"}),r2e=$R({type:"anomaly-metric",description:"Anomaly monitor over metric aggregations.",$id:"InputMonitorConfigurationAnomalyMetric"}),Fae=FR({type:"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.",$id:"MonitorConfigurationAnomalyTrace"}),n2e=$R({type:"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.",$id:"InputMonitorConfigurationAnomalyTrace"}),$ae=FR({type:"anomaly-rum",description:"Anomaly monitor over RUM aggregations. Use this configuration when Tsuga should learn historical RUM query behavior and alert on unusual movement in RUM-derived values.",$id:"MonitorConfigurationAnomalyRum"}),o2e=$R({type:"anomaly-rum",description:"Anomaly monitor over RUM aggregations. Set this value to create or update an anomaly monitor that learns historical RUM query behavior and alerts on unusual movement in RUM-derived values. The monitor reads a single RUM stream: fields in `queries` and `groupByFields` that carry a stream prefix (`events.`, `measurements.` or `exceptions.`) must all name the same stream, and unprefixed fields are read from that stream (`events` when no field names one).",$id:"InputMonitorConfigurationAnomalyRum"}),Gae=n.Object({type:n.Literal("certificate-expiry",{description:"Monitor that alerts before discovered certificates expire."}),warnBeforeInDays:n.Integer({description:"Number of days before certificate expiry when the monitor should warn."}),cloudAccounts:n.Optional(n.Array(n.String(),{description:"Cloud account IDs whose certificates are checked. Omitted means certificates from all cloud accounts are checked."})),aggregationAlertLogic:n.Literal("each",{description:"Certificate expiry monitors alert independently for each certificate."}),noDataBehavior:n.Literal("resolve",{description:"Certificate expiry monitors resolve when matching certificate data disappears."})},{$id:"MonitorConfigurationCertificateExpiry"}),i2e=n.Object({type:n.Literal("certificate-expiry",{description:"Monitor that alerts before discovered certificates expire."}),warnBeforeInDays:n.Integer({minimum:1,maximum:365,description:"Number of days before certificate expiry when the monitor should warn. Valid values are 1 through 365."}),cloudAccounts:n.Optional(n.Array(n.String(),{minItems:1,description:"Cloud account IDs whose certificates are checked. Omit to check certificates from all cloud accounts."})),aggregationAlertLogic:n.Literal("each",{description:"Certificate expiry monitors alert independently for each certificate."}),noDataBehavior:n.Literal("resolve",{description:"Certificate expiry monitors resolve when matching certificate data disappears."})},{$id:"InputMonitorConfigurationCertificateExpiry"}),Bae="When `true`, every new error pattern alerts on the next evaluation, even if it appeared in a single log. When `false` or omitted, a new pattern alerts only once it has lasted at least 5 minutes and matched at least 20 logs, which filters out one-off errors.",s2e=n.Object({type:n.Literal("log-error-pattern",{description:"Monitor that alerts on newly detected log error patterns for the configured environment, scoped by teams, services, or both. Recovery notifications are not sent for this monitor type."}),aggregationAlertLogic:n.Literal("each",{description:"Fixed aggregation logic for log error pattern monitors. Each new pattern is evaluated as its own alert group."}),noDataBehavior:n.Literal("keep_last_status",{description:"Fixed no-data behavior for log error pattern monitors. Pattern state is kept until inactive pattern groups expire."}),filter:n.Object({teamIds:n.Optional(n.Array(n.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:n.String({description:"Environment whose logs are searched for new error patterns."}),services:n.Optional(n.Array(n.String(),{description:"Service names whose logs are searched for new error patterns."}))},{description:"Log selection used for new error pattern detection. All configured fields must match for logs to be included, so sending both teams and services searches only the listed services owned by the listed teams. Send a non-empty `teamIds`, a non-empty `services`, or both."}),alertOnFirstOccurrence:n.Optional(n.Boolean({description:Bae}))},{$id:"MonitorConfigurationLogErrorPattern"}),a2e=n.Object({type:n.Literal("log-error-pattern",{description:"Monitor that alerts on newly detected log error patterns for the configured environment, scoped by teams, services, or both. Recovery notifications are not sent for this monitor type."}),aggregationAlertLogic:n.Literal("each",{description:"Fixed aggregation logic for log error pattern monitors. Each new pattern is evaluated as its own alert group."}),noDataBehavior:n.Literal("keep_last_status",{description:"Fixed no-data behavior for log error pattern monitors. Pattern state is kept until inactive pattern groups expire."}),filter:n.Object({teamIds:n.Optional(n.Array(p({allowEmpty:!1}),{description:"Team IDs whose logs are searched for new error patterns. Tsuga resolves these team IDs to team names when exporting monitor assets.",minItems:1})),env:p({allowEmpty:!1,description:"Environment whose logs are searched for new error patterns."}),services:n.Optional(n.Array(p({allowEmpty:!1}),{description:"Service names whose logs are searched for new error patterns.",minItems:1}))},{description:"Log selection used for new error pattern detection. All configured fields must match for logs to be included, so sending both teams and services searches only the listed services owned by the listed teams. Send a non-empty `teamIds`, a non-empty `services`, or both."}),alertOnFirstOccurrence:n.Optional(n.Boolean({description:Bae}))},{$id:"InputMonitorConfigurationLogErrorPattern"}),jae=n.Object({type:n.Literal("log-error-pattern-increase",{description:"Monitor that alerts when the volume of an existing log error pattern increases sharply for the configured teams and environment."}),aggregationAlertLogic:n.Literal("each",{description:"Fixed aggregation logic for log error pattern increase monitors. Each pattern whose volume increased is evaluated as its own alert group."}),noDataBehavior:n.Literal("resolve",{description:"Fixed no-data behavior for log error pattern increase monitors. A pattern group resolves once its volume stops increasing."}),filter:n.Object({teamIds:n.Optional(n.Array(n.String(),{description:"Team IDs whose error logs are watched for volume increases. Tsuga resolves these team IDs to team names when exporting monitor assets. Omit to watch every team, in which case a service scope is required."})),env:n.String({description:"Environment whose error logs are watched for volume increases."}),services:n.Optional(n.Array(n.String(),{description:"Service names whose error logs are watched for volume increases. Omit to watch every service matching the team and environment scope."}))},{description:"Log selection used for error pattern increase detection. All configured fields must match for logs to be included."})},{$id:"MonitorConfigurationLogErrorPatternIncrease"}),c2e=n.Object({type:n.Literal("log-error-pattern-increase",{description:"Monitor that alerts when the volume of an existing log error pattern increases sharply for the configured teams and environment."}),aggregationAlertLogic:n.Literal("each",{description:"Fixed aggregation logic for log error pattern increase monitors. Each pattern whose volume increased is evaluated as its own alert group."}),noDataBehavior:n.Literal("resolve",{description:"Fixed no-data behavior for log error pattern increase monitors. A pattern group resolves once its volume stops increasing."}),filter:n.Object({teamIds:n.Optional(n.Array(p({allowEmpty:!1}),{minItems:1,description:"Team IDs whose error logs are watched for volume increases. Tsuga resolves these team IDs to team names when exporting monitor assets. Omit to watch every team, in which case `services` is required."})),env:p({allowEmpty:!1,description:"Environment whose error logs are watched for volume increases."}),services:n.Optional(n.Array(p({allowEmpty:!1}),{minItems:1,description:"Service names whose error logs are watched for volume increases. Omit to watch every service matching the team and environment scope."}))},{description:"Log selection used for error pattern increase detection. All configured fields must match for logs to be included."})},{$id:"InputMonitorConfigurationLogErrorPatternIncrease"}),qae={type:n.Literal("k8s-faulty-deployment",{description:"Monitor that alerts when a Kubernetes workload (Deployment, StatefulSet, or DaemonSet) keeps failing right after a rollout."}),aggregationAlertLogic:n.Literal("each",{description:"Fixed aggregation logic for Kubernetes faulty deployment monitors. Each faulty workload revision is evaluated as its own alert group."})},u2e=["replicaSet","statefulSet","daemonSet"],Hae=n.Enum(u2e,{description:"Kubernetes workload type: `replicaSet` (Deployment rollouts), `statefulSet`, or `daemonSet`."}),Kae=n.Object({...qae,filter:n.Object({clusterNames:n.Optional(n.Array(n.String(),{description:"Kubernetes cluster names to watch. Omit to watch every cluster."})),namespaces:n.Optional(n.Array(n.String(),{description:"Kubernetes namespaces to watch. Omit to watch every namespace."})),envs:n.Optional(n.Array(n.String(),{description:"Environments to watch. Omit to watch every environment."})),workloadTypes:n.Optional(n.Array(Hae,{description:"Kubernetes workload types to watch. Omit to watch every workload type."}))},{description:"Workload selection used for faulty deployment detection. All configured fields must match for a workload to be watched."})},{$id:"MonitorConfigurationK8sFaultyDeployment"}),p2e=n.Object({...qae,filter:n.Object({clusterNames:n.Optional(n.Array(p({allowEmpty:!1}),{minItems:1,description:"Kubernetes cluster names to watch. Omit to watch every cluster."})),namespaces:n.Optional(n.Array(p({allowEmpty:!1}),{minItems:1,description:"Kubernetes namespaces to watch. Omit to watch every namespace."})),envs:n.Optional(n.Array(p({allowEmpty:!1}),{minItems:1,description:"Environments to watch. Omit to watch every environment."})),workloadTypes:n.Optional(n.Array(Hae,{minItems:1,uniqueItems:!0,description:"Kubernetes workload types to watch. Omit to watch every workload type."}))},{description:"Workload selection used for faulty deployment detection. All configured fields must match for a workload to be watched. Send an empty object to watch every workload."})},{$id:"InputMonitorConfigurationK8sFaultyDeployment"}),zae={type:n.Literal("faulty-deployment",{description:"Monitor that alerts when Tsuga faulty deployment detection flags a newly deployed service version as faulty."}),aggregationAlertLogic:n.Literal("each",{description:"Fixed aggregation logic for faulty deployment monitors. Each faulty service version in an environment is evaluated as its own alert group."})},Yae=n.Object({...zae,filter:n.Object({services:n.Optional(n.Array(n.String(),{description:"Service names to watch. Omit to watch every service."})),envs:n.Optional(n.Array(n.String(),{description:"Environments to watch. Omit to watch every environment."}))},{description:"Deployment selection used for faulty deployment detection. All configured fields must match for a deployment to be watched."})},{$id:"MonitorConfigurationFaultyDeployment"}),l2e=n.Object({...zae,filter:n.Object({services:n.Optional(n.Array(p({allowEmpty:!1}),{minItems:1,description:"Service names to watch. Omit to watch every service."})),envs:n.Optional(n.Array(p({allowEmpty:!1}),{minItems:1,description:"Environments to watch. Omit to watch every environment."}))},{description:"Deployment selection used for faulty deployment detection. All configured fields must match for a deployment to be watched. Send an empty object to watch every deployment."})},{$id:"InputMonitorConfigurationFaultyDeployment"}),d2e=D("type",[vae,Nae,kae,Lae,Mae,Dae,s2e,jae,Fae,$ae,Gae,Kae,Yae],{description:"Monitor evaluation configuration. The `type` discriminator determines which telemetry source, condition shape, and evaluation rules Tsuga uses."}),m2e=D("type",[Zje,Xje,Jje,e2e,t2e,r2e,n2e,o2e,a2e,c2e,i2e,p2e,l2e],{description:"Monitor evaluation configuration. The `type` discriminator determines which telemetry source, condition shape, and evaluation rules Tsuga uses."});var Lp=n.Object({id:n.String({description:"Tsuga-generated monitor ID assigned when the monitor is created."}),name:n.String({description:"Display name of the monitor and alert source."}),owner:n.String({description:"Team ID that owns and manages the monitor."}),message:n.Optional(n.String({description:"Caller-supplied message included in notifications triggered by this monitor. Omitted when the monitor was created or last updated without one."})),tags:kt,configuration:d2e,priority:n.Enum(En,{description:"Monitor priority from 1 through 5, where 1 is highest priority."}),permissions:ws,dashboardId:n.Optional(n.String({description:"ID of the dashboard linked to this monitor for context when investigating alerts. Caller-supplied. Omitted when no dashboard is linked."})),folderId:n.Optional(n.String({description:"ID of the monitor folder containing this monitor. Omitted for unfiled monitors."})),pauseUntil:n.Optional(v({description:"Timestamp until which the monitor is snoozed. Omitted when the monitor is not snoozed."})),creator:n.Optional(be),updater:n.Optional(be),createdAt:v({description:"Timestamp when Tsuga created the monitor."}),updatedAt:v({description:"Timestamp when Tsuga last updated the monitor."}),assetUpdatedAt:v({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."}),clusterIds:n.Array(n.String(),{description:"Cluster IDs where the monitor is deployed. Empty means all eligible clusters."})},{title:"Monitor"}),HF=D("type",[vae,Nae,kae,Lae,Mae,Dae,Fae,$ae,Gae,jae,Kae,Yae]),uhr=n.Object({...Lp.properties,configuration:HF},{title:"Monitor"}),iS=n.Object({name:p({description:"Display name of the monitor and alert source."}),message:Qe(p({type:"long"}),{description:"Message included in notifications triggered by this monitor. Optional on create."}),tags:qt,configuration:m2e,priority:n.Enum(En,{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:Qe(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."}),folderId:Qe(p({allowEmpty:!1}),{description:"Folder to organize this monitor in. Omit on create or send null to leave it unfiled; omit on update to keep its folder, or send null to remove it. A non-null ID must name a readable monitor folder. Assignment does not change ownership, data access, or evaluation state."}),pauseUntil:Qe(p({allowEmpty:!1,type:"date-time"}),{description:"ISO timestamp until which the monitor is snoozed. Must be in the future and at most one month from now. On create: omit or send `null` to leave the monitor active. On update: omit to keep the current snooze, send `null` to clear it."}),permissions:ws,clusterIds:n.Optional(n.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."}))}),Iae=["threshold","certificate-expiry","anomaly-detection","log-error-pattern","log-error-pattern-increase","k8s-faulty-deployment","faulty-deployment"],kp={PRIORITY:"priority",TYPE:"type",NAME:"name",OWNER:"owner",TAGS:"tags",CLUSTER_IDS:"clusterIds",PAUSE_UNTIL:"pauseUntil",ASSET_UPDATED_AT:"assetUpdatedAt"};var kR=["active","snoozed"],KF=n.Object({folderId:n.Union([n.Null(),p({allowEmpty:!1})],{description:"Return monitors directly assigned to this folder ID, or unfiled monitors when null. Omit to return all monitors."}),owners:he(p({allowEmpty:!1}),{description:"Restrict results to monitors owned by any of these team IDs",maxItems:50}),searchQuery:wo({description:"Search query filter for monitors.",valueDescription:"Case-insensitive substring matched against monitor ID, monitor name, query filters, and aggregate fields. Wildcard characters are treated literally."}),tags:he(on.items,{description:"Restrict results to monitors that have at least one of the listed key/value tags",maxItems:50}),priorities:he(n.Enum(En),{description:"Restrict results to monitors with one of these priorities",maxItems:En.length}),types:he(n.Enum(Iae),{description:"Restrict results to monitors with these types",maxItems:Iae.length}),activity:he(n.Enum(kR),{description:"Restrict results by activity status: active monitors or currently snoozed monitors",maxItems:kR.length}),clusterIds:he(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"}),LR=n.Partial(KF),zF=n.Partial(n.Object({...ye,filters:LR,sort:n.Object({by:n.Enum([kp.PRIORITY,kp.TYPE,kp.NAME,kp.OWNER,kp.TAGS,kp.CLUSTER_IDS,kp.PAUSE_UNTIL,kp.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:me},{description:"Optional sorting applied to the returned monitors. Ties are broken by creation time and monitor ID for stable pagination."})})),phr=f({tags:["monitors"],url:`${Io}/query`,method:"POST",paginated:!0,response:n.Array(Lp),body:zF}),lhr=f({tags:["monitors"],url:`${Io}/tags/query`,method:"POST",body:n.Object({filters:n.Optional(n.Partial(n.Omit(KF,["tags"])))}),response:Qr}),dhr=f({tags:["monitors"],url:`${Io}/counts/query`,method:"POST",body:n.Object({filters:n.Optional(n.Partial(n.Omit(KF,["activity"])))}),response:n.Object({all:n.Integer({description:"Total number of monitors matching the filters that the user can read."}),active:n.Integer({description:"Number of matching readable monitors that are not currently snoozed."}),snoozed:n.Integer({description:"Number of matching readable monitors that are currently snoozed."})})}),mhr=f({tags:["monitors"],url:`${Io}/:id`,method:"GET",params:n.Object({id:p()}),response:Lp}),fhr=f({tags:["monitors"],url:Io,method:"POST",body:iS,response:Lp}),ghr=f({tags:["monitors"],url:`${Io}/:id`,method:"PUT",params:n.Object({id:p()}),body:iS,response:Lp}),f2e=100,g2e=Ti(LR,{maxIds:f2e}),hhr=f({tags:["monitors"],url:`${Io}/bulk-update`,method:"PUT",body:n.Object({selection:g2e,owner:n.Optional(p({allowEmpty:!1,description:"Owning team to apply to every selected monitor. Omit to keep current ownership."})),folderId:Qe(p({allowEmpty:!1}),{description:"Folder to assign every selected monitor to. Omit to keep their folders, or send null to make them unfiled. Assignment preserves ownership, data access, and evaluation state."})}),response:n.Object({})}),yhr=f({tags:["monitors"],url:`${Io}/:id`,method:"DELETE",params:n.Object({id:p()}),response:B}),h2e=Ti(LR),Ehr=f({tags:["monitors"],url:`${Io}/bulk-delete`,method:"DELETE",body:n.Object({selection:h2e}),response:n.Object({})}),Thr=f({tags:["monitors"],url:`${Io}/:id/snooze`,method:"POST",params:n.Object({id:p()}),body:n.Object({pauseUntil:n.Union([n.Null(),p({allowEmpty:!1,type:"date-time"})])}),response:Lp}),y2e=Ti(LR,{maxIds:100}),Shr=f({tags:["monitors"],url:`${Io}/bulk-snooze`,method:"POST",body:n.Object({selection:y2e,pauseUntil:p({allowEmpty:!1,type:"date-time"})}),response:n.Object({})}),E2e=["alert","alert_consider_zero","alert_no_data","keep_last_status_alert"],T2e=["ok","ok_consider_zero","ok_no_data","keep_last_status_ok"],S2e=[...E2e,...T2e],Fd=n.Enum(S2e),_2e=D("type",[n.Object({type:n.Literal("each"),subStates:n.Record(n.String(),n.Object({stateValue:n.Union([Fd,n.Null()]),lastChangedAt:v()}))}),n.Object({type:n.Literal("no_aggregation"),stateValue:n.Optional(Fd)}),n.Object({type:n.Literal("any"),stateValue:n.Optional(Fd)}),n.Object({type:n.Literal("all"),stateValue:n.Optional(Fd)}),n.Object({type:n.Literal("proportion"),stateValue:n.Optional(Fd)})]),I2e=n.Object({monitorId:n.String(),currentState:_2e,lastChangedAt:n.Optional(v())}),_hr=f({tags:["monitors"],url:`${Io}/states/:id`,method:"GET",params:n.Object({id:p()}),response:I2e}),Ihr=f({tags:["monitors"],url:`${Io}/:id/transitions`,method:"GET",params:n.Object({id:p()}),query:n.Object({from:n.Number(),to:n.Number()}),response:n.Array(n.Object({id:n.String(),createdAt:v(),fromState:n.Optional(Fd),toState:n.Optional(Fd),dimension:n.Optional(n.String())}))}),b2e=["unprocessed","processed","failed-to-process"],bhr=f({tags:["monitors"],url:`${Io}/:id/results`,method:"GET",params:n.Object({id:p()}),query:n.Object({from:n.Number(),to:n.Number()}),response:n.Object({isTruncated:n.Boolean(),results:n.Array(n.Object({id:n.String(),evaluationAt:v(),formulaResult:n.Object({groups:n.Array(n.Object({groupKey:n.Record(n.String(),dT),results:n.Array(n.Union([n.Number(),n.Null()])),conditionMet:n.Enum(["true","false","nan-no-data"])}))}),createdAt:v(),status:n.Enum(b2e)}))})});function MR({type:e,description:t,$id:r}){return n.Object({type:n.Literal(e,{description:t}),conditions:Gje,noDataBehavior:n.Enum(bae,{description:Uae}),...Cae,consecutiveWindows:Wje,queries:TT},{$id:r})}function DR({type:e,description:t,$id:r}){return n.Object({type:n.Literal(e,{description:t}),conditions:Bje,noDataBehavior:n.Enum(bae,{description:Uae}),...Rae,consecutiveWindows:Qje,queries:tC},{$id:r})}function FR({type:e,description:t,$id:r}){return n.Object({type:n.Literal(e,{description:t}),condition:jje,noDataBehavior:n.Enum(xae,{description:wae}),...Kje,queries:TT},{$id:r})}function $R({type:e,description:t,$id:r}){return n.Object({type:n.Literal(e,{description:t}),condition:qje,noDataBehavior:n.Enum(xae,{description:wae}),...zje,queries:tC},{$id:r})}var Vae=D("type",[n.Object({type:n.Literal("bearer"),tokenLastChars:n.String()}),n.Object({type:n.Literal("basic"),username:n.String(),passwordLastChars:n.String()}),n.Object({type:n.Literal("custom-header"),key:n.String(),valueLastChars:n.String()}),n.Object({type:n.Literal("none")})]),Wae=D("type",[n.Object({type:n.Literal("bearer"),token:p({allowEmpty:!1})}),n.Object({type:n.Literal("basic"),username:p({allowEmpty:!1}),password:p({allowEmpty:!1})}),n.Object({type:n.Literal("custom-header"),key:p({allowEmpty:!1}),value:p({allowEmpty:!1})}),n.Object({type:n.Literal("none")})]),Qae=D("type",[n.Object({type:n.Literal("bearer"),token:n.Optional(p({allowEmpty:!1}))}),n.Object({type:n.Literal("basic"),username:n.Optional(p({allowEmpty:!1})),password:n.Optional(p({allowEmpty:!1}))}),n.Object({type:n.Literal("custom-header"),key:n.Optional(p({allowEmpty:!1})),value:n.Optional(p({allowEmpty:!1}))}),n.Object({type:n.Literal("none")})]);var Gd="/v0/notifications",$a=`${Gd}/rules`,Zae=`${Gd}/slack/setup`,Fg=`${Gd}/integrations`,$d=["triggered","resolved","no-data"],x2e=["sent","stale","pending","rate-limited","failed","silenced"],O2e=n.Optional(n.Object({maxMessages:n.Integer({description:"Maximum number of notifications this target can send during the rate-limiting window."}),minutes:n.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."})),YF=n.Object({maxMessages:n.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:n.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."}),A2e=n.Optional(YF),Da=n.Optional(n.Object({mode:n.Literal("each",{description:"Renotification mode. `each` sends repeat notifications for each matching monitor alert that remains in a configured state."}),renotificationStates:n.Array(n.Enum(["alert","alert_no_data"]),{description:"Monitor alert states that trigger repeat notifications while the target remains configured for renotification."}),renotifyIntervalMinutes:n.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."})),Fa=n.Optional(n.Object({mode:n.Literal("each",{description:"Renotification mode. `each` sends repeat notifications for each matching monitor alert that remains in a configured state."}),renotificationStates:n.Array(n.Enum(["alert","alert_no_data"]),{description:"Monitor alert states that trigger repeat notifications while the target remains configured for renotification."}),renotifyIntervalMinutes:n.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."})),sS=n.Object({id:n.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:O2e,config:D("type",[n.Object({type:n.Literal("slack",{description:"Slack target backed by a configured Slack integration."}),channel:n.String({description:"Slack channel ID that receives the notification"}),integrationId:n.String({description:"Slack workspace ID that receives the notification"}),integrationName:n.String({description:"Human readable name of the Slack integration"}),renotifyConfig:Da},{$id:"RuleTargetConfigSlack"}),n.Object({type:n.Literal("incident-io",{description:"incident.io target backed by a configured incident.io integration."}),integrationId:n.String({description:"Identifier of the incident.io integration to use"}),integrationName:n.String({description:"Human readable name of the incident.io integration"}),renotifyConfig:Da},{$id:"RuleTargetConfigIncidentIo"}),n.Object({type:n.Literal("email",{description:"Email target that sends directly to the listed addresses and does not require an integration."}),addresses:n.Array(n.String(),{description:"Email addresses that will receive the alert"}),renotifyConfig:Da},{$id:"RuleTargetConfigEmail"}),n.Object({type:n.Literal("grafana-irm",{description:"Grafana IRM target backed by a configured Grafana IRM integration."}),integrationId:n.String({description:"Identifier of the Grafana IRM integration to use"}),integrationName:n.String({description:"Human readable name of the Grafana IRM integration"}),renotifyConfig:Da},{$id:"RuleTargetConfigGrafanaIrm"}),n.Object({type:n.Literal("pagerduty",{description:"PagerDuty target backed by a configured PagerDuty integration."}),integrationId:n.String({description:"Identifier of the PagerDuty integration to use"}),integrationName:n.String({description:"Human readable name of the PagerDuty integration"}),renotifyConfig:Da},{$id:"RuleTargetConfigPagerDuty"}),n.Object({type:n.Literal("microsoft-teams",{description:"Microsoft Teams target backed by a configured Microsoft Teams integration."}),integrationId:n.String({description:"Identifier of the Microsoft Teams integration to use"}),integrationName:n.String({description:"Human readable name of the Microsoft Teams integration"}),renotifyConfig:Da},{$id:"RuleTargetConfigMicrosoftTeams"}),n.Object({type:n.Literal("webhook",{description:"Webhook target backed by a configured webhook integration."}),integrationId:n.String({description:"Identifier of the webhook integration to use"}),integrationName:n.String({description:"Human readable name of the webhook integration"}),renotifyConfig:Da},{$id:"RuleTargetConfigWebhook"}),n.Object({type:n.Literal("servicenow",{description:"ServiceNow target backed by a configured ServiceNow integration."}),integrationId:n.String({description:"Identifier of the ServiceNow integration to use"}),integrationName:n.String({description:"Human readable name of the ServiceNow integration"}),renotifyConfig:Da},{$id:"RuleTargetConfigServiceNow"}),n.Object({type:n.Literal("google-chat",{description:"Google Chat target backed by a configured Google Chat integration."}),integrationId:n.String({description:"Identifier of the Google Chat integration to use"}),integrationName:n.String({description:"Human readable name of the Google Chat integration"}),renotifyConfig:Da},{$id:"RuleTargetConfigGoogleChat"}),n.Object({type:n.Literal("squadcast",{description:"Squadcast target backed by a configured Squadcast integration."}),integrationId:n.String({description:"Identifier of the Squadcast integration to use"}),integrationName:n.String({description:"Human readable name of the Squadcast integration"}),renotifyConfig:Da},{$id:"RuleTargetConfigSquadcast"}),n.Object({type:n.Literal("jira",{description:"Jira target backed by a configured Jira integration. Jira targets file one issue per notification and do not support renotification."}),integrationId:n.String({description:"Identifier of the Jira integration to use"}),integrationName:n.String({description:"Human readable name of the Jira integration"}),projectKey:n.String({description:'Key of the Jira project that alert issues are filed into, like "OPS".'}),issueType:n.String({description:'Name of the Jira issue type created for alerts, like "Bug" or "Task".'}),openStatus:n.Optional(n.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:n.Optional(n.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`."})}),$g=n.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:A2e,config:D("type",[n.Object({type:n.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"}),renotifyConfig:Fa},{$id:"RuleTargetInputSlack"}),n.Object({type:n.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"}),renotifyConfig:Fa},{$id:"RuleTargetInputIncidentIo"}),n.Object({type:n.Literal("pagerduty",{description:"PagerDuty target backed by a configured PagerDuty integration."}),integrationId:p({allowEmpty:!1,description:"Identifier of the PagerDuty integration to use"}),renotifyConfig:Fa},{$id:"RuleTargetInputPagerDuty"}),n.Object({type:n.Literal("email",{description:"Email target that sends directly to the listed addresses and does not require an integration."}),addresses:n.Array(p({type:"email"}),{minItems:1,maxItems:20,description:"Email addresses that will receive the alert"}),renotifyConfig:Fa},{$id:"RuleTargetInputEmail"}),n.Object({type:n.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"}),renotifyConfig:Fa},{$id:"RuleTargetInputGrafanaIrm"}),n.Object({type:n.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"}),renotifyConfig:Fa},{$id:"RuleTargetInputMicrosoftTeams"}),n.Object({type:n.Literal("webhook",{description:"Webhook target backed by a configured webhook integration."}),integrationId:p({allowEmpty:!1,description:"Identifier of the webhook integration to use"}),renotifyConfig:Fa},{$id:"RuleTargetInputWebhook"}),n.Object({type:n.Literal("servicenow",{description:"ServiceNow target backed by a configured ServiceNow integration."}),integrationId:p({allowEmpty:!1,description:"Identifier of the ServiceNow integration to use"}),renotifyConfig:Fa},{$id:"RuleTargetInputServiceNow"}),n.Object({type:n.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"}),renotifyConfig:Fa},{$id:"RuleTargetInputGoogleChat"}),n.Object({type:n.Literal("squadcast",{description:"Squadcast target backed by a configured Squadcast integration."}),integrationId:p({allowEmpty:!1,description:"Identifier of the Squadcast integration to use"}),renotifyConfig:Fa},{$id:"RuleTargetInputSquadcast"}),n.Object({type:n.Literal("jira",{description:"Jira target backed by a configured Jira integration. Jira targets file one issue per notification and do not support renotification."}),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:n.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:n.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)."})}),VF=D("type",[n.Object({type:n.Literal("specific-teams",{description:"Match alert transitions associated with the listed teams. The caller must be allowed to access every listed team."}),teams:n.Array(n.String(),{description:"Team IDs selected by this filter."})},{title:"SpecificTeams"}),n.Object({type:n.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"}),n.Object({type:n.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."}),WF=D("type",[n.Object({type:n.Literal("specific-teams",{description:"Match alert transitions associated with the listed teams. The caller must be allowed to access every listed team."}),teams:n.Array(p(),{minItems:1,maxItems:100,description:"Team IDs selected by this filter."})},{title:"SpecificTeams"}),n.Object({type:n.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"}),n.Object({type:n.Literal("all-public-teams",{description:"Match alert transitions for all public teams. Public API callers need an API key with `all` or `owning-team-and-public` scope to create or update this filter."})},{title:"AllPublicTeams"})],{description:"Team visibility filter used when matching alert transitions. Tsuga validates create and update requests against the caller permissions."}),Bd=n.Object({id:n.String({description:"Tsuga-generated notification rule ID assigned when the rule is created."}),name:n.String({description:"Display name of the notification rule."}),queryString:n.Optional(n.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:VF,prioritiesFilter:n.Array(n.Enum(En),{description:"Monitor priorities that must match for this rule to fire. An empty array matches every priority."}),transitionTypesFilter:n.Array(n.Enum($d),{description:"Alert state transitions that must match for this rule to fire. An empty array matches every transition type."}),clusterIdsFilter:n.Array(n.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:n.String({description:"Team ID that owns and manages the rule."}),createdAt:v({description:"Timestamp when Tsuga created the rule."}),updatedAt:v({description:"Timestamp when Tsuga last updated the rule."}),isActive:n.Boolean({description:"Whether the rule currently sends notifications when its filters match."}),tags:kt,targets:n.Array(sS,{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:n.Optional(be),updater:n.Optional(be)}),aS=n.Object({name:p({description:"Display name of the notification rule."}),queryString:Qe(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:WF,prioritiesFilter:n.Array(n.Enum(En),{maxItems:En.length,description:"Monitor priorities that must match for this rule to fire. An empty array matches every priority."}),transitionTypesFilter:n.Array(n.Enum($d),{maxItems:$d.length,description:"Alert state transitions that must match for this rule to fire. An empty array matches every transition type."}),clusterIdsFilter:n.Optional(n.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:qt,isActive:n.Boolean({description:"Set to true for the rule to send notifications when its filters match."}),targets:n.Array($g,{minItems:1,description:"Destinations that receive a notification whenever this rule matches an alert transition. This list replaces the existing targets on update."})}),jd=n.Object({id:n.String({description:"Unique identifier of the adaptive notification rule. Generated by Tsuga."}),name:n.String({description:"Display name of the adaptive notification rule."}),owner:n.String({description:"Team ID that owns and manages the rule."}),createdAt:v({description:"Timestamp when Tsuga created the rule."}),updatedAt:v({description:"Timestamp when Tsuga last updated the rule."}),isActive:n.Boolean({description:"Whether the rule currently sends notifications when one of its monitors fires."}),shouldCreateInvestigation:n.Boolean({description:"Whether each page records an investigation holding the sampled traces and the call graph the destination was resolved from, linked from the notification body."}),tags:kt,monitorIds:n.Array(n.String(),{description:"Monitors this rule reacts to."}),sloIds:n.Array(n.String(),{description:"SLOs this rule reacts to."}),fallbackTarget:sS,creator:n.Optional(be),updater:n.Optional(be)}),GR=n.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:qt,isActive:n.Boolean({description:"Set to true for the rule to send notifications when one of its monitors fires."}),shouldCreateInvestigation:n.Optional(n.Boolean({description:"Set to true to record an investigation for each page, holding the sampled traces and the call graph the destination was resolved from, and to link it from the notification body. Defaults to false."})),monitorIds:n.Optional(n.Array(p({allowEmpty:!1}),{maxItems:100,description:"Monitors this rule reacts to. Only trace monitors and metric monitors over OTel span metrics are eligible. On update, omitting this field keeps the current monitors; send an empty array to remove them. Send at least one monitor or SLO."})),sloIds:n.Optional(n.Array(p({allowEmpty:!1}),{maxItems:100,description:"SLOs this rule reacts to. Only SLOs over traces or OTel span metrics are eligible. On update, omitting this field keeps the current SLOs; send an empty array to remove them. Send at least one monitor or SLO."})),fallbackTarget:$g}),C2e=["active","inactive"],R2e=["name","isActive","owner","tags","clusterIdsFilter","targets","type","updatedAt"],Xae=n.Object({owners:he(p({allowEmpty:!1}),{description:"Restrict results to rules owned by any of these team IDs.",maxItems:50}),searchQuery:wo({description:"Search query filter for notification rules.",valueDescription:"Case-insensitive substring matched against rule name and ID."}),tags:he(on.items,{description:"Restrict results to rules that have at least one of the listed key/value tags.",maxItems:50}),destinations:he(p({allowEmpty:!1}),{description:"Restrict results to rules that route to any of these email addresses or integration IDs.",maxItems:50}),clusterIds:he(p({allowEmpty:!1}),{description:"Restrict results to rules that run on any of these cluster IDs. Rules with no cluster restriction are treated as running on every cluster, including the requested ones.",maxItems:50}),status:n.Enum(C2e,{description:"Restrict results to active or inactive rules."})}),P2e=n.Partial(n.Object({...ye,filters:n.Partial(Xae),sort:n.Object({by:n.Enum(R2e,{description:"Field to sort the returned notification rules by."}),direction:me})})),U2e=n.Object({type:n.Literal("standard",{description:"Standard notification rule matched by query, tags, and destinations."}),...Bd.properties}),w2e=n.Object({type:n.Literal("adaptive",{description:"Adaptive notification rule matched by selected monitors or SLOs."}),...jd.properties}),v2e=D("type",[U2e,w2e]),N2e=n.Object({value:n.String({description:"Email address or integration ID used when filtering destinations."}),label:n.String({description:"Display name of the destination."}),type:n.String({description:"Destination type, such as email or slack."})}),k2e=n.Object({tags:Qr,destinations:n.Array(N2e,{description:"Destination filter options from the matching rules."}),activeCounts:n.Object({totalCount:n.Integer({description:"Total number of matching rules regardless of whether they are active."}),active:n.Integer({description:"Number of matching rules that are active."}),inactive:n.Integer({description:"Number of matching rules that are inactive."})})}),L2e=n.Object({filters:n.Optional(n.Partial(Xae,{description:"Filters applied before collecting tag, destination, and active-count options."}))}),Mhr=f({tags:["notification-rules"],url:`${$a}/query`,method:"POST",paginated:!0,body:P2e,response:n.Array(v2e,{description:"Matching standard and adaptive notification rules after they are merged, sorted, and paginated."})}),Dhr=f({tags:["notification-rules"],url:`${$a}/options/query`,method:"POST",body:L2e,response:k2e}),Fhr=f({tags:["notification-rules"],url:$a,method:"GET",paginated:!0,query:n.Object(ye),response:n.Array(Bd)}),$hr=f({tags:["notification-rules"],url:`${$a}/:id`,params:n.Object({id:p()}),method:"GET",response:Bd}),Ghr=f({tags:["notification-rules"],url:$a,method:"POST",body:aS,response:Bd}),Bhr=f({tags:["notification-rules"],url:`${$a}/:id`,method:"PUT",params:n.Object({id:p()}),body:aS,response:Bd}),jhr=f({tags:["notification-rules"],url:`${$a}/:id`,method:"DELETE",params:n.Object({id:p()}),response:B}),qhr=f({tags:["notification-rules"],url:`${$a}/bulk-delete`,method:"DELETE",body:n.Object({ids:n.Array(p(),{uniqueItems:!0})}),response:n.Object({})}),Gg=`${Gd}/adaptive-rules`,Hhr=f({tags:["notification-rules"],url:Gg,method:"GET",paginated:!0,query:n.Object(ye),response:n.Array(jd)}),Khr=f({tags:["notification-rules"],url:`${Gg}/:id`,params:n.Object({id:p()}),method:"GET",response:jd}),zhr=f({tags:["notification-rules"],url:Gg,method:"POST",body:GR,response:jd}),Yhr=f({tags:["notification-rules"],url:`${Gg}/:id`,method:"PUT",params:n.Object({id:p()}),body:GR,response:jd}),Vhr=f({tags:["notification-rules"],url:`${Gg}/:id`,method:"DELETE",params:n.Object({id:p()}),response:B}),Whr=f({tags:["notification-rules"],url:`${Gg}/bulk-delete`,method:"DELETE",body:n.Object({ids:n.Array(p(),{uniqueItems:!0})}),response:n.Object({})}),Qhr=f({tags:["notification-integrations"],url:`${Zae}/start`,method:"POST",response:n.Object({redirectUrl:n.String()})}),M2e=["google-chat","grafana-irm","incident-io","jira","microsoft-teams","pagerduty","servicenow","slack","squadcast","webhook"],Jae=n.Object({id:n.String(),name:n.String(),type:n.Enum(M2e),createdAt:v(),ruleCount:n.Number(),creator:n.Optional(be),owner:n.Optional(n.String({description:"ID of the team that owns the integration. Absent on integrations created before ownership was introduced."}))}),D2e=["name","type","ruleCount","createdAt"],F2e=n.Object({searchQuery:wo({description:"Search query filter for notification integrations.",valueDescription:"Case-insensitive substring matched against integration name and ID."})}),$2e=n.Partial(n.Object({...ye,filters:n.Partial(F2e),sort:n.Object({by:n.Enum(D2e,{description:"Field to sort the returned notification integrations by."}),direction:me})})),Zhr=f({tags:["notification-integrations"],url:`${Fg}/query`,method:"POST",paginated:!0,body:$2e,response:n.Array(Jae,{description:"Matching notification integrations after they are filtered, sorted, and paginated."})}),Xhr=f({tags:["notification-integrations"],url:`${$a}/integrations`,method:"GET",paginated:!0,query:n.Object(ye),response:n.Array(Jae)}),Jhr=f({tags:["notification-integrations"],url:`${Zae}/callback`,method:"GET",query:n.Object({code:p()}),response:n.Object({success:n.Boolean()})}),G2e={data:"notification_view_data",source:"notification_view_source",dashboard:"notification_view_dashboard",service:"notification_view_service"},eyr=n.Object({type:n.Literal("block_actions"),actions:n.Array(n.Object({type:n.Literal("button"),action_id:n.Enum(Object.values(G2e))}),{minItems:1})}),tyr=f({tags:["notification-integrations"],url:`${Gd}/slack/interactivity`,method:"POST",body:n.String(),response:n.Literal("")}),QF=["POST","PUT"],B2e=n.Record(n.String(),n.String()),j2e=n.Record(n.String(),n.Unknown()),q2e=n.Record(n.String(),n.Union([n.String(),n.Number(),n.Boolean(),n.Null(),n.Array(n.Union([n.String(),n.Number(),n.Boolean()]))])),H2e=D("type",[n.Object({type:n.Literal("json"),value:j2e}),n.Object({type:n.Literal("form"),value:q2e})]),K2e=n.Object({ok:n.String(),alert:n.String()}),cS=n.Object({id:n.String(),name:n.String(),owner:n.Optional(n.String({description:"ID of the team that owns the integration. Absent on integrations created before ownership was introduced."})),setting:D("type",[n.Object({type:n.Literal("incident-io"),alertSourceConfigId:n.String(),tokenLastChars:n.String()}),n.Object({type:n.Literal("grafana-irm"),urlLastChars:n.String()}),n.Object({type:n.Literal("pagerduty"),integrationKeyLastChars:n.String()}),n.Object({type:n.Literal("microsoft-teams"),webhookUrlLastChars:n.String()}),n.Object({type:n.Literal("webhook"),urlLastChars:n.String(),method:n.Enum(QF),authentication:Vae,customHeaders:n.Optional(B2e),payloadTemplate:H2e,eventNameMapping:n.Optional(K2e)}),n.Object({type:n.Literal("servicenow"),instanceName:n.String(),username:n.String(),passwordLastChars:n.String()}),n.Object({type:n.Literal("google-chat"),webhookUrlLastChars:n.String()}),n.Object({type:n.Literal("squadcast"),webhookUrlLastChars:n.String()}),n.Object({type:n.Literal("jira"),siteUrl:n.String(),email:n.String(),apiTokenLastChars:n.String()})]),tags:kt}),z2e=n.Object({type:n.Literal("webhook"),url:p({type:"uri"}),method:n.Enum(QF),authentication:Wae,customHeaders:n.Record(p({allowEmpty:!1}),p()),payloadTemplate:D("type",[n.Object({type:n.Literal("json"),value:n.Record(p({allowEmpty:!1}),n.Unknown())}),n.Object({type:n.Literal("form"),value:n.Record(p({allowEmpty:!1}),n.Union([n.String(),n.Number(),n.Boolean(),n.Null(),n.Array(n.Union([n.String(),n.Number(),n.Boolean()]))]))})]),eventNameMapping:n.Optional(n.Object({ok:p({allowEmpty:!1}),alert:p({allowEmpty:!1})}))}),ece=n.Object({type:n.Literal("incident-io"),alertSourceConfigId:p(),token:p()}),tce=n.Object({type:n.Literal("grafana-irm"),url:p({type:"uri"})}),rce=n.Object({type:n.Literal("pagerduty"),integrationKey:p()}),nce=n.Object({type:n.Literal("microsoft-teams"),webhookUrl:p({type:"uri"})}),Y2e=n.Object({type:n.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})}),V2e=n.Object({type:n.Literal("google-chat"),webhookUrl:p({type:"uri"})}),W2e=n.Object({type:n.Literal("squadcast"),webhookUrl:p({type:"uri"})}),Q2e=n.Object({type:n.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."})}),oce=p({allowEmpty:!1,description:"ID of the team that will own the integration, determining which team members can view and manage it. Only an org admin or an admin of this team may set it."}),ZF=n.Object({name:p(),owner:oce,setting:D("type",[ece,tce,rce,nce,z2e,Y2e,V2e,W2e,Q2e]),tags:qt}),Z2e=n.Object({type:n.Literal("webhook"),url:n.Optional(p({type:"uri"})),method:n.Optional(n.Enum(QF)),authentication:n.Optional(Qae),customHeaders:n.Optional(n.Record(p({allowEmpty:!1}),p())),payloadTemplate:n.Optional(D("type",[n.Object({type:n.Literal("json"),value:n.Record(p({allowEmpty:!1}),n.Unknown())}),n.Object({type:n.Literal("form"),value:n.Record(p({allowEmpty:!1}),n.Union([n.String(),n.Number(),n.Boolean(),n.Null(),n.Array(n.Union([n.String(),n.Number(),n.Boolean()]))]))})])),eventNameMapping:Qe(n.Object({ok:n.Optional(p({allowEmpty:!1})),alert:n.Optional(p({allowEmpty:!1}))}))}),X2e=n.Object({type:n.Literal("servicenow"),instanceName:n.Optional(p({allowEmpty:!1})),username:n.Optional(p({allowEmpty:!1})),password:n.Optional(p({allowEmpty:!1}))}),J2e=n.Object({type:n.Literal("jira"),siteUrl:n.Optional(p({type:"uri",allowEmpty:!1})),email:n.Optional(p({allowEmpty:!1})),apiToken:n.Optional(p({allowEmpty:!1}))}),eqe=n.Object({type:n.Literal("google-chat"),webhookUrl:p({type:"uri"})}),tqe=n.Object({type:n.Literal("squadcast"),webhookUrl:p({type:"uri"})}),XF=n.Object({name:n.Optional(p()),owner:oce,tags:qt,setting:n.Optional(D("type",[ece,tce,rce,nce,Z2e,X2e,eqe,tqe,J2e]))}),ryr=f({tags:["notification-integrations"],url:Fg,method:"POST",body:ZF,response:cS}),nyr=f({tags:["notification-integrations"],url:`${Fg}/:id`,method:"GET",params:n.Object({id:p()}),response:cS}),oyr=f({tags:["notification-integrations"],url:`${Fg}/:id`,method:"PATCH",params:n.Object({id:p()}),body:XF,response:cS}),iyr=f({tags:["notification-integrations"],url:`${Fg}/:id`,method:"DELETE",params:n.Object({id:p()}),response:B}),rqe=D("status",[n.Object({status:n.Literal("ok",{description:"Tsuga reached Jira and listed the projects the credentials can file into."}),projects:n.Array(n.Object({key:n.String({description:'Jira project key, like "OPS".'}),name:n.String({description:"Human readable Jira project name."}),issueTypes:n.Array(n.String(),{description:"Issue type names available when creating an issue in this project."}),statuses:n.Optional(n.Array(n.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"}),n.Object({status:n.Literal("error",{description:"Tsuga could not load Jira metadata with the stored credentials."}),message:n.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."}),syr=f({tags:["notification-integrations"],url:`${Fg}/:id/jira-metadata`,method:"GET",params:n.Object({id:p()}),response:rqe}),ayr=f({tags:["notification-rules"],url:`${Io}/:id/notifications`,method:"GET",params:n.Object({id:p()}),query:n.Optional(n.Object({from:n.Optional(n.Number()),to:n.Optional(n.Number())})),response:n.Object({notifications:n.Array(n.Object({id:n.String(),monitorId:n.String(),monitorResultId:n.String(),ruleId:n.Optional(n.String()),targetId:n.Optional(n.String()),status:n.Enum(x2e),tryCount:n.Number(),nextTryAt:v(),createdAt:v(),updatedAt:v(),sentAt:n.Optional(v())})),isTruncated:n.Boolean()})}),nqe=["slack","incident-io","pagerduty","email","grafana-irm","microsoft-teams","webhook","servicenow","google-chat","squadcast","jira"],cyr=f({tags:["notification-rules"],url:`${$a}/test`,method:"POST",body:n.Object({notificationRule:aS,targetIds:n.Optional(n.Array(p({allowEmpty:!1}),{description:"Target IDs to test specific targets",minItems:1,maxItems:10})),monitorId:n.Optional(p({allowEmpty:!1,description:"Monitor to simulate: the test notification is built like a real alert of this monitor (message, tags, group by values). When omitted, a generic test notification is sent."}))}),response:n.Union([n.Object({success:n.Literal(!1),overallMessage:n.String({description:"Message when there is an overall error"})}),n.Object({success:n.Boolean(),results:n.Array(n.Object({targetId:n.String({description:"The ID of the target that was tested"}),targetType:n.Enum(nqe,{description:"The type of the target (e.g., slack, webhook)"}),status:n.Enum(["success","failure"],{description:"Whether the test notification was sent successfully"}),message:n.Optional(n.String({description:"Message if the notification failed for this specific target"}))}))})])});var oqe=["healthy","breached","no_data"],Mp=n.Enum(oqe,{description:"SLO status: healthy (meeting the target), breached (breaching it), or no_data (not evaluated yet)"}),Bg=n.Object({owners:he(p({allowEmpty:!1}),{description:"Restrict results to SLOs owned by any of these team IDs",maxItems:50}),searchQuery:wo({description:"Text filter for SLO names or IDs. Optional; `exclude: true` removes matching SLOs.",valueDescription:"Substring matched case-insensitively against the SLO name or SLO ID."}),tags:he(on.items,{description:"Restrict results to SLOs that have at least one of the listed key/value tags",maxItems:50}),clusterIds:he(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:he(Mp,{description:"Restrict results to SLOs whose status is one of these values",maxItems:3})},{description:"Optional filters applied to narrow the returned SLOs"});var Ms="/v0/service-catalog",iqe=n.Object({team:n.String({description:"Team name observed on telemetry for this service. The emitting service sets it through telemetry attributes. Returned when Tsuga has observed a team value for the service; metadata refreshes weekly or when a new service version appears. For a service the service catalog has not recorded yet, it comes from the trace span metrics of the queried window."})},{description:"A team name observed on telemetry for this service."}),sqe=n.Object({ingestionApiKey:n.String({description:"Ingestion API key name or identifier observed on telemetry for this service. Tsuga sets it from the key used to ingest matching telemetry. Returned when key metadata is available for the service."}),lastSeenAt:v({description:"Most recent time this ingestion key was observed for the service. Tsuga sets it from telemetry timestamps during service metadata refreshes."})},{description:"An ingestion API key observed on telemetry for this service, with the last time it was seen."}),aqe=n.Object({version:n.String({description:"Service version value observed in telemetry. The emitting service sets it through `context.service.version`. Returned when Tsuga has observed a version for the service."}),firstSeenAt:v({description:"First time this version was observed for the service. Tsuga sets it from telemetry timestamps and refreshes observed versions on each service catalog pass."}),lastSeenAt:v({description:"Most recent time this version was observed for the service. Tsuga sets it from telemetry timestamps and refreshes observed versions on each service catalog pass."}),faulty:n.Optional(n.Boolean({description:"Whether Tsuga detected this version as associated with faulty behavior."})),faultyLatency:n.Optional(n.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:n.Optional(n.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."}),cqe=n.Object({language:n.String({description:"Programming language observed for this service. The OpenTelemetry SDK sets it through telemetry metadata. Returned when language metadata is available for the service."}),lastSeenAt:v({description:"Most recent time this language was observed. Tsuga sets it from telemetry timestamps during service metadata refreshes."})},{description:"A programming language observed for this service, with the last time it was seen."}),uqe=n.Object({protocol:n.String({description:"Observed API protocol, such as `http`, `grpc`, or `graphql`. Tsuga infers it from span metadata. Returned when protocol metadata is available for the service."}),lastSeenAt:v({description:"Most recent time this protocol was observed. Tsuga sets it from telemetry timestamps during service metadata refreshes."})},{description:"An API protocol observed for this service, with the last time it was seen."}),pqe=n.Object({framework:n.String({description:"Observed application framework, such as `express`, `fastify`, `django`, or `rails`. Tsuga detects it from OpenTelemetry instrumentation scope. Returned when framework metadata is available for the service."}),lastSeenAt:v({description:"Most recent time this framework was observed. Tsuga sets it from telemetry timestamps during service metadata refreshes."})},{description:"An application framework detected from OpenTelemetry instrumentation scope, with the last time it was seen."}),lqe=n.Object({platform:n.String({description:"Observed cloud or orchestration platform. Tsuga reads the `cloud.platform` resource attribute, such as `aws_eks` or `aws_lambda`, and adds `kubernetes` when spans carry `k8s.cluster.name` and `aws_ecs` when they carry `aws.ecs.task.arn`. The emitting service or collector sets these resource attributes."}),lastSeenAt:v({description:"Most recent time this platform was observed. Tsuga sets it from telemetry timestamps during service metadata refreshes."})},{description:"A cloud or orchestration platform this service runs on, with the last time it was seen."}),dqe=n.Object({provider:n.String({description:"Observed cloud provider, read from the `cloud.provider` resource attribute, such as `aws`, `gcp`, or `azure`. The emitting service or collector sets it."}),lastSeenAt:v({description:"Most recent time this provider was observed. Tsuga sets it from telemetry timestamps during service metadata refreshes."})},{description:"A cloud provider this service runs on, with the last time it was seen."}),jg=n.Object({id:n.String({description:"Tsuga-generated identifier of this service notification target. Tsuga returns it when the target is created or listed, and clients use it to update or delete the target. It is unique across service targets."}),serviceId:n.String({description:"Identifier of the service catalog entry this target is attached to. Tsuga sets it from the service path parameter and returns it on read and write responses."}),config:sS.properties.config,rateLimit:sS.properties.rateLimit,createdAt:v({description:"Timestamp when the service notification target was created. Tsuga sets this value and returns it on private service-catalog responses."}),updatedAt:v({description:"Timestamp when the service notification target was last updated. Tsuga sets this value and returns it on private service-catalog responses."})}),JF=n.Object({config:$g.properties.config,rateLimit:$g.properties.rateLimit},{description:"Service notification target create request. The caller provides the destination configuration and optional rate limit; Tsuga attaches the target to the service in the path."}),e$=n.Object({config:$g.properties.config,rateLimit:n.Union([YF,n.Null()],{description:"Per-target rate limit to apply when sending notifications. Set it to `null` to drop the current limit and fall back to the default of 1000 notifications every 10 minutes."})},{description:"Service notification target update request. The caller provides the replacement destination configuration and rate limit; omitted fields are not supported by this schema."}),BR=n.Object({id:n.Optional(n.String({description:"Unique identifier of this service. Use it with service detail and graph endpoints. Absent until the hourly service catalog task records the service."})),serviceName:n.String({description:"OpenTelemetry service name observed in telemetry."}),serviceNamespace:n.Optional(n.String({description:"OpenTelemetry service namespace observed in telemetry."})),env:n.String({description:"Environment value observed for this service."}),teams:n.Array(iqe,{description:"Team names observed on telemetry for this service."}),ingestionApiKeys:n.Array(sqe,{description:"Ingestion API keys observed on telemetry for this service and when each was last seen."}),versions:n.Array(aqe,{description:"Service version values observed in telemetry, including first and last seen timestamps."}),languages:n.Array(cqe,{description:"Programming languages observed for this service."}),serverProtocols:n.Array(uqe,{description:"API protocols this service exposes (from server-kind spans)"}),frameworks:n.Array(pqe,{description:"Application frameworks detected from OTel instrumentation scope"}),cloudPlatforms:n.Optional(n.Array(lqe,{description:"Cloud platforms this service is running on. Absent or empty when Tsuga has not observed platform metadata for the service; treat both the same."})),cloudProviders:n.Optional(n.Array(dqe,{description:"Cloud providers this service is running on. Absent or empty when Tsuga has not observed provider metadata for the service; treat both the same."})),lastSeenAt:n.Optional(v({description:"Most recent time Tsuga observed telemetry for this service. Absent until the hourly service catalog task records the service."})),firstSeenAt:n.Optional(v({description:"First time Tsuga observed telemetry for this service. Absent until the hourly service catalog task records the service."})),traceRequestRate:n.Optional(n.Number({description:"Requests per second observed for this service over the queried window, counting calls of its primary span kind. The primary span kind is the busiest of `SPAN_KIND_SERVER`, `SPAN_KIND_PRODUCER`, and `SPAN_KIND_CONSUMER` in the service\u2019s busiest env, or `SPAN_KIND_INTERNAL` when the service has none of those; `SPAN_KIND_CLIENT` never counts. Every env of the service uses that same span kind. Omitted when the trace query failed, which is distinct from `0` (the service is quiet)."})),traceErrorRate:n.Optional(n.Number({description:"Percentage of this service\u2019s primary-span-kind calls (see `traceRequestRate`) over the queried window that ended with error status. Omitted when the trace query failed."})),notificationTargets:n.Array(jg,{description:"Notification targets attached to this service, used by adaptive notification rules to page its owners."}),createdAt:n.Optional(v({description:"Timestamp when Tsuga created this service catalog entry."})),updatedAt:n.Optional(v({description:"Timestamp when Tsuga last updated this service catalog entry."}))}),mqe=n.Object({spanKind:n.Enum(D7),count:n.Number()});var ice=n.Object({...BR.properties,spanKindCounts:n.Array(mqe),envs:n.Array(n.String())}),fqe=["serviceName","env","lastDeploy","traceErrorRate","traceRequestRate","teams","api","frameworks","languages","pagingDestination"],gqe=n.Object({searchQuery:n.Object({value:p({allowEmpty:!1,description:"Substring matched case-insensitively against service names."})},{description:"Text filter for service names."}),teams:he(p({allowEmpty:!1}),{description:"Restrict results to services observed under any of these team names",maxItems:50}),envs:he(p({allowEmpty:!1}),{description:"Restrict results to services observed in any of these environments",maxItems:50}),versions:he(p({allowEmpty:!1}),{description:"Restrict results to services whose latest observed version is one of these",maxItems:50}),languages:he(p({allowEmpty:!1}),{description:"Restrict results to services written in any of these languages",maxItems:50}),hasRecentData:n.Boolean({description:"When true, only return services whose request rate over the queried window is non-zero"})}),uS=["1h","4h","24h"];var t$=n.Partial(n.Object({...ye,clusterId:p(),filters:n.Partial(gqe,{description:"Optional filters applied to narrow the returned services"}),sort:n.Object({by:n.Enum(fqe,{description:"Field to sort the returned services by"}),direction:me},{description:"Optional sorting applied to the returned services"}),statsWindow:n.Enum(uS,{description:"Lookback used to select the services returned, which are those with trace span metrics in it, and to compute the trace request rate and trace error rate fields and the span-call totals that pick each service's primary environment. Defaults to `1h`."})})),byr=f({tags:["service-catalog"],url:`${Ms}/v2/services/query`,method:"POST",paginated:!0,body:t$,response:n.Array(ice)}),xyr=f({tags:["service-catalog"],query:n.Object({serviceName:p({allowEmpty:!1}),serviceNamespace:n.Optional(p({allowEmpty:!1})),env:p({allowEmpty:!1}),clusterId:n.Optional(p())}),method:"GET",url:`${Ms}/v2/service`,response:ice}),Oyr=f({tags:["service-catalog"],query:n.Object({serviceName:p({allowEmpty:!1}),serviceNamespace:n.Optional(p({allowEmpty:!1})),clusterId:n.Optional(p())}),method:"GET",url:`${Ms}/v2/service/envs`,response:n.Array(n.Object({env:n.String({description:"Environment the service was observed in."}),ingestedBytes:n.Number({description:"Trace bytes ingested for the service in this environment over the lookback."})}),{description:"Environments the service was observed in, busiest first."})}),Ayr=f({tags:["service-catalog"],method:"GET",url:`${Ms}/services/:serviceId`,params:n.Object({serviceId:p()}),response:BR}),Cyr=f({tags:["service-catalog"],method:"GET",url:`${Ms}/services/:serviceId/targets`,params:n.Object({serviceId:p()}),response:n.Array(jg)}),Ryr=f({tags:["service-catalog"],method:"POST",url:`${Ms}/services/:serviceId/targets`,params:n.Object({serviceId:p()}),body:JF,response:jg}),Pyr=f({tags:["service-catalog"],method:"PUT",url:`${Ms}/services/:serviceId/targets/:targetId`,params:n.Object({serviceId:p(),targetId:p()}),body:e$,response:jg}),Uyr=f({tags:["service-catalog"],method:"DELETE",url:`${Ms}/services/:serviceId/targets/:targetId`,params:n.Object({serviceId:p(),targetId:p()}),response:B}),hqe=["http","rpc","messaging","genai","object_store"],sce={name:n.String({description:"Service or inferred dependency name shown in the graph."}),env:n.Optional(n.String({description:"Environment observed from spans."}))},r$=n.Object({...sce,nodeType:n.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:n.Union([n.String(),n.Null()],{description:"Service ID, or null when multiple namespaces match the observed service name."}),namespace:n.Union([n.String(),n.Null()],{description:"Service namespace, or null when multiple namespaces match the observed service name."}),errorRate:n.Optional(n.Number({description:"Ratio of entry requests with at least one error to total entry requests observed on this service. Omitted when no entry requests were observed. Computed from the raw sampled counts, so trace sampling does not affect it."})),entryErrorRequestCount:n.Number({description:"Estimated number of entry requests on this service where at least one entry span had error status, projected from the sampled traces onto the full population."}),entryRequestCount:n.Number({description:"Estimated number of entry requests on this service, projected from the sampled traces onto the full population. Observed 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."})}),ace={...sce,endpoint:n.Optional(n.String({description:"Inferred service endpoint address"})),resourceName:n.Optional(n.String({description:"Inferred resource name, e.g. table or queue name"}))},n$=n.Object({...ace,nodeType:n.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:n.Literal("db",{description:"Inferred dependency type. Always `db` for this node variant."}),databaseName:n.Optional(n.String({description:"Database name from span_attributes db.namespace. Matches the database catalog `name`."})),databaseSystem:n.String({description:"Database system from span_attributes db.system.name (falling back to legacy db.system). Matches the database catalog `databaseSystem`."})}),o$=n.Object({...ace,nodeType:n.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:n.Enum(hqe,{description:"Inferred dependency type from span metadata: http, rpc, messaging, genai, or object_store."})}),yqe=D("nodeType",[r$,n$,o$]),i$=n.Object({from:n.Object({env:n.Optional(n.String({description:"Environment of the source node"})),name:n.String({description:"Name of the source node"})},{description:"Reference to the caller node, i.e. the service or dependency that issued the request."}),to:n.Object({env:n.Optional(n.String({description:"Environment of the target node"})),name:n.String({description:"Name of the target node"}),databaseSystem:n.Optional(n.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:n.Number({description:"Estimated number of cross-service transitions on this directed edge in the graph query window. The graph is built from a uniform sample of traces, so this is projected onto the full population rather than counted directly."}),errorRate:n.Optional(n.Number({description:"Ratio of errored client spans to total client spans observed on this edge. Omitted when no client spans were observed. For edges to inferred services, the originating span is treated as the client span regardless of its kind. Computed from the raw sampled counts, so trace sampling does not affect it."})),errorCount:n.Number({description:"Estimated number of client spans with error status on this edge, projected from the sampled traces onto the full population."}),clientSpanCount:n.Number({description:"Estimated number of client spans on this edge, projected from the sampled traces onto the full population."})},{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."}),wyr=f({tags:["service-catalog"],url:`${Ms}/services/:serviceId/graph`,method:"GET",params:n.Object({serviceId:p()}),query:n.Object({...Pr.properties,query:n.Optional(p({type:"tsuga-query"}))}),response:n.Object({clusterId:n.String(),nodes:n.Array(yqe),edges:n.Array(i$)})}),Eqe=n.Object({monitors:n.Array(n.Object({id:n.String({description:"Identifier of the monitor"}),name:n.String({description:"Display name of the monitor"}),owner:n.String({description:"Team ID that owns the monitor"}),priority:n.Enum(En,{description:"Priority of the monitor"})})),slos:n.Array(n.Object({id:n.String({description:"Identifier of the SLO"}),name:n.String({description:"Display name of the SLO"}),owner:n.String({description:"Team ID that owns the SLO"}),statusCount:n.Partial(n.Record(Mp,n.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"})}))}),vyr=f({tags:["service-catalog"],method:"GET",url:`${Ms}/services/:serviceId/related-resources`,params:n.Object({serviceId:p()}),response:Eqe}),Nyr=f({tags:["service-catalog"],method:"GET",url:`${Ms}/services/by-api-keys`,response:n.Record(n.String(),n.Array(n.Object({serviceName:n.String(),serviceNamespace:n.Optional(n.String())})))});var cce="/v0/service-catalog/queues",jR=n.Object({clusterId:n.String(),name:n.String(),env:n.String(),messagingSystem:n.String(),publishPerSecond:n.Number({description:"Messages published per second."}),consumePerSecond:n.Number({description:"Messages consumed per second."}),consumerErrorsPerSecond:n.Number({description:"Messages per second whose consumer span has an error status."}),p90ProcessingMs:n.Number({description:"p90 duration of consumer spans."})}),$yr=f({tags:["service-catalog"],query:n.Object({...ye,clusterId:n.Optional(p({description:"Cluster ID used to restrict the returned queue catalog entries."})),env:n.Optional(p({allowEmpty:!1,description:"Environment used to restrict the queues."})),statsWindow:n.Optional(n.Enum(uS,{description:"Lookback over producer and consumer messaging spans used to list the queues and compute their rates."}))}),method:"GET",paginated:!0,url:cce,response:n.Array(jR)}),Gyr=f({tags:["service-catalog"],method:"GET",url:`${cce}/by-name`,query:n.Object({name:p({allowEmpty:!1}),messagingSystem:p({allowEmpty:!1}),env:p({allowEmpty:!1}),clusterId:n.Optional(p({allowEmpty:!1}))}),response:jR});var uce=`/${"v1"}/queues`,s$=n.Pick(jR,["name","env","messagingSystem","publishPerSecond","consumePerSecond","consumerErrorsPerSecond","p90ProcessingMs"],{$id:"Queue",description:"Message queue inferred from producer and consumer messaging spans (OpenTelemetry `messaging.*` attributes), with its publish, consume, and consumer error rates."}),Tqe={name:"orders",env:"production",messagingSystem:"kafka",publishPerSecond:42.5,consumePerSecond:41.9,consumerErrorsPerSecond:.2,p90ProcessingMs:18.4};Object.assign(s$,{examples:[Tqe]});var pce=n.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Omit to use the first cluster in the organization; this does not query all clusters."})),lce=f({description:"Lists message queues and topics (Kafka, SQS, RabbitMQ and other messaging systems) inferred from producer and consumer messaging spans, with per-second publish, consume and consumer error rates and p90 processing duration over the stats window.",operationId:"listQueues",tags:["queues"],method:"GET",url:uce,paginated:!0,query:n.Object({...Ye,clusterId:pce,env:n.Optional(p({allowEmpty:!1,description:"Environment used to restrict the queues."})),statsWindow:n.Optional(n.Enum(uS,{description:"Lookback over messaging spans used to list the queues and compute their rates. Defaults to `1h`."}))}),response:n.Array(s$)}),dce=f({description:"Retrieves one message queue or topic by name, messaging system and environment, with its rates. Searches the last hour first, then the last 24 hours.",operationId:"getQueue",tags:["queues"],method:"GET",url:`${uce}/by-name`,query:n.Object({name:p({allowEmpty:!1,description:"Queue name (`messaging.destination.name`)."}),messagingSystem:p({allowEmpty:!1,description:"Messaging system (`messaging.system`), for example `kafka` or `aws_sqs`."}),env:p({allowEmpty:!1,description:"Environment the queue was observed in."}),clusterId:pce}),response:s$});var mce=P("queues").pipe(U("List and inspect message queues inferred from messaging spans"),xe([Tr("list",lce,!1),Tr("get",dce,!0)]));var pS=`/${"v1"}/adaptive-notification-rules`,lS=n.Pick(jd,["id","name","owner","isActive","shouldCreateInvestigation","tags","monitorIds","sloIds","fallbackTarget"],{$id:"AdaptiveRule",description:"Adaptive notification rule that reacts to selected monitors and SLOs. When one of them fires, Tsuga pages the owners of the failing service it identifies from the sampled traces, and pages the fallback target when no owner can be resolved. See [Rules](/documentation/alert/notifications/rules)."}),fce={name:"Checkout latency",owner:"team-123-abc",isActive:!0,shouldCreateInvestigation:!0,tags:[{key:"channel",value:"alerts"}],monitorIds:["monitor-123-abc"],sloIds:["slo-456-def"],fallbackTarget:{id:"789-abc-def",rateLimit:{maxMessages:10,minutes:5},config:{type:"email",addresses:["oncall@example.com"],renotifyConfig:{mode:"each",renotificationStates:["alert"],renotifyIntervalMinutes:30}}}},Sqe={id:"123-456-abc",...fce};Object.assign(lS,{examples:[Sqe]});var gce=f({description:"Lists adaptive notification rules: when a selected monitor or SLO fires, they page the owners of the failing service found in sampled traces, or a fallback target. Standard notification rules have their own endpoint.",operationId:"listAdaptiveNotificationRules",tags:["adaptive-notification-rules"],url:pS,method:"GET",paginated:!0,query:n.Object(Ye),response:n.Array(lS)}),hce=f({description:"Retrieves one adaptive notification rule by ID.",operationId:"getAdaptiveNotificationRule",tags:["adaptive-notification-rules"],url:`${pS}/:id`,method:"GET",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the adaptive notification rule to retrieve. Use the `id` returned by adaptive notification rule list or create responses."})}),response:lS}),a$=n.Pick(GR,["name","owner","tags","isActive","shouldCreateInvestigation","monitorIds","sloIds","fallbackTarget"],{description:"Adaptive notification rule create or update request. Provide the monitors or SLOs the rule reacts to, the owner, the active state, and the fallback target."}),_qe=fce;Object.assign(a$,{examples:[_qe]});var yce=f({description:"Creates an adaptive notification rule that pages the owners of the failing service when a selected monitor or SLO fires. Only trace monitors, metric monitors over OTel span metrics, and SLOs over traces or OTel span metrics are eligible.",operationId:"createAdaptiveNotificationRule",tags:["adaptive-notification-rules"],url:pS,method:"POST",body:a$,response:lS}),Ece=f({description:"Updates an existing adaptive notification rule by ID. Required fields and the fallback target are overwritten; omitted optional fields, including `monitorIds` and `sloIds`, keep their existing values. Send an empty array to clear a list.",operationId:"updateAdaptiveNotificationRule",tags:["adaptive-notification-rules"],url:`${pS}/:id`,method:"PUT",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the adaptive notification rule to update. Use the `id` returned by adaptive notification rule list, get, or create responses."})}),body:a$,response:lS}),Tce=f({description:"Deletes an adaptive notification rule by ID. Its monitors and SLOs keep evaluating, but this rule no longer pages anyone.",operationId:"deleteAdaptiveNotificationRule",tags:["adaptive-notification-rules"],url:`${pS}/:id`,method:"DELETE",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the adaptive notification rule to delete. Use the `id` returned by adaptive notification rule list, get, create, or update responses."})}),response:B});var Sce=ve({commandName:"adaptive-notification-rules",description:"Manage adaptive notification rules",endpoints:{list:gce,get:hce,create:yce,update:Ece,delete:Tce}});var Iqe={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"]}},[pEr,qR,dS]=bqe(Iqe),lEr=Object.fromEntries(qR.map(e=>[e,e]));function bqe(e){let t=[],r=[],o=[],i=Object.keys(e);for(let s of i){t.push(s);let a=e[s];for(let u in a){r.push(u);let l=a[u];Array.isArray(l)&&o.push(...l)}}return[c$(t),c$(r),c$(o)]}function c$(e){if(e.length===0)throw new Error("Array must have at least one element.");return e}var u$=n.Enum(["HTTP","HTTPS","TCP","UDP","GENEVE","TLS","TLS_QUIC","TCP_UDP","TCP_QUIC","QUIC"]),xqe=n.Object({versioningStatus:n.Optional(n.Enum(["Enabled","Disabled","Suspended","Not configured"]))}),Oqe=n.Object({domainName:n.Optional(n.String()),origins:n.Optional(n.Array(n.String()))}),Aqe=n.Object({allocatedStorageGib:n.Optional(n.Number()),encryptedAtRest:n.Optional(n.Boolean()),engine:n.Optional(n.String()),dynamoDbItemCount:n.Optional(n.Number()),dynamoDbActualSizeGib:n.Optional(n.Number())}),Cqe=n.Object({version:n.Optional(n.String()),virtualNetworkId:n.Optional(n.String()),subnets:n.Optional(n.Array(n.String()))}),Rqe=n.Object({artifactRegistryFormat:n.Optional(n.Enum(["FORMAT_UNSPECIFIED","DOCKER","MAVEN","NPM","APT","YUM","PYTHON","KFP","GO","GENERIC","RUBY"])),uri:n.Optional(n.String()),tagMutability:n.Optional(n.Enum(["MUTABLE","IMMUTABLE"])),scanOnPush:n.Optional(n.Boolean()),encryptionType:n.Optional(n.String())}),Pqe=n.Object({status:n.Optional(n.String()),activeServices:n.Optional(n.Number()),pendingTasks:n.Optional(n.Number()),runningTasks:n.Optional(n.Number()),registeredContainerInstances:n.Optional(n.Number()),capacityProviders:n.Optional(n.Array(n.String()))}),Uqe=n.Object({status:n.Optional(n.String()),desiredStatus:n.Optional(n.String()),healthStatus:n.Optional(n.String()),availabilityZone:n.Optional(n.String()),startedAt:n.Optional(v()),protectionEnabled:n.Optional(n.Boolean()),protectionExpiresAt:n.Optional(v())}),wqe=n.Object({isEncrypted:n.Optional(n.Boolean()),ownerId:n.Optional(n.String()),state:n.Optional(n.Enum(["creating","available","deleting","deleted","error","updating"]))}),vqe=n.Object({type:n.Optional(n.String()),osType:n.Optional(n.String()),subnetIds:n.Optional(n.Array(n.String())),nbContainers:n.Optional(n.Number())}),Nqe=n.Object({digest:n.String(),imageTags:n.Array(n.String()),imageSizeBytes:n.Optional(n.Number()),imagePushedAt:n.Optional(v()),mediaType:n.Optional(n.String()),repositoryName:n.String(),repositoryId:n.Optional(n.String()),scanStatus:n.Optional(n.String())}),kqe=n.Object({url:n.Optional(n.String()),maxMessageSizeBytes:n.Optional(n.Number()),messageRetentionHours:n.Optional(n.Number())}),Lqe=n.Object({runtime:n.Optional(n.String()),memoryAllocationMib:n.Optional(n.Number()),timeoutMs:n.Optional(n.Number()),ephemeralStorageMib:n.Optional(n.Number({description:"Size of the temporary storage mounted on the function instance, in MiB. Only present for platforms that expose it, such as AWS Lambda."})),codeSha256:n.Optional(n.String())}),Mqe=n.Object({kind:n.Optional(n.String())}),Dqe=n.Object({instanceId:n.String(),architecture:n.Optional(n.String()),instanceType:n.Optional(n.String()),operatingSystem:n.Optional(n.String()),memoryMib:n.Optional(n.Number()),vCpus:n.Optional(n.Number()),vpcId:n.Optional(n.String()),k8sClusterId:n.Optional(n.String())}),Fqe=n.Object({id:n.Optional(n.String()),ipCidrBlocks:n.Array(n.String())}),$qe=n.Object({protocol:n.Optional(u$),port:n.Optional(n.Number()),instanceProtocol:n.Optional(u$),instancePort:n.Optional(n.Number())}),Gqe=n.Object({protocol:n.Optional(n.String()),ports:n.Optional(n.Array(n.String())),portRange:n.Optional(n.String()),allPorts:n.Optional(n.Boolean())}),Bqe=n.Object({name:n.String(),ip:n.Optional(n.String()),type:n.Enum(["public","private"])}),jqe=n.Object({type:n.String(),name:n.String()}),qqe=n.Object({frontendIp:n.Optional(Bqe),backendIpPools:n.Array(jqe)}),Hqe=n.Object({targetId:n.String(),targetPort:n.Optional(n.Number()),targetType:n.Optional(n.Enum(["instance","ip","lambda","alb"])),healthState:n.Optional(n.String()),healthReason:n.Optional(n.String()),healthDescription:n.Optional(n.String()),availabilityZone:n.Optional(n.String())}),Kqe=n.Object({protocol:n.Optional(u$),port:n.Optional(n.Number()),type:n.Optional(n.Enum(["alb","lambda","instance","ip"])),name:n.Optional(n.String()),targetGroupArn:n.Optional(n.String()),virtualNetworkId:n.Optional(n.String()),healthCheckProtocol:n.Optional(n.String()),healthCheckPort:n.Optional(n.String()),healthCheckPath:n.Optional(n.String()),healthCheckIntervalSeconds:n.Optional(n.Number()),healthCheckTimeoutSeconds:n.Optional(n.Number()),healthyThresholdCount:n.Optional(n.Number()),unhealthyThresholdCount:n.Optional(n.Number()),targets:n.Optional(n.Array(Hqe)),targetCount:n.Optional(n.Number()),healthyTargetCount:n.Optional(n.Number()),loadBalancerArns:n.Optional(n.Array(n.String()))}),zqe=n.Object({first:n.Optional(n.String()),last:n.Optional(n.String()),scope:n.Optional(n.Number())}),Yqe=n.Object({type:n.Optional(n.String()),name:n.Optional(n.String()),alwaysServe:n.Optional(n.Boolean()),subnets:n.Optional(n.Array(n.Union([n.Number(),zqe]))),target:n.Optional(n.String()),weight:n.Optional(n.Number()),priority:n.Optional(n.Number()),status:n.Optional(n.String())}),Vqe=n.Object({instanceId:n.Optional(n.String()),state:n.Optional(n.String()),reasonCode:n.Optional(n.String()),description:n.Optional(n.String())}),Wqe=n.Object({loadBalancerType:n.Optional(n.String()),dnsName:n.Optional(n.String()),virtualNetworkId:n.Optional(n.String()),subnetIds:n.Array(n.String()),scheme:n.Optional(n.String()),listeners:n.Optional(n.Union([n.Array($qe),n.Array(Gqe)])),targets:n.Optional(n.Union([n.Array(n.String()),n.Array(Vqe),n.Array(Yqe)])),azureLoadBalancingRules:n.Optional(n.Array(qqe))}),Qqe=n.Object({domainName:n.Optional(n.String()),expiresAt:n.Optional(v()),inUseBy:n.Optional(n.Array(n.String())),renewalEligibility:n.Optional(n.String()),revokedAt:n.Optional(v()),status:n.Optional(n.String()),type:n.Optional(n.String())}),Zqe=n.Object({state:n.Optional(n.Enum(["creating","available","deleting","deleted","error","in-use"])),volumeType:n.Optional(n.Enum(["gp2","gp3","io1","io2","st1","sc1","standard"]))}),Xqe=n.Object({osType:n.Optional(n.Enum(["Windows","Linux"]))}),Jqe=n.Object({state:n.Optional(n.String()),volumeType:n.Optional(n.String())}),eHe=n.Intersect([n.Object({isEncrypted:n.Optional(n.Boolean()),sizeGib:n.Optional(n.Number())}),n.Union([Zqe,Jqe,Xqe])]),tHe=n.Object({instanceCount:n.Optional(n.Number()),hostnames:n.Optional(n.Array(n.String())),runtime:n.Optional(n.String())}),HR=n.Union([n.Object({category:n.Literal("application"),resourceType:n.Literal("webService"),attributes:n.Optional(tHe)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("bucket"),attributes:n.Optional(xqe)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("messagingService"),attributes:n.Optional(kqe)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("fileSystem"),attributes:n.Optional(wqe)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("contentDeliveryNetwork"),attributes:n.Optional(Oqe)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("database"),attributes:n.Optional(Aqe)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("storageAccount"),attributes:n.Optional(Mqe)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("volume"),attributes:n.Optional(eHe)}),n.Object({category:n.Literal("compute"),resourceType:n.Literal("virtualMachine"),attributes:n.Optional(Dqe)}),n.Object({category:n.Literal("compute"),resourceType:n.Literal("serverless"),attributes:n.Optional(Lqe)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("kubernetesCluster"),attributes:n.Optional(Cqe)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerRepository"),attributes:n.Optional(Rqe)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerCluster"),attributes:n.Optional(Pqe)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerServiceTask"),attributes:n.Optional(Uqe)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerService"),attributes:n.Optional(vqe)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerImage"),attributes:n.Optional(Nqe)}),n.Object({category:n.Literal("network"),resourceType:n.Literal("virtualNetwork"),attributes:n.Optional(Fqe)}),n.Object({category:n.Literal("network"),resourceType:n.Literal("loadBalancer"),attributes:Wqe}),n.Object({category:n.Literal("network"),resourceType:n.Literal("targetGroup"),attributes:n.Optional(Kqe)}),n.Object({category:n.Literal("network"),resourceType:n.Literal("certificate"),attributes:n.Optional(Qqe)})],{description:"Normalized public inventory category, resource type, and category-specific attributes. Attribute shape depends on the category and resourceType combination."});var qd="/v0/inventory",_ce=["scan_in_progress","success","failure","partial"],l$=n.Object({id:n.String({description:"Identifier of the inventory resource. Generated by Tsuga."}),cloudPlatform:n.Enum(Sp,{description:"Cloud platform where Tsuga discovered this resource."}),cloudAccount:n.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:n.Optional(n.String({description:"Cloud region where Tsuga discovered this resource, when the resource is regional."})),fullyQualifiedResourceId:n.String({description:"Cloud-native unique identifier for this resource, such as an AWS ARN, GCP resource name, or Azure resource ID."}),displayName:n.String({description:"Human-readable resource name shown in Tsuga. Derived from cloud provider metadata when available."}),nativeResourceType:n.String({description:"Cloud-native resource type reported by the inventory integration, for example `aws_ec2_instance` or `gcp_bucket`."}),resourceCreatedAt:n.Optional(v({description:"Timestamp when the resource was created in the cloud, when known."})),resourceUpdatedAt:n.Optional(v({description:"Timestamp when the resource was last updated in the cloud, when known."})),resourceLastSeenAt:v({description:"Timestamp when Tsuga last observed this resource during an inventory scan."}),tags:kt,nativeAttributes:n.Optional(n.Unsafe({type:"object",additionalProperties:!0})),covered:n.Optional(n.Boolean({description:"Whether the resource is covered by the configured infrastructure-as-code identifiers"}))}),qg={DISPLAY_NAME:"displayName",CLOUD_ACCOUNT:"cloudAccount",NATIVE_RESOURCE_TYPE:"nativeResourceType",CLOUD_REGION:"cloudRegion",RESOURCE_TYPE:"resourceType",RESOURCE_CREATED_AT:"resourceCreatedAt"},Ice=n.Object({cloudPlatforms:he(n.Enum(Sp),{description:"Restrict results to resources discovered on any of these cloud platforms",maxItems:Sp.length}),cloudAccounts:he(p({allowEmpty:!1}),{description:"Restrict results to resources in any of these cloud accounts",maxItems:500}),cloudRegions:he(p({allowEmpty:!1}),{description:"Restrict results to resources in any of these cloud regions",maxItems:500}),nativeResourceTypes:he(n.Enum(dS),{description:"Restrict results to resources of any of these cloud-native resource types",maxItems:dS.length}),resourceTypes:he(n.Enum(qR),{description:"Restrict results to resources of any of these normalized resource types",maxItems:qR.length}),tags:he(on.items,{description:"Restrict results to resources that have at least one of the listed key/value tags",maxItems:50}),isIacManaged:n.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:n.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:n.Optional(n.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"}),d$=n.Partial(n.Object({...ye,filters:n.Partial(Ice,{description:"Filters applied to narrow the returned resources."}),sort:n.Object({by:n.Enum([qg.DISPLAY_NAME,qg.CLOUD_ACCOUNT,qg.NATIVE_RESOURCE_TYPE,qg.CLOUD_REGION,qg.RESOURCE_TYPE,qg.RESOURCE_CREATED_AT],{description:"Field to sort the returned resources by"}),direction:me},{description:"Optional sorting applied to the returned resources. Ties are broken by resource ID for stable pagination."})})),SEr=f({tags:["inventory"],method:"POST",url:`${qd}/resources/query`,paginated:!0,body:d$,response:n.Array(n.Intersect([l$,HR]))}),rHe=["resourceType","cloudAccount","isIacManaged"],_Er=f({tags:["inventory"],method:"POST",url:`${qd}/resources/counts`,body:n.Object({filters:n.Optional(n.Partial(Ice)),groupBy:n.Enum(rHe,{description:"Dimension to group the resource counts by."})}),response:n.Array(n.Object({value:n.String({description:'The group value the count belongs to: a resource type, a cloud account id, or "true"/"false" for IaC coverage.'}),count:n.Integer({description:"Number of resources in this group matching the requested filters."})}))}),IEr=f({tags:["inventory"],method:"GET",url:`${qd}/resources/filter-options`,response:n.Object({cloudRegions:n.Array(n.String(),{description:"Distinct cloud regions present across the tenant's resources."}),nativeResourceTypes:n.Array(n.String(),{description:"Distinct cloud-native resource types present across the tenant's resources."}),tags:Qr})}),bEr=D("type",[n.Object({type:n.Literal("aws",{description:"Discriminator identifying AWS connection settings."}),accountId:n.String({description:"AWS account ID that Tsuga scans."}),externalId:n.String({description:"External ID Tsuga passes when assuming the cross-account IAM role."}),roleArn:n.String({description:"ARN of the IAM role Tsuga assumes to read inventory in the account."})}),n.Object({type:n.Literal("gcp",{description:"Discriminator identifying GCP connection settings."}),projectId:n.String({description:"GCP project ID that Tsuga scans."}),serviceAccountId:n.String({description:"Service account Tsuga impersonates to read inventory."}),workloadIdentityProvider:n.String({description:"Workload identity provider resource name used for federated authentication."})}),n.Object({type:n.Literal("azure",{description:"Discriminator identifying Azure connection settings."}),clientId:n.String({description:"Client ID of the Azure application Tsuga authenticates as."}),subscriptionId:n.String({description:"Azure subscription ID that Tsuga scans."}),tenantId:n.String({description:"Azure tenant ID that owns the subscription."})})]),nHe="^[0-9]{12}$",oHe="^arn:aws[a-z-]*:iam::[0-9]{12}:role/.+$",iHe="^[a-z][a-z0-9-]{4,28}[a-z0-9]$",sHe="^[^@\\s]+@[^@\\s]+\\.iam\\.gserviceaccount\\.com$",aHe="^//iam\\.googleapis\\.com/projects/[0-9]+/locations/global/workloadIdentityPools/[^/]+/providers/[^/]+$",p$="^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$",cHe=n.Object({type:n.Literal("aws",{description:"Discriminator identifying AWS connection settings."}),accountId:n.String({pattern:nHe,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:n.String({pattern:oHe,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"}),uHe=n.Object({type:n.Literal("gcp",{description:"Discriminator identifying GCP connection settings."}),projectId:n.String({pattern:iHe,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:n.String({pattern:sHe,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:n.String({pattern:aHe,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"}),pHe=n.Object({type:n.Literal("azure",{description:"Discriminator identifying Azure connection settings."}),clientId:n.String({pattern:p$,minLength:1,description:"Client ID of the Azure application Tsuga authenticates as (GUID).",errorMessage:{pattern:"Must be a GUID."}}),subscriptionId:n.String({pattern:p$,minLength:1,description:"Azure subscription ID that Tsuga scans (GUID).",errorMessage:{pattern:"Must be a GUID."}}),tenantId:n.String({pattern:p$,minLength:1,description:"Azure tenant ID that owns the subscription (GUID).",errorMessage:{pattern:"Must be a GUID."}})},{$id:"AzureConnectionSettings"}),bce=D("type",[cHe,uHe,pHe],{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`."}),Hg=n.Object({id:n.String({description:"Identifier of the cloud account. Generated by Tsuga."}),cloudType:n.Enum(Sp,{description:"Cloud provider of the account."}),cloudAccountId:n.String({description:"Cloud-native account identifier: an AWS account ID, GCP project ID, or Azure subscription ID."}),accountFriendlyName:n.Optional(n.String({description:"Human-readable name for the account shown in Tsuga."})),organizationId:n.Optional(n.String({description:"Cloud organization identifier, when known."})),createdBy:n.Optional(n.String({description:"Identifier of the user who created the account, when created by a user."})),createdAt:v({description:"Timestamp when the account was registered in Tsuga."}),lastScanStartedAt:n.Optional(v({description:"Timestamp when the most recent inventory scan started."})),lastScanFinishedAt:n.Optional(v({description:"Timestamp when the most recent inventory scan finished."})),lastScanStatus:n.Optional(n.Enum(_ce,{description:"Status of the most recent inventory scan."}))}),m$=n.Object({cloudType:n.Enum(Sp,{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:n.Optional(p({description:"Human-readable name for the account shown in Tsuga."})),organizationId:n.Optional(p({description:"Cloud organization identifier, when known."})),connectionSettings:bce,lastScanStatus:n.Optional(n.Enum(_ce,{description:"Status of the most recent inventory scan."}))}),Hd=`${qd}/cloud-accounts`,xEr=f({tags:["inventory"],url:Hd,method:"GET",response:n.Array(Hg)}),OEr=f({tags:["inventory"],url:`${Hd}/:id`,method:"GET",params:n.Object({id:p()}),response:Hg}),AEr=f({tags:["inventory"],url:Hd,method:"POST",body:m$,response:Hg}),f$=n.Object({accountFriendlyName:p({description:"Human-readable name for the account shown in Tsuga."})}),CEr=f({tags:["inventory"],url:`${Hd}/:id`,method:"PUT",params:n.Object({id:p()}),body:f$,response:Hg}),REr=f({tags:["inventory"],url:`${Hd}/:id`,method:"DELETE",params:n.Object({id:p()}),response:B}),PEr=f({tags:["inventory"],url:`${qd}/trigger-scan`,method:"POST",body:n.Object({}),response:n.Object({success:n.Literal(!0)})}),UEr=f({tags:["inventory"],url:`${Hd}/azure/onboarding`,method:"POST",body:n.Object({tenantId:p()}),response:n.Object({subjectId:n.String(),audience:n.String()})}),wEr=f({tags:["inventory"],method:"POST",url:`${Hd}/validate/:type`,params:n.Object({type:p()}),body:n.Object({data:bce,id:n.Optional(p())}),response:n.Object({areAccountSettingsValid:n.Boolean(),message:n.Optional(n.String())})}),xce=`${qd}/settings`,vEr=f({tags:["inventory"],url:xce,method:"GET",response:n.Object({settings:n.Optional(n.Object({id:n.String(),infrastructureIdentifiers:n.Array(n.Object({name:n.String(),value:n.Optional(n.String())}))}))})}),lHe=50,NEr=f({tags:["inventory"],url:xce,method:"POST",body:n.Object({infrastructureIdentifiers:n.Array(n.Object({name:p({allowEmpty:!1}),value:n.Optional(p({allowEmpty:!1}))}),{maxItems:lHe})}),response:n.Object({})}),kEr=f({tags:["inventory"],url:`${qd}/iac-tags-proposal`,method:"GET",response:n.Array(n.Object({name:n.String(),value:n.Optional(n.String())}))});var Oce=`/${"v1"}/inventory`,dHe=n.Omit(l$,["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)."}),Ace=n.Intersect([dHe,HR],{$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)."}),mHe={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(Ace,{examples:[mHe]});var Cce=n.Object({...d$.properties,...Ye},{description:"Inventory resource query request. Use filters, sorting, limit, and offset to page through discovered resources."}),fHe={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(Cce,{examples:[fHe]});var Rce=f({description:"Lists or searches cloud resources (AWS, GCP or Azure, for example EC2 instances or S3 buckets) found by inventory scans of connected cloud accounts, by platform, account, region, resource type, tag or infrastructure-as-code coverage.",operationId:"queryInventoryResources",tags:["inventory"],url:`${Oce}/resources/query`,method:"POST",paginated:!0,body:Cce,response:n.Array(Ace)}),mS=`${Oce}/cloud-accounts`,fS=n.Pick(Hg,["id","cloudType","cloudAccountId","accountFriendlyName"],{$id:"CloudAccount"}),gHe={id:"123-456-abc",cloudType:"aws",cloudAccountId:"123456789012",accountFriendlyName:"Production AWS"};Object.assign(fS,{examples:[gHe]});var Pce=n.Pick(m$,["cloudType","cloudAccountId","accountFriendlyName","connectionSettings"]),hHe={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(Pce,{examples:[hHe]});var Uce=n.Pick(f$,["accountFriendlyName"]),yHe={accountFriendlyName:"Production AWS"};Object.assign(Uce,{examples:[yHe]});var qEr=f({description:"Lists the cloud accounts connected to Tsuga (AWS accounts, GCP projects, Azure subscriptions), with provider and display name.",operationId:"listCloudAccounts",tags:["inventory"],url:mS,method:"GET",response:n.Array(fS)}),HEr=f({description:"Retrieves one cloud account by ID.",operationId:"getCloudAccount",tags:["inventory"],url:`${mS}/:id`,method:"GET",params:n.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:fS}),KEr=f({description:"Registers a cloud account for inventory scanning. Connection settings are stored as provided and are not validated at creation time; scan failures surface through `lastScanStatus`.",operationId:"createCloudAccount",tags:["inventory"],url:mS,method:"POST",body:Pce,response:fS}),zEr=f({description:"Updates the friendly name of a cloud account by ID.",operationId:"updateCloudAccount",tags:["inventory"],url:`${mS}/:id`,method:"PUT",params:n.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:Uce,response:fS}),YEr=f({description:"Deletes a cloud account by ID. Future inventory scans stop for the account, and the trust relationship on the cloud side can be safely removed afterward.",operationId:"deleteCloudAccount",tags:["inventory"],url:`${mS}/:id`,method:"DELETE",params:n.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:B});var wce=ve({commandName:"cloud-resources",description:"List cloud resources discovered by inventory scans",endpoints:{list:Rce},enableListBody:!0});var gS=`/${"v1"}/custom-roles`,hS=n.Pick(kd,["id","name","description","teamScope","assets","telemetry","telemetryQuery"],{$id:"CustomRole",description:"Global role defined by the organization. It sets which teams its holders reach, which telemetry signals they can query, and which resource types they can read or write. See [Custom global roles](/documentation/account-and-settings/roles-and-permissions#custom-global-roles)."}),EHe={id:"123-456-abc",name:"Platform on-call",description:"Edits monitors and dashboards of the platform teams.",teamScope:{type:"specific",teamIds:["team-123-abc"]},assets:{dashboard:"write",monitor:"write",team:"read"},telemetry:["log","metric","trace"],telemetryQuery:[{key:"context.env",values:["production"]}]};Object.assign(hS,{examples:[EHe]});var g$=n.Pick(xR,["name","description","teamScope","assets","telemetry","telemetryQuery"],{description:"Custom role create or update request. Provide the role name, optional description, team scope, resource type grants, readable telemetry signals, and optional telemetry restriction."}),THe={name:"Platform on-call",description:"Edits monitors and dashboards of the platform teams.",teamScope:{type:"specific",teamIds:["team-123-abc"]},assets:{dashboard:"write",monitor:"write",team:"read"},telemetry:["log","metric","trace"],telemetryQuery:[{key:"context.env",values:["production"]}]};Object.assign(g$,{examples:[THe]});var vce=f({description:"Lists every custom global role (RBAC permissions, access control) of the organization, ordered by name, with what each role grants.",operationId:"listCustomRoles",tags:["custom-roles"],url:gS,method:"GET",response:n.Array(hS)}),Nce=f({description:"Retrieves one custom global role by ID.",operationId:"getCustomRole",tags:["custom-roles"],url:`${gS}/:id`,method:"GET",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the custom role to retrieve. Use the `id` returned by custom role list, create, or update responses."})}),response:hS}),kce=f({description:"Creates a custom global role. The name must be unique across the organization. Grants on resource types a custom role cannot configure are dropped. Requires write access on custom roles, which only an operation key scoped to all teams can hold. Only a Global admin can first grant it to a key; a key holding it and write access on operation API keys can then pass it on to the keys it creates or updates.",operationId:"createCustomRole",tags:["custom-roles"],url:gS,method:"POST",body:g$,response:hS}),Lce=f({description:"Replaces the name, team scope, resource type grants, and telemetry signals of a custom global role by ID. The new grants apply to every user holding the role. Requires write access on custom roles, which only an operation key scoped to all teams can hold.",operationId:"updateCustomRole",tags:["custom-roles"],url:`${gS}/:id`,method:"PUT",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the custom role to update. Use the `id` returned by custom role list, get, or create responses."})}),body:g$,response:hS}),Mce=f({description:"Deletes a custom global role by ID. Fails while a user still holds the role; change their global role first. Pending invitations that carry the role are deleted with it. Requires write access on custom roles, which only an operation key scoped to all teams can hold.",operationId:"deleteCustomRole",tags:["custom-roles"],url:`${gS}/:id`,method:"DELETE",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the custom role to delete. Use the `id` returned by custom role list, get, create, or update responses."})}),response:B});var Dce=ve({commandName:"custom-roles",description:"Manage custom global roles",endpoints:{list:vce,get:Nce,create:kce,update:Lce,delete:Mce}});var zg="/v0/dashboard-folders",Yg=n.Object({id:n.String({description:"Tsuga-generated dashboard folder ID assigned when the folder is created. Use it as dashboard `folderId` or child-folder `parentFolderId`."}),name:n.String({description:"Display name of the dashboard folder. Set by the caller on create or update."}),owner:n.String({description:"ID of the team that owns the dashboard folder. Set by the caller on create or update and used for folder access control."}),parentFolderId:n.Optional(n.String({description:"ID of the top-level parent folder when this folder is nested. Set by the caller on create or update. Returned only for child folders; omitted for top-level folders."})),tags:kt,creator:n.Optional(be),updater:n.Optional(be),createdAt:v(),updatedAt:v()},{title:"DashboardFolder"}),h$=n.Object({...Yg.properties,dashboardCount:n.Number({description:"Number of dashboards in this folder and its readable subfolders that the caller can read. Returned only by folder list responses; callers without dashboard read access see 0."}),folderCount:n.Number({description:"Number of folders nested directly under this folder that the caller can read."})}),KR=n.Object({name:p({allowEmpty:!1,description:"Display name of the dashboard folder. Required and non-empty."}),owner:p({allowEmpty:!1,description:"ID of the team that owns the dashboard folder. Required and used for folder access control."}),parentFolderId:n.Optional(n.Union([n.Null(),p({allowEmpty:!1})],{description:"ID of the top-level folder to nest this folder under. Omit on create or pass null to create a top-level folder; omit on update to keep the current parent; pass null on update to move the folder to top level. Non-null values must name a readable top-level folder. Folders can be nested at most two levels deep."})),tags:qt}),zR=n.Partial(n.Object({owners:he(p({allowEmpty:!1}),{description:"Restrict results to dashboard folders owned by any of these team IDs",maxItems:50}),searchQuery:n.Object({value:p({allowEmpty:!1,description:"Substring matched case-insensitively against dashboard folder names or folder IDs. Omit the whole `searchQuery` filter to skip text filtering."}),exclude:n.Optional(n.Boolean({description:"If true, exclude dashboard folders matching this value instead of including them"}))},{description:"Text filter for dashboard folder names or IDs. Optional; `exclude: true` returns folders whose name and ID do not match the substring."}),tags:he(on.items,{description:"Restrict results to dashboard folders that have at least one of the listed key/value tags",maxItems:50}),parentFolderId:n.Union([n.Null(),p({allowEmpty:!1})],{description:"Parent folder filter for dashboard folder query results. Optional; pass a folder ID to return the child folders nested directly under it, or null to return only top-level folders. Omit to return all folders."})},{description:"Optional filters applied to narrow the returned dashboard folders"})),Kg={IS_FAVORITE:"isFavorite",OWNER:"owner",TAGS:"tags",DASHBOARD_COUNT:"dashboardCount",UPDATED_AT:"updatedAt",NAME:"name"},y$=[Kg.OWNER,Kg.TAGS,Kg.DASHBOARD_COUNT,Kg.UPDATED_AT,Kg.NAME],SHe=n.Partial(n.Object({...ye,filters:zR,sort:n.Object({by:n.Enum([...y$,Kg.IS_FAVORITE],{description:"Field to sort the returned dashboard folders by"}),direction:me},{description:"Optional sorting applied to the returned dashboard folders"})})),fTr=f({tags:["dashboard-folders"],url:`${zg}/query`,method:"POST",paginated:!0,body:SHe,response:n.Array(h$)}),gTr=f({tags:["dashboard-folders"],url:`${zg}/:id`,method:"GET",params:n.Object({id:p()}),response:Yg}),hTr=f({tags:["dashboard-folders"],url:zg,method:"POST",body:KR,response:Yg}),yTr=f({tags:["dashboard-folders"],url:`${zg}/:id`,method:"PUT",params:n.Object({id:p()}),body:KR,response:Yg}),ETr=f({tags:["dashboard-folders"],url:`${zg}/:id`,method:"DELETE",params:n.Object({id:p()}),response:B}),TTr=f({tags:["dashboard-folders"],url:`${zg}/tags/query`,method:"POST",body:n.Object({filters:n.Optional(n.Omit(zR,["tags"]))}),response:Qr});var yS=`/${"v1"}/dashboard-folders`,YR=n.Pick(Yg,["id","name","owner","parentFolderId","tags"],{$id:"DashboardFolder",description:"Folder used to organize dashboards into a two-level hierarchy"}),Fce={id:"123-456-abc",name:"Platform",owner:"team-123-abc",tags:[{key:"team",value:"platform"}]};Object.assign(YR,{examples:[Fce]});var $ce=n.Pick(h$,["id","name","owner","parentFolderId","tags","dashboardCount"],{$id:"DashboardFolderWithDashboardCount",description:"Folder used to organize dashboards into a two-level hierarchy, including the number of readable dashboards in it and its readable subfolders."}),_He={...Fce,dashboardCount:10};Object.assign($ce,{examples:[_He]});var E$=n.Pick(KR,["name","owner","parentFolderId","tags"],{description:"Dashboard folder create or update request. Provide a name, owner team, optional parent folder, and optional tags."}),IHe={name:"Platform",owner:"team-123-abc",parentFolderId:null,tags:[{key:"team",value:"platform"}]};Object.assign(E$,{examples:[IHe]});var bHe=n.Object({by:n.Enum(y$,{description:"Field to sort the returned dashboard folders by: `owner` sorts by owning team name, `tags` sorts by tag key/value pairs, `dashboardCount` sorts by the number of readable dashboards in the folder and its readable subfolders, `updatedAt` sorts by last-updated timestamp, and `name` sorts alphabetically by folder name."}),direction:me},{description:"Optional sorting applied to the returned dashboard folders"}),Gce=n.Object({...Ye,filters:n.Optional(n.Pick(zR,["owners","searchQuery","tags","parentFolderId"])),sort:n.Optional(bHe)},{description:"Dashboard folder query request. Use filters, sorting, limit, and offset to page through visible dashboard folders."}),xHe={filters:{owners:{values:["team-123-abc"]},searchQuery:{value:"Platform"},tags:{values:[{key:"team",value:"platform"}]}},sort:{by:"name",direction:"asc"},limit:10,offset:0};Object.assign(Gce,{examples:[xHe]});var Bce=f({description:"Lists or searches dashboard folders by owning team, name or ID substring, tags or parent folder, with the number of readable dashboards in each folder and its readable subfolders. Returns every folder unless `parentFolderId` is set: a folder ID selects its children, null only top-level folders. Most recently updated first unless `sort` is set.",operationId:"queryDashboardFolders",tags:["dashboard-folders"],url:`${yS}/query`,method:"POST",paginated:!0,body:Gce,response:n.Array($ce)}),jce=f({description:"Retrieves one dashboard folder by ID.",operationId:"getDashboardFolder",tags:["dashboard-folders"],url:`${yS}/:id`,method:"GET",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the dashboard folder to retrieve. Use the `id` returned by folder list, get, create, or update responses."})}),response:YR}),qce=f({description:"Creates a dashboard folder owned by the specified team. To create a child folder, set `parentFolderId` to a readable top-level folder.",operationId:"createDashboardFolder",tags:["dashboard-folders"],url:yS,method:"POST",body:E$,response:YR}),Hce=f({description:"Updates an existing dashboard folder by ID. Send the folder name, owner, tags, and parent relationship; omit `parentFolderId` to keep the current parent or send null to move the folder to top level.",operationId:"updateDashboardFolder",tags:["dashboard-folders"],url:`${yS}/:id`,method:"PUT",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the dashboard folder to update. Use the `id` returned by folder list, get, create, or update responses."})}),body:E$,response:YR}),Kce=f({description:"Deletes an empty dashboard folder by ID. The request fails if the folder still contains dashboards or child folders; dashboards and child folders are not moved or deleted automatically.",operationId:"deleteDashboardFolder",tags:["dashboard-folders"],url:`${yS}/:id`,method:"DELETE",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the dashboard folder to delete. Use the `id` returned by folder list, get, create, or update responses."})}),response:B});var zce=ve({commandName:"dashboard-folders",description:"Manage dashboard folders",endpoints:{list:Bce,get:jce,create:qce,update:Hce,delete:Kce},enableListBody:!0});var Ba="/v0/dashboards",Yce=["white","gray.100","amber.200","lime.200","emerald.200","cyan.200","blue.200","violet.200","fuchsia.200","pink.200","red.200"],OHe=["bar","distribution","gauge","heatmap","list","pie","query-value","slo","table","timeline","timeseries","top-list"],KTr=[...OHe,"note","group"];var AHe=["ns","us","ms","s","m","h","days"];var CHe=["B","KB","MB","GB","TB","PB"],RHe=["bit","Kibit","Mibit","Gibit","Tibit","Pibit"],PHe=[...CHe,...RHe];var UHe=20;var Vce=n.Object({type:n.Literal("cpu",{description:"Normalizes values as CPU usage"})},{$id:"DataNormalizerCpu",title:"CPU"}),Wce=n.Object({type:n.Literal("duration",{description:"Normalizes values as durations using standard time units"}),unit:n.Enum(AHe,{description:"Time unit used to present the normalized values"})},{$id:"DataNormalizerDuration",title:"Duration"}),Qce=n.Object({type:n.Literal("data",{description:"Normalizes values as data sizes using byte or bit units"}),unit:n.Enum(PHe,{description:"Data size unit of the raw values. Byte units (B, KB, MB, ...) scale in steps of 1000. Bit units (bit, Kibit, Mibit, ...) are binary: values are converted to bytes and scale in steps of 1024 (KiB, MiB, GiB, ...)."})},{$id:"DataNormalizerData",title:"Data"}),Zce=n.Object({type:n.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"}),Xce=n.Object({type:n.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"}),Jce=n.Object({type:n.Literal("date",{description:"Formats values as calendar dates"})},{$id:"DataNormalizerDate",title:"Date"}),eue=n.Object({type:n.Literal("level",{description:"Displays values using their log level name"})},{$id:"DataNormalizerLevel",title:"Level"}),tue=n.Object({type:n.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"}),wHe=n.Object({type:n.Literal("custom",{description:"Normalizes values using a custom unit label"}),unit:n.String({description:"Text label describing the custom unit"})},{$id:"DataNormalizerCustom",title:"Custom"}),vHe=n.Object({type:n.Literal("custom",{description:"Normalizes values using a custom unit label"}),unit:n.String({description:"Text label describing the custom unit. Must not be empty.",minLength:1,maxLength:UHe})},{$id:"InputDataNormalizerCustom",title:"Custom"}),mr=D("type",[Wce,Qce,Zce,Xce,Jce,eue,Vce,tue,wHe],{title:"Normalizer",description:"Display-value formatter for widget values or list/table columns."}),fr=D("type",[Wce,Qce,Zce,Xce,Jce,eue,Vce,tue,vHe],{title:"Normalizer",description:"Display-value formatter for widget values or list/table columns."}),WR=n.Object({attribute:n.String({description:"Attribute (log field or database row column) displayed as a column in the list"}),normalizer:n.Optional(mr)},{title:"WidgetListColumn",description:"List column pairing a displayed attribute with the formatting applied to its values."}),QR=n.Object({attribute:n.String({description:"Attribute (log field or database row column) displayed as a column in the list"}),normalizer:n.Optional(fr)},{title:"WidgetListColumn",description:"List column pairing a displayed attribute with the formatting applied to its values."}),Vg=["background","no-background"],NHe=["table","legend-only","no-legend"];var kHe=["greater_than","less_than","equal","not_equal","greater_than_or_equal","less_than_or_equal"],rue=["alert","warning","success"],nue=({colors:e,operatorDescription:t,valueDescription:r,colorDescription:o})=>({operator:n.Enum(kHe,{description:t}),value:n.Number({description:r}),color:n.Enum(e,{description:o})}),ja=n.Object(nue({colors:rue,operatorDescription:"Comparator used to evaluate the metric value",valueDescription:"Threshold value used when evaluating the operator",colorDescription:"Color applied when the condition is met"}),{title:"ConditionalFormatting",description:"Color rule evaluated against the raw query value, before the unit is applied. The first matching rule in the array is applied."}),LHe=n.Object({value:n.Number({description:"Y-axis value where the threshold marker is placed"}),level:n.Enum(rue,{description:"Level applied to the threshold marker"})},{title:"ThresholdMarker",description:"Marker line drawn across the chart at a fixed value, colored by its level."}),MHe=["sec","min","hour","day"],qa=n.Object({time:n.Number({description:"Numeric count of `metric` units in each bucket. Required when `timeBucket` is present."}),metric:n.Enum(MHe,{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 Ga=n.Enum(["flex-start","center","flex-end"],{description:"Flex alignment keyword used for widget layout"}),Kd=n.Object({formula:n.Optional(n.String({description:"Optional alias for formula (only used for display in the UI)"})),queries:n.Optional(n.Record(n.String(),n.String({description:'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."}),zd=n.Object({formula:n.Optional(p({type:"short",description:"Optional alias for formula (only used for display in the UI)"})),queries:n.Optional(n.Record(n.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."}),ZR={source:_i,queries:DX,formula:n.Optional(rC),aliases:n.Optional(Kd),visibleSeries:n.Optional(n.Array(n.Boolean(),{description:"Flags indicating whether each query or formula series is visible"}))},XR={source:_i,queries:ET,formula:n.Optional(Ed),aliases:n.Optional(zd),visibleSeries:n.Optional(n.Array(n.Boolean(),{description:"Flags indicating whether each query or formula series is visible"}))},rs=n.Optional(n.Enum(["relative","absolute"],{description:"`absolute` keeps each group at its own value; `relative` shows it as a percentage of the ungrouped total (defaults to absolute)"})),Yd={...ZR,groupBy:n.Optional(ag)},Vd={...XR,groupBy:n.Optional(Yc)},Zr=n.Enum(NHe,{description:"Controls whether and how the widget displays legend or series details (e.g. table, legend-only, or no legend)"}),lt=n.Optional(n.Union([n.Number(),n.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."})),ns=n.Optional(n.Array(LHe,{description:"Threshold markers displayed on the chart"})),DHe="^https?:\\/\\/(?:[^\\s{}]|\\{\\{group\\.[^}\\s]+\\}\\})+$",oue='Text of the entry added to the widget context menu. Defaults to "Open custom link" when omitted.',iue="URL opened in a new tab by the context menu entry. Every `{{group.<field>}}` placeholder is replaced by the URL-encoded value the clicked series has for that group-by field; without placeholders, every series opens the same URL. `{` and `}` are only allowed as part of a placeholder. Tsuga omits the menu entry when the clicked series has no value for one of the referenced fields.",ES=n.Object({label:n.Optional(n.String({description:oue})),url:n.String({description:iue})},{$id:"WidgetCustomLink",title:"CustomLink"}),TS=n.Object({label:n.Optional(p({allowEmpty:!1,description:oue})),url:n.String({pattern:DHe,maxLength:Ei,description:iue})},{$id:"InputWidgetCustomLink",title:"CustomLink"});var T$=["monitor","slo"],sue="Events displayed on top of the chart, over its time axis, so they can be correlated with the plotted data. A widget carries at most one overlay, and each kind of overlay carries its own settings.",aue=n.Literal("service-deployments",{description:"Draws the deployments contained in the time range over the chart"}),cue="IDs of the teams whose services the app offers in its Services picker. It does not select what is drawn: the overlay draws only the services listed in `services`.",uue="OpenTelemetry service names whose deployments are drawn. Nothing is drawn until at least one service is set.",pue="Environment whose deployments are drawn. Deployments from every environment are drawn when omitted.",FHe=n.Object({type:aue,teams:n.Optional(n.Array(n.String(),{description:cue})),services:n.Optional(n.Array(n.String(),{description:uue})),env:n.Optional(n.String({description:pue}))},{$id:"WidgetServiceDeploymentsOverlay",title:"ServiceDeploymentsOverlay"}),$He=n.Object({type:aue,teams:n.Optional(n.Array(p({allowEmpty:!1}),{maxItems:50,description:cue})),services:n.Optional(n.Array(p({allowEmpty:!1}),{maxItems:200,description:uue})),env:n.Optional(p({allowEmpty:!1,description:pue}))},{$id:"InputWidgetServiceDeploymentsOverlay",title:"ServiceDeploymentsOverlay"}),lue="Tsuga query selecting the log events drawn over the chart. Nothing is drawn when omitted. An empty string draws every log event in the time range.",GHe=n.Object({type:n.Literal("logs",{description:"Draws log events over the chart"}),query:n.Optional(n.String({description:lue}))},{$id:"WidgetLogsOverlay",title:"LogsOverlay"}),BHe=n.Object({type:n.Literal("logs",{description:"Draws log events over the chart"}),query:n.Optional(p({type:"tsuga-query",description:lue}))},{$id:"InputWidgetLogsOverlay",title:"LogsOverlay"}),due="Kinds of alert drawn over the chart. Both monitor and SLO alerts are drawn when omitted. On its own, it does not make the overlay draw: set `query` or a filter too.",mue="Case-insensitive substring matched against the alert, the same way the Ongoing alerts page matches its search box. An empty string matches every alert. Nothing is drawn unless `query` or at least one filter is set.",fue="Narrows the drawn alerts. An alert must match every listed filter, and a filter matches when the alert has any of its values.",gue="Names of the teams owning the monitor, or the SLO for an SLO alert. Names rather than IDs, matching how the Ongoing alerts page filters by owner.",hue="Group-by dimensions that raised the alert, each formatted as `key:value`. An alert matches when any of its triggering dimensions is listed.",yue="Priorities the alert was raised at. A monitor alert takes its priority from the monitor, an SLO alert from the SLO alert that fired.",Eue="IDs of the clusters the alert was raised on. Alerts raised on no cluster are always drawn.",jHe=n.Object({type:n.Literal("ongoing-alerts",{description:"Draws monitor and SLO alerts over the chart"}),alertTypes:n.Optional(n.Array(n.Enum(T$),{description:due})),query:n.Optional(n.String({description:mue})),filters:n.Optional(n.Object({team:n.Optional(n.Array(n.String(),{description:gue})),triggeredBy:n.Optional(n.Array(n.String(),{description:hue})),priority:n.Optional(n.Array(n.Enum(En),{description:yue})),cluster:n.Optional(n.Array(n.String(),{description:Eue}))},{description:fue}))},{$id:"WidgetOngoingAlertsOverlay",title:"OngoingAlertsOverlay"}),qHe=n.Object({type:n.Literal("ongoing-alerts",{description:"Draws monitor and SLO alerts over the chart"}),alertTypes:n.Optional(n.Array(n.Enum(T$),{maxItems:T$.length,description:due})),query:n.Optional(p({description:mue})),filters:n.Optional(n.Object({team:n.Optional(n.Array(p({allowEmpty:!1}),{maxItems:50,description:gue})),triggeredBy:n.Optional(n.Array(p({allowEmpty:!1}),{maxItems:50,description:hue})),priority:n.Optional(n.Array(n.Enum(En),{maxItems:En.length,description:yue})),cluster:n.Optional(n.Array(p({allowEmpty:!1}),{maxItems:50,description:Eue}))},{description:fue}))},{$id:"InputWidgetOngoingAlertsOverlay",title:"OngoingAlertsOverlay"}),Wd=D("type",[FHe,GHe,jHe],{title:"EventsOverlay",description:sue}),Qd=D("type",[$He,BHe,qHe],{title:"EventsOverlay",description:sue}),HHe=n.Object({name:n.String({description:"Display name of the table column"}),...ZR,source:_i,normalizer:n.Optional(mr),precision:lt},{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`."}),KHe=n.Object({name:p({description:"Display name of the table column"}),...XR,source:_i,normalizer:n.Optional(fr),precision:lt},{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`."}),zHe=n.Array(n.Object({id:n.String({description:"ID of the column to sort by"}),desc:n.Boolean({description:"Whether the sort is descending"})},{title:"TableDefaultSorting"}),{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."}),YHe=n.Array(n.Object({id:p({description:"ID of the column to sort by: `label` for the grouping column, or `col-<index>` with the zero-based position of the entry in `columns`."}),desc:n.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."}),JR=n.Array(n.Object({id:n.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:n.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, RUM event, or connection list widgets. Users can still change sorting by selecting columns in the rendered list."}),eP=n.Array(n.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:n.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, RUM event, or connection list widgets. Users can still change sorting by selecting columns in the rendered list."}),Tue=["horizontal","vertical"],VHe=n.Object({type:n.Literal("list",{description:"Displays matching logs in a tabular list"}),query:n.String({description:"Query that selects logs for the list"}),listColumns:n.Optional(n.Array(WR,{description:"Custom columns to display for each log"})),listColumnsAliases:n.Optional(n.Record(n.String(),n.String(),{description:"Column headers by column attribute. A column without an alias shows its attribute."})),listColumnsSize:n.Optional(n.Record(n.String(),n.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:n.Optional(n.Boolean({description:"Whether list widget cell text wraps instead of truncating. Applies to list widgets."})),defaultSorting:n.Optional(JR)},{$id:"GraphVisualizationList",title:"List"}),WHe=n.Object({type:n.Literal("list",{description:"Displays matching logs in a tabular list"}),query:p({type:"tsuga-query",description:"Query that selects logs for the list"}),listColumns:n.Optional(n.Array(QR,{description:"Custom columns to display for each log. Omit it and the list renders no columns: there is no default set."})),listColumnsAliases:n.Optional(n.Record(n.String(),p(),{description:"Column headers by column attribute. A column without an alias shows its attribute."})),listColumnsSize:n.Optional(n.Record(n.String(),n.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:n.Optional(n.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:n.Optional(eP)},{$id:"InputGraphVisualizationList",title:"List"}),VR=D("type",[n.Object({type:n.Literal("auto",{description:"Automatically choose this axis bound"})}),n.Object({type:n.Literal("number",{description:"Use a fixed numeric axis bound"}),value:n.Number({description:"Fixed numeric axis bound value"})})],{description:"Axis bound mode: automatic or fixed numeric value"}),Dp=n.Object({min:VR,max:VR,scale:D("type",[n.Object({type:n.Literal("pow",{description:"Power scale"}),exponent:n.Number({description:"Exponent used by the power scale"})}),n.Object({type:n.Enum(["linear","log","sqrt"],{description:"Built-in axis scale"})})],{description:"Y-axis scale mode"}),alwaysIncludeZero:n.Boolean({description:"Whether the rendered Y axis should always include zero"})},{description:"Y-axis bounds and scale configuration for chart widgets."}),Fp=n.Object({min:VR,max:VR,scale:D("type",[n.Object({type:n.Literal("pow",{description:"Power scale"}),exponent:n.Number({minimum:0,description:"Exponent used by the power scale"})}),n.Object({type:n.Enum(["linear","log","sqrt"],{description:"Built-in axis scale"})})],{description:"Y-axis scale mode"}),alwaysIncludeZero:n.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."}),Sue=n.Array(n.Integer({description:"Marker value expressed as a percentage between 0 and 100"}),{description:"Percentile markers displayed on top of the distribution chart"}),_ue=n.Array(n.Integer({minimum:0,maximum:100,description:"Marker value expressed as a percentage between 0 and 100"}),{description:"Percentile markers displayed on top of the distribution chart"});var QHe=["regular","dashed"],Wg=n.Record(n.String(),n.Object({groupId:n.String(),lineStyle:n.Enum(QHe)}),{description:"Line style of each series, keyed by 1-based query index. The last index is the formula when there is one. Each entry is `{groupId, lineStyle}`, where `groupId` is `_q<n>` for query n or `_value` for the formula. For widgets with a single query, only the `1` entry is read and it applies to every series. Defaults to regular."}),ZHe=n.Object({type:n.Literal("timeseries-connection",{description:"Displays the database rows-based aggregation as a time series chart"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),queries:n.Array(n.String({description:"The read-only SQL query to execute against the connection."})),legendMode:n.Optional(Zr),thresholds:ns,yAxisSettings:n.Optional(Dp),lineStyleOptions:n.Optional(Wg),normalizer:n.Optional(mr),eventsOverlay:n.Optional(Wd)},{$id:"GraphVisualizationTimeseriesConnection",title:"TimeseriesConnection"}),XHe=n.Object({type:n.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:n.Array(p({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:n.Optional(Zr),thresholds:ns,yAxisSettings:n.Optional(Fp),lineStyleOptions:n.Optional(Wg),normalizer:n.Optional(fr),eventsOverlay:n.Optional(Qd)},{$id:"InputGraphVisualizationTimeseriesConnection",title:"TimeseriesConnection"}),JHe=n.Object({type:n.Literal("list-connection",{description:"Displays database rows as a tabular list"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),query:n.String({description:"The read-only SQL query to execute against the connection."}),listColumns:n.Optional(n.Array(WR,{description:"Custom columns to display for each database row"})),listColumnsAliases:n.Optional(n.Record(n.String(),n.String(),{description:"Column headers by column attribute. A column without an alias shows its attribute."})),listColumnsSize:n.Optional(n.Record(n.String(),n.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:n.Optional(n.Boolean({description:"Whether list widget cell text wraps instead of truncating. Applies to connection list widgets."})),defaultSorting:n.Optional(JR)},{$id:"GraphVisualizationListConnection",title:"ListConnection"}),eKe=n.Object({type:n.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:n.Optional(n.Array(QR,{description:"Custom columns to display for each database row. Omit it and the list renders no columns: there is no default set."})),listColumnsAliases:n.Optional(n.Record(n.String(),p(),{description:"Column headers by column attribute. A column without an alias shows its attribute."})),listColumnsSize:n.Optional(n.Record(n.String(),n.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:n.Optional(n.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:n.Optional(eP)},{$id:"InputGraphVisualizationListConnection",title:"ListConnection"}),tKe=n.Object({type:n.Literal("top-list-connection",{description:"Displays the database rows-based aggregation as a ranked top list"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),queries:n.Array(n.String({description:"The read-only SQL query to execute against the connection."})),normalizer:n.Optional(mr)},{$id:"GraphVisualizationTopListConnection",title:"TopListConnection"}),rKe=n.Object({type:n.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:n.Array(p({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),normalizer:n.Optional(fr)},{$id:"InputGraphVisualizationTopListConnection",title:"TopListConnection"}),nKe=n.Object({type:n.Literal("pie-connection",{description:"Displays the database rows-based aggregation as a pie chart"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),queries:n.Array(n.String({description:"The read-only SQL query to execute against the connection."})),legendMode:n.Optional(Zr),normalizer:n.Optional(mr)},{$id:"GraphVisualizationPieConnection",title:"PieConnection"}),oKe=n.Object({type:n.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:n.Array(p({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:n.Optional(Zr),normalizer:n.Optional(fr)},{$id:"InputGraphVisualizationPieConnection",title:"PieConnection"}),iKe=n.Object({type:n.Literal("bar-connection",{description:"Displays the database rows-based aggregation as a bar chart"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),queries:n.Array(n.String({description:"The read-only SQL query to execute against the connection."})),legendMode:n.Optional(Zr),thresholds:ns,yAxisSettings:n.Optional(Dp),normalizer:n.Optional(mr),eventsOverlay:n.Optional(Wd)},{$id:"GraphVisualizationBarConnection",title:"BarConnection"}),sKe=n.Object({type:n.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:n.Array(p({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:n.Optional(Zr),thresholds:ns,yAxisSettings:n.Optional(Fp),normalizer:n.Optional(fr),eventsOverlay:n.Optional(Qd)},{$id:"InputGraphVisualizationBarConnection",title:"BarConnection"}),aKe=n.Object({type:n.Literal("query-value-connection",{description:"Displays a single value computed by a SQL query against a database connection"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),queries:n.Array(n.String({description:"The read-only SQL query to execute against the connection."})),backgroundMode:n.Optional(n.Enum(Vg,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(ja,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"})),precision:lt,normalizer:n.Optional(mr)},{$id:"GraphVisualizationQueryValueConnection",title:"QueryValueConnection"}),cKe=n.Object({type:n.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:n.Array(p({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),backgroundMode:n.Optional(n.Enum(Vg,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(ja,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"})),precision:lt,normalizer:n.Optional(fr)},{$id:"InputGraphVisualizationQueryValueConnection",title:"QueryValueConnection"}),uKe=n.Object({type:n.Literal("list-log-patterns",{description:"Displays log patterns clustered from logs matching the query"}),query:n.String({description:"Tsuga query that selects logs to cluster into patterns"}),layout:n.Optional(n.Enum(Tue,{description:"Layout used to render log patterns"}))},{$id:"GraphVisualizationListLogPatterns",title:"ListLogPatterns"}),pKe=n.Object({type:n.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:n.Optional(n.Enum(Tue,{description:"Layout used to render log patterns"}))},{$id:"InputGraphVisualizationListLogPatterns",title:"ListLogPatterns"}),lKe=n.Object({type:n.Literal("list-spans",{description:"Displays matching trace spans in a tabular list"}),query:n.String({description:"Query that selects trace spans for the list"}),listColumns:n.Optional(n.Array(WR,{description:"Custom columns to display for each span"})),listColumnsAliases:n.Optional(n.Record(n.String(),n.String(),{description:"Column headers by column attribute. A column without an alias shows its attribute."})),listColumnsSize:n.Optional(n.Record(n.String(),n.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:n.Optional(n.Boolean({description:"Whether list widget cell text wraps instead of truncating. Applies to span list widgets."})),defaultSorting:n.Optional(JR)},{$id:"GraphVisualizationListSpans",title:"ListSpans"}),dKe=n.Object({type:n.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:n.Optional(n.Array(QR,{description:"Custom columns to display for each span. Omit it and the list renders no columns: there is no default set."})),listColumnsAliases:n.Optional(n.Record(n.String(),p(),{description:"Column headers by column attribute. A column without an alias shows its attribute."})),listColumnsSize:n.Optional(n.Record(n.String(),n.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:n.Optional(n.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:n.Optional(eP)},{$id:"InputGraphVisualizationListSpans",title:"ListSpans"}),mKe=n.Object({type:n.Literal("list-rum",{description:"Displays matching RUM events in a tabular list"}),query:n.String({description:"Query that selects RUM events for the list"}),listColumns:n.Optional(n.Array(WR,{description:"Custom columns to display for each RUM event. Attributes are read without their stream prefix, e.g. `view.name` rather than `events.view.name`."})),listColumnsAliases:n.Optional(n.Record(n.String(),n.String(),{description:"Column headers by column attribute. A column without an alias shows its attribute."})),listColumnsSize:n.Optional(n.Record(n.String(),n.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:n.Optional(n.Boolean({description:"Whether list widget cell text wraps instead of truncating. Applies to RUM event list widgets."})),defaultSorting:n.Optional(JR)},{$id:"GraphVisualizationListRum",title:"ListRum"}),fKe=n.Object({type:n.Literal("list-rum",{description:"Displays matching RUM events in a tabular list"}),query:p({type:"tsuga-query",description:"Query that selects RUM events for the list. Prefix every field with the stream it belongs to (`measurements.`, `events.`, or `exceptions.`) and filter on a single stream per query. A query without stream-prefixed fields searches the `events` stream."}),listColumns:n.Optional(n.Array(QR,{description:"Custom columns to display for each RUM event. Set attributes without their stream prefix, e.g. `view.name` rather than `events.view.name`. Omit it and the list renders no columns: there is no default set."})),listColumnsAliases:n.Optional(n.Record(n.String(),p(),{description:"Column headers by column attribute. A column without an alias shows its attribute."})),listColumnsSize:n.Optional(n.Record(n.String(),n.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:n.Optional(n.Boolean({description:"Whether list widget cell text wraps instead of truncating. Applies to RUM event list widgets. Optional; omit or set false to use truncated cells."})),defaultSorting:n.Optional(eP)},{$id:"InputGraphVisualizationListRum",title:"ListRum"}),$p=n.Array(n.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."}),Gp=n.Array(p({allowEmpty:!1,type:"long",description:"Raw PromQL expression for this widget."}),{minItems:1,description:"PromQL expressions configured for this widget. Only the first expression is rendered; later entries are stored and ignored."}),gKe=n.Object({type:n.Literal("timeseries-promql",{description:"Displays PromQL metrics query-based aggregation as a time series chart"}),queries:$p,aliases:n.Optional(Kd),timeBucket:n.Optional(qa),normalizer:n.Optional(mr),precision:lt,legendMode:n.Optional(Zr),thresholds:ns,yAxisSettings:n.Optional(Dp),smoothing:n.Optional(n.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"})),lineStyleOptions:n.Optional(Wg),eventsOverlay:n.Optional(Wd)},{$id:"GraphVisualizationTimeseriesPromql",title:"TimeseriesPromql"}),hKe=n.Object({type:n.Literal("timeseries-promql",{description:"Displays PromQL metrics query-based aggregation as a time series chart"}),queries:Gp,aliases:n.Optional(zd),timeBucket:n.Optional(qa),normalizer:n.Optional(fr),precision:lt,legendMode:n.Optional(Zr),thresholds:ns,yAxisSettings:n.Optional(Fp),smoothing:n.Optional(n.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"})),lineStyleOptions:n.Optional(Wg),eventsOverlay:n.Optional(Qd)},{$id:"InputGraphVisualizationTimeseriesPromql",title:"TimeseriesPromql"}),yKe=n.Object({type:n.Literal("query-value-promql",{description:"Configures a PromQL metrics query-based aggregation as a single value"}),queries:$p,aliases:n.Optional(Kd),backgroundMode:n.Optional(n.Enum(Vg,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(ja,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"})),precision:lt,normalizer:n.Optional(mr)},{$id:"GraphVisualizationQueryValuePromql",title:"QueryValuePromql"}),EKe=n.Object({type:n.Literal("query-value-promql",{description:"Configures a PromQL metrics query-based aggregation as a single value"}),queries:Gp,aliases:n.Optional(zd),backgroundMode:n.Optional(n.Enum(Vg,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(ja,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"})),precision:lt,normalizer:n.Optional(fr)},{$id:"InputGraphVisualizationQueryValuePromql",title:"QueryValuePromql"}),S$=["red","pink","violet","blue","cyan","green","yellow","orange"],tP=n.Enum(S$,{description:"Color palette used to render the heatmap intensity gradient"}),rP=n.Object({from:n.Number({description:"Lower bound of the Gauge color threshold; runs up to the next threshold or the max"}),color:n.Enum(S$,{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."}),Iue=nue({colors:S$,operatorDescription:"Comparator used to evaluate each time bucket value against `value`",valueDescription:"Bound of the section, compared with `operator`",colorDescription:"Color of the time buckets in this section"}),bue={title:"TimelineSection",description:"Range of values shown as one state, evaluated against the raw value of each time bucket, before the unit is applied."},TKe=n.Object({...Iue,name:n.Optional(n.String({description:"Name of the state, shown in the legend"}))},bue),SKe=n.Object({...Iue,name:n.Optional(p({allowEmpty:!1,description:"Name of the state, shown in the legend"}))},bue),_Ke=10,xue="Rules that assign each time bucket to a state. Among the sections whose condition the value matches, the one whose `value` is closest to it applies, so `> 5` overrides `> 0` above 5 regardless of order. `not_equal` sections apply only when nothing else matches, and ties go to the earlier section. Buckets that match no section are shown in a neutral color.",IKe=n.Object({type:n.Literal("gauge-promql",{description:"Configures a PromQL metrics query-based aggregation as a gauge"}),queries:$p,aliases:n.Optional(Kd),max:n.Optional(n.Number({description:"Gauge maximum value, on the raw query value before the unit is applied"})),colorThresholds:n.Optional(n.Array(rP,{description:"Color thresholds inside the gauge range, on the raw query value before the unit is applied"})),precision:lt,normalizer:n.Optional(mr)},{$id:"GraphVisualizationGaugePromql",title:"GaugePromql"}),bKe=n.Object({type:n.Literal("gauge-promql",{description:"Configures a PromQL metrics query-based aggregation as a gauge"}),queries:Gp,aliases:n.Optional(zd),max:n.Optional(n.Number({description:"Gauge maximum value, on the raw query value before the unit is applied"})),colorThresholds:n.Optional(n.Array(rP,{description:"Color thresholds inside the gauge range, on the raw query value before the unit is applied"})),precision:lt,normalizer:n.Optional(fr)},{$id:"InputGraphVisualizationGaugePromql",title:"GaugePromql"}),xKe=n.Object({type:n.Literal("top-list-promql",{description:"Displays PromQL metrics query-based aggregation as a ranked top list"}),queries:$p,aliases:n.Optional(Kd),normalizer:n.Optional(mr),precision:lt,conditions:n.Optional(n.Array(ja,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"}))},{$id:"GraphVisualizationTopListPromql",title:"TopListPromql"}),OKe=n.Object({type:n.Literal("top-list-promql",{description:"Displays PromQL metrics query-based aggregation as a ranked top list"}),queries:Gp,aliases:n.Optional(zd),normalizer:n.Optional(fr),precision:lt,conditions:n.Optional(n.Array(ja,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"}))},{$id:"InputGraphVisualizationTopListPromql",title:"TopListPromql"}),AKe=n.Object({type:n.Literal("pie-promql",{description:"Displays PromQL metrics query-based aggregation as a pie chart"}),queries:$p,aliases:n.Optional(Kd),normalizer:n.Optional(mr),precision:lt,legendMode:n.Optional(Zr)},{$id:"GraphVisualizationPiePromql",title:"PiePromql"}),CKe=n.Object({type:n.Literal("pie-promql",{description:"Displays PromQL metrics query-based aggregation as a pie chart"}),queries:Gp,aliases:n.Optional(zd),normalizer:n.Optional(fr),precision:lt,legendMode:n.Optional(Zr)},{$id:"InputGraphVisualizationPiePromql",title:"PiePromql"}),RKe=n.Object({type:n.Literal("bar-promql",{description:"Displays PromQL metrics query-based aggregation as a bar chart"}),queries:$p,aliases:n.Optional(Kd),timeBucket:n.Optional(qa),precision:lt,normalizer:n.Optional(mr),thresholds:ns,legendMode:n.Optional(Zr),yAxisSettings:n.Optional(Dp),eventsOverlay:n.Optional(Wd)},{$id:"GraphVisualizationBarPromql",title:"BarPromql"}),PKe=n.Object({type:n.Literal("bar-promql",{description:"Displays PromQL metrics query-based aggregation as a bar chart"}),queries:Gp,aliases:n.Optional(zd),timeBucket:n.Optional(qa),precision:lt,normalizer:n.Optional(fr),thresholds:ns,legendMode:n.Optional(Zr),yAxisSettings:n.Optional(Fp),eventsOverlay:n.Optional(Qd)},{$id:"InputGraphVisualizationBarPromql",title:"BarPromql"}),UKe=n.Object({type:n.Literal("distribution-promql",{description:"Displays a PromQL histogram query grouped by `le` as a distribution chart, e.g. `sum by (le) (rate(http_duration_bucket[5m]))`"}),queries:$p,precision:lt,normalizer:n.Optional(mr),percentileMarkers:n.Optional(Sue)},{$id:"GraphVisualizationDistributionPromql",title:"DistributionPromql"}),wKe=n.Object({type:n.Literal("distribution-promql",{description:"Displays a PromQL histogram query grouped by `le` as a distribution chart, e.g. `sum by (le) (rate(http_duration_bucket[5m]))`"}),queries:Gp,precision:lt,normalizer:n.Optional(fr),percentileMarkers:n.Optional(_ue)},{$id:"InputGraphVisualizationDistributionPromql",title:"DistributionPromql"}),vKe=n.Object({type:n.Literal("heatmap-promql",{description:"Displays a PromQL histogram query grouped by `le` as a heatmap chart, e.g. `sum by (le) (rate(http_duration_bucket[5m]))`"}),queries:$p,precision:lt,normalizer:n.Optional(mr),palette:n.Optional(tP),yAxisSettings:n.Optional(Dp)},{$id:"GraphVisualizationHeatmapPromql",title:"HeatmapPromql"}),NKe=n.Object({type:n.Literal("heatmap-promql",{description:"Displays a PromQL histogram query grouped by `le` as a heatmap chart, e.g. `sum by (le) (rate(http_duration_bucket[5m]))`"}),queries:Gp,precision:lt,normalizer:n.Optional(fr),palette:n.Optional(tP),yAxisSettings:n.Optional(Fp)},{$id:"InputGraphVisualizationHeatmapPromql",title:"HeatmapPromql"}),kKe=n.Object({type:n.Literal("timeseries",{description:"Displays the aggregation as a time series chart"}),...Yd,groupByMode:rs,timeBucket:n.Optional(qa),normalizer:n.Optional(mr),precision:lt,legendMode:n.Optional(Zr),thresholds:ns,yAxisSettings:n.Optional(Dp),smoothing:n.Optional(n.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"})),lineStyleOptions:n.Optional(Wg),customLink:n.Optional(ES),eventsOverlay:n.Optional(Wd)},{$id:"GraphVisualizationTimeseries",title:"Timeseries"}),LKe=n.Object({type:n.Literal("timeseries",{description:"Displays the aggregation as a time series chart"}),...Vd,groupByMode:rs,timeBucket:n.Optional(qa),normalizer:n.Optional(fr),precision:lt,legendMode:n.Optional(Zr),thresholds:ns,yAxisSettings:n.Optional(Fp),smoothing:n.Optional(n.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"})),lineStyleOptions:n.Optional(Wg),customLink:n.Optional(TS),eventsOverlay:n.Optional(Qd)},{$id:"InputGraphVisualizationTimeseries",title:"Timeseries"}),Oue="Requests stacked rendering for a top-list widget. Tsuga renders stacked rows only for one count or sum query with exactly two grouped fields, no formula, non-negative values, and a single-cluster context; otherwise the widget renders as a normal top list.",MKe=n.Object({type:n.Literal("top-list",{description:"Displays the aggregation as a ranked list of top results"}),...Yd,groupByMode:rs,normalizer:n.Optional(mr),precision:lt,conditions:n.Optional(n.Array(ja,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"})),isStacked:n.Optional(n.Boolean({description:Oue})),legendMode:n.Optional(Zr),customLink:n.Optional(ES)},{$id:"GraphVisualizationTopList",title:"TopList"}),DKe=n.Object({type:n.Literal("top-list",{description:"Displays the aggregation as a ranked list of top results"}),...Vd,groupByMode:rs,normalizer:n.Optional(fr),precision:lt,conditions:n.Optional(n.Array(ja,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"})),isStacked:n.Optional(n.Boolean({description:Oue})),legendMode:n.Optional(Zr),customLink:n.Optional(TS)},{$id:"InputGraphVisualizationTopList",title:"TopList"}),Aue=n.Literal("timeline",{description:"Displays each group as a row of time buckets, colored by the section their value falls in"}),FKe=n.Object({type:Aue,...Yd,groupByMode:rs,timeBucket:n.Optional(qa),normalizer:n.Optional(mr),precision:lt,sections:n.Array(TKe,{description:xue}),legendMode:n.Optional(Zr)},{$id:"GraphVisualizationTimeline",title:"Timeline"}),$Ke=n.Object({type:Aue,...Vd,groupByMode:rs,timeBucket:n.Optional(qa),normalizer:n.Optional(fr),precision:lt,sections:n.Array(SKe,{maxItems:_Ke,description:xue}),legendMode:n.Optional(Zr)},{$id:"InputGraphVisualizationTimeline",title:"Timeline"}),GKe=n.Object({type:n.Literal("pie",{description:"Displays the aggregation as a pie chart"}),...Yd,groupByMode:rs,normalizer:n.Optional(mr),precision:lt,legendMode:n.Optional(Zr),customLink:n.Optional(ES)},{$id:"GraphVisualizationPie",title:"Pie"}),BKe=n.Object({type:n.Literal("pie",{description:"Displays the aggregation as a pie chart"}),...Vd,groupByMode:rs,normalizer:n.Optional(fr),precision:lt,legendMode:n.Optional(Zr),customLink:n.Optional(TS)},{$id:"InputGraphVisualizationPie",title:"Pie"}),jKe=n.Object({type:n.Literal("query-value",{description:"Displays the aggregation as a single value"}),...ZR,backgroundMode:n.Optional(n.Enum(Vg,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(ja,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"})),precision:lt,normalizer:n.Optional(mr)},{$id:"GraphVisualizationQueryValue",title:"QueryValue"}),qKe=n.Object({type:n.Literal("query-value",{description:"Displays the aggregation as a single value"}),...XR,backgroundMode:n.Optional(n.Enum(Vg,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(ja,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"})),precision:lt,normalizer:n.Optional(fr)},{$id:"InputGraphVisualizationQueryValue",title:"QueryValue"}),HKe=n.Object({type:n.Literal("bar",{description:"Displays the aggregation as a bar chart"}),...Yd,groupByMode:rs,timeBucket:n.Optional(qa),precision:lt,normalizer:n.Optional(mr),thresholds:ns,legendMode:n.Optional(Zr),yAxisSettings:n.Optional(Dp),customLink:n.Optional(ES),eventsOverlay:n.Optional(Wd)},{$id:"GraphVisualizationBar",title:"Bar"}),KKe=n.Object({type:n.Literal("bar",{description:"Displays the aggregation as a bar chart"}),...Vd,groupByMode:rs,timeBucket:n.Optional(qa),precision:lt,normalizer:n.Optional(fr),thresholds:ns,legendMode:n.Optional(Zr),yAxisSettings:n.Optional(Fp),customLink:n.Optional(TS),eventsOverlay:n.Optional(Qd)},{$id:"InputGraphVisualizationBar",title:"Bar"}),Cue='Attribute that switches the count to "Groups" mode: records are grouped by this attribute, the aggregation produces one value per group, and the chart buckets those per-group values. When omitted, individual records are bucketed.',Rue=n.String({description:Cue}),Pue=p({description:Cue}),zKe=n.Object({type:n.Literal("distribution",{description:"Displays the aggregation as a distribution chart"}),...Yd,group:n.Optional(Rue),precision:lt,normalizer:n.Optional(mr),percentileMarkers:n.Optional(Sue),boundsScale:n.Optional(hT)},{$id:"GraphVisualizationDistribution",title:"Distribution"}),YKe=n.Object({type:n.Literal("distribution",{description:"Displays the aggregation as a distribution chart"}),...Vd,group:n.Optional(Pue),precision:lt,normalizer:n.Optional(fr),percentileMarkers:n.Optional(_ue),boundsScale:n.Optional(hT)},{$id:"InputGraphVisualizationDistribution",title:"Distribution"}),VKe=n.Object({type:n.Literal("heatmap",{description:"Displays the aggregation as a heatmap chart"}),...Yd,group:n.Optional(Rue),precision:lt,normalizer:n.Optional(mr),palette:n.Optional(tP),yAxisSettings:n.Optional(Dp),eventsOverlay:n.Optional(Wd)},{$id:"GraphVisualizationHeatmap",title:"Heatmap"}),WKe=n.Object({type:n.Literal("heatmap",{description:"Displays the aggregation as a heatmap chart"}),...Vd,group:n.Optional(Pue),precision:lt,normalizer:n.Optional(fr),palette:n.Optional(tP),yAxisSettings:n.Optional(Fp),eventsOverlay:n.Optional(Qd)},{$id:"InputGraphVisualizationHeatmap",title:"Heatmap"}),QKe=n.Object({type:n.Literal("gauge",{description:"Displays the aggregation as a gauge"}),...ZR,max:n.Optional(n.Number({description:"Gauge maximum value, on the raw query value before the unit is applied"})),colorThresholds:n.Optional(n.Array(rP,{description:"Color thresholds inside the gauge range, on the raw query value before the unit is applied"})),precision:lt,normalizer:n.Optional(mr)},{$id:"GraphVisualizationGauge",title:"Gauge"}),ZKe=n.Object({type:n.Literal("gauge",{description:"Displays the aggregation as a gauge"}),...XR,max:n.Optional(n.Number({description:"Gauge maximum value, on the raw query value before the unit is applied. Defaults to 100 when omitted."})),colorThresholds:n.Optional(n.Array(rP,{description:"Color thresholds inside the gauge range, on the raw query value before the unit is applied"})),precision:lt,normalizer:n.Optional(fr)},{$id:"InputGraphVisualizationGauge",title:"Gauge"}),XKe=n.Object({type:n.Literal("table",{description:"Displays the aggregation as a table with multi-level grouping"}),columns:n.Array(HHe,{description:"Each column defines an independent aggregation displayed as a table column"}),groupBy:n.Optional(ag),groupByMode:rs,defaultSorting:n.Optional(zHe),columnSizes:n.Optional(n.Record(n.String(),n.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."})),customLink:n.Optional(ES)},{$id:"GraphVisualizationTable",title:"Table"}),JKe=n.Object({type:n.Literal("table",{description:"Displays the aggregation as a table with multi-level grouping"}),columns:n.Array(KHe,{minItems:1,description:"Each column defines an independent aggregation displayed as a table column"}),groupBy:n.Optional(Yc),groupByMode:rs,defaultSorting:n.Optional(YHe),columnSizes:n.Optional(n.Record(n.String(),n.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`, counting from 0. Columns without an entry keep their default width."})),customLink:n.Optional(TS)},{$id:"InputGraphVisualizationTable",title:"Table"}),eze=n.Object({type:n.Literal("note",{description:"Displays static text on the dashboard"}),note:n.Optional(n.String({description:"Markdown-compatible text shown in the note"})),noteColor:n.Optional(n.Enum(Yce,{description:"Background color used to render the note"})),noteAlign:n.Optional(Ga),noteJustifyContent:n.Optional(Ga)},{$id:"GraphVisualizationNote",title:"Note"}),tze=n.Object({type:n.Literal("note",{description:"Displays static text on the dashboard"}),note:n.Optional(p({type:"long",description:"Markdown-compatible text shown in the note"})),noteColor:n.Optional(n.Enum(Yce,{description:"Background color used to render the note"})),noteAlign:n.Optional(Ga),noteJustifyContent:n.Optional(Ga)},{$id:"InputGraphVisualizationNote",title:"Note"}),Uue=n.Object({type:n.Literal("group",{description:"Full-width header that groups the widgets referencing it through `groupId`. Its name is the widget `name`."})},{$id:"GraphVisualizationGroup",title:"Group"}),wue=["summary","table"],vue="Displays the latest status of SLOs as summary cards with the result count per status, a table of results, or both. Status is not recomputed over the dashboard time range.",Nue="Id of the SLO to display. Omit it to cover every SLO that matches `filters`.",kue="Narrows the SLOs the widget covers. Omit it, or any of its fields, to apply no filter.",rze="Restrict results to SLOs owned by any of these team IDs",nze="Restrict results to SLOs that have at least one of the listed key/value tags",Lue="Keep only the results whose status is one of these values. A result is one cluster of an ungrouped SLO, or one group of a grouped SLO.",Mue="Keep only the results matching every key filter. A result's values for a key are its group-by value when its SLO groups by that field, and its SLO's tag values for that key. A result matches when one of its values is in `values`, or, with `exclude: true`, when none is; a result with no value for the key only matches an exclusion.",Due="Group-by field or tag key to filter on, such as `context.team`",Fue="Values compared with the result's group-by value and its SLO's tag values for `key`",$ue="If true, keep the results with none of these values instead of those with at least one",Gue="Groups the results by SLO, by owning team, or by the value of a tag key or group-by field. Omit it to list results ungrouped. Only the `table` section is grouped, so include `table` in `display`.",Bue="Tag key or group-by field to group by, such as `env` or `context.team`. A result falls under each value it has for this key: its group-by value when its SLO groups by this field, and its SLO's tag values for this key. Results with no value for the key are not shown.",jue="Sections to show: `summary` for the result count per status, `table` for the list of results.",que=n.Object({type:n.Literal("slo",{description:"Groups the results by their SLO"})},{$id:"SloWidgetOrganizeBySlo",title:"SLO"}),Hue=n.Object({type:n.Literal("team",{description:"Groups the results by the team owning their SLO"})},{$id:"SloWidgetOrganizeByTeam",title:"Team"}),oze=n.Object({type:n.Literal("key",{description:"Groups the results by the value of a tag key or group-by field"}),key:n.String({description:Bue})},{$id:"SloWidgetOrganizeByKey",title:"Key"}),ize=n.Object({type:n.Literal("key",{description:"Groups the results by the value of a tag key or group-by field"}),key:p({allowEmpty:!1,description:Bue})},{$id:"InputSloWidgetOrganizeByKey",title:"Key"}),sze=D("type",[que,Hue,oze],{title:"SloWidgetOrganizeBy",description:Gue}),aze=D("type",[que,Hue,ize],{title:"SloWidgetOrganizeBy",description:Gue}),cze=n.Object({type:n.Literal("slo",{description:vue}),sloId:n.Optional(n.String({description:Nue})),filters:n.Optional(n.Object({owners:n.Optional(n.Object({values:n.Array(n.String()),exclude:n.Optional(n.Boolean())},{description:rze})),tags:n.Optional(n.Object({values:Qr,exclude:n.Optional(n.Boolean())},{description:nze})),statuses:n.Optional(n.Object({values:n.Array(Mp),exclude:n.Optional(n.Boolean())},{description:Lue})),keys:n.Optional(n.Array(n.Object({key:n.String({description:Due}),values:n.Array(n.String(),{description:Fue}),exclude:n.Optional(n.Boolean({description:$ue}))}),{description:Mue}))},{description:kue})),organizeBy:n.Optional(sze),display:n.Array(n.Enum(wue),{description:jue})},{$id:"GraphVisualizationSlo",title:"Slo"}),uze=n.Object({type:n.Literal("slo",{description:vue}),sloId:n.Optional(p({allowEmpty:!1,description:Nue})),filters:n.Optional(n.Object({owners:n.Optional(Bg.properties.owners),tags:n.Optional(Bg.properties.tags),statuses:n.Optional(he(Mp,{description:Lue,maxItems:3})),keys:n.Optional(n.Array(n.Object({key:p({allowEmpty:!1,description:Due}),values:n.Array(p({allowEmpty:!1}),{maxItems:50,description:Fue}),exclude:n.Optional(n.Boolean({description:$ue}))}),{maxItems:50,description:Mue}))},{description:kue})),organizeBy:n.Optional(aze),display:n.Array(n.Enum(wue),{minItems:1,uniqueItems:!0,description:jue})},{$id:"InputGraphVisualizationSlo",title:"Slo"}),pze=D("type",[ZHe,JHe,tKe,nKe,iKe,aKe,gKe,yKe,IKe,xKe,AKe,RKe,UKe,vKe,kKe,MKe,FKe,GKe,jKe,QKe,HKe,zKe,VKe,XKe,VHe,eze,Uue,uKe,lKe,mKe,cze],{description:"Widget visualization configuration. The `type` discriminator selects the widget kind and its required fields."}),Kue=D("type",[XHe,eKe,rKe,oKe,sKe,cKe,hKe,EKe,bKe,OKe,CKe,PKe,wKe,NKe,LKe,DKe,$Ke,BKe,qKe,ZKe,KKe,YKe,WKe,JKe,WHe,tze,Uue,pKe,dKe,fKe,uze],{description:"Widget visualization configuration. The `type` discriminator selects the widget kind and its required fields."}),_$=n.Object({x:n.Number({description:"Column position of the widget on the 12-column dashboard grid. 0 is the leftmost column; increasing values move right."}),y:n.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:n.Number({description:"Width of the widget in grid columns, out of the 12-column grid. Dashboard validation uses this with `h` and the widget type to reject layouts below the widget minimum."}),h:n.Number({description:"Height of the widget in grid rows, where each row is 50 pixels tall. Dashboard validation uses this with `w` and the widget type to reject layouts below the widget minimum."})},{description:`Grid position and size of the widget. Optional; when provided, the size must be at least ${aJ}\xD7${cJ} (width\xD7height) grid units, except note widgets which can go down to 1\xD71, and group widgets which span the full ${sJ} columns.`}),zue="ID of the dashboard tab that shows the widget. Widgets without a tab, or whose tab no longer exists, are shown in the first tab.",Yue="ID of the group widget the widget belongs to. The group must be in the same tab, and cannot itself belong to a group.",nP=n.Object({id:n.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:n.Optional(n.String({description:"Display name of the graph widget."})),description:n.Optional(n.String({description:"Optional text shown with the graph widget."})),descriptionAlign:n.Optional(Ga),descriptionJustifyContent:n.Optional(Ga),visualization:pze,layout:n.Optional(_$),tabId:n.Optional(n.String({description:zue})),groupId:n.Optional(n.String({description:Yue}))},{title:"Graph",description:"Single dashboard widget, combining its identity, its visualization configuration, and its position on the dashboard grid."}),lze=n.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:n.Optional(p({description:"Display name of the graph widget."})),description:n.Optional(n.String({minLength:1,maxLength:800,description:"Text shown with the graph widget."})),descriptionAlign:n.Optional(Ga),descriptionJustifyContent:n.Optional(Ga),visualization:Kue,layout:n.Optional(_$),tabId:n.Optional(p({description:zue})),groupId:n.Optional(p({description:Yue}))},{title:"Graph",description:"Single dashboard widget, combining its identity, its visualization configuration, and its position on the dashboard grid."}),I$=n.Object({name:Qe(p(),{description:"Display name of the graph widget. Pass null to remove it."}),description:Qe(n.String({minLength:1,maxLength:800}),{description:"Text shown with the graph widget. Pass null to remove it."}),descriptionAlign:Qe(Ga,{description:"Vertical alignment of the description. Pass null to remove it."}),descriptionJustifyContent:Qe(Ga,{description:"Horizontal alignment of the description. Pass null to remove it."}),visualization:n.Optional(Kue),layout:Qe(_$,{description:"Grid position and size of the widget. Pass null to remove it."})},{title:"GraphPatch",description:"Partial update of a single dashboard widget. Omitted fields keep their current values, and `visualization` and `layout` are replaced as a whole when provided."}),dze=10,mze=n.Array(n.Object({key:n.String({description:"Dashboard-wide filter key, usually a telemetry attribute name."}),values:n.Array(n.String({description:"Filter value."}),{description:"Allowed values for this dashboard-wide filter."}),exclude:n.Optional(n.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."}),fze=n.Array(n.Object({key:p({description:"Dashboard-wide filter key, usually a telemetry attribute name."}),values:n.Array(p({description:"Filter value."}),{description:"Allowed values for this dashboard-wide filter."}),exclude:n.Optional(n.Boolean({description:"If true, widgets exclude telemetry whose value matches this filter instead of including it (is-not)."}))}),{maxItems:dze,description:"Dashboard-wide filters applied to every widget on the dashboard."}),Vue="Ordered tabs splitting the dashboard widgets into separate pages. When omitted or empty, the dashboard shows all its widgets on a single page.",gze=n.Object({id:n.String({description:"Unique identifier of the tab inside the dashboard."}),name:n.String({description:"Display name of the tab."})}),hze=n.Object({id:p({allowEmpty:!1,description:"Unique identifier of the tab inside the dashboard."}),name:p({allowEmpty:!1,description:"Display name of the tab."})}),yze=20,Qg=n.Object({id:n.String({description:"Tsuga-generated dashboard ID assigned when the dashboard is created."}),name:n.String({description:"Display name of the dashboard. Set by the caller on create or update."}),owner:n.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:n.Array(nP,{description:"Ordered widgets that compose the dashboard"}),filters:n.Optional(mze),tabs:n.Optional(n.Array(gze,{description:Vue})),createdAt:v({description:"Timestamp when Tsuga created the dashboard."}),updatedAt:v({description:"Timestamp when Tsuga last updated the dashboard."}),creator:n.Optional(be),updater:n.Optional(be),tags:kt,timePreset:n.Optional(n.Enum(nM,{description:"Relative time preset used when opening the dashboard."})),clusterIds:n.Optional(n.Array(n.String(),{description:"Clusters selected when opening the dashboard."})),folderId:n.Optional(n.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."}))}),oP=n.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:n.Array(lze,{description:"Ordered widgets that compose the dashboard"}),filters:n.Optional(fze),tabs:n.Optional(n.Array(hze,{maxItems:yze,description:Vue})),tags:qt,timePreset:n.Optional(n.Enum(nM,{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."})),clusterIds:Qe(Hc,{description:"IDs of the clusters to select when opening the dashboard (its default clusters). Optional; omit on update to keep the current clusters, or pass null to clear them."}),folderId:n.Optional(n.Union([n.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."}))}),Ds={IS_FAVORITE:"isFavorite",OWNER:"owner",TAGS:"tags",WIDGET_COUNT:"widgetCount",UPDATED_AT:"updatedAt",NAME:"name"},Wue=[Ds.OWNER,Ds.TAGS,Ds.WIDGET_COUNT,Ds.UPDATED_AT,Ds.NAME],Zd=n.Partial(n.Object({ids:he(p({allowEmpty:!1}),{description:"Restrict results to dashboards with any of these IDs",maxItems:50}),owners:he(p({allowEmpty:!1}),{description:"Restrict results to dashboards owned by any of these team IDs",maxItems:50}),searchQuery:n.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:n.Optional(n.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:he(on.items,{description:"Restrict results to dashboards that have at least one of the listed key/value tags",maxItems:50}),folderId:n.Union([n.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"})),Eze=n.Partial(n.Object({...ye,filters:Zd,sort:n.Object({by:n.Enum([Ds.IS_FAVORITE,Ds.OWNER,Ds.TAGS,Ds.WIDGET_COUNT,Ds.UPDATED_AT,Ds.NAME],{description:"Field to sort the returned dashboards by"}),direction:me},{description:"Optional sorting applied to the returned dashboards"})})),b$=n.Object({...n.Omit(Qg,["graphs"]).properties,widgetCount:n.Number({description:"Number of widgets on the dashboard."})}),zTr=f({tags:["dashboards"],url:`${Ba}/query`,method:"POST",paginated:!0,response:n.Array(b$),body:Eze}),YTr=f({tags:["dashboards"],url:`${Ba}/tags/query`,method:"POST",body:n.Object({filters:n.Optional(n.Omit(Zd,["tags"]))}),response:Qr}),VTr=f({tags:["dashboards"],url:`${Ba}/counts/query`,method:"POST",body:n.Object({filters:n.Optional(n.Partial(Zd))}),response:n.Object({all:n.Integer({description:"Total number of dashboards matching the filters that the user can read."})})}),WTr=f({tags:["dashboards"],url:`${Ba}/:id`,method:"GET",params:n.Object({id:p()}),response:Qg}),QTr=f({tags:["dashboards"],url:Ba,method:"POST",body:oP,response:Qg}),ZTr=f({tags:["dashboards"],url:`${Ba}/:id`,method:"PATCH",params:n.Object({id:p()}),body:n.Partial(oP),response:Qg}),Tze=Ti(Zd,{maxIds:100}),XTr=f({tags:["dashboards"],url:`${Ba}/bulk-update`,method:"PUT",body:n.Object({selection:Tze,owner:n.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:Qe(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:n.Object({})}),JTr=f({tags:["dashboards"],url:`${Ba}/:id`,method:"DELETE",params:n.Object({id:p()}),response:B}),Sze=f({tags:["dashboards"],url:`${Ba}/:id/graphs/:graphId`,method:"PATCH",params:n.Object({id:p({allowEmpty:!1}),graphId:p({allowEmpty:!1})}),body:I$,response:nP}),eSr=U7(Sze),_ze=Ti(Zd),tSr=f({tags:["dashboards"],url:`${Ba}/bulk-delete`,method:"DELETE",body:n.Object({selection:_ze}),response:n.Object({})});var Zg=`/${"v1"}/dashboards`,iP=n.Pick(Qg,["id","name","owner","graphs","filters","tags","timePreset","clusterIds","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)."}),Que={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",clusterIds:["cluster-123-abc"]};Object.assign(iP,{examples:[Que]});var Zue=n.Pick(b$,["id","name","owner","widgetCount","filters","tags","timePreset","clusterIds","folderId"],{$id:"DashboardSummary",description:"Dashboard as listed by the dashboard query: its fields without `graphs`, plus the number of widgets. Retrieve the dashboard by ID to read its widgets."});Object.assign(Zue,{examples:[{...mC(Que,["graphs"]),widgetCount:1}]});var Ize=n.Object({by:n.Enum([...Wue],{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:me},{description:"Optional sorting applied to the returned dashboards"}),Xue=n.Object({...Ye,filters:n.Optional(n.Pick(Zd,["owners","searchQuery","tags","folderId"])),sort:n.Optional(Ize)},{description:"Dashboard query request. Use filters, sorting, limit, and offset to page through visible dashboards."}),bze={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(Xue,{examples:[bze]});var Jue=f({description:"Lists or searches dashboards by name or ID substring, owning team, tags or folder. Results omit widgets (`graphs`) and give `widgetCount`; get a dashboard by ID to read its widgets. See [Dashboards](/documentation/visualize/dashboards/index).",operationId:"queryDashboards",tags:["dashboards"],url:`${Zg}/query`,method:"POST",paginated:!0,body:Xue,response:n.Array(Zue)}),epe=f({description:"Retrieves one dashboard by ID, with its widgets (graphs, charts) and their queries.",operationId:"getDashboard",tags:["dashboards"],url:`${Zg}/:id`,method:"GET",params:n.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:iP}),x$=n.Pick(oP,["name","owner","graphs","filters","tags","timePreset","clusterIds","folderId"],{description:"Dashboard create or update request. Provide the dashboard identity, owner team, widgets, filters, tags, and optional time preset and default clusters."}),tpe={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",clusterIds:["cluster-123-abc"],folderId:null};Object.assign(x$,{examples:[tpe]});var rpe=n.Object(I$.properties,{description:"Dashboard graph update request. The graph identifier is supplied in the `graphId` path parameter; every body field is optional and omitted fields keep their current values."}),xze={name:"Request Latency P99",description:"p99 request latency for the API gateway.",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}};Object.assign(rpe,{examples:[xze]});var npe=f({description:"Creates a dashboard owned by the specified team, with its widgets (graphs). The response returns the saved dashboard definition.",operationId:"createDashboard",tags:["dashboards"],url:Zg,method:"POST",body:x$,response:iP}),ope=f({description:"Updates a dashboard by ID, such as its widgets (graphs, charts), filters or folder. Top-level fields are patched and omitted ones keep their values, but a sent array replaces the stored one whole: a `graphs` array missing a widget deletes that widget. Read the dashboard first and send back every widget you keep, or change one widget with the dashboard graph update.",operationId:"updateDashboard",tags:["dashboards"],url:`${Zg}/:id`,method:"PUT",params:n.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:n.Partial(x$,{examples:[tpe]}),response:iP}),Oze=n.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."})}),ipe=f({description:"Deletes a dashboard by ID. Use only after confirming no users or automation still rely on the dashboard.",operationId:"deleteDashboard",tags:["dashboards"],url:`${Zg}/:id`,method:"DELETE",params:Oze,response:B}),O$=f({description:"Updates one widget (graph, chart) of a dashboard by dashboard ID and graph ID, without resending the dashboard. Sent fields are patched and null clears them; a sent `visualization` or `layout` replaces the stored one whole.",operationId:"updateDashboardGraph",tags:["dashboards"],url:`${Zg}/:id/graphs/:graphId`,method:"PUT",params:n.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:rpe,response:nP});var spe=P("update-graph",{id:Er("DASHBOARD_ID").pipe(jt("The dashboard that contains the widget")),graphId:Er("GRAPH_ID").pipe(jt("The widget to update, from the dashboard `graphs[].id`")),file:Ap,data:tu,generateSkeleton:ru},N("cli.dashboards.update-graph")(function*(e){if(e.generateSkeleton){yield*Si(yield*eu(O$));return}yield*Oe(yield*Xe(O$,{params:{id:e.id,graphId:e.graphId},body:yield*Wc(e)}))})).pipe(U("Update one widget of a dashboard without resending the dashboard: sent fields are patched, omitted ones keep their values, and null clears a field. A sent `visualization` or `layout` replaces the stored one whole, so send it complete"));var ape=ve({commandName:"dashboards",description:"Manage dashboards",endpoints:{list:Jue,get:epe,create:npe,update:ope,delete:ipe},enableListBody:!0,extraSubcommands:[spe]});var cpe="tsuga_in:v1:";var Aze=100,A$=3,Xg=n.Object({id:n.String({description:"Tsuga-generated ingestion API key ID assigned when the key is created."}),name:n.String({description:"Human-readable key name. Names must be kebab-case when creating or updating keys."}),keyLastCharacters:n.String({description:"Last visible characters of the secret key. Use this to identify a key without exposing the full secret."}),owner:n.String({description:"Team ID that owns and manages the ingestion API key."}),tags:Qr,teamOverrideFields:n.Optional(n.Array(n.String(),{description:"Telemetry attribute names used to override ownership for data sent with this key."})),updatedAt:v({description:"Timestamp when Tsuga last updated the key metadata."}),createdAt:v({description:"Timestamp when Tsuga created the key."}),creator:n.Optional(be),updater:n.Optional(be),assetUpdatedAt:v({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})}),SS=n.Object({name:n.String({format:Qi,minLength:1,maxLength:Aze,description:"Kebab-case name for the ingestion API key."}),owner:p({allowEmpty:!1,description:"Team ID that will own and manage the ingestion API key."}),tags:on,teamOverrideFields:n.Union([n.Array(p({allowEmpty:!1}),{minItems:1,maxItems:A$,description:"Array form."}),n.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."})}),Jg="/v0/ingestion-api-keys",PSr=f({tags:["ingestion-api-keys"],url:Jg,method:"POST",body:SS,response:n.Object({...Xg.properties,key:n.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."})})}),USr=f({tags:["ingestion-api-keys"],url:Jg,method:"GET",paginated:!0,query:n.Object(ye),response:n.Array(Xg)}),wSr=f({tags:["ingestion-api-keys"],url:`${Jg}/:id`,method:"GET",params:n.Object({id:p({allowEmpty:!1})}),response:Xg}),vSr=f({tags:["ingestion-api-keys"],url:`${Jg}/:id`,method:"PUT",params:n.Object({id:p({allowEmpty:!1})}),body:SS,response:Xg}),NSr=f({tags:["ingestion-api-keys"],url:`${Jg}/:id`,method:"DELETE",params:n.Object({id:p({allowEmpty:!1})}),response:B}),kSr=f({tags:["ingestion-api-keys"],url:`${Jg}/bulk-delete`,method:"DELETE",body:n.Object({ids:n.Array(p({allowEmpty:!1}),{uniqueItems:!0})}),response:n.Object({})});var _S=`/${"v1"}/ingestion-api-keys`,IS=n.Pick(Xg,["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)."}),upe={id:"123-456-abc",name:"production-logs-ingestion",keyLastCharacters:"x7Qm",owner:"team-123-abc",tags:[{key:"env",value:"production"}],teamOverrideFields:["service"]};Object.assign(IS,{examples:[upe]});var ppe=n.Pick(SS,["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."}),lpe=n.Pick(SS,["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."}),dpe={name:"production-logs-ingestion",owner:"team-123-abc",tags:[{key:"env",value:"production"}],teamOverrideFields:["service"]};Object.assign(ppe,{examples:[dpe]});Object.assign(lpe,{examples:[dpe]});var Cze={...upe,key:`${cpe}abc123xyx7Qm`},mpe=f({description:"Lists ingestion API keys, the credentials collectors, agents, SDKs and HTTP clients use to send telemetry to Tsuga, with their owners, tags and team override fields.",operationId:"listIngestionApiKeys",tags:["ingestion-api-keys"],url:_S,method:"GET",paginated:!0,query:n.Object(Ye),response:n.Array(IS)}),jSr=f({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:`${_S}/:id`,method:"GET",params:n.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:IS}),Rze=n.Object({...IS.properties,key:n.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:Cze}),fpe=f({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:_S,method:"POST",body:ppe,response:Rze}),gpe=f({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:`${_S}/:id`,method:"PUT",params:n.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:lpe,response:IS}),hpe=f({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:`${_S}/:id`,method:"DELETE",params:n.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:B});var ype=ve({commandName:"ingestion-api-keys",description:"Manage ingestion API keys",singularOverride:"ingestion API key",pluralOverride:"ingestion API keys",endpoints:{list:mpe,create:fpe,update:gpe,delete:hpe}});var bS="/v0/investigations",Pze=["dashboard","monitor","service","slo","log-route","adaptive-notification-rule"],Uze=n.Object({type:n.String({description:'Kind of linked asset, e.g. "dashboard"'}),id:n.String({description:"Identifier of the linked asset"})}),wze=n.Object({type:n.Enum(Pze,{description:"Kind of linked asset"}),id:p({allowEmpty:!1,description:"Identifier of the linked asset"})}),ou=n.Object({id:n.String({description:"Identifier of the investigation"}),name:n.String({description:"Human readable name shown for the investigation"}),slug:n.Optional(n.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:n.Optional(n.String({description:"Markdown content capturing the investigation notes and findings"})),tags:kt,owner:n.String({description:"Team ID owning the investigation"}),env:n.Optional(n.String({description:'Environment the investigation relates to, e.g. "prod"'})),linkedAssets:n.Array(Uze,{description:"Assets (dashboards, monitors, \u2026) referenced by this investigation"}),creator:n.Optional(be),updater:n.Optional(be),createdAt:v({description:"Timestamp the investigation was created at."}),updatedAt:v({description:"Timestamp the investigation was last updated at."})},{title:"Investigation"}),xS=n.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:Qe(p({type:"long"}),{description:"Markdown content capturing the investigation notes and findings"}),tags:qt,owner:p({allowEmpty:!1,description:"Team ID owning the investigation"}),env:Qe(p({allowEmpty:!0}),{description:"Environment the investigation relates to"}),linkedAssets:n.Optional(n.Array(wze,{maxItems:100,description:"Assets (dashboards, monitors, \u2026) referenced by this investigation"}))}),vze={name:"Payments 5xx spike",slug:"incident-2024-06-payments-5xx",contentMd:`## Summary
@@ -319,7 +319,7 @@ ${a}`:`[${e}]`),a&&u?`${a}
319
319
  ${u}`:a||u}function y1(e,{maxDepth:t=1e3,numbersAsFloat:r=!1,strictTemporal:o=!1}={}){if(i_(e)!=="object")throw new TypeError("stringify can only be called with an object");let i=h1(0,e,"",t,r,o);return i[i.length-1]!==`
320
320
  `?i+`
321
321
  `:i}function Y4e(e,t,r){return{environment:"dev",log_user_prompt:r,exporter:{"otlp-http":{endpoint:`${e}/v1/logs`,protocol:"binary",headers:{Authorization:`Bearer ${t}`}}},trace_exporter:{"otlp-http":{endpoint:`${e}/v1/traces`,protocol:"binary",headers:{Authorization:`Bearer ${t}`}}}}}var V4e=N("cli.setup.codex")(function*(e,t,r,o){let i=yield*rn,s=(0,E1.join)(e,".codex"),a=(0,E1.join)(s,"config.toml");yield*$e(`Codex \u2192 ${a}`),yield*i.makeDirectory(s,{recursive:!0}).pipe(Vc("create",s));let u=yield*lg(a),l=yield*u===void 0?A({}):Et({try:()=>f1(u),catch:()=>new Gn({message:`${a} is not valid TOML. Fix or remove it before re-running.`})}),d="otel"in l,{otel:g,...y}=l,E={...y,otel:Y4e(t,r,o)},h=yield*dg(a,u,yield*AP);yield*pg(a,y1(E)),yield*$e(h===void 0?" created":d?` replaced existing [otel] tables (backup: ${h})`:` appended (backup: ${h})`)}),xfe=P("codex",{endpoint:CP,ingestionApiKey:RP,includePrompts:PP("user prompts")},N("cli.setup.codexCli")(function*(e){yield*V4e((0,bfe.homedir)(),e.endpoint.replace(/\/+$/,""),e.ingestionApiKey,e.includePrompts),yield*$e(OP)})).pipe(U("Patch ~/.codex/config.toml with Tsuga OTEL settings (replaces any existing [otel] table)"));var Ofe=P("setup").pipe(U("Configure local LLM CLIs to ship OTEL telemetry to Tsuga"),xe([ffe,xfe]));var Afe=jn("contrast-sets","Compare two groups of spans and return the attributes that separate them",VJ);var NP=je("trace-id").pipe(re("Trace ID to summarize"),_e("TRACE_ID"));var Cfe=P("latency-summary",{traceId:NP,...Xt,minRangeDurationMs:$V("min-range-duration-ms").pipe(re("Collapse timeline ranges shorter than this (default: max(1ms, 1% of trace duration); 0 disables collapsing)"),_e("MILLISECONDS"),tt),ranges:Wn("ranges").pipe(re("Include the per-range timeline; --no-ranges returns only services and serviceTotals"),xn(!0))},N("cli.traces.latencySummary")(function*(e){yield*Oe(yield*Xe(HJ,{query:yn({traceId:e.traceId,...yield*Wr(e),minRangeDurationMs:ue(e.minRangeDurationMs),includeRanges:e.ranges?void 0:!1})}))})).pipe(U("Summarize where wall-clock time is spent in a trace, attributed per service"));var W4e=["start_time","duration","context.service.name","span.name","status_code","trace_id"],Rfe=P("search",{...Xt,query:Cp,maxResults:Rg,pretty:_o},N("cli.traces.search")(function*(e){let t=yield*fn,{spans:r}=yield*rr(xT,{query:yield*Dg(e)});yield*t.rows(r,{...e,defaultFields:W4e})})).pipe(U("Search spans"));var Pfe=P("summarize",{traceId:NP,...Xt},N("cli.traces.summarize")(function*(e){yield*Oe(yield*Xe(jJ,{query:{traceId:e.traceId,...yield*Wr(e)}}))})).pipe(U("Summarize a trace by aggregating groups of similar spans into summary spans. Each span keeps service and env inline and points at its full resource context in `resources` via `resource_id`"));var Ufe=P("traces").pipe(U("Search and summarize traces"),xe([Afe,Rfe,Pfe,Cfe]));var wfe="/logs",vfe="/explorer",T1="/analytics";var Nfe=n.Object({id:n.String({description:"Code of the short link, the last path segment of `https://app.tsuga.com/l/<id>`."}),url:n.String({description:"Relative app URL (path and search) the short link opens. Search parameters use the app URL encoding: object and array values are JSON-stringified, then URL-encoded."}),expiresAt:v({description:"Timestamp after which the short link stops resolving."})},{$id:"ShortUrl",description:"A short link copied with **Copy page URL** in the app, resolved to the app URL it opens. See [Copy and paste](/documentation/keyboard-shortcuts#copy-and-paste)."}),Q4e={id:"aB3-dE5fG-h7J",url:"/logs?query=level%3Aerror&timeRange=%7B%22type%22%3A%22absolute%22%2C%22from%22%3A1767225600000%2C%22to%22%3A1767229200000%7D",expiresAt:"2026-02-01T00:00:00.000Z"};Object.assign(Nfe,{examples:[Q4e]});var kfe=f({description:"Resolves a short link copied with **Copy page URL** to the app URL it opens, which carries the page state, such as the query, filters and time range. An expired or unknown code returns 404.",operationId:"getShortUrl",tags:["short-urls"],url:`/${"v1"}/short-urls/:id`,method:"GET",params:n.Object({id:p({allowEmpty:!1,description:"Code of the short link, the last path segment of `https://app.tsuga.com/l/<id>`."})}),response:Nfe});var Lfe=n.Object({id:n.String({description:"Code of the share link, the last path segment of `https://api.tsuga.com/v0/widget-shares/<orgId>/<id>`."}),title:n.Optional(n.String({description:"Name of the widget the link was shared from. Omitted when the widget had no name."})),search:n.String({description:"Analytics search parameters captured when the link was created, without the leading `?`. Values use the app URL encoding: object and array values are JSON-stringified, then URL-encoded. `timeZone` is the time zone of the user who created the link, which the shared image uses."}),dashboardId:n.Optional(n.String({description:"ID of the dashboard holding the shared widget. Omitted for Analytics shares."})),graphId:n.Optional(n.String({description:"ID of the shared widget on its dashboard. Omitted for Analytics shares."})),url:n.String({description:"Absolute app URL a signed-in browser opening the share link is redirected to: the widget on its dashboard, or Analytics. It carries no `timeZone`, so the app shows the result in the time zone of the viewer."}),expiresAt:v({description:"Timestamp after which the share link stops resolving."})},{$id:"WidgetShare",description:"A widget share link created from Analytics or a dashboard widget, with the query it renders. See [Share links](/documentation/visualize/analytics/index#share-links)."}),Z4e={id:"kL9-mN2pQ-r4S",title:"Checkout errors",search:"source=logs&queries=%5B%7B%22aggregate%22%3A%7B%22type%22%3A%22count%22%7D%2C%22filter%22%3A%22service%3Acheckout%22%7D%5D&timeRange=%7B%22type%22%3A%22absolute%22%2C%22from%22%3A1767225600000%2C%22to%22%3A1767229200000%7D",dashboardId:"dashboard-123-abc",graphId:"graph-123-abc",url:"https://app.tsuga.com/dashboards/dashboard-123-abc?openedGraph=graph-123-abc&openedGraphReadonly=true&timeRange=%7B%22type%22%3A%22absolute%22%2C%22from%22%3A1767225600000%2C%22to%22%3A1767229200000%7D",expiresAt:"2026-02-01T00:00:00.000Z"};Object.assign(Lfe,{examples:[Z4e]});var Mfe=f({description:"Resolves a widget share link, whose unfurl only shows an image, to the query behind it: widget title, Analytics search and dashboard. An expired or unknown code returns 404.",operationId:"getWidgetShare",tags:["public","widget-shares"],url:`/${"v1"}/widget-shares/:id`,method:"GET",params:n.Object({id:p({allowEmpty:!1,description:"Code of the share link, the last path segment of `https://api.tsuga.com/v0/widget-shares/<orgId>/<id>`."})}),response:Lfe});var X4e=/^\/l\/([^/]+)\/?$/,J4e=/^\/v0\/widget-shares\/[^/]+\/([^/]+?)(?:\/image\.png)?\/?$/,e3e={[wfe]:"logs-explorer",[vfe]:"logs-explorer","/traces":"traces-explorer",[T1]:"analytics"};function t3e(e){if(!URL.canParse(e))return;let t=new URL(e);if(t.protocol!=="https:"&&t.protocol!=="http:"||!r3e(t.hostname))return;let r=J4e.exec(t.pathname);if(r?.[1])return{type:"widget-share",code:decodeURIComponent(r[1])};if(t.hostname.startsWith("api."))return;let o=X4e.exec(t.pathname);return o?.[1]?{type:"explorer-short-link",origin:t.origin,code:decodeURIComponent(o[1])}:{type:"app-url",url:t}}function r3e(e){return e==="localhost"||e==="127.0.0.1"||["tsuga.com","tsuga-staging.com"].some(t=>e===t||e.endsWith(`.${t}`))}function S1(e,t,{search:r=t.search,...o}={}){return Et({try:()=>{let i=n3e(r);return"timeRange"in i&&(i.timeRange=o3e(i.timeRange)),{type:e,url:t.href,view:i3e(t.pathname),path:t.pathname,...o,searchParams:i}},catch:()=>new gd({message:"The link contains an invalid time range."})})}function n3e(e){let t={};for(let[r,o]of new URLSearchParams(e))try{t[r]=JSON.parse(o)}catch{t[r]=o}return t}function o3e(e){if(e===null||typeof e!="object")return e;let{type:t,from:r,to:o}=e;return t!=="absolute"||typeof r!="number"||typeof o!="number"?e:{type:t,from:bc(Es(r)),to:bc(Es(o))}}function i3e(e){return e.startsWith("/dashboards/")?"dashboard":e3e[e]}var Dfe=P("unshorten",{url:Er("URL").pipe(jt("A short link from Copy page URL, a widget share link, or a full app.tsuga.com URL"))},N("cli.unshorten")(function*({url:e}){let t=yield*Et({try:()=>t3e(e.trim()),catch:()=>new gd({message:"The link contains invalid URL encoding."})});if(t===void 0)return yield*new gd({message:`Not a Tsuga short link, widget share link, or app URL: ${e}`,suggestions:["Pass a short link (https://app.tsuga.com/l/<code>), a widget share link (https://api.tsuga.com/v0/widget-shares/<orgId>/<code>), or an app.tsuga.com URL"]});switch(t.type){case"app-url":yield*Oe({data:yield*S1("app-url",t.url)});return;case"explorer-short-link":{let r=yield*rr(kfe,{params:{id:t.code}});yield*Oe({data:yield*S1("explorer-short-link",new URL(r.url,t.origin),{expiresAt:r.expiresAt})});return}case"widget-share":{let r=yield*rr(Mfe,{params:{id:t.code}}),o=new URL(r.url);yield*Oe({data:yield*S1("widget-share",o,{search:r.search,expiresAt:r.expiresAt,widget:{title:r.title,dashboardId:r.dashboardId,graphId:r.graphId,analyticsUrl:new URL(`${T1}?${r.search}`,o.origin).href}})});return}default:Nt(t)}})).pipe(U("Expand a Tsuga short link or widget share link and decode its query, time range, and view"));var Ffe=Kme.pipe(xe([{group:"Resources",commands:qme},{group:"Query & explore",commands:[eae,lae,Ufe,Tae,ofe,Fne,dfe,Hie,tse,Vse,mce,_ae,tie,Lie,Dfe]},{group:"Documentation, help & feedback",commands:[mie,$ie,afe]},{group:"Setup & config",commands:[Qoe,pie,nie,Ofe,Xie,ufe]}]),Gx($A,e=>e.fields),Gx(Ua,e=>({operationApiKey:ue(e.operationApiKey),cluster:ue(e.cluster),rationale:ue(e.rationale)})),g4(fn.pageLayer)),_1=Ffe.pipe(Gx(e_,()=>({root:Ffe})));function $fe(e,t){let r=e.split(".").map(Number),o=t.split(".").map(Number);for(let i=0;i<Math.max(r.length,o.length);i++){let s=(r[i]??0)-(o[i]??0);if(s!==0)return s}return 0}var s3e=3e3,a3e="https://registry.npmjs.org/@tsuga/cli/latest",c3e=pn({version:Se}),u3e=Go(c3e),p3e=N("cli.checkForUpdate")(function*(e){let t=yield*ht,r=yield*Yl,o=yield*Kn,i=yield*t.getLastUpdateCheck;if(i&&o-Date.parse(i)<Ra)return;let s=yield*r.get(a3e).pipe(q(Pk),q(a=>a.json),q(u3e),R2(s3e),O2);Sn(s)||($fe(s.value.version,e)>0&&(yield*Xn(`
322
- Update available: ${e} \u2192 ${s.value.version}`),yield*Xn("Run `tsuga self-update` to update")),yield*t.saveLastUpdateCheck(bc(Es(o))))}),Gfe=e=>fc(p3e(e));dM(process.stdout);dM(process.stderr);var l3e=xm(ht.layer,Ep.layer).pipe(Om(ng.layer),Om(B4),Om(hY)),I1=process.argv.slice(2),jfe=I1.some(e=>["--help","-h","--version","-v","--completions","--wizard"].includes(e)),b1,qfe=e=>{b1=e;for(let t of DA)process.removeListener(t,qfe)};for(let e of DA)process.once(e,qfe);var Hfe=zie(process.stdout,process.stderr);process.on("exit",Hfe.release);var Bfe=hk(_1,{version:"1.196.0"})(I1).pipe(Yie(Hfe)),d3e=jfe?Bfe:eee(Bfe,I1,_1,()=>b1).pipe(wn(Gfe("1.196.0")));d3e.pipe(Co(e=>qA(e)?wn(e.pipe(WZ,Xn),ie(()=>process.exitCode=BA(e))):HA(e)&&!jfe?ie(()=>process.exitCode=Rr.usage):$(e)),DI(l3e),w2(XJ),$i(j4,!0),e=>G2(e,{teardown:(t,r)=>Ou(t)&&pc(t.cause)?r(jA(b1)):fv(t,r)}));
322
+ Update available: ${e} \u2192 ${s.value.version}`),yield*Xn("Run `tsuga self-update` to update")),yield*t.saveLastUpdateCheck(bc(Es(o))))}),Gfe=e=>fc(p3e(e));dM(process.stdout);dM(process.stderr);var l3e=xm(ht.layer,Ep.layer).pipe(Om(ng.layer),Om(B4),Om(hY)),I1=process.argv.slice(2),jfe=I1.some(e=>["--help","-h","--version","-v","--completions","--wizard"].includes(e)),b1,qfe=e=>{b1=e;for(let t of DA)process.removeListener(t,qfe)};for(let e of DA)process.once(e,qfe);var Hfe=zie(process.stdout,process.stderr);process.on("exit",Hfe.release);var Bfe=hk(_1,{version:"1.198.0"})(I1).pipe(Yie(Hfe)),d3e=jfe?Bfe:eee(Bfe,I1,_1,()=>b1).pipe(wn(Gfe("1.198.0")));d3e.pipe(Co(e=>qA(e)?wn(e.pipe(WZ,Xn),ie(()=>process.exitCode=BA(e))):HA(e)&&!jfe?ie(()=>process.exitCode=Rr.usage):$(e)),DI(l3e),w2(XJ),$i(j4,!0),e=>G2(e,{teardown:(t,r)=>Ou(t)&&pc(t.cause)?r(jA(b1)):fv(t,r)}));
323
323
  /**
324
324
  * The following is a list of HTTP status codes and their meanings.
325
325
  *