@tsuga/cli 1.51.0 → 1.52.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -9
- package/dist/cli.js +7 -7
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -236,7 +236,7 @@ ${Pe("Wizard cancelled.",Tc)}`,xY=(e,t,r,o=xc)=>{let i=fRe(t);return[Pe(e,Sc,o),
|
|
|
236
236
|
`,r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>h(h(M(";",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>h(h(M(`
|
|
237
237
|
`,e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>[]))),([t,r])=>[t,r]),MQ=(e,t=[])=>h(h(LQ(e),([r,o])=>h(j0(o),([i,s])=>[[r,i],s])),([r,o])=>MQ(o,[...t,r]),()=>[t,e]),cNe=e=>h(h(h(j0(e),([t,r])=>h(MQ(r),([o,i])=>h(h(LQ(i),([s,a])=>[[s],a],()=>[[],i]),([s,a])=>[[t,o,s],a]))),([t,r])=>[t,r],()=>h([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[L6(t),r]),j0=e=>h(h(aNe(e),([t,r])=>h(h(nNe(r),([o,i])=>[o,i],()=>h(oNe(r),([o,i])=>[o,i],()=>h(iNe(r),([o,i])=>[o,i],()=>h(sNe(r),([o,i])=>[o,i],()=>[])))),([o,i])=>h(aQ(i),([s,a])=>[[t,o,s],a]))),([t,r])=>[M6(t),r]),lNe=e=>h(h(j0(e),([t,r])=>h(cNe(r),([o,i])=>[[t,o],i])),([t,r])=>[D6(t),r]),DQ=e=>h(h(lNe(e),([t,r])=>[t,r],()=>h(yUe(e),([t,r])=>[t,r],()=>h(ft(e),([t,r])=>[t,r],()=>[]))),([t,r])=>[t,r]);function FQ(e){let t=$0(`\`${e}\``);return u.IsEqual(t.length,2)?t[0]:Vt()}function pNe(e){return e.join("|")}function mNe(e){return e.slice(1,e.length-1)}function dNe(e,t,r){return Ql(t,`${r}${e}`)}function fNe(e,t){return Ql(e,`${t}${r9}`)}function gNe(e,t){return Ql(e,`${t}${gA}`)}function hNe(e,t){return Ql(e,`${t}${SA}`)}function yNe(e,t){return FE(Ge([Ye("false"),Ye("true")]),e,t)}function ENe(e,t){return Ql(e,`${t}${TA}`)}function SNe(e,t,r){return Ql(t,`${r}${mNe(e)}`)}function TNe(e,t,r){let o=$E(e,{});return FE(o,t,r)}function bNe(e,t,r){let o=No(e);return FE(o,t,r)}function $Q(e,t,r,o=[]){return u.ShiftLeft(e,(i,s)=>$Q(s,t,r,[...o,FE(i,[],"")]),()=>Ql(t,`${r}(${pNe(o)})`))}function FE(e,t,r){return zr(e)?bNe(e.enum,t,r):An(e)?gNe(t,r):Ze(e)?dNe(e.const,t,r):Wo(e)?fNe(t,r):uo(e)?yNe(t,r):Sr(e)?hNe(t,r):rn(e)?ENe(t,r):Xt(e)?SNe(e.pattern,t,r):BQ(e)?TNe(e.parameters[0],t,r):te(e)?$Q(e.anyOf,t,r):wV}function Ql(e,t){return u.ShiftLeft(e,(r,o)=>FE(r,o,t),()=>t)}function xNe(e){return`^${Ql(e,"")}$`}function GQ(e){let t=xNe(e);return xA(t)}function $E(e,t){return ze(e)?U.Update(GQ(e),{},t):vA(e,t)}function qQ(e,t,r,o){let i=xi(e,t,r);return $E(i,o)}function vA(e,t={}){return fe("TemplateLiteral",[e],t)}function BQ(e){return Or(e)&&u.HasPropertyKey(e,"action")&&u.IsEqual(e.action,"TemplateLiteral")}function jQ(e){return $E(e,{})}function INe(e){let t=FQ(e);return jQ(t)}function HQ(e,t={}){let r=u.IsString(e)?INe(e):jQ(e);return U.Update(r,{},t)}function Xt(e){return ue(e,"TemplateLiteral")}var ke={};wi(ke,{ExtendsFalse:()=>Be,ExtendsTrue:()=>se,ExtendsUnion:()=>H0,IsExtendsFalse:()=>_Ne,IsExtendsTrue:()=>zQ,IsExtendsTrueLike:()=>sf,IsExtendsUnion:()=>KQ,Match:()=>ur});function H0(e){return U.Create({"~kind":"ExtendsUnion"},{inferred:e})}function KQ(e){return u.IsObject(e)&&u.HasPropertyKey(e,"~kind")&&u.HasPropertyKey(e,"inferred")&&u.IsEqual(e["~kind"],"ExtendsUnion")&&u.IsObject(e.inferred)}function se(e){return U.Create({"~kind":"ExtendsTrue"},{inferred:e})}function zQ(e){return u.IsObject(e)&&u.HasPropertyKey(e,"~kind")&&u.HasPropertyKey(e,"inferred")&&u.IsEqual(e["~kind"],"ExtendsTrue")&&u.IsObject(e.inferred)}function Be(){return U.Create({"~kind":"ExtendsFalse"},{})}function _Ne(e){return u.IsObject(e)&&u.HasPropertyKey(e,"~kind")&&u.IsEqual(e["~kind"],"ExtendsFalse")}function sf(e){return KQ(e)||zQ(e)}function ur(e,t,r){return sf(e)?t(e.inferred):r()}function ANe(e,t,r,o){return ur(pt(e,r,o),i=>se(U.Assign(U.Assign(e,i),{[t]:r})),()=>Be())}function ONe(e,t){return se(e)}function CNe(e,t,r,o,i){return ur(pt(e,t,r),s=>ur(pt(s,t,o),a=>se(a),()=>Be()),()=>ur(pt(e,t,i),s=>se(s),()=>Be()))}function RNe(e,t,r){let o=No(r);return pt(e,t,o)}function YQ(e,t,r){return u.ShiftLeft(r,(o,i)=>ur(pt(e,t,o),s=>YQ(s,t,i),()=>Be()),()=>se(e))}function PNe(e,t,r){let o=Xn(r);return pt(e,t,o)}function VQ(e,t,r){return u.ShiftLeft(r,(o,i)=>ur(pt(e,t,o),s=>se(s),()=>VQ(e,t,i)),()=>Be())}function Pt(e,t,r){return en(r)?ONe(e,t):Ur(r)?CNe(e,t,r.if,r.then,r.else):zr(r)?RNe(e,t,r.enum):Kr(r)?ANe(e,r.name,t,r.extends):Ue(r)?YQ(e,t,r.allOf):Xt(r)?PNe(e,t,r.pattern):te(r)?VQ(e,t,r.anyOf):gn(r)?se(e):Be()}function QQ(e,t,r){return Kr(r)?Pt(e,t,r):en(r)?se(e):gn(r)?se(e):H0(e)}function wNe(e,t){let r=Cp(e),o=Cp(t);return r&&o||!r&&o?!0:!(r&&!o)}function WQ(e,t,r,o){return at(o)?wNe(t,o)?pt(e,r,o.items):Be():Pt(e,t,o)}function JQ(e,t,r){return Wo(r)?se(e):Pt(e,t,r)}function ZQ(e,t,r){return uo(r)?se(e):Pt(e,t,r)}function vNe(e,t,r,o,i){let s=Kr(o)?t:o,a=Kr(o)?o:t,c=fn(t),l=fn(o);return!c&&l?Be():ur(pt(e,s,a),m=>GE(m,r,i),()=>Be())}function UNe(e,t,r,o){return u.ShiftLeft(o,(i,s)=>vNe(e,t,r,i,s),()=>fn(t)?se(e):Be())}function NNe(e,t,r){return u.ShiftLeft(t,(o,i)=>UNe(e,o,i,r),()=>se(e))}function GE(e,t,r){return NNe(e,t,r)}function iO(e,t,r){return Xo(r)?se(e):pt(e,t,r)}function XQ(e,t,r,o){return en(o)?se(e):gn(o)?se(e):jr(o)?ur(GE(e,t,o.parameters),i=>iO(i,r,o.instanceType),()=>Be()):Be()}function eW(e,t,r,o,i){return ur(pt(e,t,i),()=>pt(e,r,i),()=>pt(e,o,i))}function tW(e,t,r){let o=No(t);return pt(e,o,r)}function rW(e,t,r,o){return en(o)?se(e):gn(o)?se(e):Hr(o)?ur(GE(e,t,o.parameters),i=>iO(i,r,o.returnType),()=>Be()):Be()}function nW(e,t,r){return An(r)?se(e):Sr(r)?se(e):Pt(e,t,r)}function oW(e,t,r){let o=Cr(t);return pt(e,o,r)}function sO(e,t,r){return t===r?se(e):Be()}function kNe(e,t,r){return Ze(r)?sO(e,t,r.const):Wo(r)?se(e):Pt(e,Ye(t),r)}function LNe(e,t,r){return Ze(r)?sO(e,t,r.const):uo(r)?se(e):Pt(e,Ye(t),r)}function MNe(e,t,r){return Ze(r)?sO(e,t,r.const):Sr(r)?se(e):Pt(e,Ye(t),r)}function DNe(e,t,r){return Ze(r)?sO(e,t,r.const):rn(r)?se(e):Pt(e,Ye(t),r)}function iW(e,t,r){return u.IsBigInt(t.const)?kNe(e,t.const,r):u.IsBoolean(t.const)?LNe(e,t.const,r):u.IsNumber(t.const)?MNe(e,t.const,r):u.IsString(t.const)?DNe(e,t.const,r):Vt()}function sW(e,t,r){return Kr(r)?Pt(e,t,r):se(e)}function aW(e,t,r){return la(r)?se(e):Pt(e,t,r)}function cW(e,t,r){return Sr(r)?se(e):Pt(e,t,r)}function FNe(e,t,r){return fn(t)?fn(r)?se(e):Be():se(e)}function $Ne(e,t,r){return Kr(r)&&Ts(r.extends)?Be():ur(pt(e,t,r),o=>FNe(o,t,r),()=>Be())}function GNe(e,t){return e.reduce((r,o)=>o in t?sf(t[o])?{...r,...t[o].inferred}:Vt():Vt(),{})}function BNe(e,t,r){let o={};for(let a of u.Keys(r))o[a]=a in t?$Ne({},t[a],r[a]):fn(r[a])?Kr(r[a])?se(U.Assign(e,{[r[a].name]:r[a].extends})):se(e):Be();let i=u.Values(o).every(a=>sf(a)),s=i?GNe(u.Keys(o),o):{};return i?se(s):Be()}function qNe(e,t,r){let o=BNe(e,t,r);return sf(o)?se(U.Assign(e,o.inferred)):Be()}function jNe(e,t,r){return qNe(e,t,r)}function HNe(e,t){return u.Keys(t).reduce((r,o)=>({...r,[o]:u.HasPropertyKey(e,o)?te(r[o])?Ge([...r[o].anyOf,t[o]]):Ge([e[o],t[o]]):t[o]}),e)}function lW(e,t,r,o){return u.ShiftLeft(t,(i,s)=>ur(pt({},e[i],r),a=>lW(e,s,r,HNe(o,a)),()=>Be()),()=>se(o))}function KNe(e,t,r,o){let i=u.Keys(t);return lW(t,i,o,e)}function uW(e,t,r){return Bt(r)?KNe(e,t,On(r),lr(r)):Ne(r)?jNe(e,t,r.properties):Pt(e,ve(t),r)}function zNe(e,t){return u.IsEqual(u.Keys(t).length,0)?se(e):Be()}function YNe(e,t,r,o,i){return pt(e,r,i)}function pW(e,t,r,o){return Bt(o)?YNe(e,CA(t),r,CA(On(o)),lr(o)):Ne(o)?zNe(e,o.properties):en(o)?se(e):gn(o)?se(e):Be()}function mW(e,t,r){return rn(r)?se(e):Pt(e,t,r)}function dW(e,t,r){return ua(r)?se(e):Pt(e,t,r)}function fW(e,t,r){let o=Xn(t);return pt(e,o,r)}function K0(e,t){return U.Create({"~kind":"Inferrable"},{name:e,type:t},{})}function BE(e){return u.IsObject(e)&&u.HasPropertyKey(e,"~kind")&&u.HasPropertyKey(e,"name")&&u.HasPropertyKey(e,"type")&&u.IsEqual(e["~kind"],"Inferrable")&&u.IsString(e.name)&&u.IsObject(e.type)}function z0(e){return zl(e)?Kr(e.items)?at(e.items.extends)?K0(e.items.name,e.items.extends.items):gn(e.items.extends)?K0(e.items.name,e.items.extends):void 0:Vt():void 0}function aO(e){return Kr(e)?K0(e.name,e.extends):void 0}function Y0(e,t,r=[]){return u.ShiftLeft(e,(o,i)=>ur(pt({},o,t),()=>Y0(i,t,[...r,o]),()=>{}),()=>r)}function gW(e,t,r,o){let i=Y0(r,o);return u.IsArray(i)?se(U.Assign(e,{[t]:Nr(i)})):Be()}function cO(e,t,r,o){let i=Y0(r,o);return u.IsArray(i)?se(U.Assign(e,{[t]:Ge(i)})):Be()}function VNe(e){return[...e].reverse()}function V0(e,t){return t?VNe(e):e}function QNe(e){let t=e.length>0?e[0]:void 0,r=Or(t)?z0(t):void 0;return Or(r)}function WNe(e,t,r,o,i,s){return ur(pt(e,r,i),a=>hW(a,t,o,s),()=>Be())}function JNe(e,t,r,o,i){let s=z0(o);return BE(s)?gW(e,s.name,V0(r,t),s.type):u.ShiftLeft(r,(a,c)=>WNe(e,t,a,c,o,i),()=>Be())}function ZNe(e,t,r,o){return u.ShiftLeft(o,(i,s)=>JNe(e,t,r,i,s),()=>u.IsEqual(r.length,0)?se(e):Be())}function hW(e,t,r,o){return ZNe(e,t,r,o)}function XNe(e,t,r){let o=Wl(e,sr([],[]),r),i=QNe(o);return hW(e,i,V0(t,i),V0(o,i))}function yW(e,t,r){let o=aO(r);return BE(o)?cO(e,o.name,t,o.type):u.ShiftLeft(t,(i,s)=>ur(pt(e,i,r),a=>yW(a,s,r),()=>Be()),()=>se(e))}function EW(e,t,r){let o=Wl(e,sr([],[]),t);return Ve(r)?XNe(e,o,r.items):at(r)?yW(e,o,r.items):Pt(e,Nr(o),r)}function SW(e,t,r){return Xo(r)?se(e):xs(r)?se(e):Pt(e,t,r)}function TW(e,t,r){return u.ShiftLeft(r,(o,i)=>ur(pt(e,t,o),s=>se(s),()=>TW(e,t,i)),()=>Be())}function Q0(e,t,r){return u.ShiftLeft(t,(o,i)=>ur(TW(e,o,r),s=>Q0(s,i,r),()=>Be()),()=>se(e))}function bW(e,t,r){let o=aO(r);return BE(o)?cO(e,o.name,t,o.type):te(r)?Q0(e,t,r.anyOf):Q0(e,t,[r])}function xW(e,t,r){return Kr(r)?Pt(e,t,r):en(r)?se(e):gn(r)?se(e):Be()}function IW(e,t,r){return Xo(r)?se(e):Pt(e,t,r)}function pt(e,t,r){return en(t)?QQ(e,t,r):at(t)?WQ(e,t,t.items,r):Wo(t)?JQ(e,t,r):uo(t)?ZQ(e,t,r):jr(t)?XQ(e,t.parameters,t.instanceType,r):Ur(t)?eW(e,t.if,t.then,t.else,r):zr(t)?tW(e,t.enum,r):Hr(t)?rW(e,t.parameters,t.returnType,r):An(t)?nW(e,t,r):Ue(t)?oW(e,t.allOf,r):Ze(t)?iW(e,t,r):Ts(t)?sW(e,t,r):la(t)?aW(e,t,r):Sr(t)?cW(e,t,r):Ne(t)?uW(e,t.properties,r):Bt(t)?pW(e,On(t),lr(t),r):rn(t)?mW(e,t,r):ua(t)?dW(e,t,r):Xt(t)?fW(e,t.pattern,r):Ve(t)?EW(e,t.items,r):xs(t)?SW(e,t,r):te(t)?bW(e,t.anyOf,r):gn(t)?xW(e,t,r):Xo(t)?IW(e,t,r):Be()}function eke(e,t){return Cr([...e,ve(t)])}function W0(e,t,r){return ze(e)?U.Update(eke(e,t),{},r):NE(e,t,r)}function _W(e,t,r,o,i){let s=xi(e,t,r),a=qE(e,t,o);return W0(s,a,i)}function NE(e,t,r={}){return fe("Interface",[e,t],r)}function af(e){return Or(e)&&u.HasPropertyKey(e,"action")&&u.IsEqual(e.action,"Interface")}function AW(e,t,r={}){return W0(e,t,r)}function tke(e,t,r){return e.includes(r)?!0:jE([...e,r],t,t[r])}function OW(e,t,r){let o=uA(r);return Lp(e,t,o)}function Lp(e,t,r){return u.ShiftLeft(r,(o,i)=>jE(e,t,o)?!0:Lp(e,t,i),()=>!1)}function jE(e,t,r){return Dt(r)?tke(e,t,r.$ref):at(r)?jE(e,t,r.items):jr(r)?Lp(e,t,[...r.parameters,r.instanceType]):Hr(r)?Lp(e,t,[...r.parameters,r.returnType]):af(r)?OW(e,t,r.parameters[1]):Ue(r)?Lp(e,t,r.allOf):Ne(r)?OW(e,t,r.properties):te(r)?Lp(e,t,r.anyOf):Ve(r)?Lp(e,t,r.items):Bt(r)?jE(e,t,lr(r)):!1}function CW(e,t,r){return jE(e,t,r)}function rke(e,t){return t.reduce((r,o)=>CW([o],e,e[o])?[...r,o]:r,[])}function RW(e){let t=lA(e);return rke(e,t)}function nke(e,t,r){return r.includes(t)?r:t in e?HE(e,e[t],[...r,t]):Vt()}function PW(e,t,r){let o=uA(t);return cf(e,o,r)}function cf(e,t,r){return t.reduce((o,i)=>HE(e,i,o),r)}function HE(e,t,r){return Dt(t)?nke(e,t.$ref,r):at(t)?HE(e,t.items,r):jr(t)?cf(e,[...t.parameters,t.instanceType],r):Hr(t)?cf(e,[...t.parameters,t.returnType],r):af(t)?PW(e,t.parameters[1],r):Ue(t)?cf(e,t.allOf,r):Ne(t)?PW(e,t.properties,r):te(t)?cf(e,t.anyOf,r):Ve(t)?cf(e,t.items,r):Bt(t)?HE(e,lr(t),r):r}function wW(e,t,r){return HE(e,r,[t])}function oke(e){return Yd()}function ike(e){return u.Keys(e).reduce((t,r)=>({...t,[r]:Mp(e[r])}),{})}function KE(e){return e.reduce((t,r)=>[...t,Mp(r)],[])}function Mp(e){return Dt(e)?oke(e.$ref):at(e)?vo(Mp(e.items),Kd(e)):jr(e)?oa(KE(e.parameters),Mp(e.instanceType)):Hr(e)?ia(KE(e.parameters),Mp(e.returnType)):Ue(e)?kn(KE(e.allOf)):Ne(e)?ve(ike(e.properties)):Bt(e)?ef(Kl(e),Mp(lr(e))):te(e)?Ge(KE(e.anyOf)):Ve(e)?Nr(KE(e.items)):e}function ske(e,t){return t in e?Mp(e[t]):tn()}function vW(e){return ske(e.$defs,e.$ref)}function ake(e,t,r){let o=xi(e,sr([],[]),t),i=qE({},sr([],[]),r);return Cr([...o,ve(i)])}function cke(e,t){return u.Keys(e).filter(o=>t.includes(o)).reduce((o,i)=>{let s=e[i],a=af(s)?ake(e,s.parameters[0],s.parameters[1]):s;return{...o,[i]:a}},{})}function UW(e,t,r){let o=wW(e,t,r),i=cke(e,o);return aa(i,t)}function NW(e,t){return t in e?Dt(e[t])?NW(e,e[t].$ref):e[t]:Gt()}function pa(e,t){return NW(e,t)}function kW(e){return Zt(e)?vW(e):pA(e)?tn():e}function jn(e,t,r){let o=kW(t),i=kW(r);return pt(e,o,i)}var RE="equal",lke="disjoint",PE="left-inside",wE="right-inside";function Up(e,t){let r=[gn(e)?ke.ExtendsFalse():jn({},e,t),gn(e)?ke.ExtendsTrue({}):jn({},t,e)];return ke.IsExtendsTrueLike(r[0])&&ke.IsExtendsTrueLike(r[1])?RE:ke.IsExtendsTrueLike(r[0])&&ke.IsExtendsFalse(r[1])?PE:ke.IsExtendsFalse(r[0])&&ke.IsExtendsTrueLike(r[1])?wE:lke}function uke(e,t){return t.filter(r=>Up(e,r)!==wE)}function pke(e,t){let r=t.some(o=>{let i=Up(e,o);return u.IsEqual(i,PE)||u.IsEqual(i,RE)});return u.IsEqual(r,!1)}function mke(e,t){let r=zi(e);return en(r)?[r]:pke(r,t)?[...uke(r,t),r]:t}function dke(e){return e.reduce((t,r)=>Ne(r)?[...t,r]:Ts(r)?t:mke(r,t),[])}function R0(e){let t=dke(e);return Xd(t)}function J0(e,t){return U.Update(zi(e),{},t)}function LW(e,t,r,o){let i=V(e,t,r);return J0(i,o)}function zE(e,t=[]){return Gl(e)&&u.IsEqual(e.action,"Conditional")?Dt(e.parameters[0])?zE(e.parameters[2],zE(e.parameters[3],[...t,e.parameters[0].$ref])):zE(e.parameters[2],zE(e.parameters[3],t)):Gl(e)&&u.IsEqual(e.action,"Mapped")&&Gl(e.parameters[1])&&u.IsEqual(e.parameters[1].action,"KeyOf")&&Dt(e.parameters[1].parameters[0])?[...t,e.parameters[1].parameters[0].$ref]:t}function fke(e,t){return e.reduce((r,o)=>[...r,t.includes(o.name)],[])}function FW(e,t,r=[]){return u.ShiftLeft(e,(o,i)=>u.ShiftLeft(t,(s,a)=>FW(i,a,[...r,[s,o]]),()=>r),()=>r)}function gke(e){return Xt(e)?Xn(e.pattern):zr(e)?No(e.enum):e}function hke(e){let t=gke(e);return te(t)?[...t.anyOf]:[t]}function yke(e,t){return e.reduce((r,o)=>[...r,[...o,t]],[])}function MW(e,t){return t.reduce((r,o)=>[...r,...yke(e,o)],[])}function DW(e){return e.reduce((t,r)=>u.IsEqual(r[0],!0)?MW(t,hke(r[1])):MW(t,[r[1]]),[[]])}function $W(e,t,r){let o=zE(r),i=fke(e,o),s=FW(t,i);return Gl(r)&&u.IsEqual(r.action,"Conditional")||Gl(r)&&u.IsEqual(r.action,"Mapped")?DW(s):[t]}function Eke(){return["(not-resolvable)",Gt()]}function Ske(){return["(not-generic)",Gt()]}function Tke(e,t,r){return[e,Bl(t,r)]}function bke(e,t,r){return t in e?GW(e,t,e[t],r):Eke()}function GW(e,t,r,o){return zd(r)?Tke(t,r.parameters,r.expression):Dt(r)?bke(e,r.$ref,o):Ske()}function BW(e,t,r){return GW(e,"(anonymous)",t,r)}function xke(e,t,r){if(Kr(t)||lf(t)||ke.IsExtendsTrueLike(jn({},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 qW(e,t,r,o,i){let s=V(e,t,i);return xke(r,s,o),U.Assign(e,{[r]:s})}function Ike(e,t,r,o,i){let s=V(e,t,r.extends),a=V(e,t,r.equals);return u.ShiftLeft(i,(c,l)=>Z0(qW(e,t,r.name,s,c),t,o,l),()=>Z0(qW(e,t,r.name,s,a),t,o,[]))}function Z0(e,t,r,o){return u.ShiftLeft(r,(i,s)=>Ike(e,t,i,s,o),()=>e)}function jW(e,t,r,o){return Z0(e,t,r,o)}var X0=0,eL=0;function _ke(){if(!u.IsLessThan(eL,In.Get().maxInstantiationCount))throw Error("Type instantiation is excessively deep and possibly infinite")}function Ake(){_ke(),eL++,X0++}function Oke(){X0--,u.IsEqual(X0,0)&&(eL=0)}function Cke(e){return u.IsGreaterThan(e.callstack.length,0)?e.callstack[e.callstack.length-1]:""}function Rke(e,t){return u.IsEqual(Cke(e),t)}function Pke(e,t,r,o,i,s){Ake();try{let a=jW(e,t,o,s),c=V(a,sr([...t.callstack,r.$ref],t.visited),i);return V(a,sr([],[]),c)}finally{Oke()}}function wke(e,t,r,o,i,s){return s.reduce((a,c)=>{let l=Pke(e,t,r,o,i,c);return[...a,l]},[])}function vke(e,t,r,o,i,s){let a=$W(o,s,i),c=wke(e,t,r,o,i,a);return u.IsEqual(c.length,1)?c[0]:Zo(c)}function lO(e,t,r,o){let i=xi(e,t,o),s=BW(e,r,o),a=s[0],c=s[1];return zd(c)?Rke(t,a)?kE(_n(a),i):vke(e,t,_n(a),c.parameters,c.expression,i):kE(r,i)}function kE(e,t){return U.Create({"~kind":"Call"},{type:"call",target:e,arguments:t},{})}function HW(e,t){return lO({},sr([],[]),e,t)}function lf(e){return ue(e,"Call")}function Uke(e){return U.Discard(e,["~immutable"])}function KW(e,t){return U.Update(Uke(e),{},t)}function zW(e,t,r,o){let i=V(e,t,r);return KW(i,o)}function YW(e,t){return e(t)}function VW(e,t){return u.IsString(t)?Ye(YW(e,t)):Ye(t)}function QW(e,t){let r=Xn(t);return Rc(e,r)}function WW(e,t){let r=t.map(o=>Rc(e,o));return Ge(r)}function Rc(e,t){return Ze(t)?VW(e,t.const):Xt(t)?QW(e,t.pattern):te(t)?WW(e,t.anyOf):t}function UA(e,t={}){return fe("Capitalize",[e],t)}function JW(e,t={}){return tL(e,t)}function NA(e,t={}){return fe("Lowercase",[e],t)}function ZW(e,t={}){return rL(e,t)}function kA(e,t={}){return fe("Uncapitalize",[e],t)}function XW(e,t={}){return nL(e,t)}function LA(e,t={}){return fe("Uppercase",[e],t)}function e8(e,t={}){return oL(e,t)}var Nke=e=>e[0].toUpperCase()+e.slice(1),kke=e=>e.toLowerCase(),Lke=e=>e[0].toLowerCase()+e.slice(1),Mke=e=>e.toUpperCase();function tL(e,t){return ze([e])?U.Update(Rc(Nke,e),{},t):UA(e,t)}function rL(e,t){return ze([e])?U.Update(Rc(kke,e),{},t):NA(e,t)}function nL(e,t){return ze([e])?U.Update(Rc(Lke,e),{},t):kA(e,t)}function oL(e,t){return ze([e])?U.Update(Rc(Mke,e),{},t):LA(e,t)}function t8(e,t,r,o){let i=V(e,t,r);return tL(i,o)}function r8(e,t,r,o){let i=V(e,t,r);return rL(i,o)}function n8(e,t,r,o){let i=V(e,t,r);return nL(i,o)}function o8(e,t,r,o){let i=V(e,t,r);return oL(i,o)}function MA(e,t,r,o,i={}){return fe("Conditional",[e,t,r,o],i)}function i8(e,t,r,o,i={}){return iL({},sr([],[]),e,t,r,o,i)}function Dke(e,t,r,o,i,s){let a=jn(e,r,o);return ke.IsExtendsUnion(a)?Ge([V(a.inferred,t,i),V(e,t,s)]):ke.IsExtendsTrue(a)?V(a.inferred,t,i):V(e,t,s)}function iL(e,t,r,o,i,s,a){return ze([r,o])?U.Update(Dke(e,t,r,o,i,s),{},a):MA(r,o,i,s,a)}function s8(e,t,r,o,i,s,a){let c=V(e,t,r),l=V(e,t,o);return iL(e,t,c,l,i,s,a)}function DA(e,t={}){return fe("ConstructorParameters",[e],t)}function a8(e,t={}){return sL(e,t)}function Fke(e){let t=jr(e)?e.parameters:[],r=Wl({},sr([],[]),t);return Nr(r)}function sL(e,t){return ze([e])?U.Update(Fke(e),{},t):DA(e,t)}function c8(e,t,r,o){let i=V(e,t,r);return sL(i,o)}function FA(e,t,r={}){return fe("Exclude",[e,t],r)}function l8(e,t,r={}){return YE(e,t,r)}function YE(e,t,r){return ze([e,t])?U.Update(_A(e,t),{},r):FA(e,t,r)}function u8(e,t,r,o,i){let s=V(e,t,r),a=V(e,t,o);return YE(s,a,i)}function $A(e,t,r={}){return fe("Extract",[e,t],r)}function p8(e,t,r={}){return aL(e,t,r)}function $ke(e,t){let r=jn({},e,t);return ke.IsExtendsTrueLike(r)?[e]:[]}function Gke(e,t){return e.reduce((r,o)=>[...r,...$ke(o,t)],[])}function m8(e,t){let r=zi(e),o=te(r)?r.anyOf:[r],i=Gke(o,t);return Zo(i)}function aL(e,t,r){return ze([e,t])?U.Update(m8(e,t),{},r):$A(e,t,r)}function d8(e,t,r,o,i){let s=V(e,t,r),a=V(e,t,o);return aL(s,a,i)}function Bke(e){return e.reduce((t,r)=>hA(r)?[...t,Ye(r)]:t,[])}function uf(e){let t=Bke(e);return Ge(t)}function LE(e,t,r={}){return fe("Index",[e,t],r)}function f8(e,t,r={}){let o=u.IsArray(t)?uf(t):t;return cL(e,o,r)}function g8(e,t){let r=pa(e,t);return Ii(r)}function h8(e,t,r){let o=bs(e,t,r);return Ii(o)}function qke(e,t){let r=u.Keys(e).filter(y=>!u.HasPropertyKey(t,y)),o=u.Keys(t).filter(y=>!u.HasPropertyKey(e,y)),i=u.Keys(e).filter(y=>u.HasPropertyKey(t,y)),s=r.reduce((y,T)=>({...y,[T]:e[T]}),{}),a=o.reduce((y,T)=>({...y,[T]:t[T]}),{}),c=i.reduce((y,T)=>({...y,[T]:Cr([e[T],t[T]])}),{}),l=U.Assign(s,a);return U.Assign(l,c)}function y8(e){return e.reduce((t,r)=>qke(t,Ii(r)),{})}function E8(e){let t=I9(Nr(e));return Ii(t)}function jke(e,t){return u.Keys(e).filter(i=>i in t).reduce((i,s)=>({...i,[s]:Zo([e[s],t[s]])}),{})}function S8(e,t){return u.ShiftLeft(e,(r,o)=>S8(o,jke(t,Ii(r))),()=>t)}function T8(e){return u.ShiftLeft(e,(t,r)=>S8(r,Ii(t)),()=>Vt())}function Ii(e){return Zt(e)?g8(e.$defs,e.$ref):Ur(e)?h8(e.if,e.then,e.else):Ue(e)?y8(e.allOf):te(e)?T8(e.anyOf):Ve(e)?E8(e.items):Ne(e)?e.properties:{}}function pf(e){let t=Ii(e);return ve(t)}var Hke=new RegExp("^(?:0|[1-9][0-9]*)$");function mf(e){let t=`${e}`;return Hke.test(t)?parseInt(t):e}function Kke(e){return Ye(mf(e))}function b8(e){return e.map(t=>x8(t))}function x8(e){return Ue(e)?kn(b8(e.allOf)):te(e)?Ge(b8(e.anyOf)):Ze(e)?Kke(e.const):e}function I8(e,t){let r=x8(t),o=jn({},r,Jo());return ke.IsExtendsTrueLike(o)?e:Ze(t)&&u.IsEqual(t.const,"length")?Jo():Gt()}function _8(e,t){let r=pa(e,t);return ei(r)}function A8(e,t,r){let o=bs(e,t,r);return ei(o)}function O8(e){let t=No(e);return ei(t)}function C8(e){let t=Cr(e);return ei(t)}function R8(e){return[`${e}`]}function P8(e){let t=Xn(e);return ei(t)}function w8(e){return e.reduce((t,r)=>[...t,...ei(r)],[])}function ei(e){return Zt(e)?_8(e.$defs,e.$ref):Ur(e)?A8(e.if,e.then,e.else):zr(e)?O8(e.enum):Ue(e)?C8(e.allOf):Ze(e)?R8(e.const):Xt(e)?P8(e.pattern):te(e)?w8(e.anyOf):[]}function df(e){return ei(e)}function VE(e,t){return t.map(r=>QE(e,r))}function QE(e,t){return at(t)?vo(QE(e,t.items)):jr(t)?oa(VE(e,t.parameters),QE(e,t.instanceType)):Hr(t)?ia(VE(e,t.parameters),QE(e,t.returnType)):Ve(t)?Nr(VE(e,t.items)):te(t)?Ge(VE(e,t.anyOf)):Ue(t)?kn(VE(e,t.allOf)):PA(t)?ve(e):t}function v8(e,t){return QE(e,t)}function zke(e,t){let r=t in e?e[t]:Gt();return v8(e,r)}function U8(e,t){return t.reduce((r,o)=>[...r,zke(e,o)],[])}function Yke(e,t){let r=df(t),o=U8(e,r);return Zo(o)}var Vke=new RegExp(Hl);function Qke(e){return e.filter(r=>Vke.test(r))}function Wke(e){let t=lA(e),r=Qke(t),o=U8(e,r);return Zo(o)}function N8(e,t){return Sr(t)?Wke(e):Yke(e,t)}function Jke(e){return Ye(mf(e))}function k8(e){return e.map(t=>lL(t))}function lL(e){return Ue(e)?kn(k8(e.allOf)):te(e)?Ge(k8(e.anyOf)):Ze(e)?Jke(e.const):e}function Zke(e,t){return e.reduceRight((r,o,i)=>{let s=jn({},Ye(i),t);return ke.IsExtendsTrueLike(s)?[o,...r]:r},[])}function Xke(e,t){let r=lL(t),o=Zke(e,r);return Oc(o)}function e0e(e){return Oc(e)}function L8(e,t){return Ze(t)&&u.IsEqual(t.const,"length")?Ye(e.length):Sr(t)||An(t)?e0e(e):Xke(e,t)}function M8(e,t){return at(e)?I8(e.items,t):Ne(e)?N8(e.properties,t):Ve(e)?L8(e.items,t):Gt()}function t0e(e){return Zt(e)||Ur(e)||Ue(e)||te(e)?pf(e):e}function cL(e,t,r){return ze([e,t])?U.Update(M8(t0e(e),t),{},r):LE(e,t,r)}function D8(e,t,r,o,i){let s=V(e,t,r),a=V(e,t,o);return cL(s,a,i)}function GA(e,t={}){return fe("InstanceType",[e],t)}function F8(e,t={}){return uL(e,t)}function r0e(e){return jr(e)?e.instanceType:Gt()}function uL(e,t){return ze([e])?U.Update(r0e(e),{},t):GA(e,t)}function $8(e,t,r,o={}){let i=V(e,t,r);return uL(i,o)}function ME(e,t={}){return fe("KeyOf",[e],t)}function G8(e,t={}){return pL(e,t)}function B8(){return Ge([Jo(),po(),Jd()])}function q8(e){return Jo()}function n0e(e){return e.reduce((r,o)=>hA(o)?[...r,Ye(mf(o))]:Vt(),[])}function j8(e){let t=u.Keys(e),r=n0e(t);return Oc(r)}function H8(e){return Kl(e)}function K8(e){let t=e.map((r,o)=>Ye(o));return Oc(t)}function z8(e){return en(e)?B8():at(e)?q8(e.items):Ne(e)?j8(e.properties):Bt(e)?H8(e):Ve(e)?K8(e.items):Gt()}function o0e(e){return Zt(e)||Ur(e)||Ue(e)||te(e)?pf(e):e}function pL(e,t){return ze([e])?U.Update(z8(o0e(e)),{},t):ME(e,t)}function Y8(e,t,r,o){let i=V(e,t,r);return pL(i,o)}function UE(e,t,r,o,i={}){return fe("Mapped",[e,t,r,o],i)}function V8(e,t,r,o,i={}){return mL({},sr([],[]),e,t,r,o,i)}function i0e(e){let t=Xn(e);return uO(t)}function s0e(e){return e.reduce((t,r)=>[...t,...uO(r)],[])}function a0e(e){let t=No(e);return uO(t)}function c0e(e){return u.IsNumber(e)?[Ye(`${e}`)]:[Ye(e)]}function uO(e){return zr(e)?a0e(e.enum):Ze(e)?c0e(e.const):Xt(e)?i0e(e.pattern):te(e)?s0e(e.anyOf):[e]}function Q8(e){return uO(e)}function l0e(e){return Xt(e)?Xn(e.pattern):e}function u0e(e,t,r,o,i,s){let a=U.Assign(e,{[r.name]:o}),c=V(a,t,i),l=l0e(c),m=V(a,t,s);return yA(l)||EA(l)?{[l.const]:m}:{}}function p0e(e,t,r,o,i,s){return o.reduce((a,c)=>[...a,u0e(e,t,r,c,i,s)],[])}function m0e(e){return e.reduce((t,r)=>[...t,ve(r)],[])}function W8(e,t,r,o,i,s){let a=Q8(o),c=p0e(e,t,r,a,i,s),l=m0e(c);return Cr(l)}function mL(e,t,r,o,i,s,a){return ze([o])?U.Update(W8(e,t,r,o,i,s),{},a):UE(r,o,i,s,a)}function J8(e,t,r,o,i,s,a){let c=V(e,t,o);return mL(e,t,r,c,i,s,a)}function d0e(e,t,r){let o=U.Assign(e,t);return u.Keys(t).filter(s=>r.includes(s)).reduce((s,a)=>({...s,[a]:UW(o,a,t[a])}),{})}function f0e(e,t,r){let o=U.Assign(e,t);return u.Keys(t).filter(s=>!r.includes(s)).reduce((s,a)=>({...s,[a]:V(o,sr([],[]),t[a])}),{})}function g0e(e,t,r){let o=RW(t),i=d0e(e,t,o),s=f0e(e,t,o),a={...i,...s};return U.Update(a,{},r)}function pO(e,t,r,o){return g0e(e,r,o)}function BA(e,t={}){return fe("NonNullable",[e],t)}function Z8(e,t={}){return dL(e,t)}function h0e(e){let t=Ge([Wd(),tf()]);return YE(e,t,{})}function dL(e,t){return ze([e])?U.Update(h0e(e),{},t):BA(e,t)}function X8(e,t,r,o){let i=V(e,t,r);return dL(i,o)}function qA(e,t,r={}){return fe("Omit",[e,t],r)}function e7(e,t,r={}){let o=u.IsArray(t)?uf(t):t;return fL(e,o,r)}function mO(e){let t=pf(e);return Ne(t)?t.properties:Vt()}function y0e(e,t){return u.Keys(e).reduce((o,i)=>t.includes(i)?o:{...o,[i]:e[i]},{})}function t7(e,t){let r=mO(e),o=df(t),i=y0e(r,o);return ve(i)}function fL(e,t,r){return ze([e,t])?U.Update(t7(e,t),{},r):qA(e,t,r)}function r7(e,t,r,o,i){let s=V(e,t,r),a=V(e,t,o);return fL(s,a,i)}function jA(e,t={}){return fe("Parameters",[e],t)}function n7(e,t={}){return gL(e,t)}function E0e(e){let t=Hr(e)?e.parameters:[],r=Wl({},sr([],[]),t);return Nr(r)}function gL(e,t){return ze([e])?U.Update(E0e(e),{},t):jA(e,t)}function o7(e,t,r,o){let i=V(e,t,r);return gL(i,o)}function HA(e,t={}){return fe("Partial",[e],t)}function i7(e,t={}){return hL(e,t)}function s7(e,t){let r=pa(e,t),o=ma(r);return aa(U.Assign(e,{[t]:o}),t)}function a7(e,t,r){let o=bs(e,t,r);return ma(o)}function c7(e){let t=Cr(e);return ma(t)}function l7(e){let t=e.map(r=>ma(r));return Ge(t)}function u7(e){let t=u.Keys(e).reduce((o,i)=>({...o,[i]:Ip(e[i])}),{});return ve(t)}function ma(e){return Zt(e)?s7(e.$defs,e.$ref):Ur(e)?a7(e.if,e.then,e.else):Ue(e)?c7(e.allOf):te(e)?l7(e.anyOf):Ne(e)?u7(e.properties):ve({})}function hL(e,t){return ze([e])?U.Update(ma(e),{},t):HA(e,t)}function p7(e,t,r,o){let i=V(e,t,r);return hL(i,o)}function KA(e,t,r={}){return fe("Pick",[e,t],r)}function m7(e,t,r={}){let o=u.IsArray(t)?uf(t):t;return yL(e,o,r)}function S0e(e,t){return u.Keys(e).reduce((o,i)=>t.includes(i)?U.Assign(o,{[i]:e[i]}):o,{})}function d7(e,t){let r=mO(e),o=df(t),i=S0e(r,o);return ve(i)}function yL(e,t,r){return ze([e,t])?U.Update(d7(e,t),{},r):KA(e,t,r)}function f7(e,t,r,o,i){let s=V(e,t,r),a=V(e,t,o);return yL(s,a,i)}function zA(e,t={}){return fe("ReadonlyObject",[e],t)}function EL(e,t={}){return SL(e,t)}var g7=EL;function h7(e){return Qd(vo(e))}function y7(e,t){let r=pa(e,t),o=da(r);return aa(U.Assign(e,{[t]:o}),t)}function E7(e,t,r){let o=bs(e,t,r);return da(o)}function S7(e){let t=Cr(e);return da(t)}function T7(e){let t=u.Keys(e).reduce((o,i)=>({...o,[i]:Rp(e[i])}),{});return ve(t)}function b7(e){return Qd(Nr(e))}function x7(e){let t=e.map(r=>da(r));return Ge(t)}function da(e){return at(e)?h7(e.items):Zt(e)?y7(e.$defs,e.$ref):Ur(e)?E7(e.if,e.then,e.else):Ue(e)?S7(e.allOf):Ne(e)?T7(e.properties):Ve(e)?b7(e.items):te(e)?x7(e.anyOf):e}function SL(e,t){return ze([e])?U.Update(da(e),{},t):zA(e)}function I7(e,t,r,o){let i=V(e,t,r);return SL(i,o)}function _7(e,t,r,o){return t.visited.includes(o)?r:o in e?V(e,sr(t.callstack,[...t.visited,o]),e[o]):r}function A7(e,t){let r=pa(e,t),o=fa(r);return aa(U.Assign(e,{[t]:o}),t)}function O7(e,t,r){let o=bs(e,t,r);return fa(o)}function C7(e){let t=Cr(e);return fa(t)}function R7(e){let t=e.map(r=>fa(r));return Ge(t)}function P7(e){let t=u.Keys(e).reduce((o,i)=>({...o,[i]:IA(e[i])}),{});return ve(t)}function fa(e){return Zt(e)?A7(e.$defs,e.$ref):Ur(e)?O7(e.if,e.then,e.else):Ue(e)?C7(e.allOf):te(e)?R7(e.anyOf):Ne(e)?P7(e.properties):ve({})}function YA(e,t={}){return fe("Required",[e],t)}function w7(e,t={}){return TL(e,t)}function TL(e,t){return ze([e])?U.Update(fa(e),{},t):YA(e,t)}function v7(e,t,r,o){let i=V(e,t,r);return TL(i,o)}function VA(e,t={}){return fe("ReturnType",[e],t)}function U7(e,t={}){return bL(e,t)}function T0e(e){return Hr(e)?e.returnType:Gt()}function bL(e,t){return ze([e])?U.Update(T0e(e),{},t):VA(e,t)}function N7(e,t,r,o={}){let i=V(e,t,r);return bL(i,o)}function QA(e,t){return fe("With",[e,t],{})}function dO(e,t){return xL(e,t)}function xL(e,t){return ze([e])?U.Update(e,{},t):QA(e,t)}function k7(e,t,r,o){let i=V(e,t,r);return xL(i,o)}function b0e(e){return zl(e)?Ve(e.items)?IL(e.items.items):Kr(e.items)?[e]:Dt(e.items)?[e]:[Gt()]:[e]}function IL(e){return e.reduce((r,o)=>[...r,...b0e(o)],[])}function sr(e,t){return{callstack:e,visited:t}}function ze(e){return u.ShiftLeft(e,(t,r)=>Dt(t)?!1:ze(r),()=>!0)}function qE(e,t,r){return u.Keys(r).reduce((o,i)=>({...o,[i]:V(e,t,r[i])}),{})}function Wl(e,t,r){let o=xi(e,t,r);return IL(o)}function xi(e,t,r){return r.map(o=>V(e,t,o))}function x0e(e,t){let r=fn(e)?TE(t,{}):t,o=Pp(e)?SE(r,{}):r;return Cp(e)?WE(o,{}):o}function I0e(e,t,r,o,i){return u.IsEqual(r,"AddImmutable")?L7(e,t,o[0],i):u.IsEqual(r,"RemoveImmutable")?zW(e,t,o[0],i):u.IsEqual(r,"AddReadonly")?OV(e,t,o[0],i):u.IsEqual(r,"RemoveReadonly")?E9(e,t,o[0],i):u.IsEqual(r,"AddOptional")?CV(e,t,o[0],i):u.IsEqual(r,"RemoveOptional")?b9(e,t,o[0],i):u.IsEqual(r,"Capitalize")?t8(e,t,o[0],i):u.IsEqual(r,"Conditional")?s8(e,t,o[0],o[1],o[2],o[3],i):u.IsEqual(r,"ConstructorParameters")?c8(e,t,o[0],i):u.IsEqual(r,"Evaluate")?LW(e,t,o[0],i):u.IsEqual(r,"Exclude")?u8(e,t,o[0],o[1],i):u.IsEqual(r,"Extract")?d8(e,t,o[0],o[1],i):u.IsEqual(r,"Index")?D8(e,t,o[0],o[1],i):u.IsEqual(r,"InstanceType")?$8(e,t,o[0],i):u.IsEqual(r,"Interface")?_W(e,t,o[0],o[1],i):u.IsEqual(r,"KeyOf")?Y8(e,t,o[0],i):u.IsEqual(r,"Lowercase")?r8(e,t,o[0],i):u.IsEqual(r,"Mapped")?J8(e,t,o[0],o[1],o[2],o[3],i):u.IsEqual(r,"Module")?pO(e,t,o[0],i):u.IsEqual(r,"NonNullable")?X8(e,t,o[0],i):u.IsEqual(r,"Pick")?f7(e,t,o[0],o[1],i):u.IsEqual(r,"Parameters")?o7(e,t,o[0],i):u.IsEqual(r,"Partial")?p7(e,t,o[0],i):u.IsEqual(r,"Omit")?r7(e,t,o[0],o[1],i):u.IsEqual(r,"ReadonlyObject")?I7(e,t,o[0],i):u.IsEqual(r,"Record")?F9(e,t,o[0],o[1],i):u.IsEqual(r,"Required")?v7(e,t,o[0],i):u.IsEqual(r,"ReturnType")?N7(e,t,o[0],i):u.IsEqual(r,"TemplateLiteral")?qQ(e,t,o[0],i):u.IsEqual(r,"Uncapitalize")?n8(e,t,o[0],i):u.IsEqual(r,"Uppercase")?o8(e,t,o[0],i):u.IsEqual(r,"With")?k7(e,t,o[0],o[1]):fe(r,o,i)}function _0e(e,t,r){let o=Dt(r)?_7(e,t,r,r.$ref):at(r)?vo(V(e,t,r.items),Kd(r)):lf(r)?lO(e,t,r.target,r.arguments):jr(r)?oa(xi(e,t,r.parameters),V(e,t,r.instanceType),RV(r)):Hr(r)?ia(xi(e,t,r.parameters),V(e,t,r.returnType),PV(r)):Ur(r)?_p(V(e,t,r.if),V(e,t,r.then),V(e,t,r.else),LV(r)):Ue(r)?kn(xi(e,t,r.allOf),GV(r)):Ne(r)?ve(qE(e,t,r.properties),NV(r)):Bt(r)?OA(On(r),V(e,t,lr(r))):zl(r)?Np(V(e,t,r.items)):Ve(r)?Nr(Wl(e,t,r.items),y9(r)):te(r)?Ge(xi(e,t,r.anyOf),a9(r)):r;return x0e(r,o)}function V(e,t,r){return Gl(r)?I0e(e,t,r.action,r.parameters,r.options):_0e(e,t,r)}function Yi(e,t){return V(e,sr([],[]),t)}function A0e(e){return U.Update(e,{"~immutable":!0},{})}function WE(e,t){return U.Update(A0e(e),{},t)}function L7(e,t,r,o){let i=V(e,t,r);return WE(i,o)}function F6(e,t={}){return fe("AddImmutable",[e],t)}function Qd(e,t={}){return WE(e,t)}function $6(e,t={}){return fe("Evaluate",[e],t)}function Hn(e,t={}){return J0(e,t)}function G6(e,t={}){return fe("Module",[e],t)}function M7(e,t={}){return pO({},sr([],[]),e,t)}function O0e(e,t){let r=Up(e,t);return u.IsEqual(r,"right-inside")||u.IsEqual(r,"disjoint")?1:0}function D7(e,t,r=[]){return u.ShiftLeft(t,(o,i)=>u.IsEqual(O0e(e,o),1)?D7(e,i,[...r,o]):[...r,e,...t],()=>[...r,e])}function F7(e,t=[]){return u.ShiftLeft(e,(r,o)=>F7(o,D7(r,t)),()=>t)}function $7(e){return F7(e)}function G7(...e){let[t,r,o]=Et.Match(e,{2:(a,c)=>u.IsString(a)?[{},a,c]:[a,c,{}],3:(a,c,l)=>[a,c,l],1:a=>[{},a,{}]}),i=DQ(r),s=u.IsArray(i)&&u.IsEqual(i.length,2)?V(t,sr([],[]),i[0]):Gt();return U.Update(s,{},o)}var n={};wi(n,{Any:()=>Yd,Array:()=>vo,BigInt:()=>_E,Boolean:()=>fA,Call:()=>HW,Capitalize:()=>JW,Codec:()=>mA,Conditional:()=>i8,Constructor:()=>oa,ConstructorParameters:()=>a8,Cyclic:()=>aa,Decode:()=>JV,DecodeBuilder:()=>IE,Dependent:()=>_p,Encode:()=>ZV,EncodeBuilder:()=>xE,Enum:()=>$V,Evaluate:()=>Hn,Exclude:()=>l8,Extends:()=>jn,ExtendsResult:()=>ke,Extract:()=>p8,Function:()=>ia,Generic:()=>Bl,Identifier:()=>AE,Immutable:()=>XV,Index:()=>f8,Infer:()=>bE,InstanceType:()=>F8,Instantiate:()=>Yi,Integer:()=>wp,Interface:()=>AW,Intersect:()=>kn,IsAny:()=>en,IsArray:()=>at,IsBigInt:()=>Wo,IsBoolean:()=>uo,IsCall:()=>lf,IsCodec:()=>Op,IsConstructor:()=>jr,IsCyclic:()=>Zt,IsDependent:()=>Ur,IsEnum:()=>zr,IsEnumValue:()=>FV,IsFunction:()=>Hr,IsGeneric:()=>zd,IsIdentifier:()=>n9,IsImmutable:()=>Cp,IsInfer:()=>Kr,IsInteger:()=>An,IsIntersect:()=>Ue,IsKind:()=>ue,IsLiteral:()=>Ze,IsNever:()=>Ts,IsNull:()=>la,IsNumber:()=>Sr,IsObject:()=>Ne,IsOptional:()=>fn,IsParameter:()=>s9,IsReadonly:()=>Pp,IsRecord:()=>Bt,IsRef:()=>Dt,IsRefine:()=>dA,IsRest:()=>zl,IsSchema:()=>Or,IsString:()=>rn,IsSymbol:()=>ua,IsTemplateLiteral:()=>Xt,IsThis:()=>PA,IsTuple:()=>Ve,IsUndefined:()=>xs,IsUnion:()=>te,IsUnknown:()=>gn,IsUnsafe:()=>pA,IsVoid:()=>Xo,KeyOf:()=>G8,Literal:()=>Ye,Lowercase:()=>ZW,Mapped:()=>V8,Module:()=>M7,Never:()=>Gt,NonNullable:()=>Z8,Null:()=>Wd,Number:()=>Jo,Object:()=>ve,Omit:()=>e7,Optional:()=>vV,Parameter:()=>vp,Parameters:()=>n7,Partial:()=>i7,Pick:()=>m7,Readonly:()=>e9,ReadonlyObject:()=>EL,ReadonlyType:()=>g7,Record:()=>ef,RecordKey:()=>Kl,RecordPattern:()=>On,RecordValue:()=>lr,Ref:()=>_n,Refine:()=>t9,Required:()=>w7,Rest:()=>Np,ReturnType:()=>U7,Script:()=>G7,String:()=>po,Symbol:()=>Jd,TemplateLiteral:()=>HQ,This:()=>RA,Tuple:()=>Nr,Uncapitalize:()=>XW,Undefined:()=>tf,Union:()=>Ge,Unknown:()=>tn,Unsafe:()=>kV,Uppercase:()=>e8,Void:()=>wA,With:()=>dO});function Pr(e){throw new Error(`assertUnreachable: ${JSON.stringify(e,null,2)}`)}var B7="Must be a valid tags query: only tag:value searches (no wildcards), boolean operators, and parentheses are supported.";var C0e=ii(j7());var H7="lowercase-email",Dp="iana-timezone",_L="simple-time",AL="simple-date-time";var R0e=(e,t)=>RegExp(`^${e.source}(${t.source}${e.source})*$`),P0e=/[a-zA-Z0-9-_]+/,w0e=/\./,oNt=R0e(P0e,w0e);var K7="lowercase-domain";var Jl="kebab-case";var z7="camel-case";var Y7="http-url";var v0e=new Set;function Q(e,t,r={}){let o=t.map(i=>{let s=i;return s.$id?(v0e.add(i),n.Ref(s.$id)):i});return n.Unsafe({...r,type:"object",discriminator:{propertyName:e},required:[e],oneOf:o})}function qe(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 _i(e,t={}){return Q("type",[n.Object({type:n.Literal("ids"),ids:n.Array(f({allowEmpty:!1}),{minItems:1,uniqueItems:!0,...t.maxIds!==void 0&&{maxItems:t.maxIds}})}),n.Object({type:n.Literal("all"),filters:n.Optional(e)})])}function ko(e){return n.Object({value:f({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 Pc=1e3,gO=100,je={limit:n.Optional(n.Integer({minimum:1,maximum:Pc,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."}))},U0e=["asc","desc"],Le=n.Enum(U0e,{description:"Sort direction: ascending or descending."}),er={...je,limit:n.Optional(n.Integer({minimum:1,maximum:Pc,default:gO,description:`Maximum number of items to return in this page. Omit to use the public API default of ${gO}.`}))},N0e=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."}),uNt=n.Object({pagination:N0e},{$id:"ResponseMetadata",description:"Metadata accompanying `data` on paginated operations, describing the full result set the page was taken from."});function Ut(e,t={}){return n.Optional(n.Union([n.Null(),e],t))}function V7(e){return{...e,method:"PUT"}}function H(e={}){return n.Unsafe({...e,type:"string"})}var Zl=250;function f({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:z7,minLength:i,maxLength:Zl,...s});case"kebab-case":return n.String({format:Jl,minLength:i,maxLength:Zl,...s});case"email":return n.String({format:H7,minLength:i,maxLength:254,errorMessage:{format:"Must be a valid lowercase email address."},...s});case"lowercase-domain":return n.String({format:K7,minLength:i,maxLength:Zl,...s});case"tsuga-query":return n.String({format:"tsuga-query",minLength:i,maxLength:1e4,...s});case"tags-query":return n.String({format:"tags-query",minLength:i,maxLength:1e4,errorMessage:{format:`${B7} 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",...s});case"user-password":return n.String({format:"user-password",minLength:12,maxLength:Zl,...s});case"long":return n.String({minLength:i,maxLength:5e4,...s});case"short":return n.String({minLength:i,maxLength:Zl,...s});case"tsuga-formula":return n.String({format:"tsuga-formula",minLength:i,maxLength:Zl,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:Pr(t)}}var JE=["ingestion-api-key","operation-api-key","rum-public-token","dashboard","log-route","metric-route","monitor","notification-rule","notification-silence","slo"],hO=n.Array(n.Enum(JE,{description:"Tsuga-managed asset type."}),{description:"Tsuga-managed asset types covered by the policy. An empty array means all supported asset types."});var OL=["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"],INt=n.Enum(OL),k0e=["CLUSTER_AGGREGATION_STRUCTURE"];var _Nt=n.Object({code:n.Enum(OL),message:n.String()}),J7=[...OL,...k0e,"ABORT_ERROR","BAD_REQUEST","CUSTOM_ROLE_IN_USE","CUSTOM_ROLE_NAME_CONFLICT","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"],Z7=["INTERNAL_ERROR","INVALID_QUERY_TO_CLUSTER"];var L0e=["NETWORK_ERROR","RESPONSE_PARSE_ERROR"],M0e=[...J7,...Z7,...L0e],D0e=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(JE,{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."}),F0e=Q("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`."}),$0e=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:F0e},{description:"A single grok rule that failed to compile, with its position in the submitted rules and the structured compile error."}),X7=Q("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(D0e,{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($0e,{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."}),ANt=n.Object({code:n.Optional(n.Enum(M0e,{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(X7)},{$id:"ErrorResponse",description:"Standard envelope for API errors"}),ONt=n.Object({code:n.Optional(n.Enum(J7,{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(X7)},{$id:"ClientErrorResponse",description:"Standard envelope for client (4XX) API errors"}),CNt=n.Object({code:n.Optional(n.Enum(Z7,{description:"Machine readable error code describing what went wrong"})),message:n.String({description:"Human readable explanation of the error"}),statusCode:n.Number({description:"HTTP status code that was returned"})},{$id:"ServerErrorResponse",description:"Standard envelope for server (5XX) API errors"}),RNt=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"}),PNt=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"});function x({body:e,description:t,method:r,operationId:o,params:i,tags:s,query:a,paginated:c,response:l,url:m}){return i?{buildUrl:T=>m.replace(/:[a-zA-Z_]+/g,S=>T[S.slice(1)]),method:r,params:i,response:l,templateUrl:m,...e===void 0?{}:{body:e},...t===void 0?{}:{description:t},...o===void 0?{}:{operationId:o},...a===void 0?{}:{query:a},...c===void 0?{}:{paginated:c},...s===void 0?{}:{tags:s}}:{method:r,response:l,url:m,templateUrl:m,...e===void 0?{}:{body:e},...t===void 0?{}:{description:t},...o===void 0?{}:{operationId:o},...a===void 0?{}:{query:a},...c===void 0?{}:{paginated:c},...s===void 0?{}:{tags:s}}}function eJ(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 ae=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 CL="tsuga-cli";var Fp="/v0/oauth",tJ=x({description:"OAuth 2.1 authorization endpoint: validates the client and redirect URI, then redirects to the consent page",url:`${Fp}/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)"})}),rJ=x({description:"OAuth 2.1 token endpoint: exchanges an authorization code (PKCE) or refresh token for a token pair",url:`${Fp}/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()})}),KNt=x({description:"Resolve a signed authorization request handle for the consent page",url:`${Fp}/authorization-request`,method:"GET",query:n.Object({handle:n.String()}),response:n.Object({clientId:n.String(),clientName:n.String(),redirectUri:n.String()})}),zNt=x({description:"Approve or deny an OAuth authorization request from the consent page",url:`${Fp}/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"})})}),YNt=x({description:"Validate an OAuth access token (internal, for the MCP resource server)",url:`${Fp}/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())})}),G0e=["pending","active","revoked"],B0e=n.Object({id:n.String(),createdAt:H(),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(G0e),lastUsedAt:n.Optional(H())}),VNt=x({tags:["oauth"],description:"List OAuth grants: your own, or all users for admins",url:`${Fp}/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(B0e)}),QNt=x({tags:["oauth"],description:"Delete an OAuth grant (own grant, or any grant for admins)",url:`${Fp}/grants/:id`,method:"DELETE",params:n.Object({id:n.String()}),response:ae});var q0e=Math.pow(10,8)*24*60*60*1e3,JNt=-q0e;var nJ=864e5,oJ=6e4,iJ=36e5;var j0e=3600;var sJ=j0e*24,ZNt=sJ*7,H0e=sJ*365.2425,K0e=H0e/12,XNt=K0e*3,RL=Symbol.for("constructDateFrom");function Is(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&RL in e?e[RL](t):e instanceof Date?new e.constructor(t):new Date(t)}function nn(e,t){return Is(t||e,e)}function aJ(e,t,r){let o=nn(e,r?.in);return isNaN(t)?Is(r?.in||e,NaN):(t&&o.setDate(o.getDate()+t),o)}function cJ(e,t,r){let o=nn(e,r?.in);if(isNaN(t))return Is(r?.in||e,NaN);if(!t)return o;let i=o.getDate(),s=Is(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 ff(e,t,r){let{years:o=0,months:i=0,weeks:s=0,days:a=0,hours:c=0,minutes:l=0,seconds:m=0}=t,y=nn(e,r?.in),T=i||o?cJ(y,i+o*12):y,S=a||s?aJ(T,a+s*7):T,E=l+c*60,A=(m+E*60)*1e3;return Is(r?.in||e,+S+A)}var z0e={};function lJ(){return z0e}function PL(e){let t=nn(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 mo(e,...t){let r=Is.bind(null,e||t.find(o=>typeof o=="object"));return t.map(r)}function wL(e,t){let r=nn(e,t?.in);return r.setHours(0,0,0,0),r}function uJ(e,t,r){let[o,i]=mo(r?.in,e,t),s=wL(o),a=wL(i),c=+s-PL(s),l=+a-PL(a);return Math.round((c-l)/nJ)}function $p(e,t){let r=+nn(e)-+nn(t);return r<0?-1:r>0?1:r}function pJ(e,t,r){let[o,i]=mo(r?.in,e,t),s=o.getFullYear()-i.getFullYear(),a=o.getMonth()-i.getMonth();return s*12+a}function mJ(e,t,r){let[o,i]=mo(r?.in,e,t);return o.getFullYear()-i.getFullYear()}function fJ(e,t,r){let[o,i]=mo(r?.in,e,t),s=dJ(o,i),a=Math.abs(uJ(o,i));o.setDate(o.getDate()-s*a);let c=+(dJ(o,i)===-s),l=s*(a-c);return l===0?0:l}function dJ(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 gf(e){return t=>{let o=(e?Math[e]:Math.trunc)(t);return o===0?0:o}}function gJ(e,t,r){let[o,i]=mo(r?.in,e,t),s=(+o-+i)/iJ;return gf(r?.roundingMethod)(s)}function yO(e,t){return+nn(e)-+nn(t)}function hJ(e,t,r){let o=yO(e,t)/oJ;return gf(r?.roundingMethod)(o)}function yJ(e,t){let r=nn(e,t?.in);return r.setHours(23,59,59,999),r}function EJ(e,t){let r=nn(e,t?.in),o=r.getMonth();return r.setFullYear(r.getFullYear(),o+1,0),r.setHours(23,59,59,999),r}function SJ(e,t){let r=nn(e,t?.in);return+yJ(r,t)==+EJ(r,t)}function TJ(e,t,r){let[o,i,s]=mo(r?.in,e,e,t),a=$p(i,s),c=Math.abs(pJ(i,s));if(c<1)return 0;i.getMonth()===1&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-a*c);let l=$p(i,s)===-a;SJ(o)&&c===1&&$p(o,s)===1&&(l=!1);let m=a*(c-+l);return m===0?0:m}function bJ(e,t,r){let o=yO(e,t)/1e3;return gf(r?.roundingMethod)(o)}function xJ(e,t,r){let[o,i]=mo(r?.in,e,t),s=$p(o,i),a=Math.abs(mJ(o,i));o.setFullYear(1584),i.setFullYear(1584);let c=$p(o,i)===-s,l=s*(a-+c);return l===0?0:l}function IJ(e,t){let[r,o]=mo(e,t.start,t.end);return{start:r,end:o}}var Y0e={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"}},_J=(e,t,r)=>{let o,i=Y0e[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 EO(e){return(t={})=>{let r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}var V0e={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Q0e={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},W0e={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},AJ={date:EO({formats:V0e,defaultWidth:"full"}),time:EO({formats:Q0e,defaultWidth:"full"}),dateTime:EO({formats:W0e,defaultWidth:"full"})};var J0e={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},OJ=(e,t,r,o)=>J0e[e];function hf(e){return(t,r)=>{let o=r?.context?String(r.context):"standalone",i;if(o==="formatting"&&e.formattingValues){let a=e.defaultFormattingWidth||e.defaultWidth,c=r?.width?String(r.width):a;i=e.formattingValues[c]||e.formattingValues[a]}else{let a=e.defaultWidth,c=r?.width?String(r.width):e.defaultWidth;i=e.values[c]||e.values[a]}let s=e.argumentCallback?e.argumentCallback(t):t;return i[s]}}var Z0e={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},X0e={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},eLe={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"]},tLe={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"]},rLe={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"}},nLe={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"}},oLe=(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"},CJ={ordinalNumber:oLe,era:hf({values:Z0e,defaultWidth:"wide"}),quarter:hf({values:X0e,defaultWidth:"wide",argumentCallback:e=>e-1}),month:hf({values:eLe,defaultWidth:"wide"}),day:hf({values:tLe,defaultWidth:"wide"}),dayPeriod:hf({values:rLe,defaultWidth:"wide",formattingValues:nLe,defaultFormattingWidth:"wide"})};function yf(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],c=o&&e.parsePatterns[o]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(c)?sLe(c,T=>T.test(a)):iLe(c,T=>T.test(a)),m;m=e.valueCallback?e.valueCallback(l):l,m=r.valueCallback?r.valueCallback(m):m;let y=t.slice(a.length);return{value:m,rest:y}}}function iLe(e,t){for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function sLe(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}function RJ(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 c=t.slice(i.length);return{value:a,rest:c}}}var aLe=/^(\d+)(th|st|nd|rd)?/i,cLe=/\d+/i,lLe={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},uLe={any:[/^b/i,/^(a|c)/i]},pLe={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},mLe={any:[/1/i,/2/i,/3/i,/4/i]},dLe={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},fLe={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]},gLe={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},hLe={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]},yLe={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},ELe={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}},PJ={ordinalNumber:RJ({matchPattern:aLe,parsePattern:cLe,valueCallback:e=>parseInt(e,10)}),era:yf({matchPatterns:lLe,defaultMatchWidth:"wide",parsePatterns:uLe,defaultParseWidth:"any"}),quarter:yf({matchPatterns:pLe,defaultMatchWidth:"wide",parsePatterns:mLe,defaultParseWidth:"any",valueCallback:e=>e+1}),month:yf({matchPatterns:dLe,defaultMatchWidth:"wide",parsePatterns:fLe,defaultParseWidth:"any"}),day:yf({matchPatterns:gLe,defaultMatchWidth:"wide",parsePatterns:hLe,defaultParseWidth:"any"}),dayPeriod:yf({matchPatterns:yLe,defaultMatchWidth:"any",parsePatterns:ELe,defaultParseWidth:"any"})};var vL={code:"en-US",formatDistance:_J,formatLong:AJ,formatRelative:OJ,localize:CJ,match:PJ,options:{weekStartsOn:0,firstWeekContainsDate:1}};var SLe=["years","months","weeks","days","hours","minutes","seconds"];function wJ(e,t){let r=lJ(),o=t?.locale??r.locale??vL,i=t?.format??SLe,s=t?.zero??!1,a=t?.delimiter??" ";return o.formatDistance?i.reduce((l,m)=>{let y=`x${m.replace(/(^.)/,S=>S.toUpperCase())}`,T=e[m];return T!==void 0&&(s||e[m])?l.concat(o.formatDistance(y,T)):l},[]).join(a):""}function vJ(e,t){let{start:r,end:o}=IJ(t?.in,e),i={},s=xJ(o,r);s&&(i.years=s);let a=ff(r,{years:i.years}),c=TJ(o,a);c&&(i.months=c);let l=ff(a,{months:i.months}),m=fJ(o,l);m&&(i.days=m);let y=ff(l,{days:i.days}),T=gJ(o,y);T&&(i.hours=T);let S=ff(y,{hours:i.hours}),E=hJ(o,S);E&&(i.minutes=E);let _=ff(S,{minutes:i.minutes}),A=bJ(o,_);return A&&(i.seconds=A),i}var W0t=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 sLt=60*1e3;var qLt=1/1e6,ZE=1e3,Gp=60*ZE,NL=60*Gp,Ef=24*NL,jLt=7*Ef,HLt=30*Ef;var TO=86400;var kL=["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 ALe={s:1,m:60,h:3600,d:86400};function NJ(e){for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r<48||r>57)return!1}return!0}function OLe(){return Math.floor(Date.now()/1e3)}function bO(e,t=OLe()){if(typeof e=="number")return e;if(e==="now")return t;if(e.startsWith("-")&&e.length>=3){let o=e.at(-1),i=o?ALe[o]:void 0;if(i){let s=e.slice(1,-1);if(s.length>0&&NJ(s))return t-parseInt(s,10)*i}}if(NJ(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 Sf=class extends yt("OAuthTokenError"){},ga=class extends yt("TransportError"){},Tf=class extends yt("ResponseDecodeError"){},wc=class extends yt("LoginFailed"){},bf=class extends yt("ConfigCorrupted"){},xf=class extends yt("ConfigUnreadable"){},Xl=class extends yt("NoCredentials"){},Bp=class extends yt("SessionExpired"){},If=class extends yt("KeychainUnwritable"){},qp=class extends yt("ExternalCommandError"){},vc=class extends yt("UntrustedApiUrl"){},_f=class extends yt("NonJsonResponse"){},_s=class e extends yt("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}})}};function kJ(e,t,r){let o=new URL(tJ.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 CLe=Xr({access_token:or(Me),refresh_token:or(Me),expires_in:or(op),error:or(Me),error_description:or(Me)}),RLe=fs(CLe),LJ=ie(function*(e){let t=yield*Sp,r=D("oauth.token")(function*(o,i){let s=yield*t.post(new URL(rJ.url,o).href,{headers:{Accept:"application/json"},body:l0(i,"application/x-www-form-urlencoded")}).pipe(Mt(l=>new ga({message:`OAuth token request failed (${l.message})`,cause:l}))),a=yield*s.json.pipe(ce(RLe),ms(()=>({})));if(s.status!==200){let l=a.error??`HTTP ${s.status}`;return yield*new Sf({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 Tf({message:"OAuth token response was missing required fields"});let c=yield*jo;return{accessToken:a.access_token,refreshToken:a.refresh_token,expiresAt:new Date(c+a.expires_in*ZE)}});return{exchangeCode:D("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:D("oauth.refreshTokens")(function*(o,i){return yield*r(o,{grant_type:"refresh_token",client_id:e,refresh_token:i})})}});function MJ(e,t){return kJ(CL,e,t)}var eu=class extends ot()("cli/OAuth",{make:LJ(CL)}){static layer=Bo(this,this.make)};var DJ=require("node:fs");var FJ="/usr/bin/security",PLe=44;function wLe(e){return e===0||e===PLe}function ML(e){try{return(0,DJ.lstatSync)(e).isFile()}catch{return!1}}function LL(){return process.platform==="darwin"&&ML(FJ)}function vLe(e,t){return["find-generic-password","-s",e,"-a",t,"-w"]}function ULe(e,t){return["delete-generic-password","-s",e,"-a",t]}function NLe(e,t,r){let o=Buffer.from(r,"utf-8").toString("hex");return`add-generic-password -U -s ${e} -a ${t} -X ${o}
|
|
238
238
|
`}var $J=ie(function*(e){let t=yield*Si,r=D("keychain.security")(function*(s,a){let c=yield*qi(FJ,s,{env:{},stderr:{stream:"ignore"},...a===void 0?{}:{stdin:{stream:Xx(new TextEncoder().encode(a))}}}),l=yield*uc(lc(c.stdout)),m=yield*c.exitCode;return{status:Number(m),stdout:l}}),o=(s,a)=>oo(r(s,a)).pipe(Ho(Si,t),ms(()=>({status:1,stdout:""}))),i=D("keychain.read")(function*(s){if(!LL())return;let{status:a,stdout:c}=yield*o(vLe(e,s));return a===0&&c.trim()||void 0});return{location:"the macOS Keychain",read:i,save:D("keychain.save")(function*(s,a){return LL()?(yield*o(["-i"],NLe(e,s,a))).status===0:!1}),remove:D("keychain.remove")(function*(s){if(!LL())return!0;let{status:a}=yield*o(ULe(e,s));return wLe(a)?(yield*i(s))===void 0:!1})}});var BJ="/usr/bin/secret-tool",GJ=e=>Sy(e).pipe(gU(void 0)),kLe=nK({DBUS_SESSION_BUS_ADDRESS:GJ("DBUS_SESSION_BUS_ADDRESS"),XDG_RUNTIME_DIR:GJ("XDG_RUNTIME_DIR")}).pipe(fU(e=>Object.fromEntries(Object.entries(e).flatMap(([t,r])=>r===void 0?[]:[[t,r]]))));function LLe(e){return["lookup","service",e.service,"account",e.account]}function MLe(e,t){return["store","--label",t,"service",e.service,"account",e.account]}function DLe(e){return["clear","service",e.service,"account",e.account]}function FLe(e){return["search","--all","service",e.service,"account",e.account]}function $Le(e){return e.status===0&&e.stdout.trim()===""}function DL(){return process.platform==="linux"&&ML(BJ)}var qJ=ie(function*({service:e,label:t}){let r=yield*Si,o=yield*kLe.pipe(ms(()=>({}))),i=D("secretTool.run")(function*(a,c){let l=yield*qi(BJ,a,{env:o,...c===void 0?{}:{stdin:{stream:Xx(new TextEncoder().encode(c))}}}),{stdout:m,stderr:y,status:T}=yield*xh({stdout:uc(lc(l.stdout)),stderr:uc(lc(l.stderr)),status:l.exitCode},{concurrency:"unbounded"});return{status:Number(T),stdout:m,stderr:y}},oo,Ho(Si,r),ms(()=>({status:1,stdout:"",stderr:"secret-tool did not run"})));return{location:"the login keyring",read:D("secretTool.read")(function*(a){if(!DL())return;let{status:c,stdout:l}=yield*i(LLe({service:e,account:a}));return c===0&&l.trim()||void 0}),save:D("secretTool.save")(function*(a,c){return DL()?(yield*i(MLe({service:e,account:a},t),c)).status===0:!1}),remove:D("secretTool.remove")(function*(a){return DL()?(yield*i(DLe({service:e,account:a})),$Le(yield*i(FLe({service:e,account:a})))):!0})}});var xO=Xr({accessToken:yI,accessExpiresAt:yI,refreshToken:or(Me)}),GLe=xH(xO);function jJ(e){return Re(GLe(e))}var BLe=5*Gp;function FL(e,t){let r=new Date(e.accessExpiresAt).getTime();return Number.isNaN(r)?!0:r<=t+BLe}function HJ(e){if(e.overrideKey)return{kind:"operation-api-key",token:e.overrideKey};if(e.operationApiKey)return{kind:"operation-api-key",token:e.operationApiKey};if(e.userAuth)return{kind:"user-session",userAuth:e.userAuth}}var KJ="tsuga-cli",qLe="Tsuga CLI session";function jLe(e){try{return jJ(JSON.parse(e.trim()))}catch{return}}var Af=class extends ot()("SecretStore",{make:jt(function*(){let t=process.platform==="linux"?yield*qJ({service:KJ,label:qLe}):yield*$J(KJ);return{location:t.location,read:D("secretStore.read")(function*(r){let o=yield*t.read(r);return o===void 0?void 0:jLe(o)}),save:(r,o)=>t.save(r,JSON.stringify(o)),remove:t.remove}})}){static layer=Bo(this,this.make)};function $L(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 zJ(e,t){let r=Object.create(null);for(let o of t){let i=$L(e,o);if(i===void 0)continue;let s=o.split("."),a=s.pop();if(a===void 0)continue;let c=r;for(let l of s)(typeof c[l]!="object"||c[l]===null)&&(c[l]=Object.create(null)),c=c[l];c[a]=i}return r}function GL(e){let t=e.trimStart();return/^[=+@-]/.test(t)&&!/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i.test(t)?`'${e}`:e}function YJ(e){let t=GL(e);return/[",\r\n]/.test(t)?`"${t.replace(/"/g,'""')}"`:t}var VJ=["json","tsv","csv"];function QJ(e){return e.split(",").map(t=>t.trim()).filter(t=>t.length>0)}function WJ(e){return e==null?null:typeof e=="string"?e:JSON.stringify(e)}var HLe={"\\":"\\\\"," ":"\\t","\r":"\\r","\n":"\\n"};function KLe(e){let t=WJ(e);return t===null?"":GL(t).replace(/[\\\t\r\n]/g,r=>HLe[r]??r)}function zLe(e){let t=WJ(e);return t===null?"":YJ(t)}function JJ(e,t,r){if(t.length===0)return"";let o=e==="csv"?",":" ",i=e==="csv"?zLe:KLe,s=r.map(c=>i(c)).join(o),a=t.map(c=>r.map(l=>i($L(c,l))).join(o));return[s,...a].map(c=>e==="csv"&&r.length===1&&c===""?'""':c).join(`
|
|
239
|
-
`)}var ti=class e extends ot()("common-cli/OutputFormatter"){static layer=Hs(e)({rows:ie(function*(t,r){if(r.output==="json"){let i=r.fields,s=i===void 0?t:t.map(a=>zJ(a,i));yield*Oe(s);return}let o=JJ(r.output,t,r.fields??r.defaultFields);o.length>0&&(yield*We(o))})})};var ha=class extends ot()("GlobalFlags"){};var ZJ="__tsuga_cluster_id__",YLe=n.Object({}),VLe=n.Object({status:n.Literal("error"),message:n.String({description:"Why this cluster failed to answer the query."})});function Of(e=YLe){let t=Q("status",[n.Object({...e.properties,status:n.Literal("ok")}),VLe]);return Object.assign(OA(bi,t),{description:'Outcome per cluster, keyed by cluster ID. A cluster that failed reports `status: "error"`.'})}var QLe=5,XE=n.Array(f({allowEmpty:!1}),{minItems:1,maxItems:QLe,uniqueItems:!0,description:"IDs of the clusters to query, without duplicates. Mutually exclusive with `clusterId`. Omit both to use the default cluster."});var XJ=n.Object({type:n.Literal("number"),number:n.String()}),WLe=n.Object({type:n.Literal("string"),string:n.String()}),JLe=n.Object({type:n.Literal("timestamp"),timestamp:n.String()}),eS=Q("type",[XJ,WLe,JLe]),ZLe=n.Object({by:n.Record(n.String(),eS),computed:n.Record(n.String(),XJ)}),XLe=n.Object({type:n.Literal("buckets"),buckets:n.Array(ZLe),clusterResponses:n.Optional(Of())}),eMe=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()))}),Cf=Q("type",[XLe,eMe]);var BL=["all","owning-team-and-public","owning-team-only"],As=n.Enum(BL,{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 tZ=1456444800,rZ=4927737600,tMe=tZ*1e3,rMe=rZ*1e3,IO=1704067200,qL=IO*1e3,nZ={title:"TimeRange",description:"Inclusive time range for telemetry queries. Use Unix timestamps in seconds unless the field description says milliseconds.",examples:[{from:IO,to:IO}]},nMe={title:"TimeRange",description:"Inclusive time range for telemetry queries using Unix timestamps in milliseconds.",examples:[{from:qL,to:qL}]},_O=e=>n.Integer({description:e,examples:[IO],minimum:tZ,maximum:rZ,format:"int64"}),eZ=e=>n.Integer({description:e,examples:[qL],minimum:tMe,maximum:rMe,format:"int64"}),Lr=n.Object({from:n.Optional(_O("Start of the query window as a Unix timestamp in seconds")),to:n.Optional(_O("End of the query window as a Unix timestamp in seconds"))},nZ),Yr=n.Object({from:_O("Start of the query window as a Unix timestamp in seconds"),to:_O("End of the query window as a Unix timestamp in seconds")},nZ),Os=n.Object({from:eZ("Start of the query window as a Unix timestamp in milliseconds"),to:eZ("End of the query window as a Unix timestamp in milliseconds")},nMe);var jp="/v0/logs";var jL=["CRITICAL","ERROR","WARN","NOTICE","INFO","DEBUG","TRACE"];var tS=0,HL=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(jL,{description:"Log severity, normalized from the source severity into one of the fixed Tsuga levels (ordered `CRITICAL` to `TRACE`)."}),[ZJ]:n.Optional(n.String({description:"ID of the cluster this log was read from. Only set when the request spanned several clusters."}))},{additionalProperties:!0}),iZ=100,oMe="timestamp",iMe=n.Union([n.Literal(oMe)]),tu=n.Partial(n.Object({...Lr.properties,query:f({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:tS,description:"Result offset used when fetching additional log rows."}),startOffsets:n.Array(n.Number({minimum:tS}),{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 ${tS} for every cluster.`}),clusterId:f({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}),clusterIds:XE,sortBy:iMe,sortDirection:Le,useCanopy:n.Boolean()})),DMt=x({tags:["logs"],url:`${jp}/count`,method:"GET",query:n.Pick(tu,["from","to","query","clusterId","clusterIds","useCanopy"]),response:n.Object({count:n.Number(),clusterResponses:n.Optional(Of())})}),rS=n.Object({value:n.String(),priority:n.Number()}),FMt=x({tags:["logs"],url:`${jp}/search`,method:"GET",query:tu,response:n.Object({logs:n.Optional(n.Array(HL)),attributesToHighlight:n.Optional(n.Array(rS)),clusterResponses:n.Optional(Of(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})}),sMe=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"}),aMe=n.Object({id:n.String(),pattern:n.Array(sMe),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"}))}),$Mt=x({tags:["logs"],url:`${jp}/patterns`,method:"GET",query:n.Object({...Lr.properties,query:f({type:"tsuga-query"}),clusteringThreshold:n.Optional(n.Number()),clusterId:n.Optional(f({allowEmpty:!1})),useCanopy:n.Optional(n.Boolean())}),response:n.Object({patterns:n.Array(aMe),sampleSize:n.Number()})}),GMt=x({tags:["logs"],url:`${jp}/attributes`,method:"GET",query:n.Object({...Lr.properties,clusterId:n.Optional(f({allowEmpty:!1,description:"Cluster ID"})),clusterIds:n.Optional(XE),useCanopy:n.Optional(n.Boolean())}),response:n.Object({attributes:n.Array(n.String()),clusterResponses:n.Optional(Of())})});var sZ="timestamp";var oZ=`${sZ}_iso`;var cMe=["pending","running","completed","incomplete","failed"],aZ=n.Object({id:n.String({description:"ID of the export."}),status:n.Enum(cMe,{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."}))}),BMt=x({tags:["logs"],url:`${jp}/exports`,method:"POST",body:n.Object({...n.Pick(tu,["from","to","query","clusterId","clusterIds","sortBy","sortDirection"]).properties,columns:n.Array(f({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 \`${sZ}\` also writes a \`${oZ}\` column next to it, holding the same instant in ISO 8601.`}),timezone:n.Optional(n.String({format:Dp,description:`IANA timezone the \`${oZ}\` column is offset to (e.g. \`Europe/Paris\`). Defaults to UTC.`}))}),response:n.Object({...aZ.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."})})}),qMt=x({tags:["logs"],url:`${jp}/exports/:exportId`,method:"GET",params:n.Object({exportId:n.String()}),response:aZ}),jMt=x({tags:["logs"],url:`${jp}/exports/:exportId/download`,method:"GET",params:n.Object({exportId:n.String()}),query:n.Object({token:f({allowEmpty:!1,description:"Single-use token minted when the export was created."})}),response:n.String({description:"CSV file, streamed as it is produced."})});var Uc="/v0/metrics",lMe=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(jL)},{additionalProperties:!0}),WMt=x({tags:["metrics"],url:`${Uc}/count`,method:"GET",query:n.Pick(tu,["from","to","query","clusterId"]),response:n.Object({count:n.Number()})}),JMt=x({tags:["metrics"],url:`${Uc}/search`,method:"GET",query:tu,response:n.Object({logs:n.Optional(n.Array(lMe)),totalHits:n.Optional(n.Number()),attributesToHighlight:n.Optional(n.Array(rS))},{additionalProperties:!0})}),AO=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."}),OO=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."}),KL=["gauge","cumulative-counter","delta-counter","cumulative-histogram","delta-histogram","summary"],cZ=n.Enum(KL,{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."}),lZ=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."}),uZ=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."}),pZ=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."}),uMe=n.Record(n.String(),n.Number(),{description:"Estimated number of distinct values per attribute over the same window as `seriesCardinality`, keyed like `tags`."}),pMe=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(OO),type:n.Optional(AO),unit:n.Optional(n.String({description:"Metric unit reported by instrumentation or inferred metadata."})),lastSeen:n.Optional(lZ),teams:n.Optional(uZ),seriesCardinality:n.Optional(pZ),attributeCardinalities:n.Optional(uMe)}),ZMt=x({url:`${Uc}/metadata`,method:"GET",query:n.Object({...Lr.properties,metricName:f({allowEmpty:!1}),kind:n.Optional(cZ),clusterId:n.Optional(f({allowEmpty:!1,description:"Cluster ID"}))}),response:pMe}),XMt=x({tags:["metrics"],url:Uc,method:"GET",query:n.Object({...Lr.properties,clusterId:n.Optional(f({allowEmpty:!1,description:"Cluster ID"}))}),response:n.Array(n.String())}),mZ=n.Array(n.Object({name:n.String({description:"Metric name observed by Tsuga."}),kind:cZ,type:AO,temporality:n.Optional(OO),lastSeen:n.Optional(lZ),teams:n.Optional(uZ),seriesCardinality:n.Optional(pZ)}),{description:"Metric variants observed in the requested time range. A name appears once per kind it was reported as."}),mMe=[{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(mZ,{examples:[mMe]});var eDt=x({tags:["metrics"],url:`${Uc}/names-and-types`,method:"GET",query:n.Object({...Lr.properties,clusterId:n.Optional(f({allowEmpty:!1,description:"Cluster ID"}))}),response:mZ}),nS=n.Array(n.String(),{description:"Attribute names available as dimensions for filtering or grouping the requested metric(s)."}),dMe=["service","env","host","method","status_code"];Object.assign(nS,{examples:[dMe]});var tDt=x({tags:["metrics"],url:`${Uc}/attributes`,method:"GET",query:n.Object({...Lr.properties,metricName:f({allowEmpty:!1}),clusterId:n.Optional(f({allowEmpty:!1,description:"Cluster ID"}))}),response:nS}),rDt=x({tags:["metrics"],url:`${Uc}/attributes/batch`,method:"GET",query:n.Object({...Lr.properties,metricNames:n.Array(f({allowEmpty:!1}),{minItems:1,description:"Metric names to fetch attributes for"}),clusterId:n.Optional(f({allowEmpty:!1,description:"Cluster ID"}))}),response:nS}),zL=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."})}),nDt=x({tags:["metrics"],url:`${Uc}/assets-usage`,method:"GET",query:n.Object({metricName:f({allowEmpty:!1})}),response:zL}),oDt=x({url:`${Uc}/per-attribute`,method:"GET",query:n.Object({from:n.Optional(n.Number()),to:n.Optional(n.Number()),attribute:f(),clusterId:n.Optional(f({allowEmpty:!1}))}),response:n.Array(n.String())});var hMe="/v0/aggregation",yMe=n.Union([n.Literal("a"),n.Literal("d"),n.Literal("q"),n.Literal("w"),n.Literal("t")]),oS=n.Object({parallelism:n.Number(),engine:yMe,recordBatchCache:n.Optional(n.Boolean()),includeNullGroups:n.Optional(n.Boolean()),restartAwareGaugeSum:n.Optional(n.Boolean())}),YL=["logs","metrics","traces"];var gZ={logs:"Logs",metrics:"Metrics",traces:"Spans"},EMe=[...YL,"connections","log-patterns","spans","rum"];var hDt={...gZ,connections:"Connections","log-patterns":"Log Patterns",spans:"Spans",rum:"RUM events"},ya=[...YL,"rum"];var yDt={...gZ,rum:"RUM events"};var EDt=n.Enum(EMe,{description:"Data source being queried"}),SDt=n.Enum(YL,{description:"Telemetry source queried by this aggregation: `logs`, `metrics`, or `traces`."}),Ai=n.Enum(ya,{description:"Telemetry source queried by this aggregation: `logs`, `metrics`, `traces`, or `rum`."}),Hp=n.String({description:"Attribute containing the values to aggregate"}),Kp=f({description:"Attribute containing the values to aggregate"}),SMe=Q("type",[n.Object({type:n.Literal("count",{description:"Counts the total number of records"}),field:n.Optional(Hp)},{$id:"AggregateCount",title:"Count"}),n.Object({type:n.Literal("unique-count",{description:"Counts the distinct values of the field"}),field:Hp},{$id:"AggregateUniqueCount",title:"UniqueCount"}),n.Object({type:n.Literal("average",{description:"Calculates the average value of the selected field"}),field:Hp},{$id:"AggregateAverage",title:"Average"}),n.Object({type:n.Literal("max",{description:"Finds the largest value of the field"}),field:Hp},{$id:"AggregateMax",title:"Max"}),n.Object({type:n.Literal("min",{description:"Finds the smallest value of the field"}),field:Hp},{$id:"AggregateMin",title:"Min"}),n.Object({type:n.Literal("sum",{description:"Sums the values of the selected field"}),field:Hp},{$id:"AggregateSum",title:"Sum"}),n.Object({type:n.Literal("percentile",{description:"Calculates a percentile of the selected field"}),field:Hp,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`."}),TMe=Q("type",[n.Object({type:n.Literal("count",{description:"Counts the total number of records"}),field:n.Optional(Kp)},{$id:"InputAggregateCount",title:"Count"}),n.Object({type:n.Literal("unique-count",{description:"Counts the distinct values of the field"}),field:Kp},{$id:"InputAggregateUniqueCount",title:"UniqueCount"}),n.Object({type:n.Literal("average",{description:"Calculates the average value of the selected field"}),field:Kp},{$id:"InputAggregateAverage",title:"Average"}),n.Object({type:n.Literal("max",{description:"Finds the largest value of the field"}),field:Kp},{$id:"InputAggregateMax",title:"Max"}),n.Object({type:n.Literal("min",{description:"Finds the smallest value of the field"}),field:Kp},{$id:"InputAggregateMin",title:"Min"}),n.Object({type:n.Literal("sum",{description:"Sums the values of the selected field"}),field:Kp},{$id:"InputAggregateSum",title:"Sum"}),n.Object({type:n.Literal("percentile",{description:"Calculates a percentile of the selected field"}),field:Kp,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`."}),hZ=n.Object({type:n.Literal("per-second",{description:"Normalizes the metric to events per second"})},{$id:"FunctionPerSecond",title:"PerSecond"}),yZ=n.Object({type:n.Literal("per-minute",{description:"Normalizes the metric to events per minute"})},{$id:"FunctionPerMinute",title:"PerMinute"}),EZ=n.Object({type:n.Literal("per-hour",{description:"Normalizes the metric to events per hour"})},{$id:"FunctionPerHour",title:"PerHour"}),SZ=n.Object({type:n.Literal("rate",{description:"Calculates the rate of change"})},{$id:"FunctionRate",title:"Rate"}),TZ=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"}),bZ=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"}),xZ=n.Object({type:n.Literal("sqrt",{description:"Applies a square root transformation to the values"})},{$id:"FunctionSqrt",title:"Sqrt"}),IZ=n.Object({type:n.Literal("last",{description:"Takes the last value of the metric for the selected time frame"})},{$id:"FunctionLast",title:"Last"}),bMe=n.Object({type:n.Literal("rolling",{description:"Computes a rolling window aggregate"}),window:n.String({description:"Duration of the rolling window"})},{$id:"FunctionRolling",title:"Rolling"}),xMe=n.Object({type:n.Literal("rolling",{description:"Computes a rolling window aggregate"}),window:f({allowEmpty:!1,description:"Duration of the rolling window"})},{$id:"InputFunctionRolling",title:"Rolling"}),IMe=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"}),_Me=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"}),AMe=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"}),OMe=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"}),CMe=Q("type",[hZ,yZ,EZ,SZ,TZ,bMe,IMe,bZ,xZ,IZ,AMe],{title:"Function",description:"Post-processing function applied to an aggregation query result after the aggregate is computed, selected by `type`."}),RMe=Q("type",[hZ,yZ,EZ,SZ,TZ,xMe,_Me,bZ,xZ,IZ,OMe],{title:"InputFunction",description:"Post-processing function applied to an aggregation query result after the aggregate is computed, selected by `type`."});var dZ=n.Object({min:n.Number({description:"Lower bound of the distribution range."}),max:n.Number({description:"Upper bound of the distribution range."})}),PMe=["linear","log"],CO=n.Enum(PMe,{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."}),fZ=n.Integer({minimum:1}),wMe=Q("type",[n.Object({type:n.Literal("scalar")},{title:"Scalar",description:"Returns a single value"}),n.Object({type:n.Literal("timeseries"),aggregationWindow:f({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(f()),bucketCount:n.Optional(fZ),bounds:n.Optional(dZ),boundsScale:n.Optional(CO),percentiles:n.Optional(n.Array(n.Number({minimum:0,maximum:100,multipleOf:1}),{minItems:1}))},{title:"Histogram",description:"Returns a single distribution over the entire time range"}),n.Object({type:n.Literal("heatmap"),aggregationWindow:f({description:'Time bucket size for the heatmap (e.g. "10s", "60s", "1m")'}),by:n.Optional(f()),bucketCount:n.Optional(fZ),bounds:n.Optional(dZ)},{title:"Heatmap",description:"Returns a distribution per time window"})]),iS=15,vMe=["zero","null"],UMe=n.Enum(vMe,{description:"`zero` fills missing points with zero. `null` keeps missing points null."}),_Z=n.Object({mode:n.Object({type:UMe},{description:"How missing aggregation points should be filled."})},{description:"Missing-point fill behavior for aggregation results. Optional; omit to keep missing points null."}),NMe=["avg","sum","min","max","last"],AZ=n.Enum(NMe,{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`, `last`, or `rolling` function is present. When omitted, Tsuga derives the rollup from the metric type."});var OZ=n.Enum(KL,{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."}),CZ={aggregate:SMe,functions:n.Optional(n.Array(CMe,{description:"Post-processing functions applied to aggregation results"})),fill:n.Optional(_Z),timeAggregate:n.Optional(AZ),metricKind:n.Optional(OZ)},RZ={aggregate:TMe,functions:n.Optional(n.Array(RMe,{maxItems:10,description:"Post-processing functions applied to aggregation results. Defaults to an empty array when omitted."})),fill:n.Optional(_Z),timeAggregate:n.Optional(AZ),metricKind:n.Optional(OZ)},kMe={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."},PZ={minItems:1,maxItems:iS,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").'},wZ=n.Array(n.Object({...CZ,filter:n.Optional(n.String({description:"Filter to apply to the aggregation"}))},{title:"AggregationQuery"}),kMe),sS=n.Array(n.Object({...RZ,filter:n.Optional(f({type:"tsuga-query",description:"Tsuga query filter to apply to the aggregation. Defaults to an empty string when omitted."}))},{title:"AggregationQuery"}),PZ),Nc=n.Array(n.Object({...CZ,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."}),ru=n.Array(n.Object({...RZ,filter:f({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."}),{...PZ,description:"Aggregation queries used by alerting. Each query is referenced from formulas as q1, q2, and so on."}),vZ=n.Array(n.Omit(ru.items,["fill"],{title:"SloAggregationQuery",description:"Single aggregation query evaluated by an SLO."}),{minItems:1,maxItems:iS,description:"Aggregation queries used by SLO evaluation. Each query is referenced from formulas as q1, q2, and so on."});var RO=n.String({description:"Formula referencing submitted query outputs, such as `q1 + q2`. References must be within `q1` through `qN` for the submitted queries."}),zp=f({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."}),LMe=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(Le),replaceNullWith:n.Optional(n.String({description:"Value used to group documents that have no value for a grouped field."}))},{title:"AggregationGroupBy"}),MMe=n.Object({fields:n.Array(f(),{maxItems:1,description:"Telemetry attribute name to group aggregation results by. Currently limited to one field per grouping level."}),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(Le),replaceNullWith:n.Optional(f({allowEmpty:!1,description:"Value used to group documents that have no value for a grouped field."}))},{title:"AggregationGroupBy"}),UZ=7;var Rf=n.Array(LMe,{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."}),kc=n.Array(MMe,{maxItems:UZ,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 TDt=x({tags:["aggregation"],url:`${hMe}/multi-query`,method:"POST",body:n.Object({timeRange:Os,queries:sS,groupBy:n.Optional(kc),returnType:wMe,dataSource:Ai,formula:zp,executionOptions:oS,triggeredBy:n.Optional(n.Literal("refresh")),shouldStreamResults:n.Optional(n.Boolean()),clusterId:n.Optional(f({allowEmpty:!1})),clusterIds:n.Optional(XE),viewAs:n.Optional(n.Object({owner:f({allowEmpty:!1,description:"Team ID to fetch data as"}),permissions:As}))}),response:Cf});var NZ=`/${"v1"}/aggregation`,kZ=n.Object({id:n.String({description:"Result identifier. Query results use `q1`, `q2`, and so on; formula results use `formula`."}),group:n.Record(n.String(),n.Union([n.String(),n.Number()]),{description:"Group-by field values for this result. Empty when no group-by is requested."})}),LZ=n.Object({results:n.Array(n.Object({...kZ.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."}),DMe={results:[{id:"q1",group:{host:"server-1"},value:123.45}]};Object.assign(LZ,{examples:[DMe]});var PO=n.Object({series:n.Array(n.Object({...kZ.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."}),FMe={series:[{id:"q1",group:{host:"server-1"},points:[{timestamp:16094592e5,value:123.45},{timestamp:160945926e4,value:456.78}]}]};Object.assign(PO,{examples:[FMe]});var $Me=n.Omit(sS.items,["fill"],{title:"AggregationQuery",description:"Aggregation query. Omit `filter` for an unfiltered query and omit `functions` when no post-processing is needed."}),GMe=n.Optional(kc),MZ={timeRange:Yr,queries:n.Array($Me,{maxItems:iS,description:`Aggregations that may be combined together in the same query. Each item is referenced from \`formula\` as q1, q2, and so on, in submission order. Limited to ${iS} items. For dataSource "metrics", each aggregate's \`field\` is the metric name, not an attribute; to count distinct values of an attribute use unique-count with field "<metricName>.context.<attribute>" (e.g. "system.cpu.utilization.context.host.name").`}),groupBy:GMe,dataSource:Ai,formula:n.Optional(zp)},Ea=n.Object({clusterId:n.Optional(f({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))}),DZ=n.Object(MZ,{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."}),BMe={timeRange:{from:1782201500,to:1782203400},dataSource:"logs",queries:[{aggregate:{type:"count"},filter:"context.service.name:checkout"}],groupBy:[{fields:["level"],limit:5}]};Object.assign(DZ,{examples:[BMe]});var FZ=x({description:"Runs one or more aggregation queries over logs, metrics, traces, or RUM events and returns scalar values. Use optional group-by and formula fields to compute grouped or derived results. See [Analytics queries](/documentation/visualize/analytics/queries).",operationId:"aggregateScalar",tags:["public","aggregation"],url:`${NZ}/multi-query/scalar`,method:"POST",body:DZ,query:Ea,response:LZ}),$Z=n.Object({...MZ,aggregationWindow:f({description:"Time bucket size for timeseries aggregation, such as `10s`, `1m`, or `1h`."})},{description:"Timeseries aggregation request. Provide a time range, bucket size, one or more queries, a telemetry data source, and optional grouping or formula. Omit `groupBy` for ungrouped series. Send `clusterId` as a query parameter, not in the JSON body."}),qMe={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($Z,{examples:[qMe]});var GZ=x({description:"Runs one or more aggregation queries over logs, metrics, traces, or RUM events and returns timestamped series. Use `aggregationWindow` to choose the time bucket size. See [Analytics queries](/documentation/visualize/analytics/queries).",operationId:"aggregateTimeseries",tags:["public","aggregation"],url:`${NZ}/multi-query/timeseries`,method:"POST",body:$Z,query:Ea,response:PO});var jMe="x-tsuga-session-id",VL="x-tsuga-source",QL="x-tsuga-source-version",WL="x-tsuga-source-commit",JL="x-tsuga-source-date",ZL="x-tsuga-rationale",HMe="x-tsuga-dashboard-id",KMe="x-tsuga-widget-id",zMe="x-request-id",wDt={[jMe]:"Session identifier for request correlation",[VL]:"SDK or client source identifier (e.g., web-frontend, terraform-provider)",[QL]:"SDK version",[WL]:"SDK commit hash",[JL]:"SDK commit date",[ZL]:"Optional caller-supplied rationale for this request, recorded for telemetry",[HMe]:"ID of the dashboard a query is issued from, when the request originates from a dashboard widget",[KMe]:"ID of the dashboard widget (graph) a query is issued from, when the request originates from a dashboard widget",[zMe]:"Unique identifier for this API request, useful for debugging and support"};var YMe=["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS","TRACE"],BZ=D("api.buildRequest")(function*(e,t,r,o,i){let{body:s,params:a,query:c}=o,l=r.url??(r.buildUrl&&a?r.buildUrl(a):void 0),m=YMe.find(y=>y===r.method);return l===void 0||m===void 0?yield*new _s({message:`Internal error: endpoint ${r.operationId??r.method} is not callable`}):Z_(m)(eJ(`${e}${l}`,c),{headers:{Accept:"application/json",[VL]:t,[QL]:"1.51.0",[WL]:"6df9b92ec3",[JL]:"2026-10-01T07:44:44.018Z",...i},...s?{body:c0(s)}:{}})});var VMe=["allowed-domains","audit-log-stream-destination","billing","cluster-integration-config","custom-role","custom-usage-tag","database","databricks-connection","explorer-saved-view","github-connection","host","inventory","llm-provider","monitor-alert","monitor-debugging","oauth-grant","org","retention-policy","saml-config","sensitive-data-scanner-rule","service","service-target","team-remap-config","user-self","widget-share"],QMe=["adaptive-notification-rule","audit-log","cloud-account","dashboard-folder","dashboard-report","dashboard-share","dashboard","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","tag-policy","team-members","team","user-data","user-invitation","user-permissions"],WMe=["log","metric","trace","rum"],XL=[...QMe,...WMe],GDt=[...VMe,...XL];var vO=["admin","public_editor","public_viewer","teams_only"],UO=[...vO,"custom"],Vi=["admin","editor","viewer"];var Yp="/v0/team-membership",eM="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.",tM=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(Vi,{description:eM})}),qZ=n.Object({userId:f({allowEmpty:!1,description:"User ID to add to or update in the team."}),teamId:f({allowEmpty:!1,description:"Team ID receiving the membership change."}),roleKey:n.Enum(Vi,{description:eM})}),JMe=n.Object({userId:f({allowEmpty:!1,description:"User ID to remove from the team."}),teamId:f({allowEmpty:!1,description:"Team ID to remove the user from."})}),ZMe=n.Optional(n.Object({userId:n.Optional(f({allowEmpty:!1,description:"Restrict results to memberships for this user ID."})),teamId:n.Optional(f({allowEmpty:!1,description:"Restrict results to memberships for this team ID."}))})),BDt=x({tags:["access-control"],url:Yp,method:"GET",query:ZMe,response:n.Array(tM)}),qDt=x({tags:["access-control"],url:Yp,method:"POST",body:qZ,response:tM}),jDt=x({tags:["access-control"],url:Yp,method:"PUT",body:qZ,response:tM}),HDt=x({tags:["access-control"],url:Yp,method:"DELETE",body:JMe,response:ae}),wO=500,jZ=n.Object({teamId:f({allowEmpty:!1,description:"Team ID receiving all requested memberships."}),members:n.Array(n.Object({userId:n.Optional(f({allowEmpty:!1,description:"Existing user ID to add to the team."})),userEmail:n.Optional(f({allowEmpty:!1,type:"email",description:"Existing user email to resolve and add to the team."})),roleKey:n.Enum(Vi,{description:eM})},{oneOf:[{required:["userId"]},{required:["userEmail"]}]}),{minItems:1,maxItems:wO,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."}),XMe={teamId:"team-123-abc",members:[{userId:"user-123-abc",roleKey:"viewer"},{userEmail:"sam@example.com",roleKey:"editor"}]};Object.assign(jZ,{examples:[XMe]});var HZ=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."}),eDe={results:[{userId:"user-123-abc",status:"added"},{userId:"sam@example.com",status:"user_not_found"}]};Object.assign(HZ,{examples:[eDe]});var KDt=x({tags:["access-control"],url:`${Yp}/bulk-add`,method:"POST",body:jZ,response:HZ}),zDt=x({tags:["access-control"],url:`${Yp}/bulk-update-user-roles`,method:"PUT",body:n.Object({userIds:n.Array(f({allowEmpty:!1}),{minItems:1,maxItems:wO}),teamId:f({allowEmpty:!1}),role:n.Enum(Vi)}),response:n.Object({})}),KZ=n.Object({teamId:f({allowEmpty:!1,description:"Team ID to remove the requested users from."}),userIds:n.Optional(n.Array(f({allowEmpty:!1}),{minItems:1,maxItems:wO,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(f({allowEmpty:!1,type:"email"}),{minItems:1,maxItems:wO,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."}),tDe={teamId:"team-123-abc",userIds:["user-123-abc"]};Object.assign(KZ,{examples:[tDe]});var zZ=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."}),rDe={results:[{userId:"user-123-abc",status:"removed"},{userId:"missing@example.com",status:"user_not_found"}]};Object.assign(zZ,{examples:[rDe]});var YDt=x({tags:["access-control"],url:`${Yp}/bulk-remove`,method:"DELETE",body:KZ,response:zZ});var nDe={"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:["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"]},"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"]},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:[]},"sensitive-data-scanner-rule":{read:["public_viewer","public_editor","admin"],write:["admin"]},slo:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"retention-policy":{read:["public_viewer","public_editor","admin"],write:["admin"]},"databricks-connection":{read:["public_viewer","public_editor","admin"],write:["admin"]},service:{read:["public_viewer","public_editor","admin"],write:[]},"service-target":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},host:{read:["public_viewer","public_editor","admin"],write:[]},database:{read:["public_viewer","public_editor","admin"],write:[]},"tag-policy":{read:["public_viewer","public_editor","admin"],write:["admin"]},team:{read:["public_viewer","public_editor","admin"],write:["admin"]},"team-members":{read:["public_viewer","public_editor","admin"],write:["admin"]},"team-remap-config":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-data":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-invitation":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-permissions":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-self":{read:["public_viewer","public_editor","admin"],write:["public_viewer","public_editor","admin"]},"oauth-grant":{read:[],write:[]}},oDe={"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:[],write:[]},"custom-usage-tag":{read:[],write:[]},"cluster-integration-config":{read:[],write:[]},"explorer-saved-view":{read:["viewer","editor","admin"],write:["viewer","editor","admin"]},"operation-api-key":{read:["viewer","editor","admin"],write:["admin"]},"cloud-account":{read:["viewer","editor","admin"],write:[]},dashboard:{read:["viewer","editor","admin"],write:["editor","admin"]},"dashboard-folder":{read:["viewer","editor","admin"],write:["editor","admin"]},"dashboard-report":{read:["viewer","editor","admin"],write:["editor","admin"]},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"]},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:[]},"sensitive-data-scanner-rule":{read:["viewer","editor","admin"],write:[]},slo:{read:["viewer","editor","admin"],write:["editor","admin"]},"retention-policy":{read:[],write:[]},"databricks-connection":{read:[],write:[]},service:{read:["viewer","editor","admin"],write:[]},"service-target":{read:["viewer","editor","admin"],write:["editor","admin"]},host:{read:["viewer","editor","admin"],write:[]},database:{read:["viewer","editor","admin"],write:[]},"tag-policy":{read:[],write:[]},team:{read:["viewer","editor","admin"],write:["admin"]},"team-members":{read:["viewer","editor","admin"],write:["admin"]},"team-remap-config":{read:[],write:[]},"user-data":{read:["viewer","editor","admin"],write:["admin"]},"user-invitation":{read:["viewer","editor","admin"],write:["admin"]},"user-permissions":{read:["viewer","editor","admin"],write:[]},"user-self":{read:["viewer","editor","admin"],write:["viewer","editor","admin"]},"oauth-grant":{read:[],write:[]}},iDe={user:nDe,team:oDe};function rM(e){return YZ(e,"team")}function nM(e){return YZ(e,"user")}function YZ(e,t){let r=[],o=iDe[t];for(let[i,s]of Object.entries(o))for(let[a,c]of Object.entries(s))c.includes(e)&&r.push({actionType:a,resourceType:i});return r}var XDt={admin:{name:"Global admin",description:"Full control across the organization. Can view and modify everything, including private teams.",permissions:nM("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:nM("public_editor"),roleKey:"public_editor"},public_viewer:{name:"Public viewer",description:"Read-only access to public team data. Cannot make changes.",permissions:nM("public_viewer"),roleKey:"public_viewer"},teams_only:{name:"Teams only",description:"Only access data and assets in their own teams.",permissions:[],roleKey:"teams_only"}},eFt={admin:{name:"Team admin",description:"Full team control, manage assets, members, and settings.",permissions:rM("admin"),roleKey:"admin"},editor:{name:"Team editor",description:"Can view and update most assets (like dashboards, monitors).",permissions:rM("editor"),roleKey:"editor"},viewer:{name:"Team viewer",description:"Can view all team data but cannot make changes.",permissions:rM("viewer"),roleKey:"viewer"}};var tFt=new Set(XL);var sDe={documentation:void 0,investigations:"investigation",logs:"log",metrics:"metric","team-membership":"team-members",traces:"trace",user:"user-data","allowed-domains":"allowed-domains",billing:"billing","cloud-account":"cloud-account","custom-usage-tag":"custom-usage-tag",dashboard:"dashboard","dashboard-folder":"dashboard-folder","ingestion-api-key":"ingestion-api-key",inventory:"inventory","log-route":"log-route","metric-route":"metric-route",monitor:"monitor","notification-integration":"notification-integration","notification-rule":"notification-rule","notification-silence":"notification-silence","quality-report":"quality-report","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"},aDe=Object.entries(sDe),rFt=new Map(aDe.flatMap(([e,t])=>t?[[t,e]]:[]));var Se="context";var VZ="trace_id",NO=`${Se}.team`,oFt=`${Se}.env`,iFt=`${Se}.api_key_id`,kO=`${Se}.service.name`,sFt=`${Se}.service.version`,LO=`${Se}.span.kind`,MO=`${Se}.span.name`,nu=`${Se}.status.code`,aFt=`${Se}.stack_trace`,cDe="STATUS_CODE_ERROR",cFt=`${nu}:${cDe}`,oM="resource.attributes.team",QZ=["SPAN_KIND_UNSPECIFIED","SPAN_KIND_INTERNAL","SPAN_KIND_SERVER","SPAN_KIND_CLIENT","SPAN_KIND_PRODUCER","SPAN_KIND_CONSUMER"];var aS=`${Se}.host.name`,lDe=`${Se}.instance`,uDe=`${Se}.instanceid`,pDe=`${Se}.instance_name`,lFt=`${Se}.telemetry.sdk.language`,uFt=`${Se}.process.runtime.name`,pFt=`${Se}.scope.name`,mFt=`${Se}.page.id`,dFt=`${Se}.app.name`,fFt=`${Se}.page.attributes.view_id`,gFt=`${Se}.cloud.provider`,hFt=`${Se}.cloud.platform`,yFt=`${Se}.aws.ecs.task.arn`,EFt=`${Se}.aws.ecs.task.id`,SFt=`${Se}.aws.ecs.cluster.arn`,TFt=`${Se}.faas.name`,bFt=`${Se}.faas.invoked_provider`,xFt=`${Se}.gcp.label.service_name`,IFt=`${Se}.k8s.cluster.name`,_Ft=`${Se}.k8s.cluster.uid`,AFt=`${Se}.k8s.namespace.name`,mDe=`${Se}.k8s.pod.name`,OFt=`${Se}.k8s.pod.uid`,CFt=`${Se}.k8s.container.name`,RFt=`${Se}.k8s.node.name`,PFt=`${Se}.k8s.node.uid`,dDe=`${Se}.k8s.deployment.name`,wFt=`${Se}.k8s.deployment.uid`,fDe=`${Se}.k8s.replicaset.name`,vFt=`${Se}.k8s.replicaset.uid`,gDe=`${Se}.k8s.statefulset.name`,UFt=`${Se}.k8s.statefulset.uid`,hDe=`${Se}.k8s.daemonset.name`,NFt=`${Se}.k8s.daemonset.uid`,kFt=`${Se}.k8s.job.name`,LFt=`${Se}.k8s.job.uid`,MFt=`${Se}.k8s.cronjob.name`,DFt=`${Se}.k8s.cronjob.uid`,Pf="status_code",DO="span.name";var FO="span.kind";var yDe="db.system.name",EDe="db.system",SDe="db.namespace",TDe="db.name";var FFt=`span_attributes.${SDe}`,$Ft=`span_attributes.${TDe}`,GFt=`span_attributes.${yDe}`,BFt=`span_attributes.${EDe}`;var qFt={name:"tsuga.internal.processing_tag_policy_violations_total",attributes:{tagPolicyId:`${Se}.tag_policy_id`,dataSource:`${Se}.data_source`,sourceTeam:`${Se}.source_team`}};var jFt={name:"tsuga.internal.event_size_bytes",attributes:{batchKind:`${Se}.batch_kind`,batchKindMetricsFilter:`${Se}.batch_kind:metrics`,sourceApiKeyId:`${Se}.source_api_key_id`,sourceEnv:`${Se}.source_env`,sourceTeam:`${Se}.source_team`}};var iM="__tsuga_metadata__",HFt=`${iM}.signature`,KFt=`${iM}.routes`,zFt=`${iM}.trace_id_bucket`;var XFt=[Pf,nu,nu.replace(`${Se}.`,"")];var sM=["red","orange","amber","yellow","green","emerald","teal","cyan","sky","blue","indigo","purple","pink"],aM=["light","dark"];var bDe={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)"}},WZ=["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 i1t=bDe.light.red.background;var JZ=2,ZZ=2;var XZ=[{key:"amex15_digits",name:"American Express card (1x15 digits)",category:"financial-data",example:"378282246310005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"amex4443_digits",name:"American Express card (4+4+4+3 digits)",category:"financial-data",example:"3782 8224 6310 005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"amex465_digits",name:"American Express card (4+6+5 digits)",category:"financial-data",example:"3782 822463 10005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"amex87_digits",name:"American Express card (8+7 digits)",category:"financial-data",example:"37828224 6310005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card14_digits",name:"Diners card (1x14 digits)",category:"financial-data",example:"30569309025904",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card4442_digits",name:"Diners card (4+4+4+2 digits)",category:"financial-data",example:"3056 9309 0259 04",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card464_digits",name:"Diners card (4+6+4 digits)",category:"financial-data",example:"3056 930902 5904",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card86_digits",name:"Diners card (8+6 digits)",category:"financial-data",example:"30569309 025904",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"discover_card16_digits",name:"Discover card (1x16 digits)",category:"financial-data",example:"6011111111111117",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"discover_card88_digits",name:"Discover card (2x8 digits)",category:"financial-data",example:"60111111 11111117",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"discover_card4444_digits",name:"Discover card (4x4 digits)",category:"financial-data",example:"6011 1111 1111 1117",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"jcb_card16_digits",name:"JCB card (1x16 digits)",category:"financial-data",example:"3530111333300000",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"jcb_card88_digits",name:"JCB card (2x8 digits)",category:"financial-data",example:"35301113 33300000",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"jcb_card4444_digits",name:"JCB card (4x4 digits)",category:"financial-data",example:"3530 1113 3330 0000",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"maestro_card16_digits",name:"Maestro card (1x16 digits)",category:"financial-data",example:"6759649826438453",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"maestro_card88_digits",name:"Maestro card (2x8 digits)",category:"financial-data",example:"67596498 26438453",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"maestro_card4444_digits",name:"Maestro card (4x4 digits)",category:"financial-data",example:"6759 6498 2643 8453",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"mastercard16_digits",name:"Mastercard (1x16 digits)",category:"financial-data",example:"5555555555554444",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"mastercard88_digits",name:"MasterCard (2x8 digits)",category:"financial-data",example:"55555555 55554444",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"mastercard4444_digits",name:"MasterCard (4x4 digits)",category:"financial-data",example:"5555 5555 5555 4444",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa16_digits",name:"Visa (1x16 digits)",category:"financial-data",example:"4111111111111111",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa19_digits",name:"Visa (1x19 digits)",category:"financial-data",example:"4111111111111111151",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa88_digits",name:"Visa (2x8 digits)",category:"financial-data",example:"41111111 11111111",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa883_digits",name:"Visa (8+8+3 digits)",category:"financial-data",example:"41111111 11111111 151",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa4444_digits",name:"Visa (4x4 digits)",category:"financial-data",example:"4111 1111 1111 1111",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa44443_digits",name:"Visa (4+4+4+4+3 digits)",category:"financial-data",example:"4111 1111 1111 1111 151",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"dropbox_long_lived_api_token",name:"Dropbox long lived API token",category:"credential",example:"767cb868836AAAAAAAAAAszri2cnmzu5tr0yf-nvclmwfyiswl67qyqw-uzn-scg",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:[a-z0-9]{11}(AAAAAAAAAA)[a-z0-9\\-_=]{43})"},{key:"dropbox_short_lived_api_token",name:"Dropbox short lived API token",category:"credential",example:"sl.nu0yvsrposcjeyjcpmbfrmqygllrxpahrgbt8flml9xroifbic",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:sl\\.[a-z0-9\\-=_]{50})"},{key:"french_nirpp",name:"French social security number (NIRPP)",category:"personal-information",example:"188073512757119",isUsingLuhnAlgorithm:!1,regexp:"([12])\\s*[0-9]{2}\\s*(0[1-9]|1[0-2])\\s*(2[AB]|[0-9]{2})\\s*([0-9]{3})\\s*([0-9]{3})(\\s*[0-9]{2})?"},{key:"ip_address",name:"IP address",category:"device-identifier",example:"81.55.13.53",isUsingLuhnAlgorithm:!1,regexp:""},{key:"social_security_number",name:"Social security number (XXX-XX-XXXX)",category:"personal-information",example:"437-02-2223",isUsingLuhnAlgorithm:!1,regexp:"(?x)(?-u:\\b)(?:00[1-9]|0[1-9][0-9]|[1-578][0-9]{2}|6[0-57-9][0-9]|66[0-57-9])-(?:0[1-9]|[1-9]0|[1-9][1-9])-(?:000[1-9]|00[1-9]0|0[1-9]00|[1-9]000|[1-9]{4})(?-u:\\b)"},{key:"social_security_number_space",name:"Social security number (XXX XX XXXX)",category:"personal-information",example:"437 02 2223",isUsingLuhnAlgorithm:!1,regexp:"(?x)(?-u:\\b)(?:00[1-9]|0[1-9][0-9]|[1-578][0-9]{2}|6[0-57-9][0-9]|66[0-57-9])\\s+(?:0[1-9]|[1-9]0|[1-9][1-9])\\s+(?:000[1-9]|00[1-9]0|0[1-9]00|[1-9]000|[1-9]{4})(?-u:\\b)"},{key:"social_security_number_digits",name:"Social security number (9 digits)",category:"personal-information",example:"437022223",isUsingLuhnAlgorithm:!1,regexp:"(?x)(?-u:\\b)(?:00[1-9]|0[1-9][0-9]|[1-578][0-9]{2}|6[0-57-9][0-9]|66[0-57-9])(?:0[1-9]|[1-9]0|[1-9][1-9])(?:000[1-9]|00[1-9]0|0[1-9]00|[1-9]000|[1-9]{4})(?-u:\\b)"},{key:"email",name:"Email",category:"credential",example:"admin@tsuga.com",isUsingLuhnAlgorithm:!1,regexp:"[a-zA-Z0-9-_.]*[a-zA-Z0-9_](@[a-zA-Z0-9_]+)(\\.[a-zA-Z0-9_]+(\\.[a-zA-Z0-9_]+)?[a-zA-Z])(?-u:\\b)"},{key:"one_password_secret_key",name:"1Password secret key",category:"credential",example:"A3-O28NKC-F58GULWCN72-4NIKS-KGY7V-U7FAT",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)A3-[A-Z0-9]{6}-(?:(?:[A-Z0-9]{11})|(?:[A-Z0-9]{6}-[A-Z0-9]{5}))-[A-Z0-9]{5}-[A-Z0-9]{5}-[A-Z0-9]{5}(?-u:\\b)"},{key:"one_password_service_account_token",name:"1Password service account token",category:"credential",example:"ops_eyJdAZ/FoIyz0jAXpEQOrRdIE8ydVaYfAXeZXGFqHWfBOjnE/Vgf5kHIbwrNAp2WeFNPeFiVJPlLv1hmaTVums0ldq1Kv8JEglMqP3f0ATBuX/WRbKqXYS3Z1wSzxg6S0krW4df7ZplvK04+JhJimejyTEH5dYaxqsYDBSLxjeEq7JWsmHEuXj6WP5qQi7FB+5s+CwhWPWY/jDhUMB3fdowXbfv5VnWri3iYrfBh+bFeRe9KURhXGHRDE9hgs",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ops_eyJ[a-zA-Z0-9+/]{50}"},{key:"adafruit_api_key",name:"Adafruit API key",category:"credential",example:"jb9pb4unb2bhe7xqepmgwtl2jg7ti101",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{32})"},{key:"adobe_client_id",name:"Adobe client ID",category:"credential",example:"c4166853dfd2897ebe706d49ef13fe63",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"adobe_client_secret",name:"Adobe client secret",category:"credential",example:"p8e-bb6e1614324ae48e507d33af176db3b7",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:p8e-[a-z0-9]{32})"},{key:"age_secret_key",name:"Age secret key",category:"credential",example:"AGE-SECRET-KEY-1QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)AGE-SECRET-KEY-1[QPZRY9X8GF2TVDW0S3JN54KHCE6MUA7L]{58}"},{key:"airtable_api_key",name:"Airtable API key",category:"credential",example:"19b73hbi0tc5cdy4w",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{17})"},{key:"algolia_api_key",name:"Algolia API key",category:"credential",example:"346155deb68d31c4018d73de73452947",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"alibaba_access_key_id",name:"Alibaba Cloud AccessKey ID",category:"credential",example:"LTAI7cc6804e4c2155cd52bd",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:LTAI[a-z0-9]{20})"},{key:"alibaba_secret_key",name:"Alibaba Cloud secret key",category:"credential",example:"suwixirhh10xhnko9bv0vfg2971u9p",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{30})"},{key:"anthropic_admin_api_key",name:"Anthropic admin API key",category:"credential",example:"sk-ant-admin01-abc12fake-456def789ghij-klmnopqrstuvwx-3456yza789bcde-12fakehijklmnopby56aaaogaopaaaabc123xyzAA",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sk-ant-admin01-[a-zA-Z0-9_-]{93}AA)"},{key:"anthropic_api_key",name:"Anthropic API key",category:"credential",example:"sk-ant-api03-abc123xyz-456def789ghij-klmnopqrstuvwx-3456yza789bcde-1234fghijklmnopby56aaaogaopaaaabc123xyzAA",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sk-ant-api03-[a-zA-Z0-9_-]{93}AA)"},{key:"artifactory_api_key",name:"Artifactory API key",category:"credential",example:"AKCpt771klpkqllt647fdf36fq43radbz2w2nyetvx4l90qyeef8kbgkmke63ul5vf6mqsy82",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)AKCp[A-Za-z0-9]{69}(?-u:\\b)"},{key:"artifactory_reference_token",name:"Artifactory reference token",category:"credential",example:"cmVmdc6i6888t9viuobfd88e46pdonjjsvmme6np82qti7wzbj7l9m1ygtyl9wik",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)cmVmd[A-Za-z0-9]{59}(?-u:\\b)"},{key:"asana_client_id",name:"Asana client ID",category:"credential",example:"9760134337886314",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9]{16})"},{key:"asana_client_secret",name:"Asana client secret",category:"credential",example:"tcnc8mjrf5bad359nnz3j1z90gow67ji",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"atlassian_api_token",name:"Atlassian API token",category:"credential",example:"fdo4scsa4kh53jnenkfp5fbe",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:[a-z0-9]{20}[a-f0-9]{4})|(?-u:\\b)(?:ATATT3[A-Za-z0-9_-=]{50})"},{key:"authress_service_client_access_key",name:"Authress service client access key",category:"credential",example:"sc_scmz00n9xj.0ykp.acc_2k5vtnrec4.55vc9459s-gc5qlia7a67jvzm0bobn3g0ezimd3b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:sc|ext|scauth|authress)_[a-z0-9]{5,30}\\.[a-z0-9]{4,6}\\.(?-i:acc)[_-][a-z0-9-]{10,32}\\.[a-z0-9+/_=-]{30})"},{key:"aws_access_token",name:"AWS access token",category:"credential",example:"AKIALALEMEL33243OLIB",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:A3T[A-Z0-9]|AKIA|ASIA|ABIA|ACCA)[A-Z2-7]{16})(?-u:\\b)"},{key:"azure_ad_client_secret",name:"Azure AD client secret",category:"credential",example:"bP88Q~rcBcYjzzOhg1Hnn76Wm3jGgakZiZ.8vMgR",isUsingLuhnAlgorithm:!1,regexp:"(?:^|[\\\\'\"` \\r\\n\\t\\f\\v>=:(?:,)])(?:[a-zA-Z0-9_~.]{3}[0-9]Q~[a-zA-Z0-9_~.-]{31,34})(?:$|[\\\\'\"` \\r\\n\\t\\f\\v<),])"},{key:"bitbucket_client_id",name:"Bitbucket client ID",category:"credential",example:"yyxmjnl3kahirvct7sat2082pzqdyf09",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"bitbucket_client_secret",name:"Bitbucket client secret",category:"credential",example:"fylw1pominwz91e5guqjiugw6srutpl64vzch5rnt8xnt31ka7so9va73fscz836",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{64})"},{key:"beamer_api_token",name:"Beamer API token",category:"credential",example:"b_zhy-phuoqk13asco6az4u_0yhtklgswm4umkv95nv4gu",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:b_[a-z0-9=_\\-]{44})"},{key:"codecov_access_token",name:"Codecov access token",category:"credential",example:"r93iopllonuphk41qglet20y8cb83thm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"clickhouse_cloud_api_secret_key",name:"ClickHouse Cloud API secret key",category:"credential",example:"4b1dbRdW3rOcB7xLthrM4BTBGK1qPLkHigpN1bXD6z",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:4b1d[A-Za-z0-9]{38})(?-u:\\b)"},{key:"clojars_api_token",name:"Clojars API token",category:"credential",example:"CLOJARS_d1vd7t0blxaarzx25dxoda4hm5ox86st6o5ww7tnzsfz07wvu223bf0fmgim",isUsingLuhnAlgorithm:!1,regexp:"CLOJARS_[a-z0-9]{60}"},{key:"cloudflare_api_key",name:"Cloudflare API key",category:"credential",example:"ckg0h_dzkxnl627gy3nskpq9wzm4d5hc_vxk272h",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{40})"},{key:"cloudflare_global_api_key",name:"Cloudflare global API key",category:"credential",example:"1d003bb65ec73ad2691fb76631b6496e3c9d9",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{37})"},{key:"cloudflare_origin_ca_key",name:"Cloudflare Origin CA key",category:"credential",example:"v1.0-aaa334dc886f30631ba0a610-0d98ef66290d7e50aac7c27b5986c99e6f3f1084c881d8ac0eae5de1d1aa0644076ff57022069b3237d19afe60ad045f207ef2b16387ee37b749441b2ae2e9ebe5b4606e846475d4a5",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:v1\\.0-[a-f0-9]{24}-[a-f0-9]{50})"},{key:"cohere_api_token",name:"Cohere API token",category:"credential",example:"lpn59BQ4FNUabVJh1vCpIqZpQbaViELQrTa14p9D",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:[a-zA-Z0-9]{40})"},{key:"confluent_access_token",name:"Confluent access token",category:"credential",example:"kkat92sclkukwvr2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{16})"},{key:"confluent_secret_key",name:"Confluent secret key",category:"credential",example:"64d4ppp37l9fjhadm8vv0awie6wjo4d6ourfcqvi2bcs2tm95x4f0e8gyb8z8usj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"contentful_delivery_api_token",name:"Contentful delivery API token",category:"credential",example:"eumospigka64wiwpavfmmblrq7x1hm6gz84wiiw2ff3",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{43})"},{key:"curl_auth_header",name:"Curl authorization header",category:"credential",example:"curl --header 'Authorization: 5eb4223e-5008-46e5-be67-c7b8f2732305'",isUsingLuhnAlgorithm:!1,regexp:`(?-u:\\b)curl(?-u:\\b)(?:.*?|.*?(?:[\\r\\n]{1,2}.*?){1,5})[ \\t\\n\\r](?:-H|--header)(?:=|[ \\t]{0,5})(?:"(?:Authorization:[ \\t]{0,5}(?:Basic[ \\t](?:[a-z0-9+/]{8,}={0,3})|(?:Bearer|(?:Api-)?Token)[ \\t](?:[a-zA-Z0-9_=~@.+/-]{8,})|(?:[a-zA-Z0-9_=~@.+/-]{8,}))|(?:(?:X-(?:[a-z]+-)?)?(?:Api-?)?(?:Key|Token)):[ \\t]{0,5}(?:[a-zA-Z0-9_=~@.+/-]{8,}))"|'(?:Authorization:[ \\t]{0,5}(?:Basic[ \\t](?:[a-z0-9+/]{8,}={0,3})|(?:Bearer|(?:Api-)?Token)[ \\t](?:[a-zA-Z0-9_=~@.+/-]{8,})|(?:[a-zA-Z0-9_=~@.+/-]{8,}))|(?:(?:X-(?:[a-z]+-)?)?(?:Api-?)?(?:Key|Token)):[ \\t]{0,5}(?:[a-zA-Z0-9_=~@.+/-]{8,}))')(?:(?-u:\\B)|[ \\r\\n\\t\\f\\v]|\\z)`},{key:"curl_auth_user",name:"Curl basic authentication",category:"credential",example:"curl -u elastic:P@ssw0rd$1",isUsingLuhnAlgorithm:!1,regexp:`(?-u:\\b)curl(?-u:\\b)(?:.*|.*(?:[\\r\\n]{1,2}.*){1,5})[ \\t\\n\\r](?:-u|--user)(?:=|[ \\t]{0,5})(?:"(:[^"]{3,}|[^:"]{3,}:|[^:"]{3,}:[^"]{3,})"|'(?:[^:']{3,}:[^']{3,})'|(?:(?:"[^"]{3,}"|'[^']{3,}'|[a-zA-Z0-9_$@.-]+):(?:"[^"]{3,}"|'[^']{3,}'|[a-zA-Z0-9_\${}@.-]+)))(?:[ \\r\\n\\t\\f\\v]|\\z)`},{key:"databricks_api_token",name:"Databricks API token",category:"credential",example:"dapia2553f815d29a193fd09c2bb55201895",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:dapi[a-f0-9]{32}(?:-[0-9])?)"},{key:"datadog_access_token",name:"Datadog access token",category:"credential",example:"ljgbhjnca2hy5yc2nv7cag1ag7ehx2hc6geparov",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{40})"},{key:"defined_networking_api_token",name:"Defined Networking API token",category:"credential",example:"dnkey-nowf_nwyqhvqt1gi66xnuuf2rb-bfxnr9_qydyxnxn1y8uijvhhp9owllbg-2czoe-7qs5_w5650xei",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:-[a-z0-9=_\\-]{26}-[a-z0-9=_\\-]{52})"},{key:"digitalocean_pat",name:"DigitalOcean personal access token",category:"credential",example:"dop_v1_ec8f4a856c1459bd442a275461e2f709506347de30b180851cde71f696e9fcc8",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:dop_v1_[a-f0-9]{64})"},{key:"digitalocean_access_token",name:"DigitalOcean OAuth access token",category:"credential",example:"doo_v1_42b8ea6c4b0c373f88aff9d3fa87e123ab23b0d3c22ac6d4361a4e9c1e89eaa6",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:doo_v1_[a-f0-9]{64})"},{key:"digitalocean_refresh_token",name:"DigitalOcean OAuth refresh token",category:"credential",example:"dor_v1_4d9b3e6fbe65ab472e464dfa6377d702e80164442acdfbeb3ef032d917cb9984",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:dor_v1_[a-f0-9]{64})"},{key:"discord_api_token",name:"Discord API token",category:"credential",example:"7eb855d9a40747182d0b0ea74df27aee31d05756a9933a815a3ccb5a46b2d61d",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{64})"},{key:"discord_client_id",name:"Discord client ID",category:"credential",example:"763721114261247538",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9]{18})"},{key:"discord_client_secret",name:"Discord client secret",category:"credential",example:"13641266018325206246161633988007",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{32})"},{key:"doppler_api_token",name:"Doppler API token",category:"credential",example:"dp.pt.vgin8wwjy7sx66fyq99tavkm3y5g2jdxmsufh257dhj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)dp\\.pt\\.[a-z0-9]{43}"},{key:"dropbox_api_token",name:"Dropbox API token",category:"credential",example:"rdlztoij88rzrsk",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{15})"},{key:"droneci_access_token",name:"DroneCI access token",category:"credential",example:"v26gffr903rbti5v7m392ba0u7oarz36",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"duffel_api_token",name:"Duffel API token",category:"credential",example:"duffel_test_-yd6b3pc4jy593pt5kr2l3ynzkb5b_f619dshefiz=v",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)duffel_(?:test|live)_[a-z0-9_\\-=]{43}"},{key:"dynatrace_api_token",name:"Dynatrace API token",category:"credential",example:"dt0c01.ben820rdpb1so4kasfx3yn4a.zkje7lawif35udsin5t1mi1m1sne7wdzphlzrmdnu3j69gr4kgf5dwg4x5lb30zg",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)dt0c01\\.[a-z0-9]{24}\\.[a-z0-9]{64}"},{key:"easypost_api_token",name:"EasyPost API token",category:"credential",example:"EZAKBVScDZwZFv0nJXHBcxPGil7eztnPJOSmDFf2NGKQk6Dn7VqULciSRm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)EZAK[a-z0-9]{54}(?-u:\\b)"},{key:"easypost_test_api_token",name:"EasyPost test API token",category:"credential",example:"EZTKuxUXVU5HBS1K2iyh165t3VtivpdxMgIf5Y2P1oJxeFeaJGcwzVexds",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)EZTK[a-z0-9]{54}(?-u:\\b)"},{key:"etsy_access_token",name:"Etsy access token",category:"credential",example:"8ssp35lhprxpb3sjyergcz5z",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{24})"},{key:"facebook_secret",name:"Facebook secret",category:"credential",example:"c41c21ba4fb5ee05398db86ca83f06db",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"facebook_access_token",name:"Facebook access token",category:"credential",example:"911602140448729|AY-lRJZq9BoDLobvAiP25L7RcMg",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:[0-9]{15,16}(\\||%)[0-9a-z\\-_]{27,40})"},{key:"facebook_page_access_token",name:"Facebook page access token",category:"credential",example:"EAAM9GOnCB9kBO2frzOAWGN2zMnZClQshlWydZCrBNdodesbwimx1mfVJgqZBP5RSpMfUzWhtjTTXHG5I1UlvlwRZCgjm3ZBVGeTYiqAAoxyED6HaUdhpGVNoPUwAuAWWFsi9OvyYBQt22DGLqMIgD7VktuCTTZCWKasz81Q822FPhMTB9VFFyClNzQ0NLZClt9zxpsMMrUZCo1VU1rL3CKavir5QTfBjfCEzHNlWAUDUV2YZD",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:EAA[MC][a-z0-9]{50})"},{key:"fastly_api_token",name:"Fastly API token",category:"credential",example:"im7_ux24tyyxz_4y4mvzj22akpid830c",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{32})"},{key:"finicity_client_secret",name:"Finicity client secret",category:"credential",example:"roepymyr0ce7wxhjvgb2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{20})"},{key:"finicity_api_token",name:"Finicity API token",category:"credential",example:'= "cce089057c8b7fe7f2a8474b9a050816',isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"flickr_access_token",name:"Flickr access token",category:"credential",example:"damvt93tudulk6wrfp36sawndc9pa7bb",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"finnhub_access_token",name:"Finnhub access token",category:"credential",example:"x01lnfp13spcbsa0at32",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{20})"},{key:"flutterwave_public_key",name:"Flutterwave public key",category:"credential",example:"FLWPUBK_TEST-99484d505b4ee5c1181a2884f5fe3852-X",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)FLWPUBK_TEST-[a-h0-9]{32}-X"},{key:"flutterwave_secret_key",name:"Flutterwave secret key",category:"credential",example:"FLWSECK_TEST-66187ac83488c2245f0d7e95fa37e833-X",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)FLWSECK_TEST-[a-h0-9]{32}-X"},{key:"flutterwave_encryption_key",name:"Flutterwave encryption key",category:"credential",example:"FLWSECK_TEST-6262214a02e7",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)FLWSECK_TEST-[a-h0-9]{12}"},{key:"flyio_access_token",name:"Fly.io access token",category:"credential",example:"fo1_m-HT0NHLBSPwMJ2hIer4v3lxtWEC7grXNidQxJMrVVE",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:fo1_[a-zA-Z0-9_-]{43}|fm1[ar]_[a-zA-Z0-9+\\/]{50}))"},{key:"frameio_api_token",name:"Frame.io API token",category:"credential",example:"fio-u-4ov9vjtr2wwj8j1gob-8xrx2-1=z818psmitskgoq4=p-_k77d54034z55xk-lqh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)fio-u-[a-z0-9\\-_=]{64}"},{key:"freshbooks_access_token",name:"FreshBooks access token",category:"credential",example:"gqw118uwne1nddlt4yruvvs4jr9s0vrj5mxaswgb2amacod8lgnmrknsvbovsx1g",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"gocardless_api_token",name:"GoCardless API token",category:"credential",example:"live_-z4lwtrrk6p6=-v1ig_y_4ceplziwek0lw=oz-eu",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:live_[a-z0-9\\-_=]{40})"},{key:"gcp_api_key",name:"GCP API key",category:"credential",example:"AIzaYpvGqEzpgB7R353HD9CxN8LuhZ6d6UfuXLL",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:AIza[a-zA-Z0-9_-]{35})"},{key:"github_pat",name:"GitHub personal access token",category:"credential",example:"ghp_t7i9llxuukeb7apn4zlnyeyz5b0007rsfs54",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ghp_[0-9a-zA-Z]{36}"},{key:"github_fine_grained_pat",name:"GitHub fine-grained personal access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)github_pat_[a-zA-Z0-9_]{82}"},{key:"github_oauth",name:"GitHub OAuth token",category:"credential",example:"gho_anlrm6zqscqityoqozv503by66dobnem4yxh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)gho_[0-9a-zA-Z]{36}"},{key:"github_app_token",name:"GitHub app token",category:"credential",example:"ghs_0zleityj4n1ulz178o9in1w97q1ifw8u3y8h",isUsingLuhnAlgorithm:!1,regexp:"(?:ghu|ghs)_[0-9a-zA-Z]{36}"},{key:"github_refresh_token",name:"GitHub refresh token",category:"credential",example:"ghr_inu1aa7qbgi46cf8nprbgh4kn03d0zk35raj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ghr_[0-9a-zA-Z]{36}"},{key:"gitlab_cicd_job_token",name:"GitLab CI/CD job token",category:"credential",example:"glcbt-7h2nr_6jmho0uoqkb1ww431kfl",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glcbt-[0-9a-zA-Z]{1,5}_[0-9a-zA-Z_-]{20}"},{key:"gitlab_deploy_token",name:"GitLab deploy token",category:"credential",example:"gldt-7a3o70gqa8zkal0zdp4x",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)gldt-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_feature_flag_client_token",name:"GitLab feature flag client token",category:"credential",example:"glffct-dsct62ndnvcj7alw5nas",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glffct-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_feed_token",name:"GitLab feed token",category:"credential",example:"glft-13956nvy00289v6xu0di",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glft-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_incoming_mail_token",name:"GitLab incoming mail token",category:"credential",example:"glimt-fcdt1a5jvj01si61jgkse2r20",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glimt-[0-9a-zA-Z_\\-]{25}"},{key:"gitlab_kubernetes_agent_token",name:"GitLab Kubernetes agent token",category:"credential",example:"glagent-8wxkulkbbuk7u6r3nvrefswdfw5o0v7vy81y4oky8rnfogm826",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glagent-[0-9a-zA-Z_\\-]{50}"},{key:"gitlab_oauth_app_secret",name:"GitLab OAuth app secret",category:"credential",example:"gloas-vawws2nw5kf6rizn49g41jc3jiy4xqioaihrwm1msltbdt4cbmo4x52tygcic7af",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)gloas-[0-9a-zA-Z_\\-]{64}"},{key:"gitlab_pat",name:"GitLab personal access token",category:"credential",example:"glpat-2gl3ku1497ms4gzyv16i",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glpat-[a-zA-Z0-9_-]{20}"},{key:"gitlab_pat_routable",name:"GitLab personal access token (routable)",category:"credential",example:"glpat-2hf7vebpux9j56tdcqqsvap7vxc.chvjof35u",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glpat-[0-9a-zA-Z_-]{27}\\.[0-9a-z]{2}[0-9a-z]{7}(?-u:\\b)"},{key:"gitlab_ptt",name:"GitLab personal access token (temporary)",category:"credential",example:"glptt-b54e8b7b90cf006b79af110baa9b8d9183fd7048",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glptt-[0-9a-f]{40}"},{key:"gitlab_rrt",name:"GitLab registration token",category:"credential",example:"GR1348941vnauzmn2hj0zncvt0nfe",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)GR1348941[a-zA-Z0-9_-]{20}"},{key:"gitlab_runner_authentication_token",name:"GitLab runner authentication token",category:"credential",example:"glrt-xbd1w7c9clbxm52zdxkm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glrt-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_runner_authentication_token_routable",name:"GitLab runner authentication token (routable)",category:"credential",example:"glrt-t5_8d8ugbkfzddae0dw06tvm0x7qxc.mwcd1a7cn",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glrt-t[0-9]_[0-9a-zA-Z_\\-]{27}\\.[0-9a-z]{2}[0-9a-z]{7}(?-u:\\b)"},{key:"gitlab_scim_token",name:"GitLab SCIM token",category:"credential",example:"glsoat-9jb5zk1nvy800c1uqhh0",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glsoat-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_session_cookie",name:"GitLab session cookie",category:"credential",example:"_gitlab_session=yjhub6vtrp60djn6rszuemeacsoqox97",isUsingLuhnAlgorithm:!1,regexp:"_gitlab_session=[0-9a-z]{32}"},{key:"gitter_access_token",name:"Gitter access token",category:"credential",example:"uazubes6trcd_1gym09opuf_8gj1rmvj6jwber4a",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{40})"},{key:"grafana_api_key",name:"Grafana API key",category:"credential",example:"eyJrIjoiyl5shjvqja0xkfbu38m24vn5httsipr1h9fgjhodxzlkpravuiy8h7hom5kt8gtwuguh2v",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:eyJrIjoi[A-Za-z0-9]{70}={0,3})"},{key:"grafana_cloud_api_token",name:"Grafana cloud API token",category:"credential",example:"glc_cb7p4j2g1qu0sy84me72ufmn1z8mqk8y",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:glc_[A-Za-z0-9+/]{32}={0,3})"},{key:"grafana_service_account_token",name:"Grafana service account token",category:"credential",example:"glsa_rm3sadbwl8o2c13v4ipgkz04h66kiy6t_edaea401",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:glsa_[A-Za-z0-9]{32}_[A-Fa-f0-9]{8})"},{key:"harness_api_key",name:"Harness API key",category:"credential",example:"pat.vzcxr183pymw194fdq1q0v.qjqjarqkd9ydxqagjmq3f5iq.8nn5nyaow3h5mmgjh053",isUsingLuhnAlgorithm:!1,regexp:"(?:pat|sat)\\.[a-zA-Z0-9_-]{22}\\.[a-zA-Z0-9]{24}\\.[a-zA-Z0-9]{20}"},{key:"hashicorp_tf_api_token",name:"HashiCorp Terraform API token",category:"credential",example:"984d8033429986.atlasv1.799k5cihj_807yc1e8afvla8ackd1khsb50nfeswbxbr1re54y0wpzs2tjy=",isUsingLuhnAlgorithm:!1,regexp:"[a-z0-9]{14}\\.(?-i:atlasv1)\\.[a-z0-9\\-_=]{60,70}"},{key:"heroku_api_key",name:"Heroku API key",category:"credential",example:"9127f65b-8b3f-c0b7-a336-a4347e71bc51",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"heroku_api_key_v2",name:"Heroku API key v2",category:"credential",example:"HRKU-AAxPYvV6l2R3DvF0w9VJ4m8cz9oaygOHxpQvcw--iD51MszQZeakD9DZsclX",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(HRKU-AA[0-9a-zA-Z_-]{58}))"},{key:"hubspot_api_key",name:"HubSpot API key",category:"credential",example:"86cb6664-b191-db72-95a7-49adebe84b74",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12})"},{key:"huggingface_access_token",name:"HuggingFace access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:hf_(?i:[a-z]{34}))"},{key:"huggingface_organization_api_token",name:"HuggingFace organization API token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:api_org_(?i:[a-z]{34}))"},{key:"intercom_api_key",name:"Intercom API key",category:"credential",example:"zuc5c=ykf5gcwesqvmh2pji6k3extx0rbalsznte3sdo7iu7f-lumol2npfk",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{60})"},{key:"intra42_client_secret",name:"Intra42 client secret",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:s-s4t2(?:ud|af)-[abcdef0123456789]{64})"},{key:"jfrog_api_key",name:"JFrog API key",category:"credential",example:"lj7nrgoo0kr04kw312zvly7l0olsn37vhto5wdn3yqi5srxnc2axstp7a1kewkxi717w295kh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{73})"},{key:"jfrog_identity_token",name:"JFrog identity token",category:"credential",example:"xh0x2upbtkkg1pseg7ezmcyw2c3kt0bt05l5v8ynvkro6wagolhch0f7kppplt8b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"jwt",name:"JSON web token",category:"credential",example:"ey7gzQUpN8Kz7XY6Yin.ey1o36_XrBphAG8WMHQ.",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:ey[a-zA-Z0-9]{17,}\\.ey[a-zA-Z0-9\\/\\\\_-]{17,}\\.(?:[a-zA-Z0-9\\/\\\\_-]{10,}={0,2})?)"},{key:"jwt_base64",name:"JSON web token base64",category:"credential",example:"ZXlKNE5YUWpVekkxTmlJNklsUjFUM0pDZVRKT1kxUnNSbE5YZFZvNFMyZzRWemhCYWxGaFoySTBabTVtVURGVGJFdE5Uemd0VTI4aWZRLmV5SnBjM01pT2lKcWIyVWlMQTBLSUNKbGVIQWlPakV6TURBNE1Ua3pPREFzRFFvZ0ltaDBkSEE2THk5bGVHRnRjR3hsTG1OdmJTOXBjMTl5YjI5MElqcDBjblZsZlEuZEJqZnRKZVo0Q1ZQLW1COTJLMjd1aGJVSlUxcDFyX3dXMWdGV0ZPRWpYaw==",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ZXlK(?:(?P<alg>aGJHY2lPaU)|(?P<apu>aGNIVWlPaU)|(?P<apv>aGNIWWlPaU)|(?P<aud>aGRXUWlPaU)|(?P<b64>aU5qUWlP)|(?P<crit>amNtbDBJanBi)|(?P<cty>amRIa2lPaU)|(?P<epk>bGNHc2lPbn)|(?P<enc>bGJtTWlPaU)|(?P<jku>cWEzVWlPaU)|(?P<jwk>cWQyc2lPb)|(?P<iss>cGMzTWlPaU)|(?P<iv>cGRpSTZJ)|(?P<kid>cmFXUWlP)|(?P<key_ops>clpYbGZiM0J6SWpwY)|(?P<kty>cmRIa2lPaUp)|(?P<nonce>dWIyNWpaU0k2)|(?P<p2c>d01tTWlP)|(?P<p2s>d01uTWlPaU)|(?P<ppt>d2NIUWlPaU)|(?P<sub>emRXSWlPaU)|(?P<svt>emRuUWlP)|(?P<tag>MFlXY2lPaU)|(?P<typ>MGVYQWlPaUp)|(?P<url>MWNtd2l)|(?P<use>MWMyVWlPaUp)|(?P<ver>MlpYSWlPaU)|(?P<version>MlpYSnphVzl1SWpv)|(?P<x>NElqb2)|(?P<x5c>NE5XTWlP)|(?P<x5t>NE5YUWlPaU)|(?P<x5ts256>NE5YUWpVekkxTmlJNkl)|(?P<x5u>NE5YVWlPaU)|(?P<zip>NmFYQWlPaU))[a-zA-Z0-9\\/\\\\_+\\-\\r\\n]{40,}={0,2}"},{key:"launchdarkly_access_token",name:"LaunchDarkly access token",category:"credential",example:"ezmej9s6yv4qwk2=yeb4kfi162p33b_2hzm7tr-0",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{40})"},{key:"linear_api_key",name:"Linear API key",category:"credential",example:"lin_api_0n5n0k26vb4ka9je9dqdcwl1dae5mbpfhb48xio6",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)lin_api_[a-z0-9]{40}"},{key:"linear_client_secret",name:"Linear client secret",category:"credential",example:"7b956760f09b81684ed833c524f081de",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"linkedin_client_id",name:"LinkedIn client ID",category:"credential",example:"18u930hak0em0r",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{14})"},{key:"linkedin_client_secret",name:"LinkedIn client secret",category:"credential",example:"uvkxd9rw41ylk1zj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{16})"},{key:"lob_api_key",name:"Lob API key",category:"credential",example:"test_02efbb923a38370aac769e3bedc4d3398be",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:(live|test)_[a-f0-9]{35})"},{key:"lob_pub_api_key",name:"Lob publishable API key",category:"credential",example:"test_pub_df170d9f5be9244959713dfee686c42",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:(test|live)_pub_[a-f0-9]{31})"},{key:"mailchimp_api_key",name:"MailChimp API key",category:"credential",example:"81277fbbe2dd9c5e18d5f28cebcc558c-us20",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32}-us[0-9][0-9])"},{key:"mailgun_pub_key",name:"Mailgun public validation key",category:"credential",example:"pubkey-5011bae1a4b57dfa83762c24b0e1299d",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:pubkey-[a-f0-9]{32})"},{key:"mailgun_private_api_token",name:"Mailgun private API token",category:"credential",example:"key-176f7ef066471ac351adab734d2c9fb2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:key-[a-f0-9]{32})"},{key:"mailgun_signing_key",name:"Mailgun webhook signing key",category:"credential",example:"24564bd3d54a469601d5ac5daecb9ad2-00001111-22223333",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-h0-9]{32}-[a-h0-9]{8}-[a-h0-9]{8})"},{key:"mapbox_api_token",name:"MapBox API token",category:"credential",example:"pk.5ko18udoy3cilkpgyedje9limykwj8n7wmhug4967o9wze284mmpuuhjzgig.edjzuv7jwhc6lnv5b3p9nc",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:pk\\.[a-z0-9]{60}\\.[a-z0-9]{22})"},{key:"mattermost_access_token",name:"Mattermost access token",category:"credential",example:"rtw2hncbfhpbyyri90d3q2mo1m",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{26})"},{key:"maxmind_license_key",name:"MaxMind license key",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:[A-Za-z0-9]{6}_[A-Za-z0-9]{29}_mmk)"},{key:"cisco_meraki_api_key",name:"Cisco Meraki API key",category:"credential",example:"acea14a1470f7cf443a031dde64065ce81c77b2b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:[0-9a-f]{40})"},{key:"messagebird_api_token",name:"MessageBird API token",category:"credential",example:"448q6im7yxutswabdko1n69ry",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{25})"},{key:"messagebird_client_id",name:"MessageBird client ID",category:"credential",example:"12345678-ABCD-ABCD-ABCD-1234567890AB",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"netlify_access_token",name:"Netlify access token",category:"credential",example:"3j1sa0o20v0k-cjbjn3vh_4uqnkvb3w_px5no2in",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{40,46})"},{key:"new_relic_user_api_key",name:"New Relic user API key",category:"credential",example:"NRAK-zozcnrh45ornsbl1duyfhell59u",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:NRAK-[a-z0-9]{27})"},{key:"new_relic_user_api_id",name:"New Relic user API ID",category:"credential",example:"k0jze7delork84k8ke1z1dm275yw2aqf5uu2cy7x1uiloll3xab5203hiz9tx9xx",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"new_relic_browser_api_token",name:"New Relic browser API token",category:"credential",example:"NRJS-c7fa1261a97506e4a45",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:NRJS-[a-f0-9]{19})"},{key:"new_relic_insert_key",name:"New Relic insight insert key",category:"credential",example:"NRII-4168ab7eb2e051f37144ad884d32ab34",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:NRII-[a-z0-9-]{32})"},{key:"notion_api_token",name:"Notion API token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:ntn_[0-9]{11}[A-Za-z0-9]{32}[A-Za-z0-9]{3})"},{key:"npm_access_token",name:"npm access token",category:"credential",example:"npm_vz9e7fvsn7o2n2tddg6b01gs7g9wldlys4vm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:npm_[a-z0-9]{36})"},{key:"nytimes_access_token",name:"NYTimes access token",category:"credential",example:"ako7xzi0mx7w15ogdkew7ilq7h13x8rl",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{32})"},{key:"octopus_deploy_api_key",name:"Octopus Deploy API key",category:"credential",example:"API-NFWN6F7X32BYDBU94IGY3V5ZQY",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:API-[A-Z0-9]{26})"},{key:"okta_access_token",name:"Okta access token",category:"credential",example:"003cKkRNNMy4ul7V8UDHEjEBGbnsQ6tejSHzfeBtcp",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:00[a-zA-Z0-9_=\\-]{40})"},{key:"openai_api_key",name:"OpenAI API key",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sk-(?:proj|svcacct|admin)-(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})T3BlbkFJ(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})(?-u:\\b)|sk-[a-zA-Z0-9]{20}T3BlbkFJ[a-zA-Z0-9]{20})"},{key:"openshift_user_token",name:"OpenShift user token",category:"credential",example:"sha256~OFL-TnR3jyLteu_rAuff3PUYNELVvByMRFYCcAkaJSR",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sha256~[a-zA-Z0-9_-]{43})(?:[^a-zA-Z0-9_-]|\\z)"},{key:"perplexity_api_key",name:"Perplexity API key",category:"credential",example:"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'",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pplx-[a-zA-Z0-9]{48})(?:[`'\" \\r\\n\\t\\f\\v;]|\\\\[nr]|$|(?-u:\\b))"},{key:"pgpassword_shell_assignment",name:"PGPASSWORD shell assignment",category:"credential",example:"PGPASSWORD='supersecret'",isUsingLuhnAlgorithm:!1,regexp:`(?-u:\\b)PGPASSWORD=(?:"[^"\\r\\n]+"|'[^'\\r\\n]+'|[^\\s'"]+)`},{key:"plaid_api_token",name:"Plaid API token",category:"credential",example:"access-development-4b0f8c31-83fe-e4c5-3d02-91e487b69d2d",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:access-(?:sandbox|development|production)-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"plaid_client_id",name:"Plaid client ID",category:"credential",example:"TTPjxpFNiwOct5XLdxjXD0Ta",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{24})"},{key:"plaid_secret_key",name:"Plaid secret key",category:"credential",example:"ikhqm7a9k76l8f544dl0v8kxvm2w55",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{30})"},{key:"planetscale_password",name:"PlanetScale password",category:"credential",example:"pscale_pw_9gvu8z79m4b814z0vv8266w70h3i7jlq",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pscale_pw_[a-zA-Z0-9_=\\.-]{32,64})"},{key:"planetscale_api_token",name:"PlanetScale API token",category:"credential",example:"pscale_tkn_nwy9jkjgnry96ftecsx_=jrxc6pkmmew",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pscale_tkn_[a-zA-Z0-9_=\\.-]{32,64})"},{key:"planetscale_oauth_token",name:"PlanetScale OAuth token",category:"credential",example:"pscale_oauth_zx8v3gzfnfxbymj__l629i68jnz5gnff",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pscale_oauth_[a-zA-Z0-9_=\\.-]{32,64})"},{key:"postman_api_token",name:"Postman API token",category:"credential",example:"PMAK-525b84aa46e2c588620d8123-06f9ca36c4aad4305baafbe00716b7bc8f",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:PMAK-[a-f0-9]{24}\\-[a-f0-9]{34})"},{key:"prefect_api_token",name:"Prefect API token",category:"credential",example:"pnu_kttbffyfgffu2sfbxzxw8mbpgvvtxjljwe1p",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pnu_[a-zA-Z0-9]{36})"},{key:"privateai_api_token",name:"PrivateAI API token",category:"credential",example:"iwuxqzqilzbfnccncvjz6px23dnej11h",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"private_key",name:"Private key",category:"credential",example:`-----BEGIN PRIVATE KEY-----
|
|
239
|
+
`)}var ti=class e extends ot()("common-cli/OutputFormatter"){static layer=Hs(e)({rows:ie(function*(t,r){if(r.output==="json"){let i=r.fields,s=i===void 0?t:t.map(a=>zJ(a,i));yield*Oe(s);return}let o=JJ(r.output,t,r.fields??r.defaultFields);o.length>0&&(yield*We(o))})})};var ha=class extends ot()("GlobalFlags"){};var ZJ="__tsuga_cluster_id__",YLe=n.Object({}),VLe=n.Object({status:n.Literal("error"),message:n.String({description:"Why this cluster failed to answer the query."})});function Of(e=YLe){let t=Q("status",[n.Object({...e.properties,status:n.Literal("ok")}),VLe]);return Object.assign(OA(bi,t),{description:'Outcome per cluster, keyed by cluster ID. A cluster that failed reports `status: "error"`.'})}var QLe=5,XE=n.Array(f({allowEmpty:!1}),{minItems:1,maxItems:QLe,uniqueItems:!0,description:"IDs of the clusters to query, without duplicates. Mutually exclusive with `clusterId`. Omit both to use the default cluster."});var XJ=n.Object({type:n.Literal("number"),number:n.String()}),WLe=n.Object({type:n.Literal("string"),string:n.String()}),JLe=n.Object({type:n.Literal("timestamp"),timestamp:n.String()}),eS=Q("type",[XJ,WLe,JLe]),ZLe=n.Object({by:n.Record(n.String(),eS),computed:n.Record(n.String(),XJ)}),XLe=n.Object({type:n.Literal("buckets"),buckets:n.Array(ZLe),clusterResponses:n.Optional(Of())}),eMe=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()))}),Cf=Q("type",[XLe,eMe]);var BL=["all","owning-team-and-public","owning-team-only"],As=n.Enum(BL,{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 tZ=1456444800,rZ=4927737600,tMe=tZ*1e3,rMe=rZ*1e3,IO=1704067200,qL=IO*1e3,nZ={title:"TimeRange",description:"Inclusive time range for telemetry queries. Use Unix timestamps in seconds unless the field description says milliseconds.",examples:[{from:IO,to:IO}]},nMe={title:"TimeRange",description:"Inclusive time range for telemetry queries using Unix timestamps in milliseconds.",examples:[{from:qL,to:qL}]},_O=e=>n.Integer({description:e,examples:[IO],minimum:tZ,maximum:rZ,format:"int64"}),eZ=e=>n.Integer({description:e,examples:[qL],minimum:tMe,maximum:rMe,format:"int64"}),Lr=n.Object({from:n.Optional(_O("Start of the query window as a Unix timestamp in seconds")),to:n.Optional(_O("End of the query window as a Unix timestamp in seconds"))},nZ),Yr=n.Object({from:_O("Start of the query window as a Unix timestamp in seconds"),to:_O("End of the query window as a Unix timestamp in seconds")},nZ),Os=n.Object({from:eZ("Start of the query window as a Unix timestamp in milliseconds"),to:eZ("End of the query window as a Unix timestamp in milliseconds")},nMe);var jp="/v0/logs";var jL=["CRITICAL","ERROR","WARN","NOTICE","INFO","DEBUG","TRACE"];var tS=0,HL=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(jL,{description:"Log severity, normalized from the source severity into one of the fixed Tsuga levels (ordered `CRITICAL` to `TRACE`)."}),[ZJ]:n.Optional(n.String({description:"ID of the cluster this log was read from. Only set when the request spanned several clusters."}))},{additionalProperties:!0}),iZ=100,oMe="timestamp",iMe=n.Union([n.Literal(oMe)]),tu=n.Partial(n.Object({...Lr.properties,query:f({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:tS,description:"Result offset used when fetching additional log rows."}),startOffsets:n.Array(n.Number({minimum:tS}),{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 ${tS} for every cluster.`}),clusterId:f({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}),clusterIds:XE,sortBy:iMe,sortDirection:Le,useCanopy:n.Boolean()})),DMt=x({tags:["logs"],url:`${jp}/count`,method:"GET",query:n.Pick(tu,["from","to","query","clusterId","clusterIds","useCanopy"]),response:n.Object({count:n.Number(),clusterResponses:n.Optional(Of())})}),rS=n.Object({value:n.String(),priority:n.Number()}),FMt=x({tags:["logs"],url:`${jp}/search`,method:"GET",query:tu,response:n.Object({logs:n.Optional(n.Array(HL)),attributesToHighlight:n.Optional(n.Array(rS)),clusterResponses:n.Optional(Of(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})}),sMe=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"}),aMe=n.Object({id:n.String(),pattern:n.Array(sMe),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"}))}),$Mt=x({tags:["logs"],url:`${jp}/patterns`,method:"GET",query:n.Object({...Lr.properties,query:f({type:"tsuga-query"}),clusteringThreshold:n.Optional(n.Number()),clusterId:n.Optional(f({allowEmpty:!1})),useCanopy:n.Optional(n.Boolean())}),response:n.Object({patterns:n.Array(aMe),sampleSize:n.Number()})}),GMt=x({tags:["logs"],url:`${jp}/attributes`,method:"GET",query:n.Object({...Lr.properties,clusterId:n.Optional(f({allowEmpty:!1,description:"Cluster ID"})),clusterIds:n.Optional(XE),useCanopy:n.Optional(n.Boolean())}),response:n.Object({attributes:n.Array(n.String()),clusterResponses:n.Optional(Of())})});var sZ="timestamp";var oZ=`${sZ}_iso`;var cMe=["pending","running","completed","incomplete","failed"],aZ=n.Object({id:n.String({description:"ID of the export."}),status:n.Enum(cMe,{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."}))}),BMt=x({tags:["logs"],url:`${jp}/exports`,method:"POST",body:n.Object({...n.Pick(tu,["from","to","query","clusterId","clusterIds","sortBy","sortDirection"]).properties,columns:n.Array(f({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 \`${sZ}\` also writes a \`${oZ}\` column next to it, holding the same instant in ISO 8601.`}),timezone:n.Optional(n.String({format:Dp,description:`IANA timezone the \`${oZ}\` column is offset to (e.g. \`Europe/Paris\`). Defaults to UTC.`}))}),response:n.Object({...aZ.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."})})}),qMt=x({tags:["logs"],url:`${jp}/exports/:exportId`,method:"GET",params:n.Object({exportId:n.String()}),response:aZ}),jMt=x({tags:["logs"],url:`${jp}/exports/:exportId/download`,method:"GET",params:n.Object({exportId:n.String()}),query:n.Object({token:f({allowEmpty:!1,description:"Single-use token minted when the export was created."})}),response:n.String({description:"CSV file, streamed as it is produced."})});var Uc="/v0/metrics",lMe=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(jL)},{additionalProperties:!0}),WMt=x({tags:["metrics"],url:`${Uc}/count`,method:"GET",query:n.Pick(tu,["from","to","query","clusterId"]),response:n.Object({count:n.Number()})}),JMt=x({tags:["metrics"],url:`${Uc}/search`,method:"GET",query:tu,response:n.Object({logs:n.Optional(n.Array(lMe)),totalHits:n.Optional(n.Number()),attributesToHighlight:n.Optional(n.Array(rS))},{additionalProperties:!0})}),AO=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."}),OO=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."}),KL=["gauge","cumulative-counter","delta-counter","cumulative-histogram","delta-histogram","summary"],cZ=n.Enum(KL,{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."}),lZ=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."}),uZ=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."}),pZ=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."}),uMe=n.Record(n.String(),n.Number(),{description:"Estimated number of distinct values per attribute over the same window as `seriesCardinality`, keyed like `tags`."}),pMe=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(OO),type:n.Optional(AO),unit:n.Optional(n.String({description:"Metric unit reported by instrumentation or inferred metadata."})),lastSeen:n.Optional(lZ),teams:n.Optional(uZ),seriesCardinality:n.Optional(pZ),attributeCardinalities:n.Optional(uMe)}),ZMt=x({url:`${Uc}/metadata`,method:"GET",query:n.Object({...Lr.properties,metricName:f({allowEmpty:!1}),kind:n.Optional(cZ),clusterId:n.Optional(f({allowEmpty:!1,description:"Cluster ID"}))}),response:pMe}),XMt=x({tags:["metrics"],url:Uc,method:"GET",query:n.Object({...Lr.properties,clusterId:n.Optional(f({allowEmpty:!1,description:"Cluster ID"}))}),response:n.Array(n.String())}),mZ=n.Array(n.Object({name:n.String({description:"Metric name observed by Tsuga."}),kind:cZ,type:AO,temporality:n.Optional(OO),lastSeen:n.Optional(lZ),teams:n.Optional(uZ),seriesCardinality:n.Optional(pZ)}),{description:"Metric variants observed in the requested time range. A name appears once per kind it was reported as."}),mMe=[{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(mZ,{examples:[mMe]});var eDt=x({tags:["metrics"],url:`${Uc}/names-and-types`,method:"GET",query:n.Object({...Lr.properties,clusterId:n.Optional(f({allowEmpty:!1,description:"Cluster ID"}))}),response:mZ}),nS=n.Array(n.String(),{description:"Attribute names available as dimensions for filtering or grouping the requested metric(s)."}),dMe=["service","env","host","method","status_code"];Object.assign(nS,{examples:[dMe]});var tDt=x({tags:["metrics"],url:`${Uc}/attributes`,method:"GET",query:n.Object({...Lr.properties,metricName:f({allowEmpty:!1}),clusterId:n.Optional(f({allowEmpty:!1,description:"Cluster ID"}))}),response:nS}),rDt=x({tags:["metrics"],url:`${Uc}/attributes/batch`,method:"GET",query:n.Object({...Lr.properties,metricNames:n.Array(f({allowEmpty:!1}),{minItems:1,description:"Metric names to fetch attributes for"}),clusterId:n.Optional(f({allowEmpty:!1,description:"Cluster ID"}))}),response:nS}),zL=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."})}),nDt=x({tags:["metrics"],url:`${Uc}/assets-usage`,method:"GET",query:n.Object({metricName:f({allowEmpty:!1})}),response:zL}),oDt=x({url:`${Uc}/per-attribute`,method:"GET",query:n.Object({from:n.Optional(n.Number()),to:n.Optional(n.Number()),attribute:f(),clusterId:n.Optional(f({allowEmpty:!1}))}),response:n.Array(n.String())});var hMe="/v0/aggregation",yMe=n.Union([n.Literal("a"),n.Literal("d"),n.Literal("q"),n.Literal("w"),n.Literal("t")]),oS=n.Object({parallelism:n.Number(),engine:yMe,recordBatchCache:n.Optional(n.Boolean()),includeNullGroups:n.Optional(n.Boolean()),restartAwareGaugeSum:n.Optional(n.Boolean())}),YL=["logs","metrics","traces"];var gZ={logs:"Logs",metrics:"Metrics",traces:"Spans"},EMe=[...YL,"connections","log-patterns","spans","rum"];var hDt={...gZ,connections:"Connections","log-patterns":"Log Patterns",spans:"Spans",rum:"RUM events"},ya=[...YL,"rum"];var yDt={...gZ,rum:"RUM events"};var EDt=n.Enum(EMe,{description:"Data source being queried"}),SDt=n.Enum(YL,{description:"Telemetry source queried by this aggregation: `logs`, `metrics`, or `traces`."}),Ai=n.Enum(ya,{description:"Telemetry source queried by this aggregation: `logs`, `metrics`, `traces`, or `rum`."}),Hp=n.String({description:"Attribute containing the values to aggregate"}),Kp=f({description:"Attribute containing the values to aggregate"}),SMe=Q("type",[n.Object({type:n.Literal("count",{description:"Counts the total number of records"}),field:n.Optional(Hp)},{$id:"AggregateCount",title:"Count"}),n.Object({type:n.Literal("unique-count",{description:"Counts the distinct values of the field"}),field:Hp},{$id:"AggregateUniqueCount",title:"UniqueCount"}),n.Object({type:n.Literal("average",{description:"Calculates the average value of the selected field"}),field:Hp},{$id:"AggregateAverage",title:"Average"}),n.Object({type:n.Literal("max",{description:"Finds the largest value of the field"}),field:Hp},{$id:"AggregateMax",title:"Max"}),n.Object({type:n.Literal("min",{description:"Finds the smallest value of the field"}),field:Hp},{$id:"AggregateMin",title:"Min"}),n.Object({type:n.Literal("sum",{description:"Sums the values of the selected field"}),field:Hp},{$id:"AggregateSum",title:"Sum"}),n.Object({type:n.Literal("percentile",{description:"Calculates a percentile of the selected field"}),field:Hp,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`."}),TMe=Q("type",[n.Object({type:n.Literal("count",{description:"Counts the total number of records"}),field:n.Optional(Kp)},{$id:"InputAggregateCount",title:"Count"}),n.Object({type:n.Literal("unique-count",{description:"Counts the distinct values of the field"}),field:Kp},{$id:"InputAggregateUniqueCount",title:"UniqueCount"}),n.Object({type:n.Literal("average",{description:"Calculates the average value of the selected field"}),field:Kp},{$id:"InputAggregateAverage",title:"Average"}),n.Object({type:n.Literal("max",{description:"Finds the largest value of the field"}),field:Kp},{$id:"InputAggregateMax",title:"Max"}),n.Object({type:n.Literal("min",{description:"Finds the smallest value of the field"}),field:Kp},{$id:"InputAggregateMin",title:"Min"}),n.Object({type:n.Literal("sum",{description:"Sums the values of the selected field"}),field:Kp},{$id:"InputAggregateSum",title:"Sum"}),n.Object({type:n.Literal("percentile",{description:"Calculates a percentile of the selected field"}),field:Kp,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`."}),hZ=n.Object({type:n.Literal("per-second",{description:"Normalizes the metric to events per second"})},{$id:"FunctionPerSecond",title:"PerSecond"}),yZ=n.Object({type:n.Literal("per-minute",{description:"Normalizes the metric to events per minute"})},{$id:"FunctionPerMinute",title:"PerMinute"}),EZ=n.Object({type:n.Literal("per-hour",{description:"Normalizes the metric to events per hour"})},{$id:"FunctionPerHour",title:"PerHour"}),SZ=n.Object({type:n.Literal("rate",{description:"Calculates the rate of change"})},{$id:"FunctionRate",title:"Rate"}),TZ=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"}),bZ=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"}),xZ=n.Object({type:n.Literal("sqrt",{description:"Applies a square root transformation to the values"})},{$id:"FunctionSqrt",title:"Sqrt"}),IZ=n.Object({type:n.Literal("last",{description:"Takes the last value of the metric for the selected time frame"})},{$id:"FunctionLast",title:"Last"}),bMe=n.Object({type:n.Literal("rolling",{description:"Computes a rolling window aggregate"}),window:n.String({description:"Duration of the rolling window"})},{$id:"FunctionRolling",title:"Rolling"}),xMe=n.Object({type:n.Literal("rolling",{description:"Computes a rolling window aggregate"}),window:f({allowEmpty:!1,description:"Duration of the rolling window"})},{$id:"InputFunctionRolling",title:"Rolling"}),IMe=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"}),_Me=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"}),AMe=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"}),OMe=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"}),CMe=Q("type",[hZ,yZ,EZ,SZ,TZ,bMe,IMe,bZ,xZ,IZ,AMe],{title:"Function",description:"Post-processing function applied to an aggregation query result after the aggregate is computed, selected by `type`."}),RMe=Q("type",[hZ,yZ,EZ,SZ,TZ,xMe,_Me,bZ,xZ,IZ,OMe],{title:"InputFunction",description:"Post-processing function applied to an aggregation query result after the aggregate is computed, selected by `type`."});var dZ=n.Object({min:n.Number({description:"Lower bound of the distribution range."}),max:n.Number({description:"Upper bound of the distribution range."})}),PMe=["linear","log"],CO=n.Enum(PMe,{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."}),fZ=n.Integer({minimum:1}),wMe=Q("type",[n.Object({type:n.Literal("scalar")},{title:"Scalar",description:"Returns a single value"}),n.Object({type:n.Literal("timeseries"),aggregationWindow:f({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(f()),bucketCount:n.Optional(fZ),bounds:n.Optional(dZ),boundsScale:n.Optional(CO),percentiles:n.Optional(n.Array(n.Number({minimum:0,maximum:100,multipleOf:1}),{minItems:1}))},{title:"Histogram",description:"Returns a single distribution over the entire time range"}),n.Object({type:n.Literal("heatmap"),aggregationWindow:f({description:'Time bucket size for the heatmap (e.g. "10s", "60s", "1m")'}),by:n.Optional(f()),bucketCount:n.Optional(fZ),bounds:n.Optional(dZ)},{title:"Heatmap",description:"Returns a distribution per time window"})]),iS=15,vMe=["zero","null"],UMe=n.Enum(vMe,{description:"`zero` fills missing points with zero. `null` keeps missing points null."}),_Z=n.Object({mode:n.Object({type:UMe},{description:"How missing aggregation points should be filled."})},{description:"Missing-point fill behavior for aggregation results. Optional; omit to keep missing points null."}),NMe=["avg","sum","min","max","last"],AZ=n.Enum(NMe,{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`, `last`, or `rolling` function is present. When omitted, Tsuga derives the rollup from the metric type."});var OZ=n.Enum(KL,{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."}),CZ={aggregate:SMe,functions:n.Optional(n.Array(CMe,{description:"Post-processing functions applied to aggregation results"})),fill:n.Optional(_Z),timeAggregate:n.Optional(AZ),metricKind:n.Optional(OZ)},RZ={aggregate:TMe,functions:n.Optional(n.Array(RMe,{maxItems:10,description:"Post-processing functions applied to aggregation results. Defaults to an empty array when omitted."})),fill:n.Optional(_Z),timeAggregate:n.Optional(AZ),metricKind:n.Optional(OZ)},kMe={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."},PZ={minItems:1,maxItems:iS,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").'},wZ=n.Array(n.Object({...CZ,filter:n.Optional(n.String({description:"Filter to apply to the aggregation"}))},{title:"AggregationQuery"}),kMe),sS=n.Array(n.Object({...RZ,filter:n.Optional(f({type:"tsuga-query",description:"Tsuga query filter to apply to the aggregation. Defaults to an empty string when omitted."}))},{title:"AggregationQuery"}),PZ),Nc=n.Array(n.Object({...CZ,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."}),ru=n.Array(n.Object({...RZ,filter:f({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."}),{...PZ,description:"Aggregation queries used by alerting. Each query is referenced from formulas as q1, q2, and so on."}),vZ=n.Array(n.Omit(ru.items,["fill"],{title:"SloAggregationQuery",description:"Single aggregation query evaluated by an SLO."}),{minItems:1,maxItems:iS,description:"Aggregation queries used by SLO evaluation. Each query is referenced from formulas as q1, q2, and so on."});var RO=n.String({description:"Formula referencing submitted query outputs, such as `q1 + q2`. References must be within `q1` through `qN` for the submitted queries."}),zp=f({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."}),LMe=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(Le),replaceNullWith:n.Optional(n.String({description:"Value used to group documents that have no value for a grouped field."}))},{title:"AggregationGroupBy"}),MMe=n.Object({fields:n.Array(f(),{maxItems:1,description:"Telemetry attribute name to group aggregation results by. Currently limited to one field per grouping level."}),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(Le),replaceNullWith:n.Optional(f({allowEmpty:!1,description:"Value used to group documents that have no value for a grouped field."}))},{title:"AggregationGroupBy"}),UZ=7;var Rf=n.Array(LMe,{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."}),kc=n.Array(MMe,{maxItems:UZ,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 TDt=x({tags:["aggregation"],url:`${hMe}/multi-query`,method:"POST",body:n.Object({timeRange:Os,queries:sS,groupBy:n.Optional(kc),returnType:wMe,dataSource:Ai,formula:zp,executionOptions:oS,triggeredBy:n.Optional(n.Literal("refresh")),shouldStreamResults:n.Optional(n.Boolean()),clusterId:n.Optional(f({allowEmpty:!1})),clusterIds:n.Optional(XE),viewAs:n.Optional(n.Object({owner:f({allowEmpty:!1,description:"Team ID to fetch data as"}),permissions:As}))}),response:Cf});var NZ=`/${"v1"}/aggregation`,kZ=n.Object({id:n.String({description:"Result identifier. Query results use `q1`, `q2`, and so on; formula results use `formula`."}),group:n.Record(n.String(),n.Union([n.String(),n.Number()]),{description:"Group-by field values for this result. Empty when no group-by is requested."})}),LZ=n.Object({results:n.Array(n.Object({...kZ.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."}),DMe={results:[{id:"q1",group:{host:"server-1"},value:123.45}]};Object.assign(LZ,{examples:[DMe]});var PO=n.Object({series:n.Array(n.Object({...kZ.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."}),FMe={series:[{id:"q1",group:{host:"server-1"},points:[{timestamp:16094592e5,value:123.45},{timestamp:160945926e4,value:456.78}]}]};Object.assign(PO,{examples:[FMe]});var $Me=n.Omit(sS.items,["fill"],{title:"AggregationQuery",description:"Aggregation query. Omit `filter` for an unfiltered query and omit `functions` when no post-processing is needed."}),GMe=n.Optional(kc),MZ={timeRange:Yr,queries:n.Array($Me,{maxItems:iS,description:`Aggregations that may be combined together in the same query. Each item is referenced from \`formula\` as q1, q2, and so on, in submission order. Limited to ${iS} items. For dataSource "metrics", each aggregate's \`field\` is the metric name, not an attribute; to count distinct values of an attribute use unique-count with field "<metricName>.context.<attribute>" (e.g. "system.cpu.utilization.context.host.name").`}),groupBy:GMe,dataSource:Ai,formula:n.Optional(zp)},Ea=n.Object({clusterId:n.Optional(f({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))}),DZ=n.Object(MZ,{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."}),BMe={timeRange:{from:1782201500,to:1782203400},dataSource:"logs",queries:[{aggregate:{type:"count"},filter:"context.service.name:checkout"}],groupBy:[{fields:["level"],limit:5}]};Object.assign(DZ,{examples:[BMe]});var FZ=x({description:"Runs one or more aggregation queries over logs, metrics, traces, or RUM events and returns scalar values. Use optional group-by and formula fields to compute grouped or derived results. See [Analytics queries](/documentation/visualize/analytics/queries).",operationId:"aggregateScalar",tags:["public","aggregation"],url:`${NZ}/multi-query/scalar`,method:"POST",body:DZ,query:Ea,response:LZ}),$Z=n.Object({...MZ,aggregationWindow:f({description:"Time bucket size for timeseries aggregation, such as `10s`, `1m`, or `1h`."})},{description:"Timeseries aggregation request. Provide a time range, bucket size, one or more queries, a telemetry data source, and optional grouping or formula. Omit `groupBy` for ungrouped series. Send `clusterId` as a query parameter, not in the JSON body."}),qMe={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($Z,{examples:[qMe]});var GZ=x({description:"Runs one or more aggregation queries over logs, metrics, traces, or RUM events and returns timestamped series. Use `aggregationWindow` to choose the time bucket size. See [Analytics queries](/documentation/visualize/analytics/queries).",operationId:"aggregateTimeseries",tags:["public","aggregation"],url:`${NZ}/multi-query/timeseries`,method:"POST",body:$Z,query:Ea,response:PO});var jMe="x-tsuga-session-id",VL="x-tsuga-source",QL="x-tsuga-source-version",WL="x-tsuga-source-commit",JL="x-tsuga-source-date",ZL="x-tsuga-rationale",HMe="x-tsuga-dashboard-id",KMe="x-tsuga-widget-id",zMe="x-request-id",wDt={[jMe]:"Session identifier for request correlation",[VL]:"SDK or client source identifier (e.g., web-frontend, terraform-provider)",[QL]:"SDK version",[WL]:"SDK commit hash",[JL]:"SDK commit date",[ZL]:"Optional caller-supplied rationale for this request, recorded for telemetry",[HMe]:"ID of the dashboard a query is issued from, when the request originates from a dashboard widget",[KMe]:"ID of the dashboard widget (graph) a query is issued from, when the request originates from a dashboard widget",[zMe]:"Unique identifier for this API request, useful for debugging and support"};var YMe=["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS","TRACE"],BZ=D("api.buildRequest")(function*(e,t,r,o,i){let{body:s,params:a,query:c}=o,l=r.url??(r.buildUrl&&a?r.buildUrl(a):void 0),m=YMe.find(y=>y===r.method);return l===void 0||m===void 0?yield*new _s({message:`Internal error: endpoint ${r.operationId??r.method} is not callable`}):Z_(m)(eJ(`${e}${l}`,c),{headers:{Accept:"application/json",[VL]:t,[QL]:"1.52.0",[WL]:"a512c6068f",[JL]:"2026-10-01T08:53:58.513Z",...i},...s?{body:c0(s)}:{}})});var VMe=["allowed-domains","audit-log-stream-destination","billing","cluster-integration-config","custom-role","custom-usage-tag","database","databricks-connection","explorer-saved-view","github-connection","host","inventory","llm-provider","monitor-alert","monitor-debugging","oauth-grant","org","retention-policy","saml-config","sensitive-data-scanner-rule","service","service-target","team-remap-config","user-self","widget-share"],QMe=["adaptive-notification-rule","audit-log","cloud-account","dashboard-folder","dashboard-report","dashboard-share","dashboard","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","tag-policy","team-members","team","user-data","user-invitation","user-permissions"],WMe=["log","metric","trace","rum"],XL=[...QMe,...WMe],GDt=[...VMe,...XL];var vO=["admin","public_editor","public_viewer","teams_only"],UO=[...vO,"custom"],Vi=["admin","editor","viewer"];var Yp="/v0/team-membership",eM="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.",tM=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(Vi,{description:eM})}),qZ=n.Object({userId:f({allowEmpty:!1,description:"User ID to add to or update in the team."}),teamId:f({allowEmpty:!1,description:"Team ID receiving the membership change."}),roleKey:n.Enum(Vi,{description:eM})}),JMe=n.Object({userId:f({allowEmpty:!1,description:"User ID to remove from the team."}),teamId:f({allowEmpty:!1,description:"Team ID to remove the user from."})}),ZMe=n.Optional(n.Object({userId:n.Optional(f({allowEmpty:!1,description:"Restrict results to memberships for this user ID."})),teamId:n.Optional(f({allowEmpty:!1,description:"Restrict results to memberships for this team ID."}))})),BDt=x({tags:["access-control"],url:Yp,method:"GET",query:ZMe,response:n.Array(tM)}),qDt=x({tags:["access-control"],url:Yp,method:"POST",body:qZ,response:tM}),jDt=x({tags:["access-control"],url:Yp,method:"PUT",body:qZ,response:tM}),HDt=x({tags:["access-control"],url:Yp,method:"DELETE",body:JMe,response:ae}),wO=500,jZ=n.Object({teamId:f({allowEmpty:!1,description:"Team ID receiving all requested memberships."}),members:n.Array(n.Object({userId:n.Optional(f({allowEmpty:!1,description:"Existing user ID to add to the team."})),userEmail:n.Optional(f({allowEmpty:!1,type:"email",description:"Existing user email to resolve and add to the team."})),roleKey:n.Enum(Vi,{description:eM})},{oneOf:[{required:["userId"]},{required:["userEmail"]}]}),{minItems:1,maxItems:wO,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."}),XMe={teamId:"team-123-abc",members:[{userId:"user-123-abc",roleKey:"viewer"},{userEmail:"sam@example.com",roleKey:"editor"}]};Object.assign(jZ,{examples:[XMe]});var HZ=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."}),eDe={results:[{userId:"user-123-abc",status:"added"},{userId:"sam@example.com",status:"user_not_found"}]};Object.assign(HZ,{examples:[eDe]});var KDt=x({tags:["access-control"],url:`${Yp}/bulk-add`,method:"POST",body:jZ,response:HZ}),zDt=x({tags:["access-control"],url:`${Yp}/bulk-update-user-roles`,method:"PUT",body:n.Object({userIds:n.Array(f({allowEmpty:!1}),{minItems:1,maxItems:wO}),teamId:f({allowEmpty:!1}),role:n.Enum(Vi)}),response:n.Object({})}),KZ=n.Object({teamId:f({allowEmpty:!1,description:"Team ID to remove the requested users from."}),userIds:n.Optional(n.Array(f({allowEmpty:!1}),{minItems:1,maxItems:wO,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(f({allowEmpty:!1,type:"email"}),{minItems:1,maxItems:wO,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."}),tDe={teamId:"team-123-abc",userIds:["user-123-abc"]};Object.assign(KZ,{examples:[tDe]});var zZ=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."}),rDe={results:[{userId:"user-123-abc",status:"removed"},{userId:"missing@example.com",status:"user_not_found"}]};Object.assign(zZ,{examples:[rDe]});var YDt=x({tags:["access-control"],url:`${Yp}/bulk-remove`,method:"DELETE",body:KZ,response:zZ});var nDe={"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:["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"]},"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"]},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:[]},"sensitive-data-scanner-rule":{read:["public_viewer","public_editor","admin"],write:["admin"]},slo:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"retention-policy":{read:["public_viewer","public_editor","admin"],write:["admin"]},"databricks-connection":{read:["public_viewer","public_editor","admin"],write:["admin"]},service:{read:["public_viewer","public_editor","admin"],write:[]},"service-target":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},host:{read:["public_viewer","public_editor","admin"],write:[]},database:{read:["public_viewer","public_editor","admin"],write:[]},"tag-policy":{read:["public_viewer","public_editor","admin"],write:["admin"]},team:{read:["public_viewer","public_editor","admin"],write:["admin"]},"team-members":{read:["public_viewer","public_editor","admin"],write:["admin"]},"team-remap-config":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-data":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-invitation":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-permissions":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-self":{read:["public_viewer","public_editor","admin"],write:["public_viewer","public_editor","admin"]},"oauth-grant":{read:[],write:[]}},oDe={"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:[],write:[]},"custom-usage-tag":{read:[],write:[]},"cluster-integration-config":{read:[],write:[]},"explorer-saved-view":{read:["viewer","editor","admin"],write:["viewer","editor","admin"]},"operation-api-key":{read:["viewer","editor","admin"],write:["admin"]},"cloud-account":{read:["viewer","editor","admin"],write:[]},dashboard:{read:["viewer","editor","admin"],write:["editor","admin"]},"dashboard-folder":{read:["viewer","editor","admin"],write:["editor","admin"]},"dashboard-report":{read:["viewer","editor","admin"],write:["editor","admin"]},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"]},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:[]},"sensitive-data-scanner-rule":{read:["viewer","editor","admin"],write:[]},slo:{read:["viewer","editor","admin"],write:["editor","admin"]},"retention-policy":{read:[],write:[]},"databricks-connection":{read:[],write:[]},service:{read:["viewer","editor","admin"],write:[]},"service-target":{read:["viewer","editor","admin"],write:["editor","admin"]},host:{read:["viewer","editor","admin"],write:[]},database:{read:["viewer","editor","admin"],write:[]},"tag-policy":{read:[],write:[]},team:{read:["viewer","editor","admin"],write:["admin"]},"team-members":{read:["viewer","editor","admin"],write:["admin"]},"team-remap-config":{read:[],write:[]},"user-data":{read:["viewer","editor","admin"],write:["admin"]},"user-invitation":{read:["viewer","editor","admin"],write:["admin"]},"user-permissions":{read:["viewer","editor","admin"],write:[]},"user-self":{read:["viewer","editor","admin"],write:["viewer","editor","admin"]},"oauth-grant":{read:[],write:[]}},iDe={user:nDe,team:oDe};function rM(e){return YZ(e,"team")}function nM(e){return YZ(e,"user")}function YZ(e,t){let r=[],o=iDe[t];for(let[i,s]of Object.entries(o))for(let[a,c]of Object.entries(s))c.includes(e)&&r.push({actionType:a,resourceType:i});return r}var XDt={admin:{name:"Global admin",description:"Full control across the organization. Can view and modify everything, including private teams.",permissions:nM("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:nM("public_editor"),roleKey:"public_editor"},public_viewer:{name:"Public viewer",description:"Read-only access to public team data. Cannot make changes.",permissions:nM("public_viewer"),roleKey:"public_viewer"},teams_only:{name:"Teams only",description:"Only access data and assets in their own teams.",permissions:[],roleKey:"teams_only"}},eFt={admin:{name:"Team admin",description:"Full team control, manage assets, members, and settings.",permissions:rM("admin"),roleKey:"admin"},editor:{name:"Team editor",description:"Can view and update most assets (like dashboards, monitors).",permissions:rM("editor"),roleKey:"editor"},viewer:{name:"Team viewer",description:"Can view all team data but cannot make changes.",permissions:rM("viewer"),roleKey:"viewer"}};var tFt=new Set(XL);var sDe={documentation:void 0,investigations:"investigation",logs:"log",metrics:"metric","team-membership":"team-members",traces:"trace",user:"user-data","allowed-domains":"allowed-domains",billing:"billing","cloud-account":"cloud-account","custom-usage-tag":"custom-usage-tag",dashboard:"dashboard","dashboard-folder":"dashboard-folder","ingestion-api-key":"ingestion-api-key",inventory:"inventory","log-route":"log-route","metric-route":"metric-route",monitor:"monitor","notification-integration":"notification-integration","notification-rule":"notification-rule","notification-silence":"notification-silence","quality-report":"quality-report","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"},aDe=Object.entries(sDe),rFt=new Map(aDe.flatMap(([e,t])=>t?[[t,e]]:[]));var Se="context";var VZ="trace_id",NO=`${Se}.team`,oFt=`${Se}.env`,iFt=`${Se}.api_key_id`,kO=`${Se}.service.name`,sFt=`${Se}.service.version`,LO=`${Se}.span.kind`,MO=`${Se}.span.name`,nu=`${Se}.status.code`,aFt=`${Se}.stack_trace`,cDe="STATUS_CODE_ERROR",cFt=`${nu}:${cDe}`,oM="resource.attributes.team",QZ=["SPAN_KIND_UNSPECIFIED","SPAN_KIND_INTERNAL","SPAN_KIND_SERVER","SPAN_KIND_CLIENT","SPAN_KIND_PRODUCER","SPAN_KIND_CONSUMER"];var aS=`${Se}.host.name`,lDe=`${Se}.instance`,uDe=`${Se}.instanceid`,pDe=`${Se}.instance_name`,lFt=`${Se}.telemetry.sdk.language`,uFt=`${Se}.process.runtime.name`,pFt=`${Se}.scope.name`,mFt=`${Se}.page.id`,dFt=`${Se}.app.name`,fFt=`${Se}.page.attributes.view_id`,gFt=`${Se}.cloud.provider`,hFt=`${Se}.cloud.platform`,yFt=`${Se}.aws.ecs.task.arn`,EFt=`${Se}.aws.ecs.task.id`,SFt=`${Se}.aws.ecs.cluster.arn`,TFt=`${Se}.faas.name`,bFt=`${Se}.faas.invoked_provider`,xFt=`${Se}.gcp.label.service_name`,IFt=`${Se}.k8s.cluster.name`,_Ft=`${Se}.k8s.cluster.uid`,AFt=`${Se}.k8s.namespace.name`,mDe=`${Se}.k8s.pod.name`,OFt=`${Se}.k8s.pod.uid`,CFt=`${Se}.k8s.container.name`,RFt=`${Se}.k8s.node.name`,PFt=`${Se}.k8s.node.uid`,dDe=`${Se}.k8s.deployment.name`,wFt=`${Se}.k8s.deployment.uid`,fDe=`${Se}.k8s.replicaset.name`,vFt=`${Se}.k8s.replicaset.uid`,gDe=`${Se}.k8s.statefulset.name`,UFt=`${Se}.k8s.statefulset.uid`,hDe=`${Se}.k8s.daemonset.name`,NFt=`${Se}.k8s.daemonset.uid`,kFt=`${Se}.k8s.job.name`,LFt=`${Se}.k8s.job.uid`,MFt=`${Se}.k8s.cronjob.name`,DFt=`${Se}.k8s.cronjob.uid`,Pf="status_code",DO="span.name";var FO="span.kind";var yDe="db.system.name",EDe="db.system",SDe="db.namespace",TDe="db.name";var FFt=`span_attributes.${SDe}`,$Ft=`span_attributes.${TDe}`,GFt=`span_attributes.${yDe}`,BFt=`span_attributes.${EDe}`;var qFt={name:"tsuga.internal.processing_tag_policy_violations_total",attributes:{tagPolicyId:`${Se}.tag_policy_id`,dataSource:`${Se}.data_source`,sourceTeam:`${Se}.source_team`}};var jFt={name:"tsuga.internal.event_size_bytes",attributes:{batchKind:`${Se}.batch_kind`,batchKindMetricsFilter:`${Se}.batch_kind:metrics`,sourceApiKeyId:`${Se}.source_api_key_id`,sourceEnv:`${Se}.source_env`,sourceTeam:`${Se}.source_team`}};var iM="__tsuga_metadata__",HFt=`${iM}.signature`,KFt=`${iM}.routes`,zFt=`${iM}.trace_id_bucket`;var XFt=[Pf,nu,nu.replace(`${Se}.`,"")];var sM=["red","orange","amber","yellow","green","emerald","teal","cyan","sky","blue","indigo","purple","pink"],aM=["light","dark"];var bDe={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)"}},WZ=["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 i1t=bDe.light.red.background;var JZ=2,ZZ=2;var XZ=[{key:"amex15_digits",name:"American Express card (1x15 digits)",category:"financial-data",example:"378282246310005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"amex4443_digits",name:"American Express card (4+4+4+3 digits)",category:"financial-data",example:"3782 8224 6310 005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"amex465_digits",name:"American Express card (4+6+5 digits)",category:"financial-data",example:"3782 822463 10005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"amex87_digits",name:"American Express card (8+7 digits)",category:"financial-data",example:"37828224 6310005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card14_digits",name:"Diners card (1x14 digits)",category:"financial-data",example:"30569309025904",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card4442_digits",name:"Diners card (4+4+4+2 digits)",category:"financial-data",example:"3056 9309 0259 04",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card464_digits",name:"Diners card (4+6+4 digits)",category:"financial-data",example:"3056 930902 5904",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card86_digits",name:"Diners card (8+6 digits)",category:"financial-data",example:"30569309 025904",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"discover_card16_digits",name:"Discover card (1x16 digits)",category:"financial-data",example:"6011111111111117",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"discover_card88_digits",name:"Discover card (2x8 digits)",category:"financial-data",example:"60111111 11111117",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"discover_card4444_digits",name:"Discover card (4x4 digits)",category:"financial-data",example:"6011 1111 1111 1117",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"jcb_card16_digits",name:"JCB card (1x16 digits)",category:"financial-data",example:"3530111333300000",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"jcb_card88_digits",name:"JCB card (2x8 digits)",category:"financial-data",example:"35301113 33300000",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"jcb_card4444_digits",name:"JCB card (4x4 digits)",category:"financial-data",example:"3530 1113 3330 0000",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"maestro_card16_digits",name:"Maestro card (1x16 digits)",category:"financial-data",example:"6759649826438453",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"maestro_card88_digits",name:"Maestro card (2x8 digits)",category:"financial-data",example:"67596498 26438453",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"maestro_card4444_digits",name:"Maestro card (4x4 digits)",category:"financial-data",example:"6759 6498 2643 8453",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"mastercard16_digits",name:"Mastercard (1x16 digits)",category:"financial-data",example:"5555555555554444",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"mastercard88_digits",name:"MasterCard (2x8 digits)",category:"financial-data",example:"55555555 55554444",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"mastercard4444_digits",name:"MasterCard (4x4 digits)",category:"financial-data",example:"5555 5555 5555 4444",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa16_digits",name:"Visa (1x16 digits)",category:"financial-data",example:"4111111111111111",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa19_digits",name:"Visa (1x19 digits)",category:"financial-data",example:"4111111111111111151",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa88_digits",name:"Visa (2x8 digits)",category:"financial-data",example:"41111111 11111111",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa883_digits",name:"Visa (8+8+3 digits)",category:"financial-data",example:"41111111 11111111 151",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa4444_digits",name:"Visa (4x4 digits)",category:"financial-data",example:"4111 1111 1111 1111",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa44443_digits",name:"Visa (4+4+4+4+3 digits)",category:"financial-data",example:"4111 1111 1111 1111 151",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"dropbox_long_lived_api_token",name:"Dropbox long lived API token",category:"credential",example:"767cb868836AAAAAAAAAAszri2cnmzu5tr0yf-nvclmwfyiswl67qyqw-uzn-scg",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:[a-z0-9]{11}(AAAAAAAAAA)[a-z0-9\\-_=]{43})"},{key:"dropbox_short_lived_api_token",name:"Dropbox short lived API token",category:"credential",example:"sl.nu0yvsrposcjeyjcpmbfrmqygllrxpahrgbt8flml9xroifbic",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:sl\\.[a-z0-9\\-=_]{50})"},{key:"french_nirpp",name:"French social security number (NIRPP)",category:"personal-information",example:"188073512757119",isUsingLuhnAlgorithm:!1,regexp:"([12])\\s*[0-9]{2}\\s*(0[1-9]|1[0-2])\\s*(2[AB]|[0-9]{2})\\s*([0-9]{3})\\s*([0-9]{3})(\\s*[0-9]{2})?"},{key:"ip_address",name:"IP address",category:"device-identifier",example:"81.55.13.53",isUsingLuhnAlgorithm:!1,regexp:""},{key:"social_security_number",name:"Social security number (XXX-XX-XXXX)",category:"personal-information",example:"437-02-2223",isUsingLuhnAlgorithm:!1,regexp:"(?x)(?-u:\\b)(?:00[1-9]|0[1-9][0-9]|[1-578][0-9]{2}|6[0-57-9][0-9]|66[0-57-9])-(?:0[1-9]|[1-9]0|[1-9][1-9])-(?:000[1-9]|00[1-9]0|0[1-9]00|[1-9]000|[1-9]{4})(?-u:\\b)"},{key:"social_security_number_space",name:"Social security number (XXX XX XXXX)",category:"personal-information",example:"437 02 2223",isUsingLuhnAlgorithm:!1,regexp:"(?x)(?-u:\\b)(?:00[1-9]|0[1-9][0-9]|[1-578][0-9]{2}|6[0-57-9][0-9]|66[0-57-9])\\s+(?:0[1-9]|[1-9]0|[1-9][1-9])\\s+(?:000[1-9]|00[1-9]0|0[1-9]00|[1-9]000|[1-9]{4})(?-u:\\b)"},{key:"social_security_number_digits",name:"Social security number (9 digits)",category:"personal-information",example:"437022223",isUsingLuhnAlgorithm:!1,regexp:"(?x)(?-u:\\b)(?:00[1-9]|0[1-9][0-9]|[1-578][0-9]{2}|6[0-57-9][0-9]|66[0-57-9])(?:0[1-9]|[1-9]0|[1-9][1-9])(?:000[1-9]|00[1-9]0|0[1-9]00|[1-9]000|[1-9]{4})(?-u:\\b)"},{key:"email",name:"Email",category:"credential",example:"admin@tsuga.com",isUsingLuhnAlgorithm:!1,regexp:"[a-zA-Z0-9-_.]*[a-zA-Z0-9_](@[a-zA-Z0-9_]+)(\\.[a-zA-Z0-9_]+(\\.[a-zA-Z0-9_]+)?[a-zA-Z])(?-u:\\b)"},{key:"one_password_secret_key",name:"1Password secret key",category:"credential",example:"A3-O28NKC-F58GULWCN72-4NIKS-KGY7V-U7FAT",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)A3-[A-Z0-9]{6}-(?:(?:[A-Z0-9]{11})|(?:[A-Z0-9]{6}-[A-Z0-9]{5}))-[A-Z0-9]{5}-[A-Z0-9]{5}-[A-Z0-9]{5}(?-u:\\b)"},{key:"one_password_service_account_token",name:"1Password service account token",category:"credential",example:"ops_eyJdAZ/FoIyz0jAXpEQOrRdIE8ydVaYfAXeZXGFqHWfBOjnE/Vgf5kHIbwrNAp2WeFNPeFiVJPlLv1hmaTVums0ldq1Kv8JEglMqP3f0ATBuX/WRbKqXYS3Z1wSzxg6S0krW4df7ZplvK04+JhJimejyTEH5dYaxqsYDBSLxjeEq7JWsmHEuXj6WP5qQi7FB+5s+CwhWPWY/jDhUMB3fdowXbfv5VnWri3iYrfBh+bFeRe9KURhXGHRDE9hgs",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ops_eyJ[a-zA-Z0-9+/]{50}"},{key:"adafruit_api_key",name:"Adafruit API key",category:"credential",example:"jb9pb4unb2bhe7xqepmgwtl2jg7ti101",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{32})"},{key:"adobe_client_id",name:"Adobe client ID",category:"credential",example:"c4166853dfd2897ebe706d49ef13fe63",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"adobe_client_secret",name:"Adobe client secret",category:"credential",example:"p8e-bb6e1614324ae48e507d33af176db3b7",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:p8e-[a-z0-9]{32})"},{key:"age_secret_key",name:"Age secret key",category:"credential",example:"AGE-SECRET-KEY-1QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)AGE-SECRET-KEY-1[QPZRY9X8GF2TVDW0S3JN54KHCE6MUA7L]{58}"},{key:"airtable_api_key",name:"Airtable API key",category:"credential",example:"19b73hbi0tc5cdy4w",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{17})"},{key:"algolia_api_key",name:"Algolia API key",category:"credential",example:"346155deb68d31c4018d73de73452947",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"alibaba_access_key_id",name:"Alibaba Cloud AccessKey ID",category:"credential",example:"LTAI7cc6804e4c2155cd52bd",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:LTAI[a-z0-9]{20})"},{key:"alibaba_secret_key",name:"Alibaba Cloud secret key",category:"credential",example:"suwixirhh10xhnko9bv0vfg2971u9p",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{30})"},{key:"anthropic_admin_api_key",name:"Anthropic admin API key",category:"credential",example:"sk-ant-admin01-abc12fake-456def789ghij-klmnopqrstuvwx-3456yza789bcde-12fakehijklmnopby56aaaogaopaaaabc123xyzAA",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sk-ant-admin01-[a-zA-Z0-9_-]{93}AA)"},{key:"anthropic_api_key",name:"Anthropic API key",category:"credential",example:"sk-ant-api03-abc123xyz-456def789ghij-klmnopqrstuvwx-3456yza789bcde-1234fghijklmnopby56aaaogaopaaaabc123xyzAA",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sk-ant-api03-[a-zA-Z0-9_-]{93}AA)"},{key:"artifactory_api_key",name:"Artifactory API key",category:"credential",example:"AKCpt771klpkqllt647fdf36fq43radbz2w2nyetvx4l90qyeef8kbgkmke63ul5vf6mqsy82",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)AKCp[A-Za-z0-9]{69}(?-u:\\b)"},{key:"artifactory_reference_token",name:"Artifactory reference token",category:"credential",example:"cmVmdc6i6888t9viuobfd88e46pdonjjsvmme6np82qti7wzbj7l9m1ygtyl9wik",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)cmVmd[A-Za-z0-9]{59}(?-u:\\b)"},{key:"asana_client_id",name:"Asana client ID",category:"credential",example:"9760134337886314",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9]{16})"},{key:"asana_client_secret",name:"Asana client secret",category:"credential",example:"tcnc8mjrf5bad359nnz3j1z90gow67ji",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"atlassian_api_token",name:"Atlassian API token",category:"credential",example:"fdo4scsa4kh53jnenkfp5fbe",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:[a-z0-9]{20}[a-f0-9]{4})|(?-u:\\b)(?:ATATT3[A-Za-z0-9_-=]{50})"},{key:"authress_service_client_access_key",name:"Authress service client access key",category:"credential",example:"sc_scmz00n9xj.0ykp.acc_2k5vtnrec4.55vc9459s-gc5qlia7a67jvzm0bobn3g0ezimd3b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:sc|ext|scauth|authress)_[a-z0-9]{5,30}\\.[a-z0-9]{4,6}\\.(?-i:acc)[_-][a-z0-9-]{10,32}\\.[a-z0-9+/_=-]{30})"},{key:"aws_access_token",name:"AWS access token",category:"credential",example:"AKIALALEMEL33243OLIB",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:A3T[A-Z0-9]|AKIA|ASIA|ABIA|ACCA)[A-Z2-7]{16})(?-u:\\b)"},{key:"azure_ad_client_secret",name:"Azure AD client secret",category:"credential",example:"bP88Q~rcBcYjzzOhg1Hnn76Wm3jGgakZiZ.8vMgR",isUsingLuhnAlgorithm:!1,regexp:"(?:^|[\\\\'\"` \\r\\n\\t\\f\\v>=:(?:,)])(?:[a-zA-Z0-9_~.]{3}[0-9]Q~[a-zA-Z0-9_~.-]{31,34})(?:$|[\\\\'\"` \\r\\n\\t\\f\\v<),])"},{key:"bitbucket_client_id",name:"Bitbucket client ID",category:"credential",example:"yyxmjnl3kahirvct7sat2082pzqdyf09",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"bitbucket_client_secret",name:"Bitbucket client secret",category:"credential",example:"fylw1pominwz91e5guqjiugw6srutpl64vzch5rnt8xnt31ka7so9va73fscz836",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{64})"},{key:"beamer_api_token",name:"Beamer API token",category:"credential",example:"b_zhy-phuoqk13asco6az4u_0yhtklgswm4umkv95nv4gu",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:b_[a-z0-9=_\\-]{44})"},{key:"codecov_access_token",name:"Codecov access token",category:"credential",example:"r93iopllonuphk41qglet20y8cb83thm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"clickhouse_cloud_api_secret_key",name:"ClickHouse Cloud API secret key",category:"credential",example:"4b1dbRdW3rOcB7xLthrM4BTBGK1qPLkHigpN1bXD6z",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:4b1d[A-Za-z0-9]{38})(?-u:\\b)"},{key:"clojars_api_token",name:"Clojars API token",category:"credential",example:"CLOJARS_d1vd7t0blxaarzx25dxoda4hm5ox86st6o5ww7tnzsfz07wvu223bf0fmgim",isUsingLuhnAlgorithm:!1,regexp:"CLOJARS_[a-z0-9]{60}"},{key:"cloudflare_api_key",name:"Cloudflare API key",category:"credential",example:"ckg0h_dzkxnl627gy3nskpq9wzm4d5hc_vxk272h",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{40})"},{key:"cloudflare_global_api_key",name:"Cloudflare global API key",category:"credential",example:"1d003bb65ec73ad2691fb76631b6496e3c9d9",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{37})"},{key:"cloudflare_origin_ca_key",name:"Cloudflare Origin CA key",category:"credential",example:"v1.0-aaa334dc886f30631ba0a610-0d98ef66290d7e50aac7c27b5986c99e6f3f1084c881d8ac0eae5de1d1aa0644076ff57022069b3237d19afe60ad045f207ef2b16387ee37b749441b2ae2e9ebe5b4606e846475d4a5",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:v1\\.0-[a-f0-9]{24}-[a-f0-9]{50})"},{key:"cohere_api_token",name:"Cohere API token",category:"credential",example:"lpn59BQ4FNUabVJh1vCpIqZpQbaViELQrTa14p9D",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:[a-zA-Z0-9]{40})"},{key:"confluent_access_token",name:"Confluent access token",category:"credential",example:"kkat92sclkukwvr2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{16})"},{key:"confluent_secret_key",name:"Confluent secret key",category:"credential",example:"64d4ppp37l9fjhadm8vv0awie6wjo4d6ourfcqvi2bcs2tm95x4f0e8gyb8z8usj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"contentful_delivery_api_token",name:"Contentful delivery API token",category:"credential",example:"eumospigka64wiwpavfmmblrq7x1hm6gz84wiiw2ff3",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{43})"},{key:"curl_auth_header",name:"Curl authorization header",category:"credential",example:"curl --header 'Authorization: 5eb4223e-5008-46e5-be67-c7b8f2732305'",isUsingLuhnAlgorithm:!1,regexp:`(?-u:\\b)curl(?-u:\\b)(?:.*?|.*?(?:[\\r\\n]{1,2}.*?){1,5})[ \\t\\n\\r](?:-H|--header)(?:=|[ \\t]{0,5})(?:"(?:Authorization:[ \\t]{0,5}(?:Basic[ \\t](?:[a-z0-9+/]{8,}={0,3})|(?:Bearer|(?:Api-)?Token)[ \\t](?:[a-zA-Z0-9_=~@.+/-]{8,})|(?:[a-zA-Z0-9_=~@.+/-]{8,}))|(?:(?:X-(?:[a-z]+-)?)?(?:Api-?)?(?:Key|Token)):[ \\t]{0,5}(?:[a-zA-Z0-9_=~@.+/-]{8,}))"|'(?:Authorization:[ \\t]{0,5}(?:Basic[ \\t](?:[a-z0-9+/]{8,}={0,3})|(?:Bearer|(?:Api-)?Token)[ \\t](?:[a-zA-Z0-9_=~@.+/-]{8,})|(?:[a-zA-Z0-9_=~@.+/-]{8,}))|(?:(?:X-(?:[a-z]+-)?)?(?:Api-?)?(?:Key|Token)):[ \\t]{0,5}(?:[a-zA-Z0-9_=~@.+/-]{8,}))')(?:(?-u:\\B)|[ \\r\\n\\t\\f\\v]|\\z)`},{key:"curl_auth_user",name:"Curl basic authentication",category:"credential",example:"curl -u elastic:P@ssw0rd$1",isUsingLuhnAlgorithm:!1,regexp:`(?-u:\\b)curl(?-u:\\b)(?:.*|.*(?:[\\r\\n]{1,2}.*){1,5})[ \\t\\n\\r](?:-u|--user)(?:=|[ \\t]{0,5})(?:"(:[^"]{3,}|[^:"]{3,}:|[^:"]{3,}:[^"]{3,})"|'(?:[^:']{3,}:[^']{3,})'|(?:(?:"[^"]{3,}"|'[^']{3,}'|[a-zA-Z0-9_$@.-]+):(?:"[^"]{3,}"|'[^']{3,}'|[a-zA-Z0-9_\${}@.-]+)))(?:[ \\r\\n\\t\\f\\v]|\\z)`},{key:"databricks_api_token",name:"Databricks API token",category:"credential",example:"dapia2553f815d29a193fd09c2bb55201895",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:dapi[a-f0-9]{32}(?:-[0-9])?)"},{key:"datadog_access_token",name:"Datadog access token",category:"credential",example:"ljgbhjnca2hy5yc2nv7cag1ag7ehx2hc6geparov",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{40})"},{key:"defined_networking_api_token",name:"Defined Networking API token",category:"credential",example:"dnkey-nowf_nwyqhvqt1gi66xnuuf2rb-bfxnr9_qydyxnxn1y8uijvhhp9owllbg-2czoe-7qs5_w5650xei",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:-[a-z0-9=_\\-]{26}-[a-z0-9=_\\-]{52})"},{key:"digitalocean_pat",name:"DigitalOcean personal access token",category:"credential",example:"dop_v1_ec8f4a856c1459bd442a275461e2f709506347de30b180851cde71f696e9fcc8",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:dop_v1_[a-f0-9]{64})"},{key:"digitalocean_access_token",name:"DigitalOcean OAuth access token",category:"credential",example:"doo_v1_42b8ea6c4b0c373f88aff9d3fa87e123ab23b0d3c22ac6d4361a4e9c1e89eaa6",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:doo_v1_[a-f0-9]{64})"},{key:"digitalocean_refresh_token",name:"DigitalOcean OAuth refresh token",category:"credential",example:"dor_v1_4d9b3e6fbe65ab472e464dfa6377d702e80164442acdfbeb3ef032d917cb9984",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:dor_v1_[a-f0-9]{64})"},{key:"discord_api_token",name:"Discord API token",category:"credential",example:"7eb855d9a40747182d0b0ea74df27aee31d05756a9933a815a3ccb5a46b2d61d",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{64})"},{key:"discord_client_id",name:"Discord client ID",category:"credential",example:"763721114261247538",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9]{18})"},{key:"discord_client_secret",name:"Discord client secret",category:"credential",example:"13641266018325206246161633988007",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{32})"},{key:"doppler_api_token",name:"Doppler API token",category:"credential",example:"dp.pt.vgin8wwjy7sx66fyq99tavkm3y5g2jdxmsufh257dhj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)dp\\.pt\\.[a-z0-9]{43}"},{key:"dropbox_api_token",name:"Dropbox API token",category:"credential",example:"rdlztoij88rzrsk",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{15})"},{key:"droneci_access_token",name:"DroneCI access token",category:"credential",example:"v26gffr903rbti5v7m392ba0u7oarz36",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"duffel_api_token",name:"Duffel API token",category:"credential",example:"duffel_test_-yd6b3pc4jy593pt5kr2l3ynzkb5b_f619dshefiz=v",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)duffel_(?:test|live)_[a-z0-9_\\-=]{43}"},{key:"dynatrace_api_token",name:"Dynatrace API token",category:"credential",example:"dt0c01.ben820rdpb1so4kasfx3yn4a.zkje7lawif35udsin5t1mi1m1sne7wdzphlzrmdnu3j69gr4kgf5dwg4x5lb30zg",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)dt0c01\\.[a-z0-9]{24}\\.[a-z0-9]{64}"},{key:"easypost_api_token",name:"EasyPost API token",category:"credential",example:"EZAKBVScDZwZFv0nJXHBcxPGil7eztnPJOSmDFf2NGKQk6Dn7VqULciSRm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)EZAK[a-z0-9]{54}(?-u:\\b)"},{key:"easypost_test_api_token",name:"EasyPost test API token",category:"credential",example:"EZTKuxUXVU5HBS1K2iyh165t3VtivpdxMgIf5Y2P1oJxeFeaJGcwzVexds",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)EZTK[a-z0-9]{54}(?-u:\\b)"},{key:"etsy_access_token",name:"Etsy access token",category:"credential",example:"8ssp35lhprxpb3sjyergcz5z",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{24})"},{key:"facebook_secret",name:"Facebook secret",category:"credential",example:"c41c21ba4fb5ee05398db86ca83f06db",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"facebook_access_token",name:"Facebook access token",category:"credential",example:"911602140448729|AY-lRJZq9BoDLobvAiP25L7RcMg",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:[0-9]{15,16}(\\||%)[0-9a-z\\-_]{27,40})"},{key:"facebook_page_access_token",name:"Facebook page access token",category:"credential",example:"EAAM9GOnCB9kBO2frzOAWGN2zMnZClQshlWydZCrBNdodesbwimx1mfVJgqZBP5RSpMfUzWhtjTTXHG5I1UlvlwRZCgjm3ZBVGeTYiqAAoxyED6HaUdhpGVNoPUwAuAWWFsi9OvyYBQt22DGLqMIgD7VktuCTTZCWKasz81Q822FPhMTB9VFFyClNzQ0NLZClt9zxpsMMrUZCo1VU1rL3CKavir5QTfBjfCEzHNlWAUDUV2YZD",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:EAA[MC][a-z0-9]{50})"},{key:"fastly_api_token",name:"Fastly API token",category:"credential",example:"im7_ux24tyyxz_4y4mvzj22akpid830c",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{32})"},{key:"finicity_client_secret",name:"Finicity client secret",category:"credential",example:"roepymyr0ce7wxhjvgb2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{20})"},{key:"finicity_api_token",name:"Finicity API token",category:"credential",example:'= "cce089057c8b7fe7f2a8474b9a050816',isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"flickr_access_token",name:"Flickr access token",category:"credential",example:"damvt93tudulk6wrfp36sawndc9pa7bb",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"finnhub_access_token",name:"Finnhub access token",category:"credential",example:"x01lnfp13spcbsa0at32",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{20})"},{key:"flutterwave_public_key",name:"Flutterwave public key",category:"credential",example:"FLWPUBK_TEST-99484d505b4ee5c1181a2884f5fe3852-X",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)FLWPUBK_TEST-[a-h0-9]{32}-X"},{key:"flutterwave_secret_key",name:"Flutterwave secret key",category:"credential",example:"FLWSECK_TEST-66187ac83488c2245f0d7e95fa37e833-X",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)FLWSECK_TEST-[a-h0-9]{32}-X"},{key:"flutterwave_encryption_key",name:"Flutterwave encryption key",category:"credential",example:"FLWSECK_TEST-6262214a02e7",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)FLWSECK_TEST-[a-h0-9]{12}"},{key:"flyio_access_token",name:"Fly.io access token",category:"credential",example:"fo1_m-HT0NHLBSPwMJ2hIer4v3lxtWEC7grXNidQxJMrVVE",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:fo1_[a-zA-Z0-9_-]{43}|fm1[ar]_[a-zA-Z0-9+\\/]{50}))"},{key:"frameio_api_token",name:"Frame.io API token",category:"credential",example:"fio-u-4ov9vjtr2wwj8j1gob-8xrx2-1=z818psmitskgoq4=p-_k77d54034z55xk-lqh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)fio-u-[a-z0-9\\-_=]{64}"},{key:"freshbooks_access_token",name:"FreshBooks access token",category:"credential",example:"gqw118uwne1nddlt4yruvvs4jr9s0vrj5mxaswgb2amacod8lgnmrknsvbovsx1g",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"gocardless_api_token",name:"GoCardless API token",category:"credential",example:"live_-z4lwtrrk6p6=-v1ig_y_4ceplziwek0lw=oz-eu",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:live_[a-z0-9\\-_=]{40})"},{key:"gcp_api_key",name:"GCP API key",category:"credential",example:"AIzaYpvGqEzpgB7R353HD9CxN8LuhZ6d6UfuXLL",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:AIza[a-zA-Z0-9_-]{35})"},{key:"github_pat",name:"GitHub personal access token",category:"credential",example:"ghp_t7i9llxuukeb7apn4zlnyeyz5b0007rsfs54",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ghp_[0-9a-zA-Z]{36}"},{key:"github_fine_grained_pat",name:"GitHub fine-grained personal access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)github_pat_[a-zA-Z0-9_]{82}"},{key:"github_oauth",name:"GitHub OAuth token",category:"credential",example:"gho_anlrm6zqscqityoqozv503by66dobnem4yxh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)gho_[0-9a-zA-Z]{36}"},{key:"github_app_token",name:"GitHub app token",category:"credential",example:"ghs_0zleityj4n1ulz178o9in1w97q1ifw8u3y8h",isUsingLuhnAlgorithm:!1,regexp:"(?:ghu|ghs)_[0-9a-zA-Z]{36}"},{key:"github_refresh_token",name:"GitHub refresh token",category:"credential",example:"ghr_inu1aa7qbgi46cf8nprbgh4kn03d0zk35raj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ghr_[0-9a-zA-Z]{36}"},{key:"gitlab_cicd_job_token",name:"GitLab CI/CD job token",category:"credential",example:"glcbt-7h2nr_6jmho0uoqkb1ww431kfl",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glcbt-[0-9a-zA-Z]{1,5}_[0-9a-zA-Z_-]{20}"},{key:"gitlab_deploy_token",name:"GitLab deploy token",category:"credential",example:"gldt-7a3o70gqa8zkal0zdp4x",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)gldt-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_feature_flag_client_token",name:"GitLab feature flag client token",category:"credential",example:"glffct-dsct62ndnvcj7alw5nas",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glffct-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_feed_token",name:"GitLab feed token",category:"credential",example:"glft-13956nvy00289v6xu0di",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glft-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_incoming_mail_token",name:"GitLab incoming mail token",category:"credential",example:"glimt-fcdt1a5jvj01si61jgkse2r20",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glimt-[0-9a-zA-Z_\\-]{25}"},{key:"gitlab_kubernetes_agent_token",name:"GitLab Kubernetes agent token",category:"credential",example:"glagent-8wxkulkbbuk7u6r3nvrefswdfw5o0v7vy81y4oky8rnfogm826",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glagent-[0-9a-zA-Z_\\-]{50}"},{key:"gitlab_oauth_app_secret",name:"GitLab OAuth app secret",category:"credential",example:"gloas-vawws2nw5kf6rizn49g41jc3jiy4xqioaihrwm1msltbdt4cbmo4x52tygcic7af",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)gloas-[0-9a-zA-Z_\\-]{64}"},{key:"gitlab_pat",name:"GitLab personal access token",category:"credential",example:"glpat-2gl3ku1497ms4gzyv16i",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glpat-[a-zA-Z0-9_-]{20}"},{key:"gitlab_pat_routable",name:"GitLab personal access token (routable)",category:"credential",example:"glpat-2hf7vebpux9j56tdcqqsvap7vxc.chvjof35u",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glpat-[0-9a-zA-Z_-]{27}\\.[0-9a-z]{2}[0-9a-z]{7}(?-u:\\b)"},{key:"gitlab_ptt",name:"GitLab personal access token (temporary)",category:"credential",example:"glptt-b54e8b7b90cf006b79af110baa9b8d9183fd7048",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glptt-[0-9a-f]{40}"},{key:"gitlab_rrt",name:"GitLab registration token",category:"credential",example:"GR1348941vnauzmn2hj0zncvt0nfe",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)GR1348941[a-zA-Z0-9_-]{20}"},{key:"gitlab_runner_authentication_token",name:"GitLab runner authentication token",category:"credential",example:"glrt-xbd1w7c9clbxm52zdxkm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glrt-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_runner_authentication_token_routable",name:"GitLab runner authentication token (routable)",category:"credential",example:"glrt-t5_8d8ugbkfzddae0dw06tvm0x7qxc.mwcd1a7cn",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glrt-t[0-9]_[0-9a-zA-Z_\\-]{27}\\.[0-9a-z]{2}[0-9a-z]{7}(?-u:\\b)"},{key:"gitlab_scim_token",name:"GitLab SCIM token",category:"credential",example:"glsoat-9jb5zk1nvy800c1uqhh0",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glsoat-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_session_cookie",name:"GitLab session cookie",category:"credential",example:"_gitlab_session=yjhub6vtrp60djn6rszuemeacsoqox97",isUsingLuhnAlgorithm:!1,regexp:"_gitlab_session=[0-9a-z]{32}"},{key:"gitter_access_token",name:"Gitter access token",category:"credential",example:"uazubes6trcd_1gym09opuf_8gj1rmvj6jwber4a",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{40})"},{key:"grafana_api_key",name:"Grafana API key",category:"credential",example:"eyJrIjoiyl5shjvqja0xkfbu38m24vn5httsipr1h9fgjhodxzlkpravuiy8h7hom5kt8gtwuguh2v",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:eyJrIjoi[A-Za-z0-9]{70}={0,3})"},{key:"grafana_cloud_api_token",name:"Grafana cloud API token",category:"credential",example:"glc_cb7p4j2g1qu0sy84me72ufmn1z8mqk8y",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:glc_[A-Za-z0-9+/]{32}={0,3})"},{key:"grafana_service_account_token",name:"Grafana service account token",category:"credential",example:"glsa_rm3sadbwl8o2c13v4ipgkz04h66kiy6t_edaea401",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:glsa_[A-Za-z0-9]{32}_[A-Fa-f0-9]{8})"},{key:"harness_api_key",name:"Harness API key",category:"credential",example:"pat.vzcxr183pymw194fdq1q0v.qjqjarqkd9ydxqagjmq3f5iq.8nn5nyaow3h5mmgjh053",isUsingLuhnAlgorithm:!1,regexp:"(?:pat|sat)\\.[a-zA-Z0-9_-]{22}\\.[a-zA-Z0-9]{24}\\.[a-zA-Z0-9]{20}"},{key:"hashicorp_tf_api_token",name:"HashiCorp Terraform API token",category:"credential",example:"984d8033429986.atlasv1.799k5cihj_807yc1e8afvla8ackd1khsb50nfeswbxbr1re54y0wpzs2tjy=",isUsingLuhnAlgorithm:!1,regexp:"[a-z0-9]{14}\\.(?-i:atlasv1)\\.[a-z0-9\\-_=]{60,70}"},{key:"heroku_api_key",name:"Heroku API key",category:"credential",example:"9127f65b-8b3f-c0b7-a336-a4347e71bc51",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"heroku_api_key_v2",name:"Heroku API key v2",category:"credential",example:"HRKU-AAxPYvV6l2R3DvF0w9VJ4m8cz9oaygOHxpQvcw--iD51MszQZeakD9DZsclX",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(HRKU-AA[0-9a-zA-Z_-]{58}))"},{key:"hubspot_api_key",name:"HubSpot API key",category:"credential",example:"86cb6664-b191-db72-95a7-49adebe84b74",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12})"},{key:"huggingface_access_token",name:"HuggingFace access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:hf_(?i:[a-z]{34}))"},{key:"huggingface_organization_api_token",name:"HuggingFace organization API token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:api_org_(?i:[a-z]{34}))"},{key:"intercom_api_key",name:"Intercom API key",category:"credential",example:"zuc5c=ykf5gcwesqvmh2pji6k3extx0rbalsznte3sdo7iu7f-lumol2npfk",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{60})"},{key:"intra42_client_secret",name:"Intra42 client secret",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:s-s4t2(?:ud|af)-[abcdef0123456789]{64})"},{key:"jfrog_api_key",name:"JFrog API key",category:"credential",example:"lj7nrgoo0kr04kw312zvly7l0olsn37vhto5wdn3yqi5srxnc2axstp7a1kewkxi717w295kh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{73})"},{key:"jfrog_identity_token",name:"JFrog identity token",category:"credential",example:"xh0x2upbtkkg1pseg7ezmcyw2c3kt0bt05l5v8ynvkro6wagolhch0f7kppplt8b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"jwt",name:"JSON web token",category:"credential",example:"ey7gzQUpN8Kz7XY6Yin.ey1o36_XrBphAG8WMHQ.",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:ey[a-zA-Z0-9]{17,}\\.ey[a-zA-Z0-9\\/\\\\_-]{17,}\\.(?:[a-zA-Z0-9\\/\\\\_-]{10,}={0,2})?)"},{key:"jwt_base64",name:"JSON web token base64",category:"credential",example:"ZXlKNE5YUWpVekkxTmlJNklsUjFUM0pDZVRKT1kxUnNSbE5YZFZvNFMyZzRWemhCYWxGaFoySTBabTVtVURGVGJFdE5Uemd0VTI4aWZRLmV5SnBjM01pT2lKcWIyVWlMQTBLSUNKbGVIQWlPakV6TURBNE1Ua3pPREFzRFFvZ0ltaDBkSEE2THk5bGVHRnRjR3hsTG1OdmJTOXBjMTl5YjI5MElqcDBjblZsZlEuZEJqZnRKZVo0Q1ZQLW1COTJLMjd1aGJVSlUxcDFyX3dXMWdGV0ZPRWpYaw==",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ZXlK(?:(?P<alg>aGJHY2lPaU)|(?P<apu>aGNIVWlPaU)|(?P<apv>aGNIWWlPaU)|(?P<aud>aGRXUWlPaU)|(?P<b64>aU5qUWlP)|(?P<crit>amNtbDBJanBi)|(?P<cty>amRIa2lPaU)|(?P<epk>bGNHc2lPbn)|(?P<enc>bGJtTWlPaU)|(?P<jku>cWEzVWlPaU)|(?P<jwk>cWQyc2lPb)|(?P<iss>cGMzTWlPaU)|(?P<iv>cGRpSTZJ)|(?P<kid>cmFXUWlP)|(?P<key_ops>clpYbGZiM0J6SWpwY)|(?P<kty>cmRIa2lPaUp)|(?P<nonce>dWIyNWpaU0k2)|(?P<p2c>d01tTWlP)|(?P<p2s>d01uTWlPaU)|(?P<ppt>d2NIUWlPaU)|(?P<sub>emRXSWlPaU)|(?P<svt>emRuUWlP)|(?P<tag>MFlXY2lPaU)|(?P<typ>MGVYQWlPaUp)|(?P<url>MWNtd2l)|(?P<use>MWMyVWlPaUp)|(?P<ver>MlpYSWlPaU)|(?P<version>MlpYSnphVzl1SWpv)|(?P<x>NElqb2)|(?P<x5c>NE5XTWlP)|(?P<x5t>NE5YUWlPaU)|(?P<x5ts256>NE5YUWpVekkxTmlJNkl)|(?P<x5u>NE5YVWlPaU)|(?P<zip>NmFYQWlPaU))[a-zA-Z0-9\\/\\\\_+\\-\\r\\n]{40,}={0,2}"},{key:"launchdarkly_access_token",name:"LaunchDarkly access token",category:"credential",example:"ezmej9s6yv4qwk2=yeb4kfi162p33b_2hzm7tr-0",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{40})"},{key:"linear_api_key",name:"Linear API key",category:"credential",example:"lin_api_0n5n0k26vb4ka9je9dqdcwl1dae5mbpfhb48xio6",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)lin_api_[a-z0-9]{40}"},{key:"linear_client_secret",name:"Linear client secret",category:"credential",example:"7b956760f09b81684ed833c524f081de",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"linkedin_client_id",name:"LinkedIn client ID",category:"credential",example:"18u930hak0em0r",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{14})"},{key:"linkedin_client_secret",name:"LinkedIn client secret",category:"credential",example:"uvkxd9rw41ylk1zj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{16})"},{key:"lob_api_key",name:"Lob API key",category:"credential",example:"test_02efbb923a38370aac769e3bedc4d3398be",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:(live|test)_[a-f0-9]{35})"},{key:"lob_pub_api_key",name:"Lob publishable API key",category:"credential",example:"test_pub_df170d9f5be9244959713dfee686c42",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:(test|live)_pub_[a-f0-9]{31})"},{key:"mailchimp_api_key",name:"MailChimp API key",category:"credential",example:"81277fbbe2dd9c5e18d5f28cebcc558c-us20",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32}-us[0-9][0-9])"},{key:"mailgun_pub_key",name:"Mailgun public validation key",category:"credential",example:"pubkey-5011bae1a4b57dfa83762c24b0e1299d",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:pubkey-[a-f0-9]{32})"},{key:"mailgun_private_api_token",name:"Mailgun private API token",category:"credential",example:"key-176f7ef066471ac351adab734d2c9fb2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:key-[a-f0-9]{32})"},{key:"mailgun_signing_key",name:"Mailgun webhook signing key",category:"credential",example:"24564bd3d54a469601d5ac5daecb9ad2-00001111-22223333",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-h0-9]{32}-[a-h0-9]{8}-[a-h0-9]{8})"},{key:"mapbox_api_token",name:"MapBox API token",category:"credential",example:"pk.5ko18udoy3cilkpgyedje9limykwj8n7wmhug4967o9wze284mmpuuhjzgig.edjzuv7jwhc6lnv5b3p9nc",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:pk\\.[a-z0-9]{60}\\.[a-z0-9]{22})"},{key:"mattermost_access_token",name:"Mattermost access token",category:"credential",example:"rtw2hncbfhpbyyri90d3q2mo1m",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{26})"},{key:"maxmind_license_key",name:"MaxMind license key",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:[A-Za-z0-9]{6}_[A-Za-z0-9]{29}_mmk)"},{key:"cisco_meraki_api_key",name:"Cisco Meraki API key",category:"credential",example:"acea14a1470f7cf443a031dde64065ce81c77b2b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:[0-9a-f]{40})"},{key:"messagebird_api_token",name:"MessageBird API token",category:"credential",example:"448q6im7yxutswabdko1n69ry",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{25})"},{key:"messagebird_client_id",name:"MessageBird client ID",category:"credential",example:"12345678-ABCD-ABCD-ABCD-1234567890AB",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"netlify_access_token",name:"Netlify access token",category:"credential",example:"3j1sa0o20v0k-cjbjn3vh_4uqnkvb3w_px5no2in",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{40,46})"},{key:"new_relic_user_api_key",name:"New Relic user API key",category:"credential",example:"NRAK-zozcnrh45ornsbl1duyfhell59u",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:NRAK-[a-z0-9]{27})"},{key:"new_relic_user_api_id",name:"New Relic user API ID",category:"credential",example:"k0jze7delork84k8ke1z1dm275yw2aqf5uu2cy7x1uiloll3xab5203hiz9tx9xx",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"new_relic_browser_api_token",name:"New Relic browser API token",category:"credential",example:"NRJS-c7fa1261a97506e4a45",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:NRJS-[a-f0-9]{19})"},{key:"new_relic_insert_key",name:"New Relic insight insert key",category:"credential",example:"NRII-4168ab7eb2e051f37144ad884d32ab34",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:NRII-[a-z0-9-]{32})"},{key:"notion_api_token",name:"Notion API token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:ntn_[0-9]{11}[A-Za-z0-9]{32}[A-Za-z0-9]{3})"},{key:"npm_access_token",name:"npm access token",category:"credential",example:"npm_vz9e7fvsn7o2n2tddg6b01gs7g9wldlys4vm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:npm_[a-z0-9]{36})"},{key:"nytimes_access_token",name:"NYTimes access token",category:"credential",example:"ako7xzi0mx7w15ogdkew7ilq7h13x8rl",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{32})"},{key:"octopus_deploy_api_key",name:"Octopus Deploy API key",category:"credential",example:"API-NFWN6F7X32BYDBU94IGY3V5ZQY",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:API-[A-Z0-9]{26})"},{key:"okta_access_token",name:"Okta access token",category:"credential",example:"003cKkRNNMy4ul7V8UDHEjEBGbnsQ6tejSHzfeBtcp",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:00[a-zA-Z0-9_=\\-]{40})"},{key:"openai_api_key",name:"OpenAI API key",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sk-(?:proj|svcacct|admin)-(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})T3BlbkFJ(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})(?-u:\\b)|sk-[a-zA-Z0-9]{20}T3BlbkFJ[a-zA-Z0-9]{20})"},{key:"openshift_user_token",name:"OpenShift user token",category:"credential",example:"sha256~OFL-TnR3jyLteu_rAuff3PUYNELVvByMRFYCcAkaJSR",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sha256~[a-zA-Z0-9_-]{43})(?:[^a-zA-Z0-9_-]|\\z)"},{key:"perplexity_api_key",name:"Perplexity API key",category:"credential",example:"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'",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pplx-[a-zA-Z0-9]{48})(?:[`'\" \\r\\n\\t\\f\\v;]|\\\\[nr]|$|(?-u:\\b))"},{key:"pgpassword_shell_assignment",name:"PGPASSWORD shell assignment",category:"credential",example:"PGPASSWORD='supersecret'",isUsingLuhnAlgorithm:!1,regexp:`(?-u:\\b)PGPASSWORD=(?:"[^"\\r\\n]+"|'[^'\\r\\n]+'|[^\\s'"]+)`},{key:"plaid_api_token",name:"Plaid API token",category:"credential",example:"access-development-4b0f8c31-83fe-e4c5-3d02-91e487b69d2d",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:access-(?:sandbox|development|production)-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"plaid_client_id",name:"Plaid client ID",category:"credential",example:"TTPjxpFNiwOct5XLdxjXD0Ta",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{24})"},{key:"plaid_secret_key",name:"Plaid secret key",category:"credential",example:"ikhqm7a9k76l8f544dl0v8kxvm2w55",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{30})"},{key:"planetscale_password",name:"PlanetScale password",category:"credential",example:"pscale_pw_9gvu8z79m4b814z0vv8266w70h3i7jlq",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pscale_pw_[a-zA-Z0-9_=\\.-]{32,64})"},{key:"planetscale_api_token",name:"PlanetScale API token",category:"credential",example:"pscale_tkn_nwy9jkjgnry96ftecsx_=jrxc6pkmmew",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pscale_tkn_[a-zA-Z0-9_=\\.-]{32,64})"},{key:"planetscale_oauth_token",name:"PlanetScale OAuth token",category:"credential",example:"pscale_oauth_zx8v3gzfnfxbymj__l629i68jnz5gnff",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pscale_oauth_[a-zA-Z0-9_=\\.-]{32,64})"},{key:"postman_api_token",name:"Postman API token",category:"credential",example:"PMAK-525b84aa46e2c588620d8123-06f9ca36c4aad4305baafbe00716b7bc8f",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:PMAK-[a-f0-9]{24}\\-[a-f0-9]{34})"},{key:"prefect_api_token",name:"Prefect API token",category:"credential",example:"pnu_kttbffyfgffu2sfbxzxw8mbpgvvtxjljwe1p",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pnu_[a-zA-Z0-9]{36})"},{key:"privateai_api_token",name:"PrivateAI API token",category:"credential",example:"iwuxqzqilzbfnccncvjz6px23dnej11h",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"private_key",name:"Private key",category:"credential",example:`-----BEGIN PRIVATE KEY-----
|
|
240
240
|
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDAC4AWkdwKYSd8
|
|
241
241
|
Ks14IReLcYgADhoXk56ZzXI=
|
|
242
242
|
-----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}"}],xDe=XZ.map(e=>e.key);var d1t=new Set(xDe),f1t=XZ.map(e=>e.key);var IDe={"&":"&","<":"<",">":">",'"':""","'":"'"};function cM(e){return e.replace(/[&<>"']/g,t=>IDe[t]??t)}var R1t={[LO]:FO,[LO.replace(`${Se}.`,"")]:FO,[MO]:DO,[MO.replace(`${Se}.`,"")]:DO,[nu]:Pf,[nu.replace(`${Se}.`,"")]:Pf},P1t={[FO]:LO,[DO]:MO,[Pf]:nu};function eX(e){return e.replace(/ies$/,"y").replace(/s$/,"")}var tX=["alert_cluster","alert_conditions","alert_data_url","alert_id","alert_owner","alert_previous_status","alert_priority","alert_start_time","alert_status","alert_tags","alert_timeframe","alert_title","alert_transition","alert_triggered_by","dashboard_url","monitor_url"],rX=["alert_queries","alert_thresholds","alert_values"],_De=[...tX,...rX],nX=["alert_event_name","alert_message"],t$t=[..._De,...nX],r$t=new Set([...tX,...nX]),n$t=new Set(rX);var lM={aws:"aws",gcp:"gcp",azure:"azure"},ou=[lM.aws,lM.gcp,lM.azure];var oX=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(ou,{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`."}),iX="clusterId must be provided when the organization has multiple clusters",ADe={id:"abc-123-def",name:"production",friendlyName:"Production (US)",clusterType:"aws",clusterRegion:"us-east-1"};Object.assign(oX,{examples:[ADe]});var $O=x({description:"Lists Tsuga clusters available to the organization. Use cluster IDs with public API requests that accept `clusterId`, such as telemetry, service, Kubernetes Explorer, and quality-report requests.",operationId:"listClusters",tags:["clusters"],url:`/${"v1"}/clusters`,method:"GET",response:n.Array(oX)});function wf(e){return`\u2022\u2022\u2022\u2022${e.slice(-4)}`}function GO(e){return{accessToken:e.accessToken,accessExpiresAt:e.expiresAt.toISOString(),refreshToken:e.refreshToken}}var uM=require("node:os"),Vp=require("node:path");var BO=e=>e.reason._tag==="NotFound";var sX=new Set(["api.tsuga.com","api.tsuga-staging.com"]),ODe=new Set(["localhost","127.0.0.1","[::1]"]),aX=e=>Ie(()=>e.replace(/\/+$/,"")).pipe(ce(t=>{if(!URL.canParse(t))return J(new vc({message:`TSUGA_API_URL is not a URL: ${t}`}));if(/[\s"'\\]/.test(t))return J(new vc({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:"?J(new vc({message:`TSUGA_API_URL must use HTTP or HTTPS: ${t}`})):!ODe.has(r.hostname)&&(r.protocol!=="https:"||!sX.has(r.hostname))?J(new vc({message:`Refusing to send credentials to ${t}. Set TSUGA_API_URL to ${[...sX].map(o=>`https://${o}`).join(", ")}, or a localhost URL.`})):L(t)}));var cS="https://api.tsuga.com",CDe=Xr({operationApiKey:or(Me),userAuth:or(xO)}),RDe=Xr({operationApiKey:or(Me),userAuth:or(xO),credentials:or(gI(Me,CDe)),defaults:or(gI(Me,Me))}),PDe=Xr({lastUpdateCheck:or(Me)}),wDe=fs(RDe),vDe=fs(PDe);var cX={from:"-30m",to:"now",query:"*","max-results":"100"};function UDe(e){let{operationApiKey:t,userAuth:r,...o}=e;return!t&&!r?e:{...o,credentials:{...e.credentials,[cS]:{...t?{operationApiKey:t}:{},...r?{userAuth:r}:{},...e.credentials?.[cS]}}}}function lX(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: ${wf(o.userAuth.accessToken)} (expires ${o.userAuth.accessExpiresAt})`);break;default:Pr(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={...cX,...e.defaults};for(let[s,a]of Object.entries(i)){let c=s in e.defaults?" *":"";r.push(` ${s}: ${a}${c}`)}return`${r.join(`
|
|
@@ -251,8 +251,8 @@ Re-authenticate with \`tsuga auth login\` or \`tsuga auth operation-key <OPERATI
|
|
|
251
251
|
`)}var HDe="Provide a request body with -f <FILE_PATH> or -d <JSON>. Use --generate-skeleton to get a template.",pM=(e,t)=>$t({try:()=>JSON.parse(t),catch:r=>new pr({message:`${e} is not valid JSON: ${r instanceof Error?r.message:String(r)}`})}),Qp=D("request.readBody")(function*(e){let t=Re(e.file);if(t!==void 0){if(t==="-"){let s=yield*yd,a=yield*lc(s.stdin).pipe(uc,Mt(c=>new pr({message:`Could not read stdin: ${c.message}`})));return yield*pM("stdin",a)}let i=yield*(yield*mn).readFileString(t).pipe(Mt(s=>new pr({message:`Could not read ${t}: ${s.message}`})));return yield*pM(t,i)}let r=Re(e.data);return r!==void 0?yield*pM("--data",r):yield*new pr({message:HDe})});function mM(e){return u.HasPropertyKey(e,"~refine")&&u.IsArray(e["~refine"])&&u.Every(e["~refine"],0,t=>u.IsObject(t)&&u.HasPropertyKey(t,"check")&&u.HasPropertyKey(t,"error")&&u.IsFunction(t.check)&&u.IsFunction(t.error))}function Cs(e){return u.IsObject(e)&&!u.IsArray(e)}function jO(e){return u.IsBoolean(e)}function $e(e){return Cs(e)||jO(e)}function dM(e){return u.HasPropertyKey(e,"additionalItems")&&$e(e.additionalItems)}function Lc(e){return u.HasPropertyKey(e,"additionalProperties")&&$e(e.additionalProperties)}function fM(e){return u.HasPropertyKey(e,"allOf")&&u.IsArray(e.allOf)&&e.allOf.every(t=>$e(t))}function lS(e){return u.HasPropertyKey(e,"$anchor")&&u.IsString(e.$anchor)}function gM(e){return u.HasPropertyKey(e,"anyOf")&&u.IsArray(e.anyOf)&&e.anyOf.every(t=>$e(t))}function hM(e){return u.HasPropertyKey(e,"const")}function Wp(e){return u.HasPropertyKey(e,"contains")&&$e(e.contains)}function Oi(e){return u.HasPropertyKey(e,"default")}function yM(e){return u.HasPropertyKey(e,"dependencies")&&u.IsObject(e.dependencies)&&Object.values(e.dependencies).every(t=>$e(t)||u.IsArray(t)&&t.every(r=>u.IsString(r)))}function EM(e){return u.HasPropertyKey(e,"dependentRequired")&&u.IsObject(e.dependentRequired)&&Object.values(e.dependentRequired).every(t=>u.IsArray(t)&&t.every(r=>u.IsString(r)))}function SM(e){return u.HasPropertyKey(e,"dependentSchemas")&&u.IsObject(e.dependentSchemas)&&Object.values(e.dependentSchemas).every(t=>$e(t))}function iu(e){return u.HasPropertyKey(e,"$dynamicAnchor")&&u.IsString(e.$dynamicAnchor)}function TM(e){return u.HasPropertyKey(e,"$dynamicRef")&&u.IsString(e.$dynamicRef)}function bM(e){return u.HasPropertyKey(e,"else")&&$e(e.else)}function xM(e){return u.HasPropertyKey(e,"enum")&&u.IsArray(e.enum)}function IM(e){return u.HasPropertyKey(e,"exclusiveMaximum")&&(u.IsNumber(e.exclusiveMaximum)||u.IsBigInt(e.exclusiveMaximum))}function Mc(e){return u.HasPropertyKey(e,"exclusiveMinimum")&&(u.IsNumber(e.exclusiveMinimum)||u.IsBigInt(e.exclusiveMinimum))}function uS(e){return u.HasPropertyKey(e,"format")&&u.IsString(e.format)}function Dc(e){return u.HasPropertyKey(e,"$id")&&u.IsString(e.$id)}function _M(e){return u.HasPropertyKey(e,"if")&&$e(e.if)}function vf(e){return u.HasPropertyKey(e,"items")&&($e(e.items)||u.IsArray(e.items)&&e.items.every(t=>$e(t)))}function AM(e){return vf(e)&&u.IsArray(e.items)}function OM(e){return u.HasPropertyKey(e,"maximum")&&(u.IsNumber(e.maximum)||u.IsBigInt(e.maximum))}function CM(e){return u.HasPropertyKey(e,"maxContains")&&u.IsNumber(e.maxContains)}function HO(e){return u.HasPropertyKey(e,"maxItems")&&u.IsNumber(e.maxItems)}function RM(e){return u.HasPropertyKey(e,"maxLength")&&u.IsNumber(e.maxLength)}function PM(e){return u.HasPropertyKey(e,"maxProperties")&&u.IsNumber(e.maxProperties)}function Fc(e){return u.HasPropertyKey(e,"minimum")&&(u.IsNumber(e.minimum)||u.IsBigInt(e.minimum))}function Jp(e){return u.HasPropertyKey(e,"minContains")&&u.IsNumber(e.minContains)}function Uf(e){return u.HasPropertyKey(e,"minItems")&&u.IsNumber(e.minItems)}function pS(e){return u.HasPropertyKey(e,"minLength")&&u.IsNumber(e.minLength)}function mS(e){return u.HasPropertyKey(e,"minProperties")&&u.IsNumber(e.minProperties)}function wM(e){return u.HasPropertyKey(e,"multipleOf")&&(u.IsNumber(e.multipleOf)||u.IsBigInt(e.multipleOf))}function vM(e){return u.HasPropertyKey(e,"not")&&$e(e.not)}function UM(e){return u.HasPropertyKey(e,"oneOf")&&u.IsArray(e.oneOf)&&e.oneOf.every(t=>$e(t))}function dS(e){return u.HasPropertyKey(e,"pattern")&&(u.IsString(e.pattern)||e.pattern instanceof RegExp)}function fS(e){return u.HasPropertyKey(e,"patternProperties")&&u.IsObject(e.patternProperties)&&Object.values(e.patternProperties).every(t=>$e(t))}function Nf(e){return u.HasPropertyKey(e,"prefixItems")&&u.IsArray(e.prefixItems)&&e.prefixItems.every(t=>$e(t))}function gS(e){return u.HasPropertyKey(e,"properties")&&u.IsObject(e.properties)&&Object.values(e.properties).every(t=>$e(t))}function NM(e){return u.HasPropertyKey(e,"propertyNames")&&(u.IsObject(e.propertyNames)||$e(e.propertyNames))}function KDe(e){return u.HasPropertyKey(e,"$recursiveAnchor")&&u.IsBoolean(e.$recursiveAnchor)}function KO(e){return KDe(e)&&u.IsEqual(e.$recursiveAnchor,!0)}function kM(e){return u.HasPropertyKey(e,"$recursiveRef")&&u.IsString(e.$recursiveRef)}function LM(e){return u.HasPropertyKey(e,"$ref")&&u.IsString(e.$ref)}function Zp(e){return u.HasPropertyKey(e,"required")&&u.IsArray(e.required)&&e.required.every(t=>u.IsString(t))}function MM(e){return u.HasPropertyKey(e,"then")&&$e(e.then)}function DM(e){return u.HasPropertyKey(e,"type")&&(u.IsString(e.type)||u.IsArray(e.type)&&e.type.every(t=>u.IsString(t)))}function kf(e){return u.HasPropertyKey(e,"uniqueItems")&&u.IsBoolean(e.uniqueItems)}function zO(e){return u.HasPropertyKey(e,"unevaluatedItems")&&$e(e.unevaluatedItems)}function YO(e){return u.HasPropertyKey(e,"unevaluatedProperties")&&$e(e.unevaluatedProperties)}var go=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}},hS=class extends go{constructor(t){super(),this.callback=t}AddError(t){return this.callback(t),!1}},Cn=class extends hS{constructor(){super(t=>this.errors.push(t)),this.errors=[]}AddError(t){return this.errors.push(t),!1}GetErrors(){return this.errors}};function hX(e,t,r,o){return u.Every(r["~refine"],0,(i,s)=>i.check(o))}function yX(e,t,r,o,i,s){return u.EveryAll(i["~refine"],0,(a,c)=>a.check(s)||t.AddError({keyword:"~refine",schemaPath:r,instancePath:o,params:{index:c,message:a.error(s)}}))}function EX(e){return vf(e)&&u.IsArray(e.items)}function SX(e,t,r,o){return EX(r)?u.Every(o,0,(s,a)=>u.IsLessThan(a,r.items.length)||Ci(e,t,r.additionalItems,s)&&t.AddIndex(a)):!0}function TX(e,t,r,o,i,s){return EX(i)?u.Every(s,0,(c,l)=>{let m=`${r}/additionalItems`,y=`${o}/${l}`;return u.IsLessThan(l,i.items.length)||Ri(e,t,m,y,i.additionalItems,c)&&t.AddIndex(l)}):!0}function zDe(e){return`^${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}$`}function bX(e){let t=[];return fS(e)&&t.push(...u.Keys(e.patternProperties)),gS(e)&&t.push(...u.Keys(e.properties).map(zDe)),u.IsEqual(t.length,0)?"(?!)":`(${t.join("|")})`}function xX(e,t,r,o){let i=new RegExp(bX(r));return u.Every(u.Keys(o),0,(a,c)=>i.test(a)||Ci(e,t,r.additionalProperties,o[a])&&t.AddKey(a))}function IX(e,t,r,o,i,s){let a=new RegExp(bX(i)),c=[];return u.EveryAll(u.Keys(s),0,(m,y)=>{let T=`${r}/additionalProperties`,S=`${o}/${m}`,E=new Cn,_=a.test(m)||Ri(e,E,T,S,i.additionalProperties,s[m])&&t.AddKey(m);return _||c.push(m),_})||t.AddError({keyword:"additionalProperties",schemaPath:r,instancePath:o,params:{additionalProperties:c}})}function _X(e,t,r,o){let i=r.allOf.reduce((s,a)=>{let c=new go;return gt(e,c,a,o)?[...s,c]:s},[]);return u.IsEqual(i.length,r.allOf.length)&&t.Merge(i)}function AX(e,t,r,o,i,s){let a=[],c=i.allOf.reduce((m,y,T)=>{let S=`${r}/allOf/${T}`,E=new Cn,_=rr(e,E,S,o,y,s);return _||a.push(E),_?[...m,E]:m},[]),l=u.IsEqual(c.length,i.allOf.length)&&t.Merge(c);return l||a.forEach(m=>m.GetErrors().forEach(y=>t.AddError(y))),l}function OX(e,t,r,o){let i=r.anyOf.reduce((s,a)=>{let c=new go;return gt(e,c,a,o)?[...s,c]:s},[]);return u.IsGreaterThan(i.length,0)&&t.Merge(i)}function CX(e,t,r,o,i,s){let a=[],c=i.anyOf.reduce((m,y,T)=>{let S=new Cn,E=`${r}/anyOf/${T}`,_=rr(e,S,E,o,y,s);return _||a.push(S),_?[...m,S]:m},[]),l=u.IsGreaterThan(c.length,0)&&t.Merge(c);return l||a.forEach(m=>m.GetErrors().forEach(y=>t.AddError(y))),l||t.AddError({keyword:"anyOf",schemaPath:r,instancePath:o,params:{}})}function $M(e,t,r,o){return r}function RX(e,t,r,o,i,s){return $M(e,t,i,s)||t.AddError({keyword:"boolean",schemaPath:r,instancePath:o,params:{}})}function GM(e,t,r,o){return u.IsValueLike(r.const)?u.IsEqual(o,r.const):u.IsDeepEqual(o,r.const)}function PX(e,t,r,o,i,s){return GM(e,t,i,s)||t.AddError({keyword:"const",schemaPath:r,instancePath:o,params:{allowedValue:i.const}})}function YDe(e){return!(Jp(e)&&u.IsEqual(e.minContains,0))}function BM(e,t,r,o){return YDe(r)?!u.IsEqual(o.length,0)&&u.SomeAll(o,(i,s)=>gt(e,t,r.contains,i)&&t.AddIndex(s)):!0}function wX(e,t,r,o,i,s){return BM(e,t,i,s)||t.AddError({keyword:"contains",schemaPath:r,instancePath:o,params:{minContains:1}})}function vX(e,t,r,o){let i=u.IsEqual(u.Keys(o).length,0),s=u.Every(u.Entries(r.dependencies),0,([a,c])=>!u.HasPropertyKey(o,a)||(u.IsArray(c)?c.every(l=>u.HasPropertyKey(o,l)):gt(e,t,c,o)));return i||s}function UX(e,t,r,o,i,s){let a=u.IsEqual(u.Keys(s).length,0),c=u.EveryAll(u.Entries(i.dependencies),0,([l,m])=>{let y=`${r}/dependencies/${l}`;return!u.HasPropertyKey(s,l)||(u.IsArray(m)?m.every(T=>u.HasPropertyKey(s,T)||t.AddError({keyword:"dependencies",schemaPath:r,instancePath:o,params:{property:l,dependencies:m}})):rr(e,t,y,o,m,s))});return a||c}function NX(e,t,r,o){let i=u.IsEqual(u.Keys(o).length,0),s=u.Every(u.Entries(r.dependentRequired),0,([a,c])=>!u.HasPropertyKey(o,a)||c.every(l=>u.HasPropertyKey(o,l)));return i||s}function kX(e,t,r,o,i,s){let a=u.IsEqual(u.Keys(s).length,0),c=u.EveryAll(u.Entries(i.dependentRequired),0,([l,m])=>!u.HasPropertyKey(s,l)||u.EveryAll(m,0,y=>u.HasPropertyKey(s,y)||t.AddError({keyword:"dependentRequired",schemaPath:r,instancePath:o,params:{property:l,dependencies:m}})));return a||c}function LX(e,t,r,o){let i=u.IsEqual(u.Keys(o).length,0),s=u.Every(u.Entries(r.dependentSchemas),0,([a,c])=>!u.HasPropertyKey(o,a)||gt(e,t,c,o));return i||s}function MX(e,t,r,o,i,s){let a=u.IsEqual(u.Keys(s).length,0),c=u.EveryAll(u.Entries(i.dependentSchemas),0,([l,m])=>{let y=`${r}/dependentSchemas/${l}`;return!u.HasPropertyKey(s,l)||rr(e,t,y,o,m,s)});return a||c}function DX(e,t,r,o){let i=e.DynamicRef(r)??!1;return $e(i)&>(e,t,i,o)}function FX(e,t,r,o,i,s){let a=e.DynamicRef(i)??!1;return $e(a)&&rr(e,t,"#",o,a,s)}function HM(e,t,r,o){return u.Some(r.enum,i=>u.IsValueLike(i)?u.IsEqual(o,i):u.IsDeepEqual(o,i))}function $X(e,t,r,o,i,s){return HM(e,t,i,s)||t.AddError({keyword:"enum",schemaPath:r,instancePath:o,params:{allowedValues:i.enum}})}function KM(e,t,r,o){return u.IsLessThan(o,r.exclusiveMaximum)}function GX(e,t,r,o,i,s){return KM(e,t,i,s)||t.AddError({keyword:"exclusiveMaximum",schemaPath:r,instancePath:o,params:{comparison:"<",limit:i.exclusiveMaximum}})}function zM(e,t,r,o){return u.IsGreaterThan(o,r.exclusiveMinimum)}function BX(e,t,r,o,i,s){return zM(e,t,i,s)||t.AddError({keyword:"exclusiveMinimum",schemaPath:r,instancePath:o,params:{comparison:">",limit:i.exclusiveMinimum}})}var Ff={};wi(Ff,{Clear:()=>ZX,Entries:()=>UFe,Get:()=>LFe,Has:()=>kFe,IsDate:()=>Mf,IsDateTime:()=>VO,IsDuration:()=>QO,IsEmail:()=>WO,IsHostname:()=>ZO,IsIPv4:()=>tC,IsIPv6:()=>rC,IsIdnEmail:()=>XO,IsIdnHostname:()=>eC,IsIri:()=>oC,IsIriReference:()=>nC,IsJsonPointer:()=>sC,IsJsonPointerUriFragment:()=>iC,IsRegex:()=>aC,IsRelativeJsonPointer:()=>cC,IsTime:()=>Df,IsUri:()=>mC,IsUriReference:()=>lC,IsUriTemplate:()=>uC,IsUrl:()=>dC,IsUuid:()=>fC,Reset:()=>XX,Set:()=>NFe,Test:()=>MFe});var VDe=[0,31,28,31,30,31,30,31,31,30,31,30,31],QDe=/^(\d\d\d\d)-(\d\d)-(\d\d)$/;function WDe(e){return e%4===0&&(e%100!==0||e%400===0)}function Mf(e){let t=QDe.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&&WDe(r)?29:VDe[o])}var JDe=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(?:Z|([+-])(\d\d):(\d\d))?$/i;function Df(e,t=!0){let r=JDe.exec(e);if(!r)return!1;let o=+r[1],i=+r[2],s=+r[3],a=r[4]==="-"?-1:1,c=+(r[5]||0),l=+(r[6]||0);if(c>23||l>59||t&&!r[4]&&e.toLowerCase().indexOf("z")===-1)return!1;if(o<=23&&i<=59&&s<60)return!0;let m=i-l*a,y=o-c*a-(m<0?1:0);return(y===23||y===-1)&&(m===59||m===-1)&&s<61}function VO(e,t=!0){let r=e.split(/T/i);return r.length===2&&Mf(r[0])&&Df(r[1],t)}var ZDe=/^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 QO(e){return ZDe.test(e)}var XDe=/^(?!.*\.\.)[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i;function WO(e){return XDe.test(e)}var Xp=36,JO=1,YM=26,eFe=38,tFe=700,rFe=72,nFe=128;function oFe(e,t,r){e=r?Math.floor(e/tFe):e>>1,e+=Math.floor(e/t);let o=0;for(;e>(Xp-JO)*YM>>1;)e=Math.floor(e/(Xp-JO)),o+=Xp;return o+Math.floor((Xp-JO+1)*e/(e+eFe))}function qX(e){let t=[],r=nFe,o=0,i=rFe,s=e.lastIndexOf("-");if(s>0)for(let c=0;c<s;c++){let l=e.charCodeAt(c);if(l>=128)throw new Error("Invalid punycode: non-basic before delimiter");t.push(l)}let a=s<0?0:s+1;for(;a<e.length;){let c=o,l=1,m=Xp;for(;;){if(a>=e.length)throw new Error("Invalid punycode: unexpected end of input");let T=e.charCodeAt(a++),S;if(T>=97&&T<=122)S=T-97;else if(T>=48&&T<=57)S=T-48+26;else if(T>=65&&T<=90)Vt();else throw new Error("Invalid punycode: bad digit character");o+=S*l;let E=m<=i?JO:m>=i+YM?YM:m-i;if(S<E)break;l*=Xp-E,m+=Xp}let y=t.length+1;i=oFe(o-c,y,c===0),r+=Math.floor(o/y),o%=y,t.splice(o,0,r),o++}return globalThis.String.fromCodePoint(...t)}function sFe(e){return new RegExp("\\p{Mn}","u").test(String.fromCodePoint(e))}function aFe(e){return new RegExp("\\p{Mc}","u").test(String.fromCodePoint(e))}function cFe(e){return new RegExp("\\p{Me}","u").test(String.fromCodePoint(e))}function lFe(e){return sFe(e)||aFe(e)||cFe(e)}var uFe=new Set([1600,2042,12334,12335,12337,12338,12339,12340,12341,12347]),pFe=new Set([2381,2509,2637,2765,2893,3021,3149,3277,3387,3388,3405,3530,6980,7082,7083,43456,69702,69759,69817,69939,69940,70080,70197,70477,70722,70850,71103,71231,71350,72767,73028,73029]);function mFe(e){return new RegExp("\\p{Script=Greek}","u").test(String.fromCodePoint(e))}function dFe(e){return new RegExp("\\p{Script=Hebrew}","u").test(String.fromCodePoint(e))}function fFe(e){return new RegExp("\\p{Script=Hiragana}","u").test(String.fromCodePoint(e))}function gFe(e){return new RegExp("\\p{Script=Katakana}","u").test(String.fromCodePoint(e))}function hFe(e){return new RegExp("\\p{Script=Han}","u").test(String.fromCodePoint(e))}function yFe(e){return e>=1632&&e<=1641}function EFe(e){return e>=1776&&e<=1785}function jX(e){return pFe.has(e)}function HX(e){if(e.length===0)return Vt();let t=[...e].map(a=>a.codePointAt(0)),r=t.length;if(t[0]===45||t[r-1]===45||r>=4&&t[2]===45&&t[3]===45||lFe(t[0]))return!1;let o=!1,i=!1,s=!1;for(let a=0;a<r;a++){let c=t[a];if(uFe.has(c))return!1;(fFe(c)||gFe(c)||hFe(c))&&(o=!0),yFe(c)&&(i=!0),EFe(c)&&(s=!0);let l=t[a-1],m=t[a+1];switch(c){case 183:if(l!==108||m!==108)return!1;break;case 885:if(m===void 0||!mFe(m))return!1;break;case 1523:case 1524:if(l===void 0||!dFe(l))return!1;break;case 8204:if(l===void 0||l<128&&!jX(l))return!1;break;case 8205:if(l===void 0||!jX(l))return!1;break;case 12539:break}}return!(e.includes("\u30FB")&&!o||i&&s)}function SFe(e){if(e.charCodeAt(0)===45||e.charCodeAt(e.length-1)===45||e.length>=4&&e.charCodeAt(2)===45&&e.charCodeAt(3)===45)return!1;for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(!(r>=97&&r<=122||r>=65&&r<=90||r>=48&&r<=57||r===45))return!1}return!0}function KX(e){return e.toLowerCase().startsWith("xn--")}function zX(e){try{let t=e.slice(4).toLowerCase();if(t.lastIndexOf("-")===0)return!1;let o=qX(t);return o?HX(o):!1}catch{return!1}}function YX(e){return e.length===0||e.length>63?!1:KX(e)?zX(e):HX(e)}function VX(e){return e.length===0||e.length>63?!1:KX(e)?zX(e):SFe(e)}function ZO(e){if(e.length===0||e.length>253||e.charCodeAt(e.length-1)===46)return!1;for(let t of e.split("."))if(!VX(t))return!1;return!0}var bFe=/^(?!.*\.\.)[\p{L}\p{N}!#$%&'*+/=?^_`{|}~-]+(?:\.[\p{L}\p{N}!#$%&'*+/=?^_`{|}~-]+)*@[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,61}[\p{L}\p{N}])?(?:\.[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,61}[\p{L}\p{N}])?)*$/iu;function XO(e){return bFe.test(e)}function eC(e){if(e.length===0||e.includes(" "))return!1;let t=e.normalize("NFC").replace(/[\u002E\u3002\uFF0E\uFF61]/g,".");if(t.length>253)return!1;for(let r of t.split("."))if(!YX(r))return!1;return!0}function VM(e,t,r){let o=0,i=0,s=0,a=0;for(let c=t;c<r;c++){let l=e.charCodeAt(c);if(l===46){if(s===0||i>255||a===48&&s>1)return!1;o++,i=0,s=0,a=0}else if(l>=48&&l<=57)s===0&&(a=l),i=i*10+(l-48),s++;else return!1}return o===3&&s>0&&i<=255&&!(a===48&&s>1)}function tC(e){return VM(e,0,e.length)}function xFe(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function rC(e){let t=e.length;if(t===0)return!1;let r=0,o=!1,i=0;if(e.charCodeAt(0)===58&&e.charCodeAt(1)===58){if(t===2)return!0;o=!0,i=2}for(;i<t;){let s=0,a=i;for(;i<t&&xFe(e.charCodeAt(i));)i++,s++;if(s===0)return!1;let c=e.charCodeAt(i);if(c===46){if(!VM(e,a,t))return!1;r+=2,i=t;break}if(s>4)return!1;if(r++,i===t)break;if(c!==58)return!1;if(i++,e.charCodeAt(i)===58){if(o||e.charCodeAt(i+1)===58)return!1;if(o=!0,i++,i===t)break}}return o?r<=7:r===8}function QX(e){try{return new URL(e,"http://example.com"),!0}catch{return!1}}function nC(e){if(e.includes(" ")||e.includes("\\")||/[\x00-\x1F\x7F]/.test(e)||/%(?![0-9a-fA-F]{2})/.test(e))return!1;if(e==="")return!0;let t=e.indexOf(":");return t>0&&/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e.substring(0,t))?QX(e):e.match(/^([a-zA-Z][a-zA-Z0-9+\-.]*)(\/\/)/)&&t===-1?!1:QX(e)}function oC(e){try{return new URL(e),!0}catch{return!1}}var IFe=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;function iC(e){return IFe.test(e)}var _Fe=/^(?:\/(?:[^~/]|~0|~1)*)*$/;function sC(e){return _Fe.test(e)}function aC(e){if(e.length===0)return!1;try{return new RegExp(e),!0}catch{return!1}}var AFe=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function cC(e){return AFe.test(e)}var OFe=/^(?!.*[^\x00-\x7F])(?!.*\\)(?:(?:[a-z][a-z0-9+\-.]*:)?(?:\/\/[^\s[\]{}<>^`|]*)?|[^\s[\]{}<>^`|]*)(?:\?[^\s[\]{}<>^`|]*)?(?:#[^\s[\]{}<>^`|]*)?$/i;function lC(e){return OFe.test(e)}var CFe=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i;function uC(e){return CFe.test(e)}function WX(e){return e>=97&&e<=122||e>=65&&e<=90}function JX(e){return WX(e)||e>=48&&e<=57}function pC(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function RFe(e){return JX(e)||e===43||e===45||e===46}function QM(e){return JX(e)||e===45||e===46||e===95||e===126}function WM(e){return e===33||e===36||e===38||e===39||e===40||e===41||e===42||e===43||e===44||e===59||e===61}function PFe(e){return QM(e)||WM(e)||e===58||e===64}function mC(e){let t=e.length;if(t===0||!WX(e.charCodeAt(0)))return!1;let r=1;for(;r<t;){let o=e.charCodeAt(r);if(o===58)break;if(!RFe(o))return!1;r++}if(e.charCodeAt(r)!==58)return!1;if(r++,e.charCodeAt(r)===47&&e.charCodeAt(r+1)===47){r+=2;let o=r,i=-1;for(let s=r;s<t;s++){let a=e.charCodeAt(s);if(a===64){i=s;break}if(a===47||a===63||a===35)break}if(i!==-1){for(let s=o;s<i;s++){let a=e.charCodeAt(s);if(a===91||a===93)return!1;if(a===37){if(s+2>=i||!pC(e.charCodeAt(s+1))||!pC(e.charCodeAt(s+2)))return!1;s+=2}else if(!QM(a)&&!WM(a)&&a!==58)return!1}r=i+1}if(e.charCodeAt(r)===91){for(r++;r<t&&e.charCodeAt(r)!==93;)r++;if(e.charCodeAt(r)!==93)return!1;r++}else for(;r<t;){let s=e.charCodeAt(r);if(s===47||s===63||s===35||s===58)break;if(s<128&&!QM(s)&&!WM(s))return!1;r++}if(e.charCodeAt(r)===58)for(r++;r<t;){let s=e.charCodeAt(r);if(s===47||s===63||s===35)break;if(s<48||s>57)return!1;r++}}for(;r<t;){let o=e.charCodeAt(r);if(o===37){if(r+2>=t||!pC(e.charCodeAt(r+1))||!pC(e.charCodeAt(r+2)))return!1;r+=2}else{if(o>127)return!1;if(!(PFe(o)||o===47||o===63||o===35))return!1}r++}return!0}var wFe=/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu;function dC(e){return wFe.test(e)}var vFe=/^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;function fC(e){return vFe.test(e)}var mr=new Map;function ZX(){mr.clear()}function UFe(){return[...mr.entries()]}function NFe(e,t){mr.set(e,t)}function kFe(e){return mr.has(e)}function LFe(e){return mr.get(e)}function MFe(e,t){return mr.get(e)?.(t)??!0}function XX(){ZX(),mr.set("date-time",VO),mr.set("date",Mf),mr.set("duration",QO),mr.set("email",WO),mr.set("hostname",ZO),mr.set("idn-email",XO),mr.set("idn-hostname",eC),mr.set("ipv4",tC),mr.set("ipv6",rC),mr.set("iri-reference",nC),mr.set("iri",oC),mr.set("json-pointer-uri-fragment",iC),mr.set("json-pointer",sC),mr.set("regex",aC),mr.set("relative-json-pointer",cC),mr.set("time",Df),mr.set("uri-reference",lC),mr.set("uri-template",uC),mr.set("uri",mC),mr.set("url",dC),mr.set("uuid",fC)}XX();function JM(e,t,r,o){return Ff.Test(r.format,o)}function eee(e,t,r,o,i,s){return JM(e,t,i,s)||t.AddError({keyword:"format",schemaPath:r,instancePath:o,params:{format:i.format}})}function tee(e,t,r,o){let i=MM(r)?r.then:!0,s=bM(r)?r.else:!0;return gt(e,t,r.if,o)?gt(e,t,i,o):gt(e,t,s,o)}function ree(e,t,r,o,i,s){let a=MM(i)?i.then:!0,c=bM(i)?i.else:!0,l=new Cn,m=rr(e,l,`${r}/if`,o,i.if,s)?rr(e,l,`${r}/then`,o,a,s)||t.AddError({keyword:"if",schemaPath:r,instancePath:o,params:{failingKeyword:"then"}}):rr(e,t,`${r}/else`,o,c,s)||t.AddError({keyword:"if",schemaPath:r,instancePath:o,params:{failingKeyword:"else"}});return m&&t.Merge([l]),m}function DFe(e,t,r,o){return u.Every(r.items,0,(i,s)=>u.IsLessEqualThan(o.length,s)||Ci(e,t,i,o[s])&&t.AddIndex(s))}function FFe(e,t,r,o,i,s){return u.EveryAll(i.items,0,(a,c)=>{let l=`${r}/items/${c}`,m=`${o}/${c}`;return u.IsLessEqualThan(s.length,c)||Ri(e,t,l,m,a,s[c])&&t.AddIndex(c)})}function $Fe(e,t,r,o){let i=Nf(r)?r.prefixItems.length:0;return u.Every(o,i,(s,a)=>Ci(e,t,r.items,s)&&t.AddIndex(a))}function GFe(e,t,r,o,i,s){let a=Nf(i)?i.prefixItems.length:0;return u.EveryAll(s,a,(c,l)=>{let m=`${r}/items`,y=`${o}/${l}`;return Ri(e,t,m,y,i.items,c)&&t.AddIndex(l)})}function nee(e,t,r,o){return AM(r)?DFe(e,t,r,o):$Fe(e,t,r,o)}function oee(e,t,r,o,i,s){return AM(i)?FFe(e,t,r,o,i,s):GFe(e,t,r,o,i,s)}function BFe(e){return Wp(e)}function ZM(e,t,r,o){if(!BFe(r))return!0;let i=u.Counted(o,s=>gt(e,t,r.contains,s));return u.IsLessEqualThan(i,r.maxContains)}function iee(e,t,r,o,i,s){let a=Jp(i)?i.minContains:1;return ZM(e,t,i,s)||t.AddError({keyword:"contains",schemaPath:r,instancePath:o,params:{minContains:a,maxContains:i.maxContains}})}function XM(e,t,r,o){return u.IsLessEqualThan(o,r.maximum)}function see(e,t,r,o,i,s){return XM(e,t,i,s)||t.AddError({keyword:"maximum",schemaPath:r,instancePath:o,params:{comparison:"<=",limit:i.maximum}})}function eD(e,t,r,o){return u.IsLessEqualThan(o.length,r.maxItems)}function aee(e,t,r,o,i,s){return eD(e,t,i,s)||t.AddError({keyword:"maxItems",schemaPath:r,instancePath:o,params:{limit:i.maxItems}})}function tD(e,t,r,o){return u.IsMaxLength(o,r.maxLength)}function cee(e,t,r,o,i,s){return tD(e,t,i,s)||t.AddError({keyword:"maxLength",schemaPath:r,instancePath:o,params:{limit:i.maxLength}})}function rD(e,t,r,o){return u.IsLessEqualThan(u.Keys(o).length,r.maxProperties)}function lee(e,t,r,o,i,s){return rD(e,t,i,s)||t.AddError({keyword:"maxProperties",schemaPath:r,instancePath:o,params:{limit:i.maxProperties}})}function qFe(e){return Wp(e)}function nD(e,t,r,o){if(!qFe(r))return!0;let i=u.Counted(o,(s,a)=>gt(e,t,r.contains,s)&&t.AddIndex(a));return u.IsGreaterEqualThan(i,r.minContains)}function uee(e,t,r,o,i,s){return nD(e,t,i,s)||t.AddError({keyword:"contains",schemaPath:r,instancePath:o,params:{minContains:i.minContains}})}function oD(e,t,r,o){return u.IsGreaterEqualThan(o,r.minimum)}function pee(e,t,r,o,i,s){return oD(e,t,i,s)||t.AddError({keyword:"minimum",schemaPath:r,instancePath:o,params:{comparison:">=",limit:i.minimum}})}function iD(e,t,r,o){return u.IsGreaterEqualThan(o.length,r.minItems)}function mee(e,t,r,o,i,s){return iD(e,t,i,s)||t.AddError({keyword:"minItems",schemaPath:r,instancePath:o,params:{limit:i.minItems}})}function sD(e,t,r,o){return u.IsMinLength(o,r.minLength)}function dee(e,t,r,o,i,s){return sD(e,t,i,s)||t.AddError({keyword:"minLength",schemaPath:r,instancePath:o,params:{limit:i.minLength}})}function aD(e,t,r,o){return u.IsGreaterEqualThan(u.Keys(o).length,r.minProperties)}function fee(e,t,r,o,i,s){return aD(e,t,i,s)||t.AddError({keyword:"minProperties",schemaPath:r,instancePath:o,params:{limit:i.minProperties}})}function cD(e,t,r,o){return u.IsMultipleOf(o,r.multipleOf)}function gee(e,t,r,o,i,s){return cD(e,t,i,s)||t.AddError({keyword:"multipleOf",schemaPath:r,instancePath:o,params:{multipleOf:i.multipleOf}})}function lD(e,t,r,o){let i=new go;return!gt(e,i,r.not,o)&&t.Merge([i])}function hee(e,t,r,o,i,s){return lD(e,t,i,s)||t.AddError({keyword:"not",schemaPath:r,instancePath:o,params:{}})}function yee(e,t,r,o){let i=r.oneOf.reduce((s,a)=>{let c=new go;return gt(e,c,a,o)?[...s,c]:s},[]);return u.IsEqual(i.length,1)&&t.Merge(i)}function Eee(e,t,r,o,i,s){let a=[],c=[],l=i.oneOf.reduce((y,T,S)=>{let E=new Cn,_=`${r}/oneOf/${S}`,A=rr(e,E,_,o,T,s);return A&&c.push(S),A||a.push(E),A?[...y,E]:y},[]),m=u.IsEqual(l.length,1)&&t.Merge(l);return!m&&u.IsEqual(c.length,0)&&a.forEach(y=>y.GetErrors().forEach(T=>t.AddError(T))),m||t.AddError({keyword:"oneOf",schemaPath:r,instancePath:o,params:{passingSchemas:c}})}function uD(e,t,r,o){return(u.IsString(r.pattern)?new RegExp(r.pattern,"u"):r.pattern).test(o)}function See(e,t,r,o,i,s){return uD(e,t,i,s)||t.AddError({keyword:"pattern",schemaPath:r,instancePath:o,params:{pattern:i.pattern}})}function Tee(e,t,r,o){return u.Every(u.Entries(r.patternProperties),0,([i,s])=>{let a=new RegExp(i,"u");return u.Every(u.Entries(o),0,([c,l])=>!a.test(c)||Ci(e,t,s,l)&&t.AddKey(c))})}function bee(e,t,r,o,i,s){return u.EveryAll(u.Entries(i.patternProperties),0,([a,c])=>{let l=`${r}/patternProperties/${a}`,m=new RegExp(a,"u");return u.EveryAll(u.Entries(s),0,([y,T])=>{let S=`${o}/${y}`;return!m.test(y)||Ri(e,t,l,S,c,T)&&t.AddKey(y)})})}function xee(e,t,r,o){return u.IsEqual(o.length,0)||u.Every(r.prefixItems,0,(i,s)=>u.IsLessEqualThan(o.length,s)||Ci(e,t,i,o[s])&&t.AddIndex(s))}function Iee(e,t,r,o,i,s){return u.IsEqual(s.length,0)||u.EveryAll(i.prefixItems,0,(a,c)=>{let l=`${r}/prefixItems/${c}`,m=`${o}/${c}`;return u.IsLessEqualThan(s.length,c)||Ri(e,t,l,m,a,s[c])&&t.AddIndex(c)})}function pD(e,t){return e.includes(t)||In.Get().exactOptionalPropertyTypes}function mD(e,t){return u.IsUndefined(e[t])}function _ee(e,t,r,o){let i=Zp(r)?r.required:[];return u.Every(u.Entries(r.properties),0,([a,c])=>{let l=!u.HasPropertyKey(o,a)||Ci(e,t,c,o[a])&&t.AddKey(a);return pD(i,a)?l:mD(o,a)||l})}function Aee(e,t,r,o,i,s){let a=Zp(i)?i.required:[];return u.EveryAll(u.Entries(i.properties),0,([l,m])=>{let y=`${r}/properties/${l}`,T=`${o}/${l}`,S=()=>!u.HasPropertyKey(s,l)||Ri(e,t,y,T,m,s[l])&&t.AddKey(l);return pD(a,l)?S():mD(s,l)||S()})}function Oee(e,t,r,o){return u.Every(u.Keys(o),0,(i,s)=>gt(e,t,r.propertyNames,i))}function Cee(e,t,r,o,i,s){let a=[];return u.EveryAll(u.Keys(s),0,(l,m)=>{let y=`${o}/${l}`,T=`${r}/propertyNames`,S=new Cn,E=rr(e,S,T,y,i.propertyNames,l);return E||a.push(l),E})||t.AddError({keyword:"propertyNames",schemaPath:r,instancePath:o,params:{propertyNames:a}})}function Ree(e,t,r,o){let i=e.RecursiveRef(r)??!1;return $e(i)&>(e,t,i,o)}function Pee(e,t,r,o,i,s){let a=e.RecursiveRef(i)??!1;return $e(a)&&rr(e,t,"#",o,a,s)}function wee(e,t,r,o){let i=e.Ref(r)??!1,s=new go,a=$e(i)&>(e,s,i,o);return a&&t.Merge([s]),a}function vee(e,t,r,o,i,s){let a=e.Ref(i)??!1,c=new Cn,l=$e(a)&&rr(e,c,"#",o,a,s);return l&&t.Merge([c]),l||c.GetErrors().forEach(m=>t.AddError(m)),l}function Uee(e,t,r,o){return u.Every(r.required,0,i=>u.HasPropertyKey(o,i))}function Nee(e,t,r,o,i,s){let a=[];return u.EveryAll(i.required,0,l=>{let m=u.HasPropertyKey(s,l);return m||a.push(l),m})||t.AddError({keyword:"required",schemaPath:r,instancePath:o,params:{requiredProperties:a}})}function dD(e,t,r,o,i){return u.IsEqual(r,"object")?u.IsObjectNotArray(i):u.IsEqual(r,"array")?u.IsArray(i):u.IsEqual(r,"boolean")?u.IsBoolean(i):u.IsEqual(r,"integer")?u.IsInteger(i):u.IsEqual(r,"number")?u.IsNumber(i):u.IsEqual(r,"null")?u.IsNull(i):u.IsEqual(r,"string")?u.IsString(i):u.IsEqual(r,"bigint")?u.IsBigInt(i):u.IsEqual(r,"constructor")?u.IsConstructor(i):u.IsEqual(r,"function")?u.IsFunction(i):u.IsEqual(r,"symbol")?u.IsSymbol(i):u.IsEqual(r,"undefined")?u.IsUndefined(i):u.IsEqual(r,"void")?u.IsUndefined(i):!0}function kee(e,t,r,o,i){return u.Some(r,s=>dD(e,t,s,o,i))}function Lee(e,t,r,o){return u.IsArray(r.type)?kee(e,t,r.type,r,o):dD(e,t,r.type,r,o)}function Mee(e,t,r,o,i,s){return(u.IsArray(i.type)?kee(e,t,i.type,i,s):dD(e,t,i.type,i,s))||t.AddError({keyword:"type",schemaPath:r,instancePath:o,params:{type:i.type}})}function Dee(e,t,r,o){let i=t.GetIndices();return u.Every(o,0,(s,a)=>(i.has(a)||gt(e,t,r.unevaluatedItems,s))&&t.AddIndex(a))}function Fee(e,t,r,o,i,s){let a=t.GetIndices(),c=[];return u.EveryAll(s,0,(m,y)=>{let T=new Cn,S=(a.has(y)||rr(e,T,r,o,i.unevaluatedItems,m))&&t.AddIndex(y);return S||c.push(y),S})||t.AddError({keyword:"unevaluatedItems",schemaPath:r,instancePath:o,params:{unevaluatedItems:c}})}function $ee(e,t,r,o){let i=t.GetKeys();return u.Every(u.Entries(o),0,([s,a])=>i.has(s)||gt(e,t,r.unevaluatedProperties,a)&&t.AddKey(s))}function Gee(e,t,r,o,i,s){let a=t.GetKeys(),c=[];return u.EveryAll(u.Entries(s),0,([m,y])=>{let T=new Cn,S=a.has(m)||rr(e,T,r,o,i.unevaluatedProperties,y)&&t.AddKey(m);return S||c.push(m),S})||t.AddError({keyword:"unevaluatedProperties",schemaPath:r,instancePath:o,params:{unevaluatedProperties:c}})}function Bee(e){return!u.IsEqual(e.uniqueItems,!1)}function qee(e,t,r,o){if(!Bee(r))return!0;let i=new Set(o.map(Ap.Hash)).size,s=o.length;return u.IsEqual(i,s)}function jee(e,t,r,o,i,s){if(!Bee(i))return!0;let a=new Set,c=s.reduce((m,y,T)=>{let S=Ap.Hash(y);return a.has(S)?[...m,T]:(a.add(S),m)},[]);return u.IsEqual(c.length,0)||t.AddError({keyword:"uniqueItems",schemaPath:r,instancePath:o,params:{duplicateItems:c}})}function Ci(e,t,r,o){return t.Push()&>(e,t,r,o)&&t.Pop()}function gt(e,t,r,o){e.Push(r);let i=jO(r)?$M(e,t,r,o):(!DM(r)||Lee(e,t,r,o))&&(!(u.IsObject(o)&&!u.IsArray(o))||(!Zp(r)||Uee(e,t,r,o))&&(!Lc(r)||xX(e,t,r,o))&&(!yM(r)||vX(e,t,r,o))&&(!EM(r)||NX(e,t,r,o))&&(!SM(r)||LX(e,t,r,o))&&(!fS(r)||Tee(e,t,r,o))&&(!gS(r)||_ee(e,t,r,o))&&(!NM(r)||Oee(e,t,r,o))&&(!mS(r)||aD(e,t,r,o))&&(!PM(r)||rD(e,t,r,o)))&&(!u.IsArray(o)||(!dM(r)||SX(e,t,r,o))&&(!Wp(r)||BM(e,t,r,o))&&(!vf(r)||nee(e,t,r,o))&&(!CM(r)||ZM(e,t,r,o))&&(!HO(r)||eD(e,t,r,o))&&(!Jp(r)||nD(e,t,r,o))&&(!Uf(r)||iD(e,t,r,o))&&(!Nf(r)||xee(e,t,r,o))&&(!kf(r)||qee(e,t,r,o)))&&(!u.IsString(o)||(!RM(r)||tD(e,t,r,o))&&(!pS(r)||sD(e,t,r,o))&&(!uS(r)||JM(e,t,r,o))&&(!dS(r)||uD(e,t,r,o)))&&(!(u.IsNumber(o)||u.IsBigInt(o))||(!IM(r)||KM(e,t,r,o))&&(!Mc(r)||zM(e,t,r,o))&&(!OM(r)||XM(e,t,r,o))&&(!Fc(r)||oD(e,t,r,o))&&(!wM(r)||cD(e,t,r,o)))&&(!LM(r)||wee(e,t,r,o))&&(!kM(r)||Ree(e,t,r,o))&&(!TM(r)||DX(e,t,r,o))&&(!hM(r)||GM(e,t,r,o))&&(!xM(r)||HM(e,t,r,o))&&(!_M(r)||tee(e,t,r,o))&&(!vM(r)||lD(e,t,r,o))&&(!fM(r)||_X(e,t,r,o))&&(!gM(r)||OX(e,t,r,o))&&(!UM(r)||yee(e,t,r,o))&&(!zO(r)||!u.IsArray(o)||Dee(e,t,r,o))&&(!YO(r)||!u.IsObject(o)||$ee(e,t,r,o))&&(!mM(r)||hX(e,t,r,o));return e.Pop(r),i}function Ri(e,t,r,o,i,s){return t.Push()&&rr(e,t,r,o,i,s)&&t.Pop()}function rr(e,t,r,o,i,s){e.Push(i);let a=jO(i)?RX(e,t,r,o,i,s):!!(+(!DM(i)||Mee(e,t,r,o,i,s))&+(!(u.IsObject(s)&&!u.IsArray(s))||!!(+(!Zp(i)||Nee(e,t,r,o,i,s))&+(!Lc(i)||IX(e,t,r,o,i,s))&+(!yM(i)||UX(e,t,r,o,i,s))&+(!EM(i)||kX(e,t,r,o,i,s))&+(!SM(i)||MX(e,t,r,o,i,s))&+(!fS(i)||bee(e,t,r,o,i,s))&+(!gS(i)||Aee(e,t,r,o,i,s))&+(!NM(i)||Cee(e,t,r,o,i,s))&+(!mS(i)||fee(e,t,r,o,i,s))&+(!PM(i)||lee(e,t,r,o,i,s))))&+(!u.IsArray(s)||!!(+(!dM(i)||TX(e,t,r,o,i,s))&+(!Wp(i)||wX(e,t,r,o,i,s))&+(!vf(i)||oee(e,t,r,o,i,s))&+(!CM(i)||iee(e,t,r,o,i,s))&+(!HO(i)||aee(e,t,r,o,i,s))&+(!Jp(i)||uee(e,t,r,o,i,s))&+(!Uf(i)||mee(e,t,r,o,i,s))&+(!Nf(i)||Iee(e,t,r,o,i,s))&+(!kf(i)||jee(e,t,r,o,i,s))))&+(!u.IsString(s)||!!(+(!RM(i)||cee(e,t,r,o,i,s))&+(!pS(i)||dee(e,t,r,o,i,s))&+(!uS(i)||eee(e,t,r,o,i,s))&+(!dS(i)||See(e,t,r,o,i,s))))&+(!(u.IsNumber(s)||u.IsBigInt(s))||!!(+(!IM(i)||GX(e,t,r,o,i,s))&+(!Mc(i)||BX(e,t,r,o,i,s))&+(!OM(i)||see(e,t,r,o,i,s))&+(!Fc(i)||pee(e,t,r,o,i,s))&+(!wM(i)||gee(e,t,r,o,i,s))))&+(!LM(i)||vee(e,t,r,o,i,s))&+(!kM(i)||Pee(e,t,r,o,i,s))&+(!TM(i)||FX(e,t,r,o,i,s))&+(!hM(i)||PX(e,t,r,o,i,s))&+(!xM(i)||$X(e,t,r,o,i,s))&+(!_M(i)||ree(e,t,r,o,i,s))&+(!vM(i)||hee(e,t,r,o,i,s))&+(!fM(i)||AX(e,t,r,o,i,s))&+(!gM(i)||CX(e,t,r,o,i,s))&+(!UM(i)||Eee(e,t,r,o,i,s))&+(!zO(i)||!u.IsArray(s)||Fee(e,t,r,o,i,s))&+(!YO(i)||!u.IsObject(s)||Gee(e,t,r,o,i,s)))&&(!mM(i)||yX(e,t,r,o,i,s));return e.Pop(i),a}var su={};wi(su,{DynamicRef:()=>n1e,Ref:()=>gD});var $f={};wi($f,{Delete:()=>WFe,Get:()=>VFe,Has:()=>YFe,Indices:()=>SS,Set:()=>QFe});function Hee(e){if(e.length===0)throw Error("Cannot set root")}function Kee(e){if(!u.IsObject(e))throw Error("Cannot set value")}function jFe(e){if(u.IsUnsafePropertyKey(e))throw Error("Pointer contains unsafe property key")}function zee(e){for(let t of e)jFe(t)}function HFe(e){return/^(0|[1-9]\d*)$/.test(e)}function Yee(e){return[e.slice(0,e.length-1),e.slice(e.length-1)[0]]}function KFe(e,t){return u.IsObject(t)&&u.HasPropertyKey(t,e)}function zFe(e,t){return u.IsObject(t)&&!u.IsUnsafePropertyKey(e)?t[e]:void 0}function fD(e,t){return e.reduce((r,o)=>zFe(o,r),t)}function SS(e){if(u.IsEqual(e.length,0))return[];let t=e.split("/").map(r=>r.replace(/~1/g,"/").replace(/~0/g,"~"));return t.length>0&&t[0]===""?t.slice(1):t}function YFe(e,t){let r=e;return SS(t).every(o=>KFe(o,r)?(r=r[o],!0):!1)}function VFe(e,t){let r=SS(t);return fD(r,e)}function QFe(e,t,r){let o=SS(t);Hee(o),zee(o);let[i,s]=Yee(o),a=fD(i,e);return Kee(a),a[s]=r,e}function WFe(e,t){let r=SS(t);Hee(r),zee(r);let[o,i]=Yee(r),s=fD(o,e);return Kee(s),u.IsArray(s)&&HFe(i)?s.splice(+i,1):delete s[i],e}function JFe(e,t,r){if(e.$id===r.hash)return e;let o=new URL(e.$id,t.href),i=new URL(r.href,t.href);if(u.IsEqual(o.pathname,i.pathname))return r.hash.startsWith("#")?Vee(e,t,r):e}function ZFe(e,t,r){let o=new URL(`#${e.$anchor}`,t.href),i=new URL(r.href,t.href);return u.IsEqual(o.href,i.href)?e:void 0}function XFe(e,t,r){let o=new URL(`#${e.$dynamicAnchor}`,t.href),i=new URL(r.href,t.href);return u.IsEqual(o.href,i.href)?e:void 0}function Vee(e,t,r){if(r.href.endsWith("#"))return e;if(!r.hash.startsWith("#"))return;let o=decodeURIComponent(r.hash.slice(1));if(o.startsWith("/"))return $f.Get(e,o)}function e1e(e,t,r){if(Dc(e)){let o=JFe(e,t,r);if(!u.IsUndefined(o))return o}if(lS(e)){let o=ZFe(e,t,r);if(!u.IsUndefined(o))return o}if(iu(e)){let o=XFe(e,t,r);if(!u.IsUndefined(o))return o}return Vee(e,t,r)}function t1e(e,t,r){return e.reduce((o,i)=>{let s=hD(i,t,r);return u.IsUndefined(s)?o:s},void 0)}function r1e(e,t,r){return u.Keys(e).reduce((o,i)=>{let s=hD(e[i],t,r);return u.IsUndefined(s)?o:s},void 0)}function hD(e,t,r){let o=Cs(e)&&Dc(e)?new URL(e.$id,t.href):t;if(Cs(e)){let i=e1e(e,o,r);if(!u.IsUndefined(i))return i}if(u.IsArray(e))return t1e(e,o,r);if(u.IsObject(e))return r1e(e,o,r)}function gD(e,t){let r=new URL("http://unknown/"),o=Dc(e)?new URL(e.$id,r.href):r,i=new URL(t,o.href);return hD(e,o,i)}function n1e(e,t,r,o){let i=r.$dynamicRef.startsWith("#")?gD(t,r.$dynamicRef):gD(e,r.$dynamicRef);return u.IsUndefined(i)?void 0:!Cs(i)||!iu(i)||new URL(r.$dynamicRef,"http://unknown/").hash.startsWith("#/")?i:o.find(c=>c.$dynamicAnchor===i.$dynamicAnchor)??i}var Gf=function(e,t,r,o){if(r==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?o:r==="a"?o.call(e):o?o.value:t.get(e)},au,Qee,Wee,Jee,Zee,em=class{constructor(t,r){au.add(this),this.context=t,this.schema=r,this.ids=[],this.anchors=[],this.recursiveAnchors=[],this.dynamicAnchors=[]}BaseURL(){return this.ids.reduce((t,r)=>new URL(r.$id,t),new URL("http://unknown"))}Base(){return this.ids[this.ids.length-1]??this.schema}Push(t){Cs(t)&&(Dc(t)&&(this.ids.push(t),Gf(this,au,"m",Qee).call(this,t)),lS(t)&&this.anchors.push(t),KO(t)&&this.recursiveAnchors.push(t),iu(t)&&this.dynamicAnchors.push(t))}Pop(t){Cs(t)&&(Dc(t)&&(this.ids.pop(),Gf(this,au,"m",Wee).call(this,t)),lS(t)&&this.anchors.pop(),KO(t)&&this.recursiveAnchors.pop(),iu(t)&&this.dynamicAnchors.pop())}Ref(t){return Gf(this,au,"m",Jee).call(this,t)??Gf(this,au,"m",Zee).call(this,t)}RecursiveRef(t){return KO(this.Base())?su.Ref(this.recursiveAnchors[0],t.$recursiveRef):su.Ref(this.Base(),t.$recursiveRef)}DynamicRef(t){let r=this.schema;return su.DynamicRef(r,this.Base(),t,this.dynamicAnchors)}};au=new WeakSet,Qee=function e(t,r=!0){if(!Cs(t))return;let o=t;if(!(!r&&Dc(o))){!r&&iu(o)&&this.dynamicAnchors.push(o);for(let i of u.Keys(o))Gf(this,au,"m",e).call(this,o[i],!1)}},Wee=function e(t,r=!0){if(!Cs(t))return;let o=t;if(!(!r&&Dc(o))){!r&&iu(o)&&this.dynamicAnchors.pop();for(let i of u.Keys(o))Gf(this,au,"m",e).call(this,o[i],!1)}},Jee=function(t){return u.HasPropertyKey(this.context,t.$ref)?this.context[t.$ref]:void 0},Zee=function(t){let r=this.schema;return t.$ref.startsWith("#")?su.Ref(this.Base(),t.$ref):su.Ref(r,t.$ref)};function gC(...e){let[t,r,o]=Et.Match(e,{3:(y,T,S)=>[y,T,S],2:(y,T)=>[{},y,T]}),i=In.Get(),s=QV(),a=[],c=new em(t,r),l=new hS(y=>{if(!u.IsGreaterEqualThan(a.length,i.maxErrors))return a.push({...y,message:s(y)})});return[rr(c,l,"#","",r,o),a]}function ED(...e){let[t,r,o]=Et.Match(e,{3:(a,c,l)=>[a,c,l],2:(a,c)=>[{},a,c]}),i=new em(t,r),s=new go;return gt(i,s,r,o)}function qt(...e){let[t,r,o]=Et.Match(e,{3:(i,s,a)=>[i,s,a],2:(i,s)=>[{},i,s]});return ED(t,r,o)}function Sa(...e){let[t,r,o]=Et.Match(e,{3:(a,c,l)=>[a,c,l],2:(a,c)=>[{},a,c]}),[i,s]=gC(t,r,o);return s}var cu=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 Xee(e,t,r){return u.IsArray(r)?r.map(o=>Rn(e,t.items,o)):r}function ete(e,t,r){return Rn({...e,...t.$defs},_n(t.$ref),r)}function s1e(e,t){let r=u.HasPropertyKey(t,"unevaluatedProperties")?{additionalProperties:t.unevaluatedProperties}:{},o=Yi(e,t),i=Hn(o);return Ne(i)?dO(i,r):i}function tte(e,t,r){let o=s1e(e,t);return Rn(e,o,r)}function hC(e){return u.HasPropertyKey(e,"additionalProperties")?e.additionalProperties:void 0}function rte(e,t,r){if(!u.IsObject(r)||u.IsArray(r))return r;let o=hC(t);for(let i of u.Keys(r)){if(u.HasPropertyKey(t.properties,i)){r[i]=Rn(e,t.properties[i],r[i]);continue}if(u.IsBoolean(o)&&u.IsEqual(o,!0)||Or(o)&&qt(e,o,r[i])){r[i]=Rn(e,o,r[i]);continue}delete r[i]}return r}function nte(e,t,r){if(!u.IsObject(r))return r;let o=hC(t),[i,s]=[new RegExp(On(t)),lr(t)];for(let a of u.Keys(r)){if(i.test(a)){r[a]=Rn(e,s,r[a]);continue}if(u.IsBoolean(o)&&u.IsEqual(o,!0)||Or(o)&&qt(e,o,r[a])){r[a]=Rn(e,o,r[a]);continue}delete r[a]}return r}function ote(e,t,r){return u.HasPropertyKey(e,t.$ref)?Rn(e,e[t.$ref],r):r}function ite(e,t,r){if(!u.IsArray(r))return r;let o=Math.min(r.length,t.items.length);for(let i=0;i<o;i++)r[i]=Rn(e,t.items[i],r[i]);return u.IsGreaterThan(r.length,o)?r.slice(0,o):r}function Mr(e){return xp(e)}function ste(e,t,r){for(let o of t.anyOf){let i=Rn(e,o,Mr(r));if(qt(e,o,i))return i}return r}function Rn(e,t,r){return at(t)?Xee(e,t,r):Zt(t)?ete(e,t,r):Ue(t)?tte(e,t,r):Ne(t)?rte(e,t,r):Bt(t)?nte(e,t,r):Dt(t)?ote(e,t,r):Ve(t)?ite(e,t,r):te(t)?ste(e,t,r):r}function a1e(e,t){for(let r of cA.Keys(e))cA.HasPropertyKey(t,r)||(t[r]=e[r]);return t}function c1e(e){let t={};for(let r of cA.Keys(e))t[r]=TS(e[r]);return t}function l1e(e){return SD($7(e))}function SD(e){return e.map(t=>TS(t))}function TS(e){let t=at(e)?vo(TS(e.items),Kd(e)):Ue(e)?kn(SD(e.allOf)):te(e)?Ge(l1e(e.anyOf)):Ne(e)?ve(c1e(e.properties)):Bt(e)?ef(Kl(e),TS(lr(e))):Ve(e)?Nr(SD(e.items)):e;return a1e(e,t)}function Bf(e){return TS(e)}function Ta(...e){let[t,r,o]=Et.Match(e,{3:(s,a,c)=>[s,a,c],2:(s,a)=>[{},s,a]}),i=In.Get().unionPrioritySort?Bf(r):r;return Rn(t,i,o)}var St={};wi(St,{Fail:()=>rm,IsOk:()=>TD,Ok:()=>_e,TryArray:()=>u1e,TryBigInt:()=>bD,TryBoolean:()=>x1e,TryNull:()=>C1e,TryNumber:()=>v1e,TryString:()=>U1e,TryUndefined:()=>D1e});function TD(e){return u.IsObject(e)&&u.HasPropertyKey(e,"value")}function _e(e){return{value:e}}function rm(){}function u1e(e){return u.IsArray(e)?_e(e):_e([e])}function p1e(e){return u.IsEqual(e,!0)?_e(BigInt(1)):_e(BigInt(0))}var m1e=/^-?(0|[1-9]\d*)n$/,d1e=/^-?(0|[1-9]\d*)\.\d+$/,f1e=/^-?(0|[1-9]\d*)$/;function g1e(e){return m1e.test(e)}function h1e(e){return d1e.test(e)}function y1e(e){return f1e.test(e)}function E1e(e){let t=e.toLowerCase();return g1e(e)?_e(BigInt(e.slice(0,e.length-1))):h1e(e)?_e(BigInt(e.split(".")[0])):y1e(e)?_e(BigInt(e)):u.IsEqual(t,"false")?_e(BigInt(0)):u.IsEqual(t,"true")?_e(BigInt(1)):void 0}function bD(e){return u.IsBigInt(e)?_e(e):u.IsBoolean(e)?p1e(e):u.IsNumber(e)?_e(BigInt(Math.trunc(e))):u.IsNull(e)?_e(BigInt(0)):u.IsString(e)?E1e(e):u.IsUndefined(e)?_e(BigInt(0)):void 0}function S1e(e){return u.IsEqual(e,BigInt(0))?_e(!1):u.IsEqual(e,BigInt(1))?_e(!0):void 0}function T1e(e){return u.IsEqual(e,0)?_e(!1):u.IsEqual(e,1)?_e(!0):void 0}function b1e(e){return u.IsEqual(e.toLowerCase(),"false")?_e(!1):u.IsEqual(e.toLowerCase(),"true")?_e(!0):u.IsEqual(e,"0")?_e(!1):u.IsEqual(e,"1")?_e(!0):void 0}function x1e(e){return u.IsBigInt(e)?S1e(e):u.IsBoolean(e)?_e(e):u.IsNumber(e)?T1e(e):u.IsNull(e)?_e(!1):u.IsString(e)?b1e(e):u.IsUndefined(e)?_e(!1):void 0}function I1e(e){return u.IsEqual(e,BigInt(0))?_e(null):void 0}function _1e(e){return u.IsEqual(e,!1)?_e(null):void 0}function A1e(e){return u.IsEqual(e,0)?_e(null):void 0}function O1e(e){let t=e.toLowerCase();return u.IsEqual(t,"undefined")||u.IsEqual(t,"null")||u.IsEqual(e,"")||u.IsEqual(e,"0")?_e(null):void 0}function C1e(e){return u.IsBigInt(e)?I1e(e):u.IsBoolean(e)?_1e(e):u.IsNumber(e)?A1e(e):u.IsNull(e)?_e(null):u.IsString(e)?O1e(e):u.IsUndefined(e)?_e(null):void 0}var ate=BigInt(Number.MAX_SAFE_INTEGER),cte=BigInt(Number.MIN_SAFE_INTEGER);function R1e(e){return e<=ate&&e>=cte?_e(Number(e)):void 0}function P1e(e){return _e(e?1:0)}function w1e(e){let t=+e;if(u.IsNumber(t))return _e(t);let r=e.toLowerCase();if(u.IsEqual(r,"false"))return _e(0);if(u.IsEqual(r,"true"))return _e(1);let o=bD(e);return TD(o)?o.value<=ate&&o.value>=cte?_e(Number(o.value)):void 0:void 0}function v1e(e){return u.IsBigInt(e)?R1e(e):u.IsBoolean(e)?P1e(e):u.IsNumber(e)?_e(e):u.IsNull(e)?_e(0):u.IsString(e)?w1e(e):u.IsUndefined(e)?_e(0):void 0}function U1e(e){return u.IsBigInt(e)?_e(e.toString()):u.IsBoolean(e)?_e(e.toString()):u.IsNumber(e)?_e(e.toString()):u.IsNull(e)?_e("null"):u.IsString(e)?_e(e):u.IsUndefined(e)?_e(""):void 0}function N1e(e){return u.IsEqual(e,BigInt(0))?_e(void 0):void 0}function k1e(e){return u.IsEqual(e,!1)?_e(void 0):void 0}function L1e(e){return u.IsEqual(e,0)?_e(void 0):void 0}function M1e(e){let t=e.toLowerCase();return u.IsEqual(t,"undefined")||u.IsEqual(t,"null")||u.IsEqual(e,"")||u.IsEqual(e,"0")?_e(void 0):void 0}function D1e(e){return u.IsBigInt(e)?N1e(e):u.IsBoolean(e)?k1e(e):u.IsNumber(e)?L1e(e):u.IsNull(e)?_e(void 0):u.IsString(e)?M1e(e):u.IsUndefined(e)?_e(e):void 0}function lte(e,t,r){return St.TryArray(r).value.map(i=>Dr(e,t.items,i))}function ute(e,t,r){let o=St.TryBigInt(r);return St.IsOk(o)?o.value:r}function pte(e,t,r){let o=St.TryBoolean(r);return St.IsOk(o)?o.value:r}function mte(e,t,r){return Dr({...e,...t.$defs},_n(t.$ref),r)}function dte(e,t,r){return Dr(e,Hn(t),r)}function fte(e,t,r){let o=St.TryNumber(r);return St.IsOk(o)?Math.trunc(o.value):r}function gte(e,t,r){let o=Yi(e,t),i=Hn(o);return Dr(e,i,r)}function F1e(e,t,r){let o=St.TryBigInt(r);return St.IsOk(o)&&u.IsEqual(t.const,o.value)?o.value:r}function $1e(e,t,r){let o=St.TryBoolean(r);return St.IsOk(o)&&u.IsEqual(t.const,o.value)?o.value:r}function G1e(e,t,r){let o=St.TryNumber(r);return St.IsOk(o)&&u.IsEqual(t.const,o.value)?o.value:r}function B1e(e,t,r){let o=St.TryString(r);return St.IsOk(o)&&u.IsEqual(t.const,o.value)?o.value:r}function hte(e,t,r){return u.IsEqual(t.const,r)?r:o9(t)?F1e(e,t,r):i9(t)?$1e(e,t,r):yA(t)?G1e(e,t,r):EA(t)?B1e(e,t,r):Vt()}function yte(e,t,r){let o=St.TryNull(r);return St.IsOk(o)?o.value:r}function Ete(e,t,r){let o=St.TryNumber(r);return St.IsOk(o)?o.value:r}function yC(e,t,r,o){let i=u.Keys(o);for(let[s,a]of t)for(let c of i)s.test(c)||(o[c]=Dr(e,r,o[c]));return o}function bS(e,t,r){return fn(e)&&u.IsUndefined(r[t])}function q1e(e,t,r){let o=u.EntriesRegExp(t.properties),i=u.Keys(r);for(let[s,a]of o)for(let c of i)!s.test(c)||bS(a,c,r)||(r[c]=Dr(e,a,r[c]));return u.HasPropertyKey(t,"additionalProperties")&&u.IsObject(t.additionalProperties)?yC(e,o,t.additionalProperties,r):r}function Ste(e,t,r){return u.IsObjectNotArray(r)?q1e(e,t,r):r}function j1e(e,t,r){let o=u.EntriesRegExp(t.patternProperties),i=u.Keys(r);for(let[s,a]of o)for(let c of i)s.test(c)&&(r[c]=Dr(e,a,r[c]));return u.HasPropertyKey(t,"additionalProperties")&&u.IsObject(t.additionalProperties)?yC(e,o,t.additionalProperties,r):r}function Tte(e,t,r){return u.IsObjectNotArray(r)?j1e(e,t,r):r}function bte(e,t,r){return u.HasPropertyKey(e,t.$ref)?Dr(e,e[t.$ref],r):r}function xte(e,t,r){let o=St.TryString(r);return St.IsOk(o)?o.value:r}function Ite(e,t,r){return Dr(e,Hn(t),r)}function _te(e,t,r){if(!u.IsArray(r))return r;for(let o=0;o<Math.min(t.items.length,r.length);o++)r[o]=Dr(e,t.items[o],r[o]);return r}function Ate(e,t,r){let o=St.TryUndefined(r);return St.IsOk(o)?o.value:r}function Ote(e,t,r){if(t.anyOf.some(a=>qt(e,a,r)))return r;let s=t.anyOf.map(a=>Dr(e,a,Mr(r))).find(a=>qt(e,t,a));return u.IsUndefined(s)?r:s}function Cte(e,t,r){let o=St.TryUndefined(r);return St.IsOk(o)?void 0:r}function Dr(e,t,r){return at(t)?lte(e,t,r):Wo(t)?ute(e,t,r):uo(t)?pte(e,t,r):Zt(t)?mte(e,t,r):zr(t)?dte(e,t,r):An(t)?fte(e,t,r):Ue(t)?gte(e,t,r):Ze(t)?hte(e,t,r):la(t)?yte(e,t,r):Sr(t)?Ete(e,t,r):Ne(t)?Ste(e,t,r):Bt(t)?Tte(e,t,r):Dt(t)?bte(e,t,r):rn(t)?xte(e,t,r):Xt(t)?Ite(e,t,r):Ve(t)?_te(e,t,r):xs(t)?Ate(e,t,r):te(t)?Ote(e,t,r):Xo(t)?Cte(e,t,r):r}function lu(...e){let[t,r,o]=Et.Match(e,{3:(i,s,a)=>[i,s,a],2:(i,s)=>[{},i,s]});return Dr(t,r,o)}function Rte(e,t,r){if(!u.IsArray(r))return r;for(let o=0;o<r.length;o++)r[o]=Pn(e,t.items,r[o]);return r}function Pte(e,t,r){return Pn({...e,...t.$defs},_n(t.$ref),r)}function wte(e,t){return u.IsUndefined(t)?u.IsFunction(e.default)?e.default():Mr(e.default):t}function vte(e,t,r){let o=Yi(e,t),i=Hn(o);return Pn(e,i,r)}function Ute(e,t,r){if(!u.IsObject(r))return r;let o=u.Keys(t.properties);for(let i of o){let s=Pn(e,t.properties[i],r[i]);u.IsUndefined(s)&&(fn(t.properties[i])||!u.HasPropertyKey(t.properties[i],"default"))||(r[i]=s)}if(!Lc(t)||u.IsBoolean(t.additionalProperties))return r;for(let i of u.Keys(r))o.includes(i)||(r[i]=Pn(e,t.additionalProperties,r[i]));return r}function Nte(e,t,r){if(!u.IsObject(r))return r;let[o,i]=[new RegExp(On(t)),lr(t)];for(let s of u.Keys(r))o.test(s)&&Oi(i)&&(r[s]=Pn(e,i,r[s]));if(!Lc(t))return r;for(let s of u.Keys(r))o.test(s)||(r[s]=Pn(e,t.additionalProperties,r[s]));return r}function kte(e,t,r){return u.HasPropertyKey(e,t.$ref)?Pn(e,e[t.$ref],r):r}function Lte(e,t,r){if(!u.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]=Pn(e,o[s],r[s]));return r}function Mte(e,t,r){for(let o of t.anyOf){let i=Pn(e,o,Mr(r));if(qt(e,o,i))return i}return r}function Pn(e,t,r){let o=Oi(t)?wte(t,r):r;return at(t)?Rte(e,t,o):Zt(t)?Pte(e,t,o):Ue(t)?vte(e,t,o):Ne(t)?Ute(e,t,o):Bt(t)?Nte(e,t,o):Dt(t)?kte(e,t,o):Ve(t)?Lte(e,t,o):te(t)?Mte(e,t,o):o}function nm(...e){let[t,r,o]=Et.Match(e,{3:(i,s,a)=>[i,s,a],2:(i,s)=>[{},i,s]});return Pn(t,r,o)}function qf(e){return(...t)=>{let[r,o,i]=Et.Match(t,{3:(s,a,c)=>[s,a,c],2:(s,a)=>[{},s,a]});return e.reduce((s,a)=>a(r,o,s),i)}}function H1e(e,t,r){return t["~codec"].decode(r)}function K1e(e,t,r){return t["~codec"].encode(r)}function dr(e,t,r,o){return Op(r)?u.IsEqual(e,"Decode")?H1e(t,r,o):K1e(t,r,o):o}function z1e(e,t,r,o){if(!u.IsArray(o))return o;for(let i=0;i<o.length;i++)o[i]=Tr(e,t,r.items,o[i]);return dr(e,t,r,o)}function Y1e(e,t,r,o){let i=dr(e,t,r,o);if(!u.IsArray(i))return i;for(let s=0;s<i.length;s++)i[s]=Tr(e,t,r.items,i[s]);return i}function Dte(e,t,r,o){return u.IsEqual(e,"Decode")?z1e(e,t,r,o):Y1e(e,t,r,o)}function Fte(e,t,r,o){return o=Tr(e,{...t,...r.$defs},_n(r.$ref),o),dr(e,t,r,o)}function $te(e){return e.reduce((t,r)=>({...t,...r}),{})}function Gte(e,t){for(let r of t)if(!u.IsDeepEqual(e,r))return r;return e}function V1e(e,t,r,o){if(u.IsEqual(r.allOf.length,0))return dr(e,t,r,o);let i=r.allOf.map(c=>Tr(e,t,c,Ta(c,Mr(o)))),a=i.every(c=>u.IsObject(c))?$te(i):Gte(o,i);return dr(e,t,r,a)}function Q1e(e,t,r,o){if(u.IsEqual(r.allOf.length,0))return dr(e,t,r,o);let i=dr(e,t,r,o),s=r.allOf.map(c=>Tr(e,t,c,Ta(c,Mr(i))));return s.every(c=>u.IsObject(c))?$te(s):Gte(i,s)}function Bte(e,t,r,o){return u.IsEqual(e,"Decode")?V1e(e,t,r,o):Q1e(e,t,r,o)}function W1e(e,t,r,o){if(!u.IsObjectNotArray(o))return o;for(let i of u.Keys(r.properties))!u.HasPropertyKey(o,i)||bS(r.properties[i],i,o)||(o[i]=Tr(e,t,r.properties[i],o[i]));return dr(e,t,r,o)}function J1e(e,t,r,o){let i=dr(e,t,r,o);if(!u.IsObjectNotArray(i))return i;for(let s of u.Keys(r.properties))!u.HasPropertyKey(i,s)||bS(r.properties[s],s,i)||(i[s]=Tr(e,t,r.properties[s],i[s]));return i}function qte(e,t,r,o){return u.IsEqual(e,"Decode")?W1e(e,t,r,o):J1e(e,t,r,o)}function Z1e(e,t,r,o){if(!u.IsObjectNotArray(o))return o;let i=new RegExp(On(r));for(let s of u.Keys(o))i.test(s)&&(o[s]=Tr(e,t,lr(r),o[s]));return dr(e,t,r,o)}function X1e(e,t,r,o){let i=dr(e,t,r,o);if(!u.IsObjectNotArray(i))return i;let s=new RegExp(On(r));for(let a of u.Keys(i))s.test(a)&&(i[a]=Tr(e,t,lr(r),i[a]));return i}function jte(e,t,r,o){return u.IsEqual(e,"Decode")?Z1e(e,t,r,o):X1e(e,t,r,o)}function Hte(e,t,r,o){return u.HasPropertyKey(t,r.$ref)?Tr(e,t,t[r.$ref],o):o}function Kte(e,t,r,o){return u.IsEqual(e,"Decode")?dr(e,t,r,Hte(e,t,r,o)):Hte(e,t,r,dr(e,t,r,o))}function e$e(e,t,r,o){if(!u.IsArray(o))return o;for(let i=0;i<Math.min(r.items.length,o.length);i++)o[i]=Tr(e,t,r.items[i],o[i]);return dr(e,t,r,o)}function t$e(e,t,r,o){let i=dr(e,t,r,o);if(!u.IsArray(i))return o;for(let s=0;s<Math.min(r.items.length,i.length);s++)i[s]=Tr(e,t,r.items[s],i[s]);return i}function zte(e,t,r,o){return u.IsEqual(e,"Decode")?e$e(e,t,r,o):t$e(e,t,r,o)}function r$e(e,t,r,o){for(let i of r.anyOf){if(!qt(t,i,o))continue;let s=Tr(e,t,i,o);return dr(e,t,r,s)}return o}function n$e(e,t,r,o){let i=dr(e,t,r,o);for(let s of r.anyOf){let a=Tr(e,t,s,Mr(i));if(qt(t,s,a))return a}return i}function Yte(e,t,r,o){return u.IsEqual(e,"Decode")?r$e(e,t,r,o):n$e(e,t,r,o)}function Tr(e,t,r,o){return at(r)?Dte(e,t,r,o):Zt(r)?Fte(e,t,r,o):Ue(r)?Bte(e,t,r,o):Ne(r)?qte(e,t,r,o):Bt(r)?jte(e,t,r,o):Dt(r)?Kte(e,t,r,o):Ve(r)?zte(e,t,r,o):te(r)?Yte(e,t,r,o):dr(e,t,r,o)}var xD=class extends cu{constructor(t,r){super("Decode",t,r)}};function o$e(e,t,r){if(!qt(e,t,r))throw new xD(r,Sa(e,t,r));return r}function i$e(e,t,r){let o=In.Get().unionPrioritySort?Bf(t):t;return Tr("Decode",e,o,r)}var E8t=qf([(e,t,r)=>Mr(r),(e,t,r)=>nm(e,t,r),(e,t,r)=>lu(e,t,r),(e,t,r)=>Ta(e,t,r),(e,t,r)=>o$e(e,t,r),(e,t,r)=>i$e(e,t,r)]);var ID=class extends cu{constructor(t,r){super("Encode",t,r)}};function s$e(e,t,r){if(!qt(e,t,r))throw new ID(r,Sa(e,t,r));return r}function a$e(e,t,r){let o=In.Get().unionPrioritySort?Bf(t):t;return Tr("Encode",e,o,r)}var v8t=qf([(e,t,r)=>Mr(r),(e,t,r)=>a$e(e,t,r),(e,t,r)=>nm(e,t,r),(e,t,r)=>lu(e,t,r),(e,t,r)=>Ta(e,t,r),(e,t,r)=>s$e(e,t,r)]);var Qi=class extends Error{constructor(t,r){super(r),this.type=t}};function Vte(e,t){return u.IsFunction(t.default)?t.default(t):u.IsObject(t.default)?Mr(t.default):t.default}function Qte(e,t){if(kf(t)&&!Oi(t))throw new Qi(t,"Arrays with uniqueItems constraints must specify a default annotation");let r=Uf(t)?t.minItems:0;return Array.from({length:r},()=>Fr(e,t.items))}function Wte(e,t){return Mc(t)?BigInt(t.exclusiveMinimum)+BigInt(1):Fc(t)?BigInt(t.minimum):BigInt(0)}function Jte(e,t){return!1}function Zte(e,t){let r=Fr(e,t.instanceType);return class{constructor(){Object.assign(this,r)}}}function Xte(e,t){return Fr({...e,...t.$defs},_n(t.$ref))}function ere(e,t){return Fr(e,Hn(t))}function tre(e,t){let r=Fr(e,t.returnType);return()=>r}function rre(e,t){return Mc(t)&&u.IsNumber(t.exclusiveMinimum)?t.exclusiveMinimum+1:Fc(t)?t.minimum:0}function nre(e,t){let r=Yi(e,t),o=Hn(r);return Fr(e,o)}function ore(e,t){return t.const}function ire(e,t){throw new Qi(t,"Cannot create TNever types")}function sre(e,t){return null}function are(e,t){return Mc(t)&&u.IsNumber(t.exclusiveMinimum)?t.exclusiveMinimum+1:Fc(t)?t.minimum:0}function cre(e,t){return(u.IsUndefined(t.required)?[]:t.required).reduce((o,i)=>({...o,[i]:Fr(e,t.properties[i])}),{})}function lre(e,t){if(mS(t)&&!Oi(t))throw new Qi(t,"Record with the minProperties constraint must have a default annotation");return{}}function ure(e,t){return u.HasPropertyKey(e,t.$ref)?Fr(e,e[t.$ref]):(()=>{throw new Qi(t,"Unable to deref Ref")})()}function pre(e,t){if((dS(t)||uS(t))&&!Oi(t))throw Error("Strings with format or pattern constraints must specify default");let o=pS(t)?t.minLength:0;return"".padEnd(o)}function mre(e,t){return Symbol()}function dre(e,t){let r=CE(t.pattern);if(rn(r))throw new Qi(t,"Unable to create TemplateLiteral due to infinite type expansion");return Fr(e,r)}function fre(e,t){return Array.from({length:t.minItems},(r,o)=>Fr(e,t.items[o]))}function gre(e,t){if(u.IsEqual(t.anyOf.length,0))throw Error("Unable to create Union with no variants");return Fr(e,t.anyOf[0])}function Fr(e,t){return Oi(t)?Vte(e,t):at(t)?Qte(e,t):Wo(t)?Wte(e,t):uo(t)?Jte(e,t):jr(t)?Zte(e,t):Zt(t)?Xte(e,t):zr(t)?ere(e,t):Hr(t)?tre(e,t):An(t)?rre(e,t):Ue(t)?nre(e,t):Ze(t)?ore(e,t):Ts(t)?ire(e,t):la(t)?sre(e,t):Sr(t)?are(e,t):Ne(t)?cre(e,t):Bt(t)?lre(e,t):Dt(t)?ure(e,t):rn(t)?pre(e,t):ua(t)?mre(e,t):Xt(t)?dre(e,t):Ve(t)?fre(e,t):xs(t)?void 0:te(t)?gre(e,t):Xo(t)?void 0:void 0}function ba(...e){let[t,r]=Et.Match(e,{2:(o,i)=>[o,i],1:o=>[{},o]});return Fr(t,r)}var _D=class extends cu{constructor(t,r){super("Parse",t,r)}};function c$e(e,t,r){if(!qt(e,t,r))throw new _D(r,Sa(e,t,r));return r}var ZJt=qf([(e,t,r)=>Mr(r),(e,t,r)=>nm(e,t,r),(e,t,r)=>lu(e,t,r),(e,t,r)=>Ta(e,t,r),(e,t,r)=>c$e(e,t,r)]);var u$e=ve({type:Ye("insert"),path:po(),value:tn()}),p$e=Object({type:Ye("update"),path:po(),value:tn()}),m$e=ve({type:Ye("delete"),path:po()}),iZt=Ge([u$e,p$e,m$e]);var om=D("request.generateSkeleton")(function*(e){if(!e.body)return yield*new pr({message:"This command does not accept a request body"});let t=e.body;return t.examples?.length?t.examples[0]:ba(t)});var Ere=" (unix seconds, ISO 8601, or relative like -1h/-30m/now)",jf=st("file").pipe(Ki("f"),he("Read body from file (use - for stdin)"),Fe("FILE_PATH"),Rt),im=st("data").pipe(Ki("d"),he("Inline JSON body"),Fe("JSON"),Rt),sm=Vo("generate-skeleton").pipe(he("Print a JSON skeleton for the request body and exit"),Qo(!1)),ar={from:st("from").pipe(he(`Start of time range${Ere}`),Fe("TIMESTAMP"),Rt),to:st("to").pipe(he(`End of time range${Ere}`),Fe("TIMESTAMP"),Rt)},uu=st("query").pipe(he("Tsuga query to filter results"),Fe("TSUGA_QUERY"),Rt),Hf=$d("max-results").pipe(Gd(e=>Number.isSafeInteger(e)&&e>0,()=>"--max-results must be a positive safe integer"),he("Maximum number of results"),Fe("COUNT"),Rt),xS={limit:$d("limit").pipe(Gd(e=>Number.isSafeInteger(e)&&e>=1&&e<=Pc,()=>`--limit must be an integer from 1 to ${Pc}`),he("Maximum number of items to return"),Fe("N"),Rt),offset:$d("offset").pipe(Gd(e=>Number.isSafeInteger(e)&&e>=0,()=>"--offset must be a non-negative safe integer"),he("Number of items to skip, to request a later page"),Fe("N"),Rt)},Ft=D("flags.resolveTime")(function*(e,t){let r=yield*tr,o=Re(t)??(yield*r.getDefault(e));if(!o)return yield*new pr({message:`--${e} is required`});let i=Math.floor((yield*jo)/ZE),s=yield*$t({try:()=>bO(o,i),catch:a=>new pr({message:a instanceof Error?a.message:String(a)})});return Number.isSafeInteger(s)?s:yield*new pr({message:`Invalid time value: ${o}. Unix seconds must be a safe integer.`})}),am=D("flags.withSavedDefault")(function*(e,t){let r=yield*tr;return Re(t)??(yield*r.getDefault(e))});function Sre(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 Tre(e,t){let r=e[t];return typeof r=="string"?r:Fm(r)&&It(r)&&typeof r.value=="string"?r.value:void 0}function ho(e){let t={};for(let[r,o]of Object.entries(e))o!==void 0&&(t[r]=o);return t}var yo=(e,t,r)=>G(e,{file:jf,data:im,generateSkeleton:sm},D(`cli.${e}`)(function*(o){if(o.generateSkeleton){yield*Oe(yield*om(r));return}yield*Oe(yield*ye(r,{body:yield*Qp(o)}))})).pipe(B(t));var bre=yo("scalar","Run aggregation queries and return scalar results",FZ);var xre=yo("timeseries","Run aggregation queries and return timeseries results",GZ);var Ire=G("aggregation").pipe(B("Run aggregation queries"),De([bre,xre]));var wre=require("node:crypto");var IS=require("node:crypto");function g$e(e){return(0,IS.createHash)("sha256").update(e).digest("base64url")}function _re(){let e=(0,IS.randomBytes)(32).toString("base64url");return{verifier:e,challenge:g$e(e)}}var Cre=require("node:http"),CD=require("node:os");var h$e=[":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(""),y$e=['<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 AD(e,t){let r=cM(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>${h$e}</style></head><body><main>`,`<span class="tile">${y$e}</span>`,`<div class="copy"><h1>${r}</h1><p>${cM(t)}</p></div>`,"</main></body></html>"].join("")}var Rre="/oauth/callback",S$e=5*Gp,T$e=AD("Login complete","You can close this tab and return to the terminal."),Are=AD("Login failed","Return to the terminal for details."),{$match:b$e,Code:x$e,Failed:OD,NotACallback:Ore}=zb();function I$e(e,t,r){let o;try{o=new URL(e,t)}catch{return Ore()}if(o.pathname!==Rre)return Ore();let i=o.searchParams.get("error");if(i){let a=o.searchParams.get("error_description")??"";return OD({message:`Authorization failed: ${i}${a?` (${a})`:""}`})}if(o.searchParams.get("state")!==r)return OD({message:"State mismatch on OAuth callback; aborting for safety."});let s=o.searchParams.get("code");return s?x$e({code:s}):OD({message:"OAuth callback did not include an authorization code."})}function _$e(e){return(0,CD.platform)()==="darwin"?["open",[e]]:(0,CD.platform)()==="win32"?["rundll32",["url.dll,FileProtocolHandler",e]]:["xdg-open",[e]]}var A$e=D("auth.openBrowser")(function*(e){let[t,r]=_$e(e);return yield*oo(ce(qi(t,r,{stdout:{stream:"ignore"},stderr:{stream:"ignore"}}),o=>o.exitCode)).pipe(gl({onSuccess:o=>Number(o)===0,onFailure:()=>!1}))}),O$e=(e,t,r)=>Ct(()=>{let o,i=Ie(()=>{o!==void 0&&(e.off("request",o),o=void 0)});return Bn(s=>{let a=(c,l,m)=>{c.writeHead(l,{"Content-Type":"text/html"}),c.end(m)};o=(c,l)=>{b$e({NotACallback:()=>a(l,404,Are),Failed:({message:m})=>{a(l,400,Are),s(J(new wc({message:m})))},Code:({code:m})=>{a(l,200,T$e),s(L(m))}})(I$e(c.url??"/",r,t))},e.on("request",o)}).pipe(ec(i),ex({duration:S$e,orElse:()=>new wc({message:"Timed out waiting for the browser to complete login (5 minutes)."})}))}),Pre=D("auth.captureAuthorizationCode")(function*(e){let t=yield*gi(Ie(()=>{let l=(0,Cre.createServer)();return l.on("connection",m=>m.unref()),l}),l=>Ie(()=>l.close())),o=`http://127.0.0.1:${yield*Bn(l=>{let m=y=>{l(new wc({message:`Could not open a loopback port: ${y.message}`}))};t.once("error",m),t.listen(0,"127.0.0.1",()=>{t.off("error",m);let y=t.address();l(y===null||typeof y=="string"?new wc({message:"Loopback server did not report a usable address."}):L(y.port))})})}`,i=`${o}${Rre}`,s=yield*hl(O$e(t,e.state,o),{startImmediately:!0}),a=e.buildAuthorizeUrl(i);return yield*hl(jt(function*(){(yield*A$e(a))?yield*Ti("Opening your browser to complete login..."):(yield*Ti("Visit this URL in your browser to complete login:"),yield*Ti(` ${a}`))}),{startImmediately:!0}),{code:yield*Iv(s),redirectUri:i}},oo);var vre=G("login",{},D("cli.auth.login")(function*(){let e=yield*tr,t=yield*eu,r=yield*e.resolveApiUrl,{verifier:o,challenge:i}=_re(),s=(0,wre.randomBytes)(16).toString("base64url"),{code:a,redirectUri:c}=yield*Pre({state:s,buildAuthorizeUrl:y=>MJ(r,{redirectUri:y,challenge:i,state:s})}),l=yield*t.exchangeCode(r,{code:a,verifier:o,redirectUri:c}),m=yield*e.saveUserAuth(GO(l));yield*We(`Logged in. Session token ${wf(l.accessToken)} saved to ${m}`)})).pipe(B("Log in as a user with a browser authorization flow and save the session (replaces any saved operation API key)"));var Ure=G("logout",{},D("cli.auth.logout")(function*(){yield*(yield*tr).clearUserAuth,yield*We("Local user session cleared.")})).pipe(B("Clear the saved user session"));var on=e=>P_(oE,e);var sn=v(2,(e,t)=>v_(e,t));var Nre=v(e=>R_(e[0]),(e,t)=>vk(e,t));var kre=G("operation-key",{key:on("OPERATION_API_KEY").pipe(sn("The operation API key to save"))},D("cli.auth.operationKey")(function*({key:e}){let t=yield*tr;yield*t.saveOperationApiKey(e),yield*We(`Operation API key saved to ${t.configPath}`)})).pipe(B("Save an operation API key to the config file (replaces any saved user session)"));function EC(e,t){let r=wJ(vJ({start:e,end:t}),{format:["years","months","days","hours","minutes"]});return r===""?"less than a minute":r}function C$e(e,t){let r=wf(e.accessToken),o=new Date(e.accessExpiresAt),i=!!e.refreshToken;return Number.isNaN(o.getTime())?`Logged in as a user (token ${r}, expires ${e.accessExpiresAt}).`:o<=t?i?`Logged in as a user (token ${r}). Access token expired ${EC(o,t)} ago, on ${e.accessExpiresAt}; the next command renews it automatically.`:`Logged in as a user (token ${r}). Session expired ${EC(o,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 ${EC(t,o)}, on ${e.accessExpiresAt}; the session renews automatically.`:`Logged in as a user (token ${r}). Session expires in ${EC(t,o)}, on ${e.accessExpiresAt}.`}var Lre=G("status",{},D("cli.auth.status")(function*(){let e=yield*ha,t=yield*tr,{credential:r}=yield*t.resolve({operationApiKey:e.operationApiKey,clusterId:e.cluster});if(!r){yield*We("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=new Date(yield*jo);yield*We(C$e(r.userAuth,i));return}case"operation-api-key":yield*We("Authenticated with an operation API key.");return;default:Pr(o)}})).pipe(B("Show the current authentication method"));var Mre=G("token",{},D("cli.auth.token")(function*(){let e=yield*tr,t=yield*e.resolveApiUrl,r=yield*e.getUserAuth;if(!r){let i=t===cS?"":` for ${t}`;return yield*new Xl({message:`No user session${i}. Run \`tsuga auth login\`.`})}let o=yield*qO(t,r);yield*We(o.accessToken)})).pipe(B("Print the saved user access token to stdout"));var R$e="^\\S(.*\\S)?$",P$e=50,w$e=128,v$e=256,U$e=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"}),N$e=n.Object({key:n.String({maxLength:w$e,description:"Tag key to attach to the resource."}),value:n.String({maxLength:v$e,pattern:R$e,description:"Tag value to attach to the resource. Leading or trailing whitespace is rejected."})},{title:"Tag"}),Dn=n.Array(U$e,{title:"Tags",description:"Key/value tags applied to the resource. Use them to organize resources and to satisfy tag policies."}),Fn=n.Array(N$e,{title:"Tags",maxItems:P$e,description:"Key/value tags to apply to the resource. Tag policies may require specific keys or values."}),br=n.Optional(Dn),wr=n.Optional(Fn);var pu="/v0/teams",bC=["public","private"],SC={NAME:"name",CREATED_AT:"createdAt",MEMBER_COUNT:"memberCount",VISIBILITY:"visibility"},k$e=n.Enum([SC.NAME,SC.CREATED_AT,SC.MEMBER_COUNT,SC.VISIBILITY],{description:"Team field used for sorting list responses. Use `name`, `createdAt`, `memberCount`, or `visibility`."}),xC=n.Object({color:n.Enum(sM,{description:"Color token used by Tsuga when rendering the team avatar."}),mode:n.Enum(aM,{description:"Avatar rendering mode selected for the team."}),iconName:n.Enum(WZ,{description:"Icon name rendered inside the team avatar when icon mode is used."})}),Kf=n.Object({color:n.Enum(sM),mode:n.Enum(aM)}),Dre=100,Fre=250,mu=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(bC,{description:"`public` makes team-owned resources discoverable according to access controls. `private` restricts discovery to team members and authorized users."}),tags:br,createdAt:H({description:"Timestamp when Tsuga created the team."}),updatedAt:H({description:"Timestamp when Tsuga last updated the team metadata."}),memberCount:n.Optional(n.Number({description:"Number of members currently in the team"})),avatar:n.Optional(xC)}),IC=n.Object({name:n.String({minLength:1,maxLength:Dre,format:Jl,description:`Name to assign to the team. Must be kebab-case (lowercase letters, numbers, and dashes only) and unique in the organization. Maximum length is ${Dre} characters.`}),description:Ut(n.String({maxLength:Fre}),{description:`Optional team description. Maximum length is ${Fre} characters.`}),visibility:n.Enum(bC,{description:"`public` makes team-owned resources discoverable according to access controls. `private` restricts discovery to team members and authorized users."}),tags:wr,avatar:Ut(xC)}),L$e=n.Object({id:n.String(),name:n.String(),email:n.String(),role:n.Enum(Vi),joinedTeamAt:H(),orgRole:n.Enum(UO),avatar:n.Optional(Kf)}),$re=n.Object({searchQuery:n.Optional(f({description:"Substring matched against team names and descriptions."})),visibility:n.Optional(n.Enum(bC,{description:"Restrict results to teams with this visibility."})),myTeamsOnly:n.Optional(n.Boolean({description:"If true, return only teams that include the authenticated user."}))}),trr=x({tags:["teams"],url:pu,method:"GET",paginated:!0,response:n.Array(mu),query:n.Object({...je,includeMemberCount:n.Optional(n.Boolean()),...$re.properties,sortBy:n.Optional(k$e),sortDirection:n.Optional(Le)})}),rrr=x({tags:["teams"],url:`${pu}/:id`,method:"GET",params:n.Object({id:f()}),response:mu}),TC={NAME:"name",ROLE:"role",ORG_ROLE:"orgRole",JOINED_TEAM_AT:"joinedTeamAt"},M$e=n.Enum([TC.NAME,TC.ROLE,TC.ORG_ROLE,TC.JOINED_TEAM_AT]),nrr=x({tags:["teams"],url:`${pu}/:id/members`,method:"GET",paginated:!0,params:n.Object({id:f()}),query:n.Object({...je,searchQuery:n.Optional(f({description:"Substring matched against member names and emails."})),teamRole:n.Optional(n.Array(n.Enum(Vi),{maxItems:Vi.length,uniqueItems:!0,description:"Restrict results to members with one of these team roles."})),sortBy:n.Optional(M$e),sortDirection:n.Optional(Le)}),response:n.Array(L$e)}),orr=x({tags:["teams"],url:`${pu}/:id/assets`,method:"GET",params:n.Object({id:f()}),response:n.Object({apiKeyCount:n.Number(),logRouteCount:n.Number(),monitorCount:n.Number(),notificationRuleCount:n.Number(),dashboardCount:n.Number(),sloCount:n.Number()})}),irr=x({tags:["teams"],url:pu,method:"POST",body:IC,response:mu}),srr=x({tags:["teams"],url:`${pu}/:id`,method:"PUT",params:n.Object({id:f()}),body:IC,response:mu}),D$e=Q("type",[n.Object({type:n.Literal("ids"),teamIds:n.Array(f({allowEmpty:!1}),{minItems:1,maxItems:100})}),n.Object({type:n.Literal("all"),filters:n.Optional($re)})]),arr=x({tags:["teams"],url:`${pu}/bulk-update`,method:"POST",body:n.Object({selection:D$e,config:n.Object({visibility:n.Enum(bC)})}),response:n.Object({})}),crr=x({tags:["teams"],url:`${pu}/:id`,method:"DELETE",params:n.Object({id:f()}),response:ae});var F$e=n.Enum(["agent","cli","mcp-codemode","mcp-server","tadmin","terraform-provider","web-frontend"],{description:"Tsuga client surface that performed the operation. Use this to distinguish UI, CLI, MCP, and Terraform-originated changes."}),Qe=Q("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(Kf)}),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(F$e)})],{description:"User or operation API key responsible for creating or updating a resource. Returned by Tsuga for audit context."});var _S="/v0/operation-api-keys";var $$e=100,_C=n.Enum(BL,{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."}),xa=e=>n.Literal("read",{description:e}),an=e=>n.Enum(["read","write"],{description:e}),cm=n.Partial(n.Object({investigations:an("Investigations, the records collecting the timeline and findings of an incident analysis."),dashboard:an("Dashboards and the graphs they contain."),"dashboard-folder":an("Folders organizing dashboards."),documentation:xa("Tsuga documentation and API reference pages, which are public content rather than account data."),"ingestion-api-key":an("Ingestion API keys, used to send telemetry data to Tsuga."),"rum-public-token":an("RUM public tokens, embedded in web and mobile applications to send real user monitoring telemetry."),inventory:xa("Cloud resources discovered by inventory scans."),"cloud-account":an("Cloud accounts Tsuga scans to discover resources."),logs:xa("Ingested log events, through search and aggregation endpoints."),"log-route":an("Log routes, which select newly ingested logs and apply processors to them."),metrics:xa("Ingested metrics, through query and aggregation endpoints."),"metric-route":an("Metric routes, which select newly ingested metrics by name and apply processors to them."),monitor:an("Monitors, the alert definitions evaluated against telemetry."),"allowed-domains":an("Email domains whose users are allowed to join the organization."),"quality-report":xa("Telemetry quality reports."),billing:xa("Ingested data volume billed to the organization."),service:xa("Services of the catalog, inferred from telemetry."),"service-target":an("Notification targets attached to a service."),slo:an("Service level objectives and the alerts attached to them."),"notification-rule":an("Notification rules, which route alert transitions to notification targets."),"notification-integration":an("Notification integrations, containing the credentials Tsuga uses when sending notifications."),"notification-silence":an("Notification silences, which suppress matching notification delivery."),"custom-usage-tag":an("Custom usage tags, the telemetry tag keys tracked as usage dimensions."),"retention-policy":an("Retention policies applied to logs, metrics, and traces."),"sandbox-configuration":xa("Sandbox agent configurations of the key's teams, and the sandbox agent runs launched with them."),"tag-policy":an("Tag policies, which enforce tag requirements on Tsuga-managed assets and telemetry data."),team:an("Teams and their settings."),"team-membership":an("Team memberships, each pairing a user with a team role."),traces:xa("Ingested spans, through search and aggregation endpoints."),rum:xa("Ingested RUM events, through search and aggregation endpoints."),user:an("User accounts of the organization."),"user-invitation":an("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."}),RD=n.Object({id:n.String(),name:n.String(),owner:n.String(),tags:br,scope:_C,permissions:cm,keyLastCharacters:n.String(),updatedAt:H(),createdAt:H(),creator:n.Optional(Qe),updater:n.Optional(Qe),expiresAt:n.Optional(H()),lastUsedAt:n.Optional(H())}),Gre=n.Object({name:n.String({minLength:1,maxLength:$$e}),owner:f({allowEmpty:!1}),tags:wr,scope:_C,permissions:cm,expiresAt:Ut(f({allowEmpty:!1,type:"date-time"}))}),brr=x({tags:["operation-api-keys"],url:_S,method:"POST",body:Gre,response:n.Intersect([RD,n.Object({key:n.String()})])}),xrr=x({tags:["operation-api-keys"],url:_S,method:"GET",response:n.Array(RD)}),Irr=x({tags:["operation-api-keys"],url:`${_S}/:id`,method:"PUT",params:n.Object({id:f()}),body:Gre,response:RD}),_rr=x({tags:["operation-api-keys"],url:`${_S}/:id`,method:"DELETE",params:n.Object({id:f()}),response:ae}),Arr=x({tags:["operation-api-keys"],url:`${_S}/bulk-delete`,method:"DELETE",body:n.Object({ids:n.Array(f({allowEmpty:!1}),{uniqueItems:!0})}),response:n.Object({})});var G$e={logs:"Logs",metrics:"Metrics",traces:"Traces",analytics:"Analytics",profiling:"Profiling",dashboards:"Dashboards","dashboard-reports":"Dashboard reports",notebooks:"Notebooks","ongoing-alerts":"Ongoing alerts",slo:"SLOs",monitor:"Monitors","notification-rules":"Notifications","notification-rules-list":"Notification rules","notification-silences":"Notification silences","notification-integrations":"Notification integrations",investigations:"Investigations",routes:"Routes","log-routes":"Log routes","metric-routes":"Metric routes","sensitive-data-scanner":"Sensitive data scanner","ai-sandboxes":"Sandbox agents",inventory:"Cloud resources","inventory-overview":"Cloud resources overview","inventory-all-resources":"All cloud resources","inventory-settings":"Cloud resources settings",services:"Services",databases:"Databases",rum:"RUM views","browser-views":"RUM Browser views",mobile:"RUM Mobile",sessions:"RUM Sessions","host-catalog":"Hosts",kubernetes:"Kubernetes",ecs:"ECS",serverless:"Serverless"},B$e=Object.keys(G$e),Bre=n.Enum(B$e,{description:"Stable nav item key within a main sidebar category."}),qre="Nav item keys shown in the primary sidebar for this category, in display order.",jre="Nav item keys for this category that are folded away (e.g. View more). Omitted or empty means none.",q$e=n.Array(n.String(),{description:qre}),j$e=n.Optional(n.Array(n.String(),{description:jre})),H$e=n.Array(Bre,{description:qre}),K$e=n.Optional(n.Array(Bre,{description:jre})),Hre="Stable category id. Unknown or renamed ids are ignored by the client catalog.",Kre="Sidebar categories in display order. Unknown or renamed ids are ignored by the client catalog.",zre=n.Object({categories:n.Array(n.Object({id:n.String({description:Hre}),visible:q$e,folded:j$e}),{description:Kre})}),Yre=n.Object({categories:n.Array(n.Object({id:f({allowEmpty:!1,description:Hre}),visible:H$e,folded:K$e}),{description:Kre})});var Wre=["YYYY-MM-DD","DD-MM-YYYY","MM-DD-YYYY"],Jre=["12h","24h"],Y$e=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()]),V$e=n.Union([Q("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:f()}),n.Object({type:n.Literal("ongoing-alerts")}),n.Object({type:n.Literal("services")}),n.Object({type:n.Literal("rum-views")})]),n.Null()]),Bc=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:n.Enum(UO,{description:"Organization role for the user: `admin`, `public_editor`, `public_viewer`, `teams_only`, or `custom` when the user holds a custom role."}),customRoleId:n.Optional(n.String({description:"Identifier of the custom role held by the user, when `role` is `custom`."})),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(Kf),defaultView:n.Optional(Y$e),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(Wre),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(Jre),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(zre),fromSso:n.Boolean({description:"Whether the user account was provisioned or authenticated through SSO."}),createdAt:H({description:"Timestamp when Tsuga created the user."}),updatedAt:H({description:"Timestamp when Tsuga last updated the user."}),teamIds:n.Optional(n.Array(n.String(),{description:"Team IDs the user currently belongs to."}))}),Zre=n.Intersect([mu,n.Object({userRole:n.Enum(Vi)})]),Xre=n.Object({status:n.Literal("authenticated"),token:n.String(),user:Bc}),ene=Q("status",[Xre,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."})})]),Grr=x({tags:["users"],url:"/v0/login",method:"POST",body:n.Object({email:f({type:"email"}),password:f({type:"long"})}),response:ene}),tne="/v0/login/totp",Brr=x({tags:["users"],url:`${tne}/setup`,method:"POST",body:n.Object({mfaToken:f({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."})})}),qrr=x({tags:["users"],url:tne,method:"POST",body:n.Object({mfaToken:f({type:"long"}),code:n.String({pattern:`^[0-9]{${6}}$`,description:"The 6-digit code shown by the authenticator app."})}),response:Xre}),jrr=x({tags:["users"],url:"/v0/forgot-password",method:"POST",body:n.Object({email:f({type:"email"})}),response:n.Object({})}),Hrr=x({tags:["users"],url:"/v0/reset-password",method:"POST",body:n.Object({resetToken:f(),password:f({type:"user-password"})}),response:n.Object({})}),Q$e=["active","expired"],Krr=x({tags:["users"],url:"/v0/reset-password-status/:resetToken",method:"GET",params:n.Object({resetToken:f()}),response:n.Object({status:n.Enum(Q$e)})}),zrr=x({tags:["users"],url:"/v0/change-password",method:"POST",body:n.Object({currentPassword:f({type:"long"}),newPassword:f({type:"user-password"})}),response:n.Object({})}),lm="/v0/users",PD="/v0/current-user",Yrr=x({tags:["users"],url:PD,method:"GET",response:Bc}),Vrr=x({tags:["users"],url:`${PD}/teams`,method:"GET",response:n.Array(Zre)}),Qrr=x({tags:["users"],url:"/v0/logout",method:"POST",response:n.Object({})}),Wrr=x({tags:["users"],method:"PATCH",url:PD,body:n.Partial(n.Object({avatar:n.Union([Kf,n.Null()]),defaultView:V$e,timezone:n.Union([n.String({format:Dp}),n.Null()]),dateFormat:n.Union([n.Enum(Wre),n.Null()]),hourFormat:n.Union([n.Enum(Jre),n.Null()]),favoriteDashboards:n.Array(f({allowEmpty:!1})),favoriteFolders:n.Array(f({allowEmpty:!1})),filterDataByTeams:n.Boolean(),sidebarNavLayout:n.Union([Yre,n.Null()]),name:f()}),{minProperties:1}),response:Bc}),Jrr=x({tags:["users"],url:lm,method:"GET",response:n.Array(Bc),query:n.Optional(n.Object({includeTeamIds:n.Optional(n.Boolean())}))}),AS={NAME:"name",ROLE:"role",LOGIN_METHOD:"fromSso",TEAMS:"teams",CREATED_AT:"createdAt"},rne=n.Partial(n.Object({searchQuery:n.Object({value:f({allowEmpty:!1,description:"Substring to match against the member name or email."})},{description:"Substring matched against the member name or email"})},{description:"Optional filters applied to narrow the returned members"})),W$e=n.Partial(n.Object({...je,includeTeamIds:n.Boolean({description:"When true, include the IDs of the teams each member belongs to."}),filters:rne,sort:n.Object({by:n.Enum([AS.NAME,AS.ROLE,AS.LOGIN_METHOD,AS.TEAMS,AS.CREATED_AT],{description:"Field to sort the returned members by"}),direction:Le},{description:"Optional sorting applied to the returned members"})})),Zrr=x({tags:["users"],url:`${lm}/query`,method:"POST",paginated:!0,response:n.Array(Bc),body:W$e}),{teamIds:Xrr,...J$e}=Bc.properties,Z$e=n.Object({...J$e,teams:n.Optional(n.Array(Zre))}),enr=x({tags:["users"],url:`${lm}/:id`,method:"GET",params:n.Object({id:f({allowEmpty:!1})}),query:n.Optional(n.Object({includeTeamRoles:n.Optional(n.Boolean())})),response:Z$e}),Vre=_i(rne),nne=f({allowEmpty:!1,description:"Custom role to assign."}),tnr=x({tags:["users"],method:"PUT",url:`${lm}/bulk-update-role`,body:Q("role",[n.Object({role:n.Enum(vO),selection:Vre}),n.Object({role:n.Literal("custom"),selection:Vre,customRoleId:nne})]),response:n.Object({})}),rnr=x({tags:["users"],url:`${lm}/:id`,method:"DELETE",params:n.Object({id:f()}),response:ae}),nnr=x({tags:["users"],url:`${lm}/:id/totp`,method:"DELETE",params:n.Object({id:f()}),response:ae}),onr=x({tags:["users"],url:`${lm}/all-emails`,method:"GET",response:n.Array(n.String())}),one=["pending","accepted","expired","revoked"],X$e=n.Enum(one),um="/v0/invitations",eGe=10,Qre={email:f({type:"email",description:"Lowercase email address to invite into the organization."}),teamId:f({description:"Team ID to add the invited user to after acceptance."}),teamRole:n.Enum(Vi,{description:"Role the invited user receives in the target team once accepted: `admin`, `editor`, or `viewer`."})},tGe=Q("userRole",[n.Object({...Qre,userRole:n.Enum(vO,{description:"Organization role the invited user receives after acceptance: `admin`, `public_editor`, `public_viewer`, or `teams_only`."})}),n.Object({...Qre,userRole:n.Literal("custom",{description:"Assigns the custom role identified by `customRoleId` after acceptance."}),customRoleId:nne})]),inr=x({tags:["invitations"],url:`${um}/create`,method:"POST",body:n.Array(tGe,{maxItems:eGe}),response:n.Object({success:n.Boolean(),message:n.String()})}),snr=x({tags:["invitations"],url:`${um}/resend/:id`,params:n.Object({id:f()}),method:"POST",response:n.Object({success:n.Boolean(),message:n.String()})}),ine=n.Partial(n.Object({searchQuery:n.Object({value:f({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"})),rGe=_i(ine),anr=x({tags:["invitations"],url:`${um}/bulk-resend`,method:"POST",body:n.Object({selection:rGe}),response:n.Object({success:n.Boolean(),message:n.String()})}),cnr=x({tags:["invitations"],url:um,method:"POST",body:n.Object({secret:f()}),response:n.Object({status:X$e,email:n.String(),teamName:n.Optional(n.String()),avatar:n.Optional(xC)})}),lnr=x({tags:["invitations"],url:`${um}/accept`,method:"POST",body:n.Object({name:f({type:"short"}),password:f({type:"user-password"}),secret:f()}),response:ene}),unr=x({tags:["invitations"],url:`${um}/revoke/:id`,params:n.Object({id:f()}),method:"POST",response:n.Object({success:n.Boolean(),message:n.String()})}),nGe=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(Vi,{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(one,{description:"Invitation lifecycle status: `pending`, `accepted`, `expired`, or `revoked`. `expired` can be computed from `expiresAt` when invitations are listed."}),expiresAt:H({description:"Timestamp when the invitation expires if not accepted."}),createdAt:H({description:"Timestamp when Tsuga created the invitation."}),updatedAt:H({description:"Timestamp when Tsuga last updated the invitation."})}),AC={EMAIL:"email",TEAM:"team",STATUS:"status",CREATED_AT:"createdAt"},oGe=n.Partial(n.Object({...je,filters:ine,sort:n.Object({by:n.Enum([AC.EMAIL,AC.TEAM,AC.STATUS,AC.CREATED_AT],{description:"Field to sort the returned invitations by"}),direction:Le},{description:"Optional sorting applied to the returned invitations"})})),pnr=x({tags:["invitations"],url:`${um}/query`,method:"POST",paginated:!0,response:n.Array(nGe),body:oGe});var iGe=`/${"v1"}/me`,sne=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."}),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."}),scope:_C,permissions:cm,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."}),expiresAt:n.Optional(H({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."}))},{$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)."}),sGe={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(sne,{examples:[sGe]});var ane=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(Bc,["id","email","name","role","orgId","orgName"]).properties,...n.Required(n.Pick(Bc,["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)."}),aGe={type:"user",id:"user-123-abc",email:"john@tsuga.com",name:"John Doe",role:"public_viewer",orgId:"org-123-abc",orgName:"Acme Inc.",favoriteDashboards:["dashboard-123-abc"],favoriteFolders:["folder-123-abc"]};Object.assign(ane,{examples:[aGe]});var cGe=Q("type",[sne,ane],{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."}),cne=x({description:"Retrieves the identity and access of the credential the request authenticated with. Use this to check which scope and permissions an operation API key carries before calling other endpoints, or to confirm which user an OAuth access token belongs to. Any valid public API credential can call this endpoint without additional resource permissions.",operationId:"getMe",tags:["public","authentication"],url:iGe,method:"GET",response:cGe});var lGe={all:"all permitted telemetry","owning-team-and-public":"owning team plus public data","owning-team-only":"owning team only"};function wD(e){let t=Math.max(...e.map(([r])=>r.length));return e.map(([r,o])=>` ${r.padEnd(t)} ${o}`)}function uGe(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:",...wD(r)]}function pGe(e){switch(e.type){case"operation-api-key":return["Authenticated as an operation API key.",...wD([["Name",e.name],["Key",`\u2022\u2022\u2022\u2022${e.keyLastCharacters}`],["ID",e.id],["Owning team",e.owner],["Data scope",`${e.scope} (${lGe[e.scope]})`],["Expires",e.expiresAt??"never"]]),"",...uGe(e.permissions)].join(`
|
|
252
252
|
`);case"user":return["Authenticated as a user.",...wD([["Name",e.name],["Email",e.email],["ID",e.id],["Role",e.role]]),"","Access follows the organization role, not a per-resource permission map."].join(`
|
|
253
253
|
`);default:Pr(e)}}var lne=G("whoami",{output:Ml("output",["text","json"]).pipe(Ki("o"),he("Output format: text | json"),Qo("text"))},D("cli.auth.whoami")(function*({output:e}){let t=yield*ye(cne);if(e==="json"){yield*Oe(t);return}yield*We(pGe(t))})).pipe(B("Ask Tsuga which credential this CLI authenticates as, and print its scope and permissions"));var une=G("auth").pipe(B("Manage authentication: user login (OAuth) or operation API key"),De([vre,Ure,Mre,kre,Lre,lne]));var mGe="/v0/billing/focus",vD="1.4",pm=31,OC=e=>n.String({description:`${e} UTC, formatted as ISO 8601.`}),OS=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:OC("Exclusive end of the calendar month holding the charge,"),BillingPeriodStart:OC("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:OC("Exclusive end of the day the data was ingested,"),ChargePeriodStart:OC("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, for example `Tsuga Logs`."}),ServiceProviderName:n.Literal("Tsuga",{description:"Entity providing the service."}),ServiceSubcategory:n.Literal("Observability",{description:"FOCUS service subcategory."})}),UD=n.Object(Yr.properties,{description:`Time range to export. It is widened to whole UTC days and must span at most ${pm} days.`}),Lnr=x({tags:["billing"],url:mGe,method:"GET",query:UD,response:n.Array(OS)});var pne=n.Object(OS.properties,{$id:"FocusBillingRow",description:`One FOCUS ${vD} cost and usage row: the volume of one telemetry kind ingested on one UTC day.`}),dGe={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(pne,{examples:[dGe]});var mne=x({description:`Exports the ingested data volume of the organization as FOCUS ${vD} 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 ${pm} 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:UD,response:n.Array(pne)});var Ia=e=>({output:Ml("output",VJ).pipe(Ki("o"),he("Output format"),Qo("json")),fields:st("fields").pipe(he(`Comma-separated dot-paths to project from each row (default for tabular output: ${e.join(",")})`),Fe("FIELDS"),Dl(QJ),Gd(t=>t.length>0,()=>"--fields must contain at least one field name"),Rt,Dl(Re))});var dne=Object.keys(OS.properties),fne=G("export",{...ar,...Ia(dne)},D("cli.billing.export")(function*(e){let t=yield*ti,r=yield*Ft("from",e.from),o=yield*Ft("to",e.to),i=Math.ceil(o/TO)-Math.floor(r/TO);if(i>pm)return yield*new pr({message:`--from/--to span ${i} days; a FOCUS export covers at most ${pm} days. Export one shorter range at a time.`});let s=yield*ye(mne,{query:{from:r,to:o}});yield*t.rows(s,{...e,defaultFields:dne})})).pipe(B(`Export ingested data volume as FOCUS cost and usage rows, at most ${pm} days per call`));var gne=G("billing").pipe(B("Export billing cost and usage data"),De([fne]));var hne=G("list",{},D("cli.clusters.list")(function*(){yield*Oe(yield*ye($O))})).pipe(B("List all Tsuga clusters available to the operation API key"));var yne=G("clusters").pipe(B("Manage Tsuga cluster selection"),De([hne]));var Ene=G("defaults",{},D("cli.config.resetDefaults")(function*(){yield*(yield*tr).resetDefaults,yield*We("Custom defaults cleared")})).pipe(B("Clear all custom defaults"));var Sne=G("reset").pipe(B("Reset configuration values"),De([Ene]));var Tne=G("default",{key:on("FLAG_NAME").pipe(sn("The flag to set a default for")),value:st("value").pipe(he("The default value. Use --value=-1h for dash-prefixed values"),Fe("VALUE"))},D("cli.config.setDefault")(function*({key:e,value:t}){yield*(yield*tr).setDefault(e,t),yield*We(`Default set: ${e} = ${t}`)})).pipe(B("Set a custom default value for a command flag"),OY([{description:"Widen the default log search window",command:"config set default from --value=-1h"}]));var bne=G("set").pipe(B("Set a configuration value"),De([Tne]));var xne=D("cli.config.show")(function*(){let e=yield*ha,t=yield*tr,r=yield*t.resolve({operationApiKey:e.operationApiKey,clusterId:e.cluster});yield*We(lX(r,t.configPath).trimEnd())});var Ine=G("config",{},xne).pipe(B("Show or manage configuration"),De([bne,Sne]));var ND={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`."})},fGe=n.Object({...ND,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.'})}),Por=x({tags:["docs"],url:"/v0/docs/search",method:"GET",query:n.Object({query:f({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(fGe)});var _ne=`/${"v1"}/docs`,Ane=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"}),gGe={path:"getting-started/send-your-first-logs",title:"Send your first logs",content:`# Send your first logs
|
|
254
|
-
...`};Object.assign(Ane,{examples:[gGe]});var One=n.Object(ND,{$id:"DocSearchResult",description:"A documentation page or API-reference endpoint search result"}),hGe={kind:"doc",path:"data-collection/guides/how-to-add-resource-attributes",title:"How to Add Resource Attributes",subsection:"Set resource attributes by language",tab:"Python",anchor:"set-resource-attributes-by-language",score:.9,excerpt:"...Python SDK setup should use the default resource detectors...",link:"https://www.app.tsuga.com/documentation/data-collection/guides/how-to-add-resource-attributes?tab=Python#set-resource-attributes-by-language"};Object.assign(One,{examples:[hGe]});var Cne=x({description:"Retrieve the raw markdown content of a documentation or API-reference page by its path. Documentation pages use slug paths (e.g. `getting-started/send-your-first-logs`); API-reference pages use `api/<operationId>` (e.g. `api/aggregateScalar`).",operationId:"getDocPage",tags:["public","docs"],url:_ne,method:"GET",query:n.Object({path:f({allowEmpty:!1,description:"Documentation path to fetch. Use page slug paths for docs or `api/<operationId>` for API-reference pages."})},{description:"Documentation page lookup query."}),response:Ane}),Rne=x({description:"Searches public documentation pages and API-reference endpoints. Use this to build help search or route users to Tsuga docs and API reference results. Results are ranked by relevance; an empty array means no page or endpoint matched the query.",operationId:"searchDocs",tags:["public","docs"],url:`${_ne}/search`,method:"GET",query:n.Object({query:f({allowEmpty:!1,description:"Search text to match against documentation and API-reference content."})},{description:"Documentation search query."}),response:n.Array(One)});var Pne=G("get",{path:on("DOC_PATH").pipe(sn("Path of the page to fetch"))},D("cli.docs.get")(function*({path:e}){yield*Oe(yield*ye(Cne,{query:{path:e}}))})).pipe(B("Get a documentation or API-reference page by path (e.g. 'getting-started/send-your-first-logs' or 'api/aggregateScalar')"));var wne=G("search",{query:on("SEARCH_TEXT").pipe(sn("Text to search for"))},D("cli.docs.search")(function*({query:e}){yield*Oe(yield*ye(Rne,{query:{query:e}}))})).pipe(B("Search Tsuga documentation and the full API reference, ranked by relevance"));var vne=G("docs").pipe(B("Search and fetch Tsuga documentation and API-reference pages"),De([Pne,wne]));var yGe="/v0/profiles",EGe=["cpu","samples","wall","off_cpu","space","inuse_space","objects","inuse_objects","alloc_space","alloc_objects","goroutine"],SGe=20,CS={service:f({allowEmpty:!1,description:"Service the profiles belong to, as it appears in `profile.{type}.{service}`."}),type:n.Enum(EGe,{description:"pprof sample type."}),filter:n.Optional(f({type:"tsuga-query",description:"TQL over the profile labels. Only label equality, negation and wildcards are accepted."})),groupBy:n.Optional(n.Array(f({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:SGe,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."}))},Xor=x({tags:["profiles"],url:`${yGe}/query`,method:"POST",body:n.Object({...CS,timeRange:Os,clusterId:n.Optional(f({allowEmpty:!1,description:"Cluster to target. Defaults to the first cluster created in the organization when omitted."}))}),response:Cf});var Une=`/${"v1"}/profiles`,Nne=n.Object({...CS,timeRange:Yr},{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"}]}),TGe=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}]}]}),CC=x({description:"Aggregates continuous profiling samples for a service into folded stacks, optionally split by profile labels.",tags:["private"],url:`${Une}/query`,method:"POST",body:Nne,query:Ea,response:TGe}),bGe=n.Object({pprof:n.String({description:"Merged pprof profile, base64-encoded (standard alphabet, padded)."})}),kne=x({description:"Merges continuous profiling samples for a service into a single pprof profile.",tags:["private"],url:`${Une}/pprof`,method:"POST",body:Nne,query:Ea,response:bGe});var Lne=it("cli/StdoutIsTTY",{defaultValue:()=>process.stdout.isTTY}),Mne=D("output.printBytes")(function*(e){let t=yield*yd;yield*ny(O2(e),t.stdout()).pipe(Mt(r=>new Kn({message:`Could not write stdout: ${r.message}`})))});var RC={service:st("service").pipe(he("Service the profiles belong to"),Fe("SERVICE_NAME")),type:Ml("type",CS.type.enum).pipe(he("Profile type"),Fe("PROFILE_TYPE")),...ar,filter:st("filter").pipe(he("Tsuga query over profile labels (equality, negation, wildcards)"),Fe("TSUGA_QUERY"),Rt)},PC=D("profiles.buildQueryBody")(function*(e){let t=Re(e.filter);return{service:e.service,type:e.type,timeRange:{from:yield*Ft("from",e.from),to:yield*Ft("to",e.to)},...t===void 0?{}:{filter:t}}});var Dne=G("pprof",{...RC,outputFile:st("output-file").pipe(Ki("O"),he("Write the profile to this file instead of stdout"),Fe("FILE_PATH"),Rt)},D("cli.profiles.pprof")(function*(e){let t=Re(e.outputFile);if(t===void 0&&(yield*Lne))return yield*new pr({message:"Refusing to write a binary profile to the terminal. Use --output-file <FILE_PATH> or pipe stdout."});let r=yield*ye(kne,{body:yield*PC(e)}),o=Buffer.from(r.pprof,"base64");if(t===void 0){yield*Mne(o);return}yield*(yield*mn).writeFile(t,o).pipe(Mt(s=>new Kn({message:`Could not write ${t}: ${s.message}`})))})).pipe(B("Download a merged pprof profile (raw protobuf, not gzipped)"));var Fne=yo("query","Run a raw profile query and print the folded stacks",CC);var xGe=30,$ne=["flat","flatPercent","cum","cumPercent","function"],Gne=G("top",{...RC,limit:$d("limit").pipe(he("Maximum number of functions to print"),Fe("COUNT"),Qo(xGe)),...Ia($ne)},D("cli.profiles.top")(function*(e){let t=yield*ti;if(e.limit<1)return yield*new pr({message:`--limit must be a positive integer (got: ${e.limit})`});let r=yield*ye(CC,{body:yield*PC(e)}),{total:o,functions:i}=IGe(r.stacks),s=i.slice(0,e.limit).map(a=>({...a,total:o}));yield*t.rows(s,{...e,defaultFields:$ne})})).pipe(B("Rank functions by self (flat) and inclusive (cum) sample value, like pprof -top"));function IGe(e){let t=new Map,r=new Map,o=0;for(let{stack:a,value:c}of e){let l=a.split(";"),m=l[l.length-1];if(m!==void 0){o+=c,t.set(m,(t.get(m)??0)+c);for(let y of new Set(l))r.set(y,(r.get(y)??0)+c)}}let i=a=>o===0?0:Math.round(a/o*1e4)/100,s=[...r.entries()].map(([a,c])=>{let l=t.get(a)??0;return{function:a,flat:l,flatPercent:i(l),cum:c,cumPercent:i(c)}}).sort((a,c)=>c.flat-a.flat||c.cum-a.cum||a.function.localeCompare(c.function));return{total:o,functions:s}}var Bne=G("profiles").pipe(B("Query continuous profiling data"),De([Gne,Dne,Fne]));var RS="/v0/sandbox-runs",_Ge=["running","completed","failed","cancelled"],AGe=n.Enum(_Ge,{description:"Lifecycle status of the sandbox agent run"}),OGe="^[A-Za-z0-9][A-Za-z0-9._-]*\\.md$",CGe=50,RGe=25e3,PGe=1e5,qne=`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 ${PGe} characters in total. Runs rewrite them, so review them like any agent output.`,kD=n.Record(n.String(),n.String(),{description:qne}),LD=n.Record(n.String({pattern:OGe}),n.String({maxLength:RGe}),{additionalProperties:!1,minProperties:1,maxProperties:CGe,description:qne,examples:[{"MEMORY.md":"- [Topic](topic.md) - one-line summary"}]}),jne=30,wGe=Q("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."}),Hne=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."}),Kne=200,PS=n.Object({id:n.String({description:"Tsuga-generated sandbox run ID."}),status:AGe,trigger:wGe,clusterId:n.String({description:"Cluster the agent queried."}),error:n.Optional(n.String({description:"Why the run failed or stopped."})),usage:n.Optional(Hne),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(Qe),createdAt:H({description:"When the run started."}),completedAt:n.Optional(H({description:"When the run finished."}))}),Dir=x({tags:["sandbox-runs"],url:RS,method:"GET",response:n.Array(PS)}),Fir=x({tags:["sandbox-runs"],url:`${RS}/:id`,method:"GET",params:n.Object({id:f()}),response:PS}),$ir=x({tags:["sandbox-runs"],url:`${RS}/validate`,method:"POST",body:n.Object({runId:f({allowEmpty:!1,description:"Active sandbox run whose ID identifies the container."}),clusterId:f({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."})})}),Gir=x({tags:["sandbox-runs"],url:`${RS}/:id/cancel`,method:"POST",params:n.Object({id:f()}),response:n.Object({})}),Bir=x({tags:["sandbox-runs"],url:`${RS}/:id/complete`,method:"POST",params:n.Object({id:f({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(Hne),memory:n.Optional(LD)}),response:n.Object({})});var du="/v0/sandbox-configurations",vGe=100,UGe=60,zne="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.",Yne=`Maximum minutes the sandbox agent may run before it is stopped. Defaults to ${jne} when unset.`,zf=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:zne}),scope:As,permissions:cm,systemPrompt:n.Optional(n.String({description:"Extra system prompt prepended to the sandbox agent run for this configuration."})),timeoutMinutes:n.Optional(n.Integer({description:Yne})),memory:n.Optional(kD),creator:n.Optional(Qe),updater:n.Optional(Qe),createdAt:H(),updatedAt:H()}),Vne=n.Object({name:n.String({minLength:1,maxLength:vGe,description:"Human-readable name of the sandbox configuration."}),owner:f({allowEmpty:!1,description:"ID of the team that owns this sandbox configuration."}),repositories:n.Array(f({allowEmpty:!1}),{default:[],description:zne}),scope:As,permissions:cm,systemPrompt:n.Optional(f({type:"long",description:"Extra system prompt prepended to the sandbox agent run for this configuration."})),timeoutMinutes:n.Optional(n.Integer({minimum:1,maximum:UGe,description:Yne}))}),Jir=x({tags:["sandbox-configurations"],url:du,method:"GET",response:n.Array(zf)}),Zir=x({tags:["sandbox-configurations"],url:`${du}/:id`,method:"GET",params:n.Object({id:f()}),response:zf}),Xir=x({tags:["sandbox-configurations"],url:du,method:"POST",body:Vne,response:zf}),esr=x({tags:["sandbox-configurations"],url:`${du}/:id`,method:"PUT",params:n.Object({id:f()}),body:Vne,response:zf}),tsr=x({tags:["sandbox-configurations"],url:`${du}/:id`,method:"DELETE",params:n.Object({id:f()}),response:ae}),wS=n.Object({memory:n.Optional(kD)}),MD=n.Object({memory:LD}),rsr=x({tags:["sandbox-configurations"],url:`${du}/:id/memory`,method:"GET",params:n.Object({id:f()}),response:wS}),nsr=x({tags:["sandbox-configurations"],url:`${du}/:id/memory`,method:"PUT",params:n.Object({id:f()}),body:MD,response:zf}),osr=x({tags:["sandbox-configurations"],url:`${du}/:id/memory`,method:"DELETE",params:n.Object({id:f()}),response:zf});var Qne=`/${"v1"}/sandbox-runs`,DD=`/${"v1"}/sandbox-configurations/:id/memory`,Wne="Admin users see every run; other users and operation API keys see only the runs their user started.",FD=n.Object({id:f({allowEmpty:!1,description:"ID of the sandbox configuration."})}),Jne=x({description:`Lists the latest ${Kne} sandbox agent runs, newest first, without their prompt and output. ${Wne}`,tags:["private"],url:Qne,method:"GET",response:n.Array(PS)}),Zne=x({description:`Gets a sandbox agent run with its prompt and output. ${Wne}`,tags:["private"],url:`${Qne}/:id`,method:"GET",params:n.Object({id:f({allowEmpty:!1,description:"ID of the sandbox run."})}),response:PS}),Xne=x({description:"Gets the memory sandbox agent runs keep for a sandbox configuration.",tags:["private"],url:DD,method:"GET",params:FD,response:wS}),$D=x({description:"Replaces the memory of a sandbox configuration.",tags:["private"],url:DD,method:"PUT",params:FD,body:MD,response:wS}),eoe=x({description:"Clears the memory of a sandbox configuration.",tags:["private"],url:DD,method:"DELETE",params:FD,response:wS});var Yf=on("CONFIGURATION_ID").pipe(sn("The sandbox configuration ID"));var toe=G("clear",{id:Yf},D("cli.sandbox-memory.clear")(function*({id:e}){yield*Oe(yield*ye(eoe,{params:{id:e}}))})).pipe(B("Clear the memory of a sandbox configuration"));var roe=G("get",{id:Yf},D("cli.sandbox-memory.get")(function*({id:e}){yield*Oe(yield*ye(Xne,{params:{id:e}}))})).pipe(B("Get the memory of a sandbox configuration"));var noe=G("set",{id:Yf,file:jf,data:im,generateSkeleton:sm},D("cli.sandbox-memory.set")(function*(e){if(e.generateSkeleton){yield*Oe(yield*om($D));return}yield*Oe(yield*ye($D,{params:{id:e.id},body:yield*Qp(e)}))})).pipe(B("Replace the memory of a sandbox configuration"));var ooe=G("sandbox-memory").pipe(B("Read and edit the memory that sandbox agent runs keep per configuration"),De([roe,noe,toe]));function NGe(e,t,r){let o;if(n.IsString(t))o=st(e);else if(n.IsBoolean(t))o=Vo(e);else if(n.IsEnum(t))o=k_(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=st(e).pipe(Fe("VALUE,..."),Dl(s=>s.split(",").map(a=>{let c=a.trim();return i&&c!==""?Number(c):c}))),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=st(e).pipe(Dl(i=>i==="null"?null:i)),r+=" Use null to select resources without a folder."):(o=st(e).pipe(Fe("JSON"),J3(i=>JSON.parse(i),()=>`--${e} must be valid JSON`)),r+=n.IsArray(t)?" Pass a JSON array.":" Pass JSON.");return o.pipe(he(r),Rt)}function ioe(e){let t={};function r(o,i,s,a){if(n.IsObject(o)){for(let[c,l]of Object.entries(o.properties)){if(i.length===0&&["limit","offset","clusterId"].includes(c))continue;let m=c.replace(/([A-Z])/g,"-$1").toLowerCase(),y=c==="filters"||c==="value"||c==="values"?s:c==="exclude"?`exclude-${s}`:s?`${s}-${m}`:m,T="description"in l&&typeof l.description=="string"?l.description:"";r(l,[...i,c],y,c==="value"||c==="values"?`${a} ${T}`.trim():T||a)}return}t[s]={path:i,flag:NGe(s,o,a)}}return e&&r(e,[],"",""),{flags:Object.fromEntries(Object.entries(t).map(([o,{flag:i}])=>[o,i])),apply:D("cli.resource.listFlags")(function*(o,i={},s={}){if(i===null||typeof i!="object"||Array.isArray(i))return yield*new pr({message:"The list request body must be a JSON object"});let a={...i,...s};for(let[l,{path:m}]of Object.entries(t)){let y=o[l];if(!Fm(y)||yr(y))continue;let T=a;for(let[S,E]of m.entries())if(S===m.length-1)T[E]=y.value;else{let _=T[E],A=_!==null&&typeof _=="object"&&!Array.isArray(_)?{..._}:{};T[E]=A,T=A}}let c=e?Sa(e,a):[];return c.length>0?yield*new pr({message:`Invalid list request: ${JSON.stringify(c)}`}):a})}}function kGe(e){return/^[aeiou]/i.test(e)||e==="SLO"?"an":"a"}function GD(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 BD=on("ID").pipe(sn("The resource ID"));function soe(e){return ho({limit:e.limit&&Re(e.limit),offset:e.offset&&Re(e.offset)})}function LGe(e,t){let r=e.listDescription??`List all ${t}`,o=ioe(e.enableListBody?e.endpoints.list.body:e.endpoints.list.query),i=e.endpoints.list.paginated===!0?{limit:xS.limit.pipe(he(`Maximum number of items to return, up to ${Pc} (default: ${gO})`)),offset:xS.offset}:{};return e.enableListBody?G("list",{...o.flags,...i,data:im,generateSkeleton:sm},D("cli.resource.list")(function*(s){if(s.generateSkeleton){yield*Oe(yield*om(e.endpoints.list));return}let a=It(s.data)?yield*Qp({file:re(),data:s.data}):{};yield*Oe(yield*ye(e.endpoints.list,{body:yield*o.apply(s,a,soe(s))}))})).pipe(B(r)):G("list",{...o.flags,...i},D("cli.resource.list")(function*(s){let a=yield*o.apply(s,{},soe(s));yield*Oe(yield*ye(e.endpoints.list,{query:a}))})).pipe(B(r))}function _t(e){let t=e.singularOverride??eX(e.commandName).replace(/-/g," "),r=e.pluralOverride??e.commandName.replace(/-/g," "),o=kGe(t),{get:i,create:s,update:a,delete:c}=e.endpoints,l=[LGe(e,r),...i?[G("get",{id:BD},D("cli.resource.get")(function*({id:m}){yield*Oe(yield*ye(i,{params:{[GD(i)]:m}}))})).pipe(B(`Get ${o} ${t} by ID`))]:[],...s?[yo("create",`Create a new ${t}`,s)]:[],...a?[G("update",{id:BD,file:jf,data:im,generateSkeleton:sm},D("cli.resource.update")(function*(m){if(m.generateSkeleton){yield*Oe(yield*om(a));return}yield*Oe(yield*ye(a,{params:{[GD(a)]:m.id},body:yield*Qp(m)}))})).pipe(B(`Update ${o} ${t} by ID`))]:[],...c?[G("delete",{id:BD},D("cli.resource.delete")(function*({id:m}){yield*Oe(yield*ye(c,{params:{[GD(c)]:m}}))})).pipe(B(`Delete ${o} ${t} by ID`))]:[],...e.extraSubcommands??[]];return G(e.commandName).pipe(B(e.description),De(l))}var aoe=_t({commandName:"sandbox-runs",description:"Read the history of sandbox agent runs",endpoints:{list:Jne,get:Zne}});var coe=G("experimental").pipe(B("Experimental commands that may change or be removed without notice"),De([Bne,aoe,ooe]));var MGe=`/${"v1"}/feedback`,loe=n.Object({id:n.String({description:"API request ID recorded with the feedback."})},{$id:"Feedback",description:"A recorded piece of feedback"}),DGe={id:"request-123-abc"};Object.assign(loe,{examples:[DGe]});var uoe=n.Object({content:f({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."})}),FGe={content:"The traces command times out for large services."};Object.assign(uoe,{examples:[FGe]});var poe=x({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:MGe,method:"POST",body:uoe,response:loe});var moe=G("feedback",{message:on("MESSAGE").pipe(sn("The feedback to send"),Nre({min:1}))},D("cli.feedback")(function*({message:e}){yield*Oe(yield*ye(poe,{body:{content:e.join(" ")}}))})).pipe(B("Send feedback about Tsuga tools or APIs (e.g. a tool that failed or was confusing)"));var $Ge=`/${"v1"}/grok`,GGe=25,BGe=100,doe=n.Object({rules:n.Array(f({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:GGe,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(f({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:BGe,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."}),qGe={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(doe,{examples:[qGe]});var foe=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."}),jGe={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(foe,{examples:[jGe]});var goe=x({url:`${$Ge}/parse`,method:"POST",operationId:"parseGrok",tags:["public","grok"],body:doe,response:foe,description:"Parses sample log lines with Grok rules and returns extracted fields, using the same Grok engine as the log route processor. Use this endpoint to author and test route Grok rules before saving them. The operation requires public API read access to log routes. A rule that fails to compile returns a 400 response with error code `GROK_RULE_VALIDATION_ERROR` and structured details in `error.details.ruleErrors`."});var hoe=yo("parse","Parse sample log lines with grok rules and return the extracted fields",goe);var yoe=G("grok").pipe(B("Test and preview grok parsing rules"),De([hoe]));var boe=require("node:os"),US=require("node:path");var qD,Eoe=()=>{qD?.release(),qD=void 0},Soe=(e,t)=>{let r=[],o=e.write.bind(e),i=!0;e.write=c=>i?(r.push(c),!0):o(c);let s=()=>i?(i=!1,e.write=o,r.splice(0)):[],a={release:()=>{for(let c of s())o(c)},divert:()=>{for(let c of s())t.write(c)}};return qD=a,a},Toe=e=>t=>t.pipe(Xb(r=>r._tag==="ShowHelp"?Ie(e.divert):mt),ec(Ie(e.release)));function HGe(e,t=process.platform){return t==="win32"?`${e}.cmd`:e}var fu=D("external.run")(function*(e,t){yield*We(` $ ${e} ${t.join(" ")}`),yield*Ie(Eoe);let r=yield*oo(ce(qi(HGe(e),t,{stdin:{stream:"ignore"},stdout:{stream:"inherit"},stderr:{stream:"inherit"}}),o=>o.exitCode)).pipe(Mt(o=>new qp({message:`Could not run \`${e}\`: ${o.message}. Is it installed and on your PATH?`})));if(Number(r)!==0)return yield*new qp({message:`${e} ${t.join(" ")} exited ${r}`})});var qc=(e,t)=>r=>Mt(r,o=>new Kn({message:`Could not ${e} ${t}: ${o.message}`})),Vf=D("fs.writeAtomic")(function*(e,t){let r=yield*mn,o=`${e}.tmp.${process.pid}`;yield*r.writeFileString(o,t).pipe(qc("write",o)),yield*r.rename(o,e).pipe(qc("write",e))}),Qf=D("fs.readOrUndefined")(function*(e){return yield*(yield*mn).readFileString(e).pipe(xq(BO,()=>mt),ge(r=>r??void 0),Mt(r=>new Kn({message:`Could not read ${e}: ${r.message}`})))}),Wf=D("fs.backupIfExists")(function*(e,t,r){if(t===void 0)return;let o=yield*mn,i=`${e}.bak.${r.replaceAll(":","-")}`;return yield*o.writeFileString(i,t).pipe(qc("back up",e)),i});function Jf(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var wC=D("fs.parseJsonObject")(function*(e,t){let r=yield*$t(()=>JSON.parse(t)).pipe(Mt(()=>new Kn({message:`${e} is not valid JSON. Fix or remove it before re-running.`})));return Jf(r)?r:yield*new Kn({message:`${e} must contain a JSON object at the top level.`})});var vS="tsuga-dev/agent-plugins",Zf="tsuga";var KGe=D("cli.installPlugin.autoUpdate")(function*(e){let t=yield*mn,r=(0,US.join)(e,".claude","settings.json");yield*We(`Claude Code \u2192 ${r} (autoUpdate)`),yield*t.makeDirectory((0,US.dirname)(r),{recursive:!0}).pipe(qc("create",(0,US.dirname)(r)));let o=yield*Qf(r),i=yield*wC(r,o??"{}"),s=i.extraKnownMarketplaces??{};if(!Jf(s))return yield*new Kn({message:`${r} "extraKnownMarketplaces" must be a JSON object`});let a=s[Zf],c=Jf(a)?a:{},l={...i,extraKnownMarketplaces:{...s,[Zf]:{source:{source:"github",repo:vS},...c,autoUpdate:!0}}},m=new Date(yield*jo).toISOString(),y=yield*Wf(r,o,m);yield*Vf(r,`${JSON.stringify(l,null,2)}
|
|
255
|
-
`),yield*We(y===void 0?" created":` patched (backup: ${y})`)}),zGe=D("cli.installPlugin.claude")(function*(e,t){yield*We("Claude Code \u2192 installing Tsuga plugin"),yield*fu("claude",["plugin","marketplace","add",vS]),yield*fu("claude",["plugin","install",`tsuga@${Zf}`]),t&&(yield*KGe(e))}),xoe=G("claude-code",{autoUpdate:Vo("auto-update").pipe(he("Patch ~/.claude/settings.json with autoUpdate=true; --no-auto-update skips it"),Qo(!0))},D("cli.installPlugin.claudeCode")(function*({autoUpdate:e}){yield*zGe((0,boe.homedir)(),e),yield*We("Restart your claude session to load the new plugins.")})).pipe(B("Install the Tsuga plugin into Claude Code (requires the claude CLI in PATH)"));var YGe=D("cli.installPlugin.codex")(function*(){yield*We("Codex \u2192 installing Tsuga plugin"),yield*fu("codex",["plugin","marketplace","add",vS]),yield*fu("codex",["plugin","add",`tsuga@${Zf}`])}),Ioe=G("codex",{},D("cli.installPlugin.codexCli")(function*(){yield*YGe(),yield*We("Restart your codex session to load the new plugins.")})).pipe(B("Install the Tsuga plugin into Codex (requires the codex CLI in PATH)"));var _oe=G("plugin").pipe(B("Install the Tsuga plugin into a specific LLM CLI"),De([xoe,Ioe]));var Aoe=G("install").pipe(B("Install Tsuga plugins into local LLM CLIs"),De([_oe]));var VGe=10,QGe=n.Object({key:f({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(f({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`."}))}),jD=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."})}),HD=n.Object({logs:n.Array(jD,{description:"Top log fields for the requested scope, ranked by score and mined from readable logs-sourced dashboards and monitors."}),traces:n.Array(jD,{description:"Top trace fields for the requested scope, ranked by score and mined from readable traces-sourced dashboards and monitors."}),metrics:n.Array(jD,{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."})}),KD=n.Object({scope:n.Array(QGe,{minItems:1,maxItems:VGe,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."})}),War=x({tags:["interesting-fields"],url:"/v0/interesting-fields",method:"POST",body:KD,response:HD});var WGe=`/${"v1"}/interesting-fields`,JGe={scope:[{key:"context.service.name",value:"payments"},{key:"context.env",value:"prod",valueMustMatch:!0}]},ZGe=n.Object(KD.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:[JGe]}),Ooe=x({url:WGe,method:"POST",operationId:"getInterestingFields",tags:["public","interesting-fields"],body:ZGe,response:HD,description:"Ranks the telemetry fields most relevant to a scope, mined from how the org already uses them in dashboards and monitors, bucketed by logs, traces, and metrics. Use this before guessing a field or metric name: a field that many scope-matching dashboards group or filter on is the one an operator would reach for. Ranking is TF-IDF style, so a field used everywhere in the org scores below one that is distinctive to the scope. Dashboards and monitors the caller cannot read never contribute field names, only the anonymous frequency baseline. The operation requires public API read access to dashboards and monitors."});var Coe=yo("list","Rank the log, trace and metric fields most relevant to a scope, mined from dashboards and monitors",Ooe);var Roe=G("interesting-fields").pipe(B("Discover the telemetry fields an org already uses for a scope"),De([Coe]));var Pi="/v0/kubernetes-explorer",XGe="^[a-z0-9.-]+$",eBe="^[A-Za-z0-9._-]+$",Poe=256,woe=n.Optional(f({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 ni=e=>n.Optional(n.Array(f({allowEmpty:!1}),{description:e})),zD=["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.",YD={clusterId:woe,search:n.Optional(n.String({pattern:XGe,minLength:1,maxLength:Poe,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."}))},voe={clusterId:woe,search:n.Optional(n.String({pattern:eBe,minLength:1,maxLength:Poe,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."}))},Uoe=n.Object(YD),Noe=n.Object(voe),Xf={...YD,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."})),clusters:ni("Restrict results to these Kubernetes cluster names."),namespaces:ni("Restrict results to these namespaces."),teams:ni("Restrict results to these team names."),envs:ni("Restrict results to these environments."),exclusiveFilters:n.Optional(n.Array(n.Enum(zD),{description:NS})),...je},tBe=["Pending","Running","Succeeded","Failed","Unknown","CrashLoopBackOff","Error"],rBe=[...zD,"nodes","deployments","statefulsets","daemonsets","podStatus"],nBe={...Xf,nodes:ni("Restrict results to pods scheduled on these nodes."),deployments:ni("Restrict results to pods owned by these Deployments."),statefulsets:ni("Restrict results to pods owned by these StatefulSets."),daemonsets:ni("Restrict results to pods owned by these DaemonSets."),podStatus:ni("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(rBe),{description:`${NS} Excluding podStatus is applied after stitching pod phase and container status reason telemetry, because phase is not a filterable metric attribute.`}))},oBe=["deployment","statefulset","daemonset"],koe=n.Object({kind:n.Enum(oBe,{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."}),Loe=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(tBe,{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(H({description:"Timestamp from pod start time telemetry for the selected pod instance. Present when pod start time telemetry is observed."}))}),VD=n.Object({...Loe.properties,workload:n.Optional(koe),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."}))}),iBe=["podName","namespace","cluster","team","env","node","phase","restarts","cpuUsageMilli","cpuUtilization","cpuRequestUtilization","memoryUsageBytes","memoryUtilization","memoryRequestUtilization","createdAt"],mcr=x({tags:["kubernetes-explorer"],method:"GET",url:`${Pi}/pods`,query:n.Object({...nBe,sortBy:n.Optional(n.Enum(iBe,{description:"Field to sort pods by."})),sortDirection:n.Optional(Le)}),paginated:!0,response:n.Array(VD)}),sBe=["teams","envs"],QD=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."}))}),aBe=["cluster","teams","envs","cpuUsageMilli","memoryUsageBytes","readyNodes"],dcr=x({tags:["kubernetes-explorer"],method:"GET",url:`${Pi}/clusters`,query:n.Object({...voe,teams:ni("Restrict to clusters that host workloads from these team names."),envs:ni("Restrict to clusters that host workloads in these environments."),exclusiveFilters:n.Optional(n.Array(n.Enum(sBe),{description:NS})),sortBy:n.Optional(n.Enum(aBe,{description:"Field to sort clusters by."})),sortDirection:n.Optional(Le),...je}),paginated:!0,response:n.Array(QD)}),cBe=["clusters"],lBe=["Ready","NotReady","Unknown"],WD=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(lBe,{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."}))}),uBe=["node","cluster","status","instanceType","pods","allocatablePods","cpuUsageMilli","cpuAllocatableMilli","cpuUtilization","memoryUsageBytes","memoryAllocatableBytes","memoryUtilization"],fcr=x({tags:["kubernetes-explorer"],method:"GET",url:`${Pi}/nodes`,query:n.Object({...YD,clusters:ni("Restrict results to these Kubernetes cluster names."),exclusiveFilters:n.Optional(n.Array(n.Enum(cBe),{description:NS})),sortBy:n.Optional(n.Enum(uBe,{description:"Field to sort nodes by."})),sortDirection:n.Optional(Le),...je}),paginated:!0,response:n.Array(WD)}),JD=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."}))}),pBe=["namespace","cluster","teams","envs","pods","cpuUsageMilli","memoryUsageBytes"],gcr=x({tags:["kubernetes-explorer"],method:"GET",url:`${Pi}/namespaces`,query:n.Object({...Xf,sortBy:n.Optional(n.Enum(pBe,{description:"Field to sort namespaces by."})),sortDirection:n.Optional(Le)}),paginated:!0,response:n.Array(JD)}),ZD=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."}))}),mBe=["deployment","namespace","cluster","team","env","pods","availableReplicas","cpuUsageMilli","memoryUsageBytes"],hcr=x({tags:["kubernetes-explorer"],method:"GET",url:`${Pi}/deployments`,query:n.Object({...Xf,sortBy:n.Optional(n.Enum(mBe,{description:"Field to sort deployments by."})),sortDirection:n.Optional(Le)}),paginated:!0,response:n.Array(ZD)}),XD=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."}))}),dBe=["statefulSet","namespace","cluster","team","env","pods","cpuUsageMilli","memoryUsageBytes"],ycr=x({tags:["kubernetes-explorer"],method:"GET",url:`${Pi}/statefulsets`,query:n.Object({...Xf,sortBy:n.Optional(n.Enum(dBe,{description:"Field to sort StatefulSets by."})),sortDirection:n.Optional(Le)}),paginated:!0,response:n.Array(XD)}),eF=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."}))}),fBe=["daemonSet","namespace","cluster","team","env","pods","readyNodes","cpuUsageMilli","memoryUsageBytes"],Ecr=x({tags:["kubernetes-explorer"],method:"GET",url:`${Pi}/daemonsets`,query:n.Object({...Xf,sortBy:n.Optional(n.Enum(fBe,{description:"Field to sort DaemonSets by."})),sortDirection:n.Optional(Le)}),paginated:!0,response:n.Array(eF)}),tF=n.Object({overview:n.Object({...Loe.properties,workload:n.Optional(koe)},{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."})}),Moe=n.Object({clusterId:n.Optional(f({allowEmpty:!1})),k8sCluster:f({allowEmpty:!1}),k8sNamespace:f({allowEmpty:!1}),podName:f({allowEmpty:!1})}),Scr=x({tags:["kubernetes-explorer"],method:"GET",url:`${Pi}/pod-details`,query:Moe,response:tF}),rF=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:H({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(H({description:"Timestamp when Tsuga last observed the pod deletion event. Present when the latest observed pod event is deleted."}))}),Tcr=x({tags:["kubernetes-explorer"],method:"GET",url:`${Pi}/pod-manifest`,query:Moe,response:rF}),nF=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."}),oF=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(H({description:"Latest ReplicaSet metadata.creationTimestamp observed for the Deployment. Present when ReplicaSet object telemetry is observed."}))}),podReplicas:n.Array(nF,{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(H({description:"ReplicaSet metadata.creationTimestamp from the latest observed ReplicaSet object. Present when creation time is observed."})),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."})}),bcr=x({tags:["kubernetes-explorer"],method:"GET",url:`${Pi}/deployment-details`,query:n.Object({clusterId:n.Optional(f({allowEmpty:!1})),k8sCluster:f({allowEmpty:!1}),k8sNamespace:f({allowEmpty:!1}),deploymentName:f({allowEmpty:!1})}),response:oF}),gBe=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(H())}),podReplicas:n.Array(nF,{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(H())}))}),xcr=x({tags:["kubernetes-explorer"],method:"GET",url:`${Pi}/statefulset-details`,query:n.Object({clusterId:n.Optional(f({allowEmpty:!1})),k8sCluster:f({allowEmpty:!1}),k8sNamespace:f({allowEmpty:!1}),statefulSetName:f({allowEmpty:!1})}),response:gBe}),hBe=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(H())}),podReplicas:n.Array(nF,{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(H())}))}),Icr=x({tags:["kubernetes-explorer"],method:"GET",url:`${Pi}/daemonset-details`,query:n.Object({clusterId:n.Optional(f({allowEmpty:!1})),k8sCluster:f({allowEmpty:!1}),k8sNamespace:f({allowEmpty:!1}),daemonSetName:f({allowEmpty:!1})}),response:hBe}),vC=1e3,Doe=Ef,iF=n.Object({id:n.String({description:"Identifier of the event, unique across clusters and namespaces."}),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."}))}),yBe=["timestamp","type","reason","resourceName","resourceKind","namespace","cluster","count"],EBe=[...zD,"resourceKinds","resourceNames"],_cr=x({tags:["kubernetes-explorer"],method:"GET",url:`${Pi}/events`,query:n.Object({...Xf,resourceKinds:ni("Restrict results to events about these resource kinds (Pod, Node, Deployment...)."),resourceNames:ni("Restrict results to events about these resource names."),exclusiveFilters:n.Optional(n.Array(n.Enum(EBe),{description:NS})),sortBy:n.Optional(n.Enum(yBe)),sortDirection:n.Optional(Le)}),paginated:!0,response:n.Array(iF)});var Ps=`/${"v1"}/kubernetes-explorer`,$oe=n.Pick(VD,["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."}),SBe={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($oe,{examples:[SBe]});var Goe=n.Pick(QD,["cluster","teams","envs","cpuUsageMilli","memoryUsageBytes","readyNodes","podPhaseCounts"],{description:"A Kubernetes cluster with aggregate resource usage, node readiness, and pod phase counts."}),TBe={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(Goe,{examples:[TBe]});var Boe=n.Pick(JD,["namespace","cluster","teams","envs","pods","cpuUsageMilli","memoryUsageBytes"],{description:"A Kubernetes namespace with pod count and aggregate resource usage."}),bBe={namespace:"production",cluster:"prod-us-east",teams:["platform"],envs:["production"],pods:24,cpuUsageMilli:1800,memoryUsageBytes:3221225472};Object.assign(Boe,{examples:[bBe]});var qoe=n.Pick(WD,["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."}),xBe={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(qoe,{examples:[xBe]});var joe=n.Pick(ZD,["deployment","namespace","cluster","team","env","pods","availableReplicas","desiredReplicas","cpuUsageMilli","memoryUsageBytes"],{description:"A Kubernetes deployment with replica counts and aggregate resource usage."}),IBe={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(joe,{examples:[IBe]});var Hoe=n.Pick(XD,["statefulSet","namespace","cluster","team","env","pods","cpuUsageMilli","memoryUsageBytes"],{description:"A Kubernetes StatefulSet with replica counts and aggregate resource usage."}),_Be={statefulSet:"postgres",namespace:"production",cluster:"prod-us-east",team:"platform",env:"production",pods:3,cpuUsageMilli:900,memoryUsageBytes:2147483648};Object.assign(Hoe,{examples:[_Be]});var Koe=n.Pick(eF,["daemonSet","namespace","cluster","team","env","pods","readyNodes","desiredNodes","cpuUsageMilli","memoryUsageBytes"],{description:"A Kubernetes DaemonSet with eligible-node readiness and aggregate resource usage."}),ABe={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(Koe,{examples:[ABe]});var zoe=n.Pick(tF,["overview","healthMetrics","searchFilters"],{description:"Metrics-derived information for a single Kubernetes pod: status, owning workload, CPU/memory metric identifiers, and log/trace filters."}),OBe={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(zoe,{examples:[OBe]});var Yoe=n.Pick(rF,["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."}),CBe={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(Yoe,{examples:[CBe]});var Voe=n.Pick(oF,["overview","podReplicas","revisions"],{description:"Detailed information for a single Kubernetes deployment: replica status, backing pods, and rollout revisions."}),RBe={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(Voe,{examples:[RBe]});var Qoe=n.Pick(iF,["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."}),PBe={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(Qoe,{examples:[PBe]});var Woe=n.Object({clusterId:n.Optional(f({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."}))}),mm=n.Pick(Uoe,["clusterId","search"]),wBe=n.Pick(Noe,["clusterId","search"]),Joe=x({description:"Lists Kubernetes pods observed across the organization with their current phase, owning workload, and resource usage.",operationId:"listKubernetesPods",tags:["public","kubernetes-explorer"],method:"GET",url:`${Ps}/pods`,query:mm,response:n.Array($oe)}),Zoe=x({description:"Lists Kubernetes clusters observed across the organization with aggregate resource usage, node readiness, and pod phase counts.",operationId:"listKubernetesClusters",tags:["public","kubernetes-explorer"],method:"GET",url:`${Ps}/clusters`,query:wBe,response:n.Array(Goe)}),Xoe=x({description:"Lists Kubernetes namespaces observed across the organization with pod counts and aggregate resource usage.",operationId:"listKubernetesNamespaces",tags:["public","kubernetes-explorer"],method:"GET",url:`${Ps}/namespaces`,query:mm,response:n.Array(Boe)}),eie=x({description:"Lists Kubernetes nodes observed across the organization with their readiness, instance type, and resource usage against allocatable capacity.",operationId:"listKubernetesNodes",tags:["public","kubernetes-explorer"],method:"GET",url:`${Ps}/nodes`,query:mm,response:n.Array(qoe)}),tie=x({description:"Lists Kubernetes deployments observed across the organization with replica counts and aggregate resource usage.",operationId:"listKubernetesDeployments",tags:["public","kubernetes-explorer"],method:"GET",url:`${Ps}/deployments`,query:mm,response:n.Array(joe)}),rie=x({description:"Lists Kubernetes StatefulSets observed across the organization with replica counts and aggregate resource usage.",operationId:"listKubernetesStatefulSets",tags:["public","kubernetes-explorer"],method:"GET",url:`${Ps}/statefulsets`,query:mm,response:n.Array(Hoe)}),nie=x({description:"Lists Kubernetes DaemonSets observed across the organization with eligible-node readiness and aggregate resource usage.",operationId:"listKubernetesDaemonSets",tags:["public","kubernetes-explorer"],method:"GET",url:`${Ps}/daemonsets`,query:mm,response:n.Array(Koe)}),Foe=100,vBe=n.Object({...mm.properties,limit:n.Optional(n.Integer({minimum:1,maximum:vC,default:Foe,description:`Maximum number of events to return, newest first. Defaults to ${Foe}. Valid values are 1 through ${vC}.`}))}),oie=x({description:`Lists the most recent Kubernetes events of the last ${Doe/NL} hours (from the latest ${vC} event observations), newest first, with their type, reason, message, and the resource they are about. \`search\` matches the name of the resource the event is about.`,operationId:"listKubernetesEvents",tags:["public","kubernetes-explorer"],method:"GET",url:`${Ps}/events`,query:vBe,response:n.Array(Qoe)}),iie=n.Object({...Woe.properties,k8sCluster:f({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:f({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:f({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."})}),sie=x({description:"Retrieves metrics-derived information for a single Kubernetes pod: status, owning workload, CPU/memory metric identifiers, and ready-to-use log and trace filters. Manifest configuration, labels, and annotations are served by the pod-manifest endpoint.",operationId:"getKubernetesPodDetails",tags:["public","kubernetes-explorer"],method:"GET",url:`${Ps}/pod-details`,query:iie,response:zoe}),aie=x({description:"Retrieves the manifest-derived details for a single Kubernetes pod: the pod manifest spec, labels, and annotations from the pod's most recently observed manifest.",operationId:"getKubernetesPodManifest",tags:["public","kubernetes-explorer"],method:"GET",url:`${Ps}/pod-manifest`,query:iie,response:Yoe}),cie=x({description:"Retrieves detailed information for a single Kubernetes deployment: replica status, backing pods, and rollout revisions with ready-to-use log filters.",operationId:"getKubernetesDeploymentDetails",tags:["public","kubernetes-explorer"],method:"GET",url:`${Ps}/deployment-details`,query:n.Object({...Woe.properties,k8sCluster:f({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:f({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:f({allowEmpty:!1,description:"Kubernetes Deployment name to retrieve. From workload telemetry. Required to fetch deployment details for the selected cluster and namespace."})}),response:Voe});var UBe="clusterId";function NBe(e,t){let r=Sre(e.query),o={};for(let i of Object.keys(r)){if(i===UBe)continue;let s=i.replace(/([A-Z])/g,"-$1").toLowerCase(),a=s.replace(/-/g,"_").toUpperCase(),c=st(s).pipe(he(r[i]?.description??""),Fe(a));o[i]=t?c:c.pipe(Rt)}return o}function cn(e,t,r){let o=NBe(t,r);return G(e,o,D(`cli.kubernetes.${e}`)(function*(i){let s=i,a={};for(let c of Object.keys(o)){let l=Tre(s,c);l!==void 0&&(a[c]=l)}yield*Oe(yield*ye(t,Object.keys(a).length>0?{query:a}:void 0))})).pipe(B(t.description??(r?`Get Kubernetes ${e}`:`List Kubernetes ${e}`)))}var lie=cn("clusters",Zoe,!1);var uie=cn("daemonsets",nie,!1);var pie=cn("deployment-details",cie,!0);var mie=cn("deployments",tie,!1);var die=cn("events",oie,!1);var fie=cn("namespaces",Xoe,!1);var gie=cn("nodes",eie,!1);var hie=cn("pod-details",sie,!0);var yie=cn("pod-manifest",aie,!0);var Eie=cn("pods",Joe,!1);var Sie=cn("statefulsets",rie,!1);var Tie=G("kubernetes").pipe(B("Explore Kubernetes resources observed across the organization"),De([Eie,lie,fie,gie,mie,Sie,uie,die,hie,yie,pie]));var kS=`/${"v1"}/logs`,sF=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(HL,["message","timestamp","level"]).properties},{additionalProperties:!0,$id:"LogEvent",description:"Log event including message, timestamp, severity level, and optional enriched context attributes."}),kBe={context:{team:"platform"},message:"Request completed successfully",timestamp:17040672e5,level:"INFO"};Object.assign(sF,{examples:[kBe]});var bie=n.Object({query:n.Optional(f({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:iZ,description:"Maximum number of logs to return. Defaults to 100. Valid values are 1 through 1000."})),clusterId:n.Optional(f({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."})),...Yr.properties},{description:"Log search query. Provide a time range, optional Tsuga query, and optional limit."}),LBe={query:"level:ERROR",maxResults:100,from:1704067200,to:1704070800};Object.assign(bie,{examples:[LBe]});var xie=x({description:"Searches logs in a required time range using Tsuga query syntax. Use this endpoint to retrieve raw log events for investigations or automation. See [Logs](/documentation/explore/logs) and [Query syntax](/documentation/explore/query-syntax).",operationId:"searchLogs",tags:["public","logs"],url:`${kS}/search`,method:"GET",query:bie,response:n.Object({logs:n.Array(sF,{description:"Log events matching the query and time range."})})}),MBe=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`."}))}),Iie=n.Object({patterns:n.Array(MBe,{description:"Log patterns clustered from logs matching the query."}),sampleSize:n.Number({description:"Number of logs sampled while computing patterns."})},{}),DBe={patterns:[{pattern:"Resolved segment SegmentId([0:1]) from cache",size:37004,groups:[{key:"level",value:"DEBUG"},{key:"context.team",value:"infra"}]}],sampleSize:100};Object.assign(Iie,{examples:[DBe]});var _ie=x({description:"Clusters matching logs into readable patterns for the requested time range. Use this to summarize common log shapes before drilling into raw events. See [Logs](/documentation/explore/logs).",operationId:"getLogPatterns",tags:["public","logs"],url:`${kS}/patterns`,method:"GET",query:n.Object({...Yr.properties,query:f({type:"tsuga-query",description:"Tsuga query selecting logs to cluster into patterns."}),clusterId:n.Optional(f({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))}),response:Iie}),FBe=n.Object({exampleLog:n.Optional(sF),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."})}),Aie=n.Object({newErrorPatterns:n.Array(FBe,{description:"Error patterns first seen in the requested time range."})},{}),$Be={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(Aie,{examples:[$Be]});var Oie=x({description:"Finds error patterns first seen in the requested time range, optionally filtered by team, environment, or service. Use this to detect newly appearing failures. See [Logs](/documentation/explore/logs).",operationId:"getNewErrorPatterns",tags:["public","logs"],url:`${kS}/patterns/new`,method:"GET",query:n.Object({...Yr.properties,team:n.Optional(f({description:"Team name to restrict pattern detection to."})),env:n.Optional(f({description:"Environment to restrict pattern detection to."})),service:n.Optional(f({description:"Service name to restrict pattern detection to."})),clusterId:n.Optional(f({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))}),response:Aie}),GBe=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."}))}),Cie=n.Object({errorPatternIncreases:n.Array(GBe,{description:"Error patterns with increased occurrence in the requested time range."})},{}),BBe={errorPatternIncreases:[{team:"platform",env:"production",pattern:"Non-resolved segment SegmentId(*) from cache",increaseTimestamps:[17041536e5,17042392e5]}]};Object.assign(Cie,{examples:[BBe]});var Rie=x({description:"Finds error patterns whose occurrence increased for a team in the requested time range. Use this to identify growing failure modes without retrieving raw log events. See [Logs](/documentation/explore/logs).",operationId:"getErrorPatternIncrease",tags:["public","logs"],url:`${kS}/patterns/increase`,method:"GET",query:n.Object({...Yr.properties,team:f({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(f({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(f({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))}),response:Cie}),Pie=n.Object({attributes:n.Array(n.String(),{description:"Log attribute dot-paths observed in the time range"})},{}),qBe={attributes:["context.env","context.k8s.pod.name","context.service.name","context.team","level","message","timestamp"]};Object.assign(Pie,{examples:[qBe]});var jBe=n.Object({...Yr.properties,clusterId:n.Optional(f({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))},{description:"Log attribute discovery query. Provide a time range and optional cluster ID."}),wie=x({description:"Lists log attribute dot-paths observed in the requested time range. This endpoint requires a public API credential that can read all relevant teams because attribute discovery is not team-filtered. Use this to discover fields for Tsuga queries, filters, and grouping. See [Logs](/documentation/explore/logs).",operationId:"getLogAttributes",tags:["public","logs"],url:`${kS}/attributes`,method:"GET",query:jBe,response:Pie});var vie=G("attributes",ar,D("cli.logs.attributes")(function*(e){yield*Oe(yield*ye(wie,{query:{from:yield*Ft("from",e.from),to:yield*Ft("to",e.to)}}))})).pipe(B("List log attribute dot-paths observed in the time range"));var UC=st("env").pipe(he("Filter by environment"),Fe("ENV_NAME"),Rt);var Uie=G("error-pattern-increases",{...ar,team:st("team").pipe(he("Team to query"),Fe("TEAM_NAME")),env:UC},D("cli.logs.errorPatternIncreases")(function*(e){yield*Oe(yield*ye(Rie,{query:ho({from:yield*Ft("from",e.from),to:yield*Ft("to",e.to),team:e.team,env:Re(e.env)})}))})).pipe(B("List error pattern increases for a given team"));var HBe=st("team").pipe(he("Filter by team"),Fe("TEAM_NAME"),Rt),Nie=G("new-error-patterns",{...ar,team:HBe,env:UC,service:st("service").pipe(he("Filter by service"),Fe("SERVICE_NAME"),Rt)},D("cli.logs.newErrorPatterns")(function*(e){yield*Oe(yield*ye(Oie,{query:ho({from:yield*Ft("from",e.from),to:yield*Ft("to",e.to),team:Re(e.team),env:Re(e.env),service:Re(e.service)})}))})).pipe(B("List error patterns first seen in this time range"));var kie=["count","ratio","team","level","pattern"];function KBe(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 Lie=G("patterns",{...ar,query:uu.pipe(he("Tsuga query to filter logs before clustering into patterns")),...Ia(kie)},D("cli.logs.patterns")(function*(e){let t=yield*ti,r=yield*ye(_ie,{query:ho({from:yield*Ft("from",e.from),to:yield*Ft("to",e.to),query:yield*am("query",e.query)})}),{patterns:o,sampleSize:i}=r,s=o.map(a=>KBe(a,i));yield*t.rows(s,{...e,defaultFields:kie})})).pipe(B("List log patterns"));var zBe=D("telemetry.resolveMaxResults")(function*(e){if(e===void 0)return;let t=Re(e);if(t!==void 0)return t;let r=yield*am("max-results",re());if(r===void 0)return;let o=Number(r);return!Number.isSafeInteger(o)||o<=0?yield*new pr({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}),eg=D("telemetry.timeRangeQuery")(function*(e){let t=e.query===void 0?void 0:yield*am("query",e.query),r=yield*zBe(e.maxResults);return ho({from:yield*Ft("from",e.from),to:yield*Ft("to",e.to),query:t,maxResults:r})});var Mie=["timestamp","level","message"],Die=G("search",{...ar,query:uu,maxResults:Hf,...Ia(Mie)},D("cli.logs.search")(function*(e){let t=yield*ti,r=yield*ye(xie,{query:yield*eg(e)}),{logs:o}=r;yield*t.rows(o,{...e,defaultFields:Mie})})).pipe(B("Search logs"));var Fie=G("logs").pipe(B("Search and analyze logs"),De([Die,vie,Lie,Nie,Uie]));var aF=`/${"v1"}/metrics`,cF=n.Object({name:n.String({description:"Metric name observed by Tsuga. Use this value in metric queries and aggregations."}),type:AO,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(OO),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."}))}),YBe={name:"http.server.request.duration",type:"histogram",description:"Duration of HTTP server requests",unit:"ms",temporality:"delta",capabilities:["max","min","sum"],attributes:["context.team","context.environment","context.region"]};Object.assign(cF,{examples:[YBe]});var $ie=n.Object({...Yr.properties,clusterId:n.Optional(f({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))},{description:"Metric metadata query. Provide the time range to inspect and optionally a cluster ID."}),Gie=x({description:"Lists metrics observed in the requested time range with metadata such as type, unit, temporality, capabilities, and attributes. Use this to discover metric names before querying or graphing them. See [Metrics](/documentation/explore/metrics/index).",operationId:"listMetrics",tags:["public","metrics"],url:aF,method:"GET",query:$ie,response:n.Array(cF)}),Bie=x({description:"Retrieves metadata for one metric name in the requested time range. Use this to inspect available dimensions and supported query behavior for a metric. See [Metric details](/documentation/explore/metrics/metric-details).",operationId:"getMetric",tags:["public","metrics"],url:`${aF}/:name`,method:"GET",params:n.Object({name:f({allowEmpty:!1,description:"Metric name to retrieve, for example `http.server.request.duration`."})}),query:$ie,response:cF}),VBe=["service","env","host","method","status_code"];Object.assign(nS,{examples:[VBe]});var qie=n.Pick(zL,["assets"]),QBe={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(qie,{examples:[QBe]});var jie=x({description:"Retrieve dashboards and monitors that use a specific metric",operationId:"getMetricAssetsUsage",tags:["private"],url:`${aF}/assets-usage`,method:"GET",query:n.Object({metricName:f({allowEmpty:!1,description:"The name of the metric to find usage for"})}),response:qie});var Hie=G("assets-usage",{name:on("METRIC_NAME").pipe(sn("The metric to look up"))},D("cli.metrics.assetsUsage")(function*({name:e}){yield*Oe(yield*ye(jie,{query:{metricName:e}}))})).pipe(B("List dashboards and monitors that use a specific metric"));var Kie=G("get",{name:on("METRIC_NAME").pipe(sn("The metric to retrieve")),...ar},D("cli.metrics.get")(function*(e){yield*Oe(yield*ye(Bie,{params:{name:e.name},query:{from:yield*Ft("from",e.from),to:yield*Ft("to",e.to)}}))})).pipe(B("Retrieve a metric by name with its metadata"));var zie=G("list",ar,D("cli.metrics.list")(function*(e){yield*Oe(yield*ye(Gie,{query:{from:yield*Ft("from",e.from),to:yield*Ft("to",e.to)}}))})).pipe(B("List all metrics with their metadata"));var Yie=G("metrics").pipe(B("List and inspect metrics"),De([zie,Kie,Hie]));var WBe=n.Union([n.Literal("scalar"),n.Literal("timeseries")]),JBe="/v0/promql",NC=n.Object({query:f({type:"long",allowEmpty:!1,description:"PromQL expression to evaluate."}),timeRange:Os,step:f({allowEmpty:!1,description:"Evaluation step interval (e.g. `1m`, `5m`, `1h`). Must be a valid Prometheus duration string."}),returnType:n.Optional(WBe),executionOptions:oS,shouldStreamResults:n.Optional(n.Boolean()),clusterId:n.Optional(f({allowEmpty:!1,description:"Cluster to target. Defaults to the first cluster created in the organization when omitted."}))}),ZBe={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(NC,{examples:[ZBe]});var Zur=x({tags:["promql"],url:JBe,method:"POST",body:NC,response:Cf});var XBe=`/${"v1"}/promql`,eqe=n.Object({...n.Pick(NC,["query","step"]).properties,timeRange:Yr},{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"}]}),tqe=n.Object({clusterId:n.Optional(f({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."}))}),Vie=x({description:"Runs a PromQL range query over Tsuga metric data and returns timeseries results. Authenticate with a bearer operation API key or OAuth access token that can read metrics. Send clusterId as a query parameter; multi-cluster organizations must provide it. See [How to write PromQL queries](/documentation/visualize/guides/how-to-write-promql-queries) for query syntax and examples.",operationId:"queryPromql",tags:["public","promql"],url:XBe,method:"POST",body:eqe,query:tqe,response:PO});var Qie=yo("query","Run a PromQL range query over metric data",Vie);var Wie=G("promql").pipe(B("Run PromQL queries over metric data"),De([Qie]));var rqe={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"]}},[gpr,kC,LS]=nqe(rqe),hpr=Object.fromEntries(kC.map(e=>[e,e]));function nqe(e){let t=[],r=[],o=[],i=Object.keys(e);for(let s of i){t.push(s);let a=e[s];for(let c in a){r.push(c);let l=a[c];Array.isArray(l)&&o.push(...l)}}return[lF(t),lF(r),lF(o)]}function lF(e){if(e.length===0)throw new Error("Array must have at least one element.");return e}var uF=n.Enum(["HTTP","HTTPS","TCP","UDP","GENEVE","TLS","TLS_QUIC","TCP_UDP","TCP_QUIC","QUIC"]),oqe=n.Object({versioningStatus:n.Optional(n.Enum(["Enabled","Disabled","Suspended","Not configured"]))}),iqe=n.Object({domainName:n.Optional(n.String()),origins:n.Optional(n.Array(n.String()))}),sqe=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())}),aqe=n.Object({version:n.Optional(n.String()),virtualNetworkId:n.Optional(n.String()),subnets:n.Optional(n.Array(n.String()))}),cqe=n.Object({artifactRegistryFormat:n.Optional(n.Enum(["FORMAT_UNSPECIFIED","DOCKER","MAVEN","NPM","APT","YUM","PYTHON","KFP","GO","GENERIC"])),uri:n.Optional(n.String()),tagMutability:n.Optional(n.Enum(["MUTABLE","IMMUTABLE"])),scanOnPush:n.Optional(n.Boolean()),encryptionType:n.Optional(n.String())}),lqe=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(H())}),pqe=n.Object({isEncrypted:n.Optional(n.Boolean()),ownerId:n.Optional(n.String()),state:n.Optional(n.Enum(["creating","available","deleting","deleted","error","updating"]))}),mqe=n.Object({type:n.Optional(n.String()),osType:n.Optional(n.String()),subnetIds:n.Optional(n.Array(n.String())),nbContainers:n.Optional(n.Number())}),dqe=n.Object({digest:n.String(),imageTags:n.Array(n.String()),imageSizeBytes:n.Optional(n.Number()),imagePushedAt:n.Optional(H()),mediaType:n.Optional(n.String()),repositoryName:n.String(),repositoryId:n.Optional(n.String()),scanStatus:n.Optional(n.String())}),fqe=n.Object({url:n.Optional(n.String()),maxMessageSizeBytes:n.Optional(n.Number()),messageRetentionHours:n.Optional(n.Number())}),gqe=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())}),hqe=n.Object({kind:n.Optional(n.String())}),yqe=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())}),Eqe=n.Object({id:n.Optional(n.String()),ipCidrBlocks:n.Array(n.String())}),Sqe=n.Object({protocol:n.Optional(uF),port:n.Optional(n.Number()),instanceProtocol:n.Optional(uF),instancePort:n.Optional(n.Number())}),Tqe=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"])}),xqe=n.Object({type:n.String(),name:n.String()}),Iqe=n.Object({frontendIp:n.Optional(bqe),backendIpPools:n.Array(xqe)}),_qe=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())}),Aqe=n.Object({protocol:n.Optional(uF),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(_qe)),targetCount:n.Optional(n.Number()),healthyTargetCount:n.Optional(n.Number()),loadBalancerArns:n.Optional(n.Array(n.String()))}),Oqe=n.Object({first:n.Optional(n.String()),last:n.Optional(n.String()),scope:n.Optional(n.Number())}),Cqe=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(),Oqe]))),target:n.Optional(n.String()),weight:n.Optional(n.Number()),priority:n.Optional(n.Number()),status:n.Optional(n.String())}),Rqe=n.Object({instanceId:n.Optional(n.String()),state:n.Optional(n.String()),reasonCode:n.Optional(n.String()),description:n.Optional(n.String())}),Pqe=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(Sqe),n.Array(Tqe)])),targets:n.Optional(n.Union([n.Array(n.String()),n.Array(Rqe),n.Array(Cqe)])),azureLoadBalancingRules:n.Optional(n.Array(Iqe))}),wqe=n.Object({domainName:n.Optional(n.String()),expiresAt:n.Optional(H()),inUseBy:n.Optional(n.Array(n.String())),renewalEligibility:n.Optional(n.String()),revokedAt:n.Optional(H()),status:n.Optional(n.String()),type:n.Optional(n.String())}),vqe=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"]))}),Uqe=n.Object({osType:n.Optional(n.Enum(["Windows","Linux"]))}),Nqe=n.Object({state:n.Optional(n.String()),volumeType:n.Optional(n.String())}),kqe=n.Intersect([n.Object({isEncrypted:n.Optional(n.Boolean()),sizeGib:n.Optional(n.Number())}),n.Union([vqe,Nqe,Uqe])]),Lqe=n.Object({instanceCount:n.Optional(n.Number()),hostnames:n.Optional(n.Array(n.String())),runtime:n.Optional(n.String())}),LC=n.Union([n.Object({category:n.Literal("application"),resourceType:n.Literal("webService"),attributes:n.Optional(Lqe)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("bucket"),attributes:n.Optional(oqe)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("messagingService"),attributes:n.Optional(fqe)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("fileSystem"),attributes:n.Optional(pqe)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("contentDeliveryNetwork"),attributes:n.Optional(iqe)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("database"),attributes:n.Optional(sqe)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("storageAccount"),attributes:n.Optional(hqe)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("volume"),attributes:n.Optional(kqe)}),n.Object({category:n.Literal("compute"),resourceType:n.Literal("virtualMachine"),attributes:n.Optional(yqe)}),n.Object({category:n.Literal("compute"),resourceType:n.Literal("serverless"),attributes:n.Optional(gqe)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("kubernetesCluster"),attributes:n.Optional(aqe)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerRepository"),attributes:n.Optional(cqe)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerCluster"),attributes:n.Optional(lqe)}),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(mqe)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerImage"),attributes:n.Optional(dqe)}),n.Object({category:n.Literal("network"),resourceType:n.Literal("virtualNetwork"),attributes:n.Optional(Eqe)}),n.Object({category:n.Literal("network"),resourceType:n.Literal("loadBalancer"),attributes:Pqe}),n.Object({category:n.Literal("network"),resourceType:n.Literal("targetGroup"),attributes:n.Optional(Aqe)}),n.Object({category:n.Literal("network"),resourceType:n.Literal("certificate"),attributes:n.Optional(wqe)})],{description:"Normalized public inventory category, resource type, and category-specific attributes. Attribute shape depends on the category and resourceType combination."});var dm="/v0/inventory",Jie=["scan_in_progress","success","failure","partial"],mF=n.Object({id:n.String({description:"Identifier of the inventory resource. Generated by Tsuga."}),cloudPlatform:n.Enum(ou,{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(H({description:"Timestamp when the resource was created in the cloud, when known."})),resourceUpdatedAt:n.Optional(H({description:"Timestamp when the resource was last updated in the cloud, when known."})),resourceLastSeenAt:H({description:"Timestamp when Tsuga last observed this resource during an inventory scan."}),tags:br,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"}))}),tg={DISPLAY_NAME:"displayName",CLOUD_ACCOUNT:"cloudAccount",NATIVE_RESOURCE_TYPE:"nativeResourceType",CLOUD_REGION:"cloudRegion",RESOURCE_TYPE:"resourceType",RESOURCE_CREATED_AT:"resourceCreatedAt"},Zie=n.Object({cloudPlatforms:qe(n.Enum(ou),{description:"Restrict results to resources discovered on any of these cloud platforms",maxItems:ou.length}),cloudAccounts:qe(f({allowEmpty:!1}),{description:"Restrict results to resources in any of these cloud accounts",maxItems:500}),cloudRegions:qe(f({allowEmpty:!1}),{description:"Restrict results to resources in any of these cloud regions",maxItems:500}),nativeResourceTypes:qe(n.Enum(LS),{description:"Restrict results to resources of any of these cloud-native resource types",maxItems:LS.length}),resourceTypes:qe(n.Enum(kC),{description:"Restrict results to resources of any of these normalized resource types",maxItems:kC.length}),tags:qe(Fn.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:f({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"}),dF=n.Partial(n.Object({...je,filters:n.Partial(Zie,{description:"Filters applied to narrow the returned resources."}),sort:n.Object({by:n.Enum([tg.DISPLAY_NAME,tg.CLOUD_ACCOUNT,tg.NATIVE_RESOURCE_TYPE,tg.CLOUD_REGION,tg.RESOURCE_TYPE,tg.RESOURCE_CREATED_AT],{description:"Field to sort the returned resources by"}),direction:Le},{description:"Optional sorting applied to the returned resources. Ties are broken by resource ID for stable pagination."})})),Apr=x({tags:["inventory"],method:"POST",url:`${dm}/resources/query`,paginated:!0,body:dF,response:n.Array(n.Intersect([mF,LC]))}),Mqe=["resourceType","cloudAccount","isIacManaged"],Opr=x({tags:["inventory"],method:"POST",url:`${dm}/resources/counts`,body:n.Object({filters:n.Optional(n.Partial(Zie)),groupBy:n.Enum(Mqe,{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."})}))}),Cpr=x({tags:["inventory"],method:"GET",url:`${dm}/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:Dn})}),Rpr=Q("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."})})]),Dqe="^[0-9]{12}$",Fqe="^arn:aws[a-z-]*:iam::[0-9]{12}:role/.+$",$qe="^[a-z][a-z0-9-]{4,28}[a-z0-9]$",Gqe="^[^@\\s]+@[^@\\s]+\\.iam\\.gserviceaccount\\.com$",Bqe="^//iam\\.googleapis\\.com/projects/[0-9]+/locations/global/workloadIdentityPools/[^/]+/providers/[^/]+$",pF="^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$",qqe=n.Object({type:n.Literal("aws",{description:"Discriminator identifying AWS connection settings."}),accountId:n.String({pattern:Dqe,description:"AWS account ID that Tsuga scans.",errorMessage:{pattern:"Must be a 12-digit AWS account ID."}}),externalId:f({allowEmpty:!1,description:"External ID Tsuga passes when assuming the cross-account IAM role."}),roleArn:n.String({pattern:Fqe,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"}),jqe=n.Object({type:n.Literal("gcp",{description:"Discriminator identifying GCP connection settings."}),projectId:n.String({pattern:$qe,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:Gqe,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:Bqe,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"}),Hqe=n.Object({type:n.Literal("azure",{description:"Discriminator identifying Azure connection settings."}),clientId:n.String({pattern:pF,minLength:1,description:"Client ID of the Azure application Tsuga authenticates as (GUID).",errorMessage:{pattern:"Must be a GUID."}}),subscriptionId:n.String({pattern:pF,minLength:1,description:"Azure subscription ID that Tsuga scans (GUID).",errorMessage:{pattern:"Must be a GUID."}}),tenantId:n.String({pattern:pF,minLength:1,description:"Azure tenant ID that owns the subscription (GUID).",errorMessage:{pattern:"Must be a GUID."}})},{$id:"AzureConnectionSettings"}),Xie=Q("type",[qqe,jqe,Hqe],{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`."}),rg=n.Object({id:n.String({description:"Identifier of the cloud account. Generated by Tsuga."}),cloudType:n.Enum(ou,{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:H({description:"Timestamp when the account was registered in Tsuga."}),lastScanStartedAt:n.Optional(H({description:"Timestamp when the most recent inventory scan started."})),lastScanFinishedAt:n.Optional(H({description:"Timestamp when the most recent inventory scan finished."})),lastScanStatus:n.Optional(n.Enum(Jie,{description:"Status of the most recent inventory scan."}))}),fF=n.Object({cloudType:n.Enum(ou,{description:"Cloud provider of the account."}),cloudAccountId:f({allowEmpty:!1,description:"Cloud-native account identifier: an AWS account ID, GCP project ID, or Azure subscription ID."}),accountFriendlyName:n.Optional(f({description:"Human-readable name for the account shown in Tsuga."})),organizationId:n.Optional(f({description:"Cloud organization identifier, when known."})),connectionSettings:Xie,lastScanStatus:n.Optional(n.Enum(Jie,{description:"Status of the most recent inventory scan."}))}),fm=`${dm}/cloud-accounts`,Ppr=x({tags:["inventory"],url:fm,method:"GET",response:n.Array(rg)}),wpr=x({tags:["inventory"],url:`${fm}/:id`,method:"GET",params:n.Object({id:f()}),response:rg}),vpr=x({tags:["inventory"],url:fm,method:"POST",body:fF,response:rg}),gF=n.Object({accountFriendlyName:f({description:"Human-readable name for the account shown in Tsuga."})}),Upr=x({tags:["inventory"],url:`${fm}/:id`,method:"PUT",params:n.Object({id:f()}),body:gF,response:rg}),Npr=x({tags:["inventory"],url:`${fm}/:id`,method:"DELETE",params:n.Object({id:f()}),response:ae}),kpr=x({tags:["inventory"],url:`${dm}/trigger-scan`,method:"POST",body:n.Object({}),response:n.Object({success:n.Literal(!0)})}),Lpr=x({tags:["inventory"],url:`${fm}/azure/onboarding`,method:"POST",body:n.Object({tenantId:f()}),response:n.Object({subjectId:n.String(),audience:n.String()})}),Mpr=x({tags:["inventory"],method:"POST",url:`${fm}/validate/:type`,params:n.Object({type:f()}),body:n.Object({data:Xie,id:n.Optional(f())}),response:n.Object({areAccountSettingsValid:n.Boolean(),message:n.Optional(n.String())})}),ese=`${dm}/settings`,Dpr=x({tags:["inventory"],url:ese,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())}))}))})}),Kqe=50,Fpr=x({tags:["inventory"],url:ese,method:"POST",body:n.Object({infrastructureIdentifiers:n.Array(n.Object({name:f({allowEmpty:!1}),value:n.Optional(f({allowEmpty:!1}))}),{maxItems:Kqe})}),response:n.Object({})}),$pr=x({tags:["inventory"],url:`${dm}/iac-tags-proposal`,method:"GET",response:n.Array(n.Object({name:n.String(),value:n.Optional(n.String())}))});var tse=`/${"v1"}/inventory`,zqe=n.Omit(mF,["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)."}),rse=n.Intersect([zqe,LC],{$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)."}),Yqe={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(rse,{examples:[Yqe]});var nse=n.Object({...dF.properties,...er},{description:"Inventory resource query request. Use filters, sorting, limit, and offset to page through discovered resources."}),Vqe={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(nse,{examples:[Vqe]});var ose=x({description:"Queries cloud resources discovered by inventory scans, with optional filters, sorting, and pagination. Use this endpoint to build infrastructure inventories across connected cloud accounts.",operationId:"queryInventoryResources",tags:["inventory"],url:`${tse}/resources/query`,method:"POST",paginated:!0,body:nse,response:n.Array(rse)}),MS=`${tse}/cloud-accounts`,DS=n.Pick(rg,["id","cloudType","cloudAccountId","accountFriendlyName"],{$id:"CloudAccount"}),Qqe={id:"123-456-abc",cloudType:"aws",cloudAccountId:"123456789012",accountFriendlyName:"Production AWS"};Object.assign(DS,{examples:[Qqe]});var ise=n.Pick(fF,["cloudType","cloudAccountId","accountFriendlyName","connectionSettings"]),Wqe={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(ise,{examples:[Wqe]});var sse=n.Pick(gF,["accountFriendlyName"]),Jqe={accountFriendlyName:"Production AWS"};Object.assign(sse,{examples:[Jqe]});var Vpr=x({description:"Lists cloud accounts connected to Tsuga that the authenticated operation key can read.",operationId:"listCloudAccounts",tags:["inventory"],url:MS,method:"GET",response:n.Array(DS)}),Qpr=x({description:"Retrieves one cloud account by ID.",operationId:"getCloudAccount",tags:["inventory"],url:`${MS}/:id`,method:"GET",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the cloud account to retrieve. Use the `id` returned by the cloud account list or create operations."})}),response:DS}),Wpr=x({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:ise,response:DS}),Jpr=x({description:"Updates the friendly name of a cloud account by ID.",operationId:"updateCloudAccount",tags:["inventory"],url:`${MS}/:id`,method:"PUT",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the cloud account to update. Use the `id` returned by the cloud account list or create operations."})}),body:sse,response:DS}),Zpr=x({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:f({allowEmpty:!1,description:"Identifier of the cloud account to delete. Use the `id` returned by the cloud account list or create operations."})}),response:ae});var ase=_t({commandName:"cloud-resources",description:"List cloud resources discovered by inventory scans",endpoints:{list:ose},enableListBody:!0});var og="/v0/dashboard-folders",ig=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:br,creator:n.Optional(Qe),updater:n.Optional(Qe),createdAt:H(),updatedAt:H()},{title:"DashboardFolder"}),hF=n.Object({...ig.properties,dashboardCount:n.Number({description:"Number of dashboards directly assigned to this folder that the caller can read. Returned only by folder list responses; callers without dashboard read access see 0."})}),MC=n.Object({name:f({allowEmpty:!1,description:"Display name of the dashboard folder. Required and non-empty."}),owner:f({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(),f({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:wr}),DC=n.Partial(n.Object({owners:qe(f({allowEmpty:!1}),{description:"Restrict results to dashboard folders owned by any of these team IDs",maxItems:50}),searchQuery:n.Object({value:f({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:qe(Fn.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(),f({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"})),ng={IS_FAVORITE:"isFavorite",OWNER:"owner",TAGS:"tags",DASHBOARD_COUNT:"dashboardCount",UPDATED_AT:"updatedAt",NAME:"name"},yF=[ng.OWNER,ng.TAGS,ng.DASHBOARD_COUNT,ng.UPDATED_AT,ng.NAME],Zqe=n.Partial(n.Object({...je,filters:DC,sort:n.Object({by:n.Enum([...yF,ng.IS_FAVORITE],{description:"Field to sort the returned dashboard folders by"}),direction:Le},{description:"Optional sorting applied to the returned dashboard folders"})})),lmr=x({tags:["dashboard-folders"],url:`${og}/query`,method:"POST",paginated:!0,body:Zqe,response:n.Array(hF)}),umr=x({tags:["dashboard-folders"],url:`${og}/:id`,method:"GET",params:n.Object({id:f()}),response:ig}),pmr=x({tags:["dashboard-folders"],url:og,method:"POST",body:MC,response:ig}),mmr=x({tags:["dashboard-folders"],url:`${og}/:id`,method:"PUT",params:n.Object({id:f()}),body:MC,response:ig}),dmr=x({tags:["dashboard-folders"],url:`${og}/:id`,method:"DELETE",params:n.Object({id:f()}),response:ae}),fmr=x({tags:["dashboard-folders"],url:`${og}/tags/query`,method:"POST",body:n.Object({filters:n.Optional(n.Omit(DC,["tags"]))}),response:Dn});var FS=`/${"v1"}/dashboard-folders`,FC=n.Pick(ig,["id","name","owner","parentFolderId","tags"],{$id:"DashboardFolder",description:"Folder used to organize dashboards into a two-level hierarchy"}),cse={id:"123-456-abc",name:"Platform",owner:"team-123-abc",tags:[{key:"team",value:"platform"}]};Object.assign(FC,{examples:[cse]});var lse=n.Pick(hF,["id","name","owner","parentFolderId","tags","dashboardCount"],{$id:"DashboardFolderWithDashboardCount",description:"Folder used to organize dashboards into a two-level hierarchy, including the number of readable dashboards it directly contains."}),Xqe={...cse,dashboardCount:10};Object.assign(lse,{examples:[Xqe]});var EF=n.Pick(MC,["name","owner","parentFolderId","tags"],{description:"Dashboard folder create or update request. Provide a name, owner team, optional parent folder, and optional tags."}),eje={name:"Platform",owner:"team-123-abc",parentFolderId:null,tags:[{key:"team",value:"platform"}]};Object.assign(EF,{examples:[eje]});var tje=n.Object({by:n.Enum(yF,{description:"Field to sort the returned dashboard folders by: `owner` sorts by owning team name, `tags` sorts by tag key/value pairs, `dashboardCount` sorts by the number of readable dashboards directly in the folder, `updatedAt` sorts by last-updated timestamp, and `name` sorts alphabetically by folder name."}),direction:Le},{description:"Optional sorting applied to the returned dashboard folders"}),use=n.Object({...er,filters:n.Optional(n.Pick(DC,["owners","searchQuery","tags","parentFolderId"])),sort:n.Optional(tje)},{description:"Dashboard folder query request. Use filters, sorting, limit, and offset to page through visible dashboard folders."}),rje={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(use,{examples:[rje]});var pse=x({description:"Queries dashboard folders visible to the authenticated operation key. Returns all folders unless the `parentFolderId` filter is set: pass a folder ID to select the children of that folder, or null to return only top-level folders. Results are ordered by most recently updated folder first unless `sort` is set, and include the number of readable dashboards directly assigned to each folder. Use filters to narrow by owning team, name or ID substring, or tags.",operationId:"queryDashboardFolders",tags:["dashboard-folders"],url:`${FS}/query`,method:"POST",paginated:!0,body:use,response:n.Array(lse)}),mse=x({description:"Retrieves one dashboard folder by ID.",operationId:"getDashboardFolder",tags:["dashboard-folders"],url:`${FS}/:id`,method:"GET",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the dashboard folder to retrieve. Use the `id` returned by folder list, get, create, or update responses."})}),response:FC}),dse=x({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:FS,method:"POST",body:EF,response:FC}),fse=x({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:`${FS}/:id`,method:"PUT",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the dashboard folder to update. Use the `id` returned by folder list, get, create, or update responses."})}),body:EF,response:FC}),gse=x({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:`${FS}/:id`,method:"DELETE",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the dashboard folder to delete. Use the `id` returned by folder list, get, create, or update responses."})}),response:ae});var hse=_t({commandName:"dashboard-folders",description:"Manage dashboard folders",endpoints:{list:pse,get:mse,create:dse,update:fse,delete:gse},enableListBody:!0});var Aa="/v0/dashboards",Ese=["white","gray.100","amber.200","lime.200","emerald.200","cyan.200","blue.200","violet.200","fuchsia.200","pink.200","red.200"],nje=["bar","distribution","gauge","heatmap","list","pie","query-value","table","timeseries","top-list"],Dmr=[...nje,"note","slo"];var oje=["ns","us","ms","s","m","h","days"];var ije=["B","KB","MB","GB","TB","PB"];var sje=20;var Sse=n.Object({type:n.Literal("cpu",{description:"Normalizes values as CPU usage"})},{$id:"DataNormalizerCpu",title:"CPU"}),Tse=n.Object({type:n.Literal("duration",{description:"Normalizes values as durations using standard time units"}),unit:n.Enum(oje,{description:"Time unit used to present the normalized values"})},{$id:"DataNormalizerDuration",title:"Duration"}),bse=n.Object({type:n.Literal("data",{description:"Normalizes values as data sizes using byte units"}),unit:n.Enum(ije,{description:"Data size unit used to present the normalized values"})},{$id:"DataNormalizerData",title:"Data"}),xse=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"}),Ise=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"}),_se=n.Object({type:n.Literal("date",{description:"Formats values as calendar dates"})},{$id:"DataNormalizerDate",title:"Date"}),Ase=n.Object({type:n.Literal("level",{description:"Displays values using their log level name"})},{$id:"DataNormalizerLevel",title:"Level"}),Ose=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"}),aje=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"}),cje=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:sje})},{$id:"InputDataNormalizerCustom",title:"Custom"}),Eo=Q("type",[Tse,bse,xse,Ise,_se,Ase,Sse,Ose,aje],{title:"Normalizer",description:"Display-value formatter for widget values or list/table columns."}),So=Q("type",[Tse,bse,xse,Ise,_se,Ase,Sse,Ose,cje],{title:"Normalizer",description:"Display-value formatter for widget values or list/table columns."}),SF=n.Object({attribute:n.String({description:"Attribute (log field or database row column) displayed as a column in the list"}),normalizer:n.Optional(Eo)},{title:"WidgetListColumn",description:"List column pairing a displayed attribute with the formatting applied to its values."}),TF=n.Object({attribute:n.String({description:"Attribute (log field or database row column) displayed as a column in the list"}),normalizer:n.Optional(So)},{title:"WidgetListColumn",description:"List column pairing a displayed attribute with the formatting applied to its values."}),sg=["background","no-background"],lje=["table","legend-only","no-legend"];var uje=["greater_than","less_than","equal","not_equal","greater_than_or_equal","less_than_or_equal"],Cse=["alert","warning","success"],Oa=n.Object({operator:n.Enum(uje,{description:"Comparator used to evaluate the metric value"}),value:n.Number({description:"Threshold value used when evaluating the operator"}),color:n.Enum(Cse,{description:"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."}),pje=n.Object({value:n.Number({description:"Y-axis value where the threshold marker is placed"}),level:n.Enum(Cse,{description:"Level applied to the threshold marker"})},{title:"ThresholdMarker",description:"Marker line drawn across the chart at a fixed value, colored by its level."}),mje=["sec","min","hour","day"],gu=n.Object({time:n.Number({description:"Numeric count of `metric` units in each bucket. Required when `timeBucket` is present."}),metric:n.Enum(mje,{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 _a=n.Enum(["flex-start","center","flex-end"],{description:"Flex alignment keyword used for widget layout"}),ag=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."}),cg=n.Object({formula:n.Optional(f({type:"short",description:"Optional alias for formula (only used for display in the UI)"})),queries:n.Optional(n.Record(n.String(),f({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."}),GC={source:Ai,queries:wZ,formula:n.Optional(RO),aliases:n.Optional(ag),visibleSeries:n.Optional(n.Array(n.Boolean(),{description:"Flags indicating whether each query or formula series is visible"}))},BC={source:Ai,queries:sS,formula:n.Optional(zp),aliases:n.Optional(cg),visibleSeries:n.Optional(n.Array(n.Boolean(),{description:"Flags indicating whether each query or formula series is visible"}))},Ca=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)"})),lg={...GC,groupBy:n.Optional(Rf)},ug={...BC,groupBy:n.Optional(kc)},$r=n.Enum(lje,{description:"Controls whether and how the widget displays legend or series details (e.g. table, legend-only, or no legend)"}),Qt=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."})),Wi=n.Optional(n.Array(pje,{description:"Threshold markers displayed on the chart"})),dje="^https?:\\/\\/(?:[^\\s{}]|\\{\\{group\\.[^}\\s]+\\}\\})+$",Rse='Text of the entry added to the widget context menu. Defaults to "Open custom link" when omitted.',Pse="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.",$S=n.Object({label:n.Optional(n.String({description:Rse})),url:n.String({description:Pse})},{$id:"WidgetCustomLink",title:"CustomLink"}),GS=n.Object({label:n.Optional(f({allowEmpty:!1,description:Rse})),url:n.String({pattern:dje,maxLength:Zl,description:Pse})},{$id:"InputWidgetCustomLink",title:"CustomLink"}),fje=n.Object({name:n.String({description:"Display name of the table column"}),...GC,source:Ai,normalizer:n.Optional(Eo),precision:Qt},{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`."}),gje=n.Object({name:f({description:"Display name of the table column"}),...BC,source:Ai,normalizer:n.Optional(So),precision:Qt},{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`."}),hje=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."}),yje=n.Array(n.Object({id:f({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."}),bF=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, or connection list widgets. Users can still change sorting by selecting columns in the rendered list."}),xF=n.Array(n.Object({id:f({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, or connection list widgets. Users can still change sorting by selecting columns in the rendered list."}),wse=["horizontal","vertical"],Eje=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(SF,{description:"Custom columns to display for each log"})),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(bF)},{$id:"GraphVisualizationList",title:"List"}),Sje=n.Object({type:n.Literal("list",{description:"Displays matching logs in a tabular list"}),query:f({type:"tsuga-query",description:"Query that selects logs for the list"}),listColumns:n.Optional(n.Array(TF,{description:"Custom columns to display for each log"})),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(xF)},{$id:"InputGraphVisualizationList",title:"List"}),$C=Q("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"}),pg=n.Object({min:$C,max:$C,scale:Q("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."}),mg=n.Object({min:$C,max:$C,scale:Q("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."}),Tje=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"}),bje=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 xje=["regular","dashed"],dg=n.Record(n.String(),n.Object({groupId:n.String(),lineStyle:n.Enum(xje)}),{description:"Line style of each series, keyed by 1-based query index. The last index is the formula when there is one. For widgets with a single query, only the `1` entry is read and it applies to every series. Defaults to regular."}),Ije=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($r),thresholds:Wi,yAxisSettings:n.Optional(pg),lineStyleOptions:n.Optional(dg)},{$id:"GraphVisualizationTimeseriesConnection",title:"TimeseriesConnection"}),_je=n.Object({type:n.Literal("timeseries-connection",{description:"Displays the database rows-based aggregation as a time series chart"}),connectionId:f({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(f({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:n.Optional($r),thresholds:Wi,yAxisSettings:n.Optional(mg),lineStyleOptions:n.Optional(dg)},{$id:"InputGraphVisualizationTimeseriesConnection",title:"TimeseriesConnection"}),Aje=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(SF,{description:"Custom columns to display for each database row"})),listColumnsSize:n.Optional(n.Record(n.String(),n.Number({description:"List column width by column id"}),{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(bF)},{$id:"GraphVisualizationListConnection",title:"ListConnection"}),Oje=n.Object({type:n.Literal("list-connection",{description:"Displays database rows as a tabular list"}),connectionId:f({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),query:f({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),listColumns:n.Optional(n.Array(TF,{description:"Custom columns to display for each database row"})),listColumnsSize:n.Optional(n.Record(n.String(),n.Number({description:"List column width by column id"}),{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(xF)},{$id:"InputGraphVisualizationListConnection",title:"ListConnection"}),Cje=n.Object({type:n.Literal("top-list-connection",{description:"Displays the database rows-based aggregation as a ranked top list"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),queries:n.Array(n.String({description:"The read-only SQL query to execute against the connection."}))},{$id:"GraphVisualizationTopListConnection",title:"TopListConnection"}),Rje=n.Object({type:n.Literal("top-list-connection",{description:"Displays the database rows-based aggregation as a ranked top list"}),connectionId:f({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(f({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1})},{$id:"InputGraphVisualizationTopListConnection",title:"TopListConnection"}),Pje=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($r)},{$id:"GraphVisualizationPieConnection",title:"PieConnection"}),wje=n.Object({type:n.Literal("pie-connection",{description:"Displays the database rows-based aggregation as a pie chart"}),connectionId:f({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(f({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:n.Optional($r)},{$id:"InputGraphVisualizationPieConnection",title:"PieConnection"}),vje=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($r),thresholds:Wi,yAxisSettings:n.Optional(pg)},{$id:"GraphVisualizationBarConnection",title:"BarConnection"}),Uje=n.Object({type:n.Literal("bar-connection",{description:"Displays the database rows-based aggregation as a bar chart"}),connectionId:f({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(f({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:n.Optional($r),thresholds:Wi,yAxisSettings:n.Optional(mg)},{$id:"InputGraphVisualizationBarConnection",title:"BarConnection"}),Nje=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(sg,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(Oa,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"})),precision:Qt,normalizer:n.Optional(Eo),legendMode:n.Optional($r)},{$id:"GraphVisualizationQueryValueConnection",title:"QueryValueConnection"}),kje=n.Object({type:n.Literal("query-value-connection",{description:"Displays a single value computed by a SQL query against a database connection"}),connectionId:f({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(f({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),backgroundMode:n.Optional(n.Enum(sg,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(Oa,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"})),precision:Qt,normalizer:n.Optional(So),legendMode:n.Optional($r)},{$id:"InputGraphVisualizationQueryValueConnection",title:"QueryValueConnection"}),Lje=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(wse,{description:"Layout used to render log patterns"}))},{$id:"GraphVisualizationListLogPatterns",title:"ListLogPatterns"}),Mje=n.Object({type:n.Literal("list-log-patterns",{description:"Displays log patterns clustered from logs matching the query"}),query:f({type:"tsuga-query",description:"Tsuga query that selects logs to cluster into patterns"}),layout:n.Optional(n.Enum(wse,{description:"Layout used to render log patterns"}))},{$id:"InputGraphVisualizationListLogPatterns",title:"ListLogPatterns"}),Dje=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(SF,{description:"Custom columns to display for each span"})),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(bF)},{$id:"GraphVisualizationListSpans",title:"ListSpans"}),Fje=n.Object({type:n.Literal("list-spans",{description:"Displays matching trace spans in a tabular list"}),query:f({type:"tsuga-query",description:"Query that selects trace spans for the list"}),listColumns:n.Optional(n.Array(TF,{description:"Custom columns to display for each span"})),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(xF)},{$id:"InputGraphVisualizationListSpans",title:"ListSpans"}),BS=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."}),qS=n.Array(f({allowEmpty:!1,type:"long",description:"Raw PromQL expression for this widget."}),{minItems:1,description:"PromQL expressions configured for this widget."}),$je=n.Object({type:n.Literal("timeseries-promql",{description:"Displays PromQL metrics query-based aggregation as a time series chart"}),queries:BS,aliases:n.Optional(ag),timeBucket:n.Optional(gu),normalizer:n.Optional(Eo),precision:Qt,legendMode:n.Optional($r),thresholds:Wi,yAxisSettings:n.Optional(pg),smoothing:n.Optional(n.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"})),lineStyleOptions:n.Optional(dg)},{$id:"GraphVisualizationTimeseriesPromql",title:"TimeseriesPromql"}),Gje=n.Object({type:n.Literal("timeseries-promql",{description:"Displays PromQL metrics query-based aggregation as a time series chart"}),queries:qS,aliases:n.Optional(cg),timeBucket:n.Optional(gu),normalizer:n.Optional(So),precision:Qt,legendMode:n.Optional($r),thresholds:Wi,yAxisSettings:n.Optional(mg),smoothing:n.Optional(n.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"})),lineStyleOptions:n.Optional(dg)},{$id:"InputGraphVisualizationTimeseriesPromql",title:"TimeseriesPromql"}),Bje=n.Object({type:n.Literal("query-value-promql",{description:"Configures a PromQL metrics query-based aggregation as a single value"}),queries:BS,aliases:n.Optional(ag),backgroundMode:n.Optional(n.Enum(sg,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(Oa,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"})),precision:Qt,normalizer:n.Optional(Eo),legendMode:n.Optional($r)},{$id:"GraphVisualizationQueryValuePromql",title:"QueryValuePromql"}),qje=n.Object({type:n.Literal("query-value-promql",{description:"Configures a PromQL metrics query-based aggregation as a single value"}),queries:qS,aliases:n.Optional(cg),backgroundMode:n.Optional(n.Enum(sg,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(Oa,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"})),precision:Qt,normalizer:n.Optional(So),legendMode:n.Optional($r)},{$id:"InputGraphVisualizationQueryValuePromql",title:"QueryValuePromql"}),jje=n.Object({type:n.Literal("top-list-promql",{description:"Displays PromQL metrics query-based aggregation as a ranked top list"}),queries:BS,aliases:n.Optional(ag),normalizer:n.Optional(Eo),precision:Qt,conditions:n.Optional(n.Array(Oa,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"}))},{$id:"GraphVisualizationTopListPromql",title:"TopListPromql"}),Hje=n.Object({type:n.Literal("top-list-promql",{description:"Displays PromQL metrics query-based aggregation as a ranked top list"}),queries:qS,aliases:n.Optional(cg),normalizer:n.Optional(So),precision:Qt,conditions:n.Optional(n.Array(Oa,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"}))},{$id:"InputGraphVisualizationTopListPromql",title:"TopListPromql"}),Kje=n.Object({type:n.Literal("pie-promql",{description:"Displays PromQL metrics query-based aggregation as a pie chart"}),queries:BS,aliases:n.Optional(ag),normalizer:n.Optional(Eo),precision:Qt,legendMode:n.Optional($r)},{$id:"GraphVisualizationPiePromql",title:"PiePromql"}),zje=n.Object({type:n.Literal("pie-promql",{description:"Displays PromQL metrics query-based aggregation as a pie chart"}),queries:qS,aliases:n.Optional(cg),normalizer:n.Optional(So),precision:Qt,legendMode:n.Optional($r)},{$id:"InputGraphVisualizationPiePromql",title:"PiePromql"}),Yje=n.Object({type:n.Literal("bar-promql",{description:"Displays PromQL metrics query-based aggregation as a bar chart"}),queries:BS,aliases:n.Optional(ag),timeBucket:n.Optional(gu),precision:Qt,normalizer:n.Optional(Eo),thresholds:Wi,legendMode:n.Optional($r),yAxisSettings:n.Optional(pg)},{$id:"GraphVisualizationBarPromql",title:"BarPromql"}),Vje=n.Object({type:n.Literal("bar-promql",{description:"Displays PromQL metrics query-based aggregation as a bar chart"}),queries:qS,aliases:n.Optional(cg),timeBucket:n.Optional(gu),precision:Qt,normalizer:n.Optional(So),thresholds:Wi,legendMode:n.Optional($r),yAxisSettings:n.Optional(mg)},{$id:"InputGraphVisualizationBarPromql",title:"BarPromql"}),Qje=n.Object({type:n.Literal("timeseries",{description:"Displays the aggregation as a time series chart"}),...lg,groupByMode:Ca,timeBucket:n.Optional(gu),normalizer:n.Optional(Eo),precision:Qt,legendMode:n.Optional($r),thresholds:Wi,yAxisSettings:n.Optional(pg),smoothing:n.Optional(n.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"})),lineStyleOptions:n.Optional(dg),customLink:n.Optional($S)},{$id:"GraphVisualizationTimeseries",title:"Timeseries"}),Wje=n.Object({type:n.Literal("timeseries",{description:"Displays the aggregation as a time series chart"}),...ug,groupByMode:Ca,timeBucket:n.Optional(gu),normalizer:n.Optional(So),precision:Qt,legendMode:n.Optional($r),thresholds:Wi,yAxisSettings:n.Optional(mg),smoothing:n.Optional(n.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"})),lineStyleOptions:n.Optional(dg),customLink:n.Optional(GS)},{$id:"InputGraphVisualizationTimeseries",title:"Timeseries"}),vse="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.",Jje=n.Object({type:n.Literal("top-list",{description:"Displays the aggregation as a ranked list of top results"}),...lg,groupByMode:Ca,normalizer:n.Optional(Eo),precision:Qt,conditions:n.Optional(n.Array(Oa,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"})),isStacked:n.Optional(n.Boolean({description:vse})),customLink:n.Optional($S)},{$id:"GraphVisualizationTopList",title:"TopList"}),Zje=n.Object({type:n.Literal("top-list",{description:"Displays the aggregation as a ranked list of top results"}),...ug,groupByMode:Ca,normalizer:n.Optional(So),precision:Qt,conditions:n.Optional(n.Array(Oa,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"})),isStacked:n.Optional(n.Boolean({description:vse})),customLink:n.Optional(GS)},{$id:"InputGraphVisualizationTopList",title:"TopList"}),Xje=n.Object({type:n.Literal("pie",{description:"Displays the aggregation as a pie chart"}),...lg,groupByMode:Ca,normalizer:n.Optional(Eo),precision:Qt,legendMode:n.Optional($r),customLink:n.Optional($S)},{$id:"GraphVisualizationPie",title:"Pie"}),e2e=n.Object({type:n.Literal("pie",{description:"Displays the aggregation as a pie chart"}),...ug,groupByMode:Ca,normalizer:n.Optional(So),precision:Qt,legendMode:n.Optional($r),customLink:n.Optional(GS)},{$id:"InputGraphVisualizationPie",title:"Pie"}),t2e=n.Object({type:n.Literal("query-value",{description:"Displays the aggregation as a single value"}),...GC,backgroundMode:n.Optional(n.Enum(sg,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(Oa,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"})),precision:Qt,normalizer:n.Optional(Eo),legendMode:n.Optional($r)},{$id:"GraphVisualizationQueryValue",title:"QueryValue"}),r2e=n.Object({type:n.Literal("query-value",{description:"Displays the aggregation as a single value"}),...BC,backgroundMode:n.Optional(n.Enum(sg,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(Oa,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"})),precision:Qt,normalizer:n.Optional(So),legendMode:n.Optional($r)},{$id:"InputGraphVisualizationQueryValue",title:"QueryValue"}),n2e=n.Object({type:n.Literal("bar",{description:"Displays the aggregation as a bar chart"}),...lg,groupByMode:Ca,timeBucket:n.Optional(gu),precision:Qt,normalizer:n.Optional(Eo),thresholds:Wi,legendMode:n.Optional($r),yAxisSettings:n.Optional(pg),customLink:n.Optional($S)},{$id:"GraphVisualizationBar",title:"Bar"}),o2e=n.Object({type:n.Literal("bar",{description:"Displays the aggregation as a bar chart"}),...ug,groupByMode:Ca,timeBucket:n.Optional(gu),precision:Qt,normalizer:n.Optional(So),thresholds:Wi,legendMode:n.Optional($r),yAxisSettings:n.Optional(mg),customLink:n.Optional(GS)},{$id:"InputGraphVisualizationBar",title:"Bar"}),Use='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.',Nse=n.String({description:Use}),kse=f({description:Use}),i2e=n.Object({type:n.Literal("distribution",{description:"Displays the aggregation as a distribution chart"}),...lg,group:n.Optional(Nse),precision:Qt,normalizer:n.Optional(Eo),percentileMarkers:n.Optional(Tje),boundsScale:n.Optional(CO)},{$id:"GraphVisualizationDistribution",title:"Distribution"}),s2e=n.Object({type:n.Literal("distribution",{description:"Displays the aggregation as a distribution chart"}),...ug,group:n.Optional(kse),precision:Qt,normalizer:n.Optional(So),percentileMarkers:n.Optional(bje),boundsScale:n.Optional(CO)},{$id:"InputGraphVisualizationDistribution",title:"Distribution"}),Lse=["red","pink","violet","blue","cyan","green","yellow","orange"],Mse=n.Enum(Lse,{description:"Color palette used to render the heatmap intensity gradient"}),a2e=n.Object({type:n.Literal("heatmap",{description:"Displays the aggregation as a heatmap chart"}),...lg,group:n.Optional(Nse),precision:Qt,normalizer:n.Optional(Eo),palette:n.Optional(Mse)},{$id:"GraphVisualizationHeatmap",title:"Heatmap"}),c2e=n.Object({type:n.Literal("heatmap",{description:"Displays the aggregation as a heatmap chart"}),...ug,group:n.Optional(kse),precision:Qt,normalizer:n.Optional(So),palette:n.Optional(Mse)},{$id:"InputGraphVisualizationHeatmap",title:"Heatmap"}),Dse=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(Lse,{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."}),l2e=n.Object({type:n.Literal("gauge",{description:"Displays the aggregation as a gauge"}),...GC,max:n.Optional(n.Number({description:"Gauge maximum value, on the raw query value before the unit is applied"})),colorThresholds:n.Optional(n.Array(Dse,{description:"Color thresholds inside the gauge range, on the raw query value before the unit is applied"})),precision:Qt,normalizer:n.Optional(Eo)},{$id:"GraphVisualizationGauge",title:"Gauge"}),u2e=n.Object({type:n.Literal("gauge",{description:"Displays the aggregation as a gauge"}),...BC,max:n.Optional(n.Number({description:"Gauge maximum value, on the raw query value before the unit is applied"})),colorThresholds:n.Optional(n.Array(Dse,{description:"Color thresholds inside the gauge range, on the raw query value before the unit is applied"})),precision:Qt,normalizer:n.Optional(So)},{$id:"InputGraphVisualizationGauge",title:"Gauge"}),p2e=n.Object({type:n.Literal("table",{description:"Displays the aggregation as a table with multi-level grouping"}),columns:n.Array(fje,{description:"Each column defines an independent aggregation displayed as a table column"}),groupBy:n.Optional(Rf),groupByMode:Ca,defaultSorting:n.Optional(hje),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($S)},{$id:"GraphVisualizationTable",title:"Table"}),m2e=n.Object({type:n.Literal("table",{description:"Displays the aggregation as a table with multi-level grouping"}),columns:n.Array(gje,{minItems:1,description:"Each column defines an independent aggregation displayed as a table column"}),groupBy:n.Optional(kc),groupByMode:Ca,defaultSorting:n.Optional(yje),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(GS)},{$id:"InputGraphVisualizationTable",title:"Table"}),d2e=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(Ese,{description:"Background color used to render the note"})),noteAlign:n.Optional(_a),noteJustifyContent:n.Optional(_a)},{$id:"GraphVisualizationNote",title:"Note"}),f2e=n.Object({type:n.Literal("note",{description:"Displays static text on the dashboard"}),note:n.Optional(f({type:"long",description:"Markdown-compatible text shown in the note"})),noteColor:n.Optional(n.Enum(Ese,{description:"Background color used to render the note"})),noteAlign:n.Optional(_a),noteJustifyContent:n.Optional(_a)},{$id:"InputGraphVisualizationNote",title:"Note"}),g2e=n.Object({type:n.Literal("slo-uptime",{description:"Displays the SLI percentage of an SLO computed over the dashboard time range, colored against the SLO target. Experimental."}),sloId:n.String({description:"Id of the SLO to display"})},{$id:"GraphVisualizationSloUptime",title:"SloUptime"}),h2e=n.Object({type:n.Literal("slo-uptime",{description:"Displays the SLI percentage of an SLO computed over the dashboard time range, colored against the SLO target. Experimental."}),sloId:f({allowEmpty:!1,description:"Id of the SLO to display"})},{$id:"InputGraphVisualizationSloUptime",title:"SloUptime"}),y2e=n.Object({type:n.Literal("slo-over-time",{description:"Displays the good and bad events, or the per-slice status, of an SLO over the dashboard time range. Experimental."}),sloId:n.String({description:"Id of the SLO to display"})},{$id:"GraphVisualizationSloOverTime",title:"SloOverTime"}),E2e=n.Object({type:n.Literal("slo-over-time",{description:"Displays the good and bad events, or the per-slice status, of an SLO over the dashboard time range. Experimental."}),sloId:f({allowEmpty:!1,description:"Id of the SLO to display"})},{$id:"InputGraphVisualizationSloOverTime",title:"SloOverTime"}),S2e=Q("type",[Ije,Aje,Cje,Pje,vje,Nje,$je,Bje,jje,Kje,Yje,Qje,Jje,Xje,t2e,l2e,n2e,i2e,a2e,p2e,Eje,d2e,Lje,Dje,g2e,y2e],{description:"Widget visualization configuration. The `type` discriminator selects the widget kind and its required fields."}),Fse=Q("type",[_je,Oje,Rje,wje,Uje,kje,Gje,qje,Hje,zje,Vje,Wje,Zje,e2e,r2e,u2e,o2e,s2e,c2e,m2e,Sje,f2e,Mje,Fje,h2e,E2e],{description:"Widget visualization configuration. The `type` discriminator selects the widget kind and its required fields."}),IF=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 ${JZ}\xD7${ZZ} (width\xD7height) grid units, except note widgets which can go down to 1\xD71.`}),qC=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(_a),descriptionJustifyContent:n.Optional(_a),visualization:S2e,layout:n.Optional(IF)},{title:"Graph",description:"Single dashboard widget, combining its identity, its visualization configuration, and its position on the dashboard grid."}),T2e=n.Object({id:f({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(f({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(_a),descriptionJustifyContent:n.Optional(_a),visualization:Fse,layout:n.Optional(IF)},{title:"Graph",description:"Single dashboard widget, combining its identity, its visualization configuration, and its position on the dashboard grid."}),_F=n.Object({name:Ut(f(),{description:"Display name of the graph widget. Pass null to remove it."}),description:Ut(n.String({minLength:1,maxLength:800}),{description:"Text shown with the graph widget. Pass null to remove it."}),descriptionAlign:Ut(_a,{description:"Vertical alignment of the description. Pass null to remove it."}),descriptionJustifyContent:Ut(_a,{description:"Horizontal alignment of the description. Pass null to remove it."}),visualization:n.Optional(Fse),layout:Ut(IF,{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."}),yse=10,b2e=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."}),x2e=n.Array(n.Object({key:f({description:"Dashboard-wide filter key, usually a telemetry attribute name."}),values:n.Array(f({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:yse,description:`Dashboard-wide filters applied to every widget on the dashboard. Up to ${yse} filters are allowed.`}),fg=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(qC,{description:"Ordered widgets that compose the dashboard"}),filters:n.Optional(b2e),createdAt:H({description:"Timestamp when Tsuga created the dashboard."}),updatedAt:H({description:"Timestamp when Tsuga last updated the dashboard."}),creator:n.Optional(Qe),updater:n.Optional(Qe),tags:br,timePreset:n.Optional(n.Enum(kL,{description:"Relative time preset used 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."}))}),jC=n.Object({name:f({description:"Display name of the dashboard."}),owner:f({allowEmpty:!1,description:"ID of the team that owns the dashboard. Required and used for dashboard access control."}),graphs:n.Array(T2e,{description:"Ordered widgets that compose the dashboard"}),filters:n.Optional(x2e),tags:wr,timePreset:n.Optional(n.Enum(kL,{description:"Relative time preset used when opening the dashboard. Optional; create defaults to `past-30-minutes` when omitted, and update omission preserves the current value."})),folderId:n.Optional(n.Union([n.Null(),f({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."}))}),ws={IS_FAVORITE:"isFavorite",OWNER:"owner",TAGS:"tags",WIDGET_COUNT:"widgetCount",UPDATED_AT:"updatedAt",NAME:"name"},$se=[ws.OWNER,ws.TAGS,ws.WIDGET_COUNT,ws.UPDATED_AT,ws.NAME],gm=n.Partial(n.Object({owners:qe(f({allowEmpty:!1}),{description:"Restrict results to dashboards owned by any of these team IDs",maxItems:50}),searchQuery:n.Object({value:f({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:qe(Fn.items,{description:"Restrict results to dashboards that have at least one of the listed key/value tags",maxItems:50}),folderId:n.Union([n.Null(),f({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"})),I2e=n.Partial(n.Object({...je,filters:gm,sort:n.Object({by:n.Enum([ws.IS_FAVORITE,ws.OWNER,ws.TAGS,ws.WIDGET_COUNT,ws.UPDATED_AT,ws.NAME],{description:"Field to sort the returned dashboards by"}),direction:Le},{description:"Optional sorting applied to the returned dashboards"})})),Fmr=x({tags:["dashboards"],url:`${Aa}/query`,method:"POST",paginated:!0,response:n.Array(fg),body:I2e}),$mr=x({tags:["dashboards"],url:`${Aa}/tags/query`,method:"POST",body:n.Object({filters:n.Optional(n.Omit(gm,["tags"]))}),response:Dn}),Gmr=x({tags:["dashboards"],url:`${Aa}/counts/query`,method:"POST",body:n.Object({filters:n.Optional(n.Partial(gm))}),response:n.Object({all:n.Integer({description:"Total number of dashboards matching the filters that the user can read."})})}),Bmr=x({tags:["dashboards"],url:`${Aa}/:id`,method:"GET",params:n.Object({id:f()}),response:fg}),qmr=x({tags:["dashboards"],url:Aa,method:"POST",body:jC,response:fg}),jmr=x({tags:["dashboards"],url:`${Aa}/:id`,method:"PATCH",params:n.Object({id:f()}),body:n.Partial(jC),response:fg}),_2e=_i(gm,{maxIds:100}),Hmr=x({tags:["dashboards"],url:`${Aa}/bulk-update`,method:"PUT",body:n.Object({selection:_2e,owner:n.Optional(f({allowEmpty:!1,description:"Owning team ID to apply to every dashboard. Optional when folderId is provided; omit to keep the current owner."})),folderId:Ut(f({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({})}),Kmr=x({tags:["dashboards"],url:`${Aa}/:id`,method:"DELETE",params:n.Object({id:f()}),response:ae}),A2e=x({tags:["dashboards"],url:`${Aa}/:id/graphs/:graphId`,method:"PATCH",params:n.Object({id:f({allowEmpty:!1}),graphId:f({allowEmpty:!1})}),body:_F,response:qC}),zmr=V7(A2e),O2e=_i(gm),Ymr=x({tags:["dashboards"],url:`${Aa}/bulk-delete`,method:"DELETE",body:n.Object({selection:O2e}),response:n.Object({})});var gg=`/${"v1"}/dashboards`,jS=n.Pick(fg,["id","name","owner","graphs","filters","tags","timePreset","folderId"],{$id:"Dashboard",description:"Saved visualization made of dashboard-wide filters and ordered graphs. Use dashboards to preserve reusable views for a team or workflow. See [Dashboards](/documentation/visualize/dashboards/index)."}),C2e={id:"123-456-abc",name:"API Performance Overview",owner:"team-123-abc",graphs:[{id:"789-abc-def",name:"Request Latency P99",visualization:{type:"timeseries",source:"metrics",queries:[{aggregate:{type:"percentile",field:"duration",percentile:99},filter:"service:api-gateway"}]},layout:{x:0,y:0,w:6,h:4}}],filters:[{key:"env",values:["production"]}],tags:[{key:"team",value:"platform"}],timePreset:"past-1-hour"};Object.assign(jS,{examples:[C2e]});var R2e=n.Object({by:n.Enum([...$se],{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:Le},{description:"Optional sorting applied to the returned dashboards"}),Gse=n.Object({...er,filters:n.Optional(n.Pick(gm,["owners","searchQuery","tags","folderId"])),sort:n.Optional(R2e)},{description:"Dashboard query request. Use filters, sorting, limit, and offset to page through visible dashboards."}),P2e={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(Gse,{examples:[P2e]});var Bse=x({description:"Queries dashboards visible to the authenticated operation key. Use this endpoint to build dashboard inventories or synchronize dashboard metadata. Pagination fields limit the returned page; use the response metadata to request additional pages. See [Dashboards](/documentation/visualize/dashboards/index).",operationId:"queryDashboards",tags:["dashboards"],url:`${gg}/query`,method:"POST",paginated:!0,body:Gse,response:n.Array(jS)}),qse=x({description:"Retrieves one dashboard by ID.",operationId:"getDashboard",tags:["dashboards"],url:`${gg}/:id`,method:"GET",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the saved dashboard to retrieve. Use the `id` returned by dashboard query, create, or update responses."})}),response:jS}),AF=n.Pick(jC,["name","owner","graphs","filters","tags","timePreset","folderId"],{description:"Dashboard create or update request. Provide the dashboard identity, owner team, widgets, filters, tags, and optional time preset."}),jse={name:"API Performance Overview",owner:"team-123-abc",graphs:[{id:"789-abc-def",name:"Request Latency P99",visualization:{type:"timeseries",source:"metrics",queries:[{aggregate:{type:"percentile",field:"duration",percentile:99},filter:"service:api-gateway"}]},layout:{x:0,y:0,w:6,h:4}}],filters:[{key:"env",values:["production"]}],tags:[{key:"team",value:"platform"}],timePreset:"past-1-hour",folderId:null};Object.assign(AF,{examples:[jse]});var Hse=n.Object(_F.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."}),w2e={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(Hse,{examples:[w2e]});var Kse=x({description:"Creates a dashboard owned by the specified team. Use this to provision dashboards from automation or templates. The response returns the saved dashboard definition.",operationId:"createDashboard",tags:["dashboards"],url:gg,method:"POST",body:AF,response:jS}),zse=x({description:"Updates an existing dashboard by ID. Fields are patched from the request body; omitted fields keep their current values.",operationId:"updateDashboard",tags:["dashboards"],url:`${gg}/:id`,method:"PUT",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the saved dashboard to update. Use the `id` returned by dashboard query, get, or create responses."})}),body:n.Partial(AF,{examples:[jse]}),response:jS}),v2e=n.Object({id:f({allowEmpty:!1,description:"Identifier of the saved dashboard to delete. Use the `id` returned by dashboard query, get, create, or update responses."})}),Yse=x({description:"Deletes a dashboard by ID. Use only after confirming no users or automation still rely on the dashboard.",operationId:"deleteDashboard",tags:["dashboards"],url:`${gg}/:id`,method:"DELETE",params:v2e,response:ae}),tdr=x({description:"Updates one graph inside a dashboard without replacing the full dashboard. Use this for targeted widget edits when you already know the dashboard ID and graph ID. Fields are patched from the request body; omitted fields keep their current values and null clears them.",operationId:"updateDashboardGraph",tags:["dashboards"],url:`${gg}/:id/graphs/:graphId`,method:"PUT",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the dashboard that contains the graph to update. Use the `id` returned by dashboard responses."}),graphId:f({allowEmpty:!1,description:"Identifier of the graph to update within the dashboard. Use graph IDs from the dashboard response."})}),body:Hse,response:qC});var Vse=_t({commandName:"dashboards",description:"Manage dashboards",endpoints:{list:Bse,get:qse,create:Kse,update:zse,delete:Yse},enableListBody:!0});var Qse=100,HS=3,hg=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:Dn,teamOverrideFields:n.Optional(n.Array(n.String(),{description:"Telemetry attribute names used to override ownership for data sent with this key."})),updatedAt:H({description:"Timestamp when Tsuga last updated the key metadata."}),createdAt:H({description:"Timestamp when Tsuga created the key."}),creator:n.Optional(Qe),updater:n.Optional(Qe),assetUpdatedAt:H({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})}),KS=n.Object({name:n.String({format:Jl,minLength:1,maxLength:Qse,description:`Kebab-case name for the ingestion API key. Maximum length is ${Qse} characters.`}),owner:f({allowEmpty:!1,description:"Team ID that will own and manage the ingestion API key."}),tags:Fn,teamOverrideFields:n.Union([n.Array(f({allowEmpty:!1}),{minItems:1,maxItems:HS,description:`Array form. Up to ${HS} fields are allowed.`}),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."})}),yg="/v0/ingestion-api-keys",ddr=x({tags:["ingestion-api-keys"],url:yg,method:"POST",body:KS,response:n.Intersect([hg,n.Object({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."})})])}),fdr=x({tags:["ingestion-api-keys"],url:yg,method:"GET",paginated:!0,query:n.Object(je),response:n.Array(hg)}),gdr=x({tags:["ingestion-api-keys"],url:`${yg}/:id`,method:"GET",params:n.Object({id:f({allowEmpty:!1})}),response:hg}),hdr=x({tags:["ingestion-api-keys"],url:`${yg}/:id`,method:"PUT",params:n.Object({id:f({allowEmpty:!1})}),body:KS,response:hg}),ydr=x({tags:["ingestion-api-keys"],url:`${yg}/:id`,method:"DELETE",params:n.Object({id:f({allowEmpty:!1})}),response:ae}),Edr=x({tags:["ingestion-api-keys"],url:`${yg}/bulk-delete`,method:"DELETE",body:n.Object({ids:n.Array(f({allowEmpty:!1}),{uniqueItems:!0})}),response:n.Object({})});var zS=`/${"v1"}/ingestion-api-keys`,YS=n.Pick(hg,["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)."}),Wse={id:"123-456-abc",name:"production-logs-ingestion",keyLastCharacters:"x7Qm",owner:"team-123-abc",tags:[{key:"env",value:"production"}],teamOverrideFields:["service"]};Object.assign(YS,{examples:[Wse]});var Jse=n.Pick(KS,["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."}),Zse=n.Pick(KS,["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."}),Xse={name:"production-logs-ingestion",owner:"team-123-abc",tags:[{key:"env",value:"production"}],teamOverrideFields:["service"]};Object.assign(Jse,{examples:[Xse]});Object.assign(Zse,{examples:[Xse]});var U2e={...Wse,key:"tsuga_in:v1:abc123xyx7Qm"},eae=x({description:"Lists ingestion API keys visible to the authenticated operation key. Use this to inventory telemetry intake keys, owners, tags, and team override fields. Pagination fields limit the returned page.",operationId:"listIngestionApiKeys",tags:["ingestion-api-keys"],url:zS,method:"GET",paginated:!0,query:n.Object(er),response:n.Array(YS)}),Odr=x({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:`${zS}/:id`,method:"GET",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the ingestion API key to retrieve. Use the `id` returned by ingestion API key list or create responses."})}),response:YS}),N2e=n.Intersect([n.Pick(YS,["id","name","keyLastCharacters","owner","tags","teamOverrideFields"]),n.Object({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:U2e}),tae=x({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:zS,method:"POST",body:Jse,response:N2e}),rae=x({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:`${zS}/:id`,method:"PUT",params:n.Object({id:f({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:Zse,response:YS}),nae=x({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:`${zS}/:id`,method:"DELETE",params:n.Object({id:f({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:ae});var oae=_t({commandName:"ingestion-api-keys",description:"Manage ingestion API keys",singularOverride:"ingestion API key",pluralOverride:"ingestion API keys",endpoints:{list:eae,create:tae,update:rae,delete:nae}});var VS="/v0/investigations",k2e=["dashboard","monitor","service","slo","log-route","adaptive-notification-rule"],L2e=n.Object({type:n.String({description:'Kind of linked asset, e.g. "dashboard"'}),id:n.String({description:"Identifier of the linked asset"})}),M2e=n.Object({type:n.Enum(k2e,{description:"Kind of linked asset"}),id:f({allowEmpty:!1,description:"Identifier of the linked asset"})}),jc=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:br,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(L2e,{description:"Assets (dashboards, monitors, \u2026) referenced by this investigation"}),creator:n.Optional(Qe),updater:n.Optional(Qe),createdAt:H({description:"Timestamp the investigation was created at."}),updatedAt:H({description:"Timestamp the investigation was last updated at."})},{title:"Investigation"}),QS=n.Object({name:f({allowEmpty:!1,description:"Human readable name shown for the investigation"}),slug:f({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:Ut(f({type:"long"}),{description:"Markdown content capturing the investigation notes and findings"}),tags:wr,owner:f({allowEmpty:!1,description:"Team ID owning the investigation"}),env:Ut(f({allowEmpty:!0}),{description:"Environment the investigation relates to"}),linkedAssets:n.Optional(n.Array(M2e,{maxItems:100,description:"Assets (dashboards, monitors, \u2026) referenced by this investigation"}))}),D2e={name:"Payments 5xx spike",slug:"incident-2024-06-payments-5xx",contentMd:`## Summary
|
|
254
|
+
...`};Object.assign(Ane,{examples:[gGe]});var One=n.Object(ND,{$id:"DocSearchResult",description:"A documentation page or API-reference endpoint search result"}),hGe={kind:"doc",path:"data-collection/guides/how-to-add-resource-attributes",title:"How to Add Resource Attributes",subsection:"Set resource attributes by language",tab:"Python",anchor:"set-resource-attributes-by-language",score:.9,excerpt:"...Python SDK setup should use the default resource detectors...",link:"https://www.app.tsuga.com/documentation/data-collection/guides/how-to-add-resource-attributes?tab=Python#set-resource-attributes-by-language"};Object.assign(One,{examples:[hGe]});var Cne=x({description:"Retrieve the raw markdown content of a documentation or API-reference page by its path. Documentation pages use slug paths (e.g. `getting-started/send-your-first-logs`); API-reference pages use `api/<operationId>` (e.g. `api/aggregateScalar`).",operationId:"getDocPage",tags:["public","docs"],url:_ne,method:"GET",query:n.Object({path:f({allowEmpty:!1,description:"Documentation path to fetch. Use page slug paths for docs or `api/<operationId>` for API-reference pages."})},{description:"Documentation page lookup query."}),response:Ane}),Rne=x({description:"Searches public documentation pages and API-reference endpoints. Use this to build help search or route users to Tsuga docs and API reference results. Results are ranked by relevance; an empty array means no page or endpoint matched the query.",operationId:"searchDocs",tags:["public","docs"],url:`${_ne}/search`,method:"GET",query:n.Object({query:f({allowEmpty:!1,description:"Search text to match against documentation and API-reference content."})},{description:"Documentation search query."}),response:n.Array(One)});var Pne=G("get",{path:on("DOC_PATH").pipe(sn("Path of the page to fetch"))},D("cli.docs.get")(function*({path:e}){yield*Oe(yield*ye(Cne,{query:{path:e}}))})).pipe(B("Get a documentation or API-reference page by path (e.g. 'getting-started/send-your-first-logs' or 'api/aggregateScalar')"));var wne=G("search",{query:on("SEARCH_TEXT").pipe(sn("Text to search for"))},D("cli.docs.search")(function*({query:e}){yield*Oe(yield*ye(Rne,{query:{query:e}}))})).pipe(B("Search Tsuga documentation and the full API reference, ranked by relevance"));var vne=G("docs").pipe(B("Search and fetch Tsuga documentation and API-reference pages"),De([Pne,wne]));var CS="/v0/sandbox-runs",yGe=["running","completed","failed","cancelled"],EGe=n.Enum(yGe,{description:"Lifecycle status of the sandbox agent run"}),SGe="^[A-Za-z0-9][A-Za-z0-9._-]*\\.md$",TGe=50,bGe=25e3,xGe=1e5,Une=`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 ${xGe} characters in total. Runs rewrite them, so review them like any agent output.`,kD=n.Record(n.String(),n.String(),{description:Une}),LD=n.Record(n.String({pattern:SGe}),n.String({maxLength:bGe}),{additionalProperties:!1,minProperties:1,maxProperties:TGe,description:Une,examples:[{"MEMORY.md":"- [Topic](topic.md) - one-line summary"}]}),Nne=30,IGe=Q("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."}),kne=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."}),Lne=200,RS=n.Object({id:n.String({description:"Tsuga-generated sandbox run ID."}),status:EGe,trigger:IGe,clusterId:n.String({description:"Cluster the agent queried."}),error:n.Optional(n.String({description:"Why the run failed or stopped."})),usage:n.Optional(kne),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(Qe),createdAt:H({description:"When the run started."}),completedAt:n.Optional(H({description:"When the run finished."}))}),Zor=x({tags:["sandbox-runs"],url:CS,method:"GET",response:n.Array(RS)}),Xor=x({tags:["sandbox-runs"],url:`${CS}/:id`,method:"GET",params:n.Object({id:f()}),response:RS}),eir=x({tags:["sandbox-runs"],url:`${CS}/validate`,method:"POST",body:n.Object({runId:f({allowEmpty:!1,description:"Active sandbox run whose ID identifies the container."}),clusterId:f({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."})})}),tir=x({tags:["sandbox-runs"],url:`${CS}/:id/cancel`,method:"POST",params:n.Object({id:f()}),response:n.Object({})}),rir=x({tags:["sandbox-runs"],url:`${CS}/:id/complete`,method:"POST",params:n.Object({id:f({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(kne),memory:n.Optional(LD)}),response:n.Object({})});var du="/v0/sandbox-configurations",_Ge=100,AGe=60,Mne="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.",Dne=`Maximum minutes the sandbox agent may run before it is stopped. Defaults to ${Nne} when unset.`,zf=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:Mne}),scope:As,permissions:cm,systemPrompt:n.Optional(n.String({description:"Extra system prompt prepended to the sandbox agent run for this configuration."})),timeoutMinutes:n.Optional(n.Integer({description:Dne})),memory:n.Optional(kD),creator:n.Optional(Qe),updater:n.Optional(Qe),createdAt:H(),updatedAt:H()}),Fne=n.Object({name:n.String({minLength:1,maxLength:_Ge,description:"Human-readable name of the sandbox configuration."}),owner:f({allowEmpty:!1,description:"ID of the team that owns this sandbox configuration."}),repositories:n.Array(f({allowEmpty:!1}),{default:[],description:Mne}),scope:As,permissions:cm,systemPrompt:n.Optional(f({type:"long",description:"Extra system prompt prepended to the sandbox agent run for this configuration."})),timeoutMinutes:n.Optional(n.Integer({minimum:1,maximum:AGe,description:Dne}))}),mir=x({tags:["sandbox-configurations"],url:du,method:"GET",response:n.Array(zf)}),dir=x({tags:["sandbox-configurations"],url:`${du}/:id`,method:"GET",params:n.Object({id:f()}),response:zf}),fir=x({tags:["sandbox-configurations"],url:du,method:"POST",body:Fne,response:zf}),gir=x({tags:["sandbox-configurations"],url:`${du}/:id`,method:"PUT",params:n.Object({id:f()}),body:Fne,response:zf}),hir=x({tags:["sandbox-configurations"],url:`${du}/:id`,method:"DELETE",params:n.Object({id:f()}),response:ae}),PS=n.Object({memory:n.Optional(kD)}),MD=n.Object({memory:LD}),yir=x({tags:["sandbox-configurations"],url:`${du}/:id/memory`,method:"GET",params:n.Object({id:f()}),response:PS}),Eir=x({tags:["sandbox-configurations"],url:`${du}/:id/memory`,method:"PUT",params:n.Object({id:f()}),body:MD,response:zf}),Sir=x({tags:["sandbox-configurations"],url:`${du}/:id/memory`,method:"DELETE",params:n.Object({id:f()}),response:zf});var $ne=`/${"v1"}/sandbox-runs`,DD=`/${"v1"}/sandbox-configurations/:id/memory`,Gne="Admin users see every run; other users and operation API keys see only the runs their user started.",FD=n.Object({id:f({allowEmpty:!1,description:"ID of the sandbox configuration."})}),Bne=x({description:`Lists the latest ${Lne} sandbox agent runs, newest first, without their prompt and output. ${Gne}`,tags:["private"],url:$ne,method:"GET",response:n.Array(RS)}),qne=x({description:`Gets a sandbox agent run with its prompt and output. ${Gne}`,tags:["private"],url:`${$ne}/:id`,method:"GET",params:n.Object({id:f({allowEmpty:!1,description:"ID of the sandbox run."})}),response:RS}),jne=x({description:"Gets the memory sandbox agent runs keep for a sandbox configuration.",tags:["private"],url:DD,method:"GET",params:FD,response:PS}),$D=x({description:"Replaces the memory of a sandbox configuration.",tags:["private"],url:DD,method:"PUT",params:FD,body:MD,response:PS}),Hne=x({description:"Clears the memory of a sandbox configuration.",tags:["private"],url:DD,method:"DELETE",params:FD,response:PS});var Yf=on("CONFIGURATION_ID").pipe(sn("The sandbox configuration ID"));var Kne=G("clear",{id:Yf},D("cli.sandbox-memory.clear")(function*({id:e}){yield*Oe(yield*ye(Hne,{params:{id:e}}))})).pipe(B("Clear the memory of a sandbox configuration"));var zne=G("get",{id:Yf},D("cli.sandbox-memory.get")(function*({id:e}){yield*Oe(yield*ye(jne,{params:{id:e}}))})).pipe(B("Get the memory of a sandbox configuration"));var Yne=G("set",{id:Yf,file:jf,data:im,generateSkeleton:sm},D("cli.sandbox-memory.set")(function*(e){if(e.generateSkeleton){yield*Oe(yield*om($D));return}yield*Oe(yield*ye($D,{params:{id:e.id},body:yield*Qp(e)}))})).pipe(B("Replace the memory of a sandbox configuration"));var Vne=G("sandbox-memory").pipe(B("Read and edit the memory that sandbox agent runs keep per configuration"),De([zne,Yne,Kne]));function OGe(e,t,r){let o;if(n.IsString(t))o=st(e);else if(n.IsBoolean(t))o=Vo(e);else if(n.IsEnum(t))o=k_(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=st(e).pipe(Fe("VALUE,..."),Dl(s=>s.split(",").map(a=>{let c=a.trim();return i&&c!==""?Number(c):c}))),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=st(e).pipe(Dl(i=>i==="null"?null:i)),r+=" Use null to select resources without a folder."):(o=st(e).pipe(Fe("JSON"),J3(i=>JSON.parse(i),()=>`--${e} must be valid JSON`)),r+=n.IsArray(t)?" Pass a JSON array.":" Pass JSON.");return o.pipe(he(r),Rt)}function Qne(e){let t={};function r(o,i,s,a){if(n.IsObject(o)){for(let[c,l]of Object.entries(o.properties)){if(i.length===0&&["limit","offset","clusterId"].includes(c))continue;let m=c.replace(/([A-Z])/g,"-$1").toLowerCase(),y=c==="filters"||c==="value"||c==="values"?s:c==="exclude"?`exclude-${s}`:s?`${s}-${m}`:m,T="description"in l&&typeof l.description=="string"?l.description:"";r(l,[...i,c],y,c==="value"||c==="values"?`${a} ${T}`.trim():T||a)}return}t[s]={path:i,flag:OGe(s,o,a)}}return e&&r(e,[],"",""),{flags:Object.fromEntries(Object.entries(t).map(([o,{flag:i}])=>[o,i])),apply:D("cli.resource.listFlags")(function*(o,i={},s={}){if(i===null||typeof i!="object"||Array.isArray(i))return yield*new pr({message:"The list request body must be a JSON object"});let a={...i,...s};for(let[l,{path:m}]of Object.entries(t)){let y=o[l];if(!Fm(y)||yr(y))continue;let T=a;for(let[S,E]of m.entries())if(S===m.length-1)T[E]=y.value;else{let _=T[E],A=_!==null&&typeof _=="object"&&!Array.isArray(_)?{..._}:{};T[E]=A,T=A}}let c=e?Sa(e,a):[];return c.length>0?yield*new pr({message:`Invalid list request: ${JSON.stringify(c)}`}):a})}}function CGe(e){return/^[aeiou]/i.test(e)||e==="SLO"?"an":"a"}function GD(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 BD=on("ID").pipe(sn("The resource ID"));function Wne(e){return ho({limit:e.limit&&Re(e.limit),offset:e.offset&&Re(e.offset)})}function RGe(e,t){let r=e.listDescription??`List all ${t}`,o=Qne(e.enableListBody?e.endpoints.list.body:e.endpoints.list.query),i=e.endpoints.list.paginated===!0?{limit:xS.limit.pipe(he(`Maximum number of items to return, up to ${Pc} (default: ${gO})`)),offset:xS.offset}:{};return e.enableListBody?G("list",{...o.flags,...i,data:im,generateSkeleton:sm},D("cli.resource.list")(function*(s){if(s.generateSkeleton){yield*Oe(yield*om(e.endpoints.list));return}let a=It(s.data)?yield*Qp({file:re(),data:s.data}):{};yield*Oe(yield*ye(e.endpoints.list,{body:yield*o.apply(s,a,Wne(s))}))})).pipe(B(r)):G("list",{...o.flags,...i},D("cli.resource.list")(function*(s){let a=yield*o.apply(s,{},Wne(s));yield*Oe(yield*ye(e.endpoints.list,{query:a}))})).pipe(B(r))}function _t(e){let t=e.singularOverride??eX(e.commandName).replace(/-/g," "),r=e.pluralOverride??e.commandName.replace(/-/g," "),o=CGe(t),{get:i,create:s,update:a,delete:c}=e.endpoints,l=[RGe(e,r),...i?[G("get",{id:BD},D("cli.resource.get")(function*({id:m}){yield*Oe(yield*ye(i,{params:{[GD(i)]:m}}))})).pipe(B(`Get ${o} ${t} by ID`))]:[],...s?[yo("create",`Create a new ${t}`,s)]:[],...a?[G("update",{id:BD,file:jf,data:im,generateSkeleton:sm},D("cli.resource.update")(function*(m){if(m.generateSkeleton){yield*Oe(yield*om(a));return}yield*Oe(yield*ye(a,{params:{[GD(a)]:m.id},body:yield*Qp(m)}))})).pipe(B(`Update ${o} ${t} by ID`))]:[],...c?[G("delete",{id:BD},D("cli.resource.delete")(function*({id:m}){yield*Oe(yield*ye(c,{params:{[GD(c)]:m}}))})).pipe(B(`Delete ${o} ${t} by ID`))]:[],...e.extraSubcommands??[]];return G(e.commandName).pipe(B(e.description),De(l))}var Jne=_t({commandName:"sandbox-runs",description:"Read the history of sandbox agent runs",endpoints:{list:Bne,get:qne}});var Zne=G("experimental").pipe(B("Experimental commands that may change or be removed without notice"),De([Jne,Vne]));var PGe=`/${"v1"}/feedback`,Xne=n.Object({id:n.String({description:"API request ID recorded with the feedback."})},{$id:"Feedback",description:"A recorded piece of feedback"}),wGe={id:"request-123-abc"};Object.assign(Xne,{examples:[wGe]});var eoe=n.Object({content:f({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."})}),vGe={content:"The traces command times out for large services."};Object.assign(eoe,{examples:[vGe]});var toe=x({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:PGe,method:"POST",body:eoe,response:Xne});var roe=G("feedback",{message:on("MESSAGE").pipe(sn("The feedback to send"),Nre({min:1}))},D("cli.feedback")(function*({message:e}){yield*Oe(yield*ye(toe,{body:{content:e.join(" ")}}))})).pipe(B("Send feedback about Tsuga tools or APIs (e.g. a tool that failed or was confusing)"));var UGe=`/${"v1"}/grok`,NGe=25,kGe=100,noe=n.Object({rules:n.Array(f({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:NGe,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(f({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:kGe,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."}),LGe={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(noe,{examples:[LGe]});var ooe=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."}),MGe={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(ooe,{examples:[MGe]});var ioe=x({url:`${UGe}/parse`,method:"POST",operationId:"parseGrok",tags:["public","grok"],body:noe,response:ooe,description:"Parses sample log lines with Grok rules and returns extracted fields, using the same Grok engine as the log route processor. Use this endpoint to author and test route Grok rules before saving them. The operation requires public API read access to log routes. A rule that fails to compile returns a 400 response with error code `GROK_RULE_VALIDATION_ERROR` and structured details in `error.details.ruleErrors`."});var soe=yo("parse","Parse sample log lines with grok rules and return the extracted fields",ioe);var aoe=G("grok").pipe(B("Test and preview grok parsing rules"),De([soe]));var poe=require("node:os"),vS=require("node:path");var qD,coe=()=>{qD?.release(),qD=void 0},loe=(e,t)=>{let r=[],o=e.write.bind(e),i=!0;e.write=c=>i?(r.push(c),!0):o(c);let s=()=>i?(i=!1,e.write=o,r.splice(0)):[],a={release:()=>{for(let c of s())o(c)},divert:()=>{for(let c of s())t.write(c)}};return qD=a,a},uoe=e=>t=>t.pipe(Xb(r=>r._tag==="ShowHelp"?Ie(e.divert):mt),ec(Ie(e.release)));function DGe(e,t=process.platform){return t==="win32"?`${e}.cmd`:e}var fu=D("external.run")(function*(e,t){yield*We(` $ ${e} ${t.join(" ")}`),yield*Ie(coe);let r=yield*oo(ce(qi(DGe(e),t,{stdin:{stream:"ignore"},stdout:{stream:"inherit"},stderr:{stream:"inherit"}}),o=>o.exitCode)).pipe(Mt(o=>new qp({message:`Could not run \`${e}\`: ${o.message}. Is it installed and on your PATH?`})));if(Number(r)!==0)return yield*new qp({message:`${e} ${t.join(" ")} exited ${r}`})});var qc=(e,t)=>r=>Mt(r,o=>new Kn({message:`Could not ${e} ${t}: ${o.message}`})),Vf=D("fs.writeAtomic")(function*(e,t){let r=yield*mn,o=`${e}.tmp.${process.pid}`;yield*r.writeFileString(o,t).pipe(qc("write",o)),yield*r.rename(o,e).pipe(qc("write",e))}),Qf=D("fs.readOrUndefined")(function*(e){return yield*(yield*mn).readFileString(e).pipe(xq(BO,()=>mt),ge(r=>r??void 0),Mt(r=>new Kn({message:`Could not read ${e}: ${r.message}`})))}),Wf=D("fs.backupIfExists")(function*(e,t,r){if(t===void 0)return;let o=yield*mn,i=`${e}.bak.${r.replaceAll(":","-")}`;return yield*o.writeFileString(i,t).pipe(qc("back up",e)),i});function Jf(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var CC=D("fs.parseJsonObject")(function*(e,t){let r=yield*$t(()=>JSON.parse(t)).pipe(Mt(()=>new Kn({message:`${e} is not valid JSON. Fix or remove it before re-running.`})));return Jf(r)?r:yield*new Kn({message:`${e} must contain a JSON object at the top level.`})});var wS="tsuga-dev/agent-plugins",Zf="tsuga";var FGe=D("cli.installPlugin.autoUpdate")(function*(e){let t=yield*mn,r=(0,vS.join)(e,".claude","settings.json");yield*We(`Claude Code \u2192 ${r} (autoUpdate)`),yield*t.makeDirectory((0,vS.dirname)(r),{recursive:!0}).pipe(qc("create",(0,vS.dirname)(r)));let o=yield*Qf(r),i=yield*CC(r,o??"{}"),s=i.extraKnownMarketplaces??{};if(!Jf(s))return yield*new Kn({message:`${r} "extraKnownMarketplaces" must be a JSON object`});let a=s[Zf],c=Jf(a)?a:{},l={...i,extraKnownMarketplaces:{...s,[Zf]:{source:{source:"github",repo:wS},...c,autoUpdate:!0}}},m=new Date(yield*jo).toISOString(),y=yield*Wf(r,o,m);yield*Vf(r,`${JSON.stringify(l,null,2)}
|
|
255
|
+
`),yield*We(y===void 0?" created":` patched (backup: ${y})`)}),$Ge=D("cli.installPlugin.claude")(function*(e,t){yield*We("Claude Code \u2192 installing Tsuga plugin"),yield*fu("claude",["plugin","marketplace","add",wS]),yield*fu("claude",["plugin","install",`tsuga@${Zf}`]),t&&(yield*FGe(e))}),moe=G("claude-code",{autoUpdate:Vo("auto-update").pipe(he("Patch ~/.claude/settings.json with autoUpdate=true; --no-auto-update skips it"),Qo(!0))},D("cli.installPlugin.claudeCode")(function*({autoUpdate:e}){yield*$Ge((0,poe.homedir)(),e),yield*We("Restart your claude session to load the new plugins.")})).pipe(B("Install the Tsuga plugin into Claude Code (requires the claude CLI in PATH)"));var GGe=D("cli.installPlugin.codex")(function*(){yield*We("Codex \u2192 installing Tsuga plugin"),yield*fu("codex",["plugin","marketplace","add",wS]),yield*fu("codex",["plugin","add",`tsuga@${Zf}`])}),doe=G("codex",{},D("cli.installPlugin.codexCli")(function*(){yield*GGe(),yield*We("Restart your codex session to load the new plugins.")})).pipe(B("Install the Tsuga plugin into Codex (requires the codex CLI in PATH)"));var foe=G("plugin").pipe(B("Install the Tsuga plugin into a specific LLM CLI"),De([moe,doe]));var goe=G("install").pipe(B("Install Tsuga plugins into local LLM CLIs"),De([foe]));var BGe=10,qGe=n.Object({key:f({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(f({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`."}))}),jD=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."})}),HD=n.Object({logs:n.Array(jD,{description:"Top log fields for the requested scope, ranked by score and mined from readable logs-sourced dashboards and monitors."}),traces:n.Array(jD,{description:"Top trace fields for the requested scope, ranked by score and mined from readable traces-sourced dashboards and monitors."}),metrics:n.Array(jD,{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."})}),KD=n.Object({scope:n.Array(qGe,{minItems:1,maxItems:BGe,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."})}),lar=x({tags:["interesting-fields"],url:"/v0/interesting-fields",method:"POST",body:KD,response:HD});var jGe=`/${"v1"}/interesting-fields`,HGe={scope:[{key:"context.service.name",value:"payments"},{key:"context.env",value:"prod",valueMustMatch:!0}]},KGe=n.Object(KD.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:[HGe]}),hoe=x({url:jGe,method:"POST",operationId:"getInterestingFields",tags:["public","interesting-fields"],body:KGe,response:HD,description:"Ranks the telemetry fields most relevant to a scope, mined from how the org already uses them in dashboards and monitors, bucketed by logs, traces, and metrics. Use this before guessing a field or metric name: a field that many scope-matching dashboards group or filter on is the one an operator would reach for. Ranking is TF-IDF style, so a field used everywhere in the org scores below one that is distinctive to the scope. Dashboards and monitors the caller cannot read never contribute field names, only the anonymous frequency baseline. The operation requires public API read access to dashboards and monitors."});var yoe=yo("list","Rank the log, trace and metric fields most relevant to a scope, mined from dashboards and monitors",hoe);var Eoe=G("interesting-fields").pipe(B("Discover the telemetry fields an org already uses for a scope"),De([yoe]));var Pi="/v0/kubernetes-explorer",zGe="^[a-z0-9.-]+$",YGe="^[A-Za-z0-9._-]+$",Soe=256,Toe=n.Optional(f({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 ni=e=>n.Optional(n.Array(f({allowEmpty:!1}),{description:e})),zD=["clusters","namespaces","teams","envs"],US="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.",YD={clusterId:Toe,search:n.Optional(n.String({pattern:zGe,minLength:1,maxLength:Soe,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."}))},boe={clusterId:Toe,search:n.Optional(n.String({pattern:YGe,minLength:1,maxLength:Soe,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."}))},xoe=n.Object(YD),Ioe=n.Object(boe),Xf={...YD,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."})),clusters:ni("Restrict results to these Kubernetes cluster names."),namespaces:ni("Restrict results to these namespaces."),teams:ni("Restrict results to these team names."),envs:ni("Restrict results to these environments."),exclusiveFilters:n.Optional(n.Array(n.Enum(zD),{description:US})),...je},VGe=["Pending","Running","Succeeded","Failed","Unknown","CrashLoopBackOff","Error"],QGe=[...zD,"nodes","deployments","statefulsets","daemonsets","podStatus"],WGe={...Xf,nodes:ni("Restrict results to pods scheduled on these nodes."),deployments:ni("Restrict results to pods owned by these Deployments."),statefulsets:ni("Restrict results to pods owned by these StatefulSets."),daemonsets:ni("Restrict results to pods owned by these DaemonSets."),podStatus:ni("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(QGe),{description:`${US} Excluding podStatus is applied after stitching pod phase and container status reason telemetry, because phase is not a filterable metric attribute.`}))},JGe=["deployment","statefulset","daemonset"],_oe=n.Object({kind:n.Enum(JGe,{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."}),Aoe=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(VGe,{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(H({description:"Timestamp from pod start time telemetry for the selected pod instance. Present when pod start time telemetry is observed."}))}),VD=n.Object({...Aoe.properties,workload:n.Optional(_oe),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."}))}),ZGe=["podName","namespace","cluster","team","env","node","phase","restarts","cpuUsageMilli","cpuUtilization","cpuRequestUtilization","memoryUsageBytes","memoryUtilization","memoryRequestUtilization","createdAt"],Aar=x({tags:["kubernetes-explorer"],method:"GET",url:`${Pi}/pods`,query:n.Object({...WGe,sortBy:n.Optional(n.Enum(ZGe,{description:"Field to sort pods by."})),sortDirection:n.Optional(Le)}),paginated:!0,response:n.Array(VD)}),XGe=["teams","envs"],QD=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."}))}),eBe=["cluster","teams","envs","cpuUsageMilli","memoryUsageBytes","readyNodes"],Oar=x({tags:["kubernetes-explorer"],method:"GET",url:`${Pi}/clusters`,query:n.Object({...boe,teams:ni("Restrict to clusters that host workloads from these team names."),envs:ni("Restrict to clusters that host workloads in these environments."),exclusiveFilters:n.Optional(n.Array(n.Enum(XGe),{description:US})),sortBy:n.Optional(n.Enum(eBe,{description:"Field to sort clusters by."})),sortDirection:n.Optional(Le),...je}),paginated:!0,response:n.Array(QD)}),tBe=["clusters"],rBe=["Ready","NotReady","Unknown"],WD=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(rBe,{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."}))}),nBe=["node","cluster","status","instanceType","pods","allocatablePods","cpuUsageMilli","cpuAllocatableMilli","cpuUtilization","memoryUsageBytes","memoryAllocatableBytes","memoryUtilization"],Car=x({tags:["kubernetes-explorer"],method:"GET",url:`${Pi}/nodes`,query:n.Object({...YD,clusters:ni("Restrict results to these Kubernetes cluster names."),exclusiveFilters:n.Optional(n.Array(n.Enum(tBe),{description:US})),sortBy:n.Optional(n.Enum(nBe,{description:"Field to sort nodes by."})),sortDirection:n.Optional(Le),...je}),paginated:!0,response:n.Array(WD)}),JD=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."}))}),oBe=["namespace","cluster","teams","envs","pods","cpuUsageMilli","memoryUsageBytes"],Rar=x({tags:["kubernetes-explorer"],method:"GET",url:`${Pi}/namespaces`,query:n.Object({...Xf,sortBy:n.Optional(n.Enum(oBe,{description:"Field to sort namespaces by."})),sortDirection:n.Optional(Le)}),paginated:!0,response:n.Array(JD)}),ZD=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."}))}),iBe=["deployment","namespace","cluster","team","env","pods","availableReplicas","cpuUsageMilli","memoryUsageBytes"],Par=x({tags:["kubernetes-explorer"],method:"GET",url:`${Pi}/deployments`,query:n.Object({...Xf,sortBy:n.Optional(n.Enum(iBe,{description:"Field to sort deployments by."})),sortDirection:n.Optional(Le)}),paginated:!0,response:n.Array(ZD)}),XD=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."}))}),sBe=["statefulSet","namespace","cluster","team","env","pods","cpuUsageMilli","memoryUsageBytes"],war=x({tags:["kubernetes-explorer"],method:"GET",url:`${Pi}/statefulsets`,query:n.Object({...Xf,sortBy:n.Optional(n.Enum(sBe,{description:"Field to sort StatefulSets by."})),sortDirection:n.Optional(Le)}),paginated:!0,response:n.Array(XD)}),eF=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."}))}),aBe=["daemonSet","namespace","cluster","team","env","pods","readyNodes","cpuUsageMilli","memoryUsageBytes"],Uar=x({tags:["kubernetes-explorer"],method:"GET",url:`${Pi}/daemonsets`,query:n.Object({...Xf,sortBy:n.Optional(n.Enum(aBe,{description:"Field to sort DaemonSets by."})),sortDirection:n.Optional(Le)}),paginated:!0,response:n.Array(eF)}),tF=n.Object({overview:n.Object({...Aoe.properties,workload:n.Optional(_oe)},{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."})}),Ooe=n.Object({clusterId:n.Optional(f({allowEmpty:!1})),k8sCluster:f({allowEmpty:!1}),k8sNamespace:f({allowEmpty:!1}),podName:f({allowEmpty:!1})}),Nar=x({tags:["kubernetes-explorer"],method:"GET",url:`${Pi}/pod-details`,query:Ooe,response:tF}),rF=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:H({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(H({description:"Timestamp when Tsuga last observed the pod deletion event. Present when the latest observed pod event is deleted."}))}),kar=x({tags:["kubernetes-explorer"],method:"GET",url:`${Pi}/pod-manifest`,query:Ooe,response:rF}),nF=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."}),oF=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(H({description:"Latest ReplicaSet metadata.creationTimestamp observed for the Deployment. Present when ReplicaSet object telemetry is observed."}))}),podReplicas:n.Array(nF,{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(H({description:"ReplicaSet metadata.creationTimestamp from the latest observed ReplicaSet object. Present when creation time is observed."})),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."})}),Lar=x({tags:["kubernetes-explorer"],method:"GET",url:`${Pi}/deployment-details`,query:n.Object({clusterId:n.Optional(f({allowEmpty:!1})),k8sCluster:f({allowEmpty:!1}),k8sNamespace:f({allowEmpty:!1}),deploymentName:f({allowEmpty:!1})}),response:oF}),cBe=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(H())}),podReplicas:n.Array(nF,{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(H())}))}),Mar=x({tags:["kubernetes-explorer"],method:"GET",url:`${Pi}/statefulset-details`,query:n.Object({clusterId:n.Optional(f({allowEmpty:!1})),k8sCluster:f({allowEmpty:!1}),k8sNamespace:f({allowEmpty:!1}),statefulSetName:f({allowEmpty:!1})}),response:cBe}),lBe=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(H())}),podReplicas:n.Array(nF,{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(H())}))}),Dar=x({tags:["kubernetes-explorer"],method:"GET",url:`${Pi}/daemonset-details`,query:n.Object({clusterId:n.Optional(f({allowEmpty:!1})),k8sCluster:f({allowEmpty:!1}),k8sNamespace:f({allowEmpty:!1}),daemonSetName:f({allowEmpty:!1})}),response:lBe}),RC=1e3,Coe=Ef,iF=n.Object({id:n.String({description:"Identifier of the event, unique across clusters and namespaces."}),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."}))}),uBe=["timestamp","type","reason","resourceName","resourceKind","namespace","cluster","count"],pBe=[...zD,"resourceKinds","resourceNames"],Far=x({tags:["kubernetes-explorer"],method:"GET",url:`${Pi}/events`,query:n.Object({...Xf,resourceKinds:ni("Restrict results to events about these resource kinds (Pod, Node, Deployment...)."),resourceNames:ni("Restrict results to events about these resource names."),exclusiveFilters:n.Optional(n.Array(n.Enum(pBe),{description:US})),sortBy:n.Optional(n.Enum(uBe)),sortDirection:n.Optional(Le)}),paginated:!0,response:n.Array(iF)});var Ps=`/${"v1"}/kubernetes-explorer`,Poe=n.Pick(VD,["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."}),mBe={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(Poe,{examples:[mBe]});var woe=n.Pick(QD,["cluster","teams","envs","cpuUsageMilli","memoryUsageBytes","readyNodes","podPhaseCounts"],{description:"A Kubernetes cluster with aggregate resource usage, node readiness, and pod phase counts."}),dBe={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(woe,{examples:[dBe]});var voe=n.Pick(JD,["namespace","cluster","teams","envs","pods","cpuUsageMilli","memoryUsageBytes"],{description:"A Kubernetes namespace with pod count and aggregate resource usage."}),fBe={namespace:"production",cluster:"prod-us-east",teams:["platform"],envs:["production"],pods:24,cpuUsageMilli:1800,memoryUsageBytes:3221225472};Object.assign(voe,{examples:[fBe]});var Uoe=n.Pick(WD,["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."}),gBe={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(Uoe,{examples:[gBe]});var Noe=n.Pick(ZD,["deployment","namespace","cluster","team","env","pods","availableReplicas","desiredReplicas","cpuUsageMilli","memoryUsageBytes"],{description:"A Kubernetes deployment with replica counts and aggregate resource usage."}),hBe={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(Noe,{examples:[hBe]});var koe=n.Pick(XD,["statefulSet","namespace","cluster","team","env","pods","cpuUsageMilli","memoryUsageBytes"],{description:"A Kubernetes StatefulSet with replica counts and aggregate resource usage."}),yBe={statefulSet:"postgres",namespace:"production",cluster:"prod-us-east",team:"platform",env:"production",pods:3,cpuUsageMilli:900,memoryUsageBytes:2147483648};Object.assign(koe,{examples:[yBe]});var Loe=n.Pick(eF,["daemonSet","namespace","cluster","team","env","pods","readyNodes","desiredNodes","cpuUsageMilli","memoryUsageBytes"],{description:"A Kubernetes DaemonSet with eligible-node readiness and aggregate resource usage."}),EBe={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(Loe,{examples:[EBe]});var Moe=n.Pick(tF,["overview","healthMetrics","searchFilters"],{description:"Metrics-derived information for a single Kubernetes pod: status, owning workload, CPU/memory metric identifiers, and log/trace filters."}),SBe={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(Moe,{examples:[SBe]});var Doe=n.Pick(rF,["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."}),TBe={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(Doe,{examples:[TBe]});var Foe=n.Pick(oF,["overview","podReplicas","revisions"],{description:"Detailed information for a single Kubernetes deployment: replica status, backing pods, and rollout revisions."}),bBe={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(Foe,{examples:[bBe]});var $oe=n.Pick(iF,["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."}),xBe={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($oe,{examples:[xBe]});var Goe=n.Object({clusterId:n.Optional(f({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."}))}),mm=n.Pick(xoe,["clusterId","search"]),IBe=n.Pick(Ioe,["clusterId","search"]),Boe=x({description:"Lists Kubernetes pods observed across the organization with their current phase, owning workload, and resource usage.",operationId:"listKubernetesPods",tags:["public","kubernetes-explorer"],method:"GET",url:`${Ps}/pods`,query:mm,response:n.Array(Poe)}),qoe=x({description:"Lists Kubernetes clusters observed across the organization with aggregate resource usage, node readiness, and pod phase counts.",operationId:"listKubernetesClusters",tags:["public","kubernetes-explorer"],method:"GET",url:`${Ps}/clusters`,query:IBe,response:n.Array(woe)}),joe=x({description:"Lists Kubernetes namespaces observed across the organization with pod counts and aggregate resource usage.",operationId:"listKubernetesNamespaces",tags:["public","kubernetes-explorer"],method:"GET",url:`${Ps}/namespaces`,query:mm,response:n.Array(voe)}),Hoe=x({description:"Lists Kubernetes nodes observed across the organization with their readiness, instance type, and resource usage against allocatable capacity.",operationId:"listKubernetesNodes",tags:["public","kubernetes-explorer"],method:"GET",url:`${Ps}/nodes`,query:mm,response:n.Array(Uoe)}),Koe=x({description:"Lists Kubernetes deployments observed across the organization with replica counts and aggregate resource usage.",operationId:"listKubernetesDeployments",tags:["public","kubernetes-explorer"],method:"GET",url:`${Ps}/deployments`,query:mm,response:n.Array(Noe)}),zoe=x({description:"Lists Kubernetes StatefulSets observed across the organization with replica counts and aggregate resource usage.",operationId:"listKubernetesStatefulSets",tags:["public","kubernetes-explorer"],method:"GET",url:`${Ps}/statefulsets`,query:mm,response:n.Array(koe)}),Yoe=x({description:"Lists Kubernetes DaemonSets observed across the organization with eligible-node readiness and aggregate resource usage.",operationId:"listKubernetesDaemonSets",tags:["public","kubernetes-explorer"],method:"GET",url:`${Ps}/daemonsets`,query:mm,response:n.Array(Loe)}),Roe=100,_Be=n.Object({...mm.properties,limit:n.Optional(n.Integer({minimum:1,maximum:RC,default:Roe,description:`Maximum number of events to return, newest first. Defaults to ${Roe}. Valid values are 1 through ${RC}.`}))}),Voe=x({description:`Lists the most recent Kubernetes events of the last ${Coe/NL} hours (from the latest ${RC} event observations), newest first, with their type, reason, message, and the resource they are about. \`search\` matches the name of the resource the event is about.`,operationId:"listKubernetesEvents",tags:["public","kubernetes-explorer"],method:"GET",url:`${Ps}/events`,query:_Be,response:n.Array($oe)}),Qoe=n.Object({...Goe.properties,k8sCluster:f({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:f({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:f({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."})}),Woe=x({description:"Retrieves metrics-derived information for a single Kubernetes pod: status, owning workload, CPU/memory metric identifiers, and ready-to-use log and trace filters. Manifest configuration, labels, and annotations are served by the pod-manifest endpoint.",operationId:"getKubernetesPodDetails",tags:["public","kubernetes-explorer"],method:"GET",url:`${Ps}/pod-details`,query:Qoe,response:Moe}),Joe=x({description:"Retrieves the manifest-derived details for a single Kubernetes pod: the pod manifest spec, labels, and annotations from the pod's most recently observed manifest.",operationId:"getKubernetesPodManifest",tags:["public","kubernetes-explorer"],method:"GET",url:`${Ps}/pod-manifest`,query:Qoe,response:Doe}),Zoe=x({description:"Retrieves detailed information for a single Kubernetes deployment: replica status, backing pods, and rollout revisions with ready-to-use log filters.",operationId:"getKubernetesDeploymentDetails",tags:["public","kubernetes-explorer"],method:"GET",url:`${Ps}/deployment-details`,query:n.Object({...Goe.properties,k8sCluster:f({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:f({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:f({allowEmpty:!1,description:"Kubernetes Deployment name to retrieve. From workload telemetry. Required to fetch deployment details for the selected cluster and namespace."})}),response:Foe});var ABe="clusterId";function OBe(e,t){let r=Sre(e.query),o={};for(let i of Object.keys(r)){if(i===ABe)continue;let s=i.replace(/([A-Z])/g,"-$1").toLowerCase(),a=s.replace(/-/g,"_").toUpperCase(),c=st(s).pipe(he(r[i]?.description??""),Fe(a));o[i]=t?c:c.pipe(Rt)}return o}function cn(e,t,r){let o=OBe(t,r);return G(e,o,D(`cli.kubernetes.${e}`)(function*(i){let s=i,a={};for(let c of Object.keys(o)){let l=Tre(s,c);l!==void 0&&(a[c]=l)}yield*Oe(yield*ye(t,Object.keys(a).length>0?{query:a}:void 0))})).pipe(B(t.description??(r?`Get Kubernetes ${e}`:`List Kubernetes ${e}`)))}var Xoe=cn("clusters",qoe,!1);var eie=cn("daemonsets",Yoe,!1);var tie=cn("deployment-details",Zoe,!0);var rie=cn("deployments",Koe,!1);var nie=cn("events",Voe,!1);var oie=cn("namespaces",joe,!1);var iie=cn("nodes",Hoe,!1);var sie=cn("pod-details",Woe,!0);var aie=cn("pod-manifest",Joe,!0);var cie=cn("pods",Boe,!1);var lie=cn("statefulsets",zoe,!1);var uie=G("kubernetes").pipe(B("Explore Kubernetes resources observed across the organization"),De([cie,Xoe,oie,iie,rie,lie,eie,nie,sie,aie,tie]));var NS=`/${"v1"}/logs`,sF=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(HL,["message","timestamp","level"]).properties},{additionalProperties:!0,$id:"LogEvent",description:"Log event including message, timestamp, severity level, and optional enriched context attributes."}),CBe={context:{team:"platform"},message:"Request completed successfully",timestamp:17040672e5,level:"INFO"};Object.assign(sF,{examples:[CBe]});var pie=n.Object({query:n.Optional(f({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:iZ,description:"Maximum number of logs to return. Defaults to 100. Valid values are 1 through 1000."})),clusterId:n.Optional(f({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."})),...Yr.properties},{description:"Log search query. Provide a time range, optional Tsuga query, and optional limit."}),RBe={query:"level:ERROR",maxResults:100,from:1704067200,to:1704070800};Object.assign(pie,{examples:[RBe]});var mie=x({description:"Searches logs in a required time range using Tsuga query syntax. Use this endpoint to retrieve raw log events for investigations or automation. See [Logs](/documentation/explore/logs) and [Query syntax](/documentation/explore/query-syntax).",operationId:"searchLogs",tags:["public","logs"],url:`${NS}/search`,method:"GET",query:pie,response:n.Object({logs:n.Array(sF,{description:"Log events matching the query and time range."})})}),PBe=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`."}))}),die=n.Object({patterns:n.Array(PBe,{description:"Log patterns clustered from logs matching the query."}),sampleSize:n.Number({description:"Number of logs sampled while computing patterns."})},{}),wBe={patterns:[{pattern:"Resolved segment SegmentId([0:1]) from cache",size:37004,groups:[{key:"level",value:"DEBUG"},{key:"context.team",value:"infra"}]}],sampleSize:100};Object.assign(die,{examples:[wBe]});var fie=x({description:"Clusters matching logs into readable patterns for the requested time range. Use this to summarize common log shapes before drilling into raw events. See [Logs](/documentation/explore/logs).",operationId:"getLogPatterns",tags:["public","logs"],url:`${NS}/patterns`,method:"GET",query:n.Object({...Yr.properties,query:f({type:"tsuga-query",description:"Tsuga query selecting logs to cluster into patterns."}),clusterId:n.Optional(f({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))}),response:die}),vBe=n.Object({exampleLog:n.Optional(sF),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."})}),gie=n.Object({newErrorPatterns:n.Array(vBe,{description:"Error patterns first seen in the requested time range."})},{}),UBe={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(gie,{examples:[UBe]});var hie=x({description:"Finds error patterns first seen in the requested time range, optionally filtered by team, environment, or service. Use this to detect newly appearing failures. See [Logs](/documentation/explore/logs).",operationId:"getNewErrorPatterns",tags:["public","logs"],url:`${NS}/patterns/new`,method:"GET",query:n.Object({...Yr.properties,team:n.Optional(f({description:"Team name to restrict pattern detection to."})),env:n.Optional(f({description:"Environment to restrict pattern detection to."})),service:n.Optional(f({description:"Service name to restrict pattern detection to."})),clusterId:n.Optional(f({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))}),response:gie}),NBe=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."}))}),yie=n.Object({errorPatternIncreases:n.Array(NBe,{description:"Error patterns with increased occurrence in the requested time range."})},{}),kBe={errorPatternIncreases:[{team:"platform",env:"production",pattern:"Non-resolved segment SegmentId(*) from cache",increaseTimestamps:[17041536e5,17042392e5]}]};Object.assign(yie,{examples:[kBe]});var Eie=x({description:"Finds error patterns whose occurrence increased for a team in the requested time range. Use this to identify growing failure modes without retrieving raw log events. See [Logs](/documentation/explore/logs).",operationId:"getErrorPatternIncrease",tags:["public","logs"],url:`${NS}/patterns/increase`,method:"GET",query:n.Object({...Yr.properties,team:f({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(f({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(f({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))}),response:yie}),Sie=n.Object({attributes:n.Array(n.String(),{description:"Log attribute dot-paths observed in the time range"})},{}),LBe={attributes:["context.env","context.k8s.pod.name","context.service.name","context.team","level","message","timestamp"]};Object.assign(Sie,{examples:[LBe]});var MBe=n.Object({...Yr.properties,clusterId:n.Optional(f({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))},{description:"Log attribute discovery query. Provide a time range and optional cluster ID."}),Tie=x({description:"Lists log attribute dot-paths observed in the requested time range. This endpoint requires a public API credential that can read all relevant teams because attribute discovery is not team-filtered. Use this to discover fields for Tsuga queries, filters, and grouping. See [Logs](/documentation/explore/logs).",operationId:"getLogAttributes",tags:["public","logs"],url:`${NS}/attributes`,method:"GET",query:MBe,response:Sie});var bie=G("attributes",ar,D("cli.logs.attributes")(function*(e){yield*Oe(yield*ye(Tie,{query:{from:yield*Ft("from",e.from),to:yield*Ft("to",e.to)}}))})).pipe(B("List log attribute dot-paths observed in the time range"));var PC=st("env").pipe(he("Filter by environment"),Fe("ENV_NAME"),Rt);var xie=G("error-pattern-increases",{...ar,team:st("team").pipe(he("Team to query"),Fe("TEAM_NAME")),env:PC},D("cli.logs.errorPatternIncreases")(function*(e){yield*Oe(yield*ye(Eie,{query:ho({from:yield*Ft("from",e.from),to:yield*Ft("to",e.to),team:e.team,env:Re(e.env)})}))})).pipe(B("List error pattern increases for a given team"));var DBe=st("team").pipe(he("Filter by team"),Fe("TEAM_NAME"),Rt),Iie=G("new-error-patterns",{...ar,team:DBe,env:PC,service:st("service").pipe(he("Filter by service"),Fe("SERVICE_NAME"),Rt)},D("cli.logs.newErrorPatterns")(function*(e){yield*Oe(yield*ye(hie,{query:ho({from:yield*Ft("from",e.from),to:yield*Ft("to",e.to),team:Re(e.team),env:Re(e.env),service:Re(e.service)})}))})).pipe(B("List error patterns first seen in this time range"));var _ie=["count","ratio","team","level","pattern"];function FBe(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 Aie=G("patterns",{...ar,query:uu.pipe(he("Tsuga query to filter logs before clustering into patterns")),...Ia(_ie)},D("cli.logs.patterns")(function*(e){let t=yield*ti,r=yield*ye(fie,{query:ho({from:yield*Ft("from",e.from),to:yield*Ft("to",e.to),query:yield*am("query",e.query)})}),{patterns:o,sampleSize:i}=r,s=o.map(a=>FBe(a,i));yield*t.rows(s,{...e,defaultFields:_ie})})).pipe(B("List log patterns"));var $Be=D("telemetry.resolveMaxResults")(function*(e){if(e===void 0)return;let t=Re(e);if(t!==void 0)return t;let r=yield*am("max-results",re());if(r===void 0)return;let o=Number(r);return!Number.isSafeInteger(o)||o<=0?yield*new pr({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}),eg=D("telemetry.timeRangeQuery")(function*(e){let t=e.query===void 0?void 0:yield*am("query",e.query),r=yield*$Be(e.maxResults);return ho({from:yield*Ft("from",e.from),to:yield*Ft("to",e.to),query:t,maxResults:r})});var Oie=["timestamp","level","message"],Cie=G("search",{...ar,query:uu,maxResults:Hf,...Ia(Oie)},D("cli.logs.search")(function*(e){let t=yield*ti,r=yield*ye(mie,{query:yield*eg(e)}),{logs:o}=r;yield*t.rows(o,{...e,defaultFields:Oie})})).pipe(B("Search logs"));var Rie=G("logs").pipe(B("Search and analyze logs"),De([Cie,bie,Aie,Iie,xie]));var aF=`/${"v1"}/metrics`,cF=n.Object({name:n.String({description:"Metric name observed by Tsuga. Use this value in metric queries and aggregations."}),type:AO,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(OO),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."}))}),GBe={name:"http.server.request.duration",type:"histogram",description:"Duration of HTTP server requests",unit:"ms",temporality:"delta",capabilities:["max","min","sum"],attributes:["context.team","context.environment","context.region"]};Object.assign(cF,{examples:[GBe]});var Pie=n.Object({...Yr.properties,clusterId:n.Optional(f({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))},{description:"Metric metadata query. Provide the time range to inspect and optionally a cluster ID."}),wie=x({description:"Lists metrics observed in the requested time range with metadata such as type, unit, temporality, capabilities, and attributes. Use this to discover metric names before querying or graphing them. See [Metrics](/documentation/explore/metrics/index).",operationId:"listMetrics",tags:["public","metrics"],url:aF,method:"GET",query:Pie,response:n.Array(cF)}),vie=x({description:"Retrieves metadata for one metric name in the requested time range. Use this to inspect available dimensions and supported query behavior for a metric. See [Metric details](/documentation/explore/metrics/metric-details).",operationId:"getMetric",tags:["public","metrics"],url:`${aF}/:name`,method:"GET",params:n.Object({name:f({allowEmpty:!1,description:"Metric name to retrieve, for example `http.server.request.duration`."})}),query:Pie,response:cF}),BBe=["service","env","host","method","status_code"];Object.assign(nS,{examples:[BBe]});var Uie=n.Pick(zL,["assets"]),qBe={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(Uie,{examples:[qBe]});var Nie=x({description:"Retrieve dashboards and monitors that use a specific metric",operationId:"getMetricAssetsUsage",tags:["private"],url:`${aF}/assets-usage`,method:"GET",query:n.Object({metricName:f({allowEmpty:!1,description:"The name of the metric to find usage for"})}),response:Uie});var kie=G("assets-usage",{name:on("METRIC_NAME").pipe(sn("The metric to look up"))},D("cli.metrics.assetsUsage")(function*({name:e}){yield*Oe(yield*ye(Nie,{query:{metricName:e}}))})).pipe(B("List dashboards and monitors that use a specific metric"));var Lie=G("get",{name:on("METRIC_NAME").pipe(sn("The metric to retrieve")),...ar},D("cli.metrics.get")(function*(e){yield*Oe(yield*ye(vie,{params:{name:e.name},query:{from:yield*Ft("from",e.from),to:yield*Ft("to",e.to)}}))})).pipe(B("Retrieve a metric by name with its metadata"));var Mie=G("list",ar,D("cli.metrics.list")(function*(e){yield*Oe(yield*ye(wie,{query:{from:yield*Ft("from",e.from),to:yield*Ft("to",e.to)}}))})).pipe(B("List all metrics with their metadata"));var Die=G("metrics").pipe(B("List and inspect metrics"),De([Mie,Lie,kie]));var jBe="/v0/profiles",HBe=["cpu","samples","wall","off_cpu","space","inuse_space","objects","inuse_objects","alloc_space","alloc_objects","goroutine"],KBe=20,kS={service:f({allowEmpty:!1,description:"Service the profiles belong to, as it appears in `profile.{type}.{service}`."}),type:n.Enum(HBe,{description:"pprof sample type."}),filter:n.Optional(f({type:"tsuga-query",description:"TQL over the profile labels. Only label equality, negation and wildcards are accepted."})),groupBy:n.Optional(n.Array(f({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:KBe,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."}))},pur=x({tags:["profiles"],url:`${jBe}/query`,method:"POST",body:n.Object({...kS,timeRange:Os,clusterId:n.Optional(f({allowEmpty:!1,description:"Cluster to target. Defaults to the first cluster created in the organization when omitted."}))}),response:Cf});var Fie=`/${"v1"}/profiles`,$ie=n.Object({...kS,timeRange:Yr},{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"}]}),zBe=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}]}]}),wC=x({description:"Aggregates continuous profiling samples for a service into folded stacks, optionally split by profile labels.",tags:["private"],url:`${Fie}/query`,method:"POST",body:$ie,query:Ea,response:zBe}),YBe=n.Object({pprof:n.String({description:"Merged pprof profile, base64-encoded (standard alphabet, padded)."})}),Gie=x({description:"Merges continuous profiling samples for a service into a single pprof profile.",tags:["private"],url:`${Fie}/pprof`,method:"POST",body:$ie,query:Ea,response:YBe});var Bie=it("cli/StdoutIsTTY",{defaultValue:()=>process.stdout.isTTY}),qie=D("output.printBytes")(function*(e){let t=yield*yd;yield*ny(O2(e),t.stdout()).pipe(Mt(r=>new Kn({message:`Could not write stdout: ${r.message}`})))});var vC={service:st("service").pipe(he("Service the profiles belong to"),Fe("SERVICE_NAME")),type:Ml("type",kS.type.enum).pipe(he("Profile type"),Fe("PROFILE_TYPE")),...ar,filter:st("filter").pipe(he("Tsuga query over profile labels (equality, negation, wildcards)"),Fe("TSUGA_QUERY"),Rt)},UC=D("profiles.buildQueryBody")(function*(e){let t=Re(e.filter);return{service:e.service,type:e.type,timeRange:{from:yield*Ft("from",e.from),to:yield*Ft("to",e.to)},...t===void 0?{}:{filter:t}}});var jie=G("pprof",{...vC,outputFile:st("output-file").pipe(Ki("O"),he("Write the profile to this file instead of stdout"),Fe("FILE_PATH"),Rt)},D("cli.profiles.pprof")(function*(e){let t=Re(e.outputFile);if(t===void 0&&(yield*Bie))return yield*new pr({message:"Refusing to write a binary profile to the terminal. Use --output-file <FILE_PATH> or pipe stdout."});let r=yield*ye(Gie,{body:yield*UC(e)}),o=Buffer.from(r.pprof,"base64");if(t===void 0){yield*qie(o);return}yield*(yield*mn).writeFile(t,o).pipe(Mt(s=>new Kn({message:`Could not write ${t}: ${s.message}`})))})).pipe(B("Download a merged pprof profile (raw protobuf, not gzipped)"));var Hie=yo("query","Run a raw profile query and print the folded stacks",wC);var VBe=30,Kie=["flat","flatPercent","cum","cumPercent","function"],zie=G("top",{...vC,limit:$d("limit").pipe(he("Maximum number of functions to print"),Fe("COUNT"),Qo(VBe)),...Ia(Kie)},D("cli.profiles.top")(function*(e){let t=yield*ti;if(e.limit<1)return yield*new pr({message:`--limit must be a positive integer (got: ${e.limit})`});let r=yield*ye(wC,{body:yield*UC(e)}),{total:o,functions:i}=QBe(r.stacks),s=i.slice(0,e.limit).map(a=>({...a,total:o}));yield*t.rows(s,{...e,defaultFields:Kie})})).pipe(B("Rank functions by self (flat) and inclusive (cum) sample value, like pprof -top"));function QBe(e){let t=new Map,r=new Map,o=0;for(let{stack:a,value:c}of e){let l=a.split(";"),m=l[l.length-1];if(m!==void 0){o+=c,t.set(m,(t.get(m)??0)+c);for(let y of new Set(l))r.set(y,(r.get(y)??0)+c)}}let i=a=>o===0?0:Math.round(a/o*1e4)/100,s=[...r.entries()].map(([a,c])=>{let l=t.get(a)??0;return{function:a,flat:l,flatPercent:i(l),cum:c,cumPercent:i(c)}}).sort((a,c)=>c.flat-a.flat||c.cum-a.cum||a.function.localeCompare(c.function));return{total:o,functions:s}}var Yie=G("profiles").pipe(B("Query continuous profiling data"),De([zie,jie,Hie]));var WBe=n.Union([n.Literal("scalar"),n.Literal("timeseries")]),JBe="/v0/promql",NC=n.Object({query:f({type:"long",allowEmpty:!1,description:"PromQL expression to evaluate."}),timeRange:Os,step:f({allowEmpty:!1,description:"Evaluation step interval (e.g. `1m`, `5m`, `1h`). Must be a valid Prometheus duration string."}),returnType:n.Optional(WBe),executionOptions:oS,shouldStreamResults:n.Optional(n.Boolean()),clusterId:n.Optional(f({allowEmpty:!1,description:"Cluster to target. Defaults to the first cluster created in the organization when omitted."}))}),ZBe={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(NC,{examples:[ZBe]});var Jur=x({tags:["promql"],url:JBe,method:"POST",body:NC,response:Cf});var XBe=`/${"v1"}/promql`,eqe=n.Object({...n.Pick(NC,["query","step"]).properties,timeRange:Yr},{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"}]}),tqe=n.Object({clusterId:n.Optional(f({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."}))}),Vie=x({description:"Runs a PromQL range query over Tsuga metric data and returns timeseries results. Authenticate with a bearer operation API key or OAuth access token that can read metrics. Send clusterId as a query parameter; multi-cluster organizations must provide it. See [How to write PromQL queries](/documentation/visualize/guides/how-to-write-promql-queries) for query syntax and examples.",operationId:"queryPromql",tags:["public","promql"],url:XBe,method:"POST",body:eqe,query:tqe,response:PO});var Qie=yo("query","Run a PromQL range query over metric data",Vie);var Wie=G("promql").pipe(B("Run PromQL queries over metric data"),De([Qie]));var rqe={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"]}},[fpr,kC,LS]=nqe(rqe),gpr=Object.fromEntries(kC.map(e=>[e,e]));function nqe(e){let t=[],r=[],o=[],i=Object.keys(e);for(let s of i){t.push(s);let a=e[s];for(let c in a){r.push(c);let l=a[c];Array.isArray(l)&&o.push(...l)}}return[lF(t),lF(r),lF(o)]}function lF(e){if(e.length===0)throw new Error("Array must have at least one element.");return e}var uF=n.Enum(["HTTP","HTTPS","TCP","UDP","GENEVE","TLS","TLS_QUIC","TCP_UDP","TCP_QUIC","QUIC"]),oqe=n.Object({versioningStatus:n.Optional(n.Enum(["Enabled","Disabled","Suspended","Not configured"]))}),iqe=n.Object({domainName:n.Optional(n.String()),origins:n.Optional(n.Array(n.String()))}),sqe=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())}),aqe=n.Object({version:n.Optional(n.String()),virtualNetworkId:n.Optional(n.String()),subnets:n.Optional(n.Array(n.String()))}),cqe=n.Object({artifactRegistryFormat:n.Optional(n.Enum(["FORMAT_UNSPECIFIED","DOCKER","MAVEN","NPM","APT","YUM","PYTHON","KFP","GO","GENERIC"])),uri:n.Optional(n.String()),tagMutability:n.Optional(n.Enum(["MUTABLE","IMMUTABLE"])),scanOnPush:n.Optional(n.Boolean()),encryptionType:n.Optional(n.String())}),lqe=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(H())}),pqe=n.Object({isEncrypted:n.Optional(n.Boolean()),ownerId:n.Optional(n.String()),state:n.Optional(n.Enum(["creating","available","deleting","deleted","error","updating"]))}),mqe=n.Object({type:n.Optional(n.String()),osType:n.Optional(n.String()),subnetIds:n.Optional(n.Array(n.String())),nbContainers:n.Optional(n.Number())}),dqe=n.Object({digest:n.String(),imageTags:n.Array(n.String()),imageSizeBytes:n.Optional(n.Number()),imagePushedAt:n.Optional(H()),mediaType:n.Optional(n.String()),repositoryName:n.String(),repositoryId:n.Optional(n.String()),scanStatus:n.Optional(n.String())}),fqe=n.Object({url:n.Optional(n.String()),maxMessageSizeBytes:n.Optional(n.Number()),messageRetentionHours:n.Optional(n.Number())}),gqe=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())}),hqe=n.Object({kind:n.Optional(n.String())}),yqe=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())}),Eqe=n.Object({id:n.Optional(n.String()),ipCidrBlocks:n.Array(n.String())}),Sqe=n.Object({protocol:n.Optional(uF),port:n.Optional(n.Number()),instanceProtocol:n.Optional(uF),instancePort:n.Optional(n.Number())}),Tqe=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"])}),xqe=n.Object({type:n.String(),name:n.String()}),Iqe=n.Object({frontendIp:n.Optional(bqe),backendIpPools:n.Array(xqe)}),_qe=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())}),Aqe=n.Object({protocol:n.Optional(uF),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(_qe)),targetCount:n.Optional(n.Number()),healthyTargetCount:n.Optional(n.Number()),loadBalancerArns:n.Optional(n.Array(n.String()))}),Oqe=n.Object({first:n.Optional(n.String()),last:n.Optional(n.String()),scope:n.Optional(n.Number())}),Cqe=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(),Oqe]))),target:n.Optional(n.String()),weight:n.Optional(n.Number()),priority:n.Optional(n.Number()),status:n.Optional(n.String())}),Rqe=n.Object({instanceId:n.Optional(n.String()),state:n.Optional(n.String()),reasonCode:n.Optional(n.String()),description:n.Optional(n.String())}),Pqe=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(Sqe),n.Array(Tqe)])),targets:n.Optional(n.Union([n.Array(n.String()),n.Array(Rqe),n.Array(Cqe)])),azureLoadBalancingRules:n.Optional(n.Array(Iqe))}),wqe=n.Object({domainName:n.Optional(n.String()),expiresAt:n.Optional(H()),inUseBy:n.Optional(n.Array(n.String())),renewalEligibility:n.Optional(n.String()),revokedAt:n.Optional(H()),status:n.Optional(n.String()),type:n.Optional(n.String())}),vqe=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"]))}),Uqe=n.Object({osType:n.Optional(n.Enum(["Windows","Linux"]))}),Nqe=n.Object({state:n.Optional(n.String()),volumeType:n.Optional(n.String())}),kqe=n.Intersect([n.Object({isEncrypted:n.Optional(n.Boolean()),sizeGib:n.Optional(n.Number())}),n.Union([vqe,Nqe,Uqe])]),Lqe=n.Object({instanceCount:n.Optional(n.Number()),hostnames:n.Optional(n.Array(n.String())),runtime:n.Optional(n.String())}),LC=n.Union([n.Object({category:n.Literal("application"),resourceType:n.Literal("webService"),attributes:n.Optional(Lqe)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("bucket"),attributes:n.Optional(oqe)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("messagingService"),attributes:n.Optional(fqe)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("fileSystem"),attributes:n.Optional(pqe)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("contentDeliveryNetwork"),attributes:n.Optional(iqe)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("database"),attributes:n.Optional(sqe)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("storageAccount"),attributes:n.Optional(hqe)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("volume"),attributes:n.Optional(kqe)}),n.Object({category:n.Literal("compute"),resourceType:n.Literal("virtualMachine"),attributes:n.Optional(yqe)}),n.Object({category:n.Literal("compute"),resourceType:n.Literal("serverless"),attributes:n.Optional(gqe)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("kubernetesCluster"),attributes:n.Optional(aqe)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerRepository"),attributes:n.Optional(cqe)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerCluster"),attributes:n.Optional(lqe)}),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(mqe)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerImage"),attributes:n.Optional(dqe)}),n.Object({category:n.Literal("network"),resourceType:n.Literal("virtualNetwork"),attributes:n.Optional(Eqe)}),n.Object({category:n.Literal("network"),resourceType:n.Literal("loadBalancer"),attributes:Pqe}),n.Object({category:n.Literal("network"),resourceType:n.Literal("targetGroup"),attributes:n.Optional(Aqe)}),n.Object({category:n.Literal("network"),resourceType:n.Literal("certificate"),attributes:n.Optional(wqe)})],{description:"Normalized public inventory category, resource type, and category-specific attributes. Attribute shape depends on the category and resourceType combination."});var dm="/v0/inventory",Jie=["scan_in_progress","success","failure","partial"],mF=n.Object({id:n.String({description:"Identifier of the inventory resource. Generated by Tsuga."}),cloudPlatform:n.Enum(ou,{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(H({description:"Timestamp when the resource was created in the cloud, when known."})),resourceUpdatedAt:n.Optional(H({description:"Timestamp when the resource was last updated in the cloud, when known."})),resourceLastSeenAt:H({description:"Timestamp when Tsuga last observed this resource during an inventory scan."}),tags:br,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"}))}),tg={DISPLAY_NAME:"displayName",CLOUD_ACCOUNT:"cloudAccount",NATIVE_RESOURCE_TYPE:"nativeResourceType",CLOUD_REGION:"cloudRegion",RESOURCE_TYPE:"resourceType",RESOURCE_CREATED_AT:"resourceCreatedAt"},Zie=n.Object({cloudPlatforms:qe(n.Enum(ou),{description:"Restrict results to resources discovered on any of these cloud platforms",maxItems:ou.length}),cloudAccounts:qe(f({allowEmpty:!1}),{description:"Restrict results to resources in any of these cloud accounts",maxItems:500}),cloudRegions:qe(f({allowEmpty:!1}),{description:"Restrict results to resources in any of these cloud regions",maxItems:500}),nativeResourceTypes:qe(n.Enum(LS),{description:"Restrict results to resources of any of these cloud-native resource types",maxItems:LS.length}),resourceTypes:qe(n.Enum(kC),{description:"Restrict results to resources of any of these normalized resource types",maxItems:kC.length}),tags:qe(Fn.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:f({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"}),dF=n.Partial(n.Object({...je,filters:n.Partial(Zie,{description:"Filters applied to narrow the returned resources."}),sort:n.Object({by:n.Enum([tg.DISPLAY_NAME,tg.CLOUD_ACCOUNT,tg.NATIVE_RESOURCE_TYPE,tg.CLOUD_REGION,tg.RESOURCE_TYPE,tg.RESOURCE_CREATED_AT],{description:"Field to sort the returned resources by"}),direction:Le},{description:"Optional sorting applied to the returned resources. Ties are broken by resource ID for stable pagination."})})),_pr=x({tags:["inventory"],method:"POST",url:`${dm}/resources/query`,paginated:!0,body:dF,response:n.Array(n.Intersect([mF,LC]))}),Mqe=["resourceType","cloudAccount","isIacManaged"],Apr=x({tags:["inventory"],method:"POST",url:`${dm}/resources/counts`,body:n.Object({filters:n.Optional(n.Partial(Zie)),groupBy:n.Enum(Mqe,{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."})}))}),Opr=x({tags:["inventory"],method:"GET",url:`${dm}/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:Dn})}),Cpr=Q("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."})})]),Dqe="^[0-9]{12}$",Fqe="^arn:aws[a-z-]*:iam::[0-9]{12}:role/.+$",$qe="^[a-z][a-z0-9-]{4,28}[a-z0-9]$",Gqe="^[^@\\s]+@[^@\\s]+\\.iam\\.gserviceaccount\\.com$",Bqe="^//iam\\.googleapis\\.com/projects/[0-9]+/locations/global/workloadIdentityPools/[^/]+/providers/[^/]+$",pF="^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$",qqe=n.Object({type:n.Literal("aws",{description:"Discriminator identifying AWS connection settings."}),accountId:n.String({pattern:Dqe,description:"AWS account ID that Tsuga scans.",errorMessage:{pattern:"Must be a 12-digit AWS account ID."}}),externalId:f({allowEmpty:!1,description:"External ID Tsuga passes when assuming the cross-account IAM role."}),roleArn:n.String({pattern:Fqe,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"}),jqe=n.Object({type:n.Literal("gcp",{description:"Discriminator identifying GCP connection settings."}),projectId:n.String({pattern:$qe,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:Gqe,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:Bqe,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"}),Hqe=n.Object({type:n.Literal("azure",{description:"Discriminator identifying Azure connection settings."}),clientId:n.String({pattern:pF,minLength:1,description:"Client ID of the Azure application Tsuga authenticates as (GUID).",errorMessage:{pattern:"Must be a GUID."}}),subscriptionId:n.String({pattern:pF,minLength:1,description:"Azure subscription ID that Tsuga scans (GUID).",errorMessage:{pattern:"Must be a GUID."}}),tenantId:n.String({pattern:pF,minLength:1,description:"Azure tenant ID that owns the subscription (GUID).",errorMessage:{pattern:"Must be a GUID."}})},{$id:"AzureConnectionSettings"}),Xie=Q("type",[qqe,jqe,Hqe],{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`."}),rg=n.Object({id:n.String({description:"Identifier of the cloud account. Generated by Tsuga."}),cloudType:n.Enum(ou,{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:H({description:"Timestamp when the account was registered in Tsuga."}),lastScanStartedAt:n.Optional(H({description:"Timestamp when the most recent inventory scan started."})),lastScanFinishedAt:n.Optional(H({description:"Timestamp when the most recent inventory scan finished."})),lastScanStatus:n.Optional(n.Enum(Jie,{description:"Status of the most recent inventory scan."}))}),fF=n.Object({cloudType:n.Enum(ou,{description:"Cloud provider of the account."}),cloudAccountId:f({allowEmpty:!1,description:"Cloud-native account identifier: an AWS account ID, GCP project ID, or Azure subscription ID."}),accountFriendlyName:n.Optional(f({description:"Human-readable name for the account shown in Tsuga."})),organizationId:n.Optional(f({description:"Cloud organization identifier, when known."})),connectionSettings:Xie,lastScanStatus:n.Optional(n.Enum(Jie,{description:"Status of the most recent inventory scan."}))}),fm=`${dm}/cloud-accounts`,Rpr=x({tags:["inventory"],url:fm,method:"GET",response:n.Array(rg)}),Ppr=x({tags:["inventory"],url:`${fm}/:id`,method:"GET",params:n.Object({id:f()}),response:rg}),wpr=x({tags:["inventory"],url:fm,method:"POST",body:fF,response:rg}),gF=n.Object({accountFriendlyName:f({description:"Human-readable name for the account shown in Tsuga."})}),vpr=x({tags:["inventory"],url:`${fm}/:id`,method:"PUT",params:n.Object({id:f()}),body:gF,response:rg}),Upr=x({tags:["inventory"],url:`${fm}/:id`,method:"DELETE",params:n.Object({id:f()}),response:ae}),Npr=x({tags:["inventory"],url:`${dm}/trigger-scan`,method:"POST",body:n.Object({}),response:n.Object({success:n.Literal(!0)})}),kpr=x({tags:["inventory"],url:`${fm}/azure/onboarding`,method:"POST",body:n.Object({tenantId:f()}),response:n.Object({subjectId:n.String(),audience:n.String()})}),Lpr=x({tags:["inventory"],method:"POST",url:`${fm}/validate/:type`,params:n.Object({type:f()}),body:n.Object({data:Xie,id:n.Optional(f())}),response:n.Object({areAccountSettingsValid:n.Boolean(),message:n.Optional(n.String())})}),ese=`${dm}/settings`,Mpr=x({tags:["inventory"],url:ese,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())}))}))})}),Kqe=50,Dpr=x({tags:["inventory"],url:ese,method:"POST",body:n.Object({infrastructureIdentifiers:n.Array(n.Object({name:f({allowEmpty:!1}),value:n.Optional(f({allowEmpty:!1}))}),{maxItems:Kqe})}),response:n.Object({})}),Fpr=x({tags:["inventory"],url:`${dm}/iac-tags-proposal`,method:"GET",response:n.Array(n.Object({name:n.String(),value:n.Optional(n.String())}))});var tse=`/${"v1"}/inventory`,zqe=n.Omit(mF,["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)."}),rse=n.Intersect([zqe,LC],{$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)."}),Yqe={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(rse,{examples:[Yqe]});var nse=n.Object({...dF.properties,...er},{description:"Inventory resource query request. Use filters, sorting, limit, and offset to page through discovered resources."}),Vqe={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(nse,{examples:[Vqe]});var ose=x({description:"Queries cloud resources discovered by inventory scans, with optional filters, sorting, and pagination. Use this endpoint to build infrastructure inventories across connected cloud accounts.",operationId:"queryInventoryResources",tags:["inventory"],url:`${tse}/resources/query`,method:"POST",paginated:!0,body:nse,response:n.Array(rse)}),MS=`${tse}/cloud-accounts`,DS=n.Pick(rg,["id","cloudType","cloudAccountId","accountFriendlyName"],{$id:"CloudAccount"}),Qqe={id:"123-456-abc",cloudType:"aws",cloudAccountId:"123456789012",accountFriendlyName:"Production AWS"};Object.assign(DS,{examples:[Qqe]});var ise=n.Pick(fF,["cloudType","cloudAccountId","accountFriendlyName","connectionSettings"]),Wqe={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(ise,{examples:[Wqe]});var sse=n.Pick(gF,["accountFriendlyName"]),Jqe={accountFriendlyName:"Production AWS"};Object.assign(sse,{examples:[Jqe]});var Ypr=x({description:"Lists cloud accounts connected to Tsuga that the authenticated operation key can read.",operationId:"listCloudAccounts",tags:["inventory"],url:MS,method:"GET",response:n.Array(DS)}),Vpr=x({description:"Retrieves one cloud account by ID.",operationId:"getCloudAccount",tags:["inventory"],url:`${MS}/:id`,method:"GET",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the cloud account to retrieve. Use the `id` returned by the cloud account list or create operations."})}),response:DS}),Qpr=x({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:ise,response:DS}),Wpr=x({description:"Updates the friendly name of a cloud account by ID.",operationId:"updateCloudAccount",tags:["inventory"],url:`${MS}/:id`,method:"PUT",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the cloud account to update. Use the `id` returned by the cloud account list or create operations."})}),body:sse,response:DS}),Jpr=x({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:f({allowEmpty:!1,description:"Identifier of the cloud account to delete. Use the `id` returned by the cloud account list or create operations."})}),response:ae});var ase=_t({commandName:"cloud-resources",description:"List cloud resources discovered by inventory scans",endpoints:{list:ose},enableListBody:!0});var og="/v0/dashboard-folders",ig=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:br,creator:n.Optional(Qe),updater:n.Optional(Qe),createdAt:H(),updatedAt:H()},{title:"DashboardFolder"}),hF=n.Object({...ig.properties,dashboardCount:n.Number({description:"Number of dashboards directly assigned to this folder that the caller can read. Returned only by folder list responses; callers without dashboard read access see 0."})}),MC=n.Object({name:f({allowEmpty:!1,description:"Display name of the dashboard folder. Required and non-empty."}),owner:f({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(),f({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:wr}),DC=n.Partial(n.Object({owners:qe(f({allowEmpty:!1}),{description:"Restrict results to dashboard folders owned by any of these team IDs",maxItems:50}),searchQuery:n.Object({value:f({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:qe(Fn.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(),f({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"})),ng={IS_FAVORITE:"isFavorite",OWNER:"owner",TAGS:"tags",DASHBOARD_COUNT:"dashboardCount",UPDATED_AT:"updatedAt",NAME:"name"},yF=[ng.OWNER,ng.TAGS,ng.DASHBOARD_COUNT,ng.UPDATED_AT,ng.NAME],Zqe=n.Partial(n.Object({...je,filters:DC,sort:n.Object({by:n.Enum([...yF,ng.IS_FAVORITE],{description:"Field to sort the returned dashboard folders by"}),direction:Le},{description:"Optional sorting applied to the returned dashboard folders"})})),cmr=x({tags:["dashboard-folders"],url:`${og}/query`,method:"POST",paginated:!0,body:Zqe,response:n.Array(hF)}),lmr=x({tags:["dashboard-folders"],url:`${og}/:id`,method:"GET",params:n.Object({id:f()}),response:ig}),umr=x({tags:["dashboard-folders"],url:og,method:"POST",body:MC,response:ig}),pmr=x({tags:["dashboard-folders"],url:`${og}/:id`,method:"PUT",params:n.Object({id:f()}),body:MC,response:ig}),mmr=x({tags:["dashboard-folders"],url:`${og}/:id`,method:"DELETE",params:n.Object({id:f()}),response:ae}),dmr=x({tags:["dashboard-folders"],url:`${og}/tags/query`,method:"POST",body:n.Object({filters:n.Optional(n.Omit(DC,["tags"]))}),response:Dn});var FS=`/${"v1"}/dashboard-folders`,FC=n.Pick(ig,["id","name","owner","parentFolderId","tags"],{$id:"DashboardFolder",description:"Folder used to organize dashboards into a two-level hierarchy"}),cse={id:"123-456-abc",name:"Platform",owner:"team-123-abc",tags:[{key:"team",value:"platform"}]};Object.assign(FC,{examples:[cse]});var lse=n.Pick(hF,["id","name","owner","parentFolderId","tags","dashboardCount"],{$id:"DashboardFolderWithDashboardCount",description:"Folder used to organize dashboards into a two-level hierarchy, including the number of readable dashboards it directly contains."}),Xqe={...cse,dashboardCount:10};Object.assign(lse,{examples:[Xqe]});var EF=n.Pick(MC,["name","owner","parentFolderId","tags"],{description:"Dashboard folder create or update request. Provide a name, owner team, optional parent folder, and optional tags."}),eje={name:"Platform",owner:"team-123-abc",parentFolderId:null,tags:[{key:"team",value:"platform"}]};Object.assign(EF,{examples:[eje]});var tje=n.Object({by:n.Enum(yF,{description:"Field to sort the returned dashboard folders by: `owner` sorts by owning team name, `tags` sorts by tag key/value pairs, `dashboardCount` sorts by the number of readable dashboards directly in the folder, `updatedAt` sorts by last-updated timestamp, and `name` sorts alphabetically by folder name."}),direction:Le},{description:"Optional sorting applied to the returned dashboard folders"}),use=n.Object({...er,filters:n.Optional(n.Pick(DC,["owners","searchQuery","tags","parentFolderId"])),sort:n.Optional(tje)},{description:"Dashboard folder query request. Use filters, sorting, limit, and offset to page through visible dashboard folders."}),rje={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(use,{examples:[rje]});var pse=x({description:"Queries dashboard folders visible to the authenticated operation key. Returns all folders unless the `parentFolderId` filter is set: pass a folder ID to select the children of that folder, or null to return only top-level folders. Results are ordered by most recently updated folder first unless `sort` is set, and include the number of readable dashboards directly assigned to each folder. Use filters to narrow by owning team, name or ID substring, or tags.",operationId:"queryDashboardFolders",tags:["dashboard-folders"],url:`${FS}/query`,method:"POST",paginated:!0,body:use,response:n.Array(lse)}),mse=x({description:"Retrieves one dashboard folder by ID.",operationId:"getDashboardFolder",tags:["dashboard-folders"],url:`${FS}/:id`,method:"GET",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the dashboard folder to retrieve. Use the `id` returned by folder list, get, create, or update responses."})}),response:FC}),dse=x({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:FS,method:"POST",body:EF,response:FC}),fse=x({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:`${FS}/:id`,method:"PUT",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the dashboard folder to update. Use the `id` returned by folder list, get, create, or update responses."})}),body:EF,response:FC}),gse=x({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:`${FS}/:id`,method:"DELETE",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the dashboard folder to delete. Use the `id` returned by folder list, get, create, or update responses."})}),response:ae});var hse=_t({commandName:"dashboard-folders",description:"Manage dashboard folders",endpoints:{list:pse,get:mse,create:dse,update:fse,delete:gse},enableListBody:!0});var Aa="/v0/dashboards",Ese=["white","gray.100","amber.200","lime.200","emerald.200","cyan.200","blue.200","violet.200","fuchsia.200","pink.200","red.200"],nje=["bar","distribution","gauge","heatmap","list","pie","query-value","table","timeseries","top-list"],Mmr=[...nje,"note","slo"];var oje=["ns","us","ms","s","m","h","days"];var ije=["B","KB","MB","GB","TB","PB"];var sje=20;var Sse=n.Object({type:n.Literal("cpu",{description:"Normalizes values as CPU usage"})},{$id:"DataNormalizerCpu",title:"CPU"}),Tse=n.Object({type:n.Literal("duration",{description:"Normalizes values as durations using standard time units"}),unit:n.Enum(oje,{description:"Time unit used to present the normalized values"})},{$id:"DataNormalizerDuration",title:"Duration"}),bse=n.Object({type:n.Literal("data",{description:"Normalizes values as data sizes using byte units"}),unit:n.Enum(ije,{description:"Data size unit used to present the normalized values"})},{$id:"DataNormalizerData",title:"Data"}),xse=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"}),Ise=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"}),_se=n.Object({type:n.Literal("date",{description:"Formats values as calendar dates"})},{$id:"DataNormalizerDate",title:"Date"}),Ase=n.Object({type:n.Literal("level",{description:"Displays values using their log level name"})},{$id:"DataNormalizerLevel",title:"Level"}),Ose=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"}),aje=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"}),cje=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:sje})},{$id:"InputDataNormalizerCustom",title:"Custom"}),Eo=Q("type",[Tse,bse,xse,Ise,_se,Ase,Sse,Ose,aje],{title:"Normalizer",description:"Display-value formatter for widget values or list/table columns."}),So=Q("type",[Tse,bse,xse,Ise,_se,Ase,Sse,Ose,cje],{title:"Normalizer",description:"Display-value formatter for widget values or list/table columns."}),SF=n.Object({attribute:n.String({description:"Attribute (log field or database row column) displayed as a column in the list"}),normalizer:n.Optional(Eo)},{title:"WidgetListColumn",description:"List column pairing a displayed attribute with the formatting applied to its values."}),TF=n.Object({attribute:n.String({description:"Attribute (log field or database row column) displayed as a column in the list"}),normalizer:n.Optional(So)},{title:"WidgetListColumn",description:"List column pairing a displayed attribute with the formatting applied to its values."}),sg=["background","no-background"],lje=["table","legend-only","no-legend"];var uje=["greater_than","less_than","equal","not_equal","greater_than_or_equal","less_than_or_equal"],Cse=["alert","warning","success"],Oa=n.Object({operator:n.Enum(uje,{description:"Comparator used to evaluate the metric value"}),value:n.Number({description:"Threshold value used when evaluating the operator"}),color:n.Enum(Cse,{description:"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."}),pje=n.Object({value:n.Number({description:"Y-axis value where the threshold marker is placed"}),level:n.Enum(Cse,{description:"Level applied to the threshold marker"})},{title:"ThresholdMarker",description:"Marker line drawn across the chart at a fixed value, colored by its level."}),mje=["sec","min","hour","day"],gu=n.Object({time:n.Number({description:"Numeric count of `metric` units in each bucket. Required when `timeBucket` is present."}),metric:n.Enum(mje,{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 _a=n.Enum(["flex-start","center","flex-end"],{description:"Flex alignment keyword used for widget layout"}),ag=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."}),cg=n.Object({formula:n.Optional(f({type:"short",description:"Optional alias for formula (only used for display in the UI)"})),queries:n.Optional(n.Record(n.String(),f({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."}),GC={source:Ai,queries:wZ,formula:n.Optional(RO),aliases:n.Optional(ag),visibleSeries:n.Optional(n.Array(n.Boolean(),{description:"Flags indicating whether each query or formula series is visible"}))},BC={source:Ai,queries:sS,formula:n.Optional(zp),aliases:n.Optional(cg),visibleSeries:n.Optional(n.Array(n.Boolean(),{description:"Flags indicating whether each query or formula series is visible"}))},Ca=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)"})),lg={...GC,groupBy:n.Optional(Rf)},ug={...BC,groupBy:n.Optional(kc)},$r=n.Enum(lje,{description:"Controls whether and how the widget displays legend or series details (e.g. table, legend-only, or no legend)"}),Qt=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."})),Wi=n.Optional(n.Array(pje,{description:"Threshold markers displayed on the chart"})),dje="^https?:\\/\\/(?:[^\\s{}]|\\{\\{group\\.[^}\\s]+\\}\\})+$",Rse='Text of the entry added to the widget context menu. Defaults to "Open custom link" when omitted.',Pse="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.",$S=n.Object({label:n.Optional(n.String({description:Rse})),url:n.String({description:Pse})},{$id:"WidgetCustomLink",title:"CustomLink"}),GS=n.Object({label:n.Optional(f({allowEmpty:!1,description:Rse})),url:n.String({pattern:dje,maxLength:Zl,description:Pse})},{$id:"InputWidgetCustomLink",title:"CustomLink"}),fje=n.Object({name:n.String({description:"Display name of the table column"}),...GC,source:Ai,normalizer:n.Optional(Eo),precision:Qt},{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`."}),gje=n.Object({name:f({description:"Display name of the table column"}),...BC,source:Ai,normalizer:n.Optional(So),precision:Qt},{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`."}),hje=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."}),yje=n.Array(n.Object({id:f({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."}),bF=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, or connection list widgets. Users can still change sorting by selecting columns in the rendered list."}),xF=n.Array(n.Object({id:f({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, or connection list widgets. Users can still change sorting by selecting columns in the rendered list."}),wse=["horizontal","vertical"],Eje=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(SF,{description:"Custom columns to display for each log"})),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(bF)},{$id:"GraphVisualizationList",title:"List"}),Sje=n.Object({type:n.Literal("list",{description:"Displays matching logs in a tabular list"}),query:f({type:"tsuga-query",description:"Query that selects logs for the list"}),listColumns:n.Optional(n.Array(TF,{description:"Custom columns to display for each log"})),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(xF)},{$id:"InputGraphVisualizationList",title:"List"}),$C=Q("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"}),pg=n.Object({min:$C,max:$C,scale:Q("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."}),mg=n.Object({min:$C,max:$C,scale:Q("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."}),Tje=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"}),bje=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 xje=["regular","dashed"],dg=n.Record(n.String(),n.Object({groupId:n.String(),lineStyle:n.Enum(xje)}),{description:"Line style of each series, keyed by 1-based query index. The last index is the formula when there is one. For widgets with a single query, only the `1` entry is read and it applies to every series. Defaults to regular."}),Ije=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($r),thresholds:Wi,yAxisSettings:n.Optional(pg),lineStyleOptions:n.Optional(dg)},{$id:"GraphVisualizationTimeseriesConnection",title:"TimeseriesConnection"}),_je=n.Object({type:n.Literal("timeseries-connection",{description:"Displays the database rows-based aggregation as a time series chart"}),connectionId:f({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(f({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:n.Optional($r),thresholds:Wi,yAxisSettings:n.Optional(mg),lineStyleOptions:n.Optional(dg)},{$id:"InputGraphVisualizationTimeseriesConnection",title:"TimeseriesConnection"}),Aje=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(SF,{description:"Custom columns to display for each database row"})),listColumnsSize:n.Optional(n.Record(n.String(),n.Number({description:"List column width by column id"}),{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(bF)},{$id:"GraphVisualizationListConnection",title:"ListConnection"}),Oje=n.Object({type:n.Literal("list-connection",{description:"Displays database rows as a tabular list"}),connectionId:f({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),query:f({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),listColumns:n.Optional(n.Array(TF,{description:"Custom columns to display for each database row"})),listColumnsSize:n.Optional(n.Record(n.String(),n.Number({description:"List column width by column id"}),{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(xF)},{$id:"InputGraphVisualizationListConnection",title:"ListConnection"}),Cje=n.Object({type:n.Literal("top-list-connection",{description:"Displays the database rows-based aggregation as a ranked top list"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),queries:n.Array(n.String({description:"The read-only SQL query to execute against the connection."}))},{$id:"GraphVisualizationTopListConnection",title:"TopListConnection"}),Rje=n.Object({type:n.Literal("top-list-connection",{description:"Displays the database rows-based aggregation as a ranked top list"}),connectionId:f({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(f({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1})},{$id:"InputGraphVisualizationTopListConnection",title:"TopListConnection"}),Pje=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($r)},{$id:"GraphVisualizationPieConnection",title:"PieConnection"}),wje=n.Object({type:n.Literal("pie-connection",{description:"Displays the database rows-based aggregation as a pie chart"}),connectionId:f({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(f({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:n.Optional($r)},{$id:"InputGraphVisualizationPieConnection",title:"PieConnection"}),vje=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($r),thresholds:Wi,yAxisSettings:n.Optional(pg)},{$id:"GraphVisualizationBarConnection",title:"BarConnection"}),Uje=n.Object({type:n.Literal("bar-connection",{description:"Displays the database rows-based aggregation as a bar chart"}),connectionId:f({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(f({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:n.Optional($r),thresholds:Wi,yAxisSettings:n.Optional(mg)},{$id:"InputGraphVisualizationBarConnection",title:"BarConnection"}),Nje=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(sg,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(Oa,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"})),precision:Qt,normalizer:n.Optional(Eo),legendMode:n.Optional($r)},{$id:"GraphVisualizationQueryValueConnection",title:"QueryValueConnection"}),kje=n.Object({type:n.Literal("query-value-connection",{description:"Displays a single value computed by a SQL query against a database connection"}),connectionId:f({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(f({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),backgroundMode:n.Optional(n.Enum(sg,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(Oa,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"})),precision:Qt,normalizer:n.Optional(So),legendMode:n.Optional($r)},{$id:"InputGraphVisualizationQueryValueConnection",title:"QueryValueConnection"}),Lje=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(wse,{description:"Layout used to render log patterns"}))},{$id:"GraphVisualizationListLogPatterns",title:"ListLogPatterns"}),Mje=n.Object({type:n.Literal("list-log-patterns",{description:"Displays log patterns clustered from logs matching the query"}),query:f({type:"tsuga-query",description:"Tsuga query that selects logs to cluster into patterns"}),layout:n.Optional(n.Enum(wse,{description:"Layout used to render log patterns"}))},{$id:"InputGraphVisualizationListLogPatterns",title:"ListLogPatterns"}),Dje=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(SF,{description:"Custom columns to display for each span"})),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(bF)},{$id:"GraphVisualizationListSpans",title:"ListSpans"}),Fje=n.Object({type:n.Literal("list-spans",{description:"Displays matching trace spans in a tabular list"}),query:f({type:"tsuga-query",description:"Query that selects trace spans for the list"}),listColumns:n.Optional(n.Array(TF,{description:"Custom columns to display for each span"})),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(xF)},{$id:"InputGraphVisualizationListSpans",title:"ListSpans"}),BS=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."}),qS=n.Array(f({allowEmpty:!1,type:"long",description:"Raw PromQL expression for this widget."}),{minItems:1,description:"PromQL expressions configured for this widget."}),$je=n.Object({type:n.Literal("timeseries-promql",{description:"Displays PromQL metrics query-based aggregation as a time series chart"}),queries:BS,aliases:n.Optional(ag),timeBucket:n.Optional(gu),normalizer:n.Optional(Eo),precision:Qt,legendMode:n.Optional($r),thresholds:Wi,yAxisSettings:n.Optional(pg),smoothing:n.Optional(n.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"})),lineStyleOptions:n.Optional(dg)},{$id:"GraphVisualizationTimeseriesPromql",title:"TimeseriesPromql"}),Gje=n.Object({type:n.Literal("timeseries-promql",{description:"Displays PromQL metrics query-based aggregation as a time series chart"}),queries:qS,aliases:n.Optional(cg),timeBucket:n.Optional(gu),normalizer:n.Optional(So),precision:Qt,legendMode:n.Optional($r),thresholds:Wi,yAxisSettings:n.Optional(mg),smoothing:n.Optional(n.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"})),lineStyleOptions:n.Optional(dg)},{$id:"InputGraphVisualizationTimeseriesPromql",title:"TimeseriesPromql"}),Bje=n.Object({type:n.Literal("query-value-promql",{description:"Configures a PromQL metrics query-based aggregation as a single value"}),queries:BS,aliases:n.Optional(ag),backgroundMode:n.Optional(n.Enum(sg,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(Oa,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"})),precision:Qt,normalizer:n.Optional(Eo),legendMode:n.Optional($r)},{$id:"GraphVisualizationQueryValuePromql",title:"QueryValuePromql"}),qje=n.Object({type:n.Literal("query-value-promql",{description:"Configures a PromQL metrics query-based aggregation as a single value"}),queries:qS,aliases:n.Optional(cg),backgroundMode:n.Optional(n.Enum(sg,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(Oa,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"})),precision:Qt,normalizer:n.Optional(So),legendMode:n.Optional($r)},{$id:"InputGraphVisualizationQueryValuePromql",title:"QueryValuePromql"}),jje=n.Object({type:n.Literal("top-list-promql",{description:"Displays PromQL metrics query-based aggregation as a ranked top list"}),queries:BS,aliases:n.Optional(ag),normalizer:n.Optional(Eo),precision:Qt,conditions:n.Optional(n.Array(Oa,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"}))},{$id:"GraphVisualizationTopListPromql",title:"TopListPromql"}),Hje=n.Object({type:n.Literal("top-list-promql",{description:"Displays PromQL metrics query-based aggregation as a ranked top list"}),queries:qS,aliases:n.Optional(cg),normalizer:n.Optional(So),precision:Qt,conditions:n.Optional(n.Array(Oa,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"}))},{$id:"InputGraphVisualizationTopListPromql",title:"TopListPromql"}),Kje=n.Object({type:n.Literal("pie-promql",{description:"Displays PromQL metrics query-based aggregation as a pie chart"}),queries:BS,aliases:n.Optional(ag),normalizer:n.Optional(Eo),precision:Qt,legendMode:n.Optional($r)},{$id:"GraphVisualizationPiePromql",title:"PiePromql"}),zje=n.Object({type:n.Literal("pie-promql",{description:"Displays PromQL metrics query-based aggregation as a pie chart"}),queries:qS,aliases:n.Optional(cg),normalizer:n.Optional(So),precision:Qt,legendMode:n.Optional($r)},{$id:"InputGraphVisualizationPiePromql",title:"PiePromql"}),Yje=n.Object({type:n.Literal("bar-promql",{description:"Displays PromQL metrics query-based aggregation as a bar chart"}),queries:BS,aliases:n.Optional(ag),timeBucket:n.Optional(gu),precision:Qt,normalizer:n.Optional(Eo),thresholds:Wi,legendMode:n.Optional($r),yAxisSettings:n.Optional(pg)},{$id:"GraphVisualizationBarPromql",title:"BarPromql"}),Vje=n.Object({type:n.Literal("bar-promql",{description:"Displays PromQL metrics query-based aggregation as a bar chart"}),queries:qS,aliases:n.Optional(cg),timeBucket:n.Optional(gu),precision:Qt,normalizer:n.Optional(So),thresholds:Wi,legendMode:n.Optional($r),yAxisSettings:n.Optional(mg)},{$id:"InputGraphVisualizationBarPromql",title:"BarPromql"}),Qje=n.Object({type:n.Literal("timeseries",{description:"Displays the aggregation as a time series chart"}),...lg,groupByMode:Ca,timeBucket:n.Optional(gu),normalizer:n.Optional(Eo),precision:Qt,legendMode:n.Optional($r),thresholds:Wi,yAxisSettings:n.Optional(pg),smoothing:n.Optional(n.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"})),lineStyleOptions:n.Optional(dg),customLink:n.Optional($S)},{$id:"GraphVisualizationTimeseries",title:"Timeseries"}),Wje=n.Object({type:n.Literal("timeseries",{description:"Displays the aggregation as a time series chart"}),...ug,groupByMode:Ca,timeBucket:n.Optional(gu),normalizer:n.Optional(So),precision:Qt,legendMode:n.Optional($r),thresholds:Wi,yAxisSettings:n.Optional(mg),smoothing:n.Optional(n.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"})),lineStyleOptions:n.Optional(dg),customLink:n.Optional(GS)},{$id:"InputGraphVisualizationTimeseries",title:"Timeseries"}),vse="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.",Jje=n.Object({type:n.Literal("top-list",{description:"Displays the aggregation as a ranked list of top results"}),...lg,groupByMode:Ca,normalizer:n.Optional(Eo),precision:Qt,conditions:n.Optional(n.Array(Oa,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"})),isStacked:n.Optional(n.Boolean({description:vse})),customLink:n.Optional($S)},{$id:"GraphVisualizationTopList",title:"TopList"}),Zje=n.Object({type:n.Literal("top-list",{description:"Displays the aggregation as a ranked list of top results"}),...ug,groupByMode:Ca,normalizer:n.Optional(So),precision:Qt,conditions:n.Optional(n.Array(Oa,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"})),isStacked:n.Optional(n.Boolean({description:vse})),customLink:n.Optional(GS)},{$id:"InputGraphVisualizationTopList",title:"TopList"}),Xje=n.Object({type:n.Literal("pie",{description:"Displays the aggregation as a pie chart"}),...lg,groupByMode:Ca,normalizer:n.Optional(Eo),precision:Qt,legendMode:n.Optional($r),customLink:n.Optional($S)},{$id:"GraphVisualizationPie",title:"Pie"}),e2e=n.Object({type:n.Literal("pie",{description:"Displays the aggregation as a pie chart"}),...ug,groupByMode:Ca,normalizer:n.Optional(So),precision:Qt,legendMode:n.Optional($r),customLink:n.Optional(GS)},{$id:"InputGraphVisualizationPie",title:"Pie"}),t2e=n.Object({type:n.Literal("query-value",{description:"Displays the aggregation as a single value"}),...GC,backgroundMode:n.Optional(n.Enum(sg,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(Oa,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"})),precision:Qt,normalizer:n.Optional(Eo),legendMode:n.Optional($r)},{$id:"GraphVisualizationQueryValue",title:"QueryValue"}),r2e=n.Object({type:n.Literal("query-value",{description:"Displays the aggregation as a single value"}),...BC,backgroundMode:n.Optional(n.Enum(sg,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(Oa,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"})),precision:Qt,normalizer:n.Optional(So),legendMode:n.Optional($r)},{$id:"InputGraphVisualizationQueryValue",title:"QueryValue"}),n2e=n.Object({type:n.Literal("bar",{description:"Displays the aggregation as a bar chart"}),...lg,groupByMode:Ca,timeBucket:n.Optional(gu),precision:Qt,normalizer:n.Optional(Eo),thresholds:Wi,legendMode:n.Optional($r),yAxisSettings:n.Optional(pg),customLink:n.Optional($S)},{$id:"GraphVisualizationBar",title:"Bar"}),o2e=n.Object({type:n.Literal("bar",{description:"Displays the aggregation as a bar chart"}),...ug,groupByMode:Ca,timeBucket:n.Optional(gu),precision:Qt,normalizer:n.Optional(So),thresholds:Wi,legendMode:n.Optional($r),yAxisSettings:n.Optional(mg),customLink:n.Optional(GS)},{$id:"InputGraphVisualizationBar",title:"Bar"}),Use='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.',Nse=n.String({description:Use}),kse=f({description:Use}),i2e=n.Object({type:n.Literal("distribution",{description:"Displays the aggregation as a distribution chart"}),...lg,group:n.Optional(Nse),precision:Qt,normalizer:n.Optional(Eo),percentileMarkers:n.Optional(Tje),boundsScale:n.Optional(CO)},{$id:"GraphVisualizationDistribution",title:"Distribution"}),s2e=n.Object({type:n.Literal("distribution",{description:"Displays the aggregation as a distribution chart"}),...ug,group:n.Optional(kse),precision:Qt,normalizer:n.Optional(So),percentileMarkers:n.Optional(bje),boundsScale:n.Optional(CO)},{$id:"InputGraphVisualizationDistribution",title:"Distribution"}),Lse=["red","pink","violet","blue","cyan","green","yellow","orange"],Mse=n.Enum(Lse,{description:"Color palette used to render the heatmap intensity gradient"}),a2e=n.Object({type:n.Literal("heatmap",{description:"Displays the aggregation as a heatmap chart"}),...lg,group:n.Optional(Nse),precision:Qt,normalizer:n.Optional(Eo),palette:n.Optional(Mse)},{$id:"GraphVisualizationHeatmap",title:"Heatmap"}),c2e=n.Object({type:n.Literal("heatmap",{description:"Displays the aggregation as a heatmap chart"}),...ug,group:n.Optional(kse),precision:Qt,normalizer:n.Optional(So),palette:n.Optional(Mse)},{$id:"InputGraphVisualizationHeatmap",title:"Heatmap"}),Dse=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(Lse,{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."}),l2e=n.Object({type:n.Literal("gauge",{description:"Displays the aggregation as a gauge"}),...GC,max:n.Optional(n.Number({description:"Gauge maximum value, on the raw query value before the unit is applied"})),colorThresholds:n.Optional(n.Array(Dse,{description:"Color thresholds inside the gauge range, on the raw query value before the unit is applied"})),precision:Qt,normalizer:n.Optional(Eo)},{$id:"GraphVisualizationGauge",title:"Gauge"}),u2e=n.Object({type:n.Literal("gauge",{description:"Displays the aggregation as a gauge"}),...BC,max:n.Optional(n.Number({description:"Gauge maximum value, on the raw query value before the unit is applied"})),colorThresholds:n.Optional(n.Array(Dse,{description:"Color thresholds inside the gauge range, on the raw query value before the unit is applied"})),precision:Qt,normalizer:n.Optional(So)},{$id:"InputGraphVisualizationGauge",title:"Gauge"}),p2e=n.Object({type:n.Literal("table",{description:"Displays the aggregation as a table with multi-level grouping"}),columns:n.Array(fje,{description:"Each column defines an independent aggregation displayed as a table column"}),groupBy:n.Optional(Rf),groupByMode:Ca,defaultSorting:n.Optional(hje),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($S)},{$id:"GraphVisualizationTable",title:"Table"}),m2e=n.Object({type:n.Literal("table",{description:"Displays the aggregation as a table with multi-level grouping"}),columns:n.Array(gje,{minItems:1,description:"Each column defines an independent aggregation displayed as a table column"}),groupBy:n.Optional(kc),groupByMode:Ca,defaultSorting:n.Optional(yje),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(GS)},{$id:"InputGraphVisualizationTable",title:"Table"}),d2e=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(Ese,{description:"Background color used to render the note"})),noteAlign:n.Optional(_a),noteJustifyContent:n.Optional(_a)},{$id:"GraphVisualizationNote",title:"Note"}),f2e=n.Object({type:n.Literal("note",{description:"Displays static text on the dashboard"}),note:n.Optional(f({type:"long",description:"Markdown-compatible text shown in the note"})),noteColor:n.Optional(n.Enum(Ese,{description:"Background color used to render the note"})),noteAlign:n.Optional(_a),noteJustifyContent:n.Optional(_a)},{$id:"InputGraphVisualizationNote",title:"Note"}),g2e=n.Object({type:n.Literal("slo-uptime",{description:"Displays the SLI percentage of an SLO computed over the dashboard time range, colored against the SLO target. Experimental."}),sloId:n.String({description:"Id of the SLO to display"})},{$id:"GraphVisualizationSloUptime",title:"SloUptime"}),h2e=n.Object({type:n.Literal("slo-uptime",{description:"Displays the SLI percentage of an SLO computed over the dashboard time range, colored against the SLO target. Experimental."}),sloId:f({allowEmpty:!1,description:"Id of the SLO to display"})},{$id:"InputGraphVisualizationSloUptime",title:"SloUptime"}),y2e=n.Object({type:n.Literal("slo-over-time",{description:"Displays the good and bad events, or the per-slice status, of an SLO over the dashboard time range. Experimental."}),sloId:n.String({description:"Id of the SLO to display"})},{$id:"GraphVisualizationSloOverTime",title:"SloOverTime"}),E2e=n.Object({type:n.Literal("slo-over-time",{description:"Displays the good and bad events, or the per-slice status, of an SLO over the dashboard time range. Experimental."}),sloId:f({allowEmpty:!1,description:"Id of the SLO to display"})},{$id:"InputGraphVisualizationSloOverTime",title:"SloOverTime"}),S2e=Q("type",[Ije,Aje,Cje,Pje,vje,Nje,$je,Bje,jje,Kje,Yje,Qje,Jje,Xje,t2e,l2e,n2e,i2e,a2e,p2e,Eje,d2e,Lje,Dje,g2e,y2e],{description:"Widget visualization configuration. The `type` discriminator selects the widget kind and its required fields."}),Fse=Q("type",[_je,Oje,Rje,wje,Uje,kje,Gje,qje,Hje,zje,Vje,Wje,Zje,e2e,r2e,u2e,o2e,s2e,c2e,m2e,Sje,f2e,Mje,Fje,h2e,E2e],{description:"Widget visualization configuration. The `type` discriminator selects the widget kind and its required fields."}),IF=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 ${JZ}\xD7${ZZ} (width\xD7height) grid units, except note widgets which can go down to 1\xD71.`}),qC=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(_a),descriptionJustifyContent:n.Optional(_a),visualization:S2e,layout:n.Optional(IF)},{title:"Graph",description:"Single dashboard widget, combining its identity, its visualization configuration, and its position on the dashboard grid."}),T2e=n.Object({id:f({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(f({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(_a),descriptionJustifyContent:n.Optional(_a),visualization:Fse,layout:n.Optional(IF)},{title:"Graph",description:"Single dashboard widget, combining its identity, its visualization configuration, and its position on the dashboard grid."}),_F=n.Object({name:Ut(f(),{description:"Display name of the graph widget. Pass null to remove it."}),description:Ut(n.String({minLength:1,maxLength:800}),{description:"Text shown with the graph widget. Pass null to remove it."}),descriptionAlign:Ut(_a,{description:"Vertical alignment of the description. Pass null to remove it."}),descriptionJustifyContent:Ut(_a,{description:"Horizontal alignment of the description. Pass null to remove it."}),visualization:n.Optional(Fse),layout:Ut(IF,{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."}),yse=10,b2e=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."}),x2e=n.Array(n.Object({key:f({description:"Dashboard-wide filter key, usually a telemetry attribute name."}),values:n.Array(f({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:yse,description:`Dashboard-wide filters applied to every widget on the dashboard. Up to ${yse} filters are allowed.`}),fg=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(qC,{description:"Ordered widgets that compose the dashboard"}),filters:n.Optional(b2e),createdAt:H({description:"Timestamp when Tsuga created the dashboard."}),updatedAt:H({description:"Timestamp when Tsuga last updated the dashboard."}),creator:n.Optional(Qe),updater:n.Optional(Qe),tags:br,timePreset:n.Optional(n.Enum(kL,{description:"Relative time preset used 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."}))}),jC=n.Object({name:f({description:"Display name of the dashboard."}),owner:f({allowEmpty:!1,description:"ID of the team that owns the dashboard. Required and used for dashboard access control."}),graphs:n.Array(T2e,{description:"Ordered widgets that compose the dashboard"}),filters:n.Optional(x2e),tags:wr,timePreset:n.Optional(n.Enum(kL,{description:"Relative time preset used when opening the dashboard. Optional; create defaults to `past-30-minutes` when omitted, and update omission preserves the current value."})),folderId:n.Optional(n.Union([n.Null(),f({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."}))}),ws={IS_FAVORITE:"isFavorite",OWNER:"owner",TAGS:"tags",WIDGET_COUNT:"widgetCount",UPDATED_AT:"updatedAt",NAME:"name"},$se=[ws.OWNER,ws.TAGS,ws.WIDGET_COUNT,ws.UPDATED_AT,ws.NAME],gm=n.Partial(n.Object({owners:qe(f({allowEmpty:!1}),{description:"Restrict results to dashboards owned by any of these team IDs",maxItems:50}),searchQuery:n.Object({value:f({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:qe(Fn.items,{description:"Restrict results to dashboards that have at least one of the listed key/value tags",maxItems:50}),folderId:n.Union([n.Null(),f({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"})),I2e=n.Partial(n.Object({...je,filters:gm,sort:n.Object({by:n.Enum([ws.IS_FAVORITE,ws.OWNER,ws.TAGS,ws.WIDGET_COUNT,ws.UPDATED_AT,ws.NAME],{description:"Field to sort the returned dashboards by"}),direction:Le},{description:"Optional sorting applied to the returned dashboards"})})),Dmr=x({tags:["dashboards"],url:`${Aa}/query`,method:"POST",paginated:!0,response:n.Array(fg),body:I2e}),Fmr=x({tags:["dashboards"],url:`${Aa}/tags/query`,method:"POST",body:n.Object({filters:n.Optional(n.Omit(gm,["tags"]))}),response:Dn}),$mr=x({tags:["dashboards"],url:`${Aa}/counts/query`,method:"POST",body:n.Object({filters:n.Optional(n.Partial(gm))}),response:n.Object({all:n.Integer({description:"Total number of dashboards matching the filters that the user can read."})})}),Gmr=x({tags:["dashboards"],url:`${Aa}/:id`,method:"GET",params:n.Object({id:f()}),response:fg}),Bmr=x({tags:["dashboards"],url:Aa,method:"POST",body:jC,response:fg}),qmr=x({tags:["dashboards"],url:`${Aa}/:id`,method:"PATCH",params:n.Object({id:f()}),body:n.Partial(jC),response:fg}),_2e=_i(gm,{maxIds:100}),jmr=x({tags:["dashboards"],url:`${Aa}/bulk-update`,method:"PUT",body:n.Object({selection:_2e,owner:n.Optional(f({allowEmpty:!1,description:"Owning team ID to apply to every dashboard. Optional when folderId is provided; omit to keep the current owner."})),folderId:Ut(f({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({})}),Hmr=x({tags:["dashboards"],url:`${Aa}/:id`,method:"DELETE",params:n.Object({id:f()}),response:ae}),A2e=x({tags:["dashboards"],url:`${Aa}/:id/graphs/:graphId`,method:"PATCH",params:n.Object({id:f({allowEmpty:!1}),graphId:f({allowEmpty:!1})}),body:_F,response:qC}),Kmr=V7(A2e),O2e=_i(gm),zmr=x({tags:["dashboards"],url:`${Aa}/bulk-delete`,method:"DELETE",body:n.Object({selection:O2e}),response:n.Object({})});var gg=`/${"v1"}/dashboards`,jS=n.Pick(fg,["id","name","owner","graphs","filters","tags","timePreset","folderId"],{$id:"Dashboard",description:"Saved visualization made of dashboard-wide filters and ordered graphs. Use dashboards to preserve reusable views for a team or workflow. See [Dashboards](/documentation/visualize/dashboards/index)."}),C2e={id:"123-456-abc",name:"API Performance Overview",owner:"team-123-abc",graphs:[{id:"789-abc-def",name:"Request Latency P99",visualization:{type:"timeseries",source:"metrics",queries:[{aggregate:{type:"percentile",field:"duration",percentile:99},filter:"service:api-gateway"}]},layout:{x:0,y:0,w:6,h:4}}],filters:[{key:"env",values:["production"]}],tags:[{key:"team",value:"platform"}],timePreset:"past-1-hour"};Object.assign(jS,{examples:[C2e]});var R2e=n.Object({by:n.Enum([...$se],{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:Le},{description:"Optional sorting applied to the returned dashboards"}),Gse=n.Object({...er,filters:n.Optional(n.Pick(gm,["owners","searchQuery","tags","folderId"])),sort:n.Optional(R2e)},{description:"Dashboard query request. Use filters, sorting, limit, and offset to page through visible dashboards."}),P2e={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(Gse,{examples:[P2e]});var Bse=x({description:"Queries dashboards visible to the authenticated operation key. Use this endpoint to build dashboard inventories or synchronize dashboard metadata. Pagination fields limit the returned page; use the response metadata to request additional pages. See [Dashboards](/documentation/visualize/dashboards/index).",operationId:"queryDashboards",tags:["dashboards"],url:`${gg}/query`,method:"POST",paginated:!0,body:Gse,response:n.Array(jS)}),qse=x({description:"Retrieves one dashboard by ID.",operationId:"getDashboard",tags:["dashboards"],url:`${gg}/:id`,method:"GET",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the saved dashboard to retrieve. Use the `id` returned by dashboard query, create, or update responses."})}),response:jS}),AF=n.Pick(jC,["name","owner","graphs","filters","tags","timePreset","folderId"],{description:"Dashboard create or update request. Provide the dashboard identity, owner team, widgets, filters, tags, and optional time preset."}),jse={name:"API Performance Overview",owner:"team-123-abc",graphs:[{id:"789-abc-def",name:"Request Latency P99",visualization:{type:"timeseries",source:"metrics",queries:[{aggregate:{type:"percentile",field:"duration",percentile:99},filter:"service:api-gateway"}]},layout:{x:0,y:0,w:6,h:4}}],filters:[{key:"env",values:["production"]}],tags:[{key:"team",value:"platform"}],timePreset:"past-1-hour",folderId:null};Object.assign(AF,{examples:[jse]});var Hse=n.Object(_F.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."}),w2e={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(Hse,{examples:[w2e]});var Kse=x({description:"Creates a dashboard owned by the specified team. Use this to provision dashboards from automation or templates. The response returns the saved dashboard definition.",operationId:"createDashboard",tags:["dashboards"],url:gg,method:"POST",body:AF,response:jS}),zse=x({description:"Updates an existing dashboard by ID. Fields are patched from the request body; omitted fields keep their current values.",operationId:"updateDashboard",tags:["dashboards"],url:`${gg}/:id`,method:"PUT",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the saved dashboard to update. Use the `id` returned by dashboard query, get, or create responses."})}),body:n.Partial(AF,{examples:[jse]}),response:jS}),v2e=n.Object({id:f({allowEmpty:!1,description:"Identifier of the saved dashboard to delete. Use the `id` returned by dashboard query, get, create, or update responses."})}),Yse=x({description:"Deletes a dashboard by ID. Use only after confirming no users or automation still rely on the dashboard.",operationId:"deleteDashboard",tags:["dashboards"],url:`${gg}/:id`,method:"DELETE",params:v2e,response:ae}),edr=x({description:"Updates one graph inside a dashboard without replacing the full dashboard. Use this for targeted widget edits when you already know the dashboard ID and graph ID. Fields are patched from the request body; omitted fields keep their current values and null clears them.",operationId:"updateDashboardGraph",tags:["dashboards"],url:`${gg}/:id/graphs/:graphId`,method:"PUT",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the dashboard that contains the graph to update. Use the `id` returned by dashboard responses."}),graphId:f({allowEmpty:!1,description:"Identifier of the graph to update within the dashboard. Use graph IDs from the dashboard response."})}),body:Hse,response:qC});var Vse=_t({commandName:"dashboards",description:"Manage dashboards",endpoints:{list:Bse,get:qse,create:Kse,update:zse,delete:Yse},enableListBody:!0});var Qse=100,HS=3,hg=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:Dn,teamOverrideFields:n.Optional(n.Array(n.String(),{description:"Telemetry attribute names used to override ownership for data sent with this key."})),updatedAt:H({description:"Timestamp when Tsuga last updated the key metadata."}),createdAt:H({description:"Timestamp when Tsuga created the key."}),creator:n.Optional(Qe),updater:n.Optional(Qe),assetUpdatedAt:H({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})}),KS=n.Object({name:n.String({format:Jl,minLength:1,maxLength:Qse,description:`Kebab-case name for the ingestion API key. Maximum length is ${Qse} characters.`}),owner:f({allowEmpty:!1,description:"Team ID that will own and manage the ingestion API key."}),tags:Fn,teamOverrideFields:n.Union([n.Array(f({allowEmpty:!1}),{minItems:1,maxItems:HS,description:`Array form. Up to ${HS} fields are allowed.`}),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."})}),yg="/v0/ingestion-api-keys",mdr=x({tags:["ingestion-api-keys"],url:yg,method:"POST",body:KS,response:n.Intersect([hg,n.Object({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."})})])}),ddr=x({tags:["ingestion-api-keys"],url:yg,method:"GET",paginated:!0,query:n.Object(je),response:n.Array(hg)}),fdr=x({tags:["ingestion-api-keys"],url:`${yg}/:id`,method:"GET",params:n.Object({id:f({allowEmpty:!1})}),response:hg}),gdr=x({tags:["ingestion-api-keys"],url:`${yg}/:id`,method:"PUT",params:n.Object({id:f({allowEmpty:!1})}),body:KS,response:hg}),hdr=x({tags:["ingestion-api-keys"],url:`${yg}/:id`,method:"DELETE",params:n.Object({id:f({allowEmpty:!1})}),response:ae}),ydr=x({tags:["ingestion-api-keys"],url:`${yg}/bulk-delete`,method:"DELETE",body:n.Object({ids:n.Array(f({allowEmpty:!1}),{uniqueItems:!0})}),response:n.Object({})});var zS=`/${"v1"}/ingestion-api-keys`,YS=n.Pick(hg,["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)."}),Wse={id:"123-456-abc",name:"production-logs-ingestion",keyLastCharacters:"x7Qm",owner:"team-123-abc",tags:[{key:"env",value:"production"}],teamOverrideFields:["service"]};Object.assign(YS,{examples:[Wse]});var Jse=n.Pick(KS,["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."}),Zse=n.Pick(KS,["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."}),Xse={name:"production-logs-ingestion",owner:"team-123-abc",tags:[{key:"env",value:"production"}],teamOverrideFields:["service"]};Object.assign(Jse,{examples:[Xse]});Object.assign(Zse,{examples:[Xse]});var U2e={...Wse,key:"tsuga_in:v1:abc123xyx7Qm"},eae=x({description:"Lists ingestion API keys visible to the authenticated operation key. Use this to inventory telemetry intake keys, owners, tags, and team override fields. Pagination fields limit the returned page.",operationId:"listIngestionApiKeys",tags:["ingestion-api-keys"],url:zS,method:"GET",paginated:!0,query:n.Object(er),response:n.Array(YS)}),Adr=x({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:`${zS}/:id`,method:"GET",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the ingestion API key to retrieve. Use the `id` returned by ingestion API key list or create responses."})}),response:YS}),N2e=n.Intersect([n.Pick(YS,["id","name","keyLastCharacters","owner","tags","teamOverrideFields"]),n.Object({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:U2e}),tae=x({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:zS,method:"POST",body:Jse,response:N2e}),rae=x({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:`${zS}/:id`,method:"PUT",params:n.Object({id:f({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:Zse,response:YS}),nae=x({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:`${zS}/:id`,method:"DELETE",params:n.Object({id:f({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:ae});var oae=_t({commandName:"ingestion-api-keys",description:"Manage ingestion API keys",singularOverride:"ingestion API key",pluralOverride:"ingestion API keys",endpoints:{list:eae,create:tae,update:rae,delete:nae}});var VS="/v0/investigations",k2e=["dashboard","monitor","service","slo","log-route","adaptive-notification-rule"],L2e=n.Object({type:n.String({description:'Kind of linked asset, e.g. "dashboard"'}),id:n.String({description:"Identifier of the linked asset"})}),M2e=n.Object({type:n.Enum(k2e,{description:"Kind of linked asset"}),id:f({allowEmpty:!1,description:"Identifier of the linked asset"})}),jc=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:br,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(L2e,{description:"Assets (dashboards, monitors, \u2026) referenced by this investigation"}),creator:n.Optional(Qe),updater:n.Optional(Qe),createdAt:H({description:"Timestamp the investigation was created at."}),updatedAt:H({description:"Timestamp the investigation was last updated at."})},{title:"Investigation"}),QS=n.Object({name:f({allowEmpty:!1,description:"Human readable name shown for the investigation"}),slug:f({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:Ut(f({type:"long"}),{description:"Markdown content capturing the investigation notes and findings"}),tags:wr,owner:f({allowEmpty:!1,description:"Team ID owning the investigation"}),env:Ut(f({allowEmpty:!0}),{description:"Environment the investigation relates to"}),linkedAssets:n.Optional(n.Array(M2e,{maxItems:100,description:"Assets (dashboards, monitors, \u2026) referenced by this investigation"}))}),D2e={name:"Payments 5xx spike",slug:"incident-2024-06-payments-5xx",contentMd:`## Summary
|
|
256
256
|
|
|
257
257
|
Checkout returned 5xx for 12 minutes after the payments-api rollout.
|
|
258
258
|
|
|
@@ -265,7 +265,7 @@ Checkout returned 5xx for 12 minutes after the payments-api rollout.
|
|
|
265
265
|
|
|
266
266
|
## Resolution
|
|
267
267
|
|
|
268
|
-
- Rolled back the payments-api deployment and confirmed the error rate returned to baseline.`,tags:[{key:"team",value:"platform"}],owner:"team-123-abc",env:"prod",linkedAssets:[{type:"monitor",id:"monitor-123-abc"},{type:"dashboard",id:"dashboard-123-abc"}]};Object.assign(HC,{examples:[F2e]});var Ddr=x({tags:["investigations"],url:VS,method:"GET",paginated:!0,query:n.Object(je),response:n.Array(jc)}),Fdr=x({tags:["investigations"],url:`${VS}/:id`,params:n.Object({id:f()}),method:"GET",response:jc}),$dr=x({tags:["investigations"],url:VS,method:"POST",body:QS,response:jc}),Gdr=x({tags:["investigations"],url:`${VS}/:id`,method:"PUT",body:HC,params:n.Object({id:f()}),response:jc}),Bdr=x({tags:["investigations"],url:`${VS}/:id`,method:"DELETE",params:n.Object({id:f()}),response:ae});var WS=`/${"v1"}/investigations`,iae=x({description:"Retrieve all investigations",tags:["private"],url:WS,method:"GET",paginated:!0,query:n.Object(er),response:n.Array(jc)}),sae=x({description:"Retrieve an investigation by its id",tags:["private"],url:`${WS}/:id`,method:"GET",params:n.Object({id:f({allowEmpty:!1})}),response:jc}),aae=x({description:"Create a new investigation",tags:["private"],url:WS,method:"POST",body:QS,response:jc}),cae=x({description:"Update an investigation by its id",tags:["private"],url:`${WS}/:id`,method:"PUT",body:HC,params:n.Object({id:f({allowEmpty:!1})}),response:jc}),lae=x({description:"Delete an investigation by its id",tags:["private"],url:`${WS}/:id`,method:"DELETE",params:n.Object({id:f({allowEmpty:!1})}),response:ae});var uae=_t({commandName:"investigations",description:"Manage investigations (beta)",endpoints:{list:iae,get:sae,create:aae,update:cae,delete:lae}});var pae=15,KC={id:n.String({description:"Unique identifier of the processor within the route. Used to preserve processor identity during updates."}),description:n.Optional(n.String({description:"Optional user-provided processor note."})),tags:br,updatedAt:n.Optional(H({description:"Timestamp when Tsuga last updated the processor."}))},zC={id:f({allowEmpty:!1,description:"Unique identifier of the processor within the route. Preserve it across updates for existing processors."}),description:n.Optional(f({type:"long",description:"Optional processor note."})),tags:wr,updatedAt:n.Optional(H({description:"Backend-maintained timestamp for this processor. Omit this field on create and update requests; Tsuga sets or preserves it based on processor changes."}))},mae={...KC,type:n.Literal("creator",{description:"Create processor. It writes a new attribute from a format string, formula, or category rule."})},dae={...zC,type:n.Literal("creator",{description:"Create processor. It writes a new attribute from a format string, formula, or category rule."})},$2e=Q("subtype",[n.Object({targetAttribute:n.String({description:"Attribute that will receive the formatted value"}),formatString:n.String({description:"Template string used to build the target attribute value"}),overrideTarget:n.Optional(n.Boolean({description:"Whether to overwrite the target attribute when it already exists. If omitted, route processing treats this as true."})),subtype:n.Literal("format-string",{description:"Builds a string from literal text and existing attribute values."}),replaceMissingByEmpty:n.Optional(n.Boolean({description:"Whether missing referenced attributes render as empty strings. If omitted, route processing treats this as true."}))},{$id:"ProcessorParamsCreatorFormatString"}),n.Object({targetAttribute:n.String({description:"Attribute that will receive the computed value"}),formula:n.String({description:"Mathematical formula evaluated to populate the target attribute"}),overrideTarget:n.Optional(n.Boolean({description:"Whether to overwrite the target attribute when it already exists. If omitted, route processing treats this as true."})),subtype:n.Literal("math-formula",{description:"Evaluates a mathematical expression and writes the numeric result."}),replaceMissingBy0:n.Optional(n.Boolean({description:"Whether missing referenced attributes evaluate as zero. If omitted, route processing treats this as true."}))},{$id:"ProcessorParamsCreatorMathFormula"}),n.Object({targetAttribute:n.String({description:"Attribute that will receive the category value"}),clauses:n.Array(n.Object({query:n.String({description:"Query that selects logs for this category clause. Clauses are evaluated in order."}),value:n.String({description:"String category value assigned when this clause matches."})}),{description:"Conditions evaluated in order to determine the category value. The first matching clause wins."}),defaultValue:n.Optional(n.String({description:"String category value used when no clause matches. If omitted and no clause matches, no category value is written."})),subtype:n.Literal("category",{description:"Assigns the first matching category value from ordered query clauses, with an optional default."})},{$id:"ProcessorParamsCreatorCategory"})],{description:"Create processor configuration. The `subtype` discriminator selects how the value written to `targetAttribute` is built and which fields are required."}),G2e=Q("subtype",[n.Object({targetAttribute:f({allowEmpty:!1,description:"Attribute that will receive the formatted value"}),formatString:f({allowEmpty:!1,type:"long",description:"Template string used to build the target attribute value"}),overrideTarget:n.Optional(n.Boolean({description:"Set to true to overwrite an existing target attribute value (defaults to true)"})),subtype:n.Literal("format-string",{description:"Builds a string from literal text and existing attribute values."}),replaceMissingByEmpty:n.Optional(n.Boolean({description:"Set to true for missing referenced attributes to render as empty strings. Defaults to true."}))},{$id:"InputProcessorParamsCreatorFormatString"}),n.Object({targetAttribute:f({allowEmpty:!1,description:"Attribute that will receive the computed value"}),formula:f({allowEmpty:!1,type:"long",description:"Mathematical formula evaluated to populate the target attribute"}),overrideTarget:n.Optional(n.Boolean({description:"Set to true to overwrite an existing target attribute value (defaults to true)"})),subtype:n.Literal("math-formula",{description:"Evaluates a mathematical expression and writes the numeric result."}),replaceMissingBy0:n.Optional(n.Boolean({description:"Set to true for missing referenced attributes to evaluate as zero. Defaults to true."}))},{$id:"InputProcessorParamsCreatorMathFormula"}),n.Object({targetAttribute:f({allowEmpty:!1,description:"Attribute that will receive the category value"}),clauses:n.Array(n.Object({query:f({allowEmpty:!1,type:"tsuga-query",description:"Query that selects logs for this category clause. Clauses are evaluated in order."}),value:f({allowEmpty:!1,description:"String category value assigned when this clause matches."})}),{minItems:1,maxItems:pae,description:"Conditions evaluated in order to determine the category value. The first matching clause wins."}),defaultValue:n.Optional(f({description:"String category value used when no clause matches. If omitted and no clause matches, no category value is written."})),subtype:n.Literal("category",{description:"Assigns the first matching category value from ordered query clauses, with an optional default."})},{$id:"InputProcessorParamsCreatorCategory"})],{description:"Create processor configuration. The `subtype` discriminator selects how the value written to `targetAttribute` is built and which fields are required."}),B2e=n.Object({...mae,params:$2e}),q2e=n.Object({...dae,params:G2e}),fae={...KC,type:n.Literal("mapper",{description:"Map processor. It moves, copies, or normalizes existing log attributes."})},gae={...zC,type:n.Literal("mapper",{description:"Map processor. It moves, copies, or normalizes existing log attributes."})},j2e=Q("subtype",[n.Object({attributes:n.Array(n.Object({originAttribute:n.String({description:"Attribute name to map to the target attribute"}),keepOrigin:n.Optional(n.Boolean({description:"Whether the source attribute is preserved after mapping. If omitted, route processing treats this as false."})),overrideTarget:n.Optional(n.Boolean({description:"Whether to overwrite the target attribute when it already exists. If omitted, route processing treats this as true."})),targetAttribute:n.String({description:"Attribute name that will receive the mapped value"})}),{description:"Mappings that map individual attributes to new targets"}),subtype:n.Literal("map-attributes",{description:"Copies or moves one or more source attributes to target attributes."})},{$id:"ProcessorParamsMapperMapAttributes"}),n.Object({attributeName:n.String({description:"Attribute whose value will determine the log level"}),subtype:n.Literal("map-level",{description:"Normalizes a severity or status attribute into Tsuga log levels."})},{$id:"ProcessorParamsMapperMapLevel"}),n.Object({attributeName:n.String({description:"Attribute whose value will determine the log timestamp"}),subtype:n.Literal("map-timestamp",{description:"Uses an event-time attribute as the log timestamp."})},{$id:"ProcessorParamsMapperMapTimestamp"})],{description:"Map processor configuration. The `subtype` discriminator selects whether existing attributes are copied or moved to new names, or used to set the log level or timestamp."}),H2e=Q("subtype",[n.Object({attributes:n.Array(n.Object({originAttribute:f({allowEmpty:!1,description:"Attribute name to map to the target attribute"}),keepOrigin:n.Optional(n.Boolean({description:"Preserve the source attribute after mapping (defaults to false)"})),overrideTarget:n.Optional(n.Boolean({description:"Overwrite the target attribute when it already exists (defaults to true)"})),targetAttribute:f({allowEmpty:!1,description:"Attribute name that will receive the mapped value"})}),{minItems:1,maxItems:50,description:"Mappings that map individual attributes to new targets"}),subtype:n.Literal("map-attributes",{description:"Copies or moves one or more source attributes to target attributes."})},{$id:"InputProcessorParamsMapperMapAttributes"}),n.Object({attributeName:f({allowEmpty:!1,description:"Attribute whose value will determine the log level"}),subtype:n.Literal("map-level",{description:"Normalizes a severity or status attribute into Tsuga log levels."})},{$id:"InputProcessorParamsMapperMapLevel"}),n.Object({attributeName:f({allowEmpty:!1,description:"Attribute whose value will determine the log timestamp"}),subtype:n.Literal("map-timestamp",{description:"Uses an event-time attribute as the log timestamp."})},{$id:"InputProcessorParamsMapperMapTimestamp"})],{description:"Map processor configuration. The `subtype` discriminator selects whether existing attributes are copied or moved to new names, or used to set the log level or timestamp."}),K2e=n.Object({...gae,params:H2e}),z2e=n.Object({...fae,params:j2e}),hae={...KC,type:n.Literal("parse-attribute",{description:"Parse processor. It extracts structured fields from a text attribute."})},yae={...zC,type:n.Literal("parse-attribute",{description:"Parse processor. It extracts structured fields from a text attribute."})},Eae=5,Y2e=Q("subtype",[n.Object({attributeName:n.String({description:"Attribute whose value will be parsed with Grok rules"}),rules:n.Array(n.String({description:"Grok rule applied to parse text. Route processing sends rules as engine patterns."}),{description:"Ordered Grok rules evaluated until one matches."}),samples:n.Optional(n.Array(n.String(),{description:"Example log lines for validating the Grok rules. Samples are not sent to the ingestion engine."})),subtype:n.Literal("grok",{description:"Extracts fields from unstructured text using ordered Grok rules."})}),n.Object({sourceAttribute:n.String({description:"Attribute containing the URL to parse"}),subtype:n.Literal("url",{description:"Parses a URL attribute and writes URL detail fields."})}),n.Object({sourceAttribute:n.String({description:"Attribute containing the user agent string to parse"}),subtype:n.Literal("user-agent",{description:"Parses a user-agent string and writes browser, operating system, and device details."})}),n.Object({sourceAttribute:n.String({description:"Attribute containing the key/value string segment to parse"}),targetAttribute:n.String({description:"Target map attribute where extracted key/value pairs will be written"}),keyValueSplitter:n.String({description:"Delimiter separating keys from values in the source string"}),pairsSplitter:n.String({description:"Delimiter separating each key/value pair in the source string."}),acceptStandaloneKey:n.Boolean({description:"Whether keys without explicit values are accepted by the parser."}),subtype:n.Literal("key-value",{description:"Parses delimited key/value text into attributes."})})],{description:"Parse processor configuration. The `subtype` discriminator selects which parser reads the source text attribute and which fields it extracts."}),V2e=Q("subtype",[n.Object({attributeName:f({allowEmpty:!1,description:"Attribute whose value will be parsed with Grok rules"}),rules:n.Array(f({allowEmpty:!1,type:"long",description:"Grok rule applied to parse text. Route processing sends rules as engine patterns."}),{minItems:1,maxItems:5,description:"Ordered Grok rules evaluated until one matches."}),samples:n.Optional(n.Array(f({type:"long"}),{maxItems:Eae,description:"Example log lines for validating the Grok rules. Samples are not sent to the ingestion engine."})),subtype:n.Literal("grok",{description:"Extracts fields from unstructured text using ordered Grok rules."})}),n.Object({sourceAttribute:f({allowEmpty:!1,description:"Attribute containing the URL to parse"}),subtype:n.Literal("url",{description:"Parses a URL attribute and writes URL detail fields."})}),n.Object({sourceAttribute:f({allowEmpty:!1,description:"Attribute containing the user agent string to parse"}),subtype:n.Literal("user-agent",{description:"Parses a user-agent string and writes browser, operating system, and device details."})}),n.Object({sourceAttribute:f({allowEmpty:!1,description:"Attribute containing the key/value string segment to parse"}),targetAttribute:f({description:"Target map attribute where extracted key/value pairs will be written"}),keyValueSplitter:f({allowEmpty:!1,description:"Delimiter separating keys from values in the source string"}),pairsSplitter:f({allowEmpty:!0,description:"Delimiter separating each key/value pair in the source string."}),acceptStandaloneKey:n.Boolean({description:"Set to true to accept keys without explicit values."}),subtype:n.Literal("key-value",{description:"Parses delimited key/value text into attributes."})})],{description:"Parse processor configuration. The `subtype` discriminator selects which parser reads the source text attribute and which fields it extracts."}),Q2e=n.Object({...hae,params:Y2e}),W2e=n.Object({...yae,params:V2e}),J2e=n.Object({...dae,params:Q("subtype",[n.Object({targetAttribute:f({allowEmpty:!1,description:"Attribute that will receive the formatted value"}),formatString:f({allowEmpty:!1,type:"long",description:"Template string used to build the target attribute value"}),overrideTarget:n.Optional(n.Boolean({description:"Set to true to overwrite an existing target attribute value (defaults to true)"})),subtype:n.Literal("format-string"),replaceMissingByEmpty:n.Optional(n.Boolean({description:"Set to true for missing referenced attributes to render as empty strings. Defaults to true."}))}),n.Object({targetAttribute:f({allowEmpty:!1,description:"Attribute that will receive the category value"}),clauses:n.Array(n.Object({query:f({allowEmpty:!1,type:"tsuga-query",description:"Query that selects logs for this category clause. Clauses are evaluated in order."}),value:f({allowEmpty:!1,description:"String category value assigned when this clause matches."})}),{minItems:1,maxItems:pae,description:"Conditions evaluated in order to determine the category value. The first matching clause wins."}),defaultValue:n.Optional(f({description:"String category value used when no clause matches."})),subtype:n.Literal("category")})])}),Z2e=n.Object({...gae,params:n.Object({attributes:n.Array(n.Object({originAttribute:f({allowEmpty:!1,description:"Attribute name to map to the target attribute"}),keepOrigin:n.Optional(n.Boolean({description:"Preserve the source attribute after mapping (defaults to false)"})),overrideTarget:n.Optional(n.Boolean({description:"Overwrite the target attribute when it already exists (defaults to true)"})),targetAttribute:f({allowEmpty:!1,description:"Attribute name that will receive the mapped value"})}),{minItems:1,maxItems:50,description:"Mappings that map individual attributes to new targets"}),subtype:n.Literal("map-attributes")})}),X2e=n.Object({...yae,params:n.Object({attributeName:f({allowEmpty:!1,description:"Attribute whose value will be parsed with Grok rules"}),rules:n.Array(f({allowEmpty:!1,type:"long",description:"Grok rule applied to parse text. Route processing sends rules as engine patterns."}),{minItems:1,maxItems:5,description:"Ordered Grok rules evaluated until one matches."}),samples:n.Optional(n.Array(f({type:"long"}),{maxItems:Eae,description:"Example log lines for validating the Grok rules."})),subtype:n.Literal("grok")})}),nfr=Q("type",[Z2e,X2e,J2e]),eHe=n.Object({...mae,params:Q("subtype",[n.Object({targetAttribute:n.String({description:"Attribute that will receive the formatted value"}),formatString:n.String({description:"Template string used to build the target attribute value"}),overrideTarget:n.Optional(n.Boolean({description:"Whether to overwrite the target attribute when it already exists."})),subtype:n.Literal("format-string"),replaceMissingByEmpty:n.Optional(n.Boolean({description:"Whether missing referenced attributes render as empty strings."}))}),n.Object({targetAttribute:n.String({description:"Attribute that will receive the category value"}),clauses:n.Array(n.Object({query:n.String({description:"Query that selects logs for this category clause."}),value:n.String({description:"String category value assigned when this clause matches."})}),{description:"Conditions evaluated in order to determine the category value."}),defaultValue:n.Optional(n.String({description:"String category value used when no clause matches."})),subtype:n.Literal("category")})])}),tHe=n.Object({...fae,params:n.Object({attributes:n.Array(n.Object({originAttribute:n.String({description:"Attribute name to map to the target attribute"}),keepOrigin:n.Optional(n.Boolean({description:"Whether the source attribute is preserved after mapping."})),overrideTarget:n.Optional(n.Boolean({description:"Whether to overwrite the target attribute when it already exists."})),targetAttribute:n.String({description:"Attribute name that will receive the mapped value"})}),{description:"Mappings that map individual attributes to new targets"}),subtype:n.Literal("map-attributes")})}),rHe=n.Object({...hae,params:n.Object({attributeName:n.String({description:"Attribute whose value will be parsed with Grok rules"}),rules:n.Array(n.String({description:"Grok rule applied to parse text."}),{description:"Ordered Grok rules evaluated until one matches."}),samples:n.Optional(n.Array(n.String(),{description:"Example log lines for validating the Grok rules."})),subtype:n.Literal("grok")})}),ofr=Q("type",[tHe,rHe,eHe]),nHe=11,Sae=n.Cyclic({OutputProcessor:n.Union([z2e,Q2e,B2e,n.Object({...KC,params:n.Object({items:n.Array(n.Object({query:n.String({description:"Query that determines whether logs enter this branch"}),processors:n.Array(n.Ref("OutputProcessor"),{description:"Processors executed when the branch query matches"})}),{description:"Conditional branches evaluated in order before falling back to the default"})}),type:n.Literal("split",{description:"Split processor. It sends each log through the first matching conditional branch."})})])},"OutputProcessor",{description:"Processing step executed sequentially on route logs"}),Tae=n.Cyclic({InputProcessor:n.Union([K2e,W2e,q2e,n.Object({...zC,params:n.Object({items:n.Array(n.Object({query:f({type:"tsuga-query",description:"Query that determines whether logs enter this branch"}),processors:n.Array(n.Ref("InputProcessor"),{maxItems:50,description:"Processors executed when the branch query matches"})}),{minItems:2,maxItems:nHe,description:"Conditional branches evaluated in order before falling back to the default"})}),type:n.Literal("split",{description:"Split processor. It sends each log through the first matching conditional branch."})})])},"InputProcessor",{description:"Processing step executed sequentially on route logs"});var oHe="/v0/logs",Ra=`${oHe}/routes`,Hc=n.Object({id:n.String({description:"Tsuga-generated log route ID assigned when the route is created."}),name:n.String({description:"Human-readable route name shown in Tsuga."}),description:n.Optional(n.String({description:"Optional free-text note about the route's purpose, set by the caller. This metadata is not evaluated when matching or processing logs."})),isEnabled:n.Boolean({description:"Whether this route is active for newly ingested logs. Disabled routes remain saved but do not process logs."}),query:n.String({description:"Tsuga query that selects which newly ingested logs enter the route processor chain."}),rank:n.Number({description:"Tsuga-assigned evaluation order, unique across all routes and dense (no gaps). Enabled routes are checked from lower rank to higher rank during ingestion, and every route whose query matches a log applies its processors to it \u2014 matching is not stopped after the first hit. New routes are appended with the highest rank; deleting a route shifts all higher ranks down by one to close the gap. Use `PUT /:id/modify-ranking` to move a route to a different rank, which shifts the routes between its old and new position accordingly."}),tags:br,owner:n.String({description:"ID of the team that owns the route. Determines which team members can view and manage it, and which tag policies apply to it. Only an org admin or an admin of this team may change fields other than `processors`, or delete the route."}),processors:n.Array(Sae,{description:"Processors applied in array order to logs that match the route, each transforming the output of the previous one. A `split` processor forks the chain into branches and cannot be followed by another processor at the same level."}),creator:n.Optional(Qe),updater:n.Optional(Qe),updatedAt:H({description:"Timestamp when Tsuga last updated the route."}),createdAt:H({description:"Timestamp when Tsuga created the route."}),assetUpdatedAt:H({description:"Timestamp when Tsuga last changed route behavior. This can differ from `updatedAt` when only metadata such as `description` or `tags` changed."})},{title:"LogRoute"}),JS=n.Object({name:f({allowEmpty:!1,description:"Human-readable log route name shown in Tsuga."}),description:Ut(f({type:"long"}),{description:"Optional free-text note about the log route's purpose. This metadata is not evaluated when matching or processing logs."}),isEnabled:n.Boolean({description:"Set to true for the log route to process newly ingested matching logs. Set to false to save it without running it."}),query:f({type:"tsuga-query",description:"Tsuga query that selects which newly ingested logs enter the log route processor chain."}),tags:wr,owner:f({allowEmpty:!1,description:"ID of the team that will own the log route, determining which team members can view and manage it and which tag policies apply. Only an org admin or an admin of this team may change fields other than `processors`, or delete the route."}),processors:n.Array(Tae,{maxItems:50,description:"Processors applied in array order to logs that match the log route, each transforming the output of the previous one. Up to 50 are accepted. A `split` processor forks the chain into branches and cannot be followed by another processor at the same level."})});var iHe=["active","inactive"],sHe=["isEnabled","name","query","owner","tags","processors","rank","assetUpdatedAt"],bae=n.Object({owners:qe(f({allowEmpty:!1}),{description:"Restrict results to routes owned by any of these team IDs.",maxItems:50}),searchQuery:ko({description:"Search query filter for routes.",valueDescription:"Case-insensitive substring matched against route name and ID."}),status:n.Enum(iHe,{description:"Restrict results to enabled (`active`) or disabled (`inactive`) routes."})}),aHe=n.Partial(n.Object({...je,filters:n.Partial(bae),sort:n.Object({by:n.Enum(sHe,{description:"Field to sort the returned routes by."}),direction:Le})})),cHe=n.Object({filters:n.Optional(n.Partial(n.Omit(bae,["status"]),{description:"Filters applied before counting enabled and disabled routes."}))}),lHe=n.Object({totalCount:n.Integer({description:"Number of matching routes, whether they are enabled or disabled."}),active:n.Integer({description:"Number of matching routes that are enabled."}),inactive:n.Integer({description:"Number of matching routes that are disabled."})}),dfr=x({tags:["routes"],url:`${Ra}/query`,method:"POST",paginated:!0,body:aHe,response:n.Array(Hc,{description:"Matching log routes after they are filtered, sorted, and paginated."})}),ffr=x({tags:["routes"],url:`${Ra}/counts/query`,method:"POST",body:cHe,response:lHe}),gfr=x({tags:["routes"],url:Ra,method:"GET",paginated:!0,query:n.Object(je),response:n.Array(Hc)}),hfr=x({tags:["routes"],url:`${Ra}/:id`,params:n.Object({id:f()}),method:"GET",response:Hc}),yfr=x({tags:["routes"],url:Ra,method:"POST",body:JS,response:Hc}),Efr=x({tags:["routes"],url:`${Ra}/:id`,method:"PUT",body:JS,params:n.Object({id:f()}),response:Hc}),Sfr=x({tags:["routes"],url:`${Ra}/:id/clone`,method:"POST",params:n.Object({id:f()}),body:JS,response:Hc}),Tfr=x({tags:["routes"],url:`${Ra}/:id`,method:"DELETE",params:n.Object({id:f()}),response:ae}),bfr=x({description:"Moves a route to a new rank, shifting the ranks of the routes between its old and new position by one to keep ranks dense and unique. Affects the route's evaluation order for newly ingested logs; does not change any route's processors or other fields.",tags:["routes"],url:`${Ra}/:id/modify-ranking`,method:"PUT",params:n.Object({id:f()}),body:n.Object({rank:n.Integer({minimum:1,description:"Target rank for the route, from 1 to the total number of routes. Requests outside that range are rejected."})}),response:n.Object({})}),xfr=x({description:"Sets a route's `isEnabled` state without changing any other field. Disabling a route stops it from processing newly ingested logs while keeping it saved and its rank unchanged.",tags:["routes"],url:`${Ra}/:id/enable`,method:"PUT",params:n.Object({id:f()}),body:n.Object({enable:n.Boolean({description:"Set to true to enable the route, or false to disable it."})}),response:Hc});var ZS=`/${"v1"}/routes`,xae={name:"Enrich API Gateway Logs",description:"Adds service metadata and normalizes log format",isEnabled:!0,query:"service:api-gateway",tags:[{key:"category",value:"enrichment"}],owner:"team-123-abc",processors:[{id:"parse-gateway-message",type:"parse-attribute",tags:[],params:{subtype:"grok",attributeName:"message",rules:["%{TIMESTAMP_ISO8601:timestamp} %{LOGLEVEL:level} %{GREEDYDATA:msg}"]}}]},Iae={name:"Normalize Checkout Logs",description:"Maps service fields and extracts key/value details",isEnabled:!0,query:"context.service.name:checkout",tags:[{key:"category",value:"normalization"}],owner:"team-123-abc",processors:[{id:"map-service-name",type:"mapper",tags:[],params:{subtype:"map-attributes",attributes:[{originAttribute:"context.service.name",targetAttribute:"service",keepOrigin:!1,overrideTarget:!0}]}},{id:"parse-logfmt-message",type:"parse-attribute",tags:[],params:{subtype:"key-value",sourceAttribute:"message",targetAttribute:"logfmt",keyValueSplitter:"=",pairsSplitter:" ",acceptStandaloneKey:!1}}]},XS=n.Pick(Hc,["id","name","description","isEnabled","query","tags","owner","processors"],{$id:"Route",description:"Team-owned log processing definition that selects newly ingested logs and applies ordered processors. See [Routes](/documentation/process/routes/index)."}),uHe={id:"123-456-abc",...xae},pHe={id:"456-789-def",...Iae};Object.assign(XS,{examples:[uHe,pHe]});var _ae=x({description:"Lists log routes visible to the authenticated operation key. Returned routes are ordered by evaluation order, with earlier routes evaluated first. Use this to inventory ingest-time processing definitions and owners. Pagination fields limit the returned page.",operationId:"listRoutes",tags:["routes"],url:ZS,method:"GET",paginated:!0,query:n.Object(er),response:n.Array(XS)}),Aae=x({description:"Retrieves one log route by ID.",operationId:"getRoute",tags:["routes"],url:`${ZS}/:id`,method:"GET",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the log route to retrieve. Use the `id` returned by route list or create responses."})}),response:XS}),OF=n.Pick(JS,["name","description","isEnabled","query","tags","owner","processors"],{description:"Log route create or update request. Provide the route metadata, source query, owner team, enabled state, tags, and ordered processors."});Object.assign(OF,{examples:[xae,Iae]});var Oae=x({description:"Creates a log route at the end of the evaluation order. Routes affect only newly ingested logs after the cluster receives the updated configuration.",operationId:"createRoute",tags:["routes"],url:ZS,method:"POST",body:OF,response:XS}),Cae=x({description:"Updates an existing log route by ID without changing its evaluation order. Fields omitted from the request keep their existing values. Routes affect only newly ingested logs after the cluster receives the updated configuration.",operationId:"updateRoute",tags:["routes"],url:`${ZS}/:id`,method:"PUT",body:OF,params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the log route to update. Use the `id` returned by route list, get, or create responses."})}),response:XS}),Rae=x({description:"Deletes a log route by ID and compacts the evaluation order for remaining routes. The route stops processing future logs after the cluster receives the updated configuration.",operationId:"deleteRoute",tags:["routes"],url:`${ZS}/:id`,method:"DELETE",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the log route to delete. Use the `id` returned by route list, create, or update responses."})}),response:ae});var Pae=_t({commandName:"log-routes",description:"Manage log routes",endpoints:{list:_ae,get:Aae,create:Oae,update:Cae,delete:Rae}});var bo="/v0/monitors",Eg=["alert","resolve","keep_last_status","consider_zero"],Sg=["alert","resolve","keep_last_status"];var vae=["no_aggregation","all","any","each","proportion"],Uae=["greater_than","less_than","equal","not_equal","greater_than_or_equal","less_than_or_equal"];var mHe=n.Object({formula:n.String({description:"Formula result to compare against the threshold, usually `q1` or a formula alias."}),operator:n.Enum(Uae,{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."})}),dHe=n.Object({formula:f({type:"tsuga-formula",description:"Formula result to compare against the threshold, usually `q1` or a formula alias."}),operator:n.Enum(Uae,{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."})}),fHe=5,CF=n.Array(mHe,{description:"Threshold conditions evaluated against query and formula results. All listed conditions must match for a non-grouped threshold monitor to alert."}),RF=n.Array(dHe,{minItems:1,maxItems:fHe,description:"Threshold conditions evaluated against query and formula results. All listed conditions must match for a non-grouped threshold monitor to alert."}),PF=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`."}),wF=n.Object({formula:f({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`."}),To=[1,2,3,4,5];var YC={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:"Configured limit for this group by. Currently ignored; monitor evaluation applies a fixed limit of 100 groups per field."}),sortOrder:n.Optional(Le),replaceNullWith:n.Optional(n.String({description:"Value used to group documents that have no value for a grouped field."}))}),{description:"Monitor group by configuration. The `limit` setting is currently ignored; evaluation applies a fixed limit of 100 groups per field."}),aggregationAlertLogic:n.Optional(n.Enum(vae,{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`."}))},VC={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(f(),{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:"Configured limit for this group by. Currently ignored; monitor evaluation applies a fixed limit of 100 groups per field."}),sortOrder:n.Optional(Le),replaceNullWith:n.Optional(f({allowEmpty:!1,description:"Value used to group documents that have no value for a grouped field."}))}),{maxItems:1,description:"Monitor group by configuration. The `limit` setting is currently ignored; evaluation applies a fixed limit of 100 groups per field."}),aggregationAlertLogic:n.Optional(n.Enum(vae,{description:"How grouped results are combined into alert state. Use `no_aggregation` only when `groupByFields` is empty; use `all`, `any`, `each`, or `proportion` with non-empty `groupByFields`. `proportion` also requires `proportionAlertThreshold`. On create, omitted query-monitor values default to `no_aggregation`; on update, omitted values keep the existing aggregation logic."})),proportionAlertThreshold:n.Optional(n.Integer({minimum:1,maximum:99,description:"Percentage threshold used when `aggregationAlertLogic` is `proportion`."}))},vF={...YC,timeframe:n.Number({description:"Lookback window, in minutes, that each anomaly monitor evaluation aggregates over. Always a whole number from 5 through 1440."})},UF={...VC,timeframe:n.Integer({minimum:5,maximum:1440,description:"Lookback window, in minutes, that each anomaly monitor evaluation aggregates over."})},Nae=n.Object({type:n.Literal("metric",{description:"Threshold monitor over metric aggregations."}),conditions:CF,noDataBehavior:n.Enum(Eg,{description:"How the monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, `keep_last_status` preserves the previous state, and `consider_zero` evaluates missing values as zero."}),...YC,queries:Nc},{$id:"MonitorConfigurationMetric"}),kae=n.Object({type:n.Literal("metric",{description:"Threshold monitor over metric aggregations."}),conditions:RF,noDataBehavior:n.Enum(Eg,{description:"How the monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, `keep_last_status` preserves the previous state, and `consider_zero` evaluates missing values as zero."}),...VC,queries:ru},{$id:"InputMonitorConfigurationMetric"}),Lae=n.Object({type:n.Literal("log",{description:"Threshold monitor over log aggregations."}),conditions:CF,noDataBehavior:n.Enum(Eg,{description:"How the monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, `keep_last_status` preserves the previous state, and `consider_zero` evaluates missing values as zero."}),...YC,queries:Nc},{$id:"MonitorConfigurationLog"}),Mae=n.Object({type:n.Literal("log",{description:"Threshold monitor over log aggregations."}),conditions:RF,noDataBehavior:n.Enum(Eg,{description:"How the monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, `keep_last_status` preserves the previous state, and `consider_zero` evaluates missing values as zero."}),...VC,queries:ru},{$id:"InputMonitorConfigurationLog"}),Dae=n.Object({type:n.Literal("trace",{description:"Threshold monitor over trace aggregations."}),conditions:CF,noDataBehavior:n.Enum(Eg,{description:"How the monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, `keep_last_status` preserves the previous state, and `consider_zero` evaluates missing values as zero."}),...YC,queries:Nc},{$id:"MonitorConfigurationTrace"}),gHe=n.Object({type:n.Literal("trace",{description:"Threshold monitor over trace aggregations."}),conditions:RF,noDataBehavior:n.Enum(Eg,{description:"How the monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, `keep_last_status` preserves the previous state, and `consider_zero` evaluates missing values as zero."}),...VC,queries:ru},{$id:"InputMonitorConfigurationTrace"}),Fae=n.Object({type:n.Literal("anomaly-log",{description:"Anomaly monitor over log aggregations."}),condition:PF,noDataBehavior:n.Enum(Sg,{description:"How the anomaly monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, and `keep_last_status` preserves the previous state."}),...vF,queries:Nc},{$id:"MonitorConfigurationAnomalyLog"}),$ae=n.Object({type:n.Literal("anomaly-log",{description:"Anomaly monitor over log aggregations."}),condition:wF,noDataBehavior:n.Enum(Sg,{description:"How the anomaly monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, and `keep_last_status` preserves the previous state."}),...UF,queries:ru},{$id:"InputMonitorConfigurationAnomalyLog"}),Gae=n.Object({type:n.Literal("anomaly-metric",{description:"Anomaly monitor over metric aggregations."}),condition:PF,noDataBehavior:n.Enum(Sg,{description:"How the anomaly monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, and `keep_last_status` preserves the previous state."}),...vF,queries:Nc},{$id:"MonitorConfigurationAnomalyMetric"}),Bae=n.Object({type:n.Literal("anomaly-metric",{description:"Anomaly monitor over metric aggregations."}),condition:wF,noDataBehavior:n.Enum(Sg,{description:"How the anomaly monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, and `keep_last_status` preserves the previous state."}),...UF,queries:ru},{$id:"InputMonitorConfigurationAnomalyMetric"}),qae=n.Object({type:n.Literal("anomaly-trace",{description:"Anomaly monitor over trace aggregations. Use this configuration when Tsuga should learn historical trace query behavior and alert on unusual movement in trace-derived values."}),condition:PF,noDataBehavior:n.Enum(Sg,{description:"How the anomaly monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, and `keep_last_status` preserves the previous state."}),...vF,queries:Nc},{$id:"MonitorConfigurationAnomalyTrace"}),hHe=n.Object({type:n.Literal("anomaly-trace",{description:"Anomaly monitor over trace aggregations. Set this value to create or update an anomaly monitor that learns historical trace query behavior and alerts on unusual movement in trace-derived values."}),condition:wF,noDataBehavior:n.Enum(Sg,{description:"How the anomaly monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, and `keep_last_status` preserves the previous state."}),...UF,queries:ru},{$id:"InputMonitorConfigurationAnomalyTrace"}),jae=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"}),yHe=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"}),EHe=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."})},{$id:"MonitorConfigurationLogErrorPattern"}),SHe=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(f({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:f({allowEmpty:!1,description:"Environment whose logs are searched for new error patterns."}),services:n.Optional(n.Array(f({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."})},{$id:"InputMonitorConfigurationLogErrorPattern"}),Hae=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"}),THe=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(f({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:f({allowEmpty:!1,description:"Environment whose error logs are watched for volume increases."}),services:n.Optional(n.Array(f({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"}),bHe=Q("type",[Nae,Lae,Dae,Fae,Gae,EHe,Hae,qae,jae],{description:"Monitor evaluation configuration. The `type` discriminator determines which telemetry source, condition shape, and evaluation rules Tsuga uses."}),xHe=Q("type",[kae,Mae,gHe,$ae,Bae,hHe,SHe,THe,yHe],{description:"Monitor evaluation configuration. The `type` discriminator determines which telemetry source, condition shape, and evaluation rules Tsuga uses."});var Kc=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:br,configuration:bHe,priority:n.Enum(To,{description:"Monitor priority from 1 through 5, where 1 is highest priority."}),permissions:As,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."})),pauseUntil:n.Optional(H({description:"Timestamp until which the monitor is snoozed."})),creator:n.Optional(Qe),updater:n.Optional(Qe),createdAt:H({description:"Timestamp when Tsuga created the monitor."}),updatedAt:H({description:"Timestamp when Tsuga last updated the monitor."}),assetUpdatedAt:H({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"}),NF=Q("type",[Nae,Lae,Dae,Fae,Gae,qae,jae,Hae]),Kfr=n.Object({...Kc.properties,configuration:NF},{title:"Monitor"}),zfr=n.Object({...Kc.properties,configuration:Q("type",[kae,Mae,$ae,Bae])},{title:"Monitor"}),eT=n.Object({name:f({description:"Display name of the monitor and alert source."}),message:Ut(f({type:"long"}),{description:"Message included in notifications triggered by this monitor. Optional on create."}),tags:wr,configuration:xHe,priority:n.Enum(To,{description:"Monitor priority from 1 through 5, where 1 is highest priority."}),owner:f({allowEmpty:!1,description:"Team ID that owns and manages the monitor."}),dashboardId:Ut(f({allowEmpty:!1}),{description:"ID of the dashboard to link to this monitor for context when investigating alerts. On create: omit or send `null` to leave the monitor unlinked. On update: omit to skip updating this field, send `null` to clear an existing link."}),pauseUntil:Ut(f({allowEmpty:!1,type:"date-time"}),{description:"ISO timestamp until which the monitor should be snoozed."}),permissions:As,clusterIds:n.Optional(n.Array(f({allowEmpty:!1}),{description:"Cluster IDs where the monitor should be deployed. Empty or omitted means all eligible clusters for cluster-deployed monitor types."}))}),wae=["threshold","certificate-expiry","anomaly-detection","log-error-pattern","log-error-pattern-increase"],hu={PRIORITY:"priority",TYPE:"type",NAME:"name",OWNER:"owner",TAGS:"tags",CLUSTER_IDS:"clusterIds",PAUSE_UNTIL:"pauseUntil",ASSET_UPDATED_AT:"assetUpdatedAt"};var kF=n.Object({owners:qe(f({allowEmpty:!1}),{description:"Restrict results to monitors owned by any of these team IDs",maxItems:50}),searchQuery:ko({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:qe(Fn.items,{description:"Restrict results to monitors that have at least one of the listed key/value tags",maxItems:50}),priorities:qe(n.Enum(To),{description:"Restrict results to monitors with one of these priorities",maxItems:To.length}),types:qe(n.Enum(wae),{description:"Restrict results to monitors with these types",maxItems:wae.length}),activity:n.Enum(["active","snoozed"],{description:"Restrict results by activity status: active monitors or currently snoozed monitors"}),clusterIds:qe(f({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"}),QC=n.Partial(kF),LF=n.Partial(n.Object({...je,filters:QC,sort:n.Object({by:n.Enum([hu.PRIORITY,hu.TYPE,hu.NAME,hu.OWNER,hu.TAGS,hu.CLUSTER_IDS,hu.PAUSE_UNTIL,hu.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:Le},{description:"Optional sorting applied to the returned monitors. Ties are broken by creation time and monitor ID for stable pagination."})})),Yfr=x({tags:["monitors"],url:`${bo}/query`,method:"POST",paginated:!0,response:n.Array(Kc),body:LF}),Vfr=x({tags:["monitors"],url:`${bo}/tags/query`,method:"POST",body:n.Object({filters:n.Optional(n.Partial(n.Omit(kF,["tags"])))}),response:Dn}),Qfr=x({tags:["monitors"],url:`${bo}/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."})})}),Wfr=x({tags:["monitors"],url:`${bo}/:id`,method:"GET",params:n.Object({id:f()}),response:Kc}),Jfr=x({tags:["monitors"],url:bo,method:"POST",body:eT,response:Kc}),Zfr=x({tags:["monitors"],url:`${bo}/:id`,method:"PUT",params:n.Object({id:f()}),body:eT,response:Kc}),IHe=_i(QC,{maxIds:100}),Xfr=x({tags:["monitors"],url:`${bo}/bulk-update`,method:"PUT",body:n.Object({selection:IHe,owner:f({allowEmpty:!1})}),response:n.Object({})}),egr=x({tags:["monitors"],url:`${bo}/:id`,method:"DELETE",params:n.Object({id:f()}),response:ae}),_He=_i(QC),tgr=x({tags:["monitors"],url:`${bo}/bulk-delete`,method:"DELETE",body:n.Object({selection:_He}),response:n.Object({})}),rgr=x({tags:["monitors"],url:`${bo}/:id/snooze`,method:"POST",params:n.Object({id:f()}),body:n.Object({pauseUntil:f({allowEmpty:!1,type:"date-time"})}),response:Kc}),AHe=_i(QC,{maxIds:100}),ngr=x({tags:["monitors"],url:`${bo}/bulk-snooze`,method:"POST",body:n.Object({selection:AHe,pauseUntil:f({allowEmpty:!1,type:"date-time"})}),response:n.Object({})}),OHe=["alert","alert_consider_zero","alert_no_data","keep_last_status_alert"],CHe=["ok","ok_consider_zero","ok_no_data","keep_last_status_ok"],RHe=[...OHe,...CHe],hm=n.Enum(RHe),PHe=Q("type",[n.Object({type:n.Literal("each"),subStates:n.Record(n.String(),n.Object({stateValue:n.Union([hm,n.Null()]),lastChangedAt:H()}))}),n.Object({type:n.Literal("no_aggregation"),stateValue:n.Optional(hm)}),n.Object({type:n.Literal("any"),stateValue:n.Optional(hm)}),n.Object({type:n.Literal("all"),stateValue:n.Optional(hm)}),n.Object({type:n.Literal("proportion"),stateValue:n.Optional(hm)})]),wHe=n.Object({monitorId:n.String(),currentState:PHe,lastChangedAt:n.Optional(H())}),ogr=x({tags:["monitors"],url:`${bo}/states/:id`,method:"GET",params:n.Object({id:f()}),response:wHe}),igr=x({tags:["monitors"],url:`${bo}/:id/transitions`,method:"GET",params:n.Object({id:f()}),query:n.Object({from:n.Number(),to:n.Number()}),response:n.Array(n.Object({id:n.String(),createdAt:H(),fromState:n.Optional(hm),toState:n.Optional(hm),dimension:n.Optional(n.String())}))}),vHe=["unprocessed","processed","failed-to-process"],sgr=x({tags:["monitors"],url:`${bo}/:id/results`,method:"GET",params:n.Object({id:f()}),query:n.Object({from:n.Number(),to:n.Number()}),response:n.Object({isTruncated:n.Boolean(),results:n.Array(n.Object({id:n.String(),evaluationAt:H(),formulaResult:n.Object({groups:n.Array(n.Object({groupKey:n.Record(n.String(),eS),results:n.Array(n.Union([n.Number(),n.Null()])),conditionMet:n.Enum(["true","false","nan-no-data"])}))}),createdAt:H(),status:n.Enum(vHe)}))})});var tT=`/${"v1"}/monitors`,Tg=n.Pick(Kc,["id","name","message","tags","configuration","priority","owner","dashboardId","permissions","clusterIds"],{$id:"Monitor",description:"Saved alert definition that evaluates telemetry and creates alert transitions. Notification delivery is configured separately with notification rules. See [Monitors](/documentation/alert/monitors/index)."}),fgr=n.Object({...Tg.properties,configuration:NF},{description:"Saved alert definition that evaluates telemetry and creates alert transitions, restricted to the kinds that raise ongoing alerts. Same shape as `Monitor` without the `log-error-pattern` configuration. See [Monitors](/documentation/alert/monitors/index)."}),zae={name:"High Error Rate Alert",message:"Error rate exceeded threshold. Check the API gateway logs.",tags:[{key:"severity",value:"critical"}],configuration:{type:"log",timeframe:5,groupByFields:[],aggregationAlertLogic:"no_aggregation",queries:[{aggregate:{type:"count"},filter:"level:ERROR service:api-gateway"}],conditions:[{formula:"q1",operator:"greater_than",threshold:100}],noDataBehavior:"resolve"},priority:1,owner:"team-123-abc",dashboardId:"789-abc-def",permissions:"all",clusterIds:[]},Yae={name:"High CPU Utilization By Service",message:"More than half of grouped services are above the CPU threshold.",tags:[{key:"severity",value:"warning"}],configuration:{type:"metric",timeframe:10,groupByFields:[{fields:["context.service.name"],limit:10}],aggregationAlertLogic:"proportion",proportionAlertThreshold:50,queries:[{aggregate:{type:"average",field:"system.cpu.utilization"},filter:"context.service.name:checkout"}],conditions:[{formula:"q1",operator:"greater_than",threshold:.8}],noDataBehavior:"keep_last_status"},priority:2,owner:"team-123-abc",dashboardId:"789-abc-def",permissions:"all",clusterIds:[]},Vae={name:"Certificate Expiry Warning",message:"A certificate is approaching expiry.",tags:[{key:"environment",value:"production"}],configuration:{type:"certificate-expiry",warnBeforeInDays:30,cloudAccounts:["aws-prod"],aggregationAlertLogic:"each",noDataBehavior:"resolve"},priority:3,owner:"team-123-abc",dashboardId:"789-abc-def",permissions:"all",clusterIds:[]},Qae={name:"New Error Pattern Detector",message:"A new error pattern was detected in the logs.",tags:[{key:"team",value:"platform"}],configuration:{type:"log-error-pattern",aggregationAlertLogic:"each",noDataBehavior:"keep_last_status",filter:{teamIds:["team-123-abc"],env:"production",services:["api-gateway"]}},priority:2,owner:"team-123-abc",dashboardId:"789-abc-def",permissions:"all",clusterIds:[]},Wae={name:"Error Pattern Increase Detector",message:"An existing error pattern is spiking.",tags:[{key:"team",value:"platform"}],configuration:{type:"log-error-pattern-increase",aggregationAlertLogic:"each",noDataBehavior:"resolve",filter:{teamIds:["team-123-abc"],env:"production",services:["api-gateway"]}},priority:2,owner:"team-123-abc",dashboardId:"789-abc-def",permissions:"all",clusterIds:[]},UHe={id:"123-456-abc",...zae},NHe={id:"234-567-bcd",...Yae},kHe={id:"345-678-cde",...Vae},LHe={id:"456-789-def",...Qae},MHe={id:"567-890-efa",...Wae};Object.assign(Tg,{examples:[UHe,NHe,kHe,LHe,MHe]});var Kae=n.Pick(LF,["filters","sort","limit","offset"]),Jae=n.Object({...Kae.properties,...er,filters:Kae.properties.filters},{description:"Monitor query request. Use filters, sorting, limit, and offset to page through visible monitors."}),DHe={filters:{owners:{values:["team-123-abc"]},searchQuery:{value:"service:api-gateway"},tags:{values:[{key:"paging",value:"true"}]},priorities:{values:[4,5],exclude:!0},types:{values:["threshold"]},activity:"active",clusterIds:{values:["cluster-123-abc"]}},sort:{by:"name",direction:"asc"},limit:10,offset:0};Object.assign(Jae,{examples:[DHe]});var Zae=x({description:"Queries monitors visible to the authenticated operation key. Use this endpoint to inventory monitor definitions, filter by owner, tag, priority, type, activity, or cluster, and page through results. See [Monitors](/documentation/alert/monitors/index).",operationId:"queryMonitors",tags:["monitors"],url:`${tT}/query`,method:"POST",paginated:!0,body:Jae,response:n.Array(Tg)}),Xae=x({description:"Retrieves one monitor definition by ID.",operationId:"getMonitor",tags:["monitors"],url:`${tT}/:id`,method:"GET",params:n.Object({id:f({allowEmpty:!1,description:"Monitor ID returned by monitor query, create, or update operations."})}),response:Tg}),ece=["name","message","tags","configuration","priority","owner","dashboardId","permissions","clusterIds"],tce=n.Pick(eT,ece,{$id:"CreateMonitorRequest",description:"Monitor creation request. Provide ownership, data access, alert configuration, priority, tags, and optional dashboard or cluster scope."}),rce=n.Pick(eT,ece,{$id:"UpdateMonitorRequest",description:"Monitor update request. Required fields and the submitted configuration are overwritten; omitted `message`, `tags`, and `clusterIds` keep their existing values. Omitting `dashboardId` clears the dashboard link."}),nce=zae,oce=Yae,ice=Vae,sce=Qae,ace=Wae;Object.assign(tce,{examples:[nce,oce,ice,sce,ace]});Object.assign(rce,{examples:[nce,oce,ice,sce,ace]});var cce=x({description:"Creates a monitor owned by the specified team. The monitor can evaluate logs, metrics, traces, anomaly behavior, certificate expiry, new error patterns, or error pattern increases depending on its configuration.",operationId:"createMonitor",tags:["monitors"],url:tT,method:"POST",body:tce,response:Tg}),lce=x({description:"Updates an existing monitor definition by ID. Required fields and the submitted configuration are overwritten; omitted `message`, `tags`, and `clusterIds` keep their existing values. Omitting `dashboardId` clears the dashboard link, and public updates clear any existing snooze because `pauseUntil` is not part of the public schema.",operationId:"updateMonitor",tags:["monitors"],url:`${tT}/:id`,method:"PUT",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the saved monitor to update. Use the `id` returned by monitor query or create responses."})}),body:rce,response:Tg}),FHe=n.Object({id:f({allowEmpty:!1,description:"Identifier of the saved monitor to delete. Use the `id` returned by monitor query, create, or update responses."})}),uce=x({description:"Deletes a monitor by ID. Deleting a monitor stops future evaluations and alert transitions for that monitor.",operationId:"deleteMonitor",tags:["monitors"],url:`${tT}/:id`,method:"DELETE",params:FHe,response:ae});var pce=_t({commandName:"monitors",description:"Manage monitors",endpoints:{list:Zae,get:Xae,create:cce,update:lce,delete:uce},enableListBody:!0});var mce=Q("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")})]),dce=Q("type",[n.Object({type:n.Literal("bearer"),token:f({allowEmpty:!1})}),n.Object({type:n.Literal("basic"),username:f({allowEmpty:!1}),password:f({allowEmpty:!1})}),n.Object({type:n.Literal("custom-header"),key:f({allowEmpty:!1}),value:f({allowEmpty:!1})}),n.Object({type:n.Literal("none")})]),fce=Q("type",[n.Object({type:n.Literal("bearer"),token:n.Optional(f({allowEmpty:!1}))}),n.Object({type:n.Literal("basic"),username:n.Optional(f({allowEmpty:!1})),password:n.Optional(f({allowEmpty:!1}))}),n.Object({type:n.Literal("custom-header"),key:n.Optional(f({allowEmpty:!1})),value:n.Optional(f({allowEmpty:!1}))}),n.Object({type:n.Literal("none")})]);var bg="/v0/notifications",va=`${bg}/rules`,gce=`${bg}/slack/setup`,xg=`${bg}/integrations`,ym=["triggered","resolved","no-data"],$He=["sent","stale","pending","rate-limited","failed","silenced"],GHe=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."})),MF=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."}),BHe=n.Optional(MF),Pa=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."})),wa=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."})),rT=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:GHe,config:Q("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:Pa},{$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:Pa},{$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:Pa},{$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:Pa},{$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:Pa},{$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:Pa},{$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:Pa},{$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:Pa},{$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:Pa},{$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:Pa},{$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`."})}),Ig=n.Object({id:f({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:BHe,config:Q("type",[n.Object({type:n.Literal("slack",{description:"Slack target backed by a configured Slack integration."}),channel:f({allowEmpty:!1,description:"Slack channel ID that receives the notification"}),integrationId:f({allowEmpty:!1,description:"Slack workspace ID that receives the notification"}),renotifyConfig:wa},{$id:"RuleTargetInputSlack"}),n.Object({type:n.Literal("incident-io",{description:"incident.io target backed by a configured incident.io integration."}),integrationId:f({allowEmpty:!1,description:"Identifier of the incident.io integration to use"}),renotifyConfig:wa},{$id:"RuleTargetInputIncidentIo"}),n.Object({type:n.Literal("pagerduty",{description:"PagerDuty target backed by a configured PagerDuty integration."}),integrationId:f({allowEmpty:!1,description:"Identifier of the PagerDuty integration to use"}),renotifyConfig:wa},{$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(f({type:"email"}),{minItems:1,maxItems:20,description:"Email addresses that will receive the alert"}),renotifyConfig:wa},{$id:"RuleTargetInputEmail"}),n.Object({type:n.Literal("grafana-irm",{description:"Grafana IRM target backed by a configured Grafana IRM integration."}),integrationId:f({allowEmpty:!1,description:"Identifier of the Grafana IRM integration to use"}),renotifyConfig:wa},{$id:"RuleTargetInputGrafanaIrm"}),n.Object({type:n.Literal("microsoft-teams",{description:"Microsoft Teams target backed by a configured Microsoft Teams integration."}),integrationId:f({allowEmpty:!1,description:"Identifier of the Microsoft Teams integration to use"}),renotifyConfig:wa},{$id:"RuleTargetInputMicrosoftTeams"}),n.Object({type:n.Literal("webhook",{description:"Webhook target backed by a configured webhook integration."}),integrationId:f({allowEmpty:!1,description:"Identifier of the webhook integration to use"}),renotifyConfig:wa},{$id:"RuleTargetInputWebhook"}),n.Object({type:n.Literal("servicenow",{description:"ServiceNow target backed by a configured ServiceNow integration."}),integrationId:f({allowEmpty:!1,description:"Identifier of the ServiceNow integration to use"}),renotifyConfig:wa},{$id:"RuleTargetInputServiceNow"}),n.Object({type:n.Literal("google-chat",{description:"Google Chat target backed by a configured Google Chat integration."}),integrationId:f({allowEmpty:!1,description:"Identifier of the Google Chat integration to use"}),renotifyConfig:wa},{$id:"RuleTargetInputGoogleChat"}),n.Object({type:n.Literal("squadcast",{description:"Squadcast target backed by a configured Squadcast integration."}),integrationId:f({allowEmpty:!1,description:"Identifier of the Squadcast integration to use"}),renotifyConfig:wa},{$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:f({allowEmpty:!1,description:"Identifier of the Jira integration to use"}),projectKey:f({allowEmpty:!1,description:'Key of the Jira project that alert issues are filed into, like "OPS".'}),issueType:f({allowEmpty:!1,description:'Name of the Jira issue type created for alerts, like "Bug" or "Task".'}),openStatus:n.Optional(f({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(f({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)."})}),DF=Q("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."}),FF=Q("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(f(),{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."}),Em=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:DF,prioritiesFilter:n.Array(n.Enum(To),{description:"Monitor priorities that must match for this rule to fire. An empty array matches every priority."}),transitionTypesFilter:n.Array(n.Enum(ym),{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:H({description:"Timestamp when Tsuga created the rule."}),updatedAt:H({description:"Timestamp when Tsuga last updated the rule."}),isActive:n.Boolean({description:"Whether the rule currently sends notifications when its filters match."}),tags:br,targets:n.Array(rT,{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(Qe),updater:n.Optional(Qe)}),nT=n.Object({name:f({description:"Display name of the notification rule."}),queryString:Ut(f({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:FF,prioritiesFilter:n.Array(n.Enum(To),{maxItems:To.length,description:"Monitor priorities that must match for this rule to fire. An empty array matches every priority."}),transitionTypesFilter:n.Array(n.Enum(ym),{maxItems:ym.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(f({allowEmpty:!1}),{description:"Cluster IDs that must match for this rule to fire. Omit it, or leave it empty, to match every cluster."})),owner:f({allowEmpty:!1,description:"Team ID that owns and manages the rule"}),tags:wr,isActive:n.Boolean({description:"Set to true for the rule to send notifications when its filters match."}),targets:n.Array(Ig,{minItems:1,description:"Destinations that receive a notification whenever this rule matches an alert transition. This list replaces the existing targets on update."})}),oT=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:H({description:"Timestamp when Tsuga created the rule."}),updatedAt:H({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:br,monitorIds:n.Array(n.String(),{description:"Monitors this rule reacts to."}),sloIds:n.Array(n.String(),{description:"SLOs this rule reacts to."}),fallbackTarget:rT,creator:n.Optional(Qe),updater:n.Optional(Qe)}),hce=n.Object({name:f({description:"Display name of the adaptive notification rule."}),owner:f({allowEmpty:!1,description:"Team ID that owns and manages the rule"}),tags:wr,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(f({allowEmpty:!1}),{maxItems:100,description:"Monitors this rule reacts to. Only trace monitors and metric monitors over OTel span metrics are eligible. Send at least one monitor or SLO."})),sloIds:n.Optional(n.Array(f({allowEmpty:!1}),{maxItems:100,description:"SLOs this rule reacts to. Only SLOs over traces or OTel span metrics are eligible. Omit for a rule that reacts to monitors only; send at least one monitor or SLO."})),fallbackTarget:Ig}),qHe=["active","inactive"],jHe=["name","isActive","owner","tags","clusterIdsFilter","targets","type","updatedAt"],yce=n.Object({owners:qe(f({allowEmpty:!1}),{description:"Restrict results to rules owned by any of these team IDs.",maxItems:50}),searchQuery:ko({description:"Search query filter for notification rules.",valueDescription:"Case-insensitive substring matched against rule name and ID."}),tags:qe(Fn.items,{description:"Restrict results to rules that have at least one of the listed key/value tags.",maxItems:50}),destinations:qe(f({allowEmpty:!1}),{description:"Restrict results to rules that route to any of these email addresses or integration IDs.",maxItems:50}),clusterIds:qe(f({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(qHe,{description:"Restrict results to active or inactive rules."})}),HHe=n.Partial(n.Object({...je,filters:n.Partial(yce),sort:n.Object({by:n.Enum(jHe,{description:"Field to sort the returned notification rules by."}),direction:Le})})),KHe=n.Object({type:n.Literal("standard",{description:"Standard notification rule matched by query, tags, and destinations."}),...Em.properties}),zHe=n.Object({type:n.Literal("adaptive",{description:"Adaptive notification rule matched by selected monitors or SLOs."}),...oT.properties}),YHe=Q("type",[KHe,zHe]),VHe=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."})}),QHe=n.Object({tags:Dn,destinations:n.Array(VHe,{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."})})}),WHe=n.Object({filters:n.Optional(n.Partial(yce,{description:"Filters applied before collecting tag, destination, and active-count options."}))}),wgr=x({tags:["notification-rules"],url:`${va}/query`,method:"POST",paginated:!0,body:HHe,response:n.Array(YHe,{description:"Matching standard and adaptive notification rules after they are merged, sorted, and paginated."})}),vgr=x({tags:["notification-rules"],url:`${va}/options/query`,method:"POST",body:WHe,response:QHe}),Ugr=x({tags:["notification-rules"],url:va,method:"GET",paginated:!0,query:n.Object(je),response:n.Array(Em)}),Ngr=x({tags:["notification-rules"],url:`${va}/:id`,params:n.Object({id:f()}),method:"GET",response:Em}),kgr=x({tags:["notification-rules"],url:va,method:"POST",body:nT,response:Em}),Lgr=x({tags:["notification-rules"],url:`${va}/:id`,method:"PUT",params:n.Object({id:f()}),body:nT,response:Em}),Mgr=x({tags:["notification-rules"],url:`${va}/:id`,method:"DELETE",params:n.Object({id:f()}),response:ae}),Dgr=x({tags:["notification-rules"],url:`${va}/bulk-delete`,method:"DELETE",body:n.Object({ids:n.Array(f(),{uniqueItems:!0})}),response:n.Object({})}),_g=`${bg}/adaptive-rules`,Fgr=x({tags:["notification-rules"],url:_g,method:"GET",paginated:!0,query:n.Object(je),response:n.Array(oT)}),$gr=x({tags:["notification-rules"],url:`${_g}/:id`,params:n.Object({id:f()}),method:"GET",response:oT}),Ggr=x({tags:["notification-rules"],url:_g,method:"POST",body:hce,response:oT}),Bgr=x({tags:["notification-rules"],url:`${_g}/:id`,method:"PUT",params:n.Object({id:f()}),body:hce,response:oT}),qgr=x({tags:["notification-rules"],url:`${_g}/:id`,method:"DELETE",params:n.Object({id:f()}),response:ae}),jgr=x({tags:["notification-rules"],url:`${_g}/bulk-delete`,method:"DELETE",body:n.Object({ids:n.Array(f(),{uniqueItems:!0})}),response:n.Object({})}),Hgr=x({tags:["notification-integrations"],url:`${gce}/start`,method:"POST",response:n.Object({redirectUrl:n.String()})}),JHe=["google-chat","grafana-irm","incident-io","jira","microsoft-teams","pagerduty","servicenow","slack","squadcast","webhook"],Ece=n.Object({id:n.String(),name:n.String(),type:n.Enum(JHe),createdAt:H(),ruleCount:n.Number(),creator:n.Optional(Qe),owner:n.Optional(n.String({description:"ID of the team that owns the integration. Absent on integrations created before ownership was introduced."}))}),ZHe=["name","type","ruleCount","createdAt"],XHe=n.Object({searchQuery:ko({description:"Search query filter for notification integrations.",valueDescription:"Case-insensitive substring matched against integration name and ID."})}),eKe=n.Partial(n.Object({...je,filters:n.Partial(XHe),sort:n.Object({by:n.Enum(ZHe,{description:"Field to sort the returned notification integrations by."}),direction:Le})})),Kgr=x({tags:["notification-integrations"],url:`${xg}/query`,method:"POST",paginated:!0,body:eKe,response:n.Array(Ece,{description:"Matching notification integrations after they are filtered, sorted, and paginated."})}),zgr=x({tags:["notification-integrations"],url:`${va}/integrations`,method:"GET",paginated:!0,query:n.Object(je),response:n.Array(Ece)}),Ygr=x({tags:["notification-integrations"],url:`${gce}/callback`,method:"GET",query:n.Object({code:f()}),response:n.Object({success:n.Boolean()})}),$F=["POST","PUT"],tKe=n.Record(n.String(),n.String()),rKe=n.Record(n.String(),n.Unknown()),nKe=n.Record(n.String(),n.Union([n.String(),n.Number(),n.Boolean(),n.Null(),n.Array(n.Union([n.String(),n.Number(),n.Boolean()]))])),oKe=Q("type",[n.Object({type:n.Literal("json"),value:rKe}),n.Object({type:n.Literal("form"),value:nKe})]),iKe=n.Object({ok:n.String(),alert:n.String()}),iT=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:Q("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($F),authentication:mce,customHeaders:n.Optional(tKe),payloadTemplate:oKe,eventNameMapping:n.Optional(iKe)}),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:br}),sKe=n.Object({type:n.Literal("webhook"),url:f({type:"uri"}),method:n.Enum($F),authentication:dce,customHeaders:n.Record(f({allowEmpty:!1}),f()),payloadTemplate:Q("type",[n.Object({type:n.Literal("json"),value:n.Record(f({allowEmpty:!1}),n.Unknown())}),n.Object({type:n.Literal("form"),value:n.Record(f({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:f({allowEmpty:!1}),alert:f({allowEmpty:!1})}))}),Sce=n.Object({type:n.Literal("incident-io"),alertSourceConfigId:f(),token:f()}),Tce=n.Object({type:n.Literal("grafana-irm"),url:f({type:"uri"})}),bce=n.Object({type:n.Literal("pagerduty"),integrationKey:f()}),xce=n.Object({type:n.Literal("microsoft-teams"),webhookUrl:f({type:"uri"})}),aKe=n.Object({type:n.Literal("servicenow"),instanceName:f({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:f({allowEmpty:!1}),password:f({allowEmpty:!1})}),cKe=n.Object({type:n.Literal("google-chat"),webhookUrl:f({type:"uri"})}),lKe=n.Object({type:n.Literal("squadcast"),webhookUrl:f({type:"uri"})}),uKe=n.Object({type:n.Literal("jira"),siteUrl:f({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:f({type:"email",allowEmpty:!1,description:"Atlassian account email used together with the API token for Basic authentication."}),apiToken:f({allowEmpty:!1,description:"Atlassian API token minted for the account, used as the Basic auth password."})}),Ice=f({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."}),GF=n.Object({name:f(),owner:Ice,setting:Q("type",[Sce,Tce,bce,xce,sKe,aKe,cKe,lKe,uKe]),tags:wr}),pKe=n.Object({type:n.Literal("webhook"),url:n.Optional(f({type:"uri"})),method:n.Optional(n.Enum($F)),authentication:n.Optional(fce),customHeaders:n.Optional(n.Record(f({allowEmpty:!1}),f())),payloadTemplate:n.Optional(Q("type",[n.Object({type:n.Literal("json"),value:n.Record(f({allowEmpty:!1}),n.Unknown())}),n.Object({type:n.Literal("form"),value:n.Record(f({allowEmpty:!1}),n.Union([n.String(),n.Number(),n.Boolean(),n.Null(),n.Array(n.Union([n.String(),n.Number(),n.Boolean()]))]))})])),eventNameMapping:Ut(n.Object({ok:n.Optional(f({allowEmpty:!1})),alert:n.Optional(f({allowEmpty:!1}))}))}),mKe=n.Object({type:n.Literal("servicenow"),instanceName:n.Optional(f({allowEmpty:!1})),username:n.Optional(f({allowEmpty:!1})),password:n.Optional(f({allowEmpty:!1}))}),dKe=n.Object({type:n.Literal("jira"),siteUrl:n.Optional(f({type:"uri",allowEmpty:!1})),email:n.Optional(f({allowEmpty:!1})),apiToken:n.Optional(f({allowEmpty:!1}))}),fKe=n.Object({type:n.Literal("google-chat"),webhookUrl:f({type:"uri"})}),gKe=n.Object({type:n.Literal("squadcast"),webhookUrl:f({type:"uri"})}),BF=n.Object({name:n.Optional(f()),owner:Ice,tags:wr,setting:n.Optional(Q("type",[Sce,Tce,bce,xce,pKe,mKe,fKe,gKe,dKe]))}),Vgr=x({tags:["notification-integrations"],url:xg,method:"POST",body:GF,response:iT}),Qgr=x({tags:["notification-integrations"],url:`${xg}/:id`,method:"GET",params:n.Object({id:f()}),response:iT}),Wgr=x({tags:["notification-integrations"],url:`${xg}/:id`,method:"PATCH",params:n.Object({id:f()}),body:BF,response:iT}),Jgr=x({tags:["notification-integrations"],url:`${xg}/:id`,method:"DELETE",params:n.Object({id:f()}),response:ae}),hKe=Q("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."}),Zgr=x({tags:["notification-integrations"],url:`${xg}/:id/jira-metadata`,method:"GET",params:n.Object({id:f()}),response:hKe}),Xgr=x({tags:["notification-rules"],url:`${bo}/:id/notifications`,method:"GET",params:n.Object({id:f()}),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($He),tryCount:n.Number(),nextTryAt:H(),createdAt:H(),updatedAt:H(),sentAt:n.Optional(H())})),isTruncated:n.Boolean()})}),yKe=["slack","incident-io","pagerduty","email","grafana-irm","microsoft-teams","webhook","servicenow","google-chat","squadcast","jira"],ehr=x({tags:["notification-rules"],url:`${va}/test`,method:"POST",body:n.Object({notificationRule:nT,targetIds:n.Optional(n.Array(f({allowEmpty:!1}),{description:"Target IDs to test specific targets",minItems:1,maxItems:10}))}),response:n.Union([n.Object({success:n.Literal(!1),overallMessage:n.String({description:"Message when there is an overall error"})}),n.Object({success:n.Boolean(),results:n.Array(n.Object({targetId:n.String({description:"The ID of the target that was tested"}),targetType:n.Enum(yKe,{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 sT=`/${"v1"}/notification-integrations`,aT=n.Pick(iT,["id","name","owner","setting","tags"],{$id:"NotificationIntegration",description:"A reusable external destination that notification rules can send to. See [Integrations](/documentation/alert/notifications/index#integrations). Slack integrations are OAuth-based and are not readable, creatable, or editable through this API; connect Slack from the app."}),EKe={id:"456-def-abc",name:"Primary on-call",owner:"team-123-abc",setting:{type:"pagerduty",integrationKeyLastChars:"ab12"},tags:[{key:"team",value:"platform"}]};Object.assign(aT,{examples:[EKe]});var _ce=x({description:"Lists non-OAuth notification integrations visible to the authenticated operation key. Slack integrations do not appear here because they are OAuth-based. Pagination fields limit the returned page.",operationId:"listNotificationIntegrations",tags:["public","notification-integrations"],url:sT,method:"GET",paginated:!0,query:n.Object(er),response:n.Array(aT)}),Ace=x({description:"Retrieves one non-OAuth notification integration by ID.",operationId:"getNotificationIntegration",tags:["notification-integrations"],url:`${sT}/:id`,method:"GET",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the notification integration to retrieve. Use the `id` returned by notification integration list or create responses."})}),response:aT}),Oce=n.Pick(GF,["name","owner","setting","tags"],{description:"Notification integration create request containing the display name, owning team, destination setting, and tags. `setting.type` cannot be `slack`; add Slack integrations from the app instead."}),SKe={name:"Primary on-call",owner:"team-123-abc",setting:{type:"pagerduty",integrationKey:"abcdef1234567890ab12"},tags:[{key:"team",value:"platform"}]};Object.assign(Oce,{examples:[SKe]});var Cce=x({description:"Creates a non-OAuth notification integration that notification rules can target as a destination.",operationId:"createNotificationIntegration",tags:["notification-integrations"],url:sT,method:"POST",body:Oce,response:aT}),Rce=n.Pick(BF,["name","owner","setting","tags"],{description:"Notification integration update request. `owner` has to be sent on every update; the other omitted fields keep their existing values."}),TKe={name:"Primary on-call",owner:"team-123-abc"};Object.assign(Rce,{examples:[TKe]});var Pce=x({description:"Updates an existing non-OAuth notification integration by ID. `owner` has to be sent on every update, even when it does not change. The submitted `setting` is overwritten in full; the other omitted fields keep their existing values.",operationId:"updateNotificationIntegration",tags:["notification-integrations"],url:`${sT}/:id`,method:"PUT",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the notification integration to update. Use the `id` returned by notification integration list, get, or create responses."})}),body:Rce,response:aT}),wce=x({description:"Deletes a non-OAuth notification integration by ID. Deletion is blocked while a notification rule still targets the integration; remove it from those rules first.",operationId:"deleteNotificationIntegration",tags:["notification-integrations"],url:`${sT}/:id`,method:"DELETE",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the notification integration to delete. Use the `id` returned by notification integration list, get, or create responses."})}),response:ae});var vce=_t({commandName:"notification-integrations",description:"Manage notification integrations",endpoints:{list:_ce,get:Ace,create:Cce,update:Pce,delete:wce}});var cT=`/${"v1"}/notification-rules`,lT=n.Pick(Em,["id","name","queryString","teamsFilter","prioritiesFilter","transitionTypesFilter","clusterIdsFilter","owner","isActive","tags","targets"],{$id:"Rule",description:"Notification rule that matches alert transitions and routes notifications to one or more targets. See [Rules](/documentation/alert/notifications/rules)."}),Uce={name:"Critical Alerts",queryString:"env:prod service:api",teamsFilter:{type:"all-public-teams"},prioritiesFilter:[1,2],transitionTypesFilter:["triggered","resolved"],clusterIdsFilter:[],owner:"team-123-abc",isActive:!0,tags:[{key:"channel",value:"alerts"}],targets:[{id:"789-abc-def",rateLimit:{maxMessages:10,minutes:5},config:{type:"email",addresses:["oncall@example.com"],renotifyConfig:{mode:"each",renotificationStates:["alert"],renotifyIntervalMinutes:30}}}]},bKe={id:"123-456-abc",...Uce};Object.assign(lT,{examples:[bKe]});var Nce=x({description:"Lists notification rules visible to the authenticated operation key. Use this endpoint to audit alert delivery routing. Pagination fields limit the returned page.",operationId:"listNotificationRules",tags:["notification-rules"],url:cT,method:"GET",paginated:!0,query:n.Object(er),response:n.Array(lT)}),kce=x({description:"Retrieves one notification rule by ID.",operationId:"getNotificationRule",tags:["notification-rules"],url:`${cT}/:id`,method:"GET",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the notification rule to retrieve. Use the `id` returned by notification rule list or create responses."})}),response:lT}),qF=n.Pick(nT,["name","queryString","teamsFilter","prioritiesFilter","transitionTypesFilter","clusterIdsFilter","owner","tags","isActive","targets"],{description:"Notification rule create or update request. Provide matching filters, owner, tags, active state, and delivery targets."}),xKe=Uce;Object.assign(qF,{examples:[xKe]});var Lce=x({description:"Creates a notification rule that matches alert transitions and sends notifications to configured targets. Monitors keep evaluating separately from notification rules.",operationId:"createNotificationRule",tags:["notification-rules"],url:cT,method:"POST",body:qF,response:lT}),Mce=x({description:"Updates an existing notification rule by ID. Required fields and the submitted target list are overwritten; omitted optional fields keep their existing values.",operationId:"updateNotificationRule",tags:["notification-rules"],url:`${cT}/:id`,method:"PUT",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the notification rule to update. Use the `id` returned by notification rule list, get, or create responses."})}),body:qF,response:lT}),IKe=n.Object({id:f({allowEmpty:!1,description:"Identifier of the notification rule to delete. Use the `id` returned by notification rule list, get, create, or update responses."})}),Dce=x({description:"Deletes a notification rule by ID. Alerting monitors continue to evaluate, but this rule no longer sends notifications.",operationId:"deleteNotificationRule",tags:["notification-rules"],url:`${cT}/:id`,method:"DELETE",params:IKe,response:ae});var Fce=_t({commandName:"notification-rules",description:"Manage notification rules",endpoints:{list:Nce,get:kce,create:Lce,update:Mce,delete:Dce}});var yu=`${bg}/silences`,_Ke=["active","inactive"],Gce=n.Union([n.Literal("monday"),n.Literal("tuesday"),n.Literal("wednesday"),n.Literal("thursday"),n.Literal("friday"),n.Literal("saturday"),n.Literal("sunday")]),AKe=n.Partial(n.Record(Gce,n.Array(n.Object({startTime:n.String({format:_L,description:"Local start time for this recurring silence window on this day, using the schedule time zone."}),endTime:n.String({format:_L,description:"Local end time for this recurring silence window on this day. It must be after `startTime`, and ranges on the same day cannot overlap."})},{title:"SilenceTimeRange"}),{minItems:1,description:"Silence windows for this day. Each window uses the schedule time zone, and windows on the same day cannot overlap."})),{description:"Recurring silence windows keyed by day of week, evaluated in the schedule `timeZone` or in UTC when it is omitted. At least one day must be listed, and a day with no entry is never silenced. Each window covers `startTime` up to but not including `endTime`."}),OKe=n.Partial(n.Record(Gce,n.Array(n.Object({startTime:n.String({description:"Local start time for this recurring silence window on this day, using the schedule time zone."}),endTime:n.String({description:"Local end time for this recurring silence window on this day. It must be after `startTime`, and ranges on the same day cannot overlap."})},{title:"SilenceTimeRange"}),{description:"Silence windows for this day. Each window uses the schedule time zone, and windows on the same day cannot overlap."})),{description:"Recurring silence windows keyed by day of week, evaluated in the schedule `timeZone` or in UTC when it is omitted. A day with no entry is never silenced. Each window covers `startTime` up to but not including `endTime`."}),WC='IANA timezone identifier (e.g. "America/New_York"). Defaults to UTC if omitted.',Bce="One-time silence schedule with specific start and end times",qce="Recurring weekly silence schedule",CKe=Q("type",[n.Object({type:n.Literal("one-time",{description:"Silence active once between the configured start and end times."}),startTime:n.String({format:AL,description:"Local start date and time for the one-time silence, interpreted in `timeZone` when provided."}),endTime:n.String({format:AL,description:"Local end date and time for the one-time silence. It must be after `startTime` and in the future."}),timeZone:n.Optional(n.String({format:Dp,description:WC}))},{$id:"InputSilenceScheduleOneTime",description:Bce}),n.Object({type:n.Literal("recurring",{description:"Silence active on a recurring weekly schedule."}),weeklySchedule:AKe,timeZone:n.Optional(n.String({format:Dp,description:WC}))},{$id:"InputSilenceScheduleRecurring",description:qce})],{description:"Schedule defining when the silence is active. The `type` field discriminates between a `one-time` window and a `recurring` weekly window. Once a one-time schedule's `endTime` passes, or a recurring window closes, the silence stops suppressing notifications but is not deleted; delete it explicitly if it is no longer needed."}),RKe=Q("type",[n.Object({type:n.Literal("one-time",{description:"Silence active once between the configured start and end times."}),startTime:n.String({description:"Local start date and time for the one-time silence, interpreted in `timeZone` when provided."}),endTime:n.String({description:"Local end date and time for the one-time silence. It must be after `startTime` and in the future when created or updated."}),timeZone:n.Optional(n.String({description:WC}))},{$id:"OutputSilenceScheduleOneTime",description:Bce}),n.Object({type:n.Literal("recurring",{description:"Silence active on a recurring weekly schedule."}),weeklySchedule:OKe,timeZone:n.Optional(n.String({description:WC}))},{$id:"OutputSilenceScheduleRecurring",description:qce})],{description:"Schedule defining when the silence is active. The `type` field discriminates between a `one-time` window and a `recurring` weekly window. Once a one-time schedule's `endTime` passes, or a recurring window closes, the silence stops suppressing notifications but is not deleted; delete it explicitly if it is no longer needed."}),PKe="monitor_id",jce=`Query on the alerting monitor tags and group-by dimensions, e.g. \`env:prod AND service:bridge\`. The monitor itself can be targeted with \`${PKe}:<monitor id>\`.`,JC=n.Object({name:f({description:"Display name of the silence"}),reason:f({allowEmpty:!1,type:"long",description:"Free-text explanation of why notifications are being silenced, shown to other operators reviewing active silences."}),owner:f({allowEmpty:!1,description:"Team ID that owns and manages the silence"}),tags:wr,isActive:n.Boolean({description:"Set to true for the silence to suppress matching notifications while its schedule is active. Set to false to keep the silence without suppressing anything."}),schedule:CKe,notificationRuleIds:Ut(n.Array(f()),{description:"Notification rule IDs this silence applies to directly, matching any notification produced by one of these rules regardless of priority or transition type. Mutually exclusive with `prioritiesFilter`, `transitionTypesFilter`, and `queryString`: a request combining this field with any of those is rejected."}),queryString:Ut(f({type:"tags-query"}),{description:jce}),teamsFilter:FF,prioritiesFilter:n.Array(n.Enum(To),{maxItems:To.length,description:"Monitor priorities that must match for this silence to apply. An empty array matches every priority."}),transitionTypesFilter:n.Array(n.Enum(ym),{maxItems:ym.length,description:"Alert state transitions that must match for this silence to apply. An empty array matches every transition type."})}),Sm=n.Object({id:n.String({description:"Tsuga-generated notification silence ID assigned when the silence is created."}),name:n.String({description:"Display name of the silence"}),reason:n.String({description:"Free-text explanation of why notifications are being silenced, shown to other operators reviewing active silences."}),owner:n.String({description:"Team ID that owns and manages the silence"}),tags:br,isActive:n.Boolean({description:"Whether the silence suppresses matching notifications while its schedule is active. When false, the silence is kept but never suppresses anything."}),schedule:RKe,notificationRuleIds:n.Optional(n.Array(n.String(),{description:"Notification rule IDs this silence applies to directly, matching any notification produced by one of these rules regardless of priority or transition type. Set only when `prioritiesFilter`, `transitionTypesFilter`, and `queryString` are not used to filter alerts."})),queryString:n.Optional(n.String({description:jce})),teamsFilter:DF,prioritiesFilter:n.Array(n.Enum(To),{description:"Monitor priorities that must match for this silence to apply. An empty array matches every priority."}),transitionTypesFilter:n.Array(n.Enum(ym),{description:"Alert state transitions that must match for this silence to apply. An empty array matches every transition type."}),createdAt:H(),updatedAt:H(),creator:n.Optional(Qe),updater:n.Optional(Qe)}),$ce=["one-time","recurring"];var wKe=["name","isActive","schedule","owner","tags","updatedAt"],Hce=n.Object({owners:qe(f({allowEmpty:!1}),{description:"Restrict results to silences owned by any of these team IDs.",maxItems:50}),searchQuery:ko({description:"Search query filter for notification silences.",valueDescription:"Case-insensitive substring matched against silence name and ID."}),tags:qe(Fn.items,{description:"Restrict results to silences that have at least one of the listed key/value tags.",maxItems:50}),scheduleTypes:qe(n.Enum($ce),{description:"Restrict results to silences with these schedule types.",maxItems:$ce.length}),status:n.Enum(_Ke,{description:"Restrict results to effectively active or inactive silences."})}),vKe=n.Partial(n.Object({...je,filters:n.Partial(Hce),sort:n.Object({by:n.Enum(wKe,{description:"Field to sort the returned notification silences by."}),direction:Le})})),UKe=n.Object({tags:Dn,activeCounts:n.Object({totalCount:n.Integer({description:"Total number of matching silences regardless of whether they are active."}),active:n.Integer({description:"Number of matching silences that are active, meaning enabled with a schedule that has not expired."}),inactive:n.Integer({description:"Number of matching silences that are disabled or whose schedule has expired."})})}),NKe=n.Object({filters:n.Optional(n.Partial(Hce,{description:"Filters applied before collecting tag and active-count options."}))}),Lhr=x({tags:["notification-silences"],url:`${yu}/query`,method:"POST",paginated:!0,body:vKe,response:n.Array(Sm,{description:"Matching notification silences after they are filtered, sorted, and paginated."})}),Mhr=x({tags:["notification-silences"],url:`${yu}/options/query`,method:"POST",body:NKe,response:UKe}),Dhr=x({tags:["notification-silences"],url:yu,method:"GET",response:n.Array(Sm)}),Fhr=x({tags:["notification-silences"],url:`${yu}/:id`,params:n.Object({id:f()}),method:"GET",response:Sm}),$hr=x({tags:["notification-silences"],url:yu,method:"POST",body:JC,response:Sm}),Ghr=x({tags:["notification-silences"],url:`${yu}/:id`,method:"PUT",params:n.Object({id:f()}),body:JC,response:Sm}),Bhr=x({tags:["notification-silences"],url:`${yu}/:id`,method:"DELETE",params:n.Object({id:f()}),response:ae}),qhr=x({tags:["notification-silences"],url:`${yu}/bulk-delete`,method:"DELETE",body:n.Object({ids:n.Array(f(),{uniqueItems:!0})}),response:n.Object({})});var uT=`/${"v1"}/notification-silences`,pT=n.Pick(Sm,["id","name","reason","owner","tags","isActive","schedule","notificationRuleIds","queryString","teamsFilter","prioritiesFilter","transitionTypesFilter"],{$id:"NotificationSilence",description:"Scheduled mute rule that suppresses matching notification delivery while monitors continue evaluating. See [Silences](/documentation/alert/notifications/silences)."}),kKe={id:"sil-weekend-maintenance",name:"Weekend maintenance",reason:"Suppress expected alerts during the weekly maintenance window.",owner:"team-123-abc",tags:[{key:"environment",value:"production"}],isActive:!0,schedule:{type:"recurring",weeklySchedule:{saturday:[{startTime:"02:00",endTime:"06:00"}],sunday:[{startTime:"02:00",endTime:"06:00"}]},timeZone:"UTC"},teamsFilter:{type:"specific-teams",teams:["team-123-abc"]},prioritiesFilter:[1,2],transitionTypesFilter:["triggered","resolved"]},LKe={id:"sil-critical-routing",name:"Critical routing maintenance",reason:"Temporarily suppress notifications from the critical routing rule.",owner:"team-123-abc",tags:[{key:"change",value:"chg-1234"}],isActive:!0,schedule:{type:"one-time",startTime:"2026-07-04T02:00:00",endTime:"2026-07-04T04:00:00",timeZone:"UTC"},notificationRuleIds:["rule-critical-routing"],teamsFilter:{type:"specific-teams",teams:["team-123-abc"]},prioritiesFilter:[],transitionTypesFilter:[]};Object.assign(pT,{examples:[kKe,LKe]});var Kce=x({description:"Lists notification silences visible to the authenticated operation key. Use this endpoint to audit maintenance windows and notification muting rules.",operationId:"listNotificationSilences",tags:["notification-silences"],url:uT,method:"GET",response:n.Array(pT)}),zce=x({description:"Retrieves one notification silence by ID.",operationId:"getNotificationSilence",tags:["notification-silences"],url:`${uT}/:id`,method:"GET",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the notification silence to retrieve. Use the `id` returned by notification silence list or create responses."})}),response:pT}),jF=n.Pick(JC,["name","reason","owner","tags","isActive","schedule","notificationRuleIds","queryString","teamsFilter","prioritiesFilter","transitionTypesFilter"],{description:"Notification silence create or update request. Provide the mute reason, owner, schedule, filters, active state, and tags."}),MKe={name:"Weekend maintenance",reason:"Suppress expected alerts during the weekly maintenance window.",owner:"team-123-abc",tags:[{key:"environment",value:"production"}],isActive:!0,schedule:{type:"recurring",weeklySchedule:{saturday:[{startTime:"02:00",endTime:"06:00"}],sunday:[{startTime:"02:00",endTime:"06:00"}]},timeZone:"UTC"},teamsFilter:{type:"specific-teams",teams:["team-123-abc"]},prioritiesFilter:[1,2],transitionTypesFilter:["triggered","resolved"]},DKe={name:"Critical routing maintenance",reason:"Temporarily suppress notifications from the critical routing rule.",owner:"team-123-abc",tags:[{key:"change",value:"chg-1234"}],isActive:!0,schedule:{type:"one-time",startTime:"2026-07-04T02:00:00",endTime:"2026-07-04T04:00:00",timeZone:"UTC"},notificationRuleIds:["rule-critical-routing"],teamsFilter:{type:"specific-teams",teams:["team-123-abc"]},prioritiesFilter:[],transitionTypesFilter:[]};Object.assign(jF,{examples:[MKe,DKe]});var Yce=x({description:"Creates a notification silence. Matching notifications that have not yet been sent are suppressed as soon as the schedule becomes active, including ones already queued when the silence is created; monitor evaluation itself is not paused, so alerts still transition and are visible in the UI.",operationId:"createNotificationSilence",tags:["notification-silences"],url:uT,method:"POST",body:jF,response:pT}),Vce=x({description:"Updates an existing notification silence by ID. Required fields are overwritten; omitted optional fields keep their existing values.",operationId:"updateNotificationSilence",tags:["notification-silences"],url:`${uT}/:id`,method:"PUT",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the notification silence to update. Use the `id` returned by notification silence list, get, or create responses."})}),body:jF,response:pT}),FKe=n.Object({id:f({allowEmpty:!1,description:"Identifier of the notification silence to delete. Use the `id` returned by notification silence list, get, create, or update responses."})}),Qce=x({description:"Deletes a notification silence. Any notification not yet sent is re-evaluated against the remaining silences and, if none match, is delivered normally; notifications already marked as silenced are not resent.",operationId:"deleteNotificationSilence",tags:["notification-silences"],url:`${uT}/:id`,method:"DELETE",params:FKe,response:ae});var Wce=_t({commandName:"notification-silences",description:"Manage notification silences",endpoints:{list:Kce,get:zce,create:Yce,update:Vce,delete:Qce}});var $Ke="tsuga_rum:v1:";var Jce=100,Zce=["web","ios","android"],Xce="Kind of application the token is issued for. Only `web` telemetry is checked against `allowedUrlPrefixes`, since mobile applications do not send an `Origin` header.",Ag=n.Object({id:n.String({description:"Tsuga-generated RUM public token ID assigned when the token is created."}),name:n.String({description:"Human-readable token name. Names must be kebab-case when creating or updating tokens."}),token:n.String({description:`Full token value, prefixed with \`${$Ke}\`, to configure in the RUM browser or mobile SDK. RUM tokens are public by design, so the value is not masked on subsequent reads and never changes after creation.`}),owner:n.String({description:"Team ID that owns and manages the RUM public token."}),applicationType:n.Enum(Zce,{description:Xce}),allowedUrlPrefixes:n.Array(n.String(),{description:"URL prefixes which RUM telemetry data can be sent from. Supports wildcard matching. Always empty for `ios` and `android` applications."}),tags:Dn,teamOverrideFields:n.Optional(n.Array(n.String(),{description:"Telemetry attribute names used to override ownership for data sent with this token."})),updatedAt:H({description:"Timestamp when the token metadata was last updated."}),createdAt:H({description:"Timestamp when the token was created."}),creator:n.Optional(Qe),updater:n.Optional(Qe),assetUpdatedAt:H({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})}),mT=n.Object({name:n.String({format:Jl,minLength:1,maxLength:Jce,description:`Kebab-case name for the RUM public token. Maximum length is ${Jce} characters.`}),owner:f({allowEmpty:!1,description:"Team ID that will own and manage the RUM public token."}),applicationType:n.Enum(Zce,{description:`${Xce} Fixed at creation: an update must resend the token's current value.`}),allowedUrlPrefixes:n.Array(n.String({format:Y7}),{description:"URL prefixes which RUM telemetry data can be sent from. Supports wildcard matching. At least one prefix is required for `web` applications, and the array must be empty for `ios` and `android` applications."}),tags:Fn,teamOverrideFields:n.Union([n.Array(f({allowEmpty:!1}),{minItems:1,maxItems:HS,description:`Array form. Up to ${HS} fields are allowed.`}),n.Null({description:"Clear any existing team override fields."})],{description:"Telemetry attribute names used to override ownership for data sent with this token. Send null to clear existing override fields."})}),Og="/v0/rum-public-tokens",cyr=x({tags:["rum-public-tokens"],url:Og,method:"POST",body:mT,response:Ag}),lyr=x({tags:["rum-public-tokens"],url:Og,method:"GET",paginated:!0,query:n.Object(je),response:n.Array(Ag)}),uyr=x({tags:["rum-public-tokens"],url:`${Og}/:id`,method:"GET",params:n.Object({id:f({allowEmpty:!1})}),response:Ag}),pyr=x({tags:["rum-public-tokens"],url:`${Og}/:id`,method:"PUT",params:n.Object({id:f({allowEmpty:!1})}),body:mT,response:Ag}),myr=x({tags:["rum-public-tokens"],url:`${Og}/:id`,method:"DELETE",params:n.Object({id:f({allowEmpty:!1})}),response:ae}),dyr=x({tags:["rum-public-tokens"],url:`${Og}/bulk-delete`,method:"DELETE",body:n.Object({ids:n.Array(f({allowEmpty:!1}),{uniqueItems:!0})}),response:n.Object({})});var dT=`/${"v1"}/public-tokens`,fT=n.Pick(Ag,["id","name","token","owner","applicationType","allowedUrlPrefixes","tags","teamOverrideFields"],{$id:"PublicToken",description:"Public token used by the RUM browser and mobile SDKs to send real user monitoring data to Tsuga. The token value is public by design and is included in every response. See [API keys](/documentation/account-and-settings/api-keys)."}),GKe={id:"123-456-abc",name:"my-web-app",token:"tsuga_rum:v1:abc123xyzABC123xyzABC123",owner:"team-123-abc",applicationType:"web",allowedUrlPrefixes:["https://app.example.com"],tags:[{key:"env",value:"production"}],teamOverrideFields:["service"]};Object.assign(fT,{examples:[GKe]});var ele=n.Pick(mT,["name","owner","applicationType","allowedUrlPrefixes","tags","teamOverrideFields"],{$id:"CreatePublicTokenRequest",description:"RUM public token creation request. Provide a kebab-case name, owner team, application type, allowed URL prefixes (required for `web`, empty for `ios` and `android`), tags including an `env` tag, and team override fields as an array of fields or null."}),tle={name:"my-web-app",owner:"team-123-abc",applicationType:"web",allowedUrlPrefixes:["https://app.example.com"],tags:[{key:"env",value:"production"}],teamOverrideFields:null};Object.assign(ele,{examples:[tle]});var rle=n.Pick(mT,["name","owner","applicationType","allowedUrlPrefixes","tags","teamOverrideFields"],{$id:"UpdatePublicTokenRequest",description:"RUM public token update request. Provide the full definition, including name, owner team, allowed URL prefixes, tags including an `env` tag, and team override fields. The application type must match the existing token and the token value itself never changes."});Object.assign(rle,{examples:[tle]});var nle=x({description:"Lists RUM public tokens visible to the authenticated operation key. Use this to inventory the tokens configured in browser and mobile applications, with their owners, allowed URL prefixes, and tags. Pagination fields limit the returned page.",operationId:"listPublicTokens",tags:["public-tokens"],url:dT,method:"GET",paginated:!0,query:n.Object(er),response:n.Array(fT)}),ole=x({description:"Retrieves one RUM public token by ID, including the full token value to configure in the SDK.",operationId:"getPublicToken",tags:["public-tokens"],url:`${dT}/:id`,method:"GET",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the public token to retrieve. Use the `id` returned by public token list or create responses."})}),response:fT}),ile=x({description:"Creates a RUM public token for a browser or mobile application. The response includes the full token value to configure in the SDK; it can be read again later with the get and list operations.",operationId:"createPublicToken",tags:["public-tokens"],url:dT,method:"POST",body:ele,response:fT}),sle=x({description:"Updates RUM public token metadata by ID, including name, owner, application type, allowed URL prefixes, tags, and team override fields. Every field is required: the application type is fixed at creation, so resend the token's current value. The token value is not rotated by this operation.",operationId:"updatePublicToken",tags:["public-tokens"],url:`${dT}/:id`,method:"PUT",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the public token to update. Use the `id` returned by public token list, get, or create responses."})}),body:rle,response:fT}),ale=x({description:"Deletes a RUM public token by ID. Applications configured with the deleted token can no longer send RUM data with it.",operationId:"deletePublicToken",tags:["public-tokens"],url:`${dT}/:id`,method:"DELETE",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the public token to delete. Use the `id` returned by public token list, get, or create responses."})}),response:ae});var cle=_t({commandName:"public-tokens",description:"Manage public tokens used by the RUM browser and mobile SDKs",endpoints:{list:nle,get:ole,create:ile,update:sle,delete:ale}});var BKe={critical:3,important:2,normal:1},Tt=e=>({label:e,weight:BKe[e]}),qKe={"unrouted-logs":{key:"unrouted-logs",title:"Logs with no matching route",summary:"Any log that reaches processing without a matched route is flagged.",rationale:"Close gaps by ensuring each event flows through a governed route.",objectType:"route",category:"observability-assets",impact:Tt("important"),recommendation:"Ensure each team maintains a route that captures all of its logs exactly once."},"no-over-routed-logs":{key:"no-over-routed-logs",title:"No logs matching 3+ routes",summary:"Detects logs that match 3 or more processing routes during the lookback window.",rationale:"A log usually only needs one or two routes. Matching many routes typically means the route queries overlap unintentionally, multiplying the processing and storage cost without adding observability value.",objectType:"route",category:"observability-assets",impact:Tt("important"),recommendation:"Review the route queries owned by this team for overlap. Tighten the filter on each route so a given log matches the minimum number of routes needed (usually one)."},"team-has-route":{key:"team-has-route",title:"\u22651 route per team",summary:"Each team owns at least one active route that filters on its team name.",rationale:"Provides clear governance boundaries for routing and enrichment.",objectType:"route",category:"observability-assets",impact:Tt("important"),recommendation:"Ensure every team manages a dedicated route scoped to its context.team value."},"no-team-override-mismatch":{key:"no-team-override-mismatch",title:`${oM} matches ${NO}`,summary:`Detects logs and spans whose ${oM} resource attribute names a different team than the ${NO} resolved at ingestion.`,rationale:`${NO} is reserved and comes from the ingestion API key, so a \`team\` resource attribute never reassigns ownership. A disagreement means the sender expects an ownership Tsuga did not apply.`,objectType:"resource",category:"telemetry-hygiene",impact:Tt("important"),recommendation:"Drop the `team` resource attribute, or set the ingestion API key team override fields to read ownership from a differently named attribute."},"service-name-present":{key:"service-name-present",title:`${kO} present`,summary:`Logs and spans must populate ${kO} with a non-empty value.`,rationale:"Core identifier used to correlate telemetry across services.",objectType:"resource",category:"telemetry-hygiene",impact:Tt("critical"),recommendation:`Populate ${kO} in all log and span payloads.`},"no-orphan-spans":{key:"no-orphan-spans",title:"No orphan spans",summary:"Every span with parent_span_id references an existing span in the same trace.",rationale:"Trace integrity depends on preserving parent-child hierarchies.",objectType:"span",category:"telemetry-hygiene",impact:Tt("normal"),recommendation:"Emit parent spans before their children so references always resolve."},"metric-unit-consistency":{key:"metric-unit-consistency",title:"Name\u2192unit consistency",summary:"All series for a metric name report the same UCUM-compliant unit across the lookback period.",rationale:"Avoid ambiguity when charting and alerting on metrics with shared names.",objectType:"metric",category:"telemetry-hygiene",impact:Tt("important"),recommendation:"Align exporters so each metric name emits a single consistent unit across services and environments."},"host-name-present":{key:"host-name-present",title:`${aS} presence`,summary:`Logs and spans must populate ${aS} with a non-empty value.`,rationale:"Core identifier used to correlate telemetry across services.",objectType:"resource",category:"telemetry-hygiene",impact:Tt("important"),recommendation:`Populate ${aS} in all log and span payloads.`},"inconsistent-attribute-naming":{key:"inconsistent-attribute-naming",title:"Consistent attribute naming",summary:"Detects attributes with multiple naming variants (e.g., userId vs user_id).",rationale:"Consistent naming improves queryability.",objectType:"log",category:"telemetry-hygiene",impact:Tt("normal"),recommendation:"Standardize attribute naming conventions across all log sources."},"no-duplicate-attr-values":{key:"no-duplicate-attr-values",title:"No duplicate attribute values",summary:"Detects when different attributes consistently carry identical values across logs (e.g., err.type and error.type always having the same value).",rationale:"Redundant attributes waste storage and complicate querying. Consolidate to one.",objectType:"log",category:"telemetry-hygiene",impact:Tt("normal"),recommendation:"Consolidate duplicate attributes at the source to reduce storage costs."},"no-debug-logs-in-prod":{key:"no-debug-logs-in-prod",title:"No DEBUG logs in production",summary:"Detects DEBUG-level logs emitted in production environments.",rationale:"DEBUG logs in production increase costs and risk exposing sensitive data.",objectType:"log",category:"telemetry-hygiene",impact:Tt("important"),recommendation:"Remove DEBUG-level logging from production environment or adjust log level configuration."},"no-multiline-logs":{key:"no-multiline-logs",title:"No ungrouped multiline logs",summary:"Detects orphaned stack-trace and traceback continuation lines that should have been grouped into a single log entry by the collector.",rationale:"Ungrouped multiline logs fragment errors across many entries, making them harder to read, search, and alert on.",objectType:"log",category:"telemetry-hygiene",impact:Tt("important"),recommendation:"Configure multiline grouping on the log collector using a line_start_pattern (e.g. a timestamp regex) so stack traces are sent as a single entry."},"no-error-logs-as-info":{key:"no-error-logs-as-info",title:"No error logs mapped as info",summary:"Detects INFO-level logs that carry error fields such as error.*, err.*, exception.*, or a stack trace.",rationale:"A log with error or exception attributes but an INFO severity is never surfaced as an error, so teams miss real failures caused by a misconfigured level mapper or bad logging.",objectType:"log",category:"telemetry-hygiene",impact:Tt("important"),recommendation:"Map these logs to ERROR in the level mapper, or fix the source logging so errors and exceptions are emitted at the right severity."},"no-empty-dashboards":{key:"no-empty-dashboards",title:"No empty dashboards",summary:"Flags dashboards with 1 or fewer widgets.",rationale:"Empty or near-empty dashboards add clutter and make it harder to find useful dashboards.",objectType:"dashboard",category:"observability-assets",impact:Tt("normal"),recommendation:"Add meaningful widgets to dashboards or remove empty ones to reduce clutter."},"monitor-has-notification":{key:"monitor-has-notification",title:"No monitors without notification",summary:"Every monitor has at least one active notification destination configured.",rationale:"A monitor without notifications is effectively silent - it detects issues but nobody is alerted.",objectType:"monitor",category:"observability-assets",impact:Tt("important"),recommendation:"Add a notification destination to every monitor - a monitor without notifications is effectively silent."},"no-future-dated-logs":{key:"no-future-dated-logs",title:"No future-dated logs",summary:"Detects logs with timestamps more than 59 minutes ahead of their intake time.",rationale:"Future-dated logs break dashboards, alerting, and log ordering - they indicate clock skew or incorrect timestamp generation.",objectType:"log",category:"telemetry-hygiene",impact:Tt("important"),recommendation:"Fix clock synchronization or timestamp generation for services emitting future-dated logs - they break dashboards and alerting."},"metric-usage":{key:"metric-usage",title:"Metric usage",summary:"Percentage of ingested metrics that are referenced by a dashboard or monitor, or were queried in the last 30 days.",rationale:"Metrics that are never visualized, alerted on, or queried add ingestion cost and cardinality without providing value.",objectType:"metric",category:"telemetry-adoption",impact:Tt("important"),recommendation:"Stop emitting metrics that are never referenced or queried to reduce ingestion cost and cardinality.",scope:"global"},"no-stale-dashboards":{key:"no-stale-dashboards",title:"No stale dashboards",summary:"Flags dashboards that have not been edited in over 180 days.",rationale:"Stale dashboards may contain outdated queries or irrelevant data, making it harder for teams to find useful, up-to-date information.",objectType:"dashboard",category:"observability-assets",impact:Tt("normal"),recommendation:"Review and update dashboards that haven't been edited in 180+ days, or archive them if no longer relevant."},"no-unused-dashboards":{key:"no-unused-dashboards",title:"No unused dashboards",summary:"Flags dashboards with zero views in the last 60 days.",rationale:"Dashboards that nobody views add clutter and may confuse team members looking for relevant information.",objectType:"dashboard",category:"telemetry-adoption",impact:Tt("important"),recommendation:"Archive or delete dashboards that nobody has viewed in the last 60 days to reduce noise."},"no-orphan-monitors":{key:"no-orphan-monitors",title:"No monitors without dashboards",summary:"Every monitor should be linked to at least one dashboard.",rationale:"Monitors without a linked dashboard make it harder for teams to investigate alerts \u2014 responders need a dashboard to quickly understand the context and scope of an issue.",objectType:"monitor",category:"observability-assets",impact:Tt("important"),recommendation:"Link monitors to relevant dashboards so teams can quickly investigate when alerts fire."},"no-flapping-monitors":{key:"no-flapping-monitors",title:"No flappy monitors",summary:"P1/P2 monitors should not have any group (or the monitor itself) trigger 7+ alerts within 7 days.",rationale:"Monitors that constantly flip between alert and OK cause alert fatigue. Teams start ignoring notifications, increasing the risk of missing real incidents.",objectType:"monitor",category:"observability-assets",impact:Tt("important"),recommendation:"Tune thresholds, add hysteresis, or adjust evaluation windows to reduce flapping."},"no-noisy-group-monitors":{key:"no-noisy-group-monitors",title:"No noisy group-by monitors",summary:"P1/P2 group-by monitors should not have 5+ groups triggering alerts simultaneously on 2+ occasions within 7 days.",rationale:"When a group-by monitor triggers alerts for many groups at once repeatedly, the signal gets lost in noise. Responders cannot prioritize and the monitor effectively becomes useless.",objectType:"monitor",category:"observability-assets",impact:Tt("important"),recommendation:"Narrow the group-by scope, raise thresholds, or split into more targeted monitors."},"no-long-alert-monitors":{key:"no-long-alert-monitors",title:"No monitors stuck in alert",summary:"P1/P2 monitors should not remain in alert state for more than 15 days.",rationale:"A high-priority monitor stuck in alert for weeks signals an unresolved issue or a misconfigured threshold. Either way, the alert loses meaning and contributes to alert fatigue.",objectType:"monitor",category:"observability-assets",impact:Tt("important"),recommendation:"Investigate and resolve the underlying issue, adjust the threshold, or acknowledge and close the alert."},"no-redundant-monitors":{key:"no-redundant-monitors",title:"No redundant monitors",summary:"P1/P2 monitors should not always trigger at the same time as another monitor (3+ co-triggers within 7 days).",rationale:"A monitor that always fires alongside another monitor is redundant. It adds noise without providing additional signal, making it harder for responders to identify the root cause.",objectType:"monitor",category:"observability-assets",impact:Tt("important"),recommendation:"Investigate whether the redundant monitor can be removed or consolidated with the one it always co-triggers with."},"no-absent-log-fields":{key:"no-absent-log-fields",title:"No absent log fields",summary:"Dashboards and monitors should reference log fields that still appear in recent logs (last 24 hours).",rationale:"References to log fields that no longer exist silently break dashboards and monitors, eroding trust in observability.",objectType:"dashboard",category:"observability-assets",impact:Tt("important"),recommendation:"Remove, rename, or backfill log fields that are referenced by dashboards or monitors but have not been seen in the last 24 hours.",scope:"global"},"k8s-recommended-attributes":{key:"k8s-recommended-attributes",title:"Kubernetes recommended resource attributes",summary:"Kubernetes logs and spans should populate core identity attributes and at least one workload-ownership attribute.",rationale:"These attributes let Tsuga correlate telemetry with the Kubernetes objects that produced it, which is required for faulty-deployment detection and rollback suggestions.",objectType:"resource",category:"collection-coverage",impact:Tt("important"),recommendation:"Make sure every Kubernetes workload emits k8s.cluster.name, k8s.namespace.name, k8s.pod.name, k8s.pod.uid, k8s.container.name, k8s.node.name and one workload-ownership attribute (for example via the OpenTelemetry Collector k8s_attributes processor)."},"k8s-recommended-metrics":{key:"k8s-recommended-metrics",title:"Kubernetes recommended cluster metrics",summary:"All recommended Kubernetes cluster metrics are collected.",rationale:"These metrics are the primary signals for faulty-deployment detection; without k8s.container.status.reason and the usage/limit pairs, container crash loops and resource starvation cannot be diagnosed.",objectType:"metric",category:"collection-coverage",impact:Tt("important"),recommendation:"Enable the OpenTelemetry Collector k8s_cluster receiver (for example via the Tsuga Helm chart) so the required Kubernetes metrics are emitted.",scope:"global"},"k8s-recommended-change-events":{key:"k8s-recommended-change-events",title:"Kubernetes recommended change events",summary:"Change events are collected for the Kubernetes object kinds recommended for rollback suggestions.",rationale:"Faulty-deployment detection needs the history of ReplicaSet, Deployment, Pod and Node changes to identify failing revisions and propose rollbacks.",objectType:"log",category:"collection-coverage",impact:Tt("important"),recommendation:"Configure the Kubernetes change-event collector (for example the OpenTelemetry k8sobjects receiver) so change events for Pod, Deployment, ReplicaSet, StatefulSet, DaemonSet, Namespace and Node are ingested."},"otel-collector-self-metrics":{key:"otel-collector-self-metrics",title:"OpenTelemetry Collector self-metrics",summary:"A cluster collecting Kubernetes metrics through an OpenTelemetry Collector also emits the collector self-metrics (otelcol_*).",rationale:"The Kubernetes receivers feed the Kubernetes explorer. Without the collector self-metrics there is no way to tell a healthy pipeline from one that drops data or fails to export, so a stale or missing Kubernetes view cannot be explained.",objectType:"metric",category:"collection-coverage",impact:Tt("important"),recommendation:"Enable the collector's internal telemetry (service.telemetry.metrics) and export it to Tsuga so otelcol_* metrics are available.",scope:"global"},"use-standard-attributes":{key:"use-standard-attributes",title:"Standard attribute usage",summary:"Detects log attributes that should be remapped to Tsuga standard attributes.",rationale:"Standard attributes enable consistent querying, out-of-the-box dashboards, and cross-team correlation.",objectType:"log",category:"telemetry-hygiene",impact:Tt("important"),recommendation:"Use the attribute remapper in your routes to rename attributes to their standard equivalents."},"no-unused-operation-api-keys":{key:"no-unused-operation-api-keys",title:"No unused operation API keys",summary:"Flags operation API keys with no activity in the last 180 days.",rationale:"Long-idle operation credentials add risk if leaked and clutter the inventory. Tracking last-used activity makes it easy to rotate or delete the unused ones.",objectType:"api-key",category:"observability-assets",impact:Tt("important"),recommendation:"Rotate or delete operation API keys that have not been used in the last 180 days."},"no-unused-ingestion-api-keys":{key:"no-unused-ingestion-api-keys",title:"No unused ingestion API keys",summary:"Flags ingestion API keys with no telemetry in the last 30 days across any cluster.",rationale:"Dormant ingestion credentials add risk if leaked and clutter the inventory. Tracking key activity makes it easy to rotate or delete the unused ones.",objectType:"api-key",category:"observability-assets",impact:Tt("important"),recommendation:"Rotate or delete ingestion API keys that have sent no data in the last 30 days."},"db-logs-trace-correlation":{key:"db-logs-trace-correlation",title:"Database logs correlated with traces",summary:`Database logs should carry ${VZ} so they can be tied back to the trace that issued the query.`,rationale:"Linking database server logs to client traces lets users jump from a slow request to the exact query log. Without a trace id, database logs cannot be joined to the request that produced them.",objectType:"log",category:"telemetry-hygiene",impact:Tt("normal"),recommendation:"Enable trace correlation on the database log pipeline (for example via SQLcommenter, which embeds the traceparent in each statement) so query logs carry a trace id.",scope:"team"},"assets-comply-with-tag-policies":{key:"assets-comply-with-tag-policies",title:"Assets comply with tag policies",summary:"Every asset owned by the team (dashboards, monitors, routes, keys, SLOs, notification rules and silences) carries the tags required by the active asset tag policies that apply to it.",rationale:"Tag policies are only enforced when an asset is created or updated, so assets that predate a policy stay non-compliant and break tag-based ownership, filtering and cost attribution.",objectType:"tag-policy",category:"observability-assets",impact:Tt("important"),recommendation:"Edit each non-compliant asset to add the missing tags and remove the disallowed tags required by the tag policy.",scope:"team"},"data-complies-with-tag-policies":{key:"data-complies-with-tag-policies",title:"Data complies with tag policies",summary:"Logs, metrics and traces sent by the team raise no violations of the active data tag policies that apply to it during the lookback window.",rationale:"Telemetry that violates a data tag policy is flagged or dropped at ingestion, so teams lose data and tag-based queries, dashboards and monitors miss it.",objectType:"tag-policy",category:"telemetry-hygiene",impact:Tt("important"),recommendation:"Set the tags required by each violated data tag policy at the source, for example as resource attributes in the OpenTelemetry SDK or collector.",scope:"team"}},lle={"postgresql-server-metrics-collected":{label:"PostgreSQL",systemValues:["postgresql"],metricPrefixes:["postgresql.","pg_"],receiver:"postgresqlreceiver"},"mysql-server-metrics-collected":{label:"MySQL",systemValues:["mysql","mariadb"],metricPrefixes:["mysql.","mysql_"],receiver:"mysqlreceiver"},"mongodb-server-metrics-collected":{label:"MongoDB",systemValues:["mongodb"],metricPrefixes:["mongodb.","mongodbatlas.","mongodb_"],receiver:"mongodbreceiver"},"redis-server-metrics-collected":{label:"Redis",systemValues:["redis"],metricPrefixes:["redis.","redis_"],receiver:"redisreceiver"},"memcached-server-metrics-collected":{label:"Memcached",systemValues:["memcached"],metricPrefixes:["memcached.","memcached_"],receiver:"memcachedreceiver"},"couchdb-server-metrics-collected":{label:"CouchDB",systemValues:["couchdb"],metricPrefixes:["couchdb.","couchdb_"],receiver:"couchdbreceiver"},"elasticsearch-server-metrics-collected":{label:"Elasticsearch",systemValues:["elasticsearch"],metricPrefixes:["elasticsearch.","elasticsearch_"],receiver:"elasticsearchreceiver"},"oracledb-server-metrics-collected":{label:"Oracle DB",systemValues:["oracle.db","oracle"],metricPrefixes:["oracledb.","oracledb_"],receiver:"oracledbreceiver"},"sqlserver-server-metrics-collected":{label:"Microsoft SQL Server",systemValues:["microsoft.sql_server","mssql"],metricPrefixes:["sqlserver.","mssql_"],receiver:"sqlserverreceiver"},"saphana-server-metrics-collected":{label:"SAP HANA",systemValues:["sap.hana","hanadb"],metricPrefixes:["saphana."],receiver:"saphanareceiver"},"cassandra-server-metrics-collected":{label:"Cassandra",systemValues:["cassandra"],metricPrefixes:["cassandra.","cassandra_"]},"clickhouse-server-metrics-collected":{label:"ClickHouse",systemValues:["clickhouse"],metricPrefixes:["ClickHouse"]},"couchbase-server-metrics-collected":{label:"Couchbase",systemValues:["couchbase"],metricPrefixes:["couchbase_"]},"neo4j-server-metrics-collected":{label:"Neo4j",systemValues:["neo4j"],metricPrefixes:["neo4j_"]},"opensearch-server-metrics-collected":{label:"OpenSearch",systemValues:["opensearch"],metricPrefixes:["opensearch_"]},"db2-server-metrics-collected":{label:"IBM Db2",systemValues:["ibm.db2","db2"],metricPrefixes:["ibm_db2_"]}},jKe=Object.fromEntries(Object.keys(lle).map(e=>{let{label:t,receiver:r}=lle[e];return[e,{key:e,title:`${t} server metrics collected`,summary:`${t} seen in client spans should have its server metrics collected.`,rationale:"Server metrics (connections, throughput, replication, contention) are needed to investigate database slowness beyond what client spans show. A detected database with no server metrics has a gap in its monitoring setup.",objectType:"metric",category:"collection-coverage",impact:Tt("important"),recommendation:r?`Configure the ${r} OpenTelemetry receiver so ${t} server metrics are collected.`:`Collect ${t} server metrics, for example via its Prometheus exporter.`,scope:"global"}]})),HKe=new Set(["azure_container_registry","azure_container_registry_image","azure_app_service_certificate","azure_virtual_network"]),KKe=LS.filter(e=>e.startsWith("azure_")&&!HKe.has(e)),ule={"aws-sqs-metrics-collected":{label:"Amazon SQS",source:"AWS/SQS",nativeResourceTypes:["aws_sqs_queue"],metricPrefixes:["aws_sqs_"]},"aws-sns-metrics-collected":{label:"Amazon SNS",source:"AWS/SNS",nativeResourceTypes:["aws_sns_topic"],metricPrefixes:["aws_sns_"]},"aws-kinesis-metrics-collected":{label:"Amazon Kinesis Data Streams",source:"AWS/Kinesis",nativeResourceTypes:["aws_kinesis_data_stream"],metricPrefixes:["aws_kinesis_"]},"aws-dynamodb-metrics-collected":{label:"Amazon DynamoDB",source:"AWS/DynamoDB",nativeResourceTypes:["aws_dynamodb_table"],metricPrefixes:["aws_dynamodb_"]},"aws-rds-metrics-collected":{label:"Amazon RDS",source:"AWS/RDS",nativeResourceTypes:["aws_rds_instance"],metricPrefixes:["aws_rds_"]},"aws-elasticache-metrics-collected":{label:"Amazon ElastiCache",source:"AWS/ElastiCache",nativeResourceTypes:["aws_elasticache"],metricPrefixes:["aws_elasticache_"]},"aws-s3-metrics-collected":{label:"Amazon S3",source:"AWS/S3",nativeResourceTypes:["aws_s3_bucket"],metricPrefixes:["aws_s3_"]},"aws-ebs-metrics-collected":{label:"Amazon EBS",source:"AWS/EBS",nativeResourceTypes:["aws_ebs_volume"],metricPrefixes:["aws_ebs_"]},"aws-efs-metrics-collected":{label:"Amazon EFS",source:"AWS/EFS",nativeResourceTypes:["aws_efs"],metricPrefixes:["aws_efs_"]},"aws-ec2-metrics-collected":{label:"Amazon EC2",source:"AWS/EC2",nativeResourceTypes:["aws_ec2_instance"],metricPrefixes:["aws_ec2_"]},"aws-lambda-metrics-collected":{label:"AWS Lambda",source:"AWS/Lambda",nativeResourceTypes:["aws_lambda_function"],metricPrefixes:["aws_lambda_"]},"aws-ecs-metrics-collected":{label:"Amazon ECS",source:"AWS/ECS",nativeResourceTypes:["aws_ecs_cluster","aws_ecs_service","aws_ecs_task"],metricPrefixes:["aws_ecs_"]},"aws-ecr-metrics-collected":{label:"Amazon ECR",source:"AWS/ECR",nativeResourceTypes:["aws_ecr_repository"],metricPrefixes:["aws_ecr_"]},"aws-elb-metrics-collected":{label:"Elastic Load Balancing",source:"AWS/ApplicationELB, AWS/NetworkELB",nativeResourceTypes:["aws_elastic_load_balancer"],metricPrefixes:["aws_applicationelb_","aws_networkelb_","aws_gatewayelb_","aws_elb_"]},"aws-cloudfront-metrics-collected":{label:"Amazon CloudFront",source:"AWS/CloudFront",nativeResourceTypes:["aws_cloudfront_distribution"],metricPrefixes:["aws_cloudfront_"]},"aws-acm-metrics-collected":{label:"AWS Certificate Manager",source:"AWS/CertificateManager",nativeResourceTypes:["aws_acm_certificate"],metricPrefixes:["aws_certificatemanager_"]},"gcp-pubsub-metrics-collected":{label:"Google Cloud Pub/Sub",source:"pubsub.googleapis.com",nativeResourceTypes:["gcp_pubsub_topic"],metricPrefixes:["pubsub.googleapis.com/"]},"gcp-storage-metrics-collected":{label:"Google Cloud Storage",source:"storage.googleapis.com",nativeResourceTypes:["gcp_bucket"],metricPrefixes:["storage.googleapis.com/"]},"gcp-compute-metrics-collected":{label:"Google Compute Engine",source:"compute.googleapis.com",nativeResourceTypes:["gcp_compute_instance","gcp_compute_disk"],metricPrefixes:["compute.googleapis.com/"]},"gcp-cloud-sql-metrics-collected":{label:"Google Cloud SQL",source:"cloudsql.googleapis.com",nativeResourceTypes:["gcp_cloud_sql_instance"],metricPrefixes:["cloudsql.googleapis.com/"]},"gcp-gke-metrics-collected":{label:"Google Kubernetes Engine",source:"kubernetes.io, container.googleapis.com",nativeResourceTypes:["gcp_gke_cluster"],metricPrefixes:["kubernetes.io/","container.googleapis.com/"]},"gcp-cloud-run-metrics-collected":{label:"Google Cloud Run",source:"run.googleapis.com",nativeResourceTypes:["gcp_cloud_run_service","gcp_cloud_run_job","gcp_cloud_run_function"],metricPrefixes:["run.googleapis.com/"]},"gcp-artifact-registry-metrics-collected":{label:"Google Artifact Registry",source:"artifactregistry.googleapis.com",nativeResourceTypes:["gcp_artifact_registry_repository"],metricPrefixes:["artifactregistry.googleapis.com/"]},"gcp-load-balancing-metrics-collected":{label:"Google Cloud Load Balancing",source:"loadbalancing.googleapis.com",nativeResourceTypes:["gcp_forwarding_rule"],metricPrefixes:["loadbalancing.googleapis.com/"]},"gcp-bigtable-metrics-collected":{label:"Google Cloud Bigtable",source:"bigtable.googleapis.com",nativeResourceTypes:["gcp_bigtable_instance"],metricPrefixes:["bigtable.googleapis.com/"]},"gcp-spanner-metrics-collected":{label:"Google Cloud Spanner",source:"spanner.googleapis.com",nativeResourceTypes:["gcp_spanner_instance"],metricPrefixes:["spanner.googleapis.com/"]},"gcp-firestore-metrics-collected":{label:"Google Cloud Firestore",source:"firestore.googleapis.com",nativeResourceTypes:["gcp_firestore_database"],metricPrefixes:["firestore.googleapis.com/"]},"gcp-app-engine-metrics-collected":{label:"Google App Engine",source:"appengine.googleapis.com",nativeResourceTypes:["gcp_app_engine_service"],metricPrefixes:["appengine.googleapis.com/"]},"azure-metrics-collected":{label:"Azure",source:"Azure Monitor",nativeResourceTypes:KKe,metricPrefixes:["azure_"]}},zKe=Object.fromEntries(Object.keys(ule).map(e=>{let{label:t,source:r}=ule[e];return[e,{key:e,title:`${t} metrics collected`,summary:`${t} resources found in inventory should have their metrics collected.`,rationale:"A resource that appears in inventory but whose metrics are not collected leaves its dashboards and resource-explorer views empty and impossible to alert on.",objectType:"metric",category:"collection-coverage",impact:Tt("important"),recommendation:`Enable the ${r} metrics integration so ${t} metrics are ingested.`,scope:"global"}]})),YKe={...qKe,...jKe,...zKe},ple=Object.values(YKe);var mle=["passed","failed","ignored"],VKe=10,QKe=n.Enum(mle,{description:"Evaluation outcome for this rule row. Allowed values are passed, failed, and ignored; ignored means the rule was not applicable to the available data."}),WKe=["aws-sqs-metrics-collected","aws-sns-metrics-collected","aws-kinesis-metrics-collected","aws-dynamodb-metrics-collected","aws-rds-metrics-collected","aws-elasticache-metrics-collected","aws-s3-metrics-collected","aws-ebs-metrics-collected","aws-efs-metrics-collected","aws-ec2-metrics-collected","aws-lambda-metrics-collected","aws-ecs-metrics-collected","aws-ecr-metrics-collected","aws-elb-metrics-collected","aws-cloudfront-metrics-collected","aws-acm-metrics-collected","gcp-pubsub-metrics-collected","gcp-storage-metrics-collected","gcp-compute-metrics-collected","gcp-cloud-sql-metrics-collected","gcp-gke-metrics-collected","gcp-cloud-run-metrics-collected","gcp-artifact-registry-metrics-collected","gcp-load-balancing-metrics-collected","gcp-bigtable-metrics-collected","gcp-spanner-metrics-collected","gcp-firestore-metrics-collected","gcp-app-engine-metrics-collected","azure-metrics-collected"],JKe=["postgresql-server-metrics-collected","mysql-server-metrics-collected","mongodb-server-metrics-collected","redis-server-metrics-collected","memcached-server-metrics-collected","couchdb-server-metrics-collected","elasticsearch-server-metrics-collected","oracledb-server-metrics-collected","sqlserver-server-metrics-collected","saphana-server-metrics-collected","cassandra-server-metrics-collected","clickhouse-server-metrics-collected","couchbase-server-metrics-collected","neo4j-server-metrics-collected","opensearch-server-metrics-collected","db2-server-metrics-collected"],KF=["unrouted-logs","no-over-routed-logs","team-has-route","no-team-override-mismatch","service-name-present","no-orphan-spans","metric-unit-consistency","host-name-present","inconsistent-attribute-naming","no-duplicate-attr-values","no-debug-logs-in-prod","no-multiline-logs","no-error-logs-as-info","no-empty-dashboards","monitor-has-notification","no-future-dated-logs","metric-usage","no-stale-dashboards","no-unused-dashboards","no-orphan-monitors","no-flapping-monitors","no-noisy-group-monitors","no-long-alert-monitors","no-redundant-monitors","no-absent-log-fields","k8s-recommended-attributes","k8s-recommended-metrics","k8s-recommended-change-events","otel-collector-self-metrics","use-standard-attributes","no-unused-operation-api-keys","no-unused-ingestion-api-keys","db-logs-trace-correlation","assets-comply-with-tag-policies","data-complies-with-tag-policies",...JKe,...WKe],dle=n.Enum(KF),ZKe=["log","metric","resource","span","api-key","dashboard","monitor","route","tag-policy"],XKe=["collection-coverage","telemetry-hygiene","observability-assets","telemetry-adoption"],eze=["critical","important","normal"],tze=["team","global"],zF=n.Object({key:n.Enum(KF),title:n.String(),summary:n.String(),rationale:n.String(),objectType:n.Enum(ZKe),category:n.Enum(XKe),impact:n.Object({label:n.Enum(eze),weight:n.Number()}),recommendation:n.String(),scope:n.Optional(n.Enum(tze))}),gT=n.Object({type:n.String({description:"Tsuga asset or telemetry kind referenced by this example. Set by the rule evaluator from the failing object, record, or lookup result; examples include `monitor`, `dashboard`, `metric`, `log`, and `api-key`."}),label:n.String({description:"Human-readable summary of the example. Set by the rule evaluator from the asset name, telemetry identifier, or lookup result so clients can display the example without following the link."}),link:n.Object({to:n.String({description:"In-app route that opens the example in Tsuga. Set by the rule evaluator when the example has a product surface for inspection."}),search:n.Optional(n.Unknown({description:"Route search payload for the in-app link. Set when the destination needs query-string state such as a search query, time range, or table filter."})),params:n.Optional(n.Unknown({description:"Route params for the in-app link. Set when the destination route needs path parameters such as an asset identifier."}))},{description:"In-app deep link for inspecting the example. Returned when Tsuga can route from the quality-report row to a relevant product page."})}),HF=n.Intersect([zF,n.Object({id:n.Optional(n.String()),status:QKe,normalizedScore:n.Number(),details:n.Optional(n.Record(n.String(),n.Unknown())),recommendation:n.Optional(n.String()),examples:n.Optional(n.Array(gT)),exampleCount:n.Optional(n.Integer())})]),rze=n.Object({generatedAt:n.String(),overallScore:n.Optional(n.Number()),rules:n.Array(zF),teamResults:n.Array(n.Object({teamId:n.String(),teamName:n.String(),teamWeight:n.Number(),score:n.Number(),weightedScore:n.Number(),totalWeight:n.Number(),ruleResults:n.Array(HF)})),globalResults:n.Optional(n.Object({score:n.Optional(n.Number()),ruleResults:n.Array(HF)}))}),YF=n.Object({id:n.String({description:"Identifier of this persisted quality-report row. Generated by Tsuga when report rows are stored. Returned on every row. Treat it as an opaque ID."}),reportId:n.String({description:"Identifier shared by rows from the same report generation for the same team or global cluster-wide scope. Generated by Tsuga when the report is stored. Returned on every row."}),ruleId:n.Enum(KF,{description:"Stable key for the telemetry-quality rule evaluated by this row. Set by Tsuga from the quality-rule catalog. Returned on every row. The enum may grow as Tsuga adds rules; clients should display unknown future values as opaque rule keys if they do not have local labels."}),owner:n.Optional(n.String({description:"Team identifier this row applies to. Set to the owning team ID for team-scoped rules. Returned for team rows; omitted for global cluster-wide rows."})),status:n.Enum(mle,{description:"Evaluation outcome for this rule row. Set by the rule evaluator when the report is generated. Returned on every row. Allowed values are passed, failed, and ignored; ignored means the rule was not applicable to the available data."}),score:n.Number({description:"Normalized score for this rule row. Set by the rule evaluator when the report is generated. Returned on every row. Values are between 0 and 1."}),weight:n.Number({description:"Impact weight of this rule, captured at report-generation time. Set by Tsuga from the rule's impact label: 1 for normal, 2 for important, 3 for critical. Used with score to compute reportOverallScore."}),reportOverallScore:n.Number({description:"Aggregate score for this row's report group. Calculated by Tsuga from non-ignored rows in the same team or global cluster-wide report. Returned on every row in that group with the same value."}),reportTotalWeight:n.Number({description:"Sum of non-ignored rule weights for this row's report group. Calculated by Tsuga when the report is generated. Returned on every row in that group with the same value."}),recommendation:n.Optional(n.String({description:"Recommendation stored with this row. Set by the rule evaluator when the report is generated. Returned when a recommendation was persisted; omitted otherwise. The latest-report endpoint does not recompute or default it at read time."})),examples:n.Optional(n.Array(gT,{description:`Assets, logs, metrics, or links supporting this rule result. Set by the rule evaluator when the report is generated. Returned when examples were persisted and visible to the caller; global row examples are returned only to admin users. Truncated to the first ${VKe}; compare against exampleCount to detect truncation.`})),exampleCount:n.Optional(n.Integer({description:"Total number of examples persisted for this row, before the preview truncation applied to examples. Returned whenever examples are visible to the caller."})),createdAt:n.String({description:"ISO timestamp the row was generated at"})}),Uyr=x({tags:["quality-reports"],url:"/v0/quality-reports",method:"POST",response:rze}),ZC=n.Optional(f({allowEmpty:!1,description:"Identifier of the cluster whose latest quality-report rows are returned. Use the id from the clusters API. Required when the organization has multiple clusters; omit only in single-cluster organizations. Unknown cluster IDs return RESOURCE_NOT_FOUND."})),Nyr=x({tags:["quality-reports"],url:"/v0/quality-reports/latest",method:"GET",paginated:!0,query:n.Object({clusterId:ZC,team:n.Optional(f({allowEmpty:!1})),...je}),response:n.Array(YF,{description:"Latest persisted rule evaluation rows for the cluster"})}),kyr=x({tags:["quality-reports"],url:"/v0/quality-reports/:id/examples",method:"GET",paginated:!0,params:n.Object({id:f({allowEmpty:!1})}),query:n.Object(je),response:n.Object({examples:n.Array(gT)})}),Lyr=x({tags:["quality-reports"],url:"/v0/quality-reports/preview",method:"POST",body:n.Object({ruleKey:dle,teamId:n.Optional(f({allowEmpty:!1})),lookbackMinutes:n.Optional(n.Integer({minimum:1,maximum:60})),clusterId:n.Optional(f({allowEmpty:!1}))}),response:n.Object({rule:zF,result:HF,teamId:n.Optional(n.String()),teamName:n.Optional(n.String())})}),Myr=x({tags:["quality-reports"],url:"/v0/quality-reports/auto-fix",method:"POST",body:n.Object({ruleKey:dle,teamId:n.Optional(f({allowEmpty:!1})),clusterId:ZC,configurationId:f({allowEmpty:!1})}),response:n.Object({runId:n.String()})}),Dyr=new Map(ple.map(e=>[e.key,e]));var fle=`/${"v1"}/quality-reports`,gle=n.Pick(YF,["id","reportId","ruleId","owner","status","score","weight","reportOverallScore","reportTotalWeight","recommendation","examples","exampleCount","createdAt"],{$id:"QualityReportRow",description:"Persisted evaluation of one telemetry-quality rule for a team or cluster-wide scope. See [Quality reports](/documentation/account-and-settings/quality-reports)."}),nze={id:"01j9x3z4vyabcdfghjkmnpqrst",reportId:"01j9x3z4vyabcdfghjkmnpqrsu",ruleId:"team-has-route",owner:"01j9x3z4vyabcdfghjkmnpqrr",status:"passed",score:1,weight:2,reportOverallScore:.85,reportTotalWeight:2,createdAt:"2026-02-26T12:00:00.000Z"};Object.assign(gle,{examples:[nze]});var oze=n.Object({clusterId:ZC,team:n.Optional(f({allowEmpty:!1,description:"Team name used to scope the report. Matched against Tsuga team names. Optional; when set, returns only rows for that team and omits global rows. Unknown team names return RESOURCE_NOT_FOUND; teams the caller cannot access return an empty result."})),...er},{description:"Latest quality report lookup query."}),hle=x({description:"Retrieves the latest persisted quality-report rows for a cluster, optionally scoped to one team. Use this to audit telemetry hygiene and routing recommendations. A cluster holds one row per rule per team, so pagination fields limit the returned page.",operationId:"getLatestQualityReport",tags:["quality-reports"],url:`${fle}/latest`,method:"GET",paginated:!0,query:oze,response:n.Array(gle)}),VF=x({description:"Retrieves a page of the examples stored for one quality-report row. The latest-report endpoint returns only a preview of each row's examples, so use this to page past that preview when exampleCount exceeds the number of examples returned there. The row's full example count is in `metadata.pagination.totalCount`.",operationId:"getQualityReportExamples",tags:["quality-reports"],url:`${fle}/:id/examples`,method:"GET",paginated:!0,params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the quality-report row whose examples are returned. Use the id from the latest-report endpoint. Unknown ids, rows the caller cannot access, and cluster-wide rows requested by a non-admin all return RESOURCE_NOT_FOUND."})}),query:n.Object(er,{description:"Page of the row examples to return."}),response:n.Object({examples:n.Array(gT,{description:"Requested page of the examples stored for this row. Empty when the rule evaluation produced none, or when the offset is past the last one."})},{description:"One page of the examples stored for a quality-report row."})});var yle=["type","label"],Ele=G("examples",{id:on("ID").pipe(sn("The quality report row whose examples are returned")),...xS,...Ia(yle)},D("cli.quality-reports.examples")(function*(e){let t=yield*ti,r=yield*ye(VF,{params:{id:e.id},query:ho({limit:Re(e.limit),offset:Re(e.offset)})});if(!qt(VF.response,r))return yield*new _s({message:"The API returned quality report examples the CLI could not read"});yield*t.rows(r.examples,{...e,defaultFields:yle})})).pipe(B("List the examples stored for one quality report row"));var Sle=_t({commandName:"quality-reports",description:"Get the latest quality report rows for a cluster",listDescription:"Get the latest quality report rows for a cluster (pass --cluster <CLUSTER_ID> when the org has more than one cluster)",endpoints:{list:hle},extraSubcommands:[Ele]});var hT="/v0/admin-center";var Ua=`${hT}/retention-policies`,Tle=3650,ize=n.Integer({description:"Number of days Tsuga retains matching telemetry."}),ble=n.Integer({minimum:1,maximum:Tle,description:`Number of days Tsuga should retain matching telemetry. Valid values are 1 through ${Tle}.`}),zc=n.Object({id:n.String({description:"Unique identifier of the retention policy. Generated by Tsuga."}),env:n.Optional(n.String({description:"Environment tag value this policy applies to. Omitted policies apply across environments unless a more specific policy exists."})),teamId:n.Optional(n.String({description:"Team ID this policy applies to. Omitted policies apply globally unless a team-specific policy exists."})),dataSource:n.Enum(ya,{description:"Telemetry signal retained by this policy: logs, metrics, traces or rum."}),durationDays:ize,isEnabled:n.Boolean({description:"Whether this policy participates in retention resolution."}),createdAt:H({description:"Timestamp when Tsuga created the retention policy."}),updatedAt:H({description:"Timestamp when Tsuga last updated the retention policy."})}),XC=n.Object({env:Ut(f(),{description:"Environment tag value this policy applies to. Omit for a policy that is not environment-specific."}),teamId:Ut(f(),{description:"Team ID this policy applies to. Omit for a policy that is not team-specific."}),dataSource:n.Enum(ya,{description:"Telemetry signal retained by this policy: logs, metrics, traces or rum."}),durationDays:ble,isEnabled:n.Boolean({description:"Set to true for the policy to participate in retention resolution."})}),xle=n.Array(n.Object({env:f(),dataSource:n.Enum(ya),durationDays:n.Union([ble,n.Null()]),isEnabled:n.Boolean()})),Ile=n.Object({inserted:n.Array(zc),updated:n.Array(zc),deleted:n.Array(zc)}),uEr=x({tags:["retention-policies"],url:Ua,method:"POST",body:XC,response:zc}),pEr=x({tags:["retention-policies"],url:Ua,method:"GET",response:n.Array(zc)}),mEr=x({tags:["retention-policies"],url:`${Ua}/:id`,method:"GET",params:n.Object({id:f()}),response:zc}),dEr=x({tags:["retention-policies"],url:`${Ua}/:id`,method:"PUT",params:n.Object({id:f()}),body:XC,response:zc}),fEr=x({tags:["retention-policies"],url:`${Ua}/bulk-update`,method:"POST",body:xle,response:Ile}),gEr=x({tags:["retention-policies"],url:`${Ua}/bulk-update-for-team`,method:"POST",body:n.Object({teamId:f(),policies:xle}),response:Ile}),hEr=x({tags:["retention-policies"],url:`${Ua}/:id`,method:"DELETE",params:n.Object({id:f()}),response:ae}),yT=["past-24-hours","past-7-days","past-30-days"],yEr=x({tags:["retention-policies"],url:`${Ua}/requested-history-percentile/:teamId`,method:"POST",params:n.Object({teamId:f()}),body:n.Object({percentile:n.Number({minimum:0,maximum:1}),observationWindow:n.Enum(yT),dataSource:n.Enum(ya)}),response:n.Object({percentile:n.Number(),observationWindow:n.Enum(yT),dataSource:n.Enum(ya),teamId:n.String(),requestedHistoryDays:n.Number()})}),sze=["1-day","3-days","7-days","1-month","6-months","more-than-6-months"];var aze=n.Array(n.Object({bucket:n.Enum(sze),count:n.Number()})),EEr=x({tags:["retention-policies"],url:`${Ua}/requested-history-histogram/:teamId`,method:"POST",params:n.Object({teamId:f()}),body:n.Object({observationWindow:n.Enum(yT),dataSource:n.Enum(ya)}),response:n.Object({observationWindow:n.Enum(yT),dataSource:n.Enum(ya),teamId:n.String(),histogram:aze})}),SEr=x({tags:["retention-policies"],url:`${Ua}/top-teams-with-retention-surplus`,method:"POST",body:n.Object({dataSource:n.Enum(ya),observationWindow:n.Enum(yT),percentile:n.Number({minimum:0,maximum:1}),topN:n.Optional(n.Number({minimum:1,maximum:20}))}),response:n.Array(n.Object({teamId:n.String(),retentionSurplusDays:n.Number()}))});var ET=`/${"v1"}/retention-policies`,ST=n.Pick(zc,["id","env","teamId","dataSource","durationDays","isEnabled"],{$id:"RetentionPolicy",description:"Retention rule for logs, metrics, or traces. Policies can apply globally, to an environment, or to a team depending on which scope fields are present. See [Retention](/documentation/account-and-settings/retention)."}),cze={id:"123-456-abc",env:"production",teamId:"team-123-abc",dataSource:"logs",durationDays:30,isEnabled:!0};Object.assign(ST,{examples:[cze]});var _le=x({description:"Lists retention policy rows visible to the authenticated operation key. Use this to audit retention duration by signal, environment, and team.",operationId:"listRetentionPolicies",tags:["retention-policies"],url:ET,method:"GET",response:n.Array(ST)}),Ale=x({description:"Retrieves one retention policy by ID.",operationId:"getRetentionPolicy",tags:["retention-policies"],url:`${ET}/:id`,method:"GET",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the retention policy to retrieve. Use the `id` returned by retention policy list or create responses."})}),response:ST}),QF=n.Pick(XC,["env","teamId","dataSource","durationDays","isEnabled"],{description:"Retention policy create or update request. Provide the telemetry signal, retention duration, enabled state, and optional environment or team scope."}),lze={env:"production",teamId:"team-123-abc",dataSource:"logs",durationDays:30,isEnabled:!0};Object.assign(QF,{examples:[lze]});var Ole=x({description:"Creates a retention policy row for a telemetry signal, optionally scoped to an environment or team. Only one policy may exist per combination of data source, environment, and team; creating a duplicate combination fails.",operationId:"createRetentionPolicy",tags:["retention-policies"],url:ET,method:"POST",body:QF,response:ST}),Cle=x({description:"Replaces an existing retention policy by ID, including signal, scope fields, duration, and enabled state.",operationId:"updateRetentionPolicy",tags:["retention-policies"],url:`${ET}/:id`,method:"PUT",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the retention policy to update. Use the `id` returned by retention policy list, get, or create responses."})}),body:QF,response:ST}),Rle=x({description:"Deletes a retention policy by ID. Retention resolution falls back to the next broader matching policy when one exists.",operationId:"deleteRetentionPolicy",tags:["retention-policies"],url:`${ET}/:id`,method:"DELETE",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the retention policy to delete. Use the `id` returned by retention policy list, create, or update responses."})}),response:ae});var Ple=_t({commandName:"retention-policies",description:"Manage retention policies",endpoints:{list:_le,get:Ale,create:Ole,update:Cle,delete:Rle}});var Yc="/v0/slos",uze=[7,30,90],pze=["good","bad"],Nle=n.Enum(pze,{description:"How to treat SLO with no data: good (count as meeting the SLO), bad (count as breaching it)"}),mze=["good","bad","ignore"],kle=n.Enum(mze,{description:"How to treat time buckets with no data: good (count as meeting the SLO), bad (count as breaching it), or ignore (exclude from the error budget)"}),wle=30,vle=1440,Lle=["greater_than","less_than","greater_than_or_equal","less_than_or_equal"],dze=["healthy","breached","no_data"],eR=n.Enum(dze,{description:"SLO status: healthy (meeting the target), breached (breaching it), or no_data (not evaluated yet)"}),Ule={sli:n.Optional(n.Number({description:"Service level indicator for the latest evaluation; absent when there is no data"})),errorBudget:n.Optional(n.Number({description:"Remaining error budget at the latest evaluation; negative when exhausted, absent when there is no data"})),status:eR},fze=n.Object({overall:n.Object(Ule,{description:"Latest overall evaluation for the cluster"}),perGroup:n.Array(n.Object({groupKey:n.Record(n.String(),eS,{description:"Group-by field values identifying this group, keyed by field name. Present only when the SLO configuration sets `groupByFields`."}),...Ule}),{description:"Latest evaluation for each group produced by the SLO configuration's `groupByFields`. Empty when the SLO is not grouped."})},{title:"SloClusterResults"}),Mle=n.Record(n.String(),fze,{description:"Latest evaluation results keyed by cluster ID."}),WF=n.Object({queries:Nc,formula:RO},{title:"SloQueryFormula",description:"Aggregation queries combined by a formula to produce the SLO signal. Tsuga evaluates this query formula during SLO evaluation and returns it as part of the saved SLO configuration. Returned queries include Tsuga-derived missing-point fill: event SLO queries use zero fill, and time SLO queries keep missing points null."}),JF=n.Object({queries:vZ,formula:zp},{title:"SloQueryFormula",description:"Aggregation queries combined by a formula to produce the SLO signal. Formulas reference queries as q1, q2, and so on. Do not send per-query fill; Tsuga derives the fill behavior from the SLO type."}),gze=n.Object({type:n.Literal("burn-rate",{description:"Alert configuration kind. Set to `burn-rate` for alerts that fire when the SLO consumes error budget faster than the configured multiplier."}),burnRate:n.Number({description:"Burn-rate multiplier that triggers this alert. The short and long evaluation windows are derived from the predefined template with the closest burn rate."})},{title:"BurnRateAlert"}),hze=n.Object({type:n.Literal("burn-rate",{description:"Alert configuration kind. Set to `burn-rate` for alerts that fire when the SLO consumes error budget faster than the configured multiplier."}),burnRate:n.Number({minimum:1,maximum:100,description:"Burn-rate multiplier that triggers this alert. Required for burn-rate alerts; valid input is 1 through 100. Non-template values are accepted; short and long evaluation windows are derived from the predefined template with the closest burn rate."})},{title:"BurnRateAlert"});var yze=n.Object({type:n.Literal("threshold",{description:"Alert configuration kind. Set to `threshold` for alerts that fire when the SLO indicator falls below a percentage threshold."}),threshold:n.Number({description:"SLI percentage threshold for this alert. The alert passes when SLI is at or above this value and fires when SLI is strictly below it."})},{title:"ThresholdAlert"}),Eze=n.Object({type:n.Literal("threshold",{description:"Alert configuration kind. Set to `threshold` for alerts that fire when the SLO indicator falls below a percentage threshold."}),threshold:n.Number({exclusiveMinimum:0,exclusiveMaximum:100,description:"SLI percentage threshold for this alert. Required for threshold alerts; valid input is greater than 0 and less than 100. The alert passes when SLI is at or above this value and fires when SLI is strictly below it."})},{title:"ThresholdAlert"}),Sze=Q("type",[gze,yze],{description:"Alert trigger configuration: burn-rate or threshold"}),Dle=Q("type",[hze,Eze],{description:"Alert trigger configuration: burn-rate or threshold"}),ZF=n.Enum(To,{description:"Alert priority (1 is highest, 5 is lowest)"}),XF=n.Object({id:n.String({description:"Tsuga-generated SLO alert ID assigned when the alert is created."}),sloId:n.String({description:"Parent SLO ID for this alert."}),priority:ZF,configuration:Sze,createdAt:H({description:"Timestamp when Tsuga created the alert."}),updatedAt:H({description:"Timestamp when Tsuga last updated the alert."}),assetUpdatedAt:H({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})},{title:"SloAlert"}),Tze=n.Object({priority:ZF,configuration:Dle}),bze=n.Object({id:n.Optional(f({allowEmpty:!1,description:"Identifier of an existing alert to update. Omit to create a new alert on this SLO."})),priority:ZF,configuration:Dle}),xze=Q("type",[n.Object({type:n.Literal("event",{description:"Configuration kind. Set to `event` for SLOs that compute SLI from good and total query formulas over the rolling timeframe."}),dataSource:Ai,goodQuery:WF,totalQuery:WF,groupByFields:n.Optional(Rf),noDataBehavior:Nle},{title:"EventSloConfiguration"}),n.Object({type:n.Literal("time",{description:"Configuration kind. Set to `time` for SLOs that evaluate a query against a threshold in fixed-size time slices."}),dataSource:Ai,query:WF,sliceSizeMinutes:n.Integer({description:"Length of each time-SLO evaluation slice in minutes. Required for `type: time`."}),threshold:n.Object({operator:n.Enum(Lle,{description:"Comparison operator between the query value and the threshold"}),value:n.Number({description:"Threshold value compared against the query signal"})},{description:"Threshold comparison applied to each time-SLO evaluation slice"}),groupByFields:n.Optional(Rf),noDataBehavior:kle},{title:"TimeSliceSloConfiguration"})],{description:"SLI configuration for this SLO. Use `event` for good/total event-ratio SLOs or `time` for thresholded time-slice SLOs."}),Ize=Q("type",[n.Object({type:n.Literal("event",{description:"Configuration kind. Set to `event` for SLOs that compute SLI from good and total query formulas over the rolling timeframe."}),dataSource:Ai,goodQuery:JF,totalQuery:JF,groupByFields:n.Optional(kc),noDataBehavior:Nle},{title:"EventSloConfiguration"}),n.Object({type:n.Literal("time",{description:"Configuration kind. Set to `time` for SLOs that evaluate a query against a threshold in fixed-size time slices."}),dataSource:Ai,query:JF,sliceSizeMinutes:n.Integer({minimum:wle,maximum:vle,description:`Length of each time-SLO evaluation slice in minutes. Required for \`type: time\`. Valid input is ${wle} through ${vle}.`}),threshold:n.Object({operator:n.Enum(Lle,{description:"Comparison operator between the query value and the threshold"}),value:n.Number({description:"Threshold value compared against the query signal"})},{description:"Threshold comparison applied to each time-SLO evaluation slice"}),groupByFields:n.Optional(kc),noDataBehavior:kle},{title:"TimeSliceSloConfiguration"})],{description:"SLI configuration for this SLO. Use `event` for good/total event-ratio SLOs or `time` for thresholded time-slice SLOs."}),_ze=n.Number({exclusiveMinimum:0,exclusiveMaximum:100,description:"Target percentage (0 < target < 100, e.g. 99.9)"}),Fle=n.Enum(uze,{type:"integer",description:"Rolling SLO evaluation window in days. Set by the caller on create or update and returned on read and list responses. Allowed values are 7, 30, and 90."}),Aze=n.Array(n.String(),{description:"Cluster IDs this SLO is evaluated on. Omit or send an empty array on input to run on all clusters; responses use an empty array to mean all clusters. Non-empty input values must reference existing clusters."}),Oze=n.Array(f({allowEmpty:!1}),{description:"Cluster IDs this SLO is evaluated on. Omit or send an empty array on input to run on all clusters; responses use an empty array to mean all clusters. Non-empty input values must reference existing clusters."}),Cg=n.Object({id:n.String({description:"Tsuga-generated SLO ID assigned when the SLO is created."}),name:n.String({description:"Display name of the SLO, set by the caller."}),description:n.Optional(n.String({description:"Free-form, caller-provided description of what the SLO measures. Absent when not set."})),tags:br,configuration:xze,target:n.Number({description:"Target percentage (0 < target < 100, e.g. 99.9)"}),timeframeDays:Fle,owner:n.String({description:"Team ID that owns the SLO"}),permissions:As,clusterIds:Aze,creator:n.Optional(Qe),updater:n.Optional(Qe),alerts:n.Array(XF,{description:"Alerts attached to this SLO"}),createdAt:H({description:"Timestamp when Tsuga created the SLO."}),updatedAt:H({description:"Timestamp when Tsuga last updated the SLO."}),assetUpdatedAt:H({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})},{title:"Slo"}),Cze=n.Object({...Cg.properties,results:Mle},{title:"SloWithResults"}),tR=n.Object({name:f({allowEmpty:!1,description:"Display name of the SLO."}),description:Ut(f({type:"long"}),{description:"Free-form, caller-provided description of what the SLO measures. Optional."}),tags:wr,configuration:Ize,target:_ze,timeframeDays:Fle,owner:f({allowEmpty:!1,description:"Team ID that owns the SLO"}),permissions:As,clusterIds:n.Optional(Oze),alerts:n.Array(Tze,{description:"Alerts to create on this SLO. Send an empty array for none."})}),e1=n.Object({...n.Omit(tR,["alerts"]).properties,alerts:n.Array(bze,{description:"Alerts attached to this SLO. The SLO owns its alerts: the set is reconciled to exactly this list \u2014 existing alerts are matched by id, alerts without an id are created, and existing alerts absent from the list are deleted. Send an empty array to clear all alerts."})}),$le=n.Object({owners:qe(f({allowEmpty:!1}),{description:"Restrict results to SLOs owned by any of these team IDs",maxItems:50}),searchQuery:ko({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:qe(Fn.items,{description:"Restrict results to SLOs that have at least one of the listed key/value tags",maxItems:50}),clusterIds:qe(f({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:qe(eR,{description:"Restrict results to SLOs whose status is one of these values",maxItems:3})},{description:"Optional filters applied to narrow the returned SLOs"}),t1=n.Partial($le),Rze=["name","owner","tags","updatedAt","sli","errorBudget","status"],r1=n.Partial(n.Object({...je,filters:t1,sort:n.Object({by:n.Enum(Rze,{description:"Field to sort by"}),direction:Le},{description:"Optional sorting applied to the returned SLOs"})})),BEr=x({tags:["slos"],url:`${Yc}/query`,method:"POST",paginated:!0,response:n.Array(Cze),body:r1}),qEr=x({tags:["slos"],url:`${Yc}/tags/query`,method:"POST",body:n.Object({filters:n.Optional(n.Partial(n.Omit($le,["tags","statuses"])))}),response:Dn}),jEr=x({tags:["slos"],url:`${Yc}/:id`,method:"GET",params:n.Object({id:f()}),response:Cg}),HEr=x({tags:["slos"],url:`${Yc}/:id/results`,method:"GET",params:n.Object({id:f()}),response:Mle}),KEr=x({tags:["slos"],url:Yc,method:"POST",body:tR,response:Cg}),zEr=x({tags:["slos"],url:`${Yc}/:id`,method:"PUT",params:n.Object({id:f()}),body:e1,response:Cg}),YEr=x({tags:["slos"],url:`${Yc}/:id`,method:"DELETE",params:n.Object({id:f()}),response:ae}),Pze=_i(t1),VEr=x({tags:["slos"],url:`${Yc}/bulk-delete`,method:"DELETE",body:n.Object({selection:Pze}),response:n.Object({})}),wze=_i(t1,{maxIds:100}),QEr=x({tags:["slos"],url:`${Yc}/bulk-update`,method:"PUT",body:n.Object({selection:wze,owner:f({allowEmpty:!1})}),response:n.Object({})});var oi="/v0/service-catalog",vze=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."}),lastSeenAt:H({description:"Most recent time this team was observed for the service. Tsuga sets it from telemetry timestamps during service metadata refreshes."})},{description:"A team name observed on telemetry for this service, with the last time it was seen."}),Uze=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:H({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."}),Nze=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:H({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:H({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."}),kze=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:H({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."}),Lze=n.Object({runtime:n.String({description:"Runtime observed for this service. The emitting service or OpenTelemetry instrumentation sets it through telemetry metadata. Returned when runtime metadata is available for the service."}),lastSeenAt:H({description:"Most recent time this runtime was observed. Tsuga sets it from telemetry timestamps during service metadata refreshes."})},{description:"A runtime observed for this service, with the last time it was seen."}),Gle=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:H({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."}),Mze=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:H({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."}),Dze=n.Object({platform:n.String({description:"Observed cloud or orchestration platform, such as `aws_eks` or `kubernetes`. The emitting service or collector sets it through telemetry resource attributes. Returned when platform metadata is available for the service."}),lastSeenAt:H({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."}),Fze=n.Object({provider:n.String({description:"Observed cloud provider, such as `aws`, `gcp`, or `azure`. The emitting service or collector sets it through telemetry resource attributes. Returned when provider metadata is available for the service."}),lastSeenAt:H({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."}),Rg=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:rT.properties.config,rateLimit:rT.properties.rateLimit,createdAt:H({description:"Timestamp when the service notification target was created. Tsuga sets this value and returns it on private service-catalog responses."}),updatedAt:H({description:"Timestamp when the service notification target was last updated. Tsuga sets this value and returns it on private service-catalog responses."})}),n1=n.Object({config:Ig.properties.config,rateLimit:Ig.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."}),o1=n.Object({config:Ig.properties.config,rateLimit:n.Union([MF,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."}),rR=n.Object({id:n.String({description:"Unique identifier of this service. Use it with service detail and graph endpoints."}),serviceName:n.String({description:"OpenTelemetry service name observed in telemetry."}),serviceNamespace:n.Optional(n.String({description:"OpenTelemetry service namespace observed in telemetry."})),env:n.String({description:"Environment value observed for this service."}),teams:n.Array(vze,{description:"Team names observed on telemetry for this service and when each was last seen."}),ingestionApiKeys:n.Array(Uze,{description:"Ingestion API keys observed on telemetry for this service and when each was last seen."}),versions:n.Array(Nze,{description:"Service version values observed in telemetry, including first and last seen timestamps."}),languages:n.Array(kze,{description:"Programming languages observed for this service."}),runtimes:n.Array(Lze,{description:"Runtime values observed for this service."}),serverProtocols:n.Array(Gle,{description:"API protocols this service exposes (from server-kind spans)"}),clientProtocols:n.Array(Gle,{description:"API protocols this service calls out over (from client-kind spans)"}),frameworks:n.Array(Mze,{description:"Application frameworks detected from OTel instrumentation scope"}),cloudPlatforms:n.Array(Dze,{description:"Cloud platforms this service is running on"}),cloudProviders:n.Array(Fze,{description:"Cloud providers this service is running on"}),lastSeenAt:H({description:"Most recent time Tsuga observed telemetry for this service."}),firstSeenAt:H({description:"First time Tsuga observed telemetry for this service."}),additionalUserFields:n.Optional(n.Unsafe({type:"object",additionalProperties:!0,description:"Additional user-defined service metadata, when configured."})),traceRequestRate:n.Optional(n.Number({description:"Requests per second observed for this service over the queried window, counting calls of its primary 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 over the queried window that ended with error status. Omitted when the trace query failed."})),notificationTargets:n.Array(Rg,{description:"Notification targets attached to this service, used by adaptive notification rules to page its owners."}),createdAt:H({description:"Timestamp when Tsuga created this service catalog entry."}),updatedAt:H({description:"Timestamp when Tsuga last updated this service catalog entry."})}),$ze=n.Object({spanKind:n.Enum(QZ),count:n.Number()}),i1=n.Object({...rR.properties,spanKindCounts:n.Array($ze),envs:n.Array(n.String())}),sSr=x({tags:["service-catalog"],query:n.Object({...je,clusterId:n.Optional(f()),env:n.Optional(f())}),method:"GET",paginated:!0,url:`${oi}/services`,response:n.Array(i1)}),Gze=["serviceName","env","lastDeploy","traceErrorRate","traceRequestRate","teams","api","frameworks","languages","pagingDestination"],Bze=n.Object({searchQuery:n.Object({value:f({allowEmpty:!1,description:"Substring matched case-insensitively against service names."})},{description:"Text filter for service names."}),teams:qe(f({allowEmpty:!1}),{description:"Restrict results to services observed under any of these team names",maxItems:50}),envs:qe(f({allowEmpty:!1}),{description:"Restrict results to services observed in any of these environments",maxItems:50}),versions:qe(f({allowEmpty:!1}),{description:"Restrict results to services whose latest observed version is one of these",maxItems:50}),languages:qe(f({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"})}),qze=["1h","4h","24h"];var jze=n.Partial(n.Object({...je,clusterId:f(),filters:n.Partial(Bze,{description:"Optional filters applied to narrow the returned services"}),sort:n.Object({by:n.Enum(Gze,{description:"Field to sort the returned services by"}),direction:Le},{description:"Optional sorting applied to the returned services"}),statsWindow:n.Enum(qze,{description:"Lookback used 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`."})})),aSr=x({tags:["service-catalog"],url:`${oi}/v2/services/query`,method:"POST",paginated:!0,body:jze,response:n.Array(i1)}),cSr=x({tags:["service-catalog"],query:n.Object({serviceName:f({allowEmpty:!1}),serviceNamespace:n.Optional(f({allowEmpty:!1})),env:f({allowEmpty:!1}),clusterId:n.Optional(f())}),method:"GET",url:`${oi}/v2/service`,response:i1}),lSr=x({tags:["service-catalog"],query:n.Object({serviceName:f({allowEmpty:!1}),serviceNamespace:n.Optional(f({allowEmpty:!1})),clusterId:n.Optional(f())}),method:"GET",url:`${oi}/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."})}),uSr=x({tags:["service-catalog"],method:"GET",url:`${oi}/services/:serviceId`,params:n.Object({serviceId:f()}),response:rR}),pSr=x({tags:["service-catalog"],method:"GET",url:`${oi}/services/:serviceId/targets`,params:n.Object({serviceId:f()}),response:n.Array(Rg)}),mSr=x({tags:["service-catalog"],method:"POST",url:`${oi}/services/:serviceId/targets`,params:n.Object({serviceId:f()}),body:n1,response:Rg}),dSr=x({tags:["service-catalog"],method:"PUT",url:`${oi}/services/:serviceId/targets/:targetId`,params:n.Object({serviceId:f(),targetId:f()}),body:o1,response:Rg}),fSr=x({tags:["service-catalog"],method:"DELETE",url:`${oi}/services/:serviceId/targets/:targetId`,params:n.Object({serviceId:f(),targetId:f()}),response:ae}),Hze=["otel_kube","otel_host_kube","otel_host","prometheus","aws_ec2","gcp_compute_engine"];var Ble=n.Object({id:n.String(),hostName:n.String(),env:n.Optional(n.String()),cpuUtilizationAverage:n.Number(),hostType:n.Enum(Hze),teams:n.Array(n.String()),tags:n.Array(n.String()),firstSeenAt:H(),lastSeenAt:H(),clusterId:n.String()}),gSr=x({tags:["service-catalog"],method:"GET",url:`${oi}/hosts`,response:n.Array(Ble)}),hSr=x({tags:["service-catalog"],method:"GET",url:`${oi}/hosts/:hostId`,params:n.Object({hostId:f()}),response:Ble}),Kze=["http","rpc","messaging","genai","object_store"],qle={name:n.String({description:"Service or inferred dependency name shown in the graph."}),env:n.Optional(n.String({description:"Environment observed from spans."}))},s1=n.Object({...qle,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."})}),jle={...qle,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"}))},a1=n.Object({...jle,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`."})}),c1=n.Object({...jle,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(Kze,{description:"Inferred dependency type from span metadata: http, rpc, messaging, genai, or object_store."})}),zze=Q("nodeType",[s1,a1,c1]),l1=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."}),ySr=x({tags:["service-catalog"],url:`${oi}/services/:serviceId/graph`,method:"GET",params:n.Object({serviceId:f()}),query:n.Object({...Lr.properties,query:n.Optional(f({type:"tsuga-query"}))}),response:n.Object({clusterId:n.String(),nodes:n.Array(zze),edges:n.Array(l1)})}),Yze=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(To,{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(eR,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"})}))}),ESr=x({tags:["service-catalog"],method:"GET",url:`${oi}/services/:serviceId/related-resources`,params:n.Object({serviceId:f()}),response:Yze}),SSr=x({tags:["service-catalog"],method:"GET",url:`${oi}/services/by-api-keys`,response:n.Record(n.String(),n.Array(n.Object({serviceName:n.String(),serviceNamespace:n.Optional(n.String())})))});var nR=`/${"v1"}/services`,u1=n.Pick(rR,["id","serviceName","serviceNamespace","env","teams","versions","languages","runtimes","serverProtocols","clientProtocols","frameworks","cloudPlatforms","cloudProviders","lastSeenAt","firstSeenAt","traceRequestRate","traceErrorRate"],{$id:"Service",description:"Service inferred from telemetry, with observed metadata, activity counts, and version signals. See [Services](/documentation/categorize/services/index)."}),Vze={id:"123-456-abc",serviceName:"api-gateway",serviceNamespace:"platform",env:"production",teams:[{team:"platform",lastSeenAt:"2024-01-15T12:34:56.000Z"}],versions:[{version:"1.2.3",firstSeenAt:"2024-01-01T08:00:00.000Z",lastSeenAt:"2024-01-15T12:34:56.000Z",faulty:!0,faultyLatency:!0}],languages:[{language:"go",lastSeenAt:"2024-01-15T12:34:56.000Z"}],runtimes:[{runtime:"go",lastSeenAt:"2024-01-15T12:34:56.000Z"}],serverProtocols:[{protocol:"http",lastSeenAt:"2024-01-15T12:34:56.000Z"}],clientProtocols:[{protocol:"grpc",lastSeenAt:"2024-01-15T12:34:56.000Z"}],frameworks:[{framework:"gin",lastSeenAt:"2024-01-15T12:34:56.000Z"}],cloudPlatforms:[{platform:"aws_eks",lastSeenAt:"2024-01-15T12:34:56.000Z"},{platform:"kubernetes",lastSeenAt:"2024-01-15T12:34:56.000Z"}],cloudProviders:[{provider:"aws",lastSeenAt:"2024-01-15T12:34:56.000Z"}],lastSeenAt:"2024-01-15T12:34:56.000Z",firstSeenAt:"2024-01-01T08:00:00.000Z",traceRequestRate:2.36,traceErrorRate:8.2};Object.assign(u1,{examples:[Vze]});var Hle=x({description:"Lists services inferred from telemetry. Use this endpoint to inventory service ownership, environments, versions, runtimes, and recent activity. Pagination fields limit the returned page.",operationId:"listServices",tags:["services"],url:nR,method:"GET",paginated:!0,query:n.Object({...er,clusterId:n.Optional(f({allowEmpty:!1,description:"Telemetry cluster to target. Omit to use the first cluster in the organization; this does not query all clusters."})),env:n.Optional(f({allowEmpty:!1,description:"Environment to restrict the listing to. Services not observed in it are omitted. Omit to return one row per environment each service was observed in, so a service live in several environments returns several rows."}))},{description:"Service list query. Use pagination and optional cluster and environment scope."}),response:n.Array(u1)}),Kle=x({description:"Retrieves one telemetry-inferred service by service ID.",operationId:"getService",tags:["services"],url:`${nR}/:serviceId`,method:"GET",params:n.Object({serviceId:f({allowEmpty:!1,description:"Identifier of the service to retrieve. Use the `id` returned by service list responses."})}),response:u1}),Qze=n.Pick(s1,["name","env","nodeType","id","namespace","errorRate","entryErrorRequestCount","entryRequestCount"],{$id:"ObservedServiceGraphNode",description:"Service graph node matched to a service catalog entry by name and env. `id`/`namespace` are null when multiple namespaces share the observed service name."}),Wze=n.Pick(c1,["name","env","nodeType","serviceType","endpoint","resourceName"],{$id:"InferredServiceGraphNode",description:"Dependency node detected from client-span attributes (e.g. a queue or external HTTP call) that could not be matched to a service catalog entry. Database dependencies use the `inferred_db` variant."}),Jze=n.Pick(a1,["name","env","nodeType","serviceType","endpoint","resourceName"],{$id:"InferredDbServiceGraphNode",description:"Database dependency node detected from client-span attributes that could not be matched to a service catalog entry."}),Zze=Q("nodeType",[Qze,Jze,Wze]),Xze=n.Pick(l1,["from","to","count","errorRate","errorCount","clientSpanCount"],{$id:"ServiceGraphEdge",description:"Directed dependency edge from a caller node (`from`) to a callee node (`to`), with call-volume and error counts observed over the query window."}),e4e=n.Optional(n.Integer({...Lr.properties.from,description:"Start of the service graph query window as a Unix timestamp in seconds. Provide both `from` and `to` for a deterministic graph window; otherwise Tsuga uses backend graph defaults."})),t4e=n.Optional(n.Integer({...Lr.properties.to,description:"End of the service graph query window as a Unix timestamp in seconds. Provide both `from` and `to` for a deterministic graph window; otherwise Tsuga uses backend graph defaults."})),r4e=f({type:"tsuga-query",default:"*",description:"Tsuga query used to filter spans considered for the graph. Defaults to `*`, which applies no additional filter beyond the service identity."}),zle=x({description:"Retrieves a dependency graph for one service over an optional time range and query filter. Provide an explicit time range for deterministic results. Use this to inspect observed downstream and upstream service relationships. See [Service page](/documentation/categorize/services/service-page).",operationId:"getServiceGraph",tags:["services"],url:`${nR}/:serviceId/graph`,method:"GET",params:n.Object({serviceId:f({allowEmpty:!1,description:"Identifier of the service to use as the graph root. Use the `id` returned by service list or get responses."})}),query:n.Object({from:e4e,to:t4e,query:n.Optional(r4e)},{description:"Service graph query. Use time range and optional span query filters."}),response:n.Object({clusterId:n.String({description:"Cluster ID the graph was built from"}),nodes:n.Array(Zze,{description:"Observed and inferred nodes included in the service dependency graph."}),edges:n.Array(Xze,{description:"Directed dependency edges between graph nodes."})})}),oR=`${nR}/:serviceId/notification-targets`,iR=n.Pick(Rg,["id","serviceId","config","rateLimit"],{$id:"ServiceNotificationTarget",description:"Notification target attached to a service, used by adaptive notification rules to page the service owners. See [Rules](/documentation/alert/notifications/rules)."}),p1={rateLimit:{maxMessages:10,minutes:5},config:{type:"email",addresses:["oncall@example.com"],renotifyConfig:{mode:"each",renotificationStates:["alert"],renotifyIntervalMinutes:30}}},n4e={id:"789-abc-def",serviceId:"123-456-abc",...p1};Object.assign(iR,{examples:[n4e]});var sR=f({allowEmpty:!1,description:"Identifier of the service the notification target belongs to. Use the `id` returned by service list or get responses."}),RSr=x({description:"Lists the notification targets attached to one service. Use this to discover target IDs before updating or deleting a target.",operationId:"listServiceNotificationTargets",tags:["services"],url:oR,method:"GET",params:n.Object({serviceId:sR}),response:n.Array(iR)}),o4e=n.Pick(n1,["config","rateLimit"],{description:"Service notification target create request. Provide the delivery destination and an optional per-target rate limit.",examples:[p1]}),i4e=n.Pick(o1,["config","rateLimit"],{description:"Service notification target update request. The submitted destination and rate limit overwrite the stored ones.",examples:[p1]}),PSr=x({description:"Attaches a notification target to a service. Adaptive notification rules matching the service page this target on alert transitions.",operationId:"createServiceNotificationTarget",tags:["services"],url:oR,method:"POST",params:n.Object({serviceId:sR}),body:o4e,response:iR}),wSr=x({description:"Updates one notification target attached to a service.",operationId:"updateServiceNotificationTarget",tags:["services"],url:`${oR}/:targetId`,method:"PUT",params:n.Object({serviceId:sR,targetId:f({allowEmpty:!1,description:"Identifier of the notification target to update. Use the `id` returned by service notification target list or create responses."})}),body:i4e,response:iR}),vSr=x({description:"Detaches a notification target from a service. Notification rules stop paging this destination for the service.",operationId:"deleteServiceNotificationTarget",tags:["services"],url:`${oR}/:targetId`,method:"DELETE",params:n.Object({serviceId:sR,targetId:f({allowEmpty:!1,description:"Identifier of the notification target to delete. Use the `id` returned by service notification target list or create responses."})}),response:ae});var Yle=_t({commandName:"services",description:"List and inspect services (read-only; services are inferred from telemetry)",endpoints:{list:Hle,get:Kle}});var TT=`/${"v1"}/slos`,s4e=n.Pick(XF,["id","sloId","priority","configuration"],{$id:"SloAlert",description:"Alert attached to an SLO, triggered on a burn-rate multiplier or an SLO target threshold"}),bT=n.Object({...n.Pick(Cg,["id","name","description","tags","configuration","target","timeframeDays","owner","permissions","clusterIds"]).properties,alerts:n.Array(s4e,{description:"Alerts attached to this SLO"})},{$id:"Slo",description:"Service Level Objective definition: its SLI configuration, target percentage, rolling timeframe, cluster scope, and attached alerts"}),a4e={id:"123-456-abc",name:"API availability 99.9%",description:"Overall API gateway availability over the last 30 days",tags:[{key:"team",value:"platform"}],configuration:{type:"event",dataSource:"logs",goodQuery:{queries:[{filter:"status:ok",aggregate:{type:"count"}}],formula:"q1"},totalQuery:{queries:[{filter:"*",aggregate:{type:"count"}}],formula:"q1"},noDataBehavior:"good"},target:99.9,timeframeDays:30,owner:"team-123-abc",permissions:"all",clusterIds:[],alerts:[{id:"alert-123-abc",sloId:"123-456-abc",priority:1,configuration:{type:"burn-rate",burnRate:14.4}}]};Object.assign(bT,{examples:[a4e]});var Vle=n.Pick(r1,["filters","sort","limit","offset"]),Qle=n.Object({...Vle.properties,...er,filters:Vle.properties.filters},{description:"SLO query request. Use filters, sorting, limit, and offset to page through visible SLOs."}),c4e={filters:{owners:{values:["team-123-abc"]},searchQuery:{value:"availability"},tags:{values:[{key:"team",value:"platform"}]},statuses:{values:["breached"]},clusterIds:{values:["cluster-123-abc"]}},sort:{by:"name",direction:"asc"},limit:10,offset:0};Object.assign(Qle,{examples:[c4e]});var Wle=x({description:"Queries SLOs visible to the authenticated operation key. Use this endpoint to inventory SLO definitions, filter by owner, tag, status, or cluster, and page through results.",operationId:"querySlos",tags:["slos"],url:`${TT}/query`,method:"POST",paginated:!0,body:Qle,response:n.Array(bT)}),Jle=x({description:"Retrieves one SLO definition by ID.",operationId:"getSlo",tags:["slos"],url:`${TT}/:id`,method:"GET",params:n.Object({id:f({allowEmpty:!1,description:"SLO ID returned by SLO query, create, or update operations."})}),response:bT}),Zle=["name","description","tags","configuration","target","timeframeDays","owner","permissions","clusterIds","alerts"],Xle=n.Pick(tR,Zle,{$id:"CreateSloRequest",description:"SLO creation request. Provide ownership, data access, SLI configuration, target, timeframe, optional cluster scope, and the alerts to create."}),eue=n.Pick(e1,Zle,{$id:"UpdateSloRequest",description:"SLO update request. Send all required SLO fields and the full alert list. Alerts are reconciled to exactly the provided list: alerts with a known id are updated, alerts without an id are created, and existing alerts absent from the list are deleted. Omit `clusterIds` to preserve the current cluster scope; send an empty array to run on all clusters."}),tue={name:"API availability 99.9%",description:"Overall API gateway availability over the last 30 days",tags:[{key:"team",value:"platform"}],configuration:{type:"event",dataSource:"logs",goodQuery:{queries:[{filter:"status:ok",aggregate:{type:"count"}}],formula:"q1"},totalQuery:{queries:[{filter:"*",aggregate:{type:"count"}}],formula:"q1"},noDataBehavior:"good"},target:99.9,timeframeDays:30,owner:"team-123-abc",permissions:"all",clusterIds:[],alerts:[{priority:1,configuration:{type:"burn-rate",burnRate:14.4}}]};Object.assign(Xle,{examples:[tue]});Object.assign(eue,{examples:[tue]});var rue=x({description:"Creates an SLO owned by the specified team. The SLO can be event-based (good/total queries) or time-based (a thresholded query over evaluation slices) depending on its configuration.",operationId:"createSlo",tags:["slos"],url:TT,method:"POST",body:Xle,response:bT}),nue=x({description:"Replaces an existing SLO definition by ID. Send the full SLO input shape, including configuration, ownership, permissions, cluster scope, and the reconciled alert list. Changing configuration, target, timeframe, permissions, or cluster scope resets the evaluation state of every alert on the SLO, so each alert ignores the transitions it recorded before the update. The SLO status and error budget are recomputed from the telemetry in the rolling window and are not cleared by an update.",operationId:"updateSlo",tags:["slos"],url:`${TT}/:id`,method:"PUT",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the SLO to update. Use the `id` returned by SLO query or create."})}),body:eue,response:bT}),oue=x({description:"Deletes an SLO by ID. Deleting an SLO stops future evaluations and removes its attached alerts.",operationId:"deleteSlo",tags:["slos"],url:`${TT}/:id`,method:"DELETE",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the SLO to delete. Use the `id` returned by SLO query or create."})}),response:ae});var iue=_t({commandName:"slos",description:"Manage SLOs",singularOverride:"SLO",pluralOverride:"SLOs",endpoints:{list:Wle,get:Jle,create:rue,update:nue,delete:oue},enableListBody:!0});var Vc=`${hT}/tag-policies`;var l4e=["logs","metrics","traces"],m1=n.Array(n.Enum(l4e,{description:"Telemetry signal covered by a data tag policy."}),{description:"Telemetry signals covered by the policy. An empty array means logs, metrics, and traces."}),sue=n.Union([hO.items,m1.items]),u4e=n.Object({teamIds:n.Array(n.String(),{description:"Team IDs used by this policy scope."}),mode:n.Enum(["include","exclude"],{description:"`include` applies the policy only to listed teams. `exclude` applies it to all teams except the listed teams."})},{description:"Team scope that limits where this policy applies. Omitted means the policy applies to all teams."}),p4e=Q("type",[n.Object({type:n.Literal("telemetry",{description:"Policy applies to telemetry data points during ingestion or evaluation."}),assetTypes:m1,shouldInsertWarning:n.Boolean({description:"When true, Tsuga annotates non-compliant telemetry with tag policy warnings instead of only measuring violations."}),dropSample:n.Optional(n.Number({description:"Percentage of non-compliant telemetry datapoints to drop. Omitted means no sampling drop is configured."}))},{title:"TelemetryTagPolicy"}),n.Object({type:n.Literal("tsuga_asset",{description:"Policy applies to Tsuga-managed resources such as dashboards, routes, and keys."}),assetTypes:hO},{title:"TsugaAssetTagPolicy"})]),m4e=Q("type",[n.Object({type:n.Literal("telemetry",{description:"Policy applies to telemetry data points during ingestion or evaluation."}),assetTypes:m1,shouldInsertWarning:n.Boolean({description:"When true, Tsuga annotates non-compliant telemetry with tag policy warnings instead of only measuring violations."}),dropSample:n.Optional(n.Number({minimum:0,maximum:100,description:"Percentage of non-compliant telemetry datapoints to drop. Valid values are 0 through 100."}))},{title:"TelemetryTagPolicy"}),n.Object({type:n.Literal("tsuga_asset",{description:"Policy applies to Tsuga-managed resources such as dashboards, routes, and keys."}),assetTypes:hO},{title:"TsugaAssetTagPolicy"})]),aue="Policy surface and enforcement behavior. Use `telemetry` for telemetry data or `tsuga_asset` for Tsuga-managed resources.",d4e=n.Unsafe({...p4e,description:aue}),f4e=n.Unsafe({...m4e,description:aue}),Tm=n.Object({id:n.String({description:"Tsuga-generated tag policy ID assigned when the policy is created."}),name:n.String({description:"Human-readable tag policy name."}),description:n.Optional(n.String({description:"Optional user-provided policy description."})),isActive:n.Boolean({description:"Whether Tsuga currently evaluates this policy. Reserved policies (for example the built-in `env` policy on ingestion API keys) cannot be set to false."}),tagKey:n.String({description:"Tag key enforced by this policy."}),allowedTagValues:n.Array(n.String(),{description:"Allowed values for `tagKey`. An empty array means any value is accepted when the tag exists."}),isRequired:n.Boolean({description:"Whether the tag must be present. If false, `allowedTagValues` is still enforced when the tag exists. Reserved policies cannot be set to false."}),teamScope:n.Optional(u4e),configuration:d4e,creator:n.Optional(Qe),updater:n.Optional(Qe),owner:n.Optional(n.String({description:"Team ID that owns and manages the policy."})),createdAt:H({description:"Timestamp when Tsuga created the tag policy."}),updatedAt:H({description:"Timestamp when Tsuga last updated the tag policy."}),assetUpdatedAt:H({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})});var xT=n.Object({name:f({description:"Human-readable tag policy name."}),description:Ut(f(),{description:"Optional policy description."}),isActive:n.Boolean({description:"Set to true for Tsuga to evaluate this policy. Reserved policies (for example the built-in `env` policy on ingestion API keys) reject a false value."}),tagKey:f({allowEmpty:!1,description:"Tag key enforced by this policy. Tsuga trims surrounding whitespace before storing the policy."}),allowedTagValues:n.Array(f({allowEmpty:!1}),{maxItems:1e3,description:"Allowed values for `tagKey`. Leave empty to allow any value when the tag exists. Tsuga trims each submitted value before storing the policy."}),isRequired:n.Boolean({description:"Set to true to require the tag. If false, allowed values still apply when the tag exists. Reserved policies reject a false value."}),teamScope:n.Optional(n.Object({teamIds:n.Array(f(),{minItems:1,maxItems:100,description:"Team IDs used by this policy scope."}),mode:n.Enum(["include","exclude"],{description:"`include` applies the policy only to listed teams. `exclude` applies it to all teams except the listed teams."})},{description:"Team scope to store for this policy. Omit this field to apply the policy to all teams."})),configuration:f4e,owner:f({allowEmpty:!1,description:"Team ID that will own and manage the policy."})}),g4e=["name","isActive","tagKey","allowedTagValues","updatedAt"],cue=n.Object({searchQuery:ko({description:"Search query filter for tag policies.",valueDescription:"Case-insensitive substring matched against policy name, tag key, and allowed tag values."}),teamIds:qe(f({allowEmpty:!1}),{description:"Restrict results to policies that apply to any of these team IDs. Policies with no team scope apply to every team, so they always match.",minItems:1,uniqueItems:!0}),assetTypes:qe(sue,{description:"Restrict results to policies covering any of these asset types. Policies with an empty `configuration.assetTypes` cover every asset type of their configuration type, so they match any requested value of that type.",minItems:1,uniqueItems:!0}),configurationType:n.Enum(["telemetry","tsuga_asset"],{description:"Restrict results to data policies (`telemetry`) or asset policies (`tsuga_asset`)."}),status:n.Enum(["active","inactive"],{description:"Restrict results to active or inactive policies."})},{description:"Optional filters applied to narrow the returned tag policies."}),h4e=n.Partial(n.Object({...je,filters:n.Partial(cue),sort:n.Object({by:n.Enum(g4e,{description:"Field to sort the returned tag policies by."}),direction:Le})})),XSr=x({tags:["tag-policies"],url:`${Vc}/query`,method:"POST",paginated:!0,body:h4e,response:n.Array(Tm,{description:"Matching tag policies after they are filtered, sorted, and paginated."})}),y4e=n.Object({activeCounts:n.Object({totalCount:n.Integer({description:"Total number of matching policies regardless of whether they are active."}),active:n.Integer({description:"Number of matching policies that are active."}),inactive:n.Integer({description:"Number of matching policies that are inactive."})})}),E4e=n.Object({filters:n.Optional(n.Partial(n.Omit(cue,["status"]),{description:"Filters applied before collecting the active counts."}))}),eTr=x({tags:["tag-policies"],url:`${Vc}/active-counts/query`,method:"POST",body:E4e,response:y4e}),tTr=x({tags:["tag-policies"],url:Vc,method:"GET",query:n.Object({teamIds:n.Optional(n.Array(f(),{maxItems:100})),assetTypes:n.Optional(n.Array(sue)),searchQuery:n.Optional(f())}),response:n.Array(Tm)}),rTr=x({tags:["tag-policies"],url:`${Vc}/:id`,method:"GET",params:n.Object({id:f()}),response:Tm}),nTr=x({tags:["tag-policies"],url:Vc,method:"POST",body:xT,response:Tm}),oTr=x({tags:["tag-policies"],url:`${Vc}/:id`,method:"PUT",params:n.Object({id:f()}),body:xT,response:Tm}),iTr=x({tags:["tag-policies"],url:`${Vc}/:id`,method:"DELETE",params:n.Object({id:f()}),response:ae}),sTr=x({tags:["tag-policies"],url:`${hT}/applicable-tag-rules`,method:"GET",query:n.Object({assetType:n.Enum(JE),teamId:f()}),response:n.Array(n.Object({tagKey:n.String(),allowedTagValues:n.Array(n.String()),isRequired:n.Boolean(),tagPolicyId:n.String()}))}),lue=n.Object({total:n.Number(),totalNonCompliant:n.Number(),idsNonCompliant:n.Array(n.String())}),uue=n.Union([n.Literal("ingestion-api-key"),n.Literal("operation-api-key"),n.Literal("rum-public-token"),n.Literal("dashboard"),n.Literal("log-route"),n.Literal("metric-route"),n.Literal("monitor"),n.Literal("notification-rule"),n.Literal("notification-silence"),n.Literal("slo")]),S4e=n.Object({total:n.Number(),totalNonCompliant:n.Number(),byAssetType:n.Record(uue,lue)}),T4e=n.Omit(lue,["total"]),b4e=n.Object({totalNonCompliant:n.Number(),byAssetType:n.Record(uue,T4e)}),pue=n.Object({totals:S4e,byTeam:n.Record(n.String(),b4e)}),aTr=x({tags:["tag-policies"],url:`${Vc}/:id/stats`,method:"GET",params:n.Object({id:f()}),response:pue}),cTr=x({tags:["tag-policies"],url:`${Vc}/new-policy-stats`,method:"POST",body:xT,response:pue});var IT=`/${"v1"}/tag-policies`,mue={name:"Required Environment Tag",description:"Requires dashboards and monitors to declare an environment.",isActive:!0,tagKey:"environment",allowedTagValues:["production","staging"],isRequired:!0,teamScope:{teamIds:["team-123-abc"],mode:"include"},configuration:{type:"tsuga_asset",assetTypes:["dashboard","monitor"]},owner:"team-123-abc"},due={name:"Telemetry Environment Policy",description:"Warns when telemetry is missing a known deployment environment.",isActive:!0,tagKey:"deployment.environment.name",allowedTagValues:["production","staging","development"],isRequired:!0,configuration:{type:"telemetry",assetTypes:[],shouldInsertWarning:!0,dropSample:25},owner:"team-123-abc"},x4e={id:"123-456-abc",...mue},I4e={id:"456-789-def",...due},_T=n.Pick(Tm,["id","name","description","isActive","tagKey","allowedTagValues","isRequired","teamScope","configuration","owner"],{$id:"TagPolicy",description:"Policy that enforces tag requirements on Tsuga-managed assets or telemetry data. See [Tag policies](/documentation/account-and-settings/tag-policies)."}),_4e=x4e,A4e=I4e;Object.assign(_T,{examples:[_4e,A4e]});var d1=n.Pick(xT,["name","description","isActive","tagKey","allowedTagValues","isRequired","teamScope","configuration","owner"],{description:"Tag policy create or update request. Provide policy identity, owner, enforced tag key, allowed values, team scope, active state, and asset or telemetry configuration."}),O4e=mue,C4e=due;Object.assign(d1,{examples:[O4e,C4e]});var fue=x({description:"Lists tag policies visible to the authenticated operation key. Use this to audit required tags, allowed values, team scope, and whether each policy applies to assets or telemetry.",operationId:"listTagPolicies",tags:["tag-policies"],url:IT,method:"GET",response:n.Array(_T)}),gue=x({description:"Retrieves one tag policy by ID.",operationId:"getTagPolicy",tags:["tag-policies"],url:`${IT}/:id`,method:"GET",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the tag policy to retrieve. Use the `id` returned by tag policy list or create responses."})}),response:_T}),hue=x({description:"Creates a tag policy for Tsuga-managed assets or telemetry data. Use the configuration type to choose the policy surface.",operationId:"createTagPolicy",tags:["tag-policies"],url:IT,method:"POST",body:d1,response:_T}),yue=x({description:"Replaces an existing tag policy by ID, including scope, requiredness, allowed values, owner, active state, and configuration. Reserved policies (for example the built-in `env` policy on ingestion API keys) reject changes to `tagKey` and reject `isActive: false` or `isRequired: false`.",operationId:"updateTagPolicy",tags:["tag-policies"],url:`${IT}/:id`,method:"PUT",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the tag policy to update. Use the `id` returned by tag policy list, get, or create responses."})}),body:d1,response:_T}),Eue=x({description:"Deletes a tag policy by ID. Tsuga stops evaluating the policy after deletion. Reserved policies (for example the built-in `env` policy on ingestion API keys) cannot be deleted.",operationId:"deleteTagPolicy",tags:["tag-policies"],url:`${IT}/:id`,method:"DELETE",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the tag policy to delete. Use the `id` returned by tag policy list, create, or update responses."})}),response:ae});var Sue=_t({commandName:"tag-policies",description:"Manage tag policies",endpoints:{list:fue,get:gue,create:hue,update:yue,delete:Eue}});var AT=`/${"v1"}/teams`,OT=n.Pick(mu,["id","name","description","visibility","tags"],{$id:"Team",description:"Collection of users used to manage ownership, visibility, and access to team-owned Tsuga resources. See [Teams](/documentation/account-and-settings/teams)."}),R4e={id:"team-123-abc",name:"platform-engineering",visibility:"public",tags:[{key:"department",value:"engineering"}]};Object.assign(OT,{examples:[R4e]});var Tue=x({description:"Lists teams visible to the authenticated operation key. Use this endpoint to inventory owners for resources, dashboards, monitors, routes, and policies. Pagination fields limit the returned page.",operationId:"listTeams",tags:["teams"],url:AT,method:"GET",paginated:!0,query:n.Object(er),response:n.Array(OT)}),bue=x({description:"Retrieves one team by ID.",operationId:"getTeam",tags:["teams"],url:`${AT}/:id`,method:"GET",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the team to retrieve. Use the `id` returned by team list or create responses."})}),response:OT}),f1=n.Pick(IC,["name","description","visibility","tags"],{description:"Team create or update request. Provide the team name, optional description, visibility, and tags."}),P4e={name:"platform-engineering",visibility:"public",tags:[{key:"department",value:"engineering"}]};Object.assign(f1,{examples:[P4e]});var xue=x({description:"Creates a team for ownership and access control. Use this before assigning resources to a new owner team. A new team sits outside every existing team, so the operation key must be scoped to all teams: a key scoped to its owning team cannot create teams, even with write access to teams.",operationId:"createTeam",tags:["teams"],url:AT,method:"POST",body:f1,response:OT}),Iue=x({description:"Replaces a team definition by ID, including name, description, visibility, and tags.",operationId:"updateTeam",tags:["teams"],url:`${AT}/:id`,method:"PUT",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the team to update. Use the `id` returned by team list, get, or create responses."})}),body:f1,response:OT}),_ue=x({description:"Deletes a team. Fails while the team still owns resources (dashboards, monitors, routes, API keys, etc.); reassign or delete those first. Team memberships are removed automatically as part of the deletion.",operationId:"deleteTeam",tags:["teams"],url:`${AT}/:id`,method:"DELETE",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the team to delete. Use the `id` returned by team list, create, or update responses."})}),response:ae});var Aue=_t({commandName:"teams",description:"Manage teams",endpoints:{list:Tue,get:bue,create:xue,update:Iue,delete:_ue}});var Oue=[ase,hse,Vse,oae,uae,Pae,pce,vce,Fce,Wce,cle,Sle,Ple,Yle,iue,Sue,Aue];var g1={r:8,g:203,b:0},h1={r:0,g:130,b:0},y1=["\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2557 ","\u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557"," \u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551"," \u2588\u2588\u2551 \u255A\u2550\u2550\u2550\u2550\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2551"," \u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2551"," \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D"];function E1(e,t,r){return Math.round(e+(t-e)*r)}function w4e(e,t){let r=E1(g1.r,h1.r,t),o=E1(g1.g,h1.g,t),i=E1(g1.b,h1.b,t);return`\x1B[38;2;${r};${o};${i}m${e}\x1B[0m`}function v4e(e){if(!e)return`
|
|
268
|
+
- Rolled back the payments-api deployment and confirmed the error rate returned to baseline.`,tags:[{key:"team",value:"platform"}],owner:"team-123-abc",env:"prod",linkedAssets:[{type:"monitor",id:"monitor-123-abc"},{type:"dashboard",id:"dashboard-123-abc"}]};Object.assign(HC,{examples:[F2e]});var Mdr=x({tags:["investigations"],url:VS,method:"GET",paginated:!0,query:n.Object(je),response:n.Array(jc)}),Ddr=x({tags:["investigations"],url:`${VS}/:id`,params:n.Object({id:f()}),method:"GET",response:jc}),Fdr=x({tags:["investigations"],url:VS,method:"POST",body:QS,response:jc}),$dr=x({tags:["investigations"],url:`${VS}/:id`,method:"PUT",body:HC,params:n.Object({id:f()}),response:jc}),Gdr=x({tags:["investigations"],url:`${VS}/:id`,method:"DELETE",params:n.Object({id:f()}),response:ae});var WS=`/${"v1"}/investigations`,iae=x({description:"Retrieve all investigations",tags:["private"],url:WS,method:"GET",paginated:!0,query:n.Object(er),response:n.Array(jc)}),sae=x({description:"Retrieve an investigation by its id",tags:["private"],url:`${WS}/:id`,method:"GET",params:n.Object({id:f({allowEmpty:!1})}),response:jc}),aae=x({description:"Create a new investigation",tags:["private"],url:WS,method:"POST",body:QS,response:jc}),cae=x({description:"Update an investigation by its id",tags:["private"],url:`${WS}/:id`,method:"PUT",body:HC,params:n.Object({id:f({allowEmpty:!1})}),response:jc}),lae=x({description:"Delete an investigation by its id",tags:["private"],url:`${WS}/:id`,method:"DELETE",params:n.Object({id:f({allowEmpty:!1})}),response:ae});var uae=_t({commandName:"investigations",description:"Manage investigations (beta)",endpoints:{list:iae,get:sae,create:aae,update:cae,delete:lae}});var pae=15,KC={id:n.String({description:"Unique identifier of the processor within the route. Used to preserve processor identity during updates."}),description:n.Optional(n.String({description:"Optional user-provided processor note."})),tags:br,updatedAt:n.Optional(H({description:"Timestamp when Tsuga last updated the processor."}))},zC={id:f({allowEmpty:!1,description:"Unique identifier of the processor within the route. Preserve it across updates for existing processors."}),description:n.Optional(f({type:"long",description:"Optional processor note."})),tags:wr,updatedAt:n.Optional(H({description:"Backend-maintained timestamp for this processor. Omit this field on create and update requests; Tsuga sets or preserves it based on processor changes."}))},mae={...KC,type:n.Literal("creator",{description:"Create processor. It writes a new attribute from a format string, formula, or category rule."})},dae={...zC,type:n.Literal("creator",{description:"Create processor. It writes a new attribute from a format string, formula, or category rule."})},$2e=Q("subtype",[n.Object({targetAttribute:n.String({description:"Attribute that will receive the formatted value"}),formatString:n.String({description:"Template string used to build the target attribute value"}),overrideTarget:n.Optional(n.Boolean({description:"Whether to overwrite the target attribute when it already exists. If omitted, route processing treats this as true."})),subtype:n.Literal("format-string",{description:"Builds a string from literal text and existing attribute values."}),replaceMissingByEmpty:n.Optional(n.Boolean({description:"Whether missing referenced attributes render as empty strings. If omitted, route processing treats this as true."}))},{$id:"ProcessorParamsCreatorFormatString"}),n.Object({targetAttribute:n.String({description:"Attribute that will receive the computed value"}),formula:n.String({description:"Mathematical formula evaluated to populate the target attribute"}),overrideTarget:n.Optional(n.Boolean({description:"Whether to overwrite the target attribute when it already exists. If omitted, route processing treats this as true."})),subtype:n.Literal("math-formula",{description:"Evaluates a mathematical expression and writes the numeric result."}),replaceMissingBy0:n.Optional(n.Boolean({description:"Whether missing referenced attributes evaluate as zero. If omitted, route processing treats this as true."}))},{$id:"ProcessorParamsCreatorMathFormula"}),n.Object({targetAttribute:n.String({description:"Attribute that will receive the category value"}),clauses:n.Array(n.Object({query:n.String({description:"Query that selects logs for this category clause. Clauses are evaluated in order."}),value:n.String({description:"String category value assigned when this clause matches."})}),{description:"Conditions evaluated in order to determine the category value. The first matching clause wins."}),defaultValue:n.Optional(n.String({description:"String category value used when no clause matches. If omitted and no clause matches, no category value is written."})),subtype:n.Literal("category",{description:"Assigns the first matching category value from ordered query clauses, with an optional default."})},{$id:"ProcessorParamsCreatorCategory"})],{description:"Create processor configuration. The `subtype` discriminator selects how the value written to `targetAttribute` is built and which fields are required."}),G2e=Q("subtype",[n.Object({targetAttribute:f({allowEmpty:!1,description:"Attribute that will receive the formatted value"}),formatString:f({allowEmpty:!1,type:"long",description:"Template string used to build the target attribute value"}),overrideTarget:n.Optional(n.Boolean({description:"Set to true to overwrite an existing target attribute value (defaults to true)"})),subtype:n.Literal("format-string",{description:"Builds a string from literal text and existing attribute values."}),replaceMissingByEmpty:n.Optional(n.Boolean({description:"Set to true for missing referenced attributes to render as empty strings. Defaults to true."}))},{$id:"InputProcessorParamsCreatorFormatString"}),n.Object({targetAttribute:f({allowEmpty:!1,description:"Attribute that will receive the computed value"}),formula:f({allowEmpty:!1,type:"long",description:"Mathematical formula evaluated to populate the target attribute"}),overrideTarget:n.Optional(n.Boolean({description:"Set to true to overwrite an existing target attribute value (defaults to true)"})),subtype:n.Literal("math-formula",{description:"Evaluates a mathematical expression and writes the numeric result."}),replaceMissingBy0:n.Optional(n.Boolean({description:"Set to true for missing referenced attributes to evaluate as zero. Defaults to true."}))},{$id:"InputProcessorParamsCreatorMathFormula"}),n.Object({targetAttribute:f({allowEmpty:!1,description:"Attribute that will receive the category value"}),clauses:n.Array(n.Object({query:f({allowEmpty:!1,type:"tsuga-query",description:"Query that selects logs for this category clause. Clauses are evaluated in order."}),value:f({allowEmpty:!1,description:"String category value assigned when this clause matches."})}),{minItems:1,maxItems:pae,description:"Conditions evaluated in order to determine the category value. The first matching clause wins."}),defaultValue:n.Optional(f({description:"String category value used when no clause matches. If omitted and no clause matches, no category value is written."})),subtype:n.Literal("category",{description:"Assigns the first matching category value from ordered query clauses, with an optional default."})},{$id:"InputProcessorParamsCreatorCategory"})],{description:"Create processor configuration. The `subtype` discriminator selects how the value written to `targetAttribute` is built and which fields are required."}),B2e=n.Object({...mae,params:$2e}),q2e=n.Object({...dae,params:G2e}),fae={...KC,type:n.Literal("mapper",{description:"Map processor. It moves, copies, or normalizes existing log attributes."})},gae={...zC,type:n.Literal("mapper",{description:"Map processor. It moves, copies, or normalizes existing log attributes."})},j2e=Q("subtype",[n.Object({attributes:n.Array(n.Object({originAttribute:n.String({description:"Attribute name to map to the target attribute"}),keepOrigin:n.Optional(n.Boolean({description:"Whether the source attribute is preserved after mapping. If omitted, route processing treats this as false."})),overrideTarget:n.Optional(n.Boolean({description:"Whether to overwrite the target attribute when it already exists. If omitted, route processing treats this as true."})),targetAttribute:n.String({description:"Attribute name that will receive the mapped value"})}),{description:"Mappings that map individual attributes to new targets"}),subtype:n.Literal("map-attributes",{description:"Copies or moves one or more source attributes to target attributes."})},{$id:"ProcessorParamsMapperMapAttributes"}),n.Object({attributeName:n.String({description:"Attribute whose value will determine the log level"}),subtype:n.Literal("map-level",{description:"Normalizes a severity or status attribute into Tsuga log levels."})},{$id:"ProcessorParamsMapperMapLevel"}),n.Object({attributeName:n.String({description:"Attribute whose value will determine the log timestamp"}),subtype:n.Literal("map-timestamp",{description:"Uses an event-time attribute as the log timestamp."})},{$id:"ProcessorParamsMapperMapTimestamp"})],{description:"Map processor configuration. The `subtype` discriminator selects whether existing attributes are copied or moved to new names, or used to set the log level or timestamp."}),H2e=Q("subtype",[n.Object({attributes:n.Array(n.Object({originAttribute:f({allowEmpty:!1,description:"Attribute name to map to the target attribute"}),keepOrigin:n.Optional(n.Boolean({description:"Preserve the source attribute after mapping (defaults to false)"})),overrideTarget:n.Optional(n.Boolean({description:"Overwrite the target attribute when it already exists (defaults to true)"})),targetAttribute:f({allowEmpty:!1,description:"Attribute name that will receive the mapped value"})}),{minItems:1,maxItems:50,description:"Mappings that map individual attributes to new targets"}),subtype:n.Literal("map-attributes",{description:"Copies or moves one or more source attributes to target attributes."})},{$id:"InputProcessorParamsMapperMapAttributes"}),n.Object({attributeName:f({allowEmpty:!1,description:"Attribute whose value will determine the log level"}),subtype:n.Literal("map-level",{description:"Normalizes a severity or status attribute into Tsuga log levels."})},{$id:"InputProcessorParamsMapperMapLevel"}),n.Object({attributeName:f({allowEmpty:!1,description:"Attribute whose value will determine the log timestamp"}),subtype:n.Literal("map-timestamp",{description:"Uses an event-time attribute as the log timestamp."})},{$id:"InputProcessorParamsMapperMapTimestamp"})],{description:"Map processor configuration. The `subtype` discriminator selects whether existing attributes are copied or moved to new names, or used to set the log level or timestamp."}),K2e=n.Object({...gae,params:H2e}),z2e=n.Object({...fae,params:j2e}),hae={...KC,type:n.Literal("parse-attribute",{description:"Parse processor. It extracts structured fields from a text attribute."})},yae={...zC,type:n.Literal("parse-attribute",{description:"Parse processor. It extracts structured fields from a text attribute."})},Eae=5,Y2e=Q("subtype",[n.Object({attributeName:n.String({description:"Attribute whose value will be parsed with Grok rules"}),rules:n.Array(n.String({description:"Grok rule applied to parse text. Route processing sends rules as engine patterns."}),{description:"Ordered Grok rules evaluated until one matches."}),samples:n.Optional(n.Array(n.String(),{description:"Example log lines for validating the Grok rules. Samples are not sent to the ingestion engine."})),subtype:n.Literal("grok",{description:"Extracts fields from unstructured text using ordered Grok rules."})}),n.Object({sourceAttribute:n.String({description:"Attribute containing the URL to parse"}),subtype:n.Literal("url",{description:"Parses a URL attribute and writes URL detail fields."})}),n.Object({sourceAttribute:n.String({description:"Attribute containing the user agent string to parse"}),subtype:n.Literal("user-agent",{description:"Parses a user-agent string and writes browser, operating system, and device details."})}),n.Object({sourceAttribute:n.String({description:"Attribute containing the key/value string segment to parse"}),targetAttribute:n.String({description:"Target map attribute where extracted key/value pairs will be written"}),keyValueSplitter:n.String({description:"Delimiter separating keys from values in the source string"}),pairsSplitter:n.String({description:"Delimiter separating each key/value pair in the source string."}),acceptStandaloneKey:n.Boolean({description:"Whether keys without explicit values are accepted by the parser."}),subtype:n.Literal("key-value",{description:"Parses delimited key/value text into attributes."})})],{description:"Parse processor configuration. The `subtype` discriminator selects which parser reads the source text attribute and which fields it extracts."}),V2e=Q("subtype",[n.Object({attributeName:f({allowEmpty:!1,description:"Attribute whose value will be parsed with Grok rules"}),rules:n.Array(f({allowEmpty:!1,type:"long",description:"Grok rule applied to parse text. Route processing sends rules as engine patterns."}),{minItems:1,maxItems:5,description:"Ordered Grok rules evaluated until one matches."}),samples:n.Optional(n.Array(f({type:"long"}),{maxItems:Eae,description:"Example log lines for validating the Grok rules. Samples are not sent to the ingestion engine."})),subtype:n.Literal("grok",{description:"Extracts fields from unstructured text using ordered Grok rules."})}),n.Object({sourceAttribute:f({allowEmpty:!1,description:"Attribute containing the URL to parse"}),subtype:n.Literal("url",{description:"Parses a URL attribute and writes URL detail fields."})}),n.Object({sourceAttribute:f({allowEmpty:!1,description:"Attribute containing the user agent string to parse"}),subtype:n.Literal("user-agent",{description:"Parses a user-agent string and writes browser, operating system, and device details."})}),n.Object({sourceAttribute:f({allowEmpty:!1,description:"Attribute containing the key/value string segment to parse"}),targetAttribute:f({description:"Target map attribute where extracted key/value pairs will be written"}),keyValueSplitter:f({allowEmpty:!1,description:"Delimiter separating keys from values in the source string"}),pairsSplitter:f({allowEmpty:!0,description:"Delimiter separating each key/value pair in the source string."}),acceptStandaloneKey:n.Boolean({description:"Set to true to accept keys without explicit values."}),subtype:n.Literal("key-value",{description:"Parses delimited key/value text into attributes."})})],{description:"Parse processor configuration. The `subtype` discriminator selects which parser reads the source text attribute and which fields it extracts."}),Q2e=n.Object({...hae,params:Y2e}),W2e=n.Object({...yae,params:V2e}),J2e=n.Object({...dae,params:Q("subtype",[n.Object({targetAttribute:f({allowEmpty:!1,description:"Attribute that will receive the formatted value"}),formatString:f({allowEmpty:!1,type:"long",description:"Template string used to build the target attribute value"}),overrideTarget:n.Optional(n.Boolean({description:"Set to true to overwrite an existing target attribute value (defaults to true)"})),subtype:n.Literal("format-string"),replaceMissingByEmpty:n.Optional(n.Boolean({description:"Set to true for missing referenced attributes to render as empty strings. Defaults to true."}))}),n.Object({targetAttribute:f({allowEmpty:!1,description:"Attribute that will receive the category value"}),clauses:n.Array(n.Object({query:f({allowEmpty:!1,type:"tsuga-query",description:"Query that selects logs for this category clause. Clauses are evaluated in order."}),value:f({allowEmpty:!1,description:"String category value assigned when this clause matches."})}),{minItems:1,maxItems:pae,description:"Conditions evaluated in order to determine the category value. The first matching clause wins."}),defaultValue:n.Optional(f({description:"String category value used when no clause matches."})),subtype:n.Literal("category")})])}),Z2e=n.Object({...gae,params:n.Object({attributes:n.Array(n.Object({originAttribute:f({allowEmpty:!1,description:"Attribute name to map to the target attribute"}),keepOrigin:n.Optional(n.Boolean({description:"Preserve the source attribute after mapping (defaults to false)"})),overrideTarget:n.Optional(n.Boolean({description:"Overwrite the target attribute when it already exists (defaults to true)"})),targetAttribute:f({allowEmpty:!1,description:"Attribute name that will receive the mapped value"})}),{minItems:1,maxItems:50,description:"Mappings that map individual attributes to new targets"}),subtype:n.Literal("map-attributes")})}),X2e=n.Object({...yae,params:n.Object({attributeName:f({allowEmpty:!1,description:"Attribute whose value will be parsed with Grok rules"}),rules:n.Array(f({allowEmpty:!1,type:"long",description:"Grok rule applied to parse text. Route processing sends rules as engine patterns."}),{minItems:1,maxItems:5,description:"Ordered Grok rules evaluated until one matches."}),samples:n.Optional(n.Array(f({type:"long"}),{maxItems:Eae,description:"Example log lines for validating the Grok rules."})),subtype:n.Literal("grok")})}),rfr=Q("type",[Z2e,X2e,J2e]),eHe=n.Object({...mae,params:Q("subtype",[n.Object({targetAttribute:n.String({description:"Attribute that will receive the formatted value"}),formatString:n.String({description:"Template string used to build the target attribute value"}),overrideTarget:n.Optional(n.Boolean({description:"Whether to overwrite the target attribute when it already exists."})),subtype:n.Literal("format-string"),replaceMissingByEmpty:n.Optional(n.Boolean({description:"Whether missing referenced attributes render as empty strings."}))}),n.Object({targetAttribute:n.String({description:"Attribute that will receive the category value"}),clauses:n.Array(n.Object({query:n.String({description:"Query that selects logs for this category clause."}),value:n.String({description:"String category value assigned when this clause matches."})}),{description:"Conditions evaluated in order to determine the category value."}),defaultValue:n.Optional(n.String({description:"String category value used when no clause matches."})),subtype:n.Literal("category")})])}),tHe=n.Object({...fae,params:n.Object({attributes:n.Array(n.Object({originAttribute:n.String({description:"Attribute name to map to the target attribute"}),keepOrigin:n.Optional(n.Boolean({description:"Whether the source attribute is preserved after mapping."})),overrideTarget:n.Optional(n.Boolean({description:"Whether to overwrite the target attribute when it already exists."})),targetAttribute:n.String({description:"Attribute name that will receive the mapped value"})}),{description:"Mappings that map individual attributes to new targets"}),subtype:n.Literal("map-attributes")})}),rHe=n.Object({...hae,params:n.Object({attributeName:n.String({description:"Attribute whose value will be parsed with Grok rules"}),rules:n.Array(n.String({description:"Grok rule applied to parse text."}),{description:"Ordered Grok rules evaluated until one matches."}),samples:n.Optional(n.Array(n.String(),{description:"Example log lines for validating the Grok rules."})),subtype:n.Literal("grok")})}),nfr=Q("type",[tHe,rHe,eHe]),nHe=11,Sae=n.Cyclic({OutputProcessor:n.Union([z2e,Q2e,B2e,n.Object({...KC,params:n.Object({items:n.Array(n.Object({query:n.String({description:"Query that determines whether logs enter this branch"}),processors:n.Array(n.Ref("OutputProcessor"),{description:"Processors executed when the branch query matches"})}),{description:"Conditional branches evaluated in order before falling back to the default"})}),type:n.Literal("split",{description:"Split processor. It sends each log through the first matching conditional branch."})})])},"OutputProcessor",{description:"Processing step executed sequentially on route logs"}),Tae=n.Cyclic({InputProcessor:n.Union([K2e,W2e,q2e,n.Object({...zC,params:n.Object({items:n.Array(n.Object({query:f({type:"tsuga-query",description:"Query that determines whether logs enter this branch"}),processors:n.Array(n.Ref("InputProcessor"),{maxItems:50,description:"Processors executed when the branch query matches"})}),{minItems:2,maxItems:nHe,description:"Conditional branches evaluated in order before falling back to the default"})}),type:n.Literal("split",{description:"Split processor. It sends each log through the first matching conditional branch."})})])},"InputProcessor",{description:"Processing step executed sequentially on route logs"});var oHe="/v0/logs",Ra=`${oHe}/routes`,Hc=n.Object({id:n.String({description:"Tsuga-generated log route ID assigned when the route is created."}),name:n.String({description:"Human-readable route name shown in Tsuga."}),description:n.Optional(n.String({description:"Optional free-text note about the route's purpose, set by the caller. This metadata is not evaluated when matching or processing logs."})),isEnabled:n.Boolean({description:"Whether this route is active for newly ingested logs. Disabled routes remain saved but do not process logs."}),query:n.String({description:"Tsuga query that selects which newly ingested logs enter the route processor chain."}),rank:n.Number({description:"Tsuga-assigned evaluation order, unique across all routes and dense (no gaps). Enabled routes are checked from lower rank to higher rank during ingestion, and every route whose query matches a log applies its processors to it \u2014 matching is not stopped after the first hit. New routes are appended with the highest rank; deleting a route shifts all higher ranks down by one to close the gap. Use `PUT /:id/modify-ranking` to move a route to a different rank, which shifts the routes between its old and new position accordingly."}),tags:br,owner:n.String({description:"ID of the team that owns the route. Determines which team members can view and manage it, and which tag policies apply to it. Only an org admin or an admin of this team may change fields other than `processors`, or delete the route."}),processors:n.Array(Sae,{description:"Processors applied in array order to logs that match the route, each transforming the output of the previous one. A `split` processor forks the chain into branches and cannot be followed by another processor at the same level."}),creator:n.Optional(Qe),updater:n.Optional(Qe),updatedAt:H({description:"Timestamp when Tsuga last updated the route."}),createdAt:H({description:"Timestamp when Tsuga created the route."}),assetUpdatedAt:H({description:"Timestamp when Tsuga last changed route behavior. This can differ from `updatedAt` when only metadata such as `description` or `tags` changed."})},{title:"LogRoute"}),JS=n.Object({name:f({allowEmpty:!1,description:"Human-readable log route name shown in Tsuga."}),description:Ut(f({type:"long"}),{description:"Optional free-text note about the log route's purpose. This metadata is not evaluated when matching or processing logs."}),isEnabled:n.Boolean({description:"Set to true for the log route to process newly ingested matching logs. Set to false to save it without running it."}),query:f({type:"tsuga-query",description:"Tsuga query that selects which newly ingested logs enter the log route processor chain."}),tags:wr,owner:f({allowEmpty:!1,description:"ID of the team that will own the log route, determining which team members can view and manage it and which tag policies apply. Only an org admin or an admin of this team may change fields other than `processors`, or delete the route."}),processors:n.Array(Tae,{maxItems:50,description:"Processors applied in array order to logs that match the log route, each transforming the output of the previous one. Up to 50 are accepted. A `split` processor forks the chain into branches and cannot be followed by another processor at the same level."})});var iHe=["active","inactive"],sHe=["isEnabled","name","query","owner","tags","processors","rank","assetUpdatedAt"],bae=n.Object({owners:qe(f({allowEmpty:!1}),{description:"Restrict results to routes owned by any of these team IDs.",maxItems:50}),searchQuery:ko({description:"Search query filter for routes.",valueDescription:"Case-insensitive substring matched against route name and ID."}),status:n.Enum(iHe,{description:"Restrict results to enabled (`active`) or disabled (`inactive`) routes."})}),aHe=n.Partial(n.Object({...je,filters:n.Partial(bae),sort:n.Object({by:n.Enum(sHe,{description:"Field to sort the returned routes by."}),direction:Le})})),cHe=n.Object({filters:n.Optional(n.Partial(n.Omit(bae,["status"]),{description:"Filters applied before counting enabled and disabled routes."}))}),lHe=n.Object({totalCount:n.Integer({description:"Number of matching routes, whether they are enabled or disabled."}),active:n.Integer({description:"Number of matching routes that are enabled."}),inactive:n.Integer({description:"Number of matching routes that are disabled."})}),mfr=x({tags:["routes"],url:`${Ra}/query`,method:"POST",paginated:!0,body:aHe,response:n.Array(Hc,{description:"Matching log routes after they are filtered, sorted, and paginated."})}),dfr=x({tags:["routes"],url:`${Ra}/counts/query`,method:"POST",body:cHe,response:lHe}),ffr=x({tags:["routes"],url:Ra,method:"GET",paginated:!0,query:n.Object(je),response:n.Array(Hc)}),gfr=x({tags:["routes"],url:`${Ra}/:id`,params:n.Object({id:f()}),method:"GET",response:Hc}),hfr=x({tags:["routes"],url:Ra,method:"POST",body:JS,response:Hc}),yfr=x({tags:["routes"],url:`${Ra}/:id`,method:"PUT",body:JS,params:n.Object({id:f()}),response:Hc}),Efr=x({tags:["routes"],url:`${Ra}/:id/clone`,method:"POST",params:n.Object({id:f()}),body:JS,response:Hc}),Sfr=x({tags:["routes"],url:`${Ra}/:id`,method:"DELETE",params:n.Object({id:f()}),response:ae}),Tfr=x({description:"Moves a route to a new rank, shifting the ranks of the routes between its old and new position by one to keep ranks dense and unique. Affects the route's evaluation order for newly ingested logs; does not change any route's processors or other fields.",tags:["routes"],url:`${Ra}/:id/modify-ranking`,method:"PUT",params:n.Object({id:f()}),body:n.Object({rank:n.Integer({minimum:1,description:"Target rank for the route, from 1 to the total number of routes. Requests outside that range are rejected."})}),response:n.Object({})}),bfr=x({description:"Sets a route's `isEnabled` state without changing any other field. Disabling a route stops it from processing newly ingested logs while keeping it saved and its rank unchanged.",tags:["routes"],url:`${Ra}/:id/enable`,method:"PUT",params:n.Object({id:f()}),body:n.Object({enable:n.Boolean({description:"Set to true to enable the route, or false to disable it."})}),response:Hc});var ZS=`/${"v1"}/routes`,xae={name:"Enrich API Gateway Logs",description:"Adds service metadata and normalizes log format",isEnabled:!0,query:"service:api-gateway",tags:[{key:"category",value:"enrichment"}],owner:"team-123-abc",processors:[{id:"parse-gateway-message",type:"parse-attribute",tags:[],params:{subtype:"grok",attributeName:"message",rules:["%{TIMESTAMP_ISO8601:timestamp} %{LOGLEVEL:level} %{GREEDYDATA:msg}"]}}]},Iae={name:"Normalize Checkout Logs",description:"Maps service fields and extracts key/value details",isEnabled:!0,query:"context.service.name:checkout",tags:[{key:"category",value:"normalization"}],owner:"team-123-abc",processors:[{id:"map-service-name",type:"mapper",tags:[],params:{subtype:"map-attributes",attributes:[{originAttribute:"context.service.name",targetAttribute:"service",keepOrigin:!1,overrideTarget:!0}]}},{id:"parse-logfmt-message",type:"parse-attribute",tags:[],params:{subtype:"key-value",sourceAttribute:"message",targetAttribute:"logfmt",keyValueSplitter:"=",pairsSplitter:" ",acceptStandaloneKey:!1}}]},XS=n.Pick(Hc,["id","name","description","isEnabled","query","tags","owner","processors"],{$id:"Route",description:"Team-owned log processing definition that selects newly ingested logs and applies ordered processors. See [Routes](/documentation/process/routes/index)."}),uHe={id:"123-456-abc",...xae},pHe={id:"456-789-def",...Iae};Object.assign(XS,{examples:[uHe,pHe]});var _ae=x({description:"Lists log routes visible to the authenticated operation key. Returned routes are ordered by evaluation order, with earlier routes evaluated first. Use this to inventory ingest-time processing definitions and owners. Pagination fields limit the returned page.",operationId:"listRoutes",tags:["routes"],url:ZS,method:"GET",paginated:!0,query:n.Object(er),response:n.Array(XS)}),Aae=x({description:"Retrieves one log route by ID.",operationId:"getRoute",tags:["routes"],url:`${ZS}/:id`,method:"GET",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the log route to retrieve. Use the `id` returned by route list or create responses."})}),response:XS}),OF=n.Pick(JS,["name","description","isEnabled","query","tags","owner","processors"],{description:"Log route create or update request. Provide the route metadata, source query, owner team, enabled state, tags, and ordered processors."});Object.assign(OF,{examples:[xae,Iae]});var Oae=x({description:"Creates a log route at the end of the evaluation order. Routes affect only newly ingested logs after the cluster receives the updated configuration.",operationId:"createRoute",tags:["routes"],url:ZS,method:"POST",body:OF,response:XS}),Cae=x({description:"Updates an existing log route by ID without changing its evaluation order. Fields omitted from the request keep their existing values. Routes affect only newly ingested logs after the cluster receives the updated configuration.",operationId:"updateRoute",tags:["routes"],url:`${ZS}/:id`,method:"PUT",body:OF,params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the log route to update. Use the `id` returned by route list, get, or create responses."})}),response:XS}),Rae=x({description:"Deletes a log route by ID and compacts the evaluation order for remaining routes. The route stops processing future logs after the cluster receives the updated configuration.",operationId:"deleteRoute",tags:["routes"],url:`${ZS}/:id`,method:"DELETE",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the log route to delete. Use the `id` returned by route list, create, or update responses."})}),response:ae});var Pae=_t({commandName:"log-routes",description:"Manage log routes",endpoints:{list:_ae,get:Aae,create:Oae,update:Cae,delete:Rae}});var bo="/v0/monitors",Eg=["alert","resolve","keep_last_status","consider_zero"],Sg=["alert","resolve","keep_last_status"];var vae=["no_aggregation","all","any","each","proportion"],Uae=["greater_than","less_than","equal","not_equal","greater_than_or_equal","less_than_or_equal"];var mHe=n.Object({formula:n.String({description:"Formula result to compare against the threshold, usually `q1` or a formula alias."}),operator:n.Enum(Uae,{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."})}),dHe=n.Object({formula:f({type:"tsuga-formula",description:"Formula result to compare against the threshold, usually `q1` or a formula alias."}),operator:n.Enum(Uae,{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."})}),fHe=5,CF=n.Array(mHe,{description:"Threshold conditions evaluated against query and formula results. All listed conditions must match for a non-grouped threshold monitor to alert."}),RF=n.Array(dHe,{minItems:1,maxItems:fHe,description:"Threshold conditions evaluated against query and formula results. All listed conditions must match for a non-grouped threshold monitor to alert."}),PF=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`."}),wF=n.Object({formula:f({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`."}),To=[1,2,3,4,5];var YC={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:"Configured limit for this group by. Currently ignored; monitor evaluation applies a fixed limit of 100 groups per field."}),sortOrder:n.Optional(Le),replaceNullWith:n.Optional(n.String({description:"Value used to group documents that have no value for a grouped field."}))}),{description:"Monitor group by configuration. The `limit` setting is currently ignored; evaluation applies a fixed limit of 100 groups per field."}),aggregationAlertLogic:n.Optional(n.Enum(vae,{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`."}))},VC={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(f(),{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:"Configured limit for this group by. Currently ignored; monitor evaluation applies a fixed limit of 100 groups per field."}),sortOrder:n.Optional(Le),replaceNullWith:n.Optional(f({allowEmpty:!1,description:"Value used to group documents that have no value for a grouped field."}))}),{maxItems:1,description:"Monitor group by configuration. The `limit` setting is currently ignored; evaluation applies a fixed limit of 100 groups per field."}),aggregationAlertLogic:n.Optional(n.Enum(vae,{description:"How grouped results are combined into alert state. Use `no_aggregation` only when `groupByFields` is empty; use `all`, `any`, `each`, or `proportion` with non-empty `groupByFields`. `proportion` also requires `proportionAlertThreshold`. On create, omitted query-monitor values default to `no_aggregation`; on update, omitted values keep the existing aggregation logic."})),proportionAlertThreshold:n.Optional(n.Integer({minimum:1,maximum:99,description:"Percentage threshold used when `aggregationAlertLogic` is `proportion`."}))},vF={...YC,timeframe:n.Number({description:"Lookback window, in minutes, that each anomaly monitor evaluation aggregates over. Always a whole number from 5 through 1440."})},UF={...VC,timeframe:n.Integer({minimum:5,maximum:1440,description:"Lookback window, in minutes, that each anomaly monitor evaluation aggregates over."})},Nae=n.Object({type:n.Literal("metric",{description:"Threshold monitor over metric aggregations."}),conditions:CF,noDataBehavior:n.Enum(Eg,{description:"How the monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, `keep_last_status` preserves the previous state, and `consider_zero` evaluates missing values as zero."}),...YC,queries:Nc},{$id:"MonitorConfigurationMetric"}),kae=n.Object({type:n.Literal("metric",{description:"Threshold monitor over metric aggregations."}),conditions:RF,noDataBehavior:n.Enum(Eg,{description:"How the monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, `keep_last_status` preserves the previous state, and `consider_zero` evaluates missing values as zero."}),...VC,queries:ru},{$id:"InputMonitorConfigurationMetric"}),Lae=n.Object({type:n.Literal("log",{description:"Threshold monitor over log aggregations."}),conditions:CF,noDataBehavior:n.Enum(Eg,{description:"How the monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, `keep_last_status` preserves the previous state, and `consider_zero` evaluates missing values as zero."}),...YC,queries:Nc},{$id:"MonitorConfigurationLog"}),Mae=n.Object({type:n.Literal("log",{description:"Threshold monitor over log aggregations."}),conditions:RF,noDataBehavior:n.Enum(Eg,{description:"How the monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, `keep_last_status` preserves the previous state, and `consider_zero` evaluates missing values as zero."}),...VC,queries:ru},{$id:"InputMonitorConfigurationLog"}),Dae=n.Object({type:n.Literal("trace",{description:"Threshold monitor over trace aggregations."}),conditions:CF,noDataBehavior:n.Enum(Eg,{description:"How the monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, `keep_last_status` preserves the previous state, and `consider_zero` evaluates missing values as zero."}),...YC,queries:Nc},{$id:"MonitorConfigurationTrace"}),gHe=n.Object({type:n.Literal("trace",{description:"Threshold monitor over trace aggregations."}),conditions:RF,noDataBehavior:n.Enum(Eg,{description:"How the monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, `keep_last_status` preserves the previous state, and `consider_zero` evaluates missing values as zero."}),...VC,queries:ru},{$id:"InputMonitorConfigurationTrace"}),Fae=n.Object({type:n.Literal("anomaly-log",{description:"Anomaly monitor over log aggregations."}),condition:PF,noDataBehavior:n.Enum(Sg,{description:"How the anomaly monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, and `keep_last_status` preserves the previous state."}),...vF,queries:Nc},{$id:"MonitorConfigurationAnomalyLog"}),$ae=n.Object({type:n.Literal("anomaly-log",{description:"Anomaly monitor over log aggregations."}),condition:wF,noDataBehavior:n.Enum(Sg,{description:"How the anomaly monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, and `keep_last_status` preserves the previous state."}),...UF,queries:ru},{$id:"InputMonitorConfigurationAnomalyLog"}),Gae=n.Object({type:n.Literal("anomaly-metric",{description:"Anomaly monitor over metric aggregations."}),condition:PF,noDataBehavior:n.Enum(Sg,{description:"How the anomaly monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, and `keep_last_status` preserves the previous state."}),...vF,queries:Nc},{$id:"MonitorConfigurationAnomalyMetric"}),Bae=n.Object({type:n.Literal("anomaly-metric",{description:"Anomaly monitor over metric aggregations."}),condition:wF,noDataBehavior:n.Enum(Sg,{description:"How the anomaly monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, and `keep_last_status` preserves the previous state."}),...UF,queries:ru},{$id:"InputMonitorConfigurationAnomalyMetric"}),qae=n.Object({type:n.Literal("anomaly-trace",{description:"Anomaly monitor over trace aggregations. Use this configuration when Tsuga should learn historical trace query behavior and alert on unusual movement in trace-derived values."}),condition:PF,noDataBehavior:n.Enum(Sg,{description:"How the anomaly monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, and `keep_last_status` preserves the previous state."}),...vF,queries:Nc},{$id:"MonitorConfigurationAnomalyTrace"}),hHe=n.Object({type:n.Literal("anomaly-trace",{description:"Anomaly monitor over trace aggregations. Set this value to create or update an anomaly monitor that learns historical trace query behavior and alerts on unusual movement in trace-derived values."}),condition:wF,noDataBehavior:n.Enum(Sg,{description:"How the anomaly monitor updates state when no data is returned. `alert` enters no-data alert state, `resolve` resolves, and `keep_last_status` preserves the previous state."}),...UF,queries:ru},{$id:"InputMonitorConfigurationAnomalyTrace"}),jae=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"}),yHe=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"}),EHe=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."})},{$id:"MonitorConfigurationLogErrorPattern"}),SHe=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(f({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:f({allowEmpty:!1,description:"Environment whose logs are searched for new error patterns."}),services:n.Optional(n.Array(f({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."})},{$id:"InputMonitorConfigurationLogErrorPattern"}),Hae=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"}),THe=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(f({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:f({allowEmpty:!1,description:"Environment whose error logs are watched for volume increases."}),services:n.Optional(n.Array(f({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"}),bHe=Q("type",[Nae,Lae,Dae,Fae,Gae,EHe,Hae,qae,jae],{description:"Monitor evaluation configuration. The `type` discriminator determines which telemetry source, condition shape, and evaluation rules Tsuga uses."}),xHe=Q("type",[kae,Mae,gHe,$ae,Bae,hHe,SHe,THe,yHe],{description:"Monitor evaluation configuration. The `type` discriminator determines which telemetry source, condition shape, and evaluation rules Tsuga uses."});var Kc=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:br,configuration:bHe,priority:n.Enum(To,{description:"Monitor priority from 1 through 5, where 1 is highest priority."}),permissions:As,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."})),pauseUntil:n.Optional(H({description:"Timestamp until which the monitor is snoozed."})),creator:n.Optional(Qe),updater:n.Optional(Qe),createdAt:H({description:"Timestamp when Tsuga created the monitor."}),updatedAt:H({description:"Timestamp when Tsuga last updated the monitor."}),assetUpdatedAt:H({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"}),NF=Q("type",[Nae,Lae,Dae,Fae,Gae,qae,jae,Hae]),Hfr=n.Object({...Kc.properties,configuration:NF},{title:"Monitor"}),Kfr=n.Object({...Kc.properties,configuration:Q("type",[kae,Mae,$ae,Bae])},{title:"Monitor"}),eT=n.Object({name:f({description:"Display name of the monitor and alert source."}),message:Ut(f({type:"long"}),{description:"Message included in notifications triggered by this monitor. Optional on create."}),tags:wr,configuration:xHe,priority:n.Enum(To,{description:"Monitor priority from 1 through 5, where 1 is highest priority."}),owner:f({allowEmpty:!1,description:"Team ID that owns and manages the monitor."}),dashboardId:Ut(f({allowEmpty:!1}),{description:"ID of the dashboard to link to this monitor for context when investigating alerts. On create: omit or send `null` to leave the monitor unlinked. On update: omit to skip updating this field, send `null` to clear an existing link."}),pauseUntil:Ut(f({allowEmpty:!1,type:"date-time"}),{description:"ISO timestamp until which the monitor should be snoozed."}),permissions:As,clusterIds:n.Optional(n.Array(f({allowEmpty:!1}),{description:"Cluster IDs where the monitor should be deployed. Empty or omitted means all eligible clusters for cluster-deployed monitor types."}))}),wae=["threshold","certificate-expiry","anomaly-detection","log-error-pattern","log-error-pattern-increase"],hu={PRIORITY:"priority",TYPE:"type",NAME:"name",OWNER:"owner",TAGS:"tags",CLUSTER_IDS:"clusterIds",PAUSE_UNTIL:"pauseUntil",ASSET_UPDATED_AT:"assetUpdatedAt"};var kF=n.Object({owners:qe(f({allowEmpty:!1}),{description:"Restrict results to monitors owned by any of these team IDs",maxItems:50}),searchQuery:ko({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:qe(Fn.items,{description:"Restrict results to monitors that have at least one of the listed key/value tags",maxItems:50}),priorities:qe(n.Enum(To),{description:"Restrict results to monitors with one of these priorities",maxItems:To.length}),types:qe(n.Enum(wae),{description:"Restrict results to monitors with these types",maxItems:wae.length}),activity:n.Enum(["active","snoozed"],{description:"Restrict results by activity status: active monitors or currently snoozed monitors"}),clusterIds:qe(f({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"}),QC=n.Partial(kF),LF=n.Partial(n.Object({...je,filters:QC,sort:n.Object({by:n.Enum([hu.PRIORITY,hu.TYPE,hu.NAME,hu.OWNER,hu.TAGS,hu.CLUSTER_IDS,hu.PAUSE_UNTIL,hu.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:Le},{description:"Optional sorting applied to the returned monitors. Ties are broken by creation time and monitor ID for stable pagination."})})),zfr=x({tags:["monitors"],url:`${bo}/query`,method:"POST",paginated:!0,response:n.Array(Kc),body:LF}),Yfr=x({tags:["monitors"],url:`${bo}/tags/query`,method:"POST",body:n.Object({filters:n.Optional(n.Partial(n.Omit(kF,["tags"])))}),response:Dn}),Vfr=x({tags:["monitors"],url:`${bo}/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."})})}),Qfr=x({tags:["monitors"],url:`${bo}/:id`,method:"GET",params:n.Object({id:f()}),response:Kc}),Wfr=x({tags:["monitors"],url:bo,method:"POST",body:eT,response:Kc}),Jfr=x({tags:["monitors"],url:`${bo}/:id`,method:"PUT",params:n.Object({id:f()}),body:eT,response:Kc}),IHe=_i(QC,{maxIds:100}),Zfr=x({tags:["monitors"],url:`${bo}/bulk-update`,method:"PUT",body:n.Object({selection:IHe,owner:f({allowEmpty:!1})}),response:n.Object({})}),Xfr=x({tags:["monitors"],url:`${bo}/:id`,method:"DELETE",params:n.Object({id:f()}),response:ae}),_He=_i(QC),egr=x({tags:["monitors"],url:`${bo}/bulk-delete`,method:"DELETE",body:n.Object({selection:_He}),response:n.Object({})}),tgr=x({tags:["monitors"],url:`${bo}/:id/snooze`,method:"POST",params:n.Object({id:f()}),body:n.Object({pauseUntil:f({allowEmpty:!1,type:"date-time"})}),response:Kc}),AHe=_i(QC,{maxIds:100}),rgr=x({tags:["monitors"],url:`${bo}/bulk-snooze`,method:"POST",body:n.Object({selection:AHe,pauseUntil:f({allowEmpty:!1,type:"date-time"})}),response:n.Object({})}),OHe=["alert","alert_consider_zero","alert_no_data","keep_last_status_alert"],CHe=["ok","ok_consider_zero","ok_no_data","keep_last_status_ok"],RHe=[...OHe,...CHe],hm=n.Enum(RHe),PHe=Q("type",[n.Object({type:n.Literal("each"),subStates:n.Record(n.String(),n.Object({stateValue:n.Union([hm,n.Null()]),lastChangedAt:H()}))}),n.Object({type:n.Literal("no_aggregation"),stateValue:n.Optional(hm)}),n.Object({type:n.Literal("any"),stateValue:n.Optional(hm)}),n.Object({type:n.Literal("all"),stateValue:n.Optional(hm)}),n.Object({type:n.Literal("proportion"),stateValue:n.Optional(hm)})]),wHe=n.Object({monitorId:n.String(),currentState:PHe,lastChangedAt:n.Optional(H())}),ngr=x({tags:["monitors"],url:`${bo}/states/:id`,method:"GET",params:n.Object({id:f()}),response:wHe}),ogr=x({tags:["monitors"],url:`${bo}/:id/transitions`,method:"GET",params:n.Object({id:f()}),query:n.Object({from:n.Number(),to:n.Number()}),response:n.Array(n.Object({id:n.String(),createdAt:H(),fromState:n.Optional(hm),toState:n.Optional(hm),dimension:n.Optional(n.String())}))}),vHe=["unprocessed","processed","failed-to-process"],igr=x({tags:["monitors"],url:`${bo}/:id/results`,method:"GET",params:n.Object({id:f()}),query:n.Object({from:n.Number(),to:n.Number()}),response:n.Object({isTruncated:n.Boolean(),results:n.Array(n.Object({id:n.String(),evaluationAt:H(),formulaResult:n.Object({groups:n.Array(n.Object({groupKey:n.Record(n.String(),eS),results:n.Array(n.Union([n.Number(),n.Null()])),conditionMet:n.Enum(["true","false","nan-no-data"])}))}),createdAt:H(),status:n.Enum(vHe)}))})});var tT=`/${"v1"}/monitors`,Tg=n.Pick(Kc,["id","name","message","tags","configuration","priority","owner","dashboardId","permissions","clusterIds"],{$id:"Monitor",description:"Saved alert definition that evaluates telemetry and creates alert transitions. Notification delivery is configured separately with notification rules. See [Monitors](/documentation/alert/monitors/index)."}),dgr=n.Object({...Tg.properties,configuration:NF},{description:"Saved alert definition that evaluates telemetry and creates alert transitions, restricted to the kinds that raise ongoing alerts. Same shape as `Monitor` without the `log-error-pattern` configuration. See [Monitors](/documentation/alert/monitors/index)."}),zae={name:"High Error Rate Alert",message:"Error rate exceeded threshold. Check the API gateway logs.",tags:[{key:"severity",value:"critical"}],configuration:{type:"log",timeframe:5,groupByFields:[],aggregationAlertLogic:"no_aggregation",queries:[{aggregate:{type:"count"},filter:"level:ERROR service:api-gateway"}],conditions:[{formula:"q1",operator:"greater_than",threshold:100}],noDataBehavior:"resolve"},priority:1,owner:"team-123-abc",dashboardId:"789-abc-def",permissions:"all",clusterIds:[]},Yae={name:"High CPU Utilization By Service",message:"More than half of grouped services are above the CPU threshold.",tags:[{key:"severity",value:"warning"}],configuration:{type:"metric",timeframe:10,groupByFields:[{fields:["context.service.name"],limit:10}],aggregationAlertLogic:"proportion",proportionAlertThreshold:50,queries:[{aggregate:{type:"average",field:"system.cpu.utilization"},filter:"context.service.name:checkout"}],conditions:[{formula:"q1",operator:"greater_than",threshold:.8}],noDataBehavior:"keep_last_status"},priority:2,owner:"team-123-abc",dashboardId:"789-abc-def",permissions:"all",clusterIds:[]},Vae={name:"Certificate Expiry Warning",message:"A certificate is approaching expiry.",tags:[{key:"environment",value:"production"}],configuration:{type:"certificate-expiry",warnBeforeInDays:30,cloudAccounts:["aws-prod"],aggregationAlertLogic:"each",noDataBehavior:"resolve"},priority:3,owner:"team-123-abc",dashboardId:"789-abc-def",permissions:"all",clusterIds:[]},Qae={name:"New Error Pattern Detector",message:"A new error pattern was detected in the logs.",tags:[{key:"team",value:"platform"}],configuration:{type:"log-error-pattern",aggregationAlertLogic:"each",noDataBehavior:"keep_last_status",filter:{teamIds:["team-123-abc"],env:"production",services:["api-gateway"]}},priority:2,owner:"team-123-abc",dashboardId:"789-abc-def",permissions:"all",clusterIds:[]},Wae={name:"Error Pattern Increase Detector",message:"An existing error pattern is spiking.",tags:[{key:"team",value:"platform"}],configuration:{type:"log-error-pattern-increase",aggregationAlertLogic:"each",noDataBehavior:"resolve",filter:{teamIds:["team-123-abc"],env:"production",services:["api-gateway"]}},priority:2,owner:"team-123-abc",dashboardId:"789-abc-def",permissions:"all",clusterIds:[]},UHe={id:"123-456-abc",...zae},NHe={id:"234-567-bcd",...Yae},kHe={id:"345-678-cde",...Vae},LHe={id:"456-789-def",...Qae},MHe={id:"567-890-efa",...Wae};Object.assign(Tg,{examples:[UHe,NHe,kHe,LHe,MHe]});var Kae=n.Pick(LF,["filters","sort","limit","offset"]),Jae=n.Object({...Kae.properties,...er,filters:Kae.properties.filters},{description:"Monitor query request. Use filters, sorting, limit, and offset to page through visible monitors."}),DHe={filters:{owners:{values:["team-123-abc"]},searchQuery:{value:"service:api-gateway"},tags:{values:[{key:"paging",value:"true"}]},priorities:{values:[4,5],exclude:!0},types:{values:["threshold"]},activity:"active",clusterIds:{values:["cluster-123-abc"]}},sort:{by:"name",direction:"asc"},limit:10,offset:0};Object.assign(Jae,{examples:[DHe]});var Zae=x({description:"Queries monitors visible to the authenticated operation key. Use this endpoint to inventory monitor definitions, filter by owner, tag, priority, type, activity, or cluster, and page through results. See [Monitors](/documentation/alert/monitors/index).",operationId:"queryMonitors",tags:["monitors"],url:`${tT}/query`,method:"POST",paginated:!0,body:Jae,response:n.Array(Tg)}),Xae=x({description:"Retrieves one monitor definition by ID.",operationId:"getMonitor",tags:["monitors"],url:`${tT}/:id`,method:"GET",params:n.Object({id:f({allowEmpty:!1,description:"Monitor ID returned by monitor query, create, or update operations."})}),response:Tg}),ece=["name","message","tags","configuration","priority","owner","dashboardId","permissions","clusterIds"],tce=n.Pick(eT,ece,{$id:"CreateMonitorRequest",description:"Monitor creation request. Provide ownership, data access, alert configuration, priority, tags, and optional dashboard or cluster scope."}),rce=n.Pick(eT,ece,{$id:"UpdateMonitorRequest",description:"Monitor update request. Required fields and the submitted configuration are overwritten; omitted `message`, `tags`, and `clusterIds` keep their existing values. Omitting `dashboardId` clears the dashboard link."}),nce=zae,oce=Yae,ice=Vae,sce=Qae,ace=Wae;Object.assign(tce,{examples:[nce,oce,ice,sce,ace]});Object.assign(rce,{examples:[nce,oce,ice,sce,ace]});var cce=x({description:"Creates a monitor owned by the specified team. The monitor can evaluate logs, metrics, traces, anomaly behavior, certificate expiry, new error patterns, or error pattern increases depending on its configuration.",operationId:"createMonitor",tags:["monitors"],url:tT,method:"POST",body:tce,response:Tg}),lce=x({description:"Updates an existing monitor definition by ID. Required fields and the submitted configuration are overwritten; omitted `message`, `tags`, and `clusterIds` keep their existing values. Omitting `dashboardId` clears the dashboard link, and public updates clear any existing snooze because `pauseUntil` is not part of the public schema.",operationId:"updateMonitor",tags:["monitors"],url:`${tT}/:id`,method:"PUT",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the saved monitor to update. Use the `id` returned by monitor query or create responses."})}),body:rce,response:Tg}),FHe=n.Object({id:f({allowEmpty:!1,description:"Identifier of the saved monitor to delete. Use the `id` returned by monitor query, create, or update responses."})}),uce=x({description:"Deletes a monitor by ID. Deleting a monitor stops future evaluations and alert transitions for that monitor.",operationId:"deleteMonitor",tags:["monitors"],url:`${tT}/:id`,method:"DELETE",params:FHe,response:ae});var pce=_t({commandName:"monitors",description:"Manage monitors",endpoints:{list:Zae,get:Xae,create:cce,update:lce,delete:uce},enableListBody:!0});var mce=Q("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")})]),dce=Q("type",[n.Object({type:n.Literal("bearer"),token:f({allowEmpty:!1})}),n.Object({type:n.Literal("basic"),username:f({allowEmpty:!1}),password:f({allowEmpty:!1})}),n.Object({type:n.Literal("custom-header"),key:f({allowEmpty:!1}),value:f({allowEmpty:!1})}),n.Object({type:n.Literal("none")})]),fce=Q("type",[n.Object({type:n.Literal("bearer"),token:n.Optional(f({allowEmpty:!1}))}),n.Object({type:n.Literal("basic"),username:n.Optional(f({allowEmpty:!1})),password:n.Optional(f({allowEmpty:!1}))}),n.Object({type:n.Literal("custom-header"),key:n.Optional(f({allowEmpty:!1})),value:n.Optional(f({allowEmpty:!1}))}),n.Object({type:n.Literal("none")})]);var bg="/v0/notifications",va=`${bg}/rules`,gce=`${bg}/slack/setup`,xg=`${bg}/integrations`,ym=["triggered","resolved","no-data"],$He=["sent","stale","pending","rate-limited","failed","silenced"],GHe=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."})),MF=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."}),BHe=n.Optional(MF),Pa=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."})),wa=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."})),rT=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:GHe,config:Q("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:Pa},{$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:Pa},{$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:Pa},{$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:Pa},{$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:Pa},{$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:Pa},{$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:Pa},{$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:Pa},{$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:Pa},{$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:Pa},{$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`."})}),Ig=n.Object({id:f({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:BHe,config:Q("type",[n.Object({type:n.Literal("slack",{description:"Slack target backed by a configured Slack integration."}),channel:f({allowEmpty:!1,description:"Slack channel ID that receives the notification"}),integrationId:f({allowEmpty:!1,description:"Slack workspace ID that receives the notification"}),renotifyConfig:wa},{$id:"RuleTargetInputSlack"}),n.Object({type:n.Literal("incident-io",{description:"incident.io target backed by a configured incident.io integration."}),integrationId:f({allowEmpty:!1,description:"Identifier of the incident.io integration to use"}),renotifyConfig:wa},{$id:"RuleTargetInputIncidentIo"}),n.Object({type:n.Literal("pagerduty",{description:"PagerDuty target backed by a configured PagerDuty integration."}),integrationId:f({allowEmpty:!1,description:"Identifier of the PagerDuty integration to use"}),renotifyConfig:wa},{$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(f({type:"email"}),{minItems:1,maxItems:20,description:"Email addresses that will receive the alert"}),renotifyConfig:wa},{$id:"RuleTargetInputEmail"}),n.Object({type:n.Literal("grafana-irm",{description:"Grafana IRM target backed by a configured Grafana IRM integration."}),integrationId:f({allowEmpty:!1,description:"Identifier of the Grafana IRM integration to use"}),renotifyConfig:wa},{$id:"RuleTargetInputGrafanaIrm"}),n.Object({type:n.Literal("microsoft-teams",{description:"Microsoft Teams target backed by a configured Microsoft Teams integration."}),integrationId:f({allowEmpty:!1,description:"Identifier of the Microsoft Teams integration to use"}),renotifyConfig:wa},{$id:"RuleTargetInputMicrosoftTeams"}),n.Object({type:n.Literal("webhook",{description:"Webhook target backed by a configured webhook integration."}),integrationId:f({allowEmpty:!1,description:"Identifier of the webhook integration to use"}),renotifyConfig:wa},{$id:"RuleTargetInputWebhook"}),n.Object({type:n.Literal("servicenow",{description:"ServiceNow target backed by a configured ServiceNow integration."}),integrationId:f({allowEmpty:!1,description:"Identifier of the ServiceNow integration to use"}),renotifyConfig:wa},{$id:"RuleTargetInputServiceNow"}),n.Object({type:n.Literal("google-chat",{description:"Google Chat target backed by a configured Google Chat integration."}),integrationId:f({allowEmpty:!1,description:"Identifier of the Google Chat integration to use"}),renotifyConfig:wa},{$id:"RuleTargetInputGoogleChat"}),n.Object({type:n.Literal("squadcast",{description:"Squadcast target backed by a configured Squadcast integration."}),integrationId:f({allowEmpty:!1,description:"Identifier of the Squadcast integration to use"}),renotifyConfig:wa},{$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:f({allowEmpty:!1,description:"Identifier of the Jira integration to use"}),projectKey:f({allowEmpty:!1,description:'Key of the Jira project that alert issues are filed into, like "OPS".'}),issueType:f({allowEmpty:!1,description:'Name of the Jira issue type created for alerts, like "Bug" or "Task".'}),openStatus:n.Optional(f({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(f({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)."})}),DF=Q("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."}),FF=Q("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(f(),{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."}),Em=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:DF,prioritiesFilter:n.Array(n.Enum(To),{description:"Monitor priorities that must match for this rule to fire. An empty array matches every priority."}),transitionTypesFilter:n.Array(n.Enum(ym),{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:H({description:"Timestamp when Tsuga created the rule."}),updatedAt:H({description:"Timestamp when Tsuga last updated the rule."}),isActive:n.Boolean({description:"Whether the rule currently sends notifications when its filters match."}),tags:br,targets:n.Array(rT,{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(Qe),updater:n.Optional(Qe)}),nT=n.Object({name:f({description:"Display name of the notification rule."}),queryString:Ut(f({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:FF,prioritiesFilter:n.Array(n.Enum(To),{maxItems:To.length,description:"Monitor priorities that must match for this rule to fire. An empty array matches every priority."}),transitionTypesFilter:n.Array(n.Enum(ym),{maxItems:ym.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(f({allowEmpty:!1}),{description:"Cluster IDs that must match for this rule to fire. Omit it, or leave it empty, to match every cluster."})),owner:f({allowEmpty:!1,description:"Team ID that owns and manages the rule"}),tags:wr,isActive:n.Boolean({description:"Set to true for the rule to send notifications when its filters match."}),targets:n.Array(Ig,{minItems:1,description:"Destinations that receive a notification whenever this rule matches an alert transition. This list replaces the existing targets on update."})}),oT=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:H({description:"Timestamp when Tsuga created the rule."}),updatedAt:H({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:br,monitorIds:n.Array(n.String(),{description:"Monitors this rule reacts to."}),sloIds:n.Array(n.String(),{description:"SLOs this rule reacts to."}),fallbackTarget:rT,creator:n.Optional(Qe),updater:n.Optional(Qe)}),hce=n.Object({name:f({description:"Display name of the adaptive notification rule."}),owner:f({allowEmpty:!1,description:"Team ID that owns and manages the rule"}),tags:wr,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(f({allowEmpty:!1}),{maxItems:100,description:"Monitors this rule reacts to. Only trace monitors and metric monitors over OTel span metrics are eligible. Send at least one monitor or SLO."})),sloIds:n.Optional(n.Array(f({allowEmpty:!1}),{maxItems:100,description:"SLOs this rule reacts to. Only SLOs over traces or OTel span metrics are eligible. Omit for a rule that reacts to monitors only; send at least one monitor or SLO."})),fallbackTarget:Ig}),qHe=["active","inactive"],jHe=["name","isActive","owner","tags","clusterIdsFilter","targets","type","updatedAt"],yce=n.Object({owners:qe(f({allowEmpty:!1}),{description:"Restrict results to rules owned by any of these team IDs.",maxItems:50}),searchQuery:ko({description:"Search query filter for notification rules.",valueDescription:"Case-insensitive substring matched against rule name and ID."}),tags:qe(Fn.items,{description:"Restrict results to rules that have at least one of the listed key/value tags.",maxItems:50}),destinations:qe(f({allowEmpty:!1}),{description:"Restrict results to rules that route to any of these email addresses or integration IDs.",maxItems:50}),clusterIds:qe(f({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(qHe,{description:"Restrict results to active or inactive rules."})}),HHe=n.Partial(n.Object({...je,filters:n.Partial(yce),sort:n.Object({by:n.Enum(jHe,{description:"Field to sort the returned notification rules by."}),direction:Le})})),KHe=n.Object({type:n.Literal("standard",{description:"Standard notification rule matched by query, tags, and destinations."}),...Em.properties}),zHe=n.Object({type:n.Literal("adaptive",{description:"Adaptive notification rule matched by selected monitors or SLOs."}),...oT.properties}),YHe=Q("type",[KHe,zHe]),VHe=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."})}),QHe=n.Object({tags:Dn,destinations:n.Array(VHe,{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."})})}),WHe=n.Object({filters:n.Optional(n.Partial(yce,{description:"Filters applied before collecting tag, destination, and active-count options."}))}),Pgr=x({tags:["notification-rules"],url:`${va}/query`,method:"POST",paginated:!0,body:HHe,response:n.Array(YHe,{description:"Matching standard and adaptive notification rules after they are merged, sorted, and paginated."})}),wgr=x({tags:["notification-rules"],url:`${va}/options/query`,method:"POST",body:WHe,response:QHe}),vgr=x({tags:["notification-rules"],url:va,method:"GET",paginated:!0,query:n.Object(je),response:n.Array(Em)}),Ugr=x({tags:["notification-rules"],url:`${va}/:id`,params:n.Object({id:f()}),method:"GET",response:Em}),Ngr=x({tags:["notification-rules"],url:va,method:"POST",body:nT,response:Em}),kgr=x({tags:["notification-rules"],url:`${va}/:id`,method:"PUT",params:n.Object({id:f()}),body:nT,response:Em}),Lgr=x({tags:["notification-rules"],url:`${va}/:id`,method:"DELETE",params:n.Object({id:f()}),response:ae}),Mgr=x({tags:["notification-rules"],url:`${va}/bulk-delete`,method:"DELETE",body:n.Object({ids:n.Array(f(),{uniqueItems:!0})}),response:n.Object({})}),_g=`${bg}/adaptive-rules`,Dgr=x({tags:["notification-rules"],url:_g,method:"GET",paginated:!0,query:n.Object(je),response:n.Array(oT)}),Fgr=x({tags:["notification-rules"],url:`${_g}/:id`,params:n.Object({id:f()}),method:"GET",response:oT}),$gr=x({tags:["notification-rules"],url:_g,method:"POST",body:hce,response:oT}),Ggr=x({tags:["notification-rules"],url:`${_g}/:id`,method:"PUT",params:n.Object({id:f()}),body:hce,response:oT}),Bgr=x({tags:["notification-rules"],url:`${_g}/:id`,method:"DELETE",params:n.Object({id:f()}),response:ae}),qgr=x({tags:["notification-rules"],url:`${_g}/bulk-delete`,method:"DELETE",body:n.Object({ids:n.Array(f(),{uniqueItems:!0})}),response:n.Object({})}),jgr=x({tags:["notification-integrations"],url:`${gce}/start`,method:"POST",response:n.Object({redirectUrl:n.String()})}),JHe=["google-chat","grafana-irm","incident-io","jira","microsoft-teams","pagerduty","servicenow","slack","squadcast","webhook"],Ece=n.Object({id:n.String(),name:n.String(),type:n.Enum(JHe),createdAt:H(),ruleCount:n.Number(),creator:n.Optional(Qe),owner:n.Optional(n.String({description:"ID of the team that owns the integration. Absent on integrations created before ownership was introduced."}))}),ZHe=["name","type","ruleCount","createdAt"],XHe=n.Object({searchQuery:ko({description:"Search query filter for notification integrations.",valueDescription:"Case-insensitive substring matched against integration name and ID."})}),eKe=n.Partial(n.Object({...je,filters:n.Partial(XHe),sort:n.Object({by:n.Enum(ZHe,{description:"Field to sort the returned notification integrations by."}),direction:Le})})),Hgr=x({tags:["notification-integrations"],url:`${xg}/query`,method:"POST",paginated:!0,body:eKe,response:n.Array(Ece,{description:"Matching notification integrations after they are filtered, sorted, and paginated."})}),Kgr=x({tags:["notification-integrations"],url:`${va}/integrations`,method:"GET",paginated:!0,query:n.Object(je),response:n.Array(Ece)}),zgr=x({tags:["notification-integrations"],url:`${gce}/callback`,method:"GET",query:n.Object({code:f()}),response:n.Object({success:n.Boolean()})}),$F=["POST","PUT"],tKe=n.Record(n.String(),n.String()),rKe=n.Record(n.String(),n.Unknown()),nKe=n.Record(n.String(),n.Union([n.String(),n.Number(),n.Boolean(),n.Null(),n.Array(n.Union([n.String(),n.Number(),n.Boolean()]))])),oKe=Q("type",[n.Object({type:n.Literal("json"),value:rKe}),n.Object({type:n.Literal("form"),value:nKe})]),iKe=n.Object({ok:n.String(),alert:n.String()}),iT=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:Q("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($F),authentication:mce,customHeaders:n.Optional(tKe),payloadTemplate:oKe,eventNameMapping:n.Optional(iKe)}),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:br}),sKe=n.Object({type:n.Literal("webhook"),url:f({type:"uri"}),method:n.Enum($F),authentication:dce,customHeaders:n.Record(f({allowEmpty:!1}),f()),payloadTemplate:Q("type",[n.Object({type:n.Literal("json"),value:n.Record(f({allowEmpty:!1}),n.Unknown())}),n.Object({type:n.Literal("form"),value:n.Record(f({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:f({allowEmpty:!1}),alert:f({allowEmpty:!1})}))}),Sce=n.Object({type:n.Literal("incident-io"),alertSourceConfigId:f(),token:f()}),Tce=n.Object({type:n.Literal("grafana-irm"),url:f({type:"uri"})}),bce=n.Object({type:n.Literal("pagerduty"),integrationKey:f()}),xce=n.Object({type:n.Literal("microsoft-teams"),webhookUrl:f({type:"uri"})}),aKe=n.Object({type:n.Literal("servicenow"),instanceName:f({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:f({allowEmpty:!1}),password:f({allowEmpty:!1})}),cKe=n.Object({type:n.Literal("google-chat"),webhookUrl:f({type:"uri"})}),lKe=n.Object({type:n.Literal("squadcast"),webhookUrl:f({type:"uri"})}),uKe=n.Object({type:n.Literal("jira"),siteUrl:f({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:f({type:"email",allowEmpty:!1,description:"Atlassian account email used together with the API token for Basic authentication."}),apiToken:f({allowEmpty:!1,description:"Atlassian API token minted for the account, used as the Basic auth password."})}),Ice=f({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."}),GF=n.Object({name:f(),owner:Ice,setting:Q("type",[Sce,Tce,bce,xce,sKe,aKe,cKe,lKe,uKe]),tags:wr}),pKe=n.Object({type:n.Literal("webhook"),url:n.Optional(f({type:"uri"})),method:n.Optional(n.Enum($F)),authentication:n.Optional(fce),customHeaders:n.Optional(n.Record(f({allowEmpty:!1}),f())),payloadTemplate:n.Optional(Q("type",[n.Object({type:n.Literal("json"),value:n.Record(f({allowEmpty:!1}),n.Unknown())}),n.Object({type:n.Literal("form"),value:n.Record(f({allowEmpty:!1}),n.Union([n.String(),n.Number(),n.Boolean(),n.Null(),n.Array(n.Union([n.String(),n.Number(),n.Boolean()]))]))})])),eventNameMapping:Ut(n.Object({ok:n.Optional(f({allowEmpty:!1})),alert:n.Optional(f({allowEmpty:!1}))}))}),mKe=n.Object({type:n.Literal("servicenow"),instanceName:n.Optional(f({allowEmpty:!1})),username:n.Optional(f({allowEmpty:!1})),password:n.Optional(f({allowEmpty:!1}))}),dKe=n.Object({type:n.Literal("jira"),siteUrl:n.Optional(f({type:"uri",allowEmpty:!1})),email:n.Optional(f({allowEmpty:!1})),apiToken:n.Optional(f({allowEmpty:!1}))}),fKe=n.Object({type:n.Literal("google-chat"),webhookUrl:f({type:"uri"})}),gKe=n.Object({type:n.Literal("squadcast"),webhookUrl:f({type:"uri"})}),BF=n.Object({name:n.Optional(f()),owner:Ice,tags:wr,setting:n.Optional(Q("type",[Sce,Tce,bce,xce,pKe,mKe,fKe,gKe,dKe]))}),Ygr=x({tags:["notification-integrations"],url:xg,method:"POST",body:GF,response:iT}),Vgr=x({tags:["notification-integrations"],url:`${xg}/:id`,method:"GET",params:n.Object({id:f()}),response:iT}),Qgr=x({tags:["notification-integrations"],url:`${xg}/:id`,method:"PATCH",params:n.Object({id:f()}),body:BF,response:iT}),Wgr=x({tags:["notification-integrations"],url:`${xg}/:id`,method:"DELETE",params:n.Object({id:f()}),response:ae}),hKe=Q("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."}),Jgr=x({tags:["notification-integrations"],url:`${xg}/:id/jira-metadata`,method:"GET",params:n.Object({id:f()}),response:hKe}),Zgr=x({tags:["notification-rules"],url:`${bo}/:id/notifications`,method:"GET",params:n.Object({id:f()}),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($He),tryCount:n.Number(),nextTryAt:H(),createdAt:H(),updatedAt:H(),sentAt:n.Optional(H())})),isTruncated:n.Boolean()})}),yKe=["slack","incident-io","pagerduty","email","grafana-irm","microsoft-teams","webhook","servicenow","google-chat","squadcast","jira"],Xgr=x({tags:["notification-rules"],url:`${va}/test`,method:"POST",body:n.Object({notificationRule:nT,targetIds:n.Optional(n.Array(f({allowEmpty:!1}),{description:"Target IDs to test specific targets",minItems:1,maxItems:10}))}),response:n.Union([n.Object({success:n.Literal(!1),overallMessage:n.String({description:"Message when there is an overall error"})}),n.Object({success:n.Boolean(),results:n.Array(n.Object({targetId:n.String({description:"The ID of the target that was tested"}),targetType:n.Enum(yKe,{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 sT=`/${"v1"}/notification-integrations`,aT=n.Pick(iT,["id","name","owner","setting","tags"],{$id:"NotificationIntegration",description:"A reusable external destination that notification rules can send to. See [Integrations](/documentation/alert/notifications/index#integrations). Slack integrations are OAuth-based and are not readable, creatable, or editable through this API; connect Slack from the app."}),EKe={id:"456-def-abc",name:"Primary on-call",owner:"team-123-abc",setting:{type:"pagerduty",integrationKeyLastChars:"ab12"},tags:[{key:"team",value:"platform"}]};Object.assign(aT,{examples:[EKe]});var _ce=x({description:"Lists non-OAuth notification integrations visible to the authenticated operation key. Slack integrations do not appear here because they are OAuth-based. Pagination fields limit the returned page.",operationId:"listNotificationIntegrations",tags:["public","notification-integrations"],url:sT,method:"GET",paginated:!0,query:n.Object(er),response:n.Array(aT)}),Ace=x({description:"Retrieves one non-OAuth notification integration by ID.",operationId:"getNotificationIntegration",tags:["notification-integrations"],url:`${sT}/:id`,method:"GET",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the notification integration to retrieve. Use the `id` returned by notification integration list or create responses."})}),response:aT}),Oce=n.Pick(GF,["name","owner","setting","tags"],{description:"Notification integration create request containing the display name, owning team, destination setting, and tags. `setting.type` cannot be `slack`; add Slack integrations from the app instead."}),SKe={name:"Primary on-call",owner:"team-123-abc",setting:{type:"pagerduty",integrationKey:"abcdef1234567890ab12"},tags:[{key:"team",value:"platform"}]};Object.assign(Oce,{examples:[SKe]});var Cce=x({description:"Creates a non-OAuth notification integration that notification rules can target as a destination.",operationId:"createNotificationIntegration",tags:["notification-integrations"],url:sT,method:"POST",body:Oce,response:aT}),Rce=n.Pick(BF,["name","owner","setting","tags"],{description:"Notification integration update request. `owner` has to be sent on every update; the other omitted fields keep their existing values."}),TKe={name:"Primary on-call",owner:"team-123-abc"};Object.assign(Rce,{examples:[TKe]});var Pce=x({description:"Updates an existing non-OAuth notification integration by ID. `owner` has to be sent on every update, even when it does not change. The submitted `setting` is overwritten in full; the other omitted fields keep their existing values.",operationId:"updateNotificationIntegration",tags:["notification-integrations"],url:`${sT}/:id`,method:"PUT",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the notification integration to update. Use the `id` returned by notification integration list, get, or create responses."})}),body:Rce,response:aT}),wce=x({description:"Deletes a non-OAuth notification integration by ID. Deletion is blocked while a notification rule still targets the integration; remove it from those rules first.",operationId:"deleteNotificationIntegration",tags:["notification-integrations"],url:`${sT}/:id`,method:"DELETE",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the notification integration to delete. Use the `id` returned by notification integration list, get, or create responses."})}),response:ae});var vce=_t({commandName:"notification-integrations",description:"Manage notification integrations",endpoints:{list:_ce,get:Ace,create:Cce,update:Pce,delete:wce}});var cT=`/${"v1"}/notification-rules`,lT=n.Pick(Em,["id","name","queryString","teamsFilter","prioritiesFilter","transitionTypesFilter","clusterIdsFilter","owner","isActive","tags","targets"],{$id:"Rule",description:"Notification rule that matches alert transitions and routes notifications to one or more targets. See [Rules](/documentation/alert/notifications/rules)."}),Uce={name:"Critical Alerts",queryString:"env:prod service:api",teamsFilter:{type:"all-public-teams"},prioritiesFilter:[1,2],transitionTypesFilter:["triggered","resolved"],clusterIdsFilter:[],owner:"team-123-abc",isActive:!0,tags:[{key:"channel",value:"alerts"}],targets:[{id:"789-abc-def",rateLimit:{maxMessages:10,minutes:5},config:{type:"email",addresses:["oncall@example.com"],renotifyConfig:{mode:"each",renotificationStates:["alert"],renotifyIntervalMinutes:30}}}]},bKe={id:"123-456-abc",...Uce};Object.assign(lT,{examples:[bKe]});var Nce=x({description:"Lists notification rules visible to the authenticated operation key. Use this endpoint to audit alert delivery routing. Pagination fields limit the returned page.",operationId:"listNotificationRules",tags:["notification-rules"],url:cT,method:"GET",paginated:!0,query:n.Object(er),response:n.Array(lT)}),kce=x({description:"Retrieves one notification rule by ID.",operationId:"getNotificationRule",tags:["notification-rules"],url:`${cT}/:id`,method:"GET",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the notification rule to retrieve. Use the `id` returned by notification rule list or create responses."})}),response:lT}),qF=n.Pick(nT,["name","queryString","teamsFilter","prioritiesFilter","transitionTypesFilter","clusterIdsFilter","owner","tags","isActive","targets"],{description:"Notification rule create or update request. Provide matching filters, owner, tags, active state, and delivery targets."}),xKe=Uce;Object.assign(qF,{examples:[xKe]});var Lce=x({description:"Creates a notification rule that matches alert transitions and sends notifications to configured targets. Monitors keep evaluating separately from notification rules.",operationId:"createNotificationRule",tags:["notification-rules"],url:cT,method:"POST",body:qF,response:lT}),Mce=x({description:"Updates an existing notification rule by ID. Required fields and the submitted target list are overwritten; omitted optional fields keep their existing values.",operationId:"updateNotificationRule",tags:["notification-rules"],url:`${cT}/:id`,method:"PUT",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the notification rule to update. Use the `id` returned by notification rule list, get, or create responses."})}),body:qF,response:lT}),IKe=n.Object({id:f({allowEmpty:!1,description:"Identifier of the notification rule to delete. Use the `id` returned by notification rule list, get, create, or update responses."})}),Dce=x({description:"Deletes a notification rule by ID. Alerting monitors continue to evaluate, but this rule no longer sends notifications.",operationId:"deleteNotificationRule",tags:["notification-rules"],url:`${cT}/:id`,method:"DELETE",params:IKe,response:ae});var Fce=_t({commandName:"notification-rules",description:"Manage notification rules",endpoints:{list:Nce,get:kce,create:Lce,update:Mce,delete:Dce}});var yu=`${bg}/silences`,_Ke=["active","inactive"],Gce=n.Union([n.Literal("monday"),n.Literal("tuesday"),n.Literal("wednesday"),n.Literal("thursday"),n.Literal("friday"),n.Literal("saturday"),n.Literal("sunday")]),AKe=n.Partial(n.Record(Gce,n.Array(n.Object({startTime:n.String({format:_L,description:"Local start time for this recurring silence window on this day, using the schedule time zone."}),endTime:n.String({format:_L,description:"Local end time for this recurring silence window on this day. It must be after `startTime`, and ranges on the same day cannot overlap."})},{title:"SilenceTimeRange"}),{minItems:1,description:"Silence windows for this day. Each window uses the schedule time zone, and windows on the same day cannot overlap."})),{description:"Recurring silence windows keyed by day of week, evaluated in the schedule `timeZone` or in UTC when it is omitted. At least one day must be listed, and a day with no entry is never silenced. Each window covers `startTime` up to but not including `endTime`."}),OKe=n.Partial(n.Record(Gce,n.Array(n.Object({startTime:n.String({description:"Local start time for this recurring silence window on this day, using the schedule time zone."}),endTime:n.String({description:"Local end time for this recurring silence window on this day. It must be after `startTime`, and ranges on the same day cannot overlap."})},{title:"SilenceTimeRange"}),{description:"Silence windows for this day. Each window uses the schedule time zone, and windows on the same day cannot overlap."})),{description:"Recurring silence windows keyed by day of week, evaluated in the schedule `timeZone` or in UTC when it is omitted. A day with no entry is never silenced. Each window covers `startTime` up to but not including `endTime`."}),WC='IANA timezone identifier (e.g. "America/New_York"). Defaults to UTC if omitted.',Bce="One-time silence schedule with specific start and end times",qce="Recurring weekly silence schedule",CKe=Q("type",[n.Object({type:n.Literal("one-time",{description:"Silence active once between the configured start and end times."}),startTime:n.String({format:AL,description:"Local start date and time for the one-time silence, interpreted in `timeZone` when provided."}),endTime:n.String({format:AL,description:"Local end date and time for the one-time silence. It must be after `startTime` and in the future."}),timeZone:n.Optional(n.String({format:Dp,description:WC}))},{$id:"InputSilenceScheduleOneTime",description:Bce}),n.Object({type:n.Literal("recurring",{description:"Silence active on a recurring weekly schedule."}),weeklySchedule:AKe,timeZone:n.Optional(n.String({format:Dp,description:WC}))},{$id:"InputSilenceScheduleRecurring",description:qce})],{description:"Schedule defining when the silence is active. The `type` field discriminates between a `one-time` window and a `recurring` weekly window. Once a one-time schedule's `endTime` passes, or a recurring window closes, the silence stops suppressing notifications but is not deleted; delete it explicitly if it is no longer needed."}),RKe=Q("type",[n.Object({type:n.Literal("one-time",{description:"Silence active once between the configured start and end times."}),startTime:n.String({description:"Local start date and time for the one-time silence, interpreted in `timeZone` when provided."}),endTime:n.String({description:"Local end date and time for the one-time silence. It must be after `startTime` and in the future when created or updated."}),timeZone:n.Optional(n.String({description:WC}))},{$id:"OutputSilenceScheduleOneTime",description:Bce}),n.Object({type:n.Literal("recurring",{description:"Silence active on a recurring weekly schedule."}),weeklySchedule:OKe,timeZone:n.Optional(n.String({description:WC}))},{$id:"OutputSilenceScheduleRecurring",description:qce})],{description:"Schedule defining when the silence is active. The `type` field discriminates between a `one-time` window and a `recurring` weekly window. Once a one-time schedule's `endTime` passes, or a recurring window closes, the silence stops suppressing notifications but is not deleted; delete it explicitly if it is no longer needed."}),PKe="monitor_id",jce=`Query on the alerting monitor tags and group-by dimensions, e.g. \`env:prod AND service:bridge\`. The monitor itself can be targeted with \`${PKe}:<monitor id>\`.`,JC=n.Object({name:f({description:"Display name of the silence"}),reason:f({allowEmpty:!1,type:"long",description:"Free-text explanation of why notifications are being silenced, shown to other operators reviewing active silences."}),owner:f({allowEmpty:!1,description:"Team ID that owns and manages the silence"}),tags:wr,isActive:n.Boolean({description:"Set to true for the silence to suppress matching notifications while its schedule is active. Set to false to keep the silence without suppressing anything."}),schedule:CKe,notificationRuleIds:Ut(n.Array(f()),{description:"Notification rule IDs this silence applies to directly, matching any notification produced by one of these rules regardless of priority or transition type. Mutually exclusive with `prioritiesFilter`, `transitionTypesFilter`, and `queryString`: a request combining this field with any of those is rejected."}),queryString:Ut(f({type:"tags-query"}),{description:jce}),teamsFilter:FF,prioritiesFilter:n.Array(n.Enum(To),{maxItems:To.length,description:"Monitor priorities that must match for this silence to apply. An empty array matches every priority."}),transitionTypesFilter:n.Array(n.Enum(ym),{maxItems:ym.length,description:"Alert state transitions that must match for this silence to apply. An empty array matches every transition type."})}),Sm=n.Object({id:n.String({description:"Tsuga-generated notification silence ID assigned when the silence is created."}),name:n.String({description:"Display name of the silence"}),reason:n.String({description:"Free-text explanation of why notifications are being silenced, shown to other operators reviewing active silences."}),owner:n.String({description:"Team ID that owns and manages the silence"}),tags:br,isActive:n.Boolean({description:"Whether the silence suppresses matching notifications while its schedule is active. When false, the silence is kept but never suppresses anything."}),schedule:RKe,notificationRuleIds:n.Optional(n.Array(n.String(),{description:"Notification rule IDs this silence applies to directly, matching any notification produced by one of these rules regardless of priority or transition type. Set only when `prioritiesFilter`, `transitionTypesFilter`, and `queryString` are not used to filter alerts."})),queryString:n.Optional(n.String({description:jce})),teamsFilter:DF,prioritiesFilter:n.Array(n.Enum(To),{description:"Monitor priorities that must match for this silence to apply. An empty array matches every priority."}),transitionTypesFilter:n.Array(n.Enum(ym),{description:"Alert state transitions that must match for this silence to apply. An empty array matches every transition type."}),createdAt:H(),updatedAt:H(),creator:n.Optional(Qe),updater:n.Optional(Qe)}),$ce=["one-time","recurring"];var wKe=["name","isActive","schedule","owner","tags","updatedAt"],Hce=n.Object({owners:qe(f({allowEmpty:!1}),{description:"Restrict results to silences owned by any of these team IDs.",maxItems:50}),searchQuery:ko({description:"Search query filter for notification silences.",valueDescription:"Case-insensitive substring matched against silence name and ID."}),tags:qe(Fn.items,{description:"Restrict results to silences that have at least one of the listed key/value tags.",maxItems:50}),scheduleTypes:qe(n.Enum($ce),{description:"Restrict results to silences with these schedule types.",maxItems:$ce.length}),status:n.Enum(_Ke,{description:"Restrict results to effectively active or inactive silences."})}),vKe=n.Partial(n.Object({...je,filters:n.Partial(Hce),sort:n.Object({by:n.Enum(wKe,{description:"Field to sort the returned notification silences by."}),direction:Le})})),UKe=n.Object({tags:Dn,activeCounts:n.Object({totalCount:n.Integer({description:"Total number of matching silences regardless of whether they are active."}),active:n.Integer({description:"Number of matching silences that are active, meaning enabled with a schedule that has not expired."}),inactive:n.Integer({description:"Number of matching silences that are disabled or whose schedule has expired."})})}),NKe=n.Object({filters:n.Optional(n.Partial(Hce,{description:"Filters applied before collecting tag and active-count options."}))}),khr=x({tags:["notification-silences"],url:`${yu}/query`,method:"POST",paginated:!0,body:vKe,response:n.Array(Sm,{description:"Matching notification silences after they are filtered, sorted, and paginated."})}),Lhr=x({tags:["notification-silences"],url:`${yu}/options/query`,method:"POST",body:NKe,response:UKe}),Mhr=x({tags:["notification-silences"],url:yu,method:"GET",response:n.Array(Sm)}),Dhr=x({tags:["notification-silences"],url:`${yu}/:id`,params:n.Object({id:f()}),method:"GET",response:Sm}),Fhr=x({tags:["notification-silences"],url:yu,method:"POST",body:JC,response:Sm}),$hr=x({tags:["notification-silences"],url:`${yu}/:id`,method:"PUT",params:n.Object({id:f()}),body:JC,response:Sm}),Ghr=x({tags:["notification-silences"],url:`${yu}/:id`,method:"DELETE",params:n.Object({id:f()}),response:ae}),Bhr=x({tags:["notification-silences"],url:`${yu}/bulk-delete`,method:"DELETE",body:n.Object({ids:n.Array(f(),{uniqueItems:!0})}),response:n.Object({})});var uT=`/${"v1"}/notification-silences`,pT=n.Pick(Sm,["id","name","reason","owner","tags","isActive","schedule","notificationRuleIds","queryString","teamsFilter","prioritiesFilter","transitionTypesFilter"],{$id:"NotificationSilence",description:"Scheduled mute rule that suppresses matching notification delivery while monitors continue evaluating. See [Silences](/documentation/alert/notifications/silences)."}),kKe={id:"sil-weekend-maintenance",name:"Weekend maintenance",reason:"Suppress expected alerts during the weekly maintenance window.",owner:"team-123-abc",tags:[{key:"environment",value:"production"}],isActive:!0,schedule:{type:"recurring",weeklySchedule:{saturday:[{startTime:"02:00",endTime:"06:00"}],sunday:[{startTime:"02:00",endTime:"06:00"}]},timeZone:"UTC"},teamsFilter:{type:"specific-teams",teams:["team-123-abc"]},prioritiesFilter:[1,2],transitionTypesFilter:["triggered","resolved"]},LKe={id:"sil-critical-routing",name:"Critical routing maintenance",reason:"Temporarily suppress notifications from the critical routing rule.",owner:"team-123-abc",tags:[{key:"change",value:"chg-1234"}],isActive:!0,schedule:{type:"one-time",startTime:"2026-07-04T02:00:00",endTime:"2026-07-04T04:00:00",timeZone:"UTC"},notificationRuleIds:["rule-critical-routing"],teamsFilter:{type:"specific-teams",teams:["team-123-abc"]},prioritiesFilter:[],transitionTypesFilter:[]};Object.assign(pT,{examples:[kKe,LKe]});var Kce=x({description:"Lists notification silences visible to the authenticated operation key. Use this endpoint to audit maintenance windows and notification muting rules.",operationId:"listNotificationSilences",tags:["notification-silences"],url:uT,method:"GET",response:n.Array(pT)}),zce=x({description:"Retrieves one notification silence by ID.",operationId:"getNotificationSilence",tags:["notification-silences"],url:`${uT}/:id`,method:"GET",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the notification silence to retrieve. Use the `id` returned by notification silence list or create responses."})}),response:pT}),jF=n.Pick(JC,["name","reason","owner","tags","isActive","schedule","notificationRuleIds","queryString","teamsFilter","prioritiesFilter","transitionTypesFilter"],{description:"Notification silence create or update request. Provide the mute reason, owner, schedule, filters, active state, and tags."}),MKe={name:"Weekend maintenance",reason:"Suppress expected alerts during the weekly maintenance window.",owner:"team-123-abc",tags:[{key:"environment",value:"production"}],isActive:!0,schedule:{type:"recurring",weeklySchedule:{saturday:[{startTime:"02:00",endTime:"06:00"}],sunday:[{startTime:"02:00",endTime:"06:00"}]},timeZone:"UTC"},teamsFilter:{type:"specific-teams",teams:["team-123-abc"]},prioritiesFilter:[1,2],transitionTypesFilter:["triggered","resolved"]},DKe={name:"Critical routing maintenance",reason:"Temporarily suppress notifications from the critical routing rule.",owner:"team-123-abc",tags:[{key:"change",value:"chg-1234"}],isActive:!0,schedule:{type:"one-time",startTime:"2026-07-04T02:00:00",endTime:"2026-07-04T04:00:00",timeZone:"UTC"},notificationRuleIds:["rule-critical-routing"],teamsFilter:{type:"specific-teams",teams:["team-123-abc"]},prioritiesFilter:[],transitionTypesFilter:[]};Object.assign(jF,{examples:[MKe,DKe]});var Yce=x({description:"Creates a notification silence. Matching notifications that have not yet been sent are suppressed as soon as the schedule becomes active, including ones already queued when the silence is created; monitor evaluation itself is not paused, so alerts still transition and are visible in the UI.",operationId:"createNotificationSilence",tags:["notification-silences"],url:uT,method:"POST",body:jF,response:pT}),Vce=x({description:"Updates an existing notification silence by ID. Required fields are overwritten; omitted optional fields keep their existing values.",operationId:"updateNotificationSilence",tags:["notification-silences"],url:`${uT}/:id`,method:"PUT",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the notification silence to update. Use the `id` returned by notification silence list, get, or create responses."})}),body:jF,response:pT}),FKe=n.Object({id:f({allowEmpty:!1,description:"Identifier of the notification silence to delete. Use the `id` returned by notification silence list, get, create, or update responses."})}),Qce=x({description:"Deletes a notification silence. Any notification not yet sent is re-evaluated against the remaining silences and, if none match, is delivered normally; notifications already marked as silenced are not resent.",operationId:"deleteNotificationSilence",tags:["notification-silences"],url:`${uT}/:id`,method:"DELETE",params:FKe,response:ae});var Wce=_t({commandName:"notification-silences",description:"Manage notification silences",endpoints:{list:Kce,get:zce,create:Yce,update:Vce,delete:Qce}});var $Ke="tsuga_rum:v1:";var Jce=100,Zce=["web","ios","android"],Xce="Kind of application the token is issued for. Only `web` telemetry is checked against `allowedUrlPrefixes`, since mobile applications do not send an `Origin` header.",Ag=n.Object({id:n.String({description:"Tsuga-generated RUM public token ID assigned when the token is created."}),name:n.String({description:"Human-readable token name. Names must be kebab-case when creating or updating tokens."}),token:n.String({description:`Full token value, prefixed with \`${$Ke}\`, to configure in the RUM browser or mobile SDK. RUM tokens are public by design, so the value is not masked on subsequent reads and never changes after creation.`}),owner:n.String({description:"Team ID that owns and manages the RUM public token."}),applicationType:n.Enum(Zce,{description:Xce}),allowedUrlPrefixes:n.Array(n.String(),{description:"URL prefixes which RUM telemetry data can be sent from. Supports wildcard matching. Always empty for `ios` and `android` applications."}),tags:Dn,teamOverrideFields:n.Optional(n.Array(n.String(),{description:"Telemetry attribute names used to override ownership for data sent with this token."})),updatedAt:H({description:"Timestamp when the token metadata was last updated."}),createdAt:H({description:"Timestamp when the token was created."}),creator:n.Optional(Qe),updater:n.Optional(Qe),assetUpdatedAt:H({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})}),mT=n.Object({name:n.String({format:Jl,minLength:1,maxLength:Jce,description:`Kebab-case name for the RUM public token. Maximum length is ${Jce} characters.`}),owner:f({allowEmpty:!1,description:"Team ID that will own and manage the RUM public token."}),applicationType:n.Enum(Zce,{description:`${Xce} Fixed at creation: an update must resend the token's current value.`}),allowedUrlPrefixes:n.Array(n.String({format:Y7}),{description:"URL prefixes which RUM telemetry data can be sent from. Supports wildcard matching. At least one prefix is required for `web` applications, and the array must be empty for `ios` and `android` applications."}),tags:Fn,teamOverrideFields:n.Union([n.Array(f({allowEmpty:!1}),{minItems:1,maxItems:HS,description:`Array form. Up to ${HS} fields are allowed.`}),n.Null({description:"Clear any existing team override fields."})],{description:"Telemetry attribute names used to override ownership for data sent with this token. Send null to clear existing override fields."})}),Og="/v0/rum-public-tokens",ayr=x({tags:["rum-public-tokens"],url:Og,method:"POST",body:mT,response:Ag}),cyr=x({tags:["rum-public-tokens"],url:Og,method:"GET",paginated:!0,query:n.Object(je),response:n.Array(Ag)}),lyr=x({tags:["rum-public-tokens"],url:`${Og}/:id`,method:"GET",params:n.Object({id:f({allowEmpty:!1})}),response:Ag}),uyr=x({tags:["rum-public-tokens"],url:`${Og}/:id`,method:"PUT",params:n.Object({id:f({allowEmpty:!1})}),body:mT,response:Ag}),pyr=x({tags:["rum-public-tokens"],url:`${Og}/:id`,method:"DELETE",params:n.Object({id:f({allowEmpty:!1})}),response:ae}),myr=x({tags:["rum-public-tokens"],url:`${Og}/bulk-delete`,method:"DELETE",body:n.Object({ids:n.Array(f({allowEmpty:!1}),{uniqueItems:!0})}),response:n.Object({})});var dT=`/${"v1"}/public-tokens`,fT=n.Pick(Ag,["id","name","token","owner","applicationType","allowedUrlPrefixes","tags","teamOverrideFields"],{$id:"PublicToken",description:"Public token used by the RUM browser and mobile SDKs to send real user monitoring data to Tsuga. The token value is public by design and is included in every response. See [API keys](/documentation/account-and-settings/api-keys)."}),GKe={id:"123-456-abc",name:"my-web-app",token:"tsuga_rum:v1:abc123xyzABC123xyzABC123",owner:"team-123-abc",applicationType:"web",allowedUrlPrefixes:["https://app.example.com"],tags:[{key:"env",value:"production"}],teamOverrideFields:["service"]};Object.assign(fT,{examples:[GKe]});var ele=n.Pick(mT,["name","owner","applicationType","allowedUrlPrefixes","tags","teamOverrideFields"],{$id:"CreatePublicTokenRequest",description:"RUM public token creation request. Provide a kebab-case name, owner team, application type, allowed URL prefixes (required for `web`, empty for `ios` and `android`), tags including an `env` tag, and team override fields as an array of fields or null."}),tle={name:"my-web-app",owner:"team-123-abc",applicationType:"web",allowedUrlPrefixes:["https://app.example.com"],tags:[{key:"env",value:"production"}],teamOverrideFields:null};Object.assign(ele,{examples:[tle]});var rle=n.Pick(mT,["name","owner","applicationType","allowedUrlPrefixes","tags","teamOverrideFields"],{$id:"UpdatePublicTokenRequest",description:"RUM public token update request. Provide the full definition, including name, owner team, allowed URL prefixes, tags including an `env` tag, and team override fields. The application type must match the existing token and the token value itself never changes."});Object.assign(rle,{examples:[tle]});var nle=x({description:"Lists RUM public tokens visible to the authenticated operation key. Use this to inventory the tokens configured in browser and mobile applications, with their owners, allowed URL prefixes, and tags. Pagination fields limit the returned page.",operationId:"listPublicTokens",tags:["public-tokens"],url:dT,method:"GET",paginated:!0,query:n.Object(er),response:n.Array(fT)}),ole=x({description:"Retrieves one RUM public token by ID, including the full token value to configure in the SDK.",operationId:"getPublicToken",tags:["public-tokens"],url:`${dT}/:id`,method:"GET",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the public token to retrieve. Use the `id` returned by public token list or create responses."})}),response:fT}),ile=x({description:"Creates a RUM public token for a browser or mobile application. The response includes the full token value to configure in the SDK; it can be read again later with the get and list operations.",operationId:"createPublicToken",tags:["public-tokens"],url:dT,method:"POST",body:ele,response:fT}),sle=x({description:"Updates RUM public token metadata by ID, including name, owner, application type, allowed URL prefixes, tags, and team override fields. Every field is required: the application type is fixed at creation, so resend the token's current value. The token value is not rotated by this operation.",operationId:"updatePublicToken",tags:["public-tokens"],url:`${dT}/:id`,method:"PUT",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the public token to update. Use the `id` returned by public token list, get, or create responses."})}),body:rle,response:fT}),ale=x({description:"Deletes a RUM public token by ID. Applications configured with the deleted token can no longer send RUM data with it.",operationId:"deletePublicToken",tags:["public-tokens"],url:`${dT}/:id`,method:"DELETE",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the public token to delete. Use the `id` returned by public token list, get, or create responses."})}),response:ae});var cle=_t({commandName:"public-tokens",description:"Manage public tokens used by the RUM browser and mobile SDKs",endpoints:{list:nle,get:ole,create:ile,update:sle,delete:ale}});var BKe={critical:3,important:2,normal:1},Tt=e=>({label:e,weight:BKe[e]}),qKe={"unrouted-logs":{key:"unrouted-logs",title:"Logs with no matching route",summary:"Any log that reaches processing without a matched route is flagged.",rationale:"Close gaps by ensuring each event flows through a governed route.",objectType:"route",category:"observability-assets",impact:Tt("important"),recommendation:"Ensure each team maintains a route that captures all of its logs exactly once."},"no-over-routed-logs":{key:"no-over-routed-logs",title:"No logs matching 3+ routes",summary:"Detects logs that match 3 or more processing routes during the lookback window.",rationale:"A log usually only needs one or two routes. Matching many routes typically means the route queries overlap unintentionally, multiplying the processing and storage cost without adding observability value.",objectType:"route",category:"observability-assets",impact:Tt("important"),recommendation:"Review the route queries owned by this team for overlap. Tighten the filter on each route so a given log matches the minimum number of routes needed (usually one)."},"team-has-route":{key:"team-has-route",title:"\u22651 route per team",summary:"Each team owns at least one active route that filters on its team name.",rationale:"Provides clear governance boundaries for routing and enrichment.",objectType:"route",category:"observability-assets",impact:Tt("important"),recommendation:"Ensure every team manages a dedicated route scoped to its context.team value."},"no-team-override-mismatch":{key:"no-team-override-mismatch",title:`${oM} matches ${NO}`,summary:`Detects logs and spans whose ${oM} resource attribute names a different team than the ${NO} resolved at ingestion.`,rationale:`${NO} is reserved and comes from the ingestion API key, so a \`team\` resource attribute never reassigns ownership. A disagreement means the sender expects an ownership Tsuga did not apply.`,objectType:"resource",category:"telemetry-hygiene",impact:Tt("important"),recommendation:"Drop the `team` resource attribute, or set the ingestion API key team override fields to read ownership from a differently named attribute."},"service-name-present":{key:"service-name-present",title:`${kO} present`,summary:`Logs and spans must populate ${kO} with a non-empty value.`,rationale:"Core identifier used to correlate telemetry across services.",objectType:"resource",category:"telemetry-hygiene",impact:Tt("critical"),recommendation:`Populate ${kO} in all log and span payloads.`},"no-orphan-spans":{key:"no-orphan-spans",title:"No orphan spans",summary:"Every span with parent_span_id references an existing span in the same trace.",rationale:"Trace integrity depends on preserving parent-child hierarchies.",objectType:"span",category:"telemetry-hygiene",impact:Tt("normal"),recommendation:"Emit parent spans before their children so references always resolve."},"metric-unit-consistency":{key:"metric-unit-consistency",title:"Name\u2192unit consistency",summary:"All series for a metric name report the same UCUM-compliant unit across the lookback period.",rationale:"Avoid ambiguity when charting and alerting on metrics with shared names.",objectType:"metric",category:"telemetry-hygiene",impact:Tt("important"),recommendation:"Align exporters so each metric name emits a single consistent unit across services and environments."},"host-name-present":{key:"host-name-present",title:`${aS} presence`,summary:`Logs and spans must populate ${aS} with a non-empty value.`,rationale:"Core identifier used to correlate telemetry across services.",objectType:"resource",category:"telemetry-hygiene",impact:Tt("important"),recommendation:`Populate ${aS} in all log and span payloads.`},"inconsistent-attribute-naming":{key:"inconsistent-attribute-naming",title:"Consistent attribute naming",summary:"Detects attributes with multiple naming variants (e.g., userId vs user_id).",rationale:"Consistent naming improves queryability.",objectType:"log",category:"telemetry-hygiene",impact:Tt("normal"),recommendation:"Standardize attribute naming conventions across all log sources."},"no-duplicate-attr-values":{key:"no-duplicate-attr-values",title:"No duplicate attribute values",summary:"Detects when different attributes consistently carry identical values across logs (e.g., err.type and error.type always having the same value).",rationale:"Redundant attributes waste storage and complicate querying. Consolidate to one.",objectType:"log",category:"telemetry-hygiene",impact:Tt("normal"),recommendation:"Consolidate duplicate attributes at the source to reduce storage costs."},"no-debug-logs-in-prod":{key:"no-debug-logs-in-prod",title:"No DEBUG logs in production",summary:"Detects DEBUG-level logs emitted in production environments.",rationale:"DEBUG logs in production increase costs and risk exposing sensitive data.",objectType:"log",category:"telemetry-hygiene",impact:Tt("important"),recommendation:"Remove DEBUG-level logging from production environment or adjust log level configuration."},"no-multiline-logs":{key:"no-multiline-logs",title:"No ungrouped multiline logs",summary:"Detects orphaned stack-trace and traceback continuation lines that should have been grouped into a single log entry by the collector.",rationale:"Ungrouped multiline logs fragment errors across many entries, making them harder to read, search, and alert on.",objectType:"log",category:"telemetry-hygiene",impact:Tt("important"),recommendation:"Configure multiline grouping on the log collector using a line_start_pattern (e.g. a timestamp regex) so stack traces are sent as a single entry."},"no-error-logs-as-info":{key:"no-error-logs-as-info",title:"No error logs mapped as info",summary:"Detects INFO-level logs that carry error fields such as error.*, err.*, exception.*, or a stack trace.",rationale:"A log with error or exception attributes but an INFO severity is never surfaced as an error, so teams miss real failures caused by a misconfigured level mapper or bad logging.",objectType:"log",category:"telemetry-hygiene",impact:Tt("important"),recommendation:"Map these logs to ERROR in the level mapper, or fix the source logging so errors and exceptions are emitted at the right severity."},"no-empty-dashboards":{key:"no-empty-dashboards",title:"No empty dashboards",summary:"Flags dashboards with 1 or fewer widgets.",rationale:"Empty or near-empty dashboards add clutter and make it harder to find useful dashboards.",objectType:"dashboard",category:"observability-assets",impact:Tt("normal"),recommendation:"Add meaningful widgets to dashboards or remove empty ones to reduce clutter."},"monitor-has-notification":{key:"monitor-has-notification",title:"No monitors without notification",summary:"Every monitor has at least one active notification destination configured.",rationale:"A monitor without notifications is effectively silent - it detects issues but nobody is alerted.",objectType:"monitor",category:"observability-assets",impact:Tt("important"),recommendation:"Add a notification destination to every monitor - a monitor without notifications is effectively silent."},"no-future-dated-logs":{key:"no-future-dated-logs",title:"No future-dated logs",summary:"Detects logs with timestamps more than 59 minutes ahead of their intake time.",rationale:"Future-dated logs break dashboards, alerting, and log ordering - they indicate clock skew or incorrect timestamp generation.",objectType:"log",category:"telemetry-hygiene",impact:Tt("important"),recommendation:"Fix clock synchronization or timestamp generation for services emitting future-dated logs - they break dashboards and alerting."},"metric-usage":{key:"metric-usage",title:"Metric usage",summary:"Percentage of ingested metrics that are referenced by a dashboard or monitor, or were queried in the last 30 days.",rationale:"Metrics that are never visualized, alerted on, or queried add ingestion cost and cardinality without providing value.",objectType:"metric",category:"telemetry-adoption",impact:Tt("important"),recommendation:"Stop emitting metrics that are never referenced or queried to reduce ingestion cost and cardinality.",scope:"global"},"no-stale-dashboards":{key:"no-stale-dashboards",title:"No stale dashboards",summary:"Flags dashboards that have not been edited in over 180 days.",rationale:"Stale dashboards may contain outdated queries or irrelevant data, making it harder for teams to find useful, up-to-date information.",objectType:"dashboard",category:"observability-assets",impact:Tt("normal"),recommendation:"Review and update dashboards that haven't been edited in 180+ days, or archive them if no longer relevant."},"no-unused-dashboards":{key:"no-unused-dashboards",title:"No unused dashboards",summary:"Flags dashboards with zero views in the last 60 days.",rationale:"Dashboards that nobody views add clutter and may confuse team members looking for relevant information.",objectType:"dashboard",category:"telemetry-adoption",impact:Tt("important"),recommendation:"Archive or delete dashboards that nobody has viewed in the last 60 days to reduce noise."},"no-orphan-monitors":{key:"no-orphan-monitors",title:"No monitors without dashboards",summary:"Every monitor should be linked to at least one dashboard.",rationale:"Monitors without a linked dashboard make it harder for teams to investigate alerts \u2014 responders need a dashboard to quickly understand the context and scope of an issue.",objectType:"monitor",category:"observability-assets",impact:Tt("important"),recommendation:"Link monitors to relevant dashboards so teams can quickly investigate when alerts fire."},"no-flapping-monitors":{key:"no-flapping-monitors",title:"No flappy monitors",summary:"P1/P2 monitors should not have any group (or the monitor itself) trigger 7+ alerts within 7 days.",rationale:"Monitors that constantly flip between alert and OK cause alert fatigue. Teams start ignoring notifications, increasing the risk of missing real incidents.",objectType:"monitor",category:"observability-assets",impact:Tt("important"),recommendation:"Tune thresholds, add hysteresis, or adjust evaluation windows to reduce flapping."},"no-noisy-group-monitors":{key:"no-noisy-group-monitors",title:"No noisy group-by monitors",summary:"P1/P2 group-by monitors should not have 5+ groups triggering alerts simultaneously on 2+ occasions within 7 days.",rationale:"When a group-by monitor triggers alerts for many groups at once repeatedly, the signal gets lost in noise. Responders cannot prioritize and the monitor effectively becomes useless.",objectType:"monitor",category:"observability-assets",impact:Tt("important"),recommendation:"Narrow the group-by scope, raise thresholds, or split into more targeted monitors."},"no-long-alert-monitors":{key:"no-long-alert-monitors",title:"No monitors stuck in alert",summary:"P1/P2 monitors should not remain in alert state for more than 15 days.",rationale:"A high-priority monitor stuck in alert for weeks signals an unresolved issue or a misconfigured threshold. Either way, the alert loses meaning and contributes to alert fatigue.",objectType:"monitor",category:"observability-assets",impact:Tt("important"),recommendation:"Investigate and resolve the underlying issue, adjust the threshold, or acknowledge and close the alert."},"no-redundant-monitors":{key:"no-redundant-monitors",title:"No redundant monitors",summary:"P1/P2 monitors should not always trigger at the same time as another monitor (3+ co-triggers within 7 days).",rationale:"A monitor that always fires alongside another monitor is redundant. It adds noise without providing additional signal, making it harder for responders to identify the root cause.",objectType:"monitor",category:"observability-assets",impact:Tt("important"),recommendation:"Investigate whether the redundant monitor can be removed or consolidated with the one it always co-triggers with."},"no-absent-log-fields":{key:"no-absent-log-fields",title:"No absent log fields",summary:"Dashboards and monitors should reference log fields that still appear in recent logs (last 24 hours).",rationale:"References to log fields that no longer exist silently break dashboards and monitors, eroding trust in observability.",objectType:"dashboard",category:"observability-assets",impact:Tt("important"),recommendation:"Remove, rename, or backfill log fields that are referenced by dashboards or monitors but have not been seen in the last 24 hours.",scope:"global"},"k8s-recommended-attributes":{key:"k8s-recommended-attributes",title:"Kubernetes recommended resource attributes",summary:"Kubernetes logs and spans should populate core identity attributes and at least one workload-ownership attribute.",rationale:"These attributes let Tsuga correlate telemetry with the Kubernetes objects that produced it, which is required for faulty-deployment detection and rollback suggestions.",objectType:"resource",category:"collection-coverage",impact:Tt("important"),recommendation:"Make sure every Kubernetes workload emits k8s.cluster.name, k8s.namespace.name, k8s.pod.name, k8s.pod.uid, k8s.container.name, k8s.node.name and one workload-ownership attribute (for example via the OpenTelemetry Collector k8s_attributes processor)."},"k8s-recommended-metrics":{key:"k8s-recommended-metrics",title:"Kubernetes recommended cluster metrics",summary:"All recommended Kubernetes cluster metrics are collected.",rationale:"These metrics are the primary signals for faulty-deployment detection; without k8s.container.status.reason and the usage/limit pairs, container crash loops and resource starvation cannot be diagnosed.",objectType:"metric",category:"collection-coverage",impact:Tt("important"),recommendation:"Enable the OpenTelemetry Collector k8s_cluster receiver (for example via the Tsuga Helm chart) so the required Kubernetes metrics are emitted.",scope:"global"},"k8s-recommended-change-events":{key:"k8s-recommended-change-events",title:"Kubernetes recommended change events",summary:"Change events are collected for the Kubernetes object kinds recommended for rollback suggestions.",rationale:"Faulty-deployment detection needs the history of ReplicaSet, Deployment, Pod and Node changes to identify failing revisions and propose rollbacks.",objectType:"log",category:"collection-coverage",impact:Tt("important"),recommendation:"Configure the Kubernetes change-event collector (for example the OpenTelemetry k8sobjects receiver) so change events for Pod, Deployment, ReplicaSet, StatefulSet, DaemonSet, Namespace and Node are ingested."},"otel-collector-self-metrics":{key:"otel-collector-self-metrics",title:"OpenTelemetry Collector self-metrics",summary:"A cluster collecting Kubernetes metrics through an OpenTelemetry Collector also emits the collector self-metrics (otelcol_*).",rationale:"The Kubernetes receivers feed the Kubernetes explorer. Without the collector self-metrics there is no way to tell a healthy pipeline from one that drops data or fails to export, so a stale or missing Kubernetes view cannot be explained.",objectType:"metric",category:"collection-coverage",impact:Tt("important"),recommendation:"Enable the collector's internal telemetry (service.telemetry.metrics) and export it to Tsuga so otelcol_* metrics are available.",scope:"global"},"use-standard-attributes":{key:"use-standard-attributes",title:"Standard attribute usage",summary:"Detects log attributes that should be remapped to Tsuga standard attributes.",rationale:"Standard attributes enable consistent querying, out-of-the-box dashboards, and cross-team correlation.",objectType:"log",category:"telemetry-hygiene",impact:Tt("important"),recommendation:"Use the attribute remapper in your routes to rename attributes to their standard equivalents."},"no-unused-operation-api-keys":{key:"no-unused-operation-api-keys",title:"No unused operation API keys",summary:"Flags operation API keys with no activity in the last 180 days.",rationale:"Long-idle operation credentials add risk if leaked and clutter the inventory. Tracking last-used activity makes it easy to rotate or delete the unused ones.",objectType:"api-key",category:"observability-assets",impact:Tt("important"),recommendation:"Rotate or delete operation API keys that have not been used in the last 180 days."},"no-unused-ingestion-api-keys":{key:"no-unused-ingestion-api-keys",title:"No unused ingestion API keys",summary:"Flags ingestion API keys with no telemetry in the last 30 days across any cluster.",rationale:"Dormant ingestion credentials add risk if leaked and clutter the inventory. Tracking key activity makes it easy to rotate or delete the unused ones.",objectType:"api-key",category:"observability-assets",impact:Tt("important"),recommendation:"Rotate or delete ingestion API keys that have sent no data in the last 30 days."},"db-logs-trace-correlation":{key:"db-logs-trace-correlation",title:"Database logs correlated with traces",summary:`Database logs should carry ${VZ} so they can be tied back to the trace that issued the query.`,rationale:"Linking database server logs to client traces lets users jump from a slow request to the exact query log. Without a trace id, database logs cannot be joined to the request that produced them.",objectType:"log",category:"telemetry-hygiene",impact:Tt("normal"),recommendation:"Enable trace correlation on the database log pipeline (for example via SQLcommenter, which embeds the traceparent in each statement) so query logs carry a trace id.",scope:"team"},"assets-comply-with-tag-policies":{key:"assets-comply-with-tag-policies",title:"Assets comply with tag policies",summary:"Every asset owned by the team (dashboards, monitors, routes, keys, SLOs, notification rules and silences) carries the tags required by the active asset tag policies that apply to it.",rationale:"Tag policies are only enforced when an asset is created or updated, so assets that predate a policy stay non-compliant and break tag-based ownership, filtering and cost attribution.",objectType:"tag-policy",category:"observability-assets",impact:Tt("important"),recommendation:"Edit each non-compliant asset to add the missing tags and remove the disallowed tags required by the tag policy.",scope:"team"},"data-complies-with-tag-policies":{key:"data-complies-with-tag-policies",title:"Data complies with tag policies",summary:"Logs, metrics and traces sent by the team raise no violations of the active data tag policies that apply to it during the lookback window.",rationale:"Telemetry that violates a data tag policy is flagged or dropped at ingestion, so teams lose data and tag-based queries, dashboards and monitors miss it.",objectType:"tag-policy",category:"telemetry-hygiene",impact:Tt("important"),recommendation:"Set the tags required by each violated data tag policy at the source, for example as resource attributes in the OpenTelemetry SDK or collector.",scope:"team"}},lle={"postgresql-server-metrics-collected":{label:"PostgreSQL",systemValues:["postgresql"],metricPrefixes:["postgresql.","pg_"],receiver:"postgresqlreceiver"},"mysql-server-metrics-collected":{label:"MySQL",systemValues:["mysql","mariadb"],metricPrefixes:["mysql.","mysql_"],receiver:"mysqlreceiver"},"mongodb-server-metrics-collected":{label:"MongoDB",systemValues:["mongodb"],metricPrefixes:["mongodb.","mongodbatlas.","mongodb_"],receiver:"mongodbreceiver"},"redis-server-metrics-collected":{label:"Redis",systemValues:["redis"],metricPrefixes:["redis.","redis_"],receiver:"redisreceiver"},"memcached-server-metrics-collected":{label:"Memcached",systemValues:["memcached"],metricPrefixes:["memcached.","memcached_"],receiver:"memcachedreceiver"},"couchdb-server-metrics-collected":{label:"CouchDB",systemValues:["couchdb"],metricPrefixes:["couchdb.","couchdb_"],receiver:"couchdbreceiver"},"elasticsearch-server-metrics-collected":{label:"Elasticsearch",systemValues:["elasticsearch"],metricPrefixes:["elasticsearch.","elasticsearch_"],receiver:"elasticsearchreceiver"},"oracledb-server-metrics-collected":{label:"Oracle DB",systemValues:["oracle.db","oracle"],metricPrefixes:["oracledb.","oracledb_"],receiver:"oracledbreceiver"},"sqlserver-server-metrics-collected":{label:"Microsoft SQL Server",systemValues:["microsoft.sql_server","mssql"],metricPrefixes:["sqlserver.","mssql_"],receiver:"sqlserverreceiver"},"saphana-server-metrics-collected":{label:"SAP HANA",systemValues:["sap.hana","hanadb"],metricPrefixes:["saphana."],receiver:"saphanareceiver"},"cassandra-server-metrics-collected":{label:"Cassandra",systemValues:["cassandra"],metricPrefixes:["cassandra.","cassandra_"]},"clickhouse-server-metrics-collected":{label:"ClickHouse",systemValues:["clickhouse"],metricPrefixes:["ClickHouse"]},"couchbase-server-metrics-collected":{label:"Couchbase",systemValues:["couchbase"],metricPrefixes:["couchbase_"]},"neo4j-server-metrics-collected":{label:"Neo4j",systemValues:["neo4j"],metricPrefixes:["neo4j_"]},"opensearch-server-metrics-collected":{label:"OpenSearch",systemValues:["opensearch"],metricPrefixes:["opensearch_"]},"db2-server-metrics-collected":{label:"IBM Db2",systemValues:["ibm.db2","db2"],metricPrefixes:["ibm_db2_"]}},jKe=Object.fromEntries(Object.keys(lle).map(e=>{let{label:t,receiver:r}=lle[e];return[e,{key:e,title:`${t} server metrics collected`,summary:`${t} seen in client spans should have its server metrics collected.`,rationale:"Server metrics (connections, throughput, replication, contention) are needed to investigate database slowness beyond what client spans show. A detected database with no server metrics has a gap in its monitoring setup.",objectType:"metric",category:"collection-coverage",impact:Tt("important"),recommendation:r?`Configure the ${r} OpenTelemetry receiver so ${t} server metrics are collected.`:`Collect ${t} server metrics, for example via its Prometheus exporter.`,scope:"global"}]})),HKe=new Set(["azure_container_registry","azure_container_registry_image","azure_app_service_certificate","azure_virtual_network"]),KKe=LS.filter(e=>e.startsWith("azure_")&&!HKe.has(e)),ule={"aws-sqs-metrics-collected":{label:"Amazon SQS",source:"AWS/SQS",nativeResourceTypes:["aws_sqs_queue"],metricPrefixes:["aws_sqs_"]},"aws-sns-metrics-collected":{label:"Amazon SNS",source:"AWS/SNS",nativeResourceTypes:["aws_sns_topic"],metricPrefixes:["aws_sns_"]},"aws-kinesis-metrics-collected":{label:"Amazon Kinesis Data Streams",source:"AWS/Kinesis",nativeResourceTypes:["aws_kinesis_data_stream"],metricPrefixes:["aws_kinesis_"]},"aws-dynamodb-metrics-collected":{label:"Amazon DynamoDB",source:"AWS/DynamoDB",nativeResourceTypes:["aws_dynamodb_table"],metricPrefixes:["aws_dynamodb_"]},"aws-rds-metrics-collected":{label:"Amazon RDS",source:"AWS/RDS",nativeResourceTypes:["aws_rds_instance"],metricPrefixes:["aws_rds_"]},"aws-elasticache-metrics-collected":{label:"Amazon ElastiCache",source:"AWS/ElastiCache",nativeResourceTypes:["aws_elasticache"],metricPrefixes:["aws_elasticache_"]},"aws-s3-metrics-collected":{label:"Amazon S3",source:"AWS/S3",nativeResourceTypes:["aws_s3_bucket"],metricPrefixes:["aws_s3_"]},"aws-ebs-metrics-collected":{label:"Amazon EBS",source:"AWS/EBS",nativeResourceTypes:["aws_ebs_volume"],metricPrefixes:["aws_ebs_"]},"aws-efs-metrics-collected":{label:"Amazon EFS",source:"AWS/EFS",nativeResourceTypes:["aws_efs"],metricPrefixes:["aws_efs_"]},"aws-ec2-metrics-collected":{label:"Amazon EC2",source:"AWS/EC2",nativeResourceTypes:["aws_ec2_instance"],metricPrefixes:["aws_ec2_"]},"aws-lambda-metrics-collected":{label:"AWS Lambda",source:"AWS/Lambda",nativeResourceTypes:["aws_lambda_function"],metricPrefixes:["aws_lambda_"]},"aws-ecs-metrics-collected":{label:"Amazon ECS",source:"AWS/ECS",nativeResourceTypes:["aws_ecs_cluster","aws_ecs_service","aws_ecs_task"],metricPrefixes:["aws_ecs_"]},"aws-ecr-metrics-collected":{label:"Amazon ECR",source:"AWS/ECR",nativeResourceTypes:["aws_ecr_repository"],metricPrefixes:["aws_ecr_"]},"aws-elb-metrics-collected":{label:"Elastic Load Balancing",source:"AWS/ApplicationELB, AWS/NetworkELB",nativeResourceTypes:["aws_elastic_load_balancer"],metricPrefixes:["aws_applicationelb_","aws_networkelb_","aws_gatewayelb_","aws_elb_"]},"aws-cloudfront-metrics-collected":{label:"Amazon CloudFront",source:"AWS/CloudFront",nativeResourceTypes:["aws_cloudfront_distribution"],metricPrefixes:["aws_cloudfront_"]},"aws-acm-metrics-collected":{label:"AWS Certificate Manager",source:"AWS/CertificateManager",nativeResourceTypes:["aws_acm_certificate"],metricPrefixes:["aws_certificatemanager_"]},"gcp-pubsub-metrics-collected":{label:"Google Cloud Pub/Sub",source:"pubsub.googleapis.com",nativeResourceTypes:["gcp_pubsub_topic"],metricPrefixes:["pubsub.googleapis.com/"]},"gcp-storage-metrics-collected":{label:"Google Cloud Storage",source:"storage.googleapis.com",nativeResourceTypes:["gcp_bucket"],metricPrefixes:["storage.googleapis.com/"]},"gcp-compute-metrics-collected":{label:"Google Compute Engine",source:"compute.googleapis.com",nativeResourceTypes:["gcp_compute_instance","gcp_compute_disk"],metricPrefixes:["compute.googleapis.com/"]},"gcp-cloud-sql-metrics-collected":{label:"Google Cloud SQL",source:"cloudsql.googleapis.com",nativeResourceTypes:["gcp_cloud_sql_instance"],metricPrefixes:["cloudsql.googleapis.com/"]},"gcp-gke-metrics-collected":{label:"Google Kubernetes Engine",source:"kubernetes.io, container.googleapis.com",nativeResourceTypes:["gcp_gke_cluster"],metricPrefixes:["kubernetes.io/","container.googleapis.com/"]},"gcp-cloud-run-metrics-collected":{label:"Google Cloud Run",source:"run.googleapis.com",nativeResourceTypes:["gcp_cloud_run_service","gcp_cloud_run_job","gcp_cloud_run_function"],metricPrefixes:["run.googleapis.com/"]},"gcp-artifact-registry-metrics-collected":{label:"Google Artifact Registry",source:"artifactregistry.googleapis.com",nativeResourceTypes:["gcp_artifact_registry_repository"],metricPrefixes:["artifactregistry.googleapis.com/"]},"gcp-load-balancing-metrics-collected":{label:"Google Cloud Load Balancing",source:"loadbalancing.googleapis.com",nativeResourceTypes:["gcp_forwarding_rule"],metricPrefixes:["loadbalancing.googleapis.com/"]},"gcp-bigtable-metrics-collected":{label:"Google Cloud Bigtable",source:"bigtable.googleapis.com",nativeResourceTypes:["gcp_bigtable_instance"],metricPrefixes:["bigtable.googleapis.com/"]},"gcp-spanner-metrics-collected":{label:"Google Cloud Spanner",source:"spanner.googleapis.com",nativeResourceTypes:["gcp_spanner_instance"],metricPrefixes:["spanner.googleapis.com/"]},"gcp-firestore-metrics-collected":{label:"Google Cloud Firestore",source:"firestore.googleapis.com",nativeResourceTypes:["gcp_firestore_database"],metricPrefixes:["firestore.googleapis.com/"]},"gcp-app-engine-metrics-collected":{label:"Google App Engine",source:"appengine.googleapis.com",nativeResourceTypes:["gcp_app_engine_service"],metricPrefixes:["appengine.googleapis.com/"]},"azure-metrics-collected":{label:"Azure",source:"Azure Monitor",nativeResourceTypes:KKe,metricPrefixes:["azure_"]}},zKe=Object.fromEntries(Object.keys(ule).map(e=>{let{label:t,source:r}=ule[e];return[e,{key:e,title:`${t} metrics collected`,summary:`${t} resources found in inventory should have their metrics collected.`,rationale:"A resource that appears in inventory but whose metrics are not collected leaves its dashboards and resource-explorer views empty and impossible to alert on.",objectType:"metric",category:"collection-coverage",impact:Tt("important"),recommendation:`Enable the ${r} metrics integration so ${t} metrics are ingested.`,scope:"global"}]})),YKe={...qKe,...jKe,...zKe},ple=Object.values(YKe);var mle=["passed","failed","ignored"],VKe=10,QKe=n.Enum(mle,{description:"Evaluation outcome for this rule row. Allowed values are passed, failed, and ignored; ignored means the rule was not applicable to the available data."}),WKe=["aws-sqs-metrics-collected","aws-sns-metrics-collected","aws-kinesis-metrics-collected","aws-dynamodb-metrics-collected","aws-rds-metrics-collected","aws-elasticache-metrics-collected","aws-s3-metrics-collected","aws-ebs-metrics-collected","aws-efs-metrics-collected","aws-ec2-metrics-collected","aws-lambda-metrics-collected","aws-ecs-metrics-collected","aws-ecr-metrics-collected","aws-elb-metrics-collected","aws-cloudfront-metrics-collected","aws-acm-metrics-collected","gcp-pubsub-metrics-collected","gcp-storage-metrics-collected","gcp-compute-metrics-collected","gcp-cloud-sql-metrics-collected","gcp-gke-metrics-collected","gcp-cloud-run-metrics-collected","gcp-artifact-registry-metrics-collected","gcp-load-balancing-metrics-collected","gcp-bigtable-metrics-collected","gcp-spanner-metrics-collected","gcp-firestore-metrics-collected","gcp-app-engine-metrics-collected","azure-metrics-collected"],JKe=["postgresql-server-metrics-collected","mysql-server-metrics-collected","mongodb-server-metrics-collected","redis-server-metrics-collected","memcached-server-metrics-collected","couchdb-server-metrics-collected","elasticsearch-server-metrics-collected","oracledb-server-metrics-collected","sqlserver-server-metrics-collected","saphana-server-metrics-collected","cassandra-server-metrics-collected","clickhouse-server-metrics-collected","couchbase-server-metrics-collected","neo4j-server-metrics-collected","opensearch-server-metrics-collected","db2-server-metrics-collected"],KF=["unrouted-logs","no-over-routed-logs","team-has-route","no-team-override-mismatch","service-name-present","no-orphan-spans","metric-unit-consistency","host-name-present","inconsistent-attribute-naming","no-duplicate-attr-values","no-debug-logs-in-prod","no-multiline-logs","no-error-logs-as-info","no-empty-dashboards","monitor-has-notification","no-future-dated-logs","metric-usage","no-stale-dashboards","no-unused-dashboards","no-orphan-monitors","no-flapping-monitors","no-noisy-group-monitors","no-long-alert-monitors","no-redundant-monitors","no-absent-log-fields","k8s-recommended-attributes","k8s-recommended-metrics","k8s-recommended-change-events","otel-collector-self-metrics","use-standard-attributes","no-unused-operation-api-keys","no-unused-ingestion-api-keys","db-logs-trace-correlation","assets-comply-with-tag-policies","data-complies-with-tag-policies",...JKe,...WKe],dle=n.Enum(KF),ZKe=["log","metric","resource","span","api-key","dashboard","monitor","route","tag-policy"],XKe=["collection-coverage","telemetry-hygiene","observability-assets","telemetry-adoption"],eze=["critical","important","normal"],tze=["team","global"],zF=n.Object({key:n.Enum(KF),title:n.String(),summary:n.String(),rationale:n.String(),objectType:n.Enum(ZKe),category:n.Enum(XKe),impact:n.Object({label:n.Enum(eze),weight:n.Number()}),recommendation:n.String(),scope:n.Optional(n.Enum(tze))}),gT=n.Object({type:n.String({description:"Tsuga asset or telemetry kind referenced by this example. Set by the rule evaluator from the failing object, record, or lookup result; examples include `monitor`, `dashboard`, `metric`, `log`, and `api-key`."}),label:n.String({description:"Human-readable summary of the example. Set by the rule evaluator from the asset name, telemetry identifier, or lookup result so clients can display the example without following the link."}),link:n.Object({to:n.String({description:"In-app route that opens the example in Tsuga. Set by the rule evaluator when the example has a product surface for inspection."}),search:n.Optional(n.Unknown({description:"Route search payload for the in-app link. Set when the destination needs query-string state such as a search query, time range, or table filter."})),params:n.Optional(n.Unknown({description:"Route params for the in-app link. Set when the destination route needs path parameters such as an asset identifier."}))},{description:"In-app deep link for inspecting the example. Returned when Tsuga can route from the quality-report row to a relevant product page."})}),HF=n.Intersect([zF,n.Object({id:n.Optional(n.String()),status:QKe,normalizedScore:n.Number(),details:n.Optional(n.Record(n.String(),n.Unknown())),recommendation:n.Optional(n.String()),examples:n.Optional(n.Array(gT)),exampleCount:n.Optional(n.Integer())})]),rze=n.Object({generatedAt:n.String(),overallScore:n.Optional(n.Number()),rules:n.Array(zF),teamResults:n.Array(n.Object({teamId:n.String(),teamName:n.String(),teamWeight:n.Number(),score:n.Number(),weightedScore:n.Number(),totalWeight:n.Number(),ruleResults:n.Array(HF)})),globalResults:n.Optional(n.Object({score:n.Optional(n.Number()),ruleResults:n.Array(HF)}))}),YF=n.Object({id:n.String({description:"Identifier of this persisted quality-report row. Generated by Tsuga when report rows are stored. Returned on every row. Treat it as an opaque ID."}),reportId:n.String({description:"Identifier shared by rows from the same report generation for the same team or global cluster-wide scope. Generated by Tsuga when the report is stored. Returned on every row."}),ruleId:n.Enum(KF,{description:"Stable key for the telemetry-quality rule evaluated by this row. Set by Tsuga from the quality-rule catalog. Returned on every row. The enum may grow as Tsuga adds rules; clients should display unknown future values as opaque rule keys if they do not have local labels."}),owner:n.Optional(n.String({description:"Team identifier this row applies to. Set to the owning team ID for team-scoped rules. Returned for team rows; omitted for global cluster-wide rows."})),status:n.Enum(mle,{description:"Evaluation outcome for this rule row. Set by the rule evaluator when the report is generated. Returned on every row. Allowed values are passed, failed, and ignored; ignored means the rule was not applicable to the available data."}),score:n.Number({description:"Normalized score for this rule row. Set by the rule evaluator when the report is generated. Returned on every row. Values are between 0 and 1."}),weight:n.Number({description:"Impact weight of this rule, captured at report-generation time. Set by Tsuga from the rule's impact label: 1 for normal, 2 for important, 3 for critical. Used with score to compute reportOverallScore."}),reportOverallScore:n.Number({description:"Aggregate score for this row's report group. Calculated by Tsuga from non-ignored rows in the same team or global cluster-wide report. Returned on every row in that group with the same value."}),reportTotalWeight:n.Number({description:"Sum of non-ignored rule weights for this row's report group. Calculated by Tsuga when the report is generated. Returned on every row in that group with the same value."}),recommendation:n.Optional(n.String({description:"Recommendation stored with this row. Set by the rule evaluator when the report is generated. Returned when a recommendation was persisted; omitted otherwise. The latest-report endpoint does not recompute or default it at read time."})),examples:n.Optional(n.Array(gT,{description:`Assets, logs, metrics, or links supporting this rule result. Set by the rule evaluator when the report is generated. Returned when examples were persisted and visible to the caller; global row examples are returned only to admin users. Truncated to the first ${VKe}; compare against exampleCount to detect truncation.`})),exampleCount:n.Optional(n.Integer({description:"Total number of examples persisted for this row, before the preview truncation applied to examples. Returned whenever examples are visible to the caller."})),createdAt:n.String({description:"ISO timestamp the row was generated at"})}),vyr=x({tags:["quality-reports"],url:"/v0/quality-reports",method:"POST",response:rze}),ZC=n.Optional(f({allowEmpty:!1,description:"Identifier of the cluster whose latest quality-report rows are returned. Use the id from the clusters API. Required when the organization has multiple clusters; omit only in single-cluster organizations. Unknown cluster IDs return RESOURCE_NOT_FOUND."})),Uyr=x({tags:["quality-reports"],url:"/v0/quality-reports/latest",method:"GET",paginated:!0,query:n.Object({clusterId:ZC,team:n.Optional(f({allowEmpty:!1})),...je}),response:n.Array(YF,{description:"Latest persisted rule evaluation rows for the cluster"})}),Nyr=x({tags:["quality-reports"],url:"/v0/quality-reports/:id/examples",method:"GET",paginated:!0,params:n.Object({id:f({allowEmpty:!1})}),query:n.Object(je),response:n.Object({examples:n.Array(gT)})}),kyr=x({tags:["quality-reports"],url:"/v0/quality-reports/preview",method:"POST",body:n.Object({ruleKey:dle,teamId:n.Optional(f({allowEmpty:!1})),lookbackMinutes:n.Optional(n.Integer({minimum:1,maximum:60})),clusterId:n.Optional(f({allowEmpty:!1}))}),response:n.Object({rule:zF,result:HF,teamId:n.Optional(n.String()),teamName:n.Optional(n.String())})}),Lyr=x({tags:["quality-reports"],url:"/v0/quality-reports/auto-fix",method:"POST",body:n.Object({ruleKey:dle,teamId:n.Optional(f({allowEmpty:!1})),clusterId:ZC,configurationId:f({allowEmpty:!1})}),response:n.Object({runId:n.String()})}),Myr=new Map(ple.map(e=>[e.key,e]));var fle=`/${"v1"}/quality-reports`,gle=n.Pick(YF,["id","reportId","ruleId","owner","status","score","weight","reportOverallScore","reportTotalWeight","recommendation","examples","exampleCount","createdAt"],{$id:"QualityReportRow",description:"Persisted evaluation of one telemetry-quality rule for a team or cluster-wide scope. See [Quality reports](/documentation/account-and-settings/quality-reports)."}),nze={id:"01j9x3z4vyabcdfghjkmnpqrst",reportId:"01j9x3z4vyabcdfghjkmnpqrsu",ruleId:"team-has-route",owner:"01j9x3z4vyabcdfghjkmnpqrr",status:"passed",score:1,weight:2,reportOverallScore:.85,reportTotalWeight:2,createdAt:"2026-02-26T12:00:00.000Z"};Object.assign(gle,{examples:[nze]});var oze=n.Object({clusterId:ZC,team:n.Optional(f({allowEmpty:!1,description:"Team name used to scope the report. Matched against Tsuga team names. Optional; when set, returns only rows for that team and omits global rows. Unknown team names return RESOURCE_NOT_FOUND; teams the caller cannot access return an empty result."})),...er},{description:"Latest quality report lookup query."}),hle=x({description:"Retrieves the latest persisted quality-report rows for a cluster, optionally scoped to one team. Use this to audit telemetry hygiene and routing recommendations. A cluster holds one row per rule per team, so pagination fields limit the returned page.",operationId:"getLatestQualityReport",tags:["quality-reports"],url:`${fle}/latest`,method:"GET",paginated:!0,query:oze,response:n.Array(gle)}),VF=x({description:"Retrieves a page of the examples stored for one quality-report row. The latest-report endpoint returns only a preview of each row's examples, so use this to page past that preview when exampleCount exceeds the number of examples returned there. The row's full example count is in `metadata.pagination.totalCount`.",operationId:"getQualityReportExamples",tags:["quality-reports"],url:`${fle}/:id/examples`,method:"GET",paginated:!0,params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the quality-report row whose examples are returned. Use the id from the latest-report endpoint. Unknown ids, rows the caller cannot access, and cluster-wide rows requested by a non-admin all return RESOURCE_NOT_FOUND."})}),query:n.Object(er,{description:"Page of the row examples to return."}),response:n.Object({examples:n.Array(gT,{description:"Requested page of the examples stored for this row. Empty when the rule evaluation produced none, or when the offset is past the last one."})},{description:"One page of the examples stored for a quality-report row."})});var yle=["type","label"],Ele=G("examples",{id:on("ID").pipe(sn("The quality report row whose examples are returned")),...xS,...Ia(yle)},D("cli.quality-reports.examples")(function*(e){let t=yield*ti,r=yield*ye(VF,{params:{id:e.id},query:ho({limit:Re(e.limit),offset:Re(e.offset)})});if(!qt(VF.response,r))return yield*new _s({message:"The API returned quality report examples the CLI could not read"});yield*t.rows(r.examples,{...e,defaultFields:yle})})).pipe(B("List the examples stored for one quality report row"));var Sle=_t({commandName:"quality-reports",description:"Get the latest quality report rows for a cluster",listDescription:"Get the latest quality report rows for a cluster (pass --cluster <CLUSTER_ID> when the org has more than one cluster)",endpoints:{list:hle},extraSubcommands:[Ele]});var hT="/v0/admin-center";var Ua=`${hT}/retention-policies`,Tle=3650,ize=n.Integer({description:"Number of days Tsuga retains matching telemetry."}),ble=n.Integer({minimum:1,maximum:Tle,description:`Number of days Tsuga should retain matching telemetry. Valid values are 1 through ${Tle}.`}),zc=n.Object({id:n.String({description:"Unique identifier of the retention policy. Generated by Tsuga."}),env:n.Optional(n.String({description:"Environment tag value this policy applies to. Omitted policies apply across environments unless a more specific policy exists."})),teamId:n.Optional(n.String({description:"Team ID this policy applies to. Omitted policies apply globally unless a team-specific policy exists."})),dataSource:n.Enum(ya,{description:"Telemetry signal retained by this policy: logs, metrics, traces or rum."}),durationDays:ize,isEnabled:n.Boolean({description:"Whether this policy participates in retention resolution."}),createdAt:H({description:"Timestamp when Tsuga created the retention policy."}),updatedAt:H({description:"Timestamp when Tsuga last updated the retention policy."})}),XC=n.Object({env:Ut(f(),{description:"Environment tag value this policy applies to. Omit for a policy that is not environment-specific."}),teamId:Ut(f(),{description:"Team ID this policy applies to. Omit for a policy that is not team-specific."}),dataSource:n.Enum(ya,{description:"Telemetry signal retained by this policy: logs, metrics, traces or rum."}),durationDays:ble,isEnabled:n.Boolean({description:"Set to true for the policy to participate in retention resolution."})}),xle=n.Array(n.Object({env:f(),dataSource:n.Enum(ya),durationDays:n.Union([ble,n.Null()]),isEnabled:n.Boolean()})),Ile=n.Object({inserted:n.Array(zc),updated:n.Array(zc),deleted:n.Array(zc)}),lEr=x({tags:["retention-policies"],url:Ua,method:"POST",body:XC,response:zc}),uEr=x({tags:["retention-policies"],url:Ua,method:"GET",response:n.Array(zc)}),pEr=x({tags:["retention-policies"],url:`${Ua}/:id`,method:"GET",params:n.Object({id:f()}),response:zc}),mEr=x({tags:["retention-policies"],url:`${Ua}/:id`,method:"PUT",params:n.Object({id:f()}),body:XC,response:zc}),dEr=x({tags:["retention-policies"],url:`${Ua}/bulk-update`,method:"POST",body:xle,response:Ile}),fEr=x({tags:["retention-policies"],url:`${Ua}/bulk-update-for-team`,method:"POST",body:n.Object({teamId:f(),policies:xle}),response:Ile}),gEr=x({tags:["retention-policies"],url:`${Ua}/:id`,method:"DELETE",params:n.Object({id:f()}),response:ae}),yT=["past-24-hours","past-7-days","past-30-days"],hEr=x({tags:["retention-policies"],url:`${Ua}/requested-history-percentile/:teamId`,method:"POST",params:n.Object({teamId:f()}),body:n.Object({percentile:n.Number({minimum:0,maximum:1}),observationWindow:n.Enum(yT),dataSource:n.Enum(ya)}),response:n.Object({percentile:n.Number(),observationWindow:n.Enum(yT),dataSource:n.Enum(ya),teamId:n.String(),requestedHistoryDays:n.Number()})}),sze=["1-day","3-days","7-days","1-month","6-months","more-than-6-months"];var aze=n.Array(n.Object({bucket:n.Enum(sze),count:n.Number()})),yEr=x({tags:["retention-policies"],url:`${Ua}/requested-history-histogram/:teamId`,method:"POST",params:n.Object({teamId:f()}),body:n.Object({observationWindow:n.Enum(yT),dataSource:n.Enum(ya)}),response:n.Object({observationWindow:n.Enum(yT),dataSource:n.Enum(ya),teamId:n.String(),histogram:aze})}),EEr=x({tags:["retention-policies"],url:`${Ua}/top-teams-with-retention-surplus`,method:"POST",body:n.Object({dataSource:n.Enum(ya),observationWindow:n.Enum(yT),percentile:n.Number({minimum:0,maximum:1}),topN:n.Optional(n.Number({minimum:1,maximum:20}))}),response:n.Array(n.Object({teamId:n.String(),retentionSurplusDays:n.Number()}))});var ET=`/${"v1"}/retention-policies`,ST=n.Pick(zc,["id","env","teamId","dataSource","durationDays","isEnabled"],{$id:"RetentionPolicy",description:"Retention rule for logs, metrics, or traces. Policies can apply globally, to an environment, or to a team depending on which scope fields are present. See [Retention](/documentation/account-and-settings/retention)."}),cze={id:"123-456-abc",env:"production",teamId:"team-123-abc",dataSource:"logs",durationDays:30,isEnabled:!0};Object.assign(ST,{examples:[cze]});var _le=x({description:"Lists retention policy rows visible to the authenticated operation key. Use this to audit retention duration by signal, environment, and team.",operationId:"listRetentionPolicies",tags:["retention-policies"],url:ET,method:"GET",response:n.Array(ST)}),Ale=x({description:"Retrieves one retention policy by ID.",operationId:"getRetentionPolicy",tags:["retention-policies"],url:`${ET}/:id`,method:"GET",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the retention policy to retrieve. Use the `id` returned by retention policy list or create responses."})}),response:ST}),QF=n.Pick(XC,["env","teamId","dataSource","durationDays","isEnabled"],{description:"Retention policy create or update request. Provide the telemetry signal, retention duration, enabled state, and optional environment or team scope."}),lze={env:"production",teamId:"team-123-abc",dataSource:"logs",durationDays:30,isEnabled:!0};Object.assign(QF,{examples:[lze]});var Ole=x({description:"Creates a retention policy row for a telemetry signal, optionally scoped to an environment or team. Only one policy may exist per combination of data source, environment, and team; creating a duplicate combination fails.",operationId:"createRetentionPolicy",tags:["retention-policies"],url:ET,method:"POST",body:QF,response:ST}),Cle=x({description:"Replaces an existing retention policy by ID, including signal, scope fields, duration, and enabled state.",operationId:"updateRetentionPolicy",tags:["retention-policies"],url:`${ET}/:id`,method:"PUT",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the retention policy to update. Use the `id` returned by retention policy list, get, or create responses."})}),body:QF,response:ST}),Rle=x({description:"Deletes a retention policy by ID. Retention resolution falls back to the next broader matching policy when one exists.",operationId:"deleteRetentionPolicy",tags:["retention-policies"],url:`${ET}/:id`,method:"DELETE",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the retention policy to delete. Use the `id` returned by retention policy list, create, or update responses."})}),response:ae});var Ple=_t({commandName:"retention-policies",description:"Manage retention policies",endpoints:{list:_le,get:Ale,create:Ole,update:Cle,delete:Rle}});var Yc="/v0/slos",uze=[7,30,90],pze=["good","bad"],Nle=n.Enum(pze,{description:"How to treat SLO with no data: good (count as meeting the SLO), bad (count as breaching it)"}),mze=["good","bad","ignore"],kle=n.Enum(mze,{description:"How to treat time buckets with no data: good (count as meeting the SLO), bad (count as breaching it), or ignore (exclude from the error budget)"}),wle=30,vle=1440,Lle=["greater_than","less_than","greater_than_or_equal","less_than_or_equal"],dze=["healthy","breached","no_data"],eR=n.Enum(dze,{description:"SLO status: healthy (meeting the target), breached (breaching it), or no_data (not evaluated yet)"}),Ule={sli:n.Optional(n.Number({description:"Service level indicator for the latest evaluation; absent when there is no data"})),errorBudget:n.Optional(n.Number({description:"Remaining error budget at the latest evaluation; negative when exhausted, absent when there is no data"})),status:eR},fze=n.Object({overall:n.Object(Ule,{description:"Latest overall evaluation for the cluster"}),perGroup:n.Array(n.Object({groupKey:n.Record(n.String(),eS,{description:"Group-by field values identifying this group, keyed by field name. Present only when the SLO configuration sets `groupByFields`."}),...Ule}),{description:"Latest evaluation for each group produced by the SLO configuration's `groupByFields`. Empty when the SLO is not grouped."})},{title:"SloClusterResults"}),Mle=n.Record(n.String(),fze,{description:"Latest evaluation results keyed by cluster ID."}),WF=n.Object({queries:Nc,formula:RO},{title:"SloQueryFormula",description:"Aggregation queries combined by a formula to produce the SLO signal. Tsuga evaluates this query formula during SLO evaluation and returns it as part of the saved SLO configuration. Returned queries include Tsuga-derived missing-point fill: event SLO queries use zero fill, and time SLO queries keep missing points null."}),JF=n.Object({queries:vZ,formula:zp},{title:"SloQueryFormula",description:"Aggregation queries combined by a formula to produce the SLO signal. Formulas reference queries as q1, q2, and so on. Do not send per-query fill; Tsuga derives the fill behavior from the SLO type."}),gze=n.Object({type:n.Literal("burn-rate",{description:"Alert configuration kind. Set to `burn-rate` for alerts that fire when the SLO consumes error budget faster than the configured multiplier."}),burnRate:n.Number({description:"Burn-rate multiplier that triggers this alert. The short and long evaluation windows are derived from the predefined template with the closest burn rate."})},{title:"BurnRateAlert"}),hze=n.Object({type:n.Literal("burn-rate",{description:"Alert configuration kind. Set to `burn-rate` for alerts that fire when the SLO consumes error budget faster than the configured multiplier."}),burnRate:n.Number({minimum:1,maximum:100,description:"Burn-rate multiplier that triggers this alert. Required for burn-rate alerts; valid input is 1 through 100. Non-template values are accepted; short and long evaluation windows are derived from the predefined template with the closest burn rate."})},{title:"BurnRateAlert"});var yze=n.Object({type:n.Literal("threshold",{description:"Alert configuration kind. Set to `threshold` for alerts that fire when the SLO indicator falls below a percentage threshold."}),threshold:n.Number({description:"SLI percentage threshold for this alert. The alert passes when SLI is at or above this value and fires when SLI is strictly below it."})},{title:"ThresholdAlert"}),Eze=n.Object({type:n.Literal("threshold",{description:"Alert configuration kind. Set to `threshold` for alerts that fire when the SLO indicator falls below a percentage threshold."}),threshold:n.Number({exclusiveMinimum:0,exclusiveMaximum:100,description:"SLI percentage threshold for this alert. Required for threshold alerts; valid input is greater than 0 and less than 100. The alert passes when SLI is at or above this value and fires when SLI is strictly below it."})},{title:"ThresholdAlert"}),Sze=Q("type",[gze,yze],{description:"Alert trigger configuration: burn-rate or threshold"}),Dle=Q("type",[hze,Eze],{description:"Alert trigger configuration: burn-rate or threshold"}),ZF=n.Enum(To,{description:"Alert priority (1 is highest, 5 is lowest)"}),XF=n.Object({id:n.String({description:"Tsuga-generated SLO alert ID assigned when the alert is created."}),sloId:n.String({description:"Parent SLO ID for this alert."}),priority:ZF,configuration:Sze,createdAt:H({description:"Timestamp when Tsuga created the alert."}),updatedAt:H({description:"Timestamp when Tsuga last updated the alert."}),assetUpdatedAt:H({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})},{title:"SloAlert"}),Tze=n.Object({priority:ZF,configuration:Dle}),bze=n.Object({id:n.Optional(f({allowEmpty:!1,description:"Identifier of an existing alert to update. Omit to create a new alert on this SLO."})),priority:ZF,configuration:Dle}),xze=Q("type",[n.Object({type:n.Literal("event",{description:"Configuration kind. Set to `event` for SLOs that compute SLI from good and total query formulas over the rolling timeframe."}),dataSource:Ai,goodQuery:WF,totalQuery:WF,groupByFields:n.Optional(Rf),noDataBehavior:Nle},{title:"EventSloConfiguration"}),n.Object({type:n.Literal("time",{description:"Configuration kind. Set to `time` for SLOs that evaluate a query against a threshold in fixed-size time slices."}),dataSource:Ai,query:WF,sliceSizeMinutes:n.Integer({description:"Length of each time-SLO evaluation slice in minutes. Required for `type: time`."}),threshold:n.Object({operator:n.Enum(Lle,{description:"Comparison operator between the query value and the threshold"}),value:n.Number({description:"Threshold value compared against the query signal"})},{description:"Threshold comparison applied to each time-SLO evaluation slice"}),groupByFields:n.Optional(Rf),noDataBehavior:kle},{title:"TimeSliceSloConfiguration"})],{description:"SLI configuration for this SLO. Use `event` for good/total event-ratio SLOs or `time` for thresholded time-slice SLOs."}),Ize=Q("type",[n.Object({type:n.Literal("event",{description:"Configuration kind. Set to `event` for SLOs that compute SLI from good and total query formulas over the rolling timeframe."}),dataSource:Ai,goodQuery:JF,totalQuery:JF,groupByFields:n.Optional(kc),noDataBehavior:Nle},{title:"EventSloConfiguration"}),n.Object({type:n.Literal("time",{description:"Configuration kind. Set to `time` for SLOs that evaluate a query against a threshold in fixed-size time slices."}),dataSource:Ai,query:JF,sliceSizeMinutes:n.Integer({minimum:wle,maximum:vle,description:`Length of each time-SLO evaluation slice in minutes. Required for \`type: time\`. Valid input is ${wle} through ${vle}.`}),threshold:n.Object({operator:n.Enum(Lle,{description:"Comparison operator between the query value and the threshold"}),value:n.Number({description:"Threshold value compared against the query signal"})},{description:"Threshold comparison applied to each time-SLO evaluation slice"}),groupByFields:n.Optional(kc),noDataBehavior:kle},{title:"TimeSliceSloConfiguration"})],{description:"SLI configuration for this SLO. Use `event` for good/total event-ratio SLOs or `time` for thresholded time-slice SLOs."}),_ze=n.Number({exclusiveMinimum:0,exclusiveMaximum:100,description:"Target percentage (0 < target < 100, e.g. 99.9)"}),Fle=n.Enum(uze,{type:"integer",description:"Rolling SLO evaluation window in days. Set by the caller on create or update and returned on read and list responses. Allowed values are 7, 30, and 90."}),Aze=n.Array(n.String(),{description:"Cluster IDs this SLO is evaluated on. Omit or send an empty array on input to run on all clusters; responses use an empty array to mean all clusters. Non-empty input values must reference existing clusters."}),Oze=n.Array(f({allowEmpty:!1}),{description:"Cluster IDs this SLO is evaluated on. Omit or send an empty array on input to run on all clusters; responses use an empty array to mean all clusters. Non-empty input values must reference existing clusters."}),Cg=n.Object({id:n.String({description:"Tsuga-generated SLO ID assigned when the SLO is created."}),name:n.String({description:"Display name of the SLO, set by the caller."}),description:n.Optional(n.String({description:"Free-form, caller-provided description of what the SLO measures. Absent when not set."})),tags:br,configuration:xze,target:n.Number({description:"Target percentage (0 < target < 100, e.g. 99.9)"}),timeframeDays:Fle,owner:n.String({description:"Team ID that owns the SLO"}),permissions:As,clusterIds:Aze,creator:n.Optional(Qe),updater:n.Optional(Qe),alerts:n.Array(XF,{description:"Alerts attached to this SLO"}),createdAt:H({description:"Timestamp when Tsuga created the SLO."}),updatedAt:H({description:"Timestamp when Tsuga last updated the SLO."}),assetUpdatedAt:H({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})},{title:"Slo"}),Cze=n.Object({...Cg.properties,results:Mle},{title:"SloWithResults"}),tR=n.Object({name:f({allowEmpty:!1,description:"Display name of the SLO."}),description:Ut(f({type:"long"}),{description:"Free-form, caller-provided description of what the SLO measures. Optional."}),tags:wr,configuration:Ize,target:_ze,timeframeDays:Fle,owner:f({allowEmpty:!1,description:"Team ID that owns the SLO"}),permissions:As,clusterIds:n.Optional(Oze),alerts:n.Array(Tze,{description:"Alerts to create on this SLO. Send an empty array for none."})}),e1=n.Object({...n.Omit(tR,["alerts"]).properties,alerts:n.Array(bze,{description:"Alerts attached to this SLO. The SLO owns its alerts: the set is reconciled to exactly this list \u2014 existing alerts are matched by id, alerts without an id are created, and existing alerts absent from the list are deleted. Send an empty array to clear all alerts."})}),$le=n.Object({owners:qe(f({allowEmpty:!1}),{description:"Restrict results to SLOs owned by any of these team IDs",maxItems:50}),searchQuery:ko({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:qe(Fn.items,{description:"Restrict results to SLOs that have at least one of the listed key/value tags",maxItems:50}),clusterIds:qe(f({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:qe(eR,{description:"Restrict results to SLOs whose status is one of these values",maxItems:3})},{description:"Optional filters applied to narrow the returned SLOs"}),t1=n.Partial($le),Rze=["name","owner","tags","updatedAt","sli","errorBudget","status"],r1=n.Partial(n.Object({...je,filters:t1,sort:n.Object({by:n.Enum(Rze,{description:"Field to sort by"}),direction:Le},{description:"Optional sorting applied to the returned SLOs"})})),GEr=x({tags:["slos"],url:`${Yc}/query`,method:"POST",paginated:!0,response:n.Array(Cze),body:r1}),BEr=x({tags:["slos"],url:`${Yc}/tags/query`,method:"POST",body:n.Object({filters:n.Optional(n.Partial(n.Omit($le,["tags","statuses"])))}),response:Dn}),qEr=x({tags:["slos"],url:`${Yc}/:id`,method:"GET",params:n.Object({id:f()}),response:Cg}),jEr=x({tags:["slos"],url:`${Yc}/:id/results`,method:"GET",params:n.Object({id:f()}),response:Mle}),HEr=x({tags:["slos"],url:Yc,method:"POST",body:tR,response:Cg}),KEr=x({tags:["slos"],url:`${Yc}/:id`,method:"PUT",params:n.Object({id:f()}),body:e1,response:Cg}),zEr=x({tags:["slos"],url:`${Yc}/:id`,method:"DELETE",params:n.Object({id:f()}),response:ae}),Pze=_i(t1),YEr=x({tags:["slos"],url:`${Yc}/bulk-delete`,method:"DELETE",body:n.Object({selection:Pze}),response:n.Object({})}),wze=_i(t1,{maxIds:100}),VEr=x({tags:["slos"],url:`${Yc}/bulk-update`,method:"PUT",body:n.Object({selection:wze,owner:f({allowEmpty:!1})}),response:n.Object({})});var oi="/v0/service-catalog",vze=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."}),lastSeenAt:H({description:"Most recent time this team was observed for the service. Tsuga sets it from telemetry timestamps during service metadata refreshes."})},{description:"A team name observed on telemetry for this service, with the last time it was seen."}),Uze=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:H({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."}),Nze=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:H({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:H({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."}),kze=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:H({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."}),Lze=n.Object({runtime:n.String({description:"Runtime observed for this service. The emitting service or OpenTelemetry instrumentation sets it through telemetry metadata. Returned when runtime metadata is available for the service."}),lastSeenAt:H({description:"Most recent time this runtime was observed. Tsuga sets it from telemetry timestamps during service metadata refreshes."})},{description:"A runtime observed for this service, with the last time it was seen."}),Gle=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:H({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."}),Mze=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:H({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."}),Dze=n.Object({platform:n.String({description:"Observed cloud or orchestration platform, such as `aws_eks` or `kubernetes`. The emitting service or collector sets it through telemetry resource attributes. Returned when platform metadata is available for the service."}),lastSeenAt:H({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."}),Fze=n.Object({provider:n.String({description:"Observed cloud provider, such as `aws`, `gcp`, or `azure`. The emitting service or collector sets it through telemetry resource attributes. Returned when provider metadata is available for the service."}),lastSeenAt:H({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."}),Rg=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:rT.properties.config,rateLimit:rT.properties.rateLimit,createdAt:H({description:"Timestamp when the service notification target was created. Tsuga sets this value and returns it on private service-catalog responses."}),updatedAt:H({description:"Timestamp when the service notification target was last updated. Tsuga sets this value and returns it on private service-catalog responses."})}),n1=n.Object({config:Ig.properties.config,rateLimit:Ig.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."}),o1=n.Object({config:Ig.properties.config,rateLimit:n.Union([MF,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."}),rR=n.Object({id:n.String({description:"Unique identifier of this service. Use it with service detail and graph endpoints."}),serviceName:n.String({description:"OpenTelemetry service name observed in telemetry."}),serviceNamespace:n.Optional(n.String({description:"OpenTelemetry service namespace observed in telemetry."})),env:n.String({description:"Environment value observed for this service."}),teams:n.Array(vze,{description:"Team names observed on telemetry for this service and when each was last seen."}),ingestionApiKeys:n.Array(Uze,{description:"Ingestion API keys observed on telemetry for this service and when each was last seen."}),versions:n.Array(Nze,{description:"Service version values observed in telemetry, including first and last seen timestamps."}),languages:n.Array(kze,{description:"Programming languages observed for this service."}),runtimes:n.Array(Lze,{description:"Runtime values observed for this service."}),serverProtocols:n.Array(Gle,{description:"API protocols this service exposes (from server-kind spans)"}),clientProtocols:n.Array(Gle,{description:"API protocols this service calls out over (from client-kind spans)"}),frameworks:n.Array(Mze,{description:"Application frameworks detected from OTel instrumentation scope"}),cloudPlatforms:n.Array(Dze,{description:"Cloud platforms this service is running on"}),cloudProviders:n.Array(Fze,{description:"Cloud providers this service is running on"}),lastSeenAt:H({description:"Most recent time Tsuga observed telemetry for this service."}),firstSeenAt:H({description:"First time Tsuga observed telemetry for this service."}),additionalUserFields:n.Optional(n.Unsafe({type:"object",additionalProperties:!0,description:"Additional user-defined service metadata, when configured."})),traceRequestRate:n.Optional(n.Number({description:"Requests per second observed for this service over the queried window, counting calls of its primary 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 over the queried window that ended with error status. Omitted when the trace query failed."})),notificationTargets:n.Array(Rg,{description:"Notification targets attached to this service, used by adaptive notification rules to page its owners."}),createdAt:H({description:"Timestamp when Tsuga created this service catalog entry."}),updatedAt:H({description:"Timestamp when Tsuga last updated this service catalog entry."})}),$ze=n.Object({spanKind:n.Enum(QZ),count:n.Number()}),i1=n.Object({...rR.properties,spanKindCounts:n.Array($ze),envs:n.Array(n.String())}),iSr=x({tags:["service-catalog"],query:n.Object({...je,clusterId:n.Optional(f()),env:n.Optional(f())}),method:"GET",paginated:!0,url:`${oi}/services`,response:n.Array(i1)}),Gze=["serviceName","env","lastDeploy","traceErrorRate","traceRequestRate","teams","api","frameworks","languages","pagingDestination"],Bze=n.Object({searchQuery:n.Object({value:f({allowEmpty:!1,description:"Substring matched case-insensitively against service names."})},{description:"Text filter for service names."}),teams:qe(f({allowEmpty:!1}),{description:"Restrict results to services observed under any of these team names",maxItems:50}),envs:qe(f({allowEmpty:!1}),{description:"Restrict results to services observed in any of these environments",maxItems:50}),versions:qe(f({allowEmpty:!1}),{description:"Restrict results to services whose latest observed version is one of these",maxItems:50}),languages:qe(f({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"})}),qze=["1h","4h","24h"];var jze=n.Partial(n.Object({...je,clusterId:f(),filters:n.Partial(Bze,{description:"Optional filters applied to narrow the returned services"}),sort:n.Object({by:n.Enum(Gze,{description:"Field to sort the returned services by"}),direction:Le},{description:"Optional sorting applied to the returned services"}),statsWindow:n.Enum(qze,{description:"Lookback used 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`."})})),sSr=x({tags:["service-catalog"],url:`${oi}/v2/services/query`,method:"POST",paginated:!0,body:jze,response:n.Array(i1)}),aSr=x({tags:["service-catalog"],query:n.Object({serviceName:f({allowEmpty:!1}),serviceNamespace:n.Optional(f({allowEmpty:!1})),env:f({allowEmpty:!1}),clusterId:n.Optional(f())}),method:"GET",url:`${oi}/v2/service`,response:i1}),cSr=x({tags:["service-catalog"],query:n.Object({serviceName:f({allowEmpty:!1}),serviceNamespace:n.Optional(f({allowEmpty:!1})),clusterId:n.Optional(f())}),method:"GET",url:`${oi}/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."})}),lSr=x({tags:["service-catalog"],method:"GET",url:`${oi}/services/:serviceId`,params:n.Object({serviceId:f()}),response:rR}),uSr=x({tags:["service-catalog"],method:"GET",url:`${oi}/services/:serviceId/targets`,params:n.Object({serviceId:f()}),response:n.Array(Rg)}),pSr=x({tags:["service-catalog"],method:"POST",url:`${oi}/services/:serviceId/targets`,params:n.Object({serviceId:f()}),body:n1,response:Rg}),mSr=x({tags:["service-catalog"],method:"PUT",url:`${oi}/services/:serviceId/targets/:targetId`,params:n.Object({serviceId:f(),targetId:f()}),body:o1,response:Rg}),dSr=x({tags:["service-catalog"],method:"DELETE",url:`${oi}/services/:serviceId/targets/:targetId`,params:n.Object({serviceId:f(),targetId:f()}),response:ae}),Hze=["otel_kube","otel_host_kube","otel_host","prometheus","aws_ec2","gcp_compute_engine"];var Ble=n.Object({id:n.String(),hostName:n.String(),env:n.Optional(n.String()),cpuUtilizationAverage:n.Number(),hostType:n.Enum(Hze),teams:n.Array(n.String()),tags:n.Array(n.String()),firstSeenAt:H(),lastSeenAt:H(),clusterId:n.String()}),fSr=x({tags:["service-catalog"],method:"GET",url:`${oi}/hosts`,response:n.Array(Ble)}),gSr=x({tags:["service-catalog"],method:"GET",url:`${oi}/hosts/:hostId`,params:n.Object({hostId:f()}),response:Ble}),Kze=["http","rpc","messaging","genai","object_store"],qle={name:n.String({description:"Service or inferred dependency name shown in the graph."}),env:n.Optional(n.String({description:"Environment observed from spans."}))},s1=n.Object({...qle,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."})}),jle={...qle,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"}))},a1=n.Object({...jle,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`."})}),c1=n.Object({...jle,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(Kze,{description:"Inferred dependency type from span metadata: http, rpc, messaging, genai, or object_store."})}),zze=Q("nodeType",[s1,a1,c1]),l1=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."}),hSr=x({tags:["service-catalog"],url:`${oi}/services/:serviceId/graph`,method:"GET",params:n.Object({serviceId:f()}),query:n.Object({...Lr.properties,query:n.Optional(f({type:"tsuga-query"}))}),response:n.Object({clusterId:n.String(),nodes:n.Array(zze),edges:n.Array(l1)})}),Yze=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(To,{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(eR,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"})}))}),ySr=x({tags:["service-catalog"],method:"GET",url:`${oi}/services/:serviceId/related-resources`,params:n.Object({serviceId:f()}),response:Yze}),ESr=x({tags:["service-catalog"],method:"GET",url:`${oi}/services/by-api-keys`,response:n.Record(n.String(),n.Array(n.Object({serviceName:n.String(),serviceNamespace:n.Optional(n.String())})))});var nR=`/${"v1"}/services`,u1=n.Pick(rR,["id","serviceName","serviceNamespace","env","teams","versions","languages","runtimes","serverProtocols","clientProtocols","frameworks","cloudPlatforms","cloudProviders","lastSeenAt","firstSeenAt","traceRequestRate","traceErrorRate"],{$id:"Service",description:"Service inferred from telemetry, with observed metadata, activity counts, and version signals. See [Services](/documentation/categorize/services/index)."}),Vze={id:"123-456-abc",serviceName:"api-gateway",serviceNamespace:"platform",env:"production",teams:[{team:"platform",lastSeenAt:"2024-01-15T12:34:56.000Z"}],versions:[{version:"1.2.3",firstSeenAt:"2024-01-01T08:00:00.000Z",lastSeenAt:"2024-01-15T12:34:56.000Z",faulty:!0,faultyLatency:!0}],languages:[{language:"go",lastSeenAt:"2024-01-15T12:34:56.000Z"}],runtimes:[{runtime:"go",lastSeenAt:"2024-01-15T12:34:56.000Z"}],serverProtocols:[{protocol:"http",lastSeenAt:"2024-01-15T12:34:56.000Z"}],clientProtocols:[{protocol:"grpc",lastSeenAt:"2024-01-15T12:34:56.000Z"}],frameworks:[{framework:"gin",lastSeenAt:"2024-01-15T12:34:56.000Z"}],cloudPlatforms:[{platform:"aws_eks",lastSeenAt:"2024-01-15T12:34:56.000Z"},{platform:"kubernetes",lastSeenAt:"2024-01-15T12:34:56.000Z"}],cloudProviders:[{provider:"aws",lastSeenAt:"2024-01-15T12:34:56.000Z"}],lastSeenAt:"2024-01-15T12:34:56.000Z",firstSeenAt:"2024-01-01T08:00:00.000Z",traceRequestRate:2.36,traceErrorRate:8.2};Object.assign(u1,{examples:[Vze]});var Hle=x({description:"Lists services inferred from telemetry. Use this endpoint to inventory service ownership, environments, versions, runtimes, and recent activity. Pagination fields limit the returned page.",operationId:"listServices",tags:["services"],url:nR,method:"GET",paginated:!0,query:n.Object({...er,clusterId:n.Optional(f({allowEmpty:!1,description:"Telemetry cluster to target. Omit to use the first cluster in the organization; this does not query all clusters."})),env:n.Optional(f({allowEmpty:!1,description:"Environment to restrict the listing to. Services not observed in it are omitted. Omit to return one row per environment each service was observed in, so a service live in several environments returns several rows."}))},{description:"Service list query. Use pagination and optional cluster and environment scope."}),response:n.Array(u1)}),Kle=x({description:"Retrieves one telemetry-inferred service by service ID.",operationId:"getService",tags:["services"],url:`${nR}/:serviceId`,method:"GET",params:n.Object({serviceId:f({allowEmpty:!1,description:"Identifier of the service to retrieve. Use the `id` returned by service list responses."})}),response:u1}),Qze=n.Pick(s1,["name","env","nodeType","id","namespace","errorRate","entryErrorRequestCount","entryRequestCount"],{$id:"ObservedServiceGraphNode",description:"Service graph node matched to a service catalog entry by name and env. `id`/`namespace` are null when multiple namespaces share the observed service name."}),Wze=n.Pick(c1,["name","env","nodeType","serviceType","endpoint","resourceName"],{$id:"InferredServiceGraphNode",description:"Dependency node detected from client-span attributes (e.g. a queue or external HTTP call) that could not be matched to a service catalog entry. Database dependencies use the `inferred_db` variant."}),Jze=n.Pick(a1,["name","env","nodeType","serviceType","endpoint","resourceName"],{$id:"InferredDbServiceGraphNode",description:"Database dependency node detected from client-span attributes that could not be matched to a service catalog entry."}),Zze=Q("nodeType",[Qze,Jze,Wze]),Xze=n.Pick(l1,["from","to","count","errorRate","errorCount","clientSpanCount"],{$id:"ServiceGraphEdge",description:"Directed dependency edge from a caller node (`from`) to a callee node (`to`), with call-volume and error counts observed over the query window."}),e4e=n.Optional(n.Integer({...Lr.properties.from,description:"Start of the service graph query window as a Unix timestamp in seconds. Provide both `from` and `to` for a deterministic graph window; otherwise Tsuga uses backend graph defaults."})),t4e=n.Optional(n.Integer({...Lr.properties.to,description:"End of the service graph query window as a Unix timestamp in seconds. Provide both `from` and `to` for a deterministic graph window; otherwise Tsuga uses backend graph defaults."})),r4e=f({type:"tsuga-query",default:"*",description:"Tsuga query used to filter spans considered for the graph. Defaults to `*`, which applies no additional filter beyond the service identity."}),zle=x({description:"Retrieves a dependency graph for one service over an optional time range and query filter. Provide an explicit time range for deterministic results. Use this to inspect observed downstream and upstream service relationships. See [Service page](/documentation/categorize/services/service-page).",operationId:"getServiceGraph",tags:["services"],url:`${nR}/:serviceId/graph`,method:"GET",params:n.Object({serviceId:f({allowEmpty:!1,description:"Identifier of the service to use as the graph root. Use the `id` returned by service list or get responses."})}),query:n.Object({from:e4e,to:t4e,query:n.Optional(r4e)},{description:"Service graph query. Use time range and optional span query filters."}),response:n.Object({clusterId:n.String({description:"Cluster ID the graph was built from"}),nodes:n.Array(Zze,{description:"Observed and inferred nodes included in the service dependency graph."}),edges:n.Array(Xze,{description:"Directed dependency edges between graph nodes."})})}),oR=`${nR}/:serviceId/notification-targets`,iR=n.Pick(Rg,["id","serviceId","config","rateLimit"],{$id:"ServiceNotificationTarget",description:"Notification target attached to a service, used by adaptive notification rules to page the service owners. See [Rules](/documentation/alert/notifications/rules)."}),p1={rateLimit:{maxMessages:10,minutes:5},config:{type:"email",addresses:["oncall@example.com"],renotifyConfig:{mode:"each",renotificationStates:["alert"],renotifyIntervalMinutes:30}}},n4e={id:"789-abc-def",serviceId:"123-456-abc",...p1};Object.assign(iR,{examples:[n4e]});var sR=f({allowEmpty:!1,description:"Identifier of the service the notification target belongs to. Use the `id` returned by service list or get responses."}),CSr=x({description:"Lists the notification targets attached to one service. Use this to discover target IDs before updating or deleting a target.",operationId:"listServiceNotificationTargets",tags:["services"],url:oR,method:"GET",params:n.Object({serviceId:sR}),response:n.Array(iR)}),o4e=n.Pick(n1,["config","rateLimit"],{description:"Service notification target create request. Provide the delivery destination and an optional per-target rate limit.",examples:[p1]}),i4e=n.Pick(o1,["config","rateLimit"],{description:"Service notification target update request. The submitted destination and rate limit overwrite the stored ones.",examples:[p1]}),RSr=x({description:"Attaches a notification target to a service. Adaptive notification rules matching the service page this target on alert transitions.",operationId:"createServiceNotificationTarget",tags:["services"],url:oR,method:"POST",params:n.Object({serviceId:sR}),body:o4e,response:iR}),PSr=x({description:"Updates one notification target attached to a service.",operationId:"updateServiceNotificationTarget",tags:["services"],url:`${oR}/:targetId`,method:"PUT",params:n.Object({serviceId:sR,targetId:f({allowEmpty:!1,description:"Identifier of the notification target to update. Use the `id` returned by service notification target list or create responses."})}),body:i4e,response:iR}),wSr=x({description:"Detaches a notification target from a service. Notification rules stop paging this destination for the service.",operationId:"deleteServiceNotificationTarget",tags:["services"],url:`${oR}/:targetId`,method:"DELETE",params:n.Object({serviceId:sR,targetId:f({allowEmpty:!1,description:"Identifier of the notification target to delete. Use the `id` returned by service notification target list or create responses."})}),response:ae});var Yle=_t({commandName:"services",description:"List and inspect services (read-only; services are inferred from telemetry)",endpoints:{list:Hle,get:Kle}});var TT=`/${"v1"}/slos`,s4e=n.Pick(XF,["id","sloId","priority","configuration"],{$id:"SloAlert",description:"Alert attached to an SLO, triggered on a burn-rate multiplier or an SLO target threshold"}),bT=n.Object({...n.Pick(Cg,["id","name","description","tags","configuration","target","timeframeDays","owner","permissions","clusterIds"]).properties,alerts:n.Array(s4e,{description:"Alerts attached to this SLO"})},{$id:"Slo",description:"Service Level Objective definition: its SLI configuration, target percentage, rolling timeframe, cluster scope, and attached alerts"}),a4e={id:"123-456-abc",name:"API availability 99.9%",description:"Overall API gateway availability over the last 30 days",tags:[{key:"team",value:"platform"}],configuration:{type:"event",dataSource:"logs",goodQuery:{queries:[{filter:"status:ok",aggregate:{type:"count"}}],formula:"q1"},totalQuery:{queries:[{filter:"*",aggregate:{type:"count"}}],formula:"q1"},noDataBehavior:"good"},target:99.9,timeframeDays:30,owner:"team-123-abc",permissions:"all",clusterIds:[],alerts:[{id:"alert-123-abc",sloId:"123-456-abc",priority:1,configuration:{type:"burn-rate",burnRate:14.4}}]};Object.assign(bT,{examples:[a4e]});var Vle=n.Pick(r1,["filters","sort","limit","offset"]),Qle=n.Object({...Vle.properties,...er,filters:Vle.properties.filters},{description:"SLO query request. Use filters, sorting, limit, and offset to page through visible SLOs."}),c4e={filters:{owners:{values:["team-123-abc"]},searchQuery:{value:"availability"},tags:{values:[{key:"team",value:"platform"}]},statuses:{values:["breached"]},clusterIds:{values:["cluster-123-abc"]}},sort:{by:"name",direction:"asc"},limit:10,offset:0};Object.assign(Qle,{examples:[c4e]});var Wle=x({description:"Queries SLOs visible to the authenticated operation key. Use this endpoint to inventory SLO definitions, filter by owner, tag, status, or cluster, and page through results.",operationId:"querySlos",tags:["slos"],url:`${TT}/query`,method:"POST",paginated:!0,body:Qle,response:n.Array(bT)}),Jle=x({description:"Retrieves one SLO definition by ID.",operationId:"getSlo",tags:["slos"],url:`${TT}/:id`,method:"GET",params:n.Object({id:f({allowEmpty:!1,description:"SLO ID returned by SLO query, create, or update operations."})}),response:bT}),Zle=["name","description","tags","configuration","target","timeframeDays","owner","permissions","clusterIds","alerts"],Xle=n.Pick(tR,Zle,{$id:"CreateSloRequest",description:"SLO creation request. Provide ownership, data access, SLI configuration, target, timeframe, optional cluster scope, and the alerts to create."}),eue=n.Pick(e1,Zle,{$id:"UpdateSloRequest",description:"SLO update request. Send all required SLO fields and the full alert list. Alerts are reconciled to exactly the provided list: alerts with a known id are updated, alerts without an id are created, and existing alerts absent from the list are deleted. Omit `clusterIds` to preserve the current cluster scope; send an empty array to run on all clusters."}),tue={name:"API availability 99.9%",description:"Overall API gateway availability over the last 30 days",tags:[{key:"team",value:"platform"}],configuration:{type:"event",dataSource:"logs",goodQuery:{queries:[{filter:"status:ok",aggregate:{type:"count"}}],formula:"q1"},totalQuery:{queries:[{filter:"*",aggregate:{type:"count"}}],formula:"q1"},noDataBehavior:"good"},target:99.9,timeframeDays:30,owner:"team-123-abc",permissions:"all",clusterIds:[],alerts:[{priority:1,configuration:{type:"burn-rate",burnRate:14.4}}]};Object.assign(Xle,{examples:[tue]});Object.assign(eue,{examples:[tue]});var rue=x({description:"Creates an SLO owned by the specified team. The SLO can be event-based (good/total queries) or time-based (a thresholded query over evaluation slices) depending on its configuration.",operationId:"createSlo",tags:["slos"],url:TT,method:"POST",body:Xle,response:bT}),nue=x({description:"Replaces an existing SLO definition by ID. Send the full SLO input shape, including configuration, ownership, permissions, cluster scope, and the reconciled alert list. Changing configuration, target, timeframe, permissions, or cluster scope resets the evaluation state of every alert on the SLO, so each alert ignores the transitions it recorded before the update. The SLO status and error budget are recomputed from the telemetry in the rolling window and are not cleared by an update.",operationId:"updateSlo",tags:["slos"],url:`${TT}/:id`,method:"PUT",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the SLO to update. Use the `id` returned by SLO query or create."})}),body:eue,response:bT}),oue=x({description:"Deletes an SLO by ID. Deleting an SLO stops future evaluations and removes its attached alerts.",operationId:"deleteSlo",tags:["slos"],url:`${TT}/:id`,method:"DELETE",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the SLO to delete. Use the `id` returned by SLO query or create."})}),response:ae});var iue=_t({commandName:"slos",description:"Manage SLOs",singularOverride:"SLO",pluralOverride:"SLOs",endpoints:{list:Wle,get:Jle,create:rue,update:nue,delete:oue},enableListBody:!0});var Vc=`${hT}/tag-policies`;var l4e=["logs","metrics","traces"],m1=n.Array(n.Enum(l4e,{description:"Telemetry signal covered by a data tag policy."}),{description:"Telemetry signals covered by the policy. An empty array means logs, metrics, and traces."}),sue=n.Union([hO.items,m1.items]),u4e=n.Object({teamIds:n.Array(n.String(),{description:"Team IDs used by this policy scope."}),mode:n.Enum(["include","exclude"],{description:"`include` applies the policy only to listed teams. `exclude` applies it to all teams except the listed teams."})},{description:"Team scope that limits where this policy applies. Omitted means the policy applies to all teams."}),p4e=Q("type",[n.Object({type:n.Literal("telemetry",{description:"Policy applies to telemetry data points during ingestion or evaluation."}),assetTypes:m1,shouldInsertWarning:n.Boolean({description:"When true, Tsuga annotates non-compliant telemetry with tag policy warnings instead of only measuring violations."}),dropSample:n.Optional(n.Number({description:"Percentage of non-compliant telemetry datapoints to drop. Omitted means no sampling drop is configured."}))},{title:"TelemetryTagPolicy"}),n.Object({type:n.Literal("tsuga_asset",{description:"Policy applies to Tsuga-managed resources such as dashboards, routes, and keys."}),assetTypes:hO},{title:"TsugaAssetTagPolicy"})]),m4e=Q("type",[n.Object({type:n.Literal("telemetry",{description:"Policy applies to telemetry data points during ingestion or evaluation."}),assetTypes:m1,shouldInsertWarning:n.Boolean({description:"When true, Tsuga annotates non-compliant telemetry with tag policy warnings instead of only measuring violations."}),dropSample:n.Optional(n.Number({minimum:0,maximum:100,description:"Percentage of non-compliant telemetry datapoints to drop. Valid values are 0 through 100."}))},{title:"TelemetryTagPolicy"}),n.Object({type:n.Literal("tsuga_asset",{description:"Policy applies to Tsuga-managed resources such as dashboards, routes, and keys."}),assetTypes:hO},{title:"TsugaAssetTagPolicy"})]),aue="Policy surface and enforcement behavior. Use `telemetry` for telemetry data or `tsuga_asset` for Tsuga-managed resources.",d4e=n.Unsafe({...p4e,description:aue}),f4e=n.Unsafe({...m4e,description:aue}),Tm=n.Object({id:n.String({description:"Tsuga-generated tag policy ID assigned when the policy is created."}),name:n.String({description:"Human-readable tag policy name."}),description:n.Optional(n.String({description:"Optional user-provided policy description."})),isActive:n.Boolean({description:"Whether Tsuga currently evaluates this policy. Reserved policies (for example the built-in `env` policy on ingestion API keys) cannot be set to false."}),tagKey:n.String({description:"Tag key enforced by this policy."}),allowedTagValues:n.Array(n.String(),{description:"Allowed values for `tagKey`. An empty array means any value is accepted when the tag exists."}),isRequired:n.Boolean({description:"Whether the tag must be present. If false, `allowedTagValues` is still enforced when the tag exists. Reserved policies cannot be set to false."}),teamScope:n.Optional(u4e),configuration:d4e,creator:n.Optional(Qe),updater:n.Optional(Qe),owner:n.Optional(n.String({description:"Team ID that owns and manages the policy."})),createdAt:H({description:"Timestamp when Tsuga created the tag policy."}),updatedAt:H({description:"Timestamp when Tsuga last updated the tag policy."}),assetUpdatedAt:H({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})});var xT=n.Object({name:f({description:"Human-readable tag policy name."}),description:Ut(f(),{description:"Optional policy description."}),isActive:n.Boolean({description:"Set to true for Tsuga to evaluate this policy. Reserved policies (for example the built-in `env` policy on ingestion API keys) reject a false value."}),tagKey:f({allowEmpty:!1,description:"Tag key enforced by this policy. Tsuga trims surrounding whitespace before storing the policy."}),allowedTagValues:n.Array(f({allowEmpty:!1}),{maxItems:1e3,description:"Allowed values for `tagKey`. Leave empty to allow any value when the tag exists. Tsuga trims each submitted value before storing the policy."}),isRequired:n.Boolean({description:"Set to true to require the tag. If false, allowed values still apply when the tag exists. Reserved policies reject a false value."}),teamScope:n.Optional(n.Object({teamIds:n.Array(f(),{minItems:1,maxItems:100,description:"Team IDs used by this policy scope."}),mode:n.Enum(["include","exclude"],{description:"`include` applies the policy only to listed teams. `exclude` applies it to all teams except the listed teams."})},{description:"Team scope to store for this policy. Omit this field to apply the policy to all teams."})),configuration:f4e,owner:f({allowEmpty:!1,description:"Team ID that will own and manage the policy."})}),g4e=["name","isActive","tagKey","allowedTagValues","updatedAt"],cue=n.Object({searchQuery:ko({description:"Search query filter for tag policies.",valueDescription:"Case-insensitive substring matched against policy name, tag key, and allowed tag values."}),teamIds:qe(f({allowEmpty:!1}),{description:"Restrict results to policies that apply to any of these team IDs. Policies with no team scope apply to every team, so they always match.",minItems:1,uniqueItems:!0}),assetTypes:qe(sue,{description:"Restrict results to policies covering any of these asset types. Policies with an empty `configuration.assetTypes` cover every asset type of their configuration type, so they match any requested value of that type.",minItems:1,uniqueItems:!0}),configurationType:n.Enum(["telemetry","tsuga_asset"],{description:"Restrict results to data policies (`telemetry`) or asset policies (`tsuga_asset`)."}),status:n.Enum(["active","inactive"],{description:"Restrict results to active or inactive policies."})},{description:"Optional filters applied to narrow the returned tag policies."}),h4e=n.Partial(n.Object({...je,filters:n.Partial(cue),sort:n.Object({by:n.Enum(g4e,{description:"Field to sort the returned tag policies by."}),direction:Le})})),ZSr=x({tags:["tag-policies"],url:`${Vc}/query`,method:"POST",paginated:!0,body:h4e,response:n.Array(Tm,{description:"Matching tag policies after they are filtered, sorted, and paginated."})}),y4e=n.Object({activeCounts:n.Object({totalCount:n.Integer({description:"Total number of matching policies regardless of whether they are active."}),active:n.Integer({description:"Number of matching policies that are active."}),inactive:n.Integer({description:"Number of matching policies that are inactive."})})}),E4e=n.Object({filters:n.Optional(n.Partial(n.Omit(cue,["status"]),{description:"Filters applied before collecting the active counts."}))}),XSr=x({tags:["tag-policies"],url:`${Vc}/active-counts/query`,method:"POST",body:E4e,response:y4e}),eTr=x({tags:["tag-policies"],url:Vc,method:"GET",query:n.Object({teamIds:n.Optional(n.Array(f(),{maxItems:100})),assetTypes:n.Optional(n.Array(sue)),searchQuery:n.Optional(f())}),response:n.Array(Tm)}),tTr=x({tags:["tag-policies"],url:`${Vc}/:id`,method:"GET",params:n.Object({id:f()}),response:Tm}),rTr=x({tags:["tag-policies"],url:Vc,method:"POST",body:xT,response:Tm}),nTr=x({tags:["tag-policies"],url:`${Vc}/:id`,method:"PUT",params:n.Object({id:f()}),body:xT,response:Tm}),oTr=x({tags:["tag-policies"],url:`${Vc}/:id`,method:"DELETE",params:n.Object({id:f()}),response:ae}),iTr=x({tags:["tag-policies"],url:`${hT}/applicable-tag-rules`,method:"GET",query:n.Object({assetType:n.Enum(JE),teamId:f()}),response:n.Array(n.Object({tagKey:n.String(),allowedTagValues:n.Array(n.String()),isRequired:n.Boolean(),tagPolicyId:n.String()}))}),lue=n.Object({total:n.Number(),totalNonCompliant:n.Number(),idsNonCompliant:n.Array(n.String())}),uue=n.Union([n.Literal("ingestion-api-key"),n.Literal("operation-api-key"),n.Literal("rum-public-token"),n.Literal("dashboard"),n.Literal("log-route"),n.Literal("metric-route"),n.Literal("monitor"),n.Literal("notification-rule"),n.Literal("notification-silence"),n.Literal("slo")]),S4e=n.Object({total:n.Number(),totalNonCompliant:n.Number(),byAssetType:n.Record(uue,lue)}),T4e=n.Omit(lue,["total"]),b4e=n.Object({totalNonCompliant:n.Number(),byAssetType:n.Record(uue,T4e)}),pue=n.Object({totals:S4e,byTeam:n.Record(n.String(),b4e)}),sTr=x({tags:["tag-policies"],url:`${Vc}/:id/stats`,method:"GET",params:n.Object({id:f()}),response:pue}),aTr=x({tags:["tag-policies"],url:`${Vc}/new-policy-stats`,method:"POST",body:xT,response:pue});var IT=`/${"v1"}/tag-policies`,mue={name:"Required Environment Tag",description:"Requires dashboards and monitors to declare an environment.",isActive:!0,tagKey:"environment",allowedTagValues:["production","staging"],isRequired:!0,teamScope:{teamIds:["team-123-abc"],mode:"include"},configuration:{type:"tsuga_asset",assetTypes:["dashboard","monitor"]},owner:"team-123-abc"},due={name:"Telemetry Environment Policy",description:"Warns when telemetry is missing a known deployment environment.",isActive:!0,tagKey:"deployment.environment.name",allowedTagValues:["production","staging","development"],isRequired:!0,configuration:{type:"telemetry",assetTypes:[],shouldInsertWarning:!0,dropSample:25},owner:"team-123-abc"},x4e={id:"123-456-abc",...mue},I4e={id:"456-789-def",...due},_T=n.Pick(Tm,["id","name","description","isActive","tagKey","allowedTagValues","isRequired","teamScope","configuration","owner"],{$id:"TagPolicy",description:"Policy that enforces tag requirements on Tsuga-managed assets or telemetry data. See [Tag policies](/documentation/account-and-settings/tag-policies)."}),_4e=x4e,A4e=I4e;Object.assign(_T,{examples:[_4e,A4e]});var d1=n.Pick(xT,["name","description","isActive","tagKey","allowedTagValues","isRequired","teamScope","configuration","owner"],{description:"Tag policy create or update request. Provide policy identity, owner, enforced tag key, allowed values, team scope, active state, and asset or telemetry configuration."}),O4e=mue,C4e=due;Object.assign(d1,{examples:[O4e,C4e]});var fue=x({description:"Lists tag policies visible to the authenticated operation key. Use this to audit required tags, allowed values, team scope, and whether each policy applies to assets or telemetry.",operationId:"listTagPolicies",tags:["tag-policies"],url:IT,method:"GET",response:n.Array(_T)}),gue=x({description:"Retrieves one tag policy by ID.",operationId:"getTagPolicy",tags:["tag-policies"],url:`${IT}/:id`,method:"GET",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the tag policy to retrieve. Use the `id` returned by tag policy list or create responses."})}),response:_T}),hue=x({description:"Creates a tag policy for Tsuga-managed assets or telemetry data. Use the configuration type to choose the policy surface.",operationId:"createTagPolicy",tags:["tag-policies"],url:IT,method:"POST",body:d1,response:_T}),yue=x({description:"Replaces an existing tag policy by ID, including scope, requiredness, allowed values, owner, active state, and configuration. Reserved policies (for example the built-in `env` policy on ingestion API keys) reject changes to `tagKey` and reject `isActive: false` or `isRequired: false`.",operationId:"updateTagPolicy",tags:["tag-policies"],url:`${IT}/:id`,method:"PUT",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the tag policy to update. Use the `id` returned by tag policy list, get, or create responses."})}),body:d1,response:_T}),Eue=x({description:"Deletes a tag policy by ID. Tsuga stops evaluating the policy after deletion. Reserved policies (for example the built-in `env` policy on ingestion API keys) cannot be deleted.",operationId:"deleteTagPolicy",tags:["tag-policies"],url:`${IT}/:id`,method:"DELETE",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the tag policy to delete. Use the `id` returned by tag policy list, create, or update responses."})}),response:ae});var Sue=_t({commandName:"tag-policies",description:"Manage tag policies",endpoints:{list:fue,get:gue,create:hue,update:yue,delete:Eue}});var AT=`/${"v1"}/teams`,OT=n.Pick(mu,["id","name","description","visibility","tags"],{$id:"Team",description:"Collection of users used to manage ownership, visibility, and access to team-owned Tsuga resources. See [Teams](/documentation/account-and-settings/teams)."}),R4e={id:"team-123-abc",name:"platform-engineering",visibility:"public",tags:[{key:"department",value:"engineering"}]};Object.assign(OT,{examples:[R4e]});var Tue=x({description:"Lists teams visible to the authenticated operation key. Use this endpoint to inventory owners for resources, dashboards, monitors, routes, and policies. Pagination fields limit the returned page.",operationId:"listTeams",tags:["teams"],url:AT,method:"GET",paginated:!0,query:n.Object(er),response:n.Array(OT)}),bue=x({description:"Retrieves one team by ID.",operationId:"getTeam",tags:["teams"],url:`${AT}/:id`,method:"GET",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the team to retrieve. Use the `id` returned by team list or create responses."})}),response:OT}),f1=n.Pick(IC,["name","description","visibility","tags"],{description:"Team create or update request. Provide the team name, optional description, visibility, and tags."}),P4e={name:"platform-engineering",visibility:"public",tags:[{key:"department",value:"engineering"}]};Object.assign(f1,{examples:[P4e]});var xue=x({description:"Creates a team for ownership and access control. Use this before assigning resources to a new owner team. A new team sits outside every existing team, so the operation key must be scoped to all teams: a key scoped to its owning team cannot create teams, even with write access to teams.",operationId:"createTeam",tags:["teams"],url:AT,method:"POST",body:f1,response:OT}),Iue=x({description:"Replaces a team definition by ID, including name, description, visibility, and tags.",operationId:"updateTeam",tags:["teams"],url:`${AT}/:id`,method:"PUT",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the team to update. Use the `id` returned by team list, get, or create responses."})}),body:f1,response:OT}),_ue=x({description:"Deletes a team. Fails while the team still owns resources (dashboards, monitors, routes, API keys, etc.); reassign or delete those first. Team memberships are removed automatically as part of the deletion.",operationId:"deleteTeam",tags:["teams"],url:`${AT}/:id`,method:"DELETE",params:n.Object({id:f({allowEmpty:!1,description:"Identifier of the team to delete. Use the `id` returned by team list, create, or update responses."})}),response:ae});var Aue=_t({commandName:"teams",description:"Manage teams",endpoints:{list:Tue,get:bue,create:xue,update:Iue,delete:_ue}});var Oue=[ase,hse,Vse,oae,uae,Pae,pce,vce,Fce,Wce,cle,Sle,Ple,Yle,iue,Sue,Aue];var g1={r:8,g:203,b:0},h1={r:0,g:130,b:0},y1=["\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2557 ","\u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557"," \u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551"," \u2588\u2588\u2551 \u255A\u2550\u2550\u2550\u2550\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2551"," \u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2551"," \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D"];function E1(e,t,r){return Math.round(e+(t-e)*r)}function w4e(e,t){let r=E1(g1.r,h1.r,t),o=E1(g1.g,h1.g,t),i=E1(g1.b,h1.b,t);return`\x1B[38;2;${r};${o};${i}m${e}\x1B[0m`}function v4e(e){if(!e)return`
|
|
269
269
|
|
|
270
270
|
${y1.join(`
|
|
271
271
|
`)}`;let t=y1.length-1;return`
|
|
@@ -273,7 +273,7 @@ ${y1.join(`
|
|
|
273
273
|
${y1.map((o,i)=>w4e(o,t===0?0:i/t)).join(`
|
|
274
274
|
`)}`}function Cue(){return v4e(process.stdout.isTTY&&!process.env.NO_COLOR)}var Rue=G("tsuga").pipe(B(`${Cue()}
|
|
275
275
|
|
|
276
|
-
Manage Tsuga resources, telemetry, and configuration from the command line`),AY({operationApiKey:st("operation-api-key").pipe(he("Operation API key (overrides config and TSUGA_OPERATION_API_KEY)"),Fe("OPERATION_API_KEY"),Rt),cluster:st("cluster").pipe(he("Target cluster (overrides config and TSUGA_CLUSTER_ID)"),Fe("CLUSTER_ID"),Rt),rationale:st("rationale").pipe(he('Why you are making this call, e.g. "confirming the deploy caused the error spike". Sent with API requests to explain intent; ignored by local commands like `setup` and `install`, and never affects the result.'),Fe("RATIONALE"),Rt)}));var aR="/v0/rum",U4e=100,N4e=0,k4e=n.Literal("timestamp"),S1=n.Object({__tsuga_metadata__:n.Object({id:n.String()},{additionalProperties:!0}),timestamp:n.Number({description:"Event timestamp as a Unix epoch in milliseconds."})},{additionalProperties:!0}),T1=n.Partial(n.Object({...Lr.properties,query:f({type:"tsuga-query",default:"*",description:"Tsuga query selecting RUM events to return. Prefix every field with the stream it belongs to (`measurements.`, `events.`, or `exceptions.`), e.g. `events.view.name:/checkout`, and filter on a single stream per query. A query without stream-prefixed fields, including the default `*`, searches the `events` stream."}),maxResults:n.Integer({minimum:1,maximum:1e3,default:U4e,description:"Maximum number of RUM events to return."}),triggeredBy:n.Literal("refresh"),startOffset:n.Number({minimum:N4e}),clusterId:f({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}),sortBy:k4e,sortDirection:Le,useWorker:n.Optional(n.Boolean())})),nbr=x({tags:["rum"],url:`${aR}/search`,method:"GET",query:T1,response:n.Object({rum:n.Optional(n.Array(S1))},{additionalProperties:!0})}),b1=n.Object({attributes:n.Array(n.String(),{description:"Every RUM attribute dot-path that can be queried. Use these names as-is in RUM search queries and RUM aggregations."})}),obr=x({tags:["rum"],url:`${aR}/attributes`,method:"GET",query:n.Object({...Lr.properties,clusterId:n.Optional(f({allowEmpty:!1,description:"Cluster ID"})),useWorker:n.Optional(n.Boolean())}),response:b1}),L4e=n.Object({env:n.String({description:"Environment the view was observed in."}),app:n.String({description:"Application the view belongs to."}),pageId:n.String({description:"View name identifying the page."}),viewLoads:n.Optional(n.Number({description:"Distinct page views in the range."})),users:n.Optional(n.Number({description:"Distinct users in the range."})),accounts:n.Optional(n.Number({description:"Distinct accounts in the range."})),lcpP75:n.Optional(n.Number({description:"75th percentile Largest Contentful Paint."})),inpP75:n.Optional(n.Number({description:"75th percentile Interaction to Next Paint."})),clsP75:n.Optional(n.Number({description:"75th percentile Cumulative Layout Shift."}))},{title:"BrowserView"}),M4e=["pageId","app","env","viewLoads","users","accounts","lcpP75","inpP75","clsP75"],D4e=20,F4e=20,Pue=50,$4e=n.Object({searchQuery:ko({description:"Text filter for view names.",valueDescription:"Substring matched case-insensitively against view names."}),envs:qe(f({allowEmpty:!1}),{description:"Restrict results to views observed in any of these environments",maxItems:D4e}),apps:qe(f({allowEmpty:!1}),{description:"Restrict results to views observed in any of these applications",maxItems:F4e}),accounts:qe(f({allowEmpty:!1}),{description:"Restrict results to views observed for any of these account names",maxItems:Pue}),browsers:qe(f({allowEmpty:!1}),{description:"Restrict results to views observed in any of these browsers",maxItems:Pue})}),G4e=n.Object({timeRange:Os,executionOptions:oS,...je,clusterId:n.Optional(f({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."})),filters:n.Optional(n.Partial($4e,{description:"Optional filters applied to narrow the returned views"})),sort:n.Optional(n.Object({by:n.Enum(M4e,{description:"Field to sort the returned views by"}),direction:Le},{description:"Optional sorting applied to the returned views"}))}),ibr=x({tags:["rum"],description:"Query browser views. Results are the highest-ranked views for the requested `sort` (by view loads when unsorted or when sorting on a view name, app or environment), capped per grouping level, so a query matching more views than the caps allow returns only that ranked set: `limit` / `offset` page through it and `totalCount` counts it, neither reaches views truncated by the caps. Narrow the time range or the filters to bring the views of interest into the ranked set.",url:`${aR}/browser-views/query`,method:"POST",paginated:!0,body:G4e,response:n.Array(L4e)}),wue=`${aR}/replay`,sbr=10*Gp,vue={sessionId:f({allowEmpty:!1,description:"RUM session to replay."}),...Os.properties,clusterId:n.Optional(f({allowEmpty:!1,description:"Cluster ID"}))},Uue=n.Optional(n.Number({description:"Resume the window here, epoch ms; absent when it is complete."})),abr=x({tags:["rum"],url:`${wue}/index`,method:"GET",query:n.Object(vue),response:n.Object({chunkTimestamps:n.Array(n.Number({description:"Epoch ms of a chunk a player can start cold from."})),nextFrom:Uue})}),B4e=n.Object({timestamp:n.Number({description:"First rrweb event in the chunk, epoch ms."}),data:n.String({description:"Serialized rrweb eventWithTime[], as recorded."})}),cbr=x({tags:["rum"],url:`${wue}/chunks`,method:"GET",query:n.Object(vue),response:n.Object({chunks:n.Array(B4e),nextFrom:Uue})});var Nue=`/${"v1"}/rum`,kue=n.Object(n.Pick(S1,["timestamp"]).properties,{additionalProperties:!0,description:"RUM event recorded by the browser or mobile SDK."}),q4e={timestamp:17040672e5,"event.name":"browser.web_vital","view.name":"/checkout","context.session.id":"5f0c9f3e-8a1b-4c6d-9e2f-1a2b3c4d5e6f","browser.web_vital.lcp":1840};Object.assign(kue,{examples:[q4e]});var Lue=n.Object({...Yr.properties,...n.Pick(T1,["query","maxResults"]).properties,...Ea.properties},{description:"RUM event search query. Provide a time range, optional Tsuga query, and optional limit."}),j4e={from:1704067200,to:1704070800,query:"events.view.name:/checkout",maxResults:100};Object.assign(Lue,{examples:[j4e]});var Mue=x({description:"Searches Real User Monitoring (RUM) events in a required time range using Tsuga query syntax, most recent first. Use this endpoint to retrieve raw browser and mobile events, such as web vitals, navigations, resource timings, and exceptions, for investigations or automation. See [Browser views](/documentation/categorize/browser-views/index) and [Query syntax](/documentation/explore/query-syntax).",operationId:"searchRumEvents",tags:["public","rum"],url:`${Nue}/search`,method:"GET",query:Lue,response:n.Object({events:n.Array(kue,{description:"RUM events matching the query and time range."})})}),Due=n.Pick(b1,["attributes"]),H4e={attributes:["events.context.session.id","events.event.name","events.view.name","exceptions.exception.type","measurements.browser.web_vital.lcp"]};Object.assign(Due,{examples:[H4e]});var Fue=x({description:"Lists the RUM attribute dot-paths that can be queried. Use this to discover fields for RUM search queries, filters, and grouping. See[Browser views](/documentation/categorize/browser-views/index).",operationId:"getRumAttributes",tags:["public","rum"],url:`${Nue}/attributes`,method:"GET",query:Ea,response:Due});var $ue=G("attributes",{},D("cli.rum.attributes")(function*(){yield*Oe(yield*ye(Fue))})).pipe(B("List RUM attribute dot-paths"));var K4e=st("query").pipe(he("Tsuga query to filter RUM events, with stream-prefixed fields (e.g. events.view.name:/checkout)"),Fe("TSUGA_QUERY"),Rt),Gue=G("search",{...ar,query:K4e,maxResults:Hf},D("cli.rum.search")(function*(e){yield*Oe(yield*ye(Mue,{query:yield*eg(e)}))})).pipe(B("Search RUM events"));var Bue=G("rum").pipe(B("Search RUM events and list their attributes"),De([Gue,$ue]));var jue=e=>{let t=e;return t._tag==="Single"?t:jue(t.param)},que=e=>e.flatMap(t=>{let r=jue(t);return r.hidden?[]:[{name:r.name,type:r.primitiveType._tag,description:Re(r.description)}]}),cR=e=>{let t=e;switch(t._tag){case"Single":return{name:t.name,type:t.primitiveType._tag,description:Re(t.description),required:!0,variadic:!1,minCount:1,maxCount:1};case"Map":case"Transform":return cR(t.param);case"Optional":{let r=cR(t.param);return r.variadic?r:{...r,required:!1,minCount:0}}case"Variadic":{let r=Jr(t.min,()=>0);return{...cR(t.param),required:r>0,variadic:!0,minCount:r,maxCount:Re(t.max)}}default:return Pr(t)}},Hue=(e,t="",r=[])=>{let o=t===""?e.name:`${t} ${e.name}`,{config:i,contextConfig:s}=e,a=new Map([...r,...que(i.flags)].map(l=>[l.name,l])),c=[...r,...que(s.flags)];return{path:o,description:e.description,arguments:i.arguments.map(cR),flags:[...a.values()],subcommands:e.subcommands.flatMap(l=>l.commands.filter(m=>!m.hidden).map(m=>Hue(m,o,c)))}},CT=class extends ot()("cli/CommandTree"){},Kue=G("schema").pipe(B("Print every command, argument, flag and description as JSON, for agents and tooling"),_Y(()=>jt(function*(){let{root:e}=yield*CT;yield*Oe(Hue(e))})));var zue="@tsuga/cli@latest",z4e=D("cli.selfUpdate")(function*(){yield*We(`Updating ${zue}`),yield*fu("npm",["install","-g",zue]),yield*We("Updated. Run `tsuga --version` to confirm the new version.")}),Yue=G("self-update",{},z4e).pipe(B("Update the Tsuga CLI to the latest version via npm"));var Vue=D("graph.optionalTime")(function*(e,t){let r=yield*am(e,t);if(r!==void 0)return yield*$t({try:()=>bO(r),catch:o=>new pr({message:o instanceof Error?o.message:String(o)})})}),Que=G("get",{serviceId:on("SERVICE_ID").pipe(sn("The service to inspect")),...ar,query:uu},D("cli.serviceGraph.get")(function*(e){let t=ho({from:yield*Vue("from",e.from),to:yield*Vue("to",e.to),query:Re(e.query)});yield*Oe(yield*ye(zle,{params:{serviceId:e.serviceId},query:t}))})).pipe(B("Retrieve the dependency graph for a service"));var Wue=G("service-graph").pipe(B("Inspect service dependency graphs"),De([Que]));var Jue=require("node:os"),RT=require("node:path");var lR="Restart your claude / codex session to load the new config.",uR=ge(jo,e=>new Date(e).toISOString()),pR=st("endpoint").pipe(he("OTLP base URL"),Fe("OTLP_ENDPOINT"),Mk(Sy("TSUGA_OTLP_ENDPOINT"))),mR=st("ingestion-api-key").pipe(he("Tsuga ingestion API key"),Fe("INGESTION_API_KEY"),Mk(Sy("TSUGA_INGESTION_API_KEY"))),dR=e=>Vo("include-prompts").pipe(he(`Include ${e} in telemetry; --no-include-prompts strips them`),Qo(!0));var Y4e={CLAUDE_CODE_ENABLE_TELEMETRY:"1",CLAUDE_CODE_ENHANCED_TELEMETRY_BETA:"1",OTEL_METRICS_EXPORTER:"otlp",OTEL_LOGS_EXPORTER:"otlp",OTEL_TRACES_EXPORTER:"otlp",OTEL_EXPORTER_OTLP_PROTOCOL:"http/json",OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:"delta"},V4e=D("cli.setup.claude")(function*(e,t,r,o){let i=yield*mn,s=(0,RT.join)(e,".claude","settings.json");yield*We(`Claude Code \u2192 ${s}`),yield*i.makeDirectory((0,RT.dirname)(s),{recursive:!0}).pipe(qc("create",(0,RT.dirname)(s)));let a=yield*Qf(s),c=yield*wC(s,a??"{}"),l=c.env??{};if(!Jf(l))return yield*new Kn({message:`${s} "env" must be a JSON object.`});let m=o?"1":"0",y={...c,env:{...l,...Y4e,OTEL_EXPORTER_OTLP_ENDPOINT:t,OTEL_LOG_USER_PROMPTS:m,OTEL_LOG_TOOL_DETAILS:m,OTEL_LOG_TOOL_CONTENT:m,OTEL_EXPORTER_OTLP_HEADERS:`Authorization=Bearer ${r}`}},T=yield*Wf(s,a,yield*uR);yield*Vf(s,`${JSON.stringify(y,null,2)}
|
|
276
|
+
Manage Tsuga resources, telemetry, and configuration from the command line`),AY({operationApiKey:st("operation-api-key").pipe(he("Operation API key (overrides config and TSUGA_OPERATION_API_KEY)"),Fe("OPERATION_API_KEY"),Rt),cluster:st("cluster").pipe(he("Target cluster (overrides config and TSUGA_CLUSTER_ID)"),Fe("CLUSTER_ID"),Rt),rationale:st("rationale").pipe(he('Why you are making this call, e.g. "confirming the deploy caused the error spike". Sent with API requests to explain intent; ignored by local commands like `setup` and `install`, and never affects the result.'),Fe("RATIONALE"),Rt)}));var aR="/v0/rum",U4e=100,N4e=0,k4e=n.Literal("timestamp"),S1=n.Object({__tsuga_metadata__:n.Object({id:n.String()},{additionalProperties:!0}),timestamp:n.Number({description:"Event timestamp as a Unix epoch in milliseconds."})},{additionalProperties:!0}),T1=n.Partial(n.Object({...Lr.properties,query:f({type:"tsuga-query",default:"*",description:"Tsuga query selecting RUM events to return. Prefix every field with the stream it belongs to (`measurements.`, `events.`, or `exceptions.`), e.g. `events.view.name:/checkout`, and filter on a single stream per query. A query without stream-prefixed fields, including the default `*`, searches the `events` stream."}),maxResults:n.Integer({minimum:1,maximum:1e3,default:U4e,description:"Maximum number of RUM events to return."}),triggeredBy:n.Literal("refresh"),startOffset:n.Number({minimum:N4e}),clusterId:f({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}),sortBy:k4e,sortDirection:Le,useWorker:n.Optional(n.Boolean())})),rbr=x({tags:["rum"],url:`${aR}/search`,method:"GET",query:T1,response:n.Object({rum:n.Optional(n.Array(S1))},{additionalProperties:!0})}),b1=n.Object({attributes:n.Array(n.String(),{description:"Every RUM attribute dot-path that can be queried. Use these names as-is in RUM search queries and RUM aggregations."})}),nbr=x({tags:["rum"],url:`${aR}/attributes`,method:"GET",query:n.Object({...Lr.properties,clusterId:n.Optional(f({allowEmpty:!1,description:"Cluster ID"})),useWorker:n.Optional(n.Boolean())}),response:b1}),L4e=n.Object({env:n.String({description:"Environment the view was observed in."}),app:n.String({description:"Application the view belongs to."}),pageId:n.String({description:"View name identifying the page."}),viewLoads:n.Optional(n.Number({description:"Distinct page views in the range."})),users:n.Optional(n.Number({description:"Distinct users in the range."})),accounts:n.Optional(n.Number({description:"Distinct accounts in the range."})),lcpP75:n.Optional(n.Number({description:"75th percentile Largest Contentful Paint."})),inpP75:n.Optional(n.Number({description:"75th percentile Interaction to Next Paint."})),clsP75:n.Optional(n.Number({description:"75th percentile Cumulative Layout Shift."}))},{title:"BrowserView"}),M4e=["pageId","app","env","viewLoads","users","accounts","lcpP75","inpP75","clsP75"],D4e=20,F4e=20,Pue=50,$4e=n.Object({searchQuery:ko({description:"Text filter for view names.",valueDescription:"Substring matched case-insensitively against view names."}),envs:qe(f({allowEmpty:!1}),{description:"Restrict results to views observed in any of these environments",maxItems:D4e}),apps:qe(f({allowEmpty:!1}),{description:"Restrict results to views observed in any of these applications",maxItems:F4e}),accounts:qe(f({allowEmpty:!1}),{description:"Restrict results to views observed for any of these account names",maxItems:Pue}),browsers:qe(f({allowEmpty:!1}),{description:"Restrict results to views observed in any of these browsers",maxItems:Pue})}),G4e=n.Object({timeRange:Os,executionOptions:oS,...je,clusterId:n.Optional(f({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."})),filters:n.Optional(n.Partial($4e,{description:"Optional filters applied to narrow the returned views"})),sort:n.Optional(n.Object({by:n.Enum(M4e,{description:"Field to sort the returned views by"}),direction:Le},{description:"Optional sorting applied to the returned views"}))}),obr=x({tags:["rum"],description:"Query browser views. Results are the highest-ranked views for the requested `sort` (by view loads when unsorted or when sorting on a view name, app or environment), capped per grouping level, so a query matching more views than the caps allow returns only that ranked set: `limit` / `offset` page through it and `totalCount` counts it, neither reaches views truncated by the caps. Narrow the time range or the filters to bring the views of interest into the ranked set.",url:`${aR}/browser-views/query`,method:"POST",paginated:!0,body:G4e,response:n.Array(L4e)}),wue=`${aR}/replay`,ibr=10*Gp,vue={sessionId:f({allowEmpty:!1,description:"RUM session to replay."}),...Os.properties,clusterId:n.Optional(f({allowEmpty:!1,description:"Cluster ID"}))},Uue=n.Optional(n.Number({description:"Resume the window here, epoch ms; absent when it is complete."})),sbr=x({tags:["rum"],url:`${wue}/index`,method:"GET",query:n.Object(vue),response:n.Object({chunkTimestamps:n.Array(n.Number({description:"Epoch ms of a chunk a player can start cold from."})),nextFrom:Uue})}),B4e=n.Object({timestamp:n.Number({description:"First rrweb event in the chunk, epoch ms."}),data:n.String({description:"Serialized rrweb eventWithTime[], as recorded."})}),abr=x({tags:["rum"],url:`${wue}/chunks`,method:"GET",query:n.Object(vue),response:n.Object({chunks:n.Array(B4e),nextFrom:Uue})});var Nue=`/${"v1"}/rum`,kue=n.Object(n.Pick(S1,["timestamp"]).properties,{additionalProperties:!0,description:"RUM event recorded by the browser or mobile SDK."}),q4e={timestamp:17040672e5,"event.name":"browser.web_vital","view.name":"/checkout","context.session.id":"5f0c9f3e-8a1b-4c6d-9e2f-1a2b3c4d5e6f","browser.web_vital.lcp":1840};Object.assign(kue,{examples:[q4e]});var Lue=n.Object({...Yr.properties,...n.Pick(T1,["query","maxResults"]).properties,...Ea.properties},{description:"RUM event search query. Provide a time range, optional Tsuga query, and optional limit."}),j4e={from:1704067200,to:1704070800,query:"events.view.name:/checkout",maxResults:100};Object.assign(Lue,{examples:[j4e]});var Mue=x({description:"Searches Real User Monitoring (RUM) events in a required time range using Tsuga query syntax, most recent first. Use this endpoint to retrieve raw browser and mobile events, such as web vitals, navigations, resource timings, and exceptions, for investigations or automation. See [Browser views](/documentation/categorize/browser-views/index) and [Query syntax](/documentation/explore/query-syntax).",operationId:"searchRumEvents",tags:["public","rum"],url:`${Nue}/search`,method:"GET",query:Lue,response:n.Object({events:n.Array(kue,{description:"RUM events matching the query and time range."})})}),Due=n.Pick(b1,["attributes"]),H4e={attributes:["events.context.session.id","events.event.name","events.view.name","exceptions.exception.type","measurements.browser.web_vital.lcp"]};Object.assign(Due,{examples:[H4e]});var Fue=x({description:"Lists the RUM attribute dot-paths that can be queried. Use this to discover fields for RUM search queries, filters, and grouping. See[Browser views](/documentation/categorize/browser-views/index).",operationId:"getRumAttributes",tags:["public","rum"],url:`${Nue}/attributes`,method:"GET",query:Ea,response:Due});var $ue=G("attributes",{},D("cli.rum.attributes")(function*(){yield*Oe(yield*ye(Fue))})).pipe(B("List RUM attribute dot-paths"));var K4e=st("query").pipe(he("Tsuga query to filter RUM events, with stream-prefixed fields (e.g. events.view.name:/checkout)"),Fe("TSUGA_QUERY"),Rt),Gue=G("search",{...ar,query:K4e,maxResults:Hf},D("cli.rum.search")(function*(e){yield*Oe(yield*ye(Mue,{query:yield*eg(e)}))})).pipe(B("Search RUM events"));var Bue=G("rum").pipe(B("Search RUM events and list their attributes"),De([Gue,$ue]));var jue=e=>{let t=e;return t._tag==="Single"?t:jue(t.param)},que=e=>e.flatMap(t=>{let r=jue(t);return r.hidden?[]:[{name:r.name,type:r.primitiveType._tag,description:Re(r.description)}]}),cR=e=>{let t=e;switch(t._tag){case"Single":return{name:t.name,type:t.primitiveType._tag,description:Re(t.description),required:!0,variadic:!1,minCount:1,maxCount:1};case"Map":case"Transform":return cR(t.param);case"Optional":{let r=cR(t.param);return r.variadic?r:{...r,required:!1,minCount:0}}case"Variadic":{let r=Jr(t.min,()=>0);return{...cR(t.param),required:r>0,variadic:!0,minCount:r,maxCount:Re(t.max)}}default:return Pr(t)}},Hue=(e,t="",r=[])=>{let o=t===""?e.name:`${t} ${e.name}`,{config:i,contextConfig:s}=e,a=new Map([...r,...que(i.flags)].map(l=>[l.name,l])),c=[...r,...que(s.flags)];return{path:o,description:e.description,arguments:i.arguments.map(cR),flags:[...a.values()],subcommands:e.subcommands.flatMap(l=>l.commands.filter(m=>!m.hidden).map(m=>Hue(m,o,c)))}},CT=class extends ot()("cli/CommandTree"){},Kue=G("schema").pipe(B("Print every command, argument, flag and description as JSON, for agents and tooling"),_Y(()=>jt(function*(){let{root:e}=yield*CT;yield*Oe(Hue(e))})));var zue="@tsuga/cli@latest",z4e=D("cli.selfUpdate")(function*(){yield*We(`Updating ${zue}`),yield*fu("npm",["install","-g",zue]),yield*We("Updated. Run `tsuga --version` to confirm the new version.")}),Yue=G("self-update",{},z4e).pipe(B("Update the Tsuga CLI to the latest version via npm"));var Vue=D("graph.optionalTime")(function*(e,t){let r=yield*am(e,t);if(r!==void 0)return yield*$t({try:()=>bO(r),catch:o=>new pr({message:o instanceof Error?o.message:String(o)})})}),Que=G("get",{serviceId:on("SERVICE_ID").pipe(sn("The service to inspect")),...ar,query:uu},D("cli.serviceGraph.get")(function*(e){let t=ho({from:yield*Vue("from",e.from),to:yield*Vue("to",e.to),query:Re(e.query)});yield*Oe(yield*ye(zle,{params:{serviceId:e.serviceId},query:t}))})).pipe(B("Retrieve the dependency graph for a service"));var Wue=G("service-graph").pipe(B("Inspect service dependency graphs"),De([Que]));var Jue=require("node:os"),RT=require("node:path");var lR="Restart your claude / codex session to load the new config.",uR=ge(jo,e=>new Date(e).toISOString()),pR=st("endpoint").pipe(he("OTLP base URL"),Fe("OTLP_ENDPOINT"),Mk(Sy("TSUGA_OTLP_ENDPOINT"))),mR=st("ingestion-api-key").pipe(he("Tsuga ingestion API key"),Fe("INGESTION_API_KEY"),Mk(Sy("TSUGA_INGESTION_API_KEY"))),dR=e=>Vo("include-prompts").pipe(he(`Include ${e} in telemetry; --no-include-prompts strips them`),Qo(!0));var Y4e={CLAUDE_CODE_ENABLE_TELEMETRY:"1",CLAUDE_CODE_ENHANCED_TELEMETRY_BETA:"1",OTEL_METRICS_EXPORTER:"otlp",OTEL_LOGS_EXPORTER:"otlp",OTEL_TRACES_EXPORTER:"otlp",OTEL_EXPORTER_OTLP_PROTOCOL:"http/json",OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:"delta"},V4e=D("cli.setup.claude")(function*(e,t,r,o){let i=yield*mn,s=(0,RT.join)(e,".claude","settings.json");yield*We(`Claude Code \u2192 ${s}`),yield*i.makeDirectory((0,RT.dirname)(s),{recursive:!0}).pipe(qc("create",(0,RT.dirname)(s)));let a=yield*Qf(s),c=yield*CC(s,a??"{}"),l=c.env??{};if(!Jf(l))return yield*new Kn({message:`${s} "env" must be a JSON object.`});let m=o?"1":"0",y={...c,env:{...l,...Y4e,OTEL_EXPORTER_OTLP_ENDPOINT:t,OTEL_LOG_USER_PROMPTS:m,OTEL_LOG_TOOL_DETAILS:m,OTEL_LOG_TOOL_CONTENT:m,OTEL_EXPORTER_OTLP_HEADERS:`Authorization=Bearer ${r}`}},T=yield*Wf(s,a,yield*uR);yield*Vf(s,`${JSON.stringify(y,null,2)}
|
|
277
277
|
`),yield*We(T===void 0?" created":` patched (backup: ${T})`)}),Zue=G("claude-code",{endpoint:pR,ingestionApiKey:mR,includePrompts:dR("user prompts + tool content")},D("cli.setup.claudeCode")(function*(e){yield*V4e((0,Jue.homedir)(),e.endpoint.replace(/\/+$/,""),e.ingestionApiKey,e.includePrompts),yield*We(lR)})).pipe(B("Patch ~/.claude/settings.json with Tsuga OTEL env"));var ipe=require("node:os"),C1=require("node:path");var Q4e=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i,PT=class e extends Date{#t=!1;#r=!1;#e=null;constructor(t){let r=!0,o=!0,i="Z";if(typeof t=="string"){let s=t.match(Q4e);s?(s[1]||(r=!1,t=`0000-01-01T${t}`),o=!!s[2],o&&t[10]===" "&&(t=t.replace(" ","T")),s[2]&&+s[2]>23?t="":(i=s[3]||null,t=t.toUpperCase(),!i&&o&&(t+="Z"))):t=""}super(t),isNaN(this.getTime())||(this.#t=r,this.#r=o,this.#e=i)}isDateTime(){return this.#t&&this.#r}isLocal(){return!this.#t||!this.#r||!this.#e}isDate(){return this.#t&&!this.#r}isTime(){return this.#r&&!this.#t}isValid(){return this.#t||this.#r}toISOString(){let t=super.toISOString();if(this.isDate())return t.slice(0,10);if(this.isTime())return t.slice(11,23);if(this.#e===null)return t.slice(0,-1);if(this.#e==="Z")return t;let r=+this.#e.slice(1,3)*60+ +this.#e.slice(4,6);return r=this.#e[0]==="-"?r:-r,new Date(this.getTime()-r*6e4).toISOString().slice(0,-1)+this.#e}static wrapAsOffsetDateTime(t,r="Z"){let o=new e(t);return o.#e=r,o}static wrapAsLocalDateTime(t){let r=new e(t);return r.#e=null,r}static wrapAsLocalDate(t){let r=new e(t);return r.#r=!1,r.#e=null,r}static wrapAsLocalTime(t){let r=new e(t);return r.#t=!1,r.#e=null,r}};function W4e(e,t){let r=e.slice(0,t).split(/\r\n|\n|\r/g);return[r.length,r.pop().length+1]}function J4e(e,t,r){let o=e.split(/\r\n|\n|\r/g),i="",s=(Math.log10(t+1)|0)+1;for(let a=t-1;a<=t+1;a++){let c=o[a-1];c&&(i+=a.toString().padEnd(s," "),i+=": ",i+=c,i+=`
|
|
278
278
|
`,a===t&&(i+=" ".repeat(s+r+2),i+=`^
|
|
279
279
|
`))}return i}var ct=class extends Error{line;column;codeblock;constructor(t,r){let[o,i]=W4e(r.toml,r.ptr),s=J4e(r.toml,o,i);super(`Invalid TOML document: ${t}
|
|
@@ -303,8 +303,8 @@ ${s}`,r),this.line=o,this.column=i,this.codeblock=s}};var Z4e=/^((0x[0-9a-fA-F](
|
|
|
303
303
|
${s}`:`[${e}]`),s&&a?`${s}
|
|
304
304
|
${a}`:s||a}function O1(e,{maxDepth:t=1e3,numbersAsFloat:r=!1}={}){if(vT(e)!=="object")throw new TypeError("stringify can only be called with an object");let o=A1(0,e,"",t,r);return o[o.length-1]!==`
|
|
305
305
|
`?o+`
|
|
306
|
-
`:o}function a3e(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 c3e=D("cli.setup.codex")(function*(e,t,r,o){let i=yield*mn,s=(0,C1.join)(e,".codex"),a=(0,C1.join)(s,"config.toml");yield*We(`Codex \u2192 ${a}`),yield*i.makeDirectory(s,{recursive:!0}).pipe(qc("create",s));let c=yield*Qf(a),l=yield*c===void 0?L({}):$t(()=>x1(c)).pipe(Mt(()=>new Kn({message:`${a} is not valid TOML. Fix or remove it before re-running.`}))),m="otel"in l,{otel:y,...T}=l,S={...T,otel:a3e(t,r,o)},E=yield*Wf(a,c,yield*uR);yield*Vf(a,O1(S)),yield*We(E===void 0?" created":m?` replaced existing [otel] tables (backup: ${E})`:` appended (backup: ${E})`)}),spe=G("codex",{endpoint:pR,ingestionApiKey:mR,includePrompts:dR("user prompts")},D("cli.setup.codexCli")(function*(e){yield*c3e((0,ipe.homedir)(),e.endpoint.replace(/\/+$/,""),e.ingestionApiKey,e.includePrompts),yield*We(lR)})).pipe(B("Patch ~/.codex/config.toml with Tsuga OTEL settings (replaces any existing [otel] table)"));var ape=G("setup").pipe(B("Configure local LLM CLIs to ship OTEL telemetry to Tsuga"),De([Zue,spe]));var Eu="/v0/traces",$xr=x({tags:["traces"],url:`${Eu}/count`,method:"GET",query:n.Pick(tu,["from","to","query","clusterId","useCanopy"]),response:n.Object({count:n.Number()})}),l3e=["unset","ok","error"],u3e=n.Enum(l3e),p3e=["unspecified","internal","server","client","producer","consumer"],m3e=n.Enum(p3e),lpe=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_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:m3e,name:n.String()}),status_code:n.Optional(u3e),trace_id:n.String()}),upe=100,d3e="start_time",f3e="duration_ns",g3e=n.Union([n.Literal(d3e),n.Literal(f3e)]),h3e={...Lr.properties,query:n.Optional(f({type:"tsuga-query"})),maxResults:n.Optional(n.Integer({minimum:1,maximum:1e4})),shouldRecommendAttributes:n.Optional(n.Boolean()),startOffset:n.Optional(n.Number({minimum:tS})),clusterId:n.Optional(f({allowEmpty:!1,description:"Cluster ID"})),sortBy:n.Optional(g3e),sortDirection:n.Optional(Le),useCanopy:n.Optional(n.Boolean())},Gxr=x({tags:["traces"],url:`${Eu}/search`,method:"GET",query:n.Object(h3e),response:n.Object({spans:n.Optional(n.Array(lpe)),attributesToHighlight:n.Optional(n.Array(rS))})});var y3e=n.Object({groupByAttributes:n.Array(f({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."})}),E3e=n.Object({...Lr.properties,traceId:f({allowEmpty:!1,description:"Trace ID to summarize"}),clusterId:n.Optional(f({allowEmpty:!1,description:"Cluster ID"})),...n.Partial(y3e).properties}),Bxr=x({tags:["traces"],url:`${Eu}/summarize`,method:"GET",query:E3e,response:n.Object({spans:n.Array(lpe)})}),qxr=x({tags:["traces"],url:`${Eu}/attributes`,method:"GET",query:n.Object({...Lr.properties,clusterId:n.Optional(f({allowEmpty:!1,description:"Cluster ID"})),useCanopy:n.Optional(n.Boolean())}),response:n.Object({attributes:n.Array(n.String())})}),S3e=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."}))}),T3e=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`. Tsuga computes the weight from active leaf spans in the range. Weights inside one range sum to `1`, except on a range merged from shorter ones. Each merge step truncates to the microsecond grid and merging is pairwise, so the loss compounds with the number of ranges merged rather than being bounded per range: it is a few parts in 10,000 on a typical trace, but a long run of very short adjacent ranges can fall well below `1`. `serviceTotals` is derived from the same merged ranges and 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."})}),b3e=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, from `0` through `1`. Computed as `durationNs / totalDurationNs`; multiply by 100 for a percentage. Shares sum to less than `1` for two reasons: time where no span was running is credited to no service, and merging adjacent ranges truncates to the microsecond grid at each step, so the loss compounds with the number of ranges merged. A shortfall on a trace with no gap is that truncation; it is usually a few parts in 10,000, but a long run of very short adjacent ranges can make it large."})}),R1=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."})),P1=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."})),ER=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(S3e,{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(T3e,{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(b3e,{description:"Aggregated wall-clock contribution per service across the fetched trace. Use this for service-level latency ownership without processing the per-range timeline."})}),x3e={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(ER,{examples:[x3e]});var jxr=x({tags:["traces"],url:`${Eu}/latency-summary`,method:"GET",query:n.Object({...Lr.properties,traceId:f({allowEmpty:!1,description:"Trace ID to summarize"}),clusterId:n.Optional(f({allowEmpty:!1,description:"Cluster ID"})),minRangeDurationMs:R1,includeRanges:P1}),response:ER}),I3e=n.Object({traceId:n.String(),spanId:n.String()}),Hxr=x({tags:["traces"],url:`${Eu}/span-backlinks`,method:"GET",query:n.Object({...Lr.properties,traceId:f({allowEmpty:!1,description:"Trace ID referenced by span links"}),clusterId:n.Optional(f({allowEmpty:!1,description:"Cluster ID"}))}),response:n.Object({backlinks:n.Array(n.Object({spanId:n.String(),references:n.Array(I3e)})),truncated:n.Boolean()})}),yR=n.Object({filter:f({type:"tsuga-query",description:"TQL filter defining the group"}),timeRange:Os}),_3e=n.Object({value:n.String(),supportA:n.Number(),supportB:n.Number()}),A3e=n.Object({value:n.String(),supportA:n.Number(),supportB:n.Number(),lift:n.Union([n.Number(),n.Null()]),pValue:n.Number()}),O3e=n.Object({attr:n.String(),values:n.Array(A3e),otherValues:n.Array(_3e)}),C3e=n.Object({contrastSets:n.Array(O3e),groupACount:n.Number(),groupBCount:n.Number(),failedAttributeCount:n.Number()}),R3e=n.Object({groupA:yR,groupB:yR,candidateAttrs:n.Optional(n.Array(f({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(f({allowEmpty:!1,description:"Cluster ID"}))}),Kxr=x({tags:["traces"],url:`${Eu}/contrast-sets`,method:"POST",body:R3e,response:C3e}),P3e=n.Object({value:n.String(),targetSupport:n.Number(),baselineSupport:n.Number()}),w3e=n.Object({value:n.String(),targetSupport:n.Number(),baselineSupport:n.Number(),lift:n.Union([n.Number(),n.Null()]),pValue:n.Number()}),v3e=n.Object({attr:n.String(),values:n.Array(w3e),otherValues:n.Array(P3e)}),cpe=n.Object({contrastSets:n.Array(v3e),targetGroupCount:n.Number(),baselineGroupCount:n.Number(),failedAttributeCount:n.Number()}),U3e=Q("type",[n.Object({type:n.Literal("snapshot"),response:cpe}),n.Object({type:n.Literal("done"),response:cpe}),n.Object({type:n.Literal("error"),message:n.String()})]),N3e=n.Object({targetGroup:yR,baselineGroup:yR,candidateAttrs:n.Optional(n.Array(f({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(f({allowEmpty:!1,description:"Cluster ID"}))}),zxr=x({tags:["traces"],url:`${Eu}/contrast-sets/stream`,method:"POST",body:N3e,response:U3e});var SR=`/${"v1"}/traces`,w1=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."})),parentSpanId:n.Optional(n.String({description:"`spanId` of this span's parent within the same trace. Absent for the root span."})),resourceAttributes: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."}),spanAttributes: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 `startTime` and `endTime` values."}),startTime:n.String({description:"Span start time as a Unix epoch timestamp in nanoseconds, encoded as a string to preserve precision."}),endTime: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:"Error message associated with the span."})},{description:"Error details associated with the span, separate from the OpenTelemetry `statusCode` field."})),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."})),spanId: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."}),statusCode: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."})),traceId: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."}),k3e={context:{service:{name:"my-service",version:"1.0.0"}},parentSpanId:"187a47da1b2560f8",resourceAttributes:{},spanAttributes:{busyNs:374640,code:{file:{path:"src/queue/sqs.rs"},line:{number:162},module:{name:"queue::sqs"}},idleNs:23621445,maxMessages:"1",target:"queue::sqs",thread:{id:2,name:"tokio-runtime-worker"}},duration:23,startTime:"1770923469995353600",endTime:"1770923470019349500",spanId:"3df8cc3449378f66",span:{kind:"internal",name:"receive_messages"},statusCode:"ok",traceId:"78c99c5bb1e4a30297fa134b9dbec64f"};Object.assign(w1,{examples:[k3e]});var L3e={from:1704067200,to:1704070800,query:"context.service.name:my-service",maxResults:100},dpe=n.Object({...Yr.properties,query:n.Optional(f({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:upe,description:"Maximum number of spans to return. Defaults to 100. Valid values are 1 through 10000."})),clusterId:n.Optional(f({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(dpe,{examples:[L3e]});var fpe=x({description:"Searches spans in a required time range using Tsuga query syntax. Use this endpoint to retrieve trace spans for investigations or automation. See [Traces](/documentation/explore/traces) and [Query syntax](/documentation/explore/query-syntax).",operationId:"searchSpans",tags:["public","traces"],url:`${SR}/search`,method:"GET",query:dpe,response:n.Object({spans:n.Array(w1,{description:"Spans matching the query and time range."})})}),M3e={from:1704067200,to:1704070800,traceId:"78c99c5bb1e4a30297fa134b9dbec64f"},gpe=n.Object({...Yr.properties,traceId:f({allowEmpty:!1,description:"Trace ID to summarize. Use the `traceId` returned by span search, the trace details page, or your tracing instrumentation. Required; the requested time range must include the trace."}),clusterId:n.Optional(f({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(f({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(gpe,{examples:[M3e]});var hpe=x({description:"Summarizes a trace by aggregating groups of similar spans into synthetic summary spans, producing a compact view of large traces. Summary spans are marked with `spanAttributes.aggregation.is_summary` and carry span counts, duration statistics, and an optional latency histogram. See [Traces](/documentation/explore/traces).",operationId:"summarizeTrace",tags:["public","traces"],url:`${SR}/summarize`,method:"GET",query:gpe,response:n.Object({spans:n.Array(w1,{description:"Summarized trace spans, sorted by start time unless `sortSpans` is false. Aggregated groups are replaced by synthetic summary spans marked with `spanAttributes.aggregation.is_summary`."})})}),D3e={from:1704067200,to:1704070800,traceId:"78c99c5bb1e4a30297fa134b9dbec64f"},ype=n.Object({...Yr.properties,traceId:f({allowEmpty:!1,description:"Trace ID to summarize. Use the `traceId` returned by span search, the trace details page, or your tracing instrumentation. Required; the requested time range must include the trace."}),clusterId:n.Optional(f({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."})),minRangeDurationMs:R1,includeRanges:P1},{description:"Trace latency summary query. Provide a trace ID, a time range covering the trace, and optional timeline tuning."});Object.assign(ype,{examples:[D3e]});var Epe=x({description:"Summarizes where wall-clock time is spent in a trace, attributing each slice of the trace timeline to the services with active leaf spans. Returns per-service totals and an optional sequential range timeline. See [Traces](/documentation/explore/traces).",operationId:"getTraceLatencySummary",tags:["public","traces"],url:`${SR}/latency-summary`,method:"GET",query:ype,response:ER}),ppe=e=>n.Object({filter:f({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:Yr},{description:`The ${e} group: a Tsuga query and the time range it is evaluated over.`}),Spe=n.Object({targetGroup:ppe("target"),baselineGroup:ppe("baseline"),candidateAttrs:n.Optional(n.Array(f({allowEmpty:!1}),{maxItems:20,description:"Span attribute dot-paths to test, such as `context.service.name` or `span_attributes.http.route`. At most 20. Attributes referenced by either group filter are always excluded, along with their known sibling attributes for the same field, so the condition being contrasted does not come back as a finding under one of those names. Omit or pass an empty array to let Tsuga discover the most frequent attributes in the target group."})),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."})),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."})),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."}))},{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."}),F3e={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(Spe,{examples:[F3e]});var mpe={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."})},$3e=n.Object({attr:n.String({description:"Span attribute dot-path this contrast set is about, such as `context.env`."}),values:n.Array(n.Object({...mpe,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(mpe,{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:"ContrastSet"}),Tpe=n.Object({contrastSets:n.Array($3e,{description:"One entry per attribute that separates the two groups, strongest first. 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."})}),G3e={contrastSets:[{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}]}],targetGroupCount:1240,baselineGroupCount:8760,failedAttributeCount:2};Object.assign(Tpe,{examples:[G3e]});var bpe=x({description:'Compares a target group of spans against a baseline group and returns the attribute values that are over-represented in the target. Use it to answer "what do these spans have in common that the others do not": erroring spans against healthy ones for a service, slow spans against normal-latency ones, or the same spans before and after a deployment. Each group carries its own time range, so a before/after comparison is one call. Each finding in `values` comes with its coverage in both groups and a p-value, plus a `lift` that is omitted when the value never appears in the baseline; `otherValues` carries coverage only, as context for reading the findings. See [Traces](/documentation/explore/traces).',operationId:"findContrastSets",tags:["public","traces"],url:`${SR}/contrast-sets`,method:"POST",body:Spe,query:Ea,response:Tpe});var xpe=yo("contrast-sets","Compare two groups of spans and return the attribute values that separate them",bpe);var TR=st("trace-id").pipe(he("Trace ID to summarize"),Fe("TRACE_ID"));var Ipe=G("latency-summary",{traceId:TR,...ar,minRangeDurationMs:W3("min-range-duration-ms").pipe(he("Collapse timeline ranges shorter than this (default: max(1ms, 1% of trace duration); 0 disables collapsing)"),Fe("MILLISECONDS"),Rt),ranges:Vo("ranges").pipe(he("Include the per-range timeline; --no-ranges returns only services and serviceTotals"),Qo(!0))},D("cli.traces.latencySummary")(function*(e){yield*Oe(yield*ye(Epe,{query:ho({traceId:e.traceId,from:yield*Ft("from",e.from),to:yield*Ft("to",e.to),minRangeDurationMs:Re(e.minRangeDurationMs),includeRanges:e.ranges?void 0:!1})}))})).pipe(B("Summarize where wall-clock time is spent in a trace, attributed per service"));var _pe=G("search",{...ar,query:uu,maxResults:Hf},D("cli.traces.search")(function*(e){yield*Oe(yield*ye(fpe,{query:yield*eg(e)}))})).pipe(B("Search spans"));var Ape=G("summarize",{traceId:TR,...ar},D("cli.traces.summarize")(function*(e){yield*Oe(yield*ye(hpe,{query:{traceId:e.traceId,from:yield*Ft("from",e.from),to:yield*Ft("to",e.to)}}))})).pipe(B("Summarize a trace by aggregating groups of similar spans into summary spans"));var Ope=G("traces").pipe(B("Search and summarize traces"),De([xpe,_pe,Ape,Ipe]));var Cpe=Rue.pipe(De([{group:"Resources",commands:Oue},{group:"Query & explore",commands:[Fie,Yie,Ope,Bue,Ire,Wue,yoe,Roe,Tie,Wie,gne,coe]},{group:"Documentation, help & feedback",commands:[vne,moe,Kue]},{group:"Setup & config",commands:[une,Ine,yne,ape,Aoe,Yue]}]),Wk(ha,e=>({operationApiKey:Re(e.operationApiKey),cluster:Re(e.cluster),rationale:Re(e.rationale)})),RY(ti.layer)),Rpe=Cpe.pipe(Wk(CT,()=>({root:Cpe})));var B3e=3e3,q3e="https://registry.npmjs.org/@tsuga/cli/latest",j3e=Xr({version:Me}),H3e=fs(j3e);function K3e(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,a=o[i]??0;if(s>a)return!0;if(s<a)return!1}return!1}var z3e=D("cli.checkForUpdate")(function*(e){let t=yield*tr,r=yield*Sp,o=yield*jo,i=yield*t.getLastUpdateCheck;if(i&&o-new Date(i).getTime()<Ef)return;let s=yield*r.get(q3e).pipe(ce(f0),ce(a=>a.json),ce(H3e),_q(B3e),bq);s._tag!=="None"&&(K3e(s.value.version,e)&&(yield*Ti(`
|
|
307
|
-
Update available: ${e} \u2192 ${s.value.version}`),yield*Ti("Run `tsuga self-update` to update")),yield*t.saveLastUpdateCheck(new Date(o).toISOString()))}),Ppe=e=>Ah(z3e(e));y0(process.stdout);y0(process.stderr);var Y3e=Zm(tr.layer,eu.layer).pipe(Xm(Af.layer),Xm(uV),Xm(FH)),wpe=process.argv.slice(2),V3e=wpe.some(e=>["--help","-h","--version","-v","--completions","--wizard"].includes(e)),vpe=
|
|
306
|
+
`:o}function a3e(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 c3e=D("cli.setup.codex")(function*(e,t,r,o){let i=yield*mn,s=(0,C1.join)(e,".codex"),a=(0,C1.join)(s,"config.toml");yield*We(`Codex \u2192 ${a}`),yield*i.makeDirectory(s,{recursive:!0}).pipe(qc("create",s));let c=yield*Qf(a),l=yield*c===void 0?L({}):$t(()=>x1(c)).pipe(Mt(()=>new Kn({message:`${a} is not valid TOML. Fix or remove it before re-running.`}))),m="otel"in l,{otel:y,...T}=l,S={...T,otel:a3e(t,r,o)},E=yield*Wf(a,c,yield*uR);yield*Vf(a,O1(S)),yield*We(E===void 0?" created":m?` replaced existing [otel] tables (backup: ${E})`:` appended (backup: ${E})`)}),spe=G("codex",{endpoint:pR,ingestionApiKey:mR,includePrompts:dR("user prompts")},D("cli.setup.codexCli")(function*(e){yield*c3e((0,ipe.homedir)(),e.endpoint.replace(/\/+$/,""),e.ingestionApiKey,e.includePrompts),yield*We(lR)})).pipe(B("Patch ~/.codex/config.toml with Tsuga OTEL settings (replaces any existing [otel] table)"));var ape=G("setup").pipe(B("Configure local LLM CLIs to ship OTEL telemetry to Tsuga"),De([Zue,spe]));var Eu="/v0/traces",Fxr=x({tags:["traces"],url:`${Eu}/count`,method:"GET",query:n.Pick(tu,["from","to","query","clusterId","useCanopy"]),response:n.Object({count:n.Number()})}),l3e=["unset","ok","error"],u3e=n.Enum(l3e),p3e=["unspecified","internal","server","client","producer","consumer"],m3e=n.Enum(p3e),lpe=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_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:m3e,name:n.String()}),status_code:n.Optional(u3e),trace_id:n.String()}),upe=100,d3e="start_time",f3e="duration_ns",g3e=n.Union([n.Literal(d3e),n.Literal(f3e)]),h3e={...Lr.properties,query:n.Optional(f({type:"tsuga-query"})),maxResults:n.Optional(n.Integer({minimum:1,maximum:1e4})),shouldRecommendAttributes:n.Optional(n.Boolean()),startOffset:n.Optional(n.Number({minimum:tS})),clusterId:n.Optional(f({allowEmpty:!1,description:"Cluster ID"})),sortBy:n.Optional(g3e),sortDirection:n.Optional(Le),useCanopy:n.Optional(n.Boolean())},$xr=x({tags:["traces"],url:`${Eu}/search`,method:"GET",query:n.Object(h3e),response:n.Object({spans:n.Optional(n.Array(lpe)),attributesToHighlight:n.Optional(n.Array(rS))})});var y3e=n.Object({groupByAttributes:n.Array(f({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."})}),E3e=n.Object({...Lr.properties,traceId:f({allowEmpty:!1,description:"Trace ID to summarize"}),clusterId:n.Optional(f({allowEmpty:!1,description:"Cluster ID"})),...n.Partial(y3e).properties}),Gxr=x({tags:["traces"],url:`${Eu}/summarize`,method:"GET",query:E3e,response:n.Object({spans:n.Array(lpe)})}),Bxr=x({tags:["traces"],url:`${Eu}/attributes`,method:"GET",query:n.Object({...Lr.properties,clusterId:n.Optional(f({allowEmpty:!1,description:"Cluster ID"})),useCanopy:n.Optional(n.Boolean())}),response:n.Object({attributes:n.Array(n.String())})}),S3e=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."}))}),T3e=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`. Tsuga computes the weight from active leaf spans in the range. Weights inside one range sum to `1`, except on a range merged from shorter ones. Each merge step truncates to the microsecond grid and merging is pairwise, so the loss compounds with the number of ranges merged rather than being bounded per range: it is a few parts in 10,000 on a typical trace, but a long run of very short adjacent ranges can fall well below `1`. `serviceTotals` is derived from the same merged ranges and 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."})}),b3e=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, from `0` through `1`. Computed as `durationNs / totalDurationNs`; multiply by 100 for a percentage. Shares sum to less than `1` for two reasons: time where no span was running is credited to no service, and merging adjacent ranges truncates to the microsecond grid at each step, so the loss compounds with the number of ranges merged. A shortfall on a trace with no gap is that truncation; it is usually a few parts in 10,000, but a long run of very short adjacent ranges can make it large."})}),R1=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."})),P1=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."})),ER=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(S3e,{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(T3e,{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(b3e,{description:"Aggregated wall-clock contribution per service across the fetched trace. Use this for service-level latency ownership without processing the per-range timeline."})}),x3e={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(ER,{examples:[x3e]});var qxr=x({tags:["traces"],url:`${Eu}/latency-summary`,method:"GET",query:n.Object({...Lr.properties,traceId:f({allowEmpty:!1,description:"Trace ID to summarize"}),clusterId:n.Optional(f({allowEmpty:!1,description:"Cluster ID"})),minRangeDurationMs:R1,includeRanges:P1}),response:ER}),I3e=n.Object({traceId:n.String(),spanId:n.String()}),jxr=x({tags:["traces"],url:`${Eu}/span-backlinks`,method:"GET",query:n.Object({...Lr.properties,traceId:f({allowEmpty:!1,description:"Trace ID referenced by span links"}),clusterId:n.Optional(f({allowEmpty:!1,description:"Cluster ID"}))}),response:n.Object({backlinks:n.Array(n.Object({spanId:n.String(),references:n.Array(I3e)})),truncated:n.Boolean()})}),yR=n.Object({filter:f({type:"tsuga-query",description:"TQL filter defining the group"}),timeRange:Os}),_3e=n.Object({value:n.String(),supportA:n.Number(),supportB:n.Number()}),A3e=n.Object({value:n.String(),supportA:n.Number(),supportB:n.Number(),lift:n.Union([n.Number(),n.Null()]),pValue:n.Number()}),O3e=n.Object({attr:n.String(),values:n.Array(A3e),otherValues:n.Array(_3e)}),C3e=n.Object({contrastSets:n.Array(O3e),groupACount:n.Number(),groupBCount:n.Number(),failedAttributeCount:n.Number()}),R3e=n.Object({groupA:yR,groupB:yR,candidateAttrs:n.Optional(n.Array(f({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(f({allowEmpty:!1,description:"Cluster ID"}))}),Hxr=x({tags:["traces"],url:`${Eu}/contrast-sets`,method:"POST",body:R3e,response:C3e}),P3e=n.Object({value:n.String(),targetSupport:n.Number(),baselineSupport:n.Number()}),w3e=n.Object({value:n.String(),targetSupport:n.Number(),baselineSupport:n.Number(),lift:n.Union([n.Number(),n.Null()]),pValue:n.Number()}),v3e=n.Object({attr:n.String(),values:n.Array(w3e),otherValues:n.Array(P3e)}),cpe=n.Object({contrastSets:n.Array(v3e),targetGroupCount:n.Number(),baselineGroupCount:n.Number(),failedAttributeCount:n.Number()}),U3e=Q("type",[n.Object({type:n.Literal("snapshot"),response:cpe}),n.Object({type:n.Literal("done"),response:cpe}),n.Object({type:n.Literal("error"),message:n.String()})]),N3e=n.Object({targetGroup:yR,baselineGroup:yR,candidateAttrs:n.Optional(n.Array(f({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(f({allowEmpty:!1,description:"Cluster ID"}))}),Kxr=x({tags:["traces"],url:`${Eu}/contrast-sets/stream`,method:"POST",body:N3e,response:U3e});var SR=`/${"v1"}/traces`,w1=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."})),parentSpanId:n.Optional(n.String({description:"`spanId` of this span's parent within the same trace. Absent for the root span."})),resourceAttributes: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."}),spanAttributes: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 `startTime` and `endTime` values."}),startTime:n.String({description:"Span start time as a Unix epoch timestamp in nanoseconds, encoded as a string to preserve precision."}),endTime: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:"Error message associated with the span."})},{description:"Error details associated with the span, separate from the OpenTelemetry `statusCode` field."})),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."})),spanId: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."}),statusCode: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."})),traceId: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."}),k3e={context:{service:{name:"my-service",version:"1.0.0"}},parentSpanId:"187a47da1b2560f8",resourceAttributes:{},spanAttributes:{busyNs:374640,code:{file:{path:"src/queue/sqs.rs"},line:{number:162},module:{name:"queue::sqs"}},idleNs:23621445,maxMessages:"1",target:"queue::sqs",thread:{id:2,name:"tokio-runtime-worker"}},duration:23,startTime:"1770923469995353600",endTime:"1770923470019349500",spanId:"3df8cc3449378f66",span:{kind:"internal",name:"receive_messages"},statusCode:"ok",traceId:"78c99c5bb1e4a30297fa134b9dbec64f"};Object.assign(w1,{examples:[k3e]});var L3e={from:1704067200,to:1704070800,query:"context.service.name:my-service",maxResults:100},dpe=n.Object({...Yr.properties,query:n.Optional(f({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:upe,description:"Maximum number of spans to return. Defaults to 100. Valid values are 1 through 10000."})),clusterId:n.Optional(f({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(dpe,{examples:[L3e]});var fpe=x({description:"Searches spans in a required time range using Tsuga query syntax. Use this endpoint to retrieve trace spans for investigations or automation. See [Traces](/documentation/explore/traces) and [Query syntax](/documentation/explore/query-syntax).",operationId:"searchSpans",tags:["public","traces"],url:`${SR}/search`,method:"GET",query:dpe,response:n.Object({spans:n.Array(w1,{description:"Spans matching the query and time range."})})}),M3e={from:1704067200,to:1704070800,traceId:"78c99c5bb1e4a30297fa134b9dbec64f"},gpe=n.Object({...Yr.properties,traceId:f({allowEmpty:!1,description:"Trace ID to summarize. Use the `traceId` returned by span search, the trace details page, or your tracing instrumentation. Required; the requested time range must include the trace."}),clusterId:n.Optional(f({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(f({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(gpe,{examples:[M3e]});var hpe=x({description:"Summarizes a trace by aggregating groups of similar spans into synthetic summary spans, producing a compact view of large traces. Summary spans are marked with `spanAttributes.aggregation.is_summary` and carry span counts, duration statistics, and an optional latency histogram. See [Traces](/documentation/explore/traces).",operationId:"summarizeTrace",tags:["public","traces"],url:`${SR}/summarize`,method:"GET",query:gpe,response:n.Object({spans:n.Array(w1,{description:"Summarized trace spans, sorted by start time unless `sortSpans` is false. Aggregated groups are replaced by synthetic summary spans marked with `spanAttributes.aggregation.is_summary`."})})}),D3e={from:1704067200,to:1704070800,traceId:"78c99c5bb1e4a30297fa134b9dbec64f"},ype=n.Object({...Yr.properties,traceId:f({allowEmpty:!1,description:"Trace ID to summarize. Use the `traceId` returned by span search, the trace details page, or your tracing instrumentation. Required; the requested time range must include the trace."}),clusterId:n.Optional(f({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."})),minRangeDurationMs:R1,includeRanges:P1},{description:"Trace latency summary query. Provide a trace ID, a time range covering the trace, and optional timeline tuning."});Object.assign(ype,{examples:[D3e]});var Epe=x({description:"Summarizes where wall-clock time is spent in a trace, attributing each slice of the trace timeline to the services with active leaf spans. Returns per-service totals and an optional sequential range timeline. See [Traces](/documentation/explore/traces).",operationId:"getTraceLatencySummary",tags:["public","traces"],url:`${SR}/latency-summary`,method:"GET",query:ype,response:ER}),ppe=e=>n.Object({filter:f({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:Yr},{description:`The ${e} group: a Tsuga query and the time range it is evaluated over.`}),Spe=n.Object({targetGroup:ppe("target"),baselineGroup:ppe("baseline"),candidateAttrs:n.Optional(n.Array(f({allowEmpty:!1}),{maxItems:20,description:"Span attribute dot-paths to test, such as `context.service.name` or `span_attributes.http.route`. At most 20. Attributes referenced by either group filter are always excluded, along with their known sibling attributes for the same field, so the condition being contrasted does not come back as a finding under one of those names. Omit or pass an empty array to let Tsuga discover the most frequent attributes in the target group."})),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."})),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."})),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."}))},{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."}),F3e={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(Spe,{examples:[F3e]});var mpe={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."})},$3e=n.Object({attr:n.String({description:"Span attribute dot-path this contrast set is about, such as `context.env`."}),values:n.Array(n.Object({...mpe,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(mpe,{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:"ContrastSet"}),Tpe=n.Object({contrastSets:n.Array($3e,{description:"One entry per attribute that separates the two groups, strongest first. 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."})}),G3e={contrastSets:[{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}]}],targetGroupCount:1240,baselineGroupCount:8760,failedAttributeCount:2};Object.assign(Tpe,{examples:[G3e]});var bpe=x({description:'Compares a target group of spans against a baseline group and returns the attribute values that are over-represented in the target. Use it to answer "what do these spans have in common that the others do not": erroring spans against healthy ones for a service, slow spans against normal-latency ones, or the same spans before and after a deployment. Each group carries its own time range, so a before/after comparison is one call. Each finding in `values` comes with its coverage in both groups and a p-value, plus a `lift` that is omitted when the value never appears in the baseline; `otherValues` carries coverage only, as context for reading the findings. See [Traces](/documentation/explore/traces).',operationId:"findContrastSets",tags:["public","traces"],url:`${SR}/contrast-sets`,method:"POST",body:Spe,query:Ea,response:Tpe});var xpe=yo("contrast-sets","Compare two groups of spans and return the attribute values that separate them",bpe);var TR=st("trace-id").pipe(he("Trace ID to summarize"),Fe("TRACE_ID"));var Ipe=G("latency-summary",{traceId:TR,...ar,minRangeDurationMs:W3("min-range-duration-ms").pipe(he("Collapse timeline ranges shorter than this (default: max(1ms, 1% of trace duration); 0 disables collapsing)"),Fe("MILLISECONDS"),Rt),ranges:Vo("ranges").pipe(he("Include the per-range timeline; --no-ranges returns only services and serviceTotals"),Qo(!0))},D("cli.traces.latencySummary")(function*(e){yield*Oe(yield*ye(Epe,{query:ho({traceId:e.traceId,from:yield*Ft("from",e.from),to:yield*Ft("to",e.to),minRangeDurationMs:Re(e.minRangeDurationMs),includeRanges:e.ranges?void 0:!1})}))})).pipe(B("Summarize where wall-clock time is spent in a trace, attributed per service"));var _pe=G("search",{...ar,query:uu,maxResults:Hf},D("cli.traces.search")(function*(e){yield*Oe(yield*ye(fpe,{query:yield*eg(e)}))})).pipe(B("Search spans"));var Ape=G("summarize",{traceId:TR,...ar},D("cli.traces.summarize")(function*(e){yield*Oe(yield*ye(hpe,{query:{traceId:e.traceId,from:yield*Ft("from",e.from),to:yield*Ft("to",e.to)}}))})).pipe(B("Summarize a trace by aggregating groups of similar spans into summary spans"));var Ope=G("traces").pipe(B("Search and summarize traces"),De([xpe,_pe,Ape,Ipe]));var Cpe=Rue.pipe(De([{group:"Resources",commands:Oue},{group:"Query & explore",commands:[Rie,Die,Ope,Yie,Bue,Ire,Wue,aoe,Eoe,uie,Wie,gne,Zne]},{group:"Documentation, help & feedback",commands:[vne,roe,Kue]},{group:"Setup & config",commands:[une,Ine,yne,ape,goe,Yue]}]),Wk(ha,e=>({operationApiKey:Re(e.operationApiKey),cluster:Re(e.cluster),rationale:Re(e.rationale)})),RY(ti.layer)),Rpe=Cpe.pipe(Wk(CT,()=>({root:Cpe})));var B3e=3e3,q3e="https://registry.npmjs.org/@tsuga/cli/latest",j3e=Xr({version:Me}),H3e=fs(j3e);function K3e(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,a=o[i]??0;if(s>a)return!0;if(s<a)return!1}return!1}var z3e=D("cli.checkForUpdate")(function*(e){let t=yield*tr,r=yield*Sp,o=yield*jo,i=yield*t.getLastUpdateCheck;if(i&&o-new Date(i).getTime()<Ef)return;let s=yield*r.get(q3e).pipe(ce(f0),ce(a=>a.json),ce(H3e),_q(B3e),bq);s._tag!=="None"&&(K3e(s.value.version,e)&&(yield*Ti(`
|
|
307
|
+
Update available: ${e} \u2192 ${s.value.version}`),yield*Ti("Run `tsuga self-update` to update")),yield*t.saveLastUpdateCheck(new Date(o).toISOString()))}),Ppe=e=>Ah(z3e(e));y0(process.stdout);y0(process.stderr);var Y3e=Zm(tr.layer,eu.layer).pipe(Xm(Af.layer),Xm(uV),Xm(FH)),wpe=process.argv.slice(2),V3e=wpe.some(e=>["--help","-h","--version","-v","--completions","--wizard"].includes(e)),vpe=loe(process.stdout,process.stderr);process.on("exit",vpe.release);Jk(Rpe,{version:"1.52.0"})(wpe).pipe(mi(V3e?mt:Ppe("1.52.0")),uoe(vpe),Tn(e=>fX(e)?mi(Ti(gX(e)),Ie(()=>process.exitCode=dX(e))):J(e)),nx(Y3e),Ho($H,!0),Lq);
|
|
308
308
|
/**
|
|
309
309
|
* The following is a list of HTTP status codes and their meanings.
|
|
310
310
|
*
|