@tsuga/cli 1.163.0 → 1.164.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 +5 -0
- package/dist/cli.js +3 -3
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -269,7 +269,7 @@ ${or(e,"Wizard cancelled.",jb)}`,eV=(e,t,r,o,i=El)=>{let s=Cxe(t);return[or(r,e,
|
|
|
269
269
|
`,e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>[]))),([t,r])=>[t,r]),oQ=(e,t=[])=>m(m(nQ(e),([r,o])=>m(uL(o),([i,s])=>[[r,i],s])),([r,o])=>oQ(o,[...t,r]),()=>[t,e]),rPe=e=>m(m(m(uL(e),([t,r])=>m(oQ(r),([o,i])=>m(m(nQ(i),([s,a])=>[[s],a],()=>[[],i]),([s,a])=>[[t,o,s],a]))),([t,r])=>[t,r],()=>m([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[tW(t),r]),uL=e=>m(m(tPe(e),([t,r])=>m(m(ZRe(r),([o,i])=>[o,i],()=>m(XRe(r),([o,i])=>[o,i],()=>m(JRe(r),([o,i])=>[o,i],()=>m(ePe(r),([o,i])=>[o,i],()=>[])))),([o,i])=>m(PW(i),([s,a])=>[[t,o,s],a]))),([t,r])=>[rW(t),r]),nPe=e=>m(m(uL(e),([t,r])=>m(rPe(r),([o,i])=>[[t,o],i])),([t,r])=>[nW(t),r]),iQ=e=>m(m(nPe(e),([t,r])=>[t,r],()=>m(lRe(e),([t,r])=>[t,r],()=>m(it(e),([t,r])=>[t,r],()=>[]))),([t,r])=>[t,r]);function sQ(e){let t=iL(`\`${e}\``);return c.IsEqual(t.length,2)?t[0]:_r()}function iPe(e){return e.join("|")}function sPe(e){return e.slice(1,e.length-1)}function aPe(e,t,r){return Bu(t,`${r}${e}`)}function cPe(e,t){return Bu(e,`${t}${b4}`)}function uPe(e,t){return Bu(e,`${t}${jx}`)}function pPe(e,t){return Bu(e,`${t}${zx}`)}function lPe(e,t){return _E(Pe([$e("false"),$e("true")]),e,t)}function dPe(e,t){return Bu(e,`${t}${Yx}`)}function mPe(e,t,r){return Bu(t,`${r}${sPe(e)}`)}function fPe(e,t,r){let o=IE(e,{});return _E(o,t,r)}function gPe(e,t,r){let o=ao(e);return _E(o,t,r)}function aQ(e,t,r,o=[]){return c.ShiftLeft(e,(i,s)=>aQ(s,t,r,[...o,_E(i,[],"")]),()=>Bu(t,`${r}(${iPe(o)})`))}function _E(e,t,r){return Mr(e)?gPe(e.enum,t,r):dn(e)?uPe(t,r):ze(e)?aPe(e.const,t,r):$o(e)?cPe(t,r):so(e)?lPe(t,r):ar(e)?pPe(t,r):qr(e)?dPe(t,r):Dt(e)?mPe(e.pattern,t,r):uQ(e)?fPe(e.parameters[0],t,r):z(e)?aQ(e.anyOf,t,r):ZV}function Bu(e,t){return c.ShiftLeft(e,(r,o)=>_E(r,o,t),()=>t)}function hPe(e){return`^${Bu(e,"")}$`}function cQ(e){let t=hPe(e);return Wx(t)}function IE(e,t){return Le(e)?O.Update(cQ(e),{},t):oO(e,t)}function pQ(e,t,r,o){let i=si(e,t,r);return IE(i,o)}function oO(e,t={}){return ee("TemplateLiteral",[e],t)}function uQ(e){return sr(e)&&c.HasPropertyKey(e,"action")&&c.IsEqual(e.action,"TemplateLiteral")}function lQ(e){return IE(e,{})}function yPe(e){let t=sQ(e);return lQ(t)}function dQ(e,t={}){let r=c.IsString(e)?yPe(e):lQ(e);return O.Update(r,{},t)}function Dt(e){return W(e,"TemplateLiteral")}var be={};yi(be,{ExtendsFalse:()=>Ne,ExtendsTrue:()=>Y,ExtendsUnion:()=>pL,IsExtendsFalse:()=>EPe,IsExtendsTrue:()=>fQ,IsExtendsTrueLike:()=>ra,IsExtendsUnion:()=>mQ,Match:()=>Or});function pL(e){return O.Create({"~kind":"ExtendsUnion"},{inferred:e})}function mQ(e){return c.IsObject(e)&&c.HasPropertyKey(e,"~kind")&&c.HasPropertyKey(e,"inferred")&&c.IsEqual(e["~kind"],"ExtendsUnion")&&c.IsObject(e.inferred)}function Y(e){return O.Create({"~kind":"ExtendsTrue"},{inferred:e})}function fQ(e){return c.IsObject(e)&&c.HasPropertyKey(e,"~kind")&&c.HasPropertyKey(e,"inferred")&&c.IsEqual(e["~kind"],"ExtendsTrue")&&c.IsObject(e.inferred)}function Ne(){return O.Create({"~kind":"ExtendsFalse"},{})}function EPe(e){return c.IsObject(e)&&c.HasPropertyKey(e,"~kind")&&c.IsEqual(e["~kind"],"ExtendsFalse")}function ra(e){return mQ(e)||fQ(e)}function Or(e,t,r){return ra(e)?t(e.inferred):r()}function TPe(e,t,r,o){return Or(et(e,r,o),i=>Y(O.Assign(O.Assign(e,i),{[t]:r})),()=>Ne())}function SPe(e,t){return Y(e)}function _Pe(e,t,r,o,i){return Or(et(e,t,r),s=>Or(et(s,t,o),a=>Y(a),()=>Ne()),()=>Or(et(e,t,i),s=>Y(s),()=>Ne()))}function IPe(e,t,r){let o=ao(r);return et(e,t,o)}function gQ(e,t,r){return c.ShiftLeft(r,(o,i)=>Or(et(e,t,o),s=>gQ(s,t,i),()=>Ne()),()=>Y(e))}function bPe(e,t,r){let o=zn(r);return et(e,t,o)}function hQ(e,t,r){return c.ShiftLeft(r,(o,i)=>Or(et(e,t,o),s=>Y(s),()=>hQ(e,t,i)),()=>Ne())}function dt(e,t,r){return dr(r)?SPe(e,t):Sr(r)?_Pe(e,t,r.if,r.then,r.else):Mr(r)?IPe(e,t,r.enum):Lr(r)?TPe(e,r.name,t,r.extends):ge(r)?gQ(e,t,r.allOf):Dt(r)?bPe(e,t,r.pattern):z(r)?hQ(e,t,r.anyOf):kr(r)?Y(e):Ne()}function yQ(e,t,r){return Lr(r)?dt(e,t,r):dr(r)?Y(e):kr(r)?Y(e):pL(e)}function xPe(e,t){let r=Ul(e),o=Ul(t);return r&&o||!r&&o?!0:!(r&&!o)}function EQ(e,t,r,o){return Ze(o)?xPe(t,o)?et(e,r,o.items):Ne():dt(e,t,o)}function TQ(e,t,r){return $o(r)?Y(e):dt(e,t,r)}function SQ(e,t,r){return so(r)?Y(e):dt(e,t,r)}function OPe(e,t,r,o,i){let s=Lr(o)?t:o,a=Lr(o)?o:t,u=Nr(t),l=Nr(o);return!u&&l?Ne():Or(et(e,s,a),d=>bE(d,r,i),()=>Ne())}function APe(e,t,r,o){return c.ShiftLeft(o,(i,s)=>OPe(e,t,r,i,s),()=>Nr(t)?Y(e):Ne())}function CPe(e,t,r){return c.ShiftLeft(t,(o,i)=>APe(e,o,i,r),()=>Y(e))}function bE(e,t,r){return CPe(e,t,r)}function vO(e,t,r){return Bo(r)?Y(e):et(e,t,r)}function _Q(e,t,r,o){return dr(o)?Y(e):kr(o)?Y(e):wr(o)?Or(bE(e,t,o.parameters),i=>vO(i,r,o.instanceType),()=>Ne()):Ne()}function IQ(e,t,r,o,i){return Or(et(e,t,i),()=>et(e,r,i),()=>et(e,o,i))}function bQ(e,t,r){let o=ao(t);return et(e,o,r)}function xQ(e,t,r,o){return dr(o)?Y(e):kr(o)?Y(e):vr(o)?Or(bE(e,t,o.parameters),i=>vO(i,r,o.returnType),()=>Ne()):Ne()}function OQ(e,t,r){return dn(r)?Y(e):ar(r)?Y(e):dt(e,t,r)}function AQ(e,t,r){let o=br(t);return et(e,o,r)}function NO(e,t,r){return t===r?Y(e):Ne()}function RPe(e,t,r){return ze(r)?NO(e,t,r.const):$o(r)?Y(e):dt(e,$e(t),r)}function PPe(e,t,r){return ze(r)?NO(e,t,r.const):so(r)?Y(e):dt(e,$e(t),r)}function UPe(e,t,r){return ze(r)?NO(e,t,r.const):ar(r)?Y(e):dt(e,$e(t),r)}function wPe(e,t,r){return ze(r)?NO(e,t,r.const):qr(r)?Y(e):dt(e,$e(t),r)}function CQ(e,t,r){return c.IsBigInt(t.const)?RPe(e,t.const,r):c.IsBoolean(t.const)?PPe(e,t.const,r):c.IsNumber(t.const)?UPe(e,t.const,r):c.IsString(t.const)?wPe(e,t.const,r):_r()}function RQ(e,t,r){return Lr(r)?dt(e,t,r):Y(e)}function PQ(e,t,r){return ea(r)?Y(e):dt(e,t,r)}function UQ(e,t,r){return ar(r)?Y(e):dt(e,t,r)}function vPe(e,t,r){return Nr(t)?Nr(r)?Y(e):Ne():Y(e)}function NPe(e,t,r){return Lr(r)&&Do(r.extends)?Ne():Or(et(e,t,r),o=>vPe(o,t,r),()=>Ne())}function kPe(e,t){return e.reduce((r,o)=>o in t?ra(t[o])?{...r,...t[o].inferred}:_r():_r(),{})}function LPe(e,t,r){let o={};for(let a of c.Keys(r))o[a]=a in t?NPe({},t[a],r[a]):Nr(r[a])?Lr(r[a])?Y(O.Assign(e,{[r[a].name]:r[a].extends})):Y(e):Ne();let i=c.Values(o).every(a=>ra(a)),s=i?kPe(c.Keys(o),o):{};return i?Y(s):Ne()}function MPe(e,t,r){let o=LPe(e,t,r);return ra(o)?Y(O.Assign(e,o.inferred)):Ne()}function DPe(e,t,r){return MPe(e,t,r)}function FPe(e,t){return c.Keys(t).reduce((r,o)=>({...r,[o]:c.HasPropertyKey(e,o)?z(r[o])?Pe([...r[o].anyOf,t[o]]):Pe([e[o],t[o]]):t[o]}),e)}function wQ(e,t,r,o){return c.ShiftLeft(t,(i,s)=>Or(et({},e[i],r),a=>wQ(e,s,r,FPe(o,a)),()=>Ne()),()=>Y(o))}function $Pe(e,t,r,o){let i=c.Keys(t);return wQ(t,i,o,e)}function vQ(e,t,r){return _t(r)?$Pe(e,t,Hr(r),Zt(r)):Te(r)?DPe(e,t,r.properties):dt(e,me(t),r)}function GPe(e,t){return c.IsEqual(c.Keys(t).length,0)?Y(e):Ne()}function BPe(e,t,r,o,i){return et(e,r,i)}function NQ(e,t,r,o){return _t(o)?BPe(e,eO(t),r,eO(Hr(o)),Zt(o)):Te(o)?GPe(e,o.properties):dr(o)?Y(e):kr(o)?Y(e):Ne()}function kQ(e,t,r){return qr(r)?Y(e):dt(e,t,r)}function LQ(e,t,r){return ta(r)?Y(e):dt(e,t,r)}function MQ(e,t,r){let o=zn(t);return et(e,o,r)}function lL(e,t){return O.Create({"~kind":"Inferrable"},{name:e,type:t},{})}function xE(e){return c.IsObject(e)&&c.HasPropertyKey(e,"~kind")&&c.HasPropertyKey(e,"name")&&c.HasPropertyKey(e,"type")&&c.IsEqual(e["~kind"],"Inferrable")&&c.IsString(e.name)&&c.IsObject(e.type)}function dL(e){return Fu(e)?Lr(e.items)?Ze(e.items.extends)?lL(e.items.name,e.items.extends.items):kr(e.items.extends)?lL(e.items.name,e.items.extends):void 0:_r():void 0}function kO(e){return Lr(e)?lL(e.name,e.extends):void 0}function DQ(e,t){let r=[];for(let o of e){if(!ra(et({},o,t)))return;r.push(o)}return r}function FQ(e,t,r,o){let i=DQ(r,o);return c.IsArray(i)?Y(O.Assign(e,{[t]:Ir(i)})):Ne()}function LO(e,t,r,o){let i=DQ(r,o);return c.IsArray(i)?Y(O.Assign(e,{[t]:Pe(i)})):Ne()}function jPe(e){return[...e].reverse()}function mL(e,t){return t?jPe(e):e}function qPe(e){let t=e.length>0?e[0]:void 0,r=sr(t)?dL(t):void 0;return sr(r)}function HPe(e,t,r,o,i,s){return Or(et(e,r,i),a=>$Q(a,t,o,s),()=>Ne())}function KPe(e,t,r,o,i){let s=dL(o);return xE(s)?FQ(e,s.name,mL(r,t),s.type):c.ShiftLeft(r,(a,u)=>HPe(e,t,a,u,o,i),()=>Ne())}function zPe(e,t,r,o){return c.ShiftLeft(o,(i,s)=>KPe(e,t,r,i,s),()=>c.IsEqual(r.length,0)?Y(e):Ne())}function $Q(e,t,r,o){return zPe(e,t,r,o)}function YPe(e,t,r){let o=ju(e,zt([],[]),r),i=qPe(o);return $Q(e,i,mL(t,i),mL(o,i))}function VPe(e,t,r){for(let o of t){let i=et(e,o,r);if(!ra(i))return i;e=i.inferred}return Y(e)}function WPe(e,t,r){let o=kO(r);return xE(o)?LO(e,o.name,t,o.type):VPe(e,t,r)}function GQ(e,t,r){let o=ju(e,zt([],[]),t);return Ge(r)?YPe(e,o,r.items):Ze(r)?WPe(e,o,r.items):dt(e,Ir(o),r)}function BQ(e,t,r){return Bo(r)?Y(e):gs(r)?Y(e):dt(e,t,r)}function jQ(e,t,r){return c.ShiftLeft(r,(o,i)=>Or(et(e,t,o),s=>Y(s),()=>jQ(e,t,i)),()=>Ne())}function fL(e,t,r){return c.ShiftLeft(t,(o,i)=>Or(jQ(e,o,r),s=>fL(s,i,r),()=>Ne()),()=>Y(e))}function qQ(e,t,r){let o=kO(r);return xE(o)?LO(e,o.name,t,o.type):z(r)?fL(e,t,r.anyOf):fL(e,t,[r])}function HQ(e,t,r){return Lr(r)?dt(e,t,r):dr(r)?Y(e):kr(r)?Y(e):Ne()}function KQ(e,t,r){return Bo(r)?Y(e):dt(e,t,r)}function et(e,t,r){return dr(t)?yQ(e,t,r):Ze(t)?EQ(e,t,t.items,r):$o(t)?TQ(e,t,r):so(t)?SQ(e,t,r):wr(t)?_Q(e,t.parameters,t.instanceType,r):Sr(t)?IQ(e,t.if,t.then,t.else,r):Mr(t)?bQ(e,t.enum,r):vr(t)?xQ(e,t.parameters,t.returnType,r):dn(t)?OQ(e,t,r):ge(t)?AQ(e,t.allOf,r):ze(t)?CQ(e,t,r):Do(t)?RQ(e,t,r):ea(t)?PQ(e,t,r):ar(t)?UQ(e,t,r):Te(t)?vQ(e,t.properties,r):_t(t)?NQ(e,Hr(t),Zt(t),r):qr(t)?kQ(e,t,r):ta(t)?LQ(e,t,r):Dt(t)?MQ(e,t.pattern,r):Ge(t)?GQ(e,t.items,r):gs(t)?BQ(e,t,r):z(t)?qQ(e,t.anyOf,r):kr(t)?HQ(e,t,r):Bo(t)?KQ(e,t,r):Ne()}function QPe(e,t){return br([...e,me(t)])}function gL(e,t,r){return Le(e)?O.Update(QPe(e,t),{},r):hE(e,t,r)}function zQ(e,t,r,o,i){let s=si(e,t,r),a=OE(e,t,o);return gL(s,a,i)}function hE(e,t,r={}){return ee("Interface",[e,t],r)}function df(e){return sr(e)&&c.HasPropertyKey(e,"action")&&c.IsEqual(e.action,"Interface")}function YQ(e,t,r={}){return gL(e,t,r)}function ZPe(e,t,r){return e.includes(r)?!0:AE([...e,r],t,t[r])}function VQ(e,t,r){let o=vx(r);return Dl(e,t,o)}function Dl(e,t,r){return c.ShiftLeft(r,(o,i)=>AE(e,t,o)?!0:Dl(e,t,i),()=>!1)}function AE(e,t,r){return yt(r)?ZPe(e,t,r.$ref):Ze(r)?AE(e,t,r.items):wr(r)?Dl(e,t,[...r.parameters,r.instanceType]):vr(r)?Dl(e,t,[...r.parameters,r.returnType]):df(r)?VQ(e,t,r.parameters[1]):ge(r)?Dl(e,t,r.allOf):Te(r)?VQ(e,t,r.properties):z(r)?Dl(e,t,r.anyOf):Ge(r)?Dl(e,t,r.items):_t(r)?AE(e,t,Zt(r)):!1}function WQ(e,t,r){return AE(e,t,r)}function XPe(e,t){return t.reduce((r,o)=>WQ([o],e,e[o])?[...r,o]:r,[])}function QQ(e){let t=wx(e);return XPe(e,t)}function JPe(e,t,r){return r.includes(t)?r:t in e?CE(e,e[t],[...r,t]):_r()}function ZQ(e,t,r){let o=vx(t);return mf(e,o,r)}function mf(e,t,r){return t.reduce((o,i)=>CE(e,i,o),r)}function CE(e,t,r){return yt(t)?JPe(e,t.$ref,r):Ze(t)?CE(e,t.items,r):wr(t)?mf(e,[...t.parameters,t.instanceType],r):vr(t)?mf(e,[...t.parameters,t.returnType],r):df(t)?ZQ(e,t.parameters[1],r):ge(t)?mf(e,t.allOf,r):Te(t)?ZQ(e,t.properties,r):z(t)?mf(e,t.anyOf,r):Ge(t)?mf(e,t.items,r):_t(t)?CE(e,Zt(t),r):r}function XQ(e,t,r){return CE(e,r,[t])}function eUe(e){return Xm()}function tUe(e){return c.Keys(e).reduce((t,r)=>({...t,[r]:Fl(e[r])}),{})}function RE(e){return e.reduce((t,r)=>[...t,Fl(r)],[])}function Fl(e){return yt(e)?eUe(e.$ref):Ze(e)?Io(Fl(e.items),Qm(e)):wr(e)?Ws(RE(e.parameters),Fl(e.instanceType)):vr(e)?Qs(RE(e.parameters),Fl(e.returnType)):ge(e)?Kn(RE(e.allOf)):Te(e)?me(tUe(e.properties)):_t(e)?sf(af(e),Fl(Zt(e))):z(e)?Pe(RE(e.anyOf)):Ge(e)?Ir(RE(e.items)):e}function rUe(e,t){return t in e?Fl(e[t]):jr()}function JQ(e){return rUe(e.$defs,e.$ref)}function nUe(e,t,r){let o=si(e,zt([],[]),t),i=OE({},zt([],[]),r);return br([...o,me(i)])}function oUe(e,t){return c.Keys(e).filter(o=>t.includes(o)).reduce((o,i)=>{let s=e[i],a=df(s)?nUe(e,s.parameters[0],s.parameters[1]):s;return{...o,[i]:a}},{})}function e6(e,t,r){let o=XQ(e,t,r),i=oUe(e,o);return Xs(i,t)}function t6(e,t){return t in e?yt(e[t])?t6(e,e[t].$ref):e[t]:St()}function na(e,t){return t6(e,t)}function r6(e){return Mt(e)?JQ(e):Nx(e)?jr():e}function vn(e,t,r){let o=r6(t),i=r6(r);return et(e,o,i)}var lE=0,PE=1,dE=2,mE=3;function nf(e,t){let r=[vn({},e,t),vn({},t,e)];return be.IsExtendsTrueLike(r[0])&&be.IsExtendsTrueLike(r[1])?lE:be.IsExtendsTrueLike(r[0])&&be.IsExtendsFalse(r[1])?dE:be.IsExtendsFalse(r[0])&&be.IsExtendsTrueLike(r[1])?mE:PE}function hL(e,t,r=[],o=t){return c.ShiftLeft(t,(i,s)=>{let a=nf(e,i);return c.IsEqual(a,dE)||c.IsEqual(a,lE)?o:c.IsEqual(a,PE)?hL(e,s,[...r,i],o):hL(e,s,r,o)},()=>[...r,e])}function iUe(e,t,r){let o=ki(e);return dr(o)?[o]:kr(o)?[o]:Do(o)?MO(t,r):Te(o)?MO(t,[...r,o]):MO(t,hL(o,r))}function MO(e,t=[]){return c.ShiftLeft(e,(r,o)=>iUe(r,o,t),()=>t)}function Vk(e){let t=MO(e);return kl(t)}function yL(e,t){return O.Update(ki(e),{},t)}function n6(e,t,r,o){let i=G(e,t,r);return yL(i,o)}function UE(e,t=[]){return wu(e)&&c.IsEqual(e.action,"Conditional")?yt(e.parameters[0])?UE(e.parameters[2],UE(e.parameters[3],[...t,e.parameters[0].$ref])):UE(e.parameters[2],UE(e.parameters[3],t)):wu(e)&&c.IsEqual(e.action,"Mapped")&&wu(e.parameters[1])&&c.IsEqual(e.parameters[1].action,"KeyOf")&&yt(e.parameters[1].parameters[0])?[...t,e.parameters[1].parameters[0].$ref]:t}function sUe(e,t){return e.reduce((r,o)=>[...r,t.includes(o.name)],[])}function s6(e,t,r=[]){return c.ShiftLeft(e,(o,i)=>c.ShiftLeft(t,(s,a)=>s6(i,a,[...r,[s,o]]),()=>r),()=>r)}function aUe(e){return Dt(e)?zn(e.pattern):Mr(e)?ao(e.enum):e}function cUe(e){let t=aUe(e);return z(t)?[...t.anyOf]:[t]}function uUe(e,t){return e.reduce((r,o)=>[...r,[...o,t]],[])}function o6(e,t){return t.reduce((r,o)=>[...r,...uUe(e,o)],[])}function i6(e){return e.reduce((t,r)=>c.IsEqual(r[0],!0)?o6(t,cUe(r[1])):o6(t,[r[1]]),[[]])}function a6(e,t,r){let o=UE(r),i=sUe(e,o),s=s6(t,i);return wu(r)&&c.IsEqual(r.action,"Conditional")||wu(r)&&c.IsEqual(r.action,"Mapped")?i6(s):[t]}function pUe(){return["(not-resolvable)",St()]}function lUe(){return["(not-generic)",St()]}function dUe(e,t,r){return[e,vu(t,r)]}function mUe(e,t,r){return t in e?c6(e,t,e[t],r):pUe()}function c6(e,t,r,o){return Zm(r)?dUe(t,r.parameters,r.expression):yt(r)?mUe(e,r.$ref,o):lUe()}function u6(e,t,r){return c6(e,"(anonymous)",t,r)}function fUe(e,t,r){if(Lr(t)||ff(t)||be.IsExtendsTrueLike(vn({},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 p6(e,t,r,o,i){let s=G(e,t,i);return fUe(r,s,o),O.Assign(e,{[r]:s})}function gUe(e,t,r,o,i){let s=G(e,t,r.extends),a=G(e,t,r.equals);return c.ShiftLeft(i,(u,l)=>EL(p6(e,t,r.name,s,u),t,o,l),()=>EL(p6(e,t,r.name,s,a),t,o,[]))}function EL(e,t,r,o){return c.ShiftLeft(r,(i,s)=>gUe(e,t,i,s,o),()=>e)}function l6(e,t,r,o){return EL(e,t,r,o)}var TL=0,SL=0;function hUe(){if(!c.IsLessThan(SL,Br.Get().maxInstantiationCount))throw Error("Type instantiation is excessively deep and possibly infinite")}function yUe(){hUe(),SL++,TL++}function EUe(){TL--,c.IsEqual(TL,0)&&(SL=0)}function TUe(e){return c.IsGreaterThan(e.callstack.length,0)?e.callstack[e.callstack.length-1]:""}function SUe(e,t){return c.IsEqual(TUe(e),t)}function _Ue(e,t,r,o,i,s){yUe();try{let a=l6(e,t,o,s),u=G(a,zt([...t.callstack,r.$ref],t.visited),i);return G(a,zt([],[]),u)}finally{EUe()}}function IUe(e,t,r,o,i,s){return s.reduce((a,u)=>{let l=_Ue(e,t,r,o,i,u);return[...a,l]},[])}function bUe(e,t,r,o,i,s){let a=a6(o,s,i),u=IUe(e,t,r,o,i,a);return c.IsEqual(u.length,1)?u[0]:xo(u)}function DO(e,t,r,o){let i=si(e,t,o),s=u6(e,r,o),a=s[0],u=s[1];return Zm(u)?SUe(t,a)?yE(pn(a),i):bUe(e,t,pn(a),u.parameters,u.expression,i):yE(r,i)}function yE(e,t){return O.Create({"~kind":"Call"},{type:"call",target:e,arguments:t},{})}function d6(e,t){return DO({},zt([],[]),e,t)}function ff(e){return W(e,"Call")}function xUe(e){return O.Discard(e,["~immutable"])}function m6(e,t){return O.Update(xUe(e),{},t)}function f6(e,t,r,o){let i=G(e,t,r);return m6(i,o)}function g6(e,t){return e(t)}function h6(e,t){return c.IsString(t)?$e(g6(e,t)):$e(t)}function y6(e,t){let r=zn(t);return Sc(e,r)}function E6(e,t){let r=t.map(o=>Sc(e,o));return Pe(r)}function Sc(e,t){return ze(t)?h6(e,t.const):Dt(t)?y6(e,t.pattern):z(t)?E6(e,t.anyOf):t}function iO(e,t={}){return ee("Capitalize",[e],t)}function T6(e,t={}){return _L(e,t)}function sO(e,t={}){return ee("Lowercase",[e],t)}function S6(e,t={}){return IL(e,t)}function aO(e,t={}){return ee("Uncapitalize",[e],t)}function _6(e,t={}){return bL(e,t)}function cO(e,t={}){return ee("Uppercase",[e],t)}function I6(e,t={}){return xL(e,t)}var OUe=e=>e[0].toUpperCase()+e.slice(1),AUe=e=>e.toLowerCase(),CUe=e=>e[0].toLowerCase()+e.slice(1),RUe=e=>e.toUpperCase();function _L(e,t){return Le([e])?O.Update(Sc(OUe,e),{},t):iO(e,t)}function IL(e,t){return Le([e])?O.Update(Sc(AUe,e),{},t):sO(e,t)}function bL(e,t){return Le([e])?O.Update(Sc(CUe,e),{},t):aO(e,t)}function xL(e,t){return Le([e])?O.Update(Sc(RUe,e),{},t):cO(e,t)}function b6(e,t,r,o){let i=G(e,t,r);return _L(i,o)}function x6(e,t,r,o){let i=G(e,t,r);return IL(i,o)}function O6(e,t,r,o){let i=G(e,t,r);return bL(i,o)}function A6(e,t,r,o){let i=G(e,t,r);return xL(i,o)}function uO(e,t,r,o,i={}){return ee("Conditional",[e,t,r,o],i)}function C6(e,t,r,o,i={}){return OL({},zt([],[]),e,t,r,o,i)}function PUe(e,t,r,o,i,s){let a=vn(e,r,o);return be.IsExtendsUnion(a)?Pe([G(a.inferred,t,i),G(e,t,s)]):be.IsExtendsTrue(a)?G(a.inferred,t,i):G(e,t,s)}function OL(e,t,r,o,i,s,a){return Le([r,o])?O.Update(PUe(e,t,r,o,i,s),{},a):uO(r,o,i,s,a)}function R6(e,t,r,o,i,s,a){let u=G(e,t,r),l=G(e,t,o);return OL(e,t,u,l,i,s,a)}function pO(e,t={}){return ee("ConstructorParameters",[e],t)}function P6(e,t={}){return AL(e,t)}function UUe(e){let t=wr(e)?e.parameters:[],r=ju({},zt([],[]),t);return Ir(r)}function AL(e,t){return Le([e])?O.Update(UUe(e),{},t):pO(e,t)}function U6(e,t,r,o){let i=G(e,t,r);return AL(i,o)}function lO(e,t,r={}){return ee("Exclude",[e,t],r)}function w6(e,t,r={}){return wE(e,t,r)}function wE(e,t,r){return Le([e,t])?O.Update(Zx(e,t),{},r):lO(e,t,r)}function v6(e,t,r,o,i){let s=G(e,t,r),a=G(e,t,o);return wE(s,a,i)}function dO(e,t,r={}){return ee("Extract",[e,t],r)}function N6(e,t,r={}){return CL(e,t,r)}function wUe(e,t){let r=vn({},e,t);return be.IsExtendsTrueLike(r)?[e]:[]}function k6(e,t,r=[]){return c.ShiftLeft(e,(o,i)=>k6(i,t,[...r,...wUe(o,t)]),()=>r)}function L6(e,t){let r=ki(e),o=z(r)?r.anyOf:[r],i=k6(o,t);return xo(i)}function CL(e,t,r){return Le([e,t])?O.Update(L6(e,t),{},r):dO(e,t,r)}function M6(e,t,r,o,i){let s=G(e,t,r),a=G(e,t,o);return CL(s,a,i)}function vUe(e){return e.reduce((t,r)=>qx(r)?[...t,$e(r)]:t,[])}function gf(e){let t=vUe(e);return Pe(t)}function EE(e,t,r={}){return ee("Index",[e,t],r)}function D6(e,t,r={}){let o=c.IsArray(t)?gf(t):t;return RL(e,o,r)}function F6(e,t){let r=na(e,t);return ai(r)}function $6(e,t,r){let o=fs(e,t,r);return ai(o)}function NUe(e,t){let r=c.Keys(e).filter(g=>!c.HasPropertyKey(t,g)),o=c.Keys(t).filter(g=>!c.HasPropertyKey(e,g)),i=c.Keys(e).filter(g=>c.HasPropertyKey(t,g)),s=r.reduce((g,y)=>({...g,[y]:e[y]}),{}),a=o.reduce((g,y)=>({...g,[y]:t[y]}),{}),u=i.reduce((g,y)=>({...g,[y]:Qx(e[y],t[y])}),{}),l=O.Assign(s,a);return O.Assign(l,u)}function G6(e){return e.reduce((t,r)=>NUe(t,ai(r)),{})}function B6(e){let t=$4(Ir(e));return ai(t)}function kUe(e,t){return c.Keys(e).filter(i=>i in t).reduce((i,s)=>({...i,[s]:j4(e[s],t[s])}),{})}function j6(e,t){return c.ShiftLeft(e,(r,o)=>j6(o,kUe(t,ai(r))),()=>t)}function q6(e){return c.ShiftLeft(e,(t,r)=>j6(r,ai(t)),()=>_r())}function ai(e){return Mt(e)?F6(e.$defs,e.$ref):Sr(e)?$6(e.if,e.then,e.else):ge(e)?G6(e.allOf):z(e)?q6(e.anyOf):Ge(e)?B6(e.items):Te(e)?e.properties:{}}function hf(e){let t=ai(e);return me(t)}var LUe=new RegExp("^(?:0|[1-9][0-9]*)$");function yf(e){let t=`${e}`;return LUe.test(t)?parseInt(t):e}function MUe(e){return $e(yf(e))}function H6(e){return e.map(t=>K6(t))}function K6(e){return ge(e)?Kn(H6(e.allOf)):z(e)?Pe(H6(e.anyOf)):ze(e)?MUe(e.const):e}function z6(e,t){let r=K6(t),o=vn({},r,Go());return be.IsExtendsTrueLike(o)?e:ze(t)&&c.IsEqual(t.const,"length")?Go():St()}function Y6(e,t){let r=na(e,t);return jo(r)}function V6(e,t,r){let o=fs(e,t,r);return jo(o)}function W6(e){let t=ao(e);return jo(t)}function Q6(e){let t=br(e);return jo(t)}function Z6(e){return[`${e}`]}function X6(e){let t=zn(e);return jo(t)}function J6(e){return e.reduce((t,r)=>[...t,...jo(r)],[])}function jo(e){return Mt(e)?Y6(e.$defs,e.$ref):Sr(e)?V6(e.if,e.then,e.else):Mr(e)?W6(e.enum):ge(e)?Q6(e.allOf):ze(e)?Z6(e.const):Dt(e)?X6(e.pattern):z(e)?J6(e.anyOf):[]}function Ef(e){return jo(e)}function vE(e,t){return t.map(r=>NE(e,r))}function NE(e,t){return Ze(t)?Io(NE(e,t.items)):wr(t)?Ws(vE(e,t.parameters),NE(e,t.instanceType)):vr(t)?Qs(vE(e,t.parameters),NE(e,t.returnType)):Ge(t)?Ir(vE(e,t.items)):z(t)?Pe(vE(e,t.anyOf)):ge(t)?Kn(vE(e,t.allOf)):rO(t)?me(e):t}function e5(e,t){return NE(e,t)}function DUe(e,t){let r=t in e?e[t]:St();return e5(e,r)}function t5(e,t){return t.reduce((r,o)=>[...r,DUe(e,o)],[])}function FUe(e,t){let r=Ef(t),o=t5(e,r);return xo(o)}var $Ue=new RegExp(Du);function GUe(e){return e.filter(r=>$Ue.test(r))}function BUe(e){let t=wx(e),r=GUe(t),o=t5(e,r);return xo(o)}function r5(e,t){return ar(t)?BUe(e):FUe(e,t)}function jUe(e){return $e(yf(e))}function n5(e){return e.map(t=>PL(t))}function PL(e){return ge(e)?Kn(n5(e.allOf)):z(e)?Pe(n5(e.anyOf)):ze(e)?jUe(e.const):e}function qUe(e,t){return e.reduceRight((r,o,i)=>{let s=vn({},$e(i),t);return be.IsExtendsTrueLike(s)?[o,...r]:r},[])}function HUe(e,t){let r=PL(t),o=qUe(e,r);return Lu(o)}function KUe(e){return Lu(e)}function o5(e,t){return ze(t)&&c.IsEqual(t.const,"length")?$e(e.length):ar(t)||dn(t)?KUe(e):HUe(e,t)}function i5(e,t){return Ze(e)?z6(e.items,t):Te(e)?r5(e.properties,t):Ge(e)?o5(e.items,t):St()}function zUe(e){return Mt(e)||Sr(e)||ge(e)||z(e)?hf(e):e}function RL(e,t,r){return Le([e,t])?O.Update(i5(zUe(e),t),{},r):EE(e,t,r)}function s5(e,t,r,o,i){let s=G(e,t,r),a=G(e,t,o);return RL(s,a,i)}function mO(e,t={}){return ee("InstanceType",[e],t)}function a5(e,t={}){return UL(e,t)}function YUe(e){return wr(e)?e.instanceType:St()}function UL(e,t){return Le([e])?O.Update(YUe(e),{},t):mO(e,t)}function c5(e,t,r,o={}){let i=G(e,t,r);return UL(i,o)}function TE(e,t={}){return ee("KeyOf",[e],t)}function u5(e,t={}){return wL(e,t)}function p5(){return Pe([Go(),wn(),tf()])}function l5(e){return Go()}function VUe(e){return e.reduce((r,o)=>qx(o)?[...r,$e(yf(o))]:_r(),[])}function d5(e){let t=c.Keys(e),r=VUe(t);return Lu(r)}function m5(e){return af(e)}function f5(e){let t=e.map((r,o)=>$e(o));return Lu(t)}function g5(e){return dr(e)?p5():Ze(e)?l5(e.items):Te(e)?d5(e.properties):_t(e)?m5(e):Ge(e)?f5(e.items):St()}function WUe(e){return Mt(e)||Sr(e)||ge(e)||z(e)?hf(e):e}function wL(e,t){return Le([e])?O.Update(g5(WUe(e)),{},t):TE(e,t)}function h5(e,t,r,o){let i=G(e,t,r);return wL(i,o)}function gE(e,t,r,o,i={}){return ee("Mapped",[e,t,r,o],i)}function y5(e,t,r,o,i={}){return vL({},zt([],[]),e,t,r,o,i)}function QUe(e){let t=zn(e);return FO(t)}function ZUe(e){return e.reduce((t,r)=>[...t,...FO(r)],[])}function XUe(e){let t=ao(e);return FO(t)}function JUe(e){return c.IsNumber(e)?[$e(`${e}`)]:[$e(e)]}function FO(e){return Mr(e)?XUe(e.enum):ze(e)?JUe(e.const):Dt(e)?QUe(e.pattern):z(e)?ZUe(e.anyOf):[e]}function E5(e){return FO(e)}function ewe(e){return Dt(e)?zn(e.pattern):e}function twe(e,t,r,o,i,s){let a=O.Assign(e,{[r.name]:o}),u=G(a,t,i),l=ewe(u),d=G(a,t,s);return Hx(l)||Kx(l)?{[l.const]:d}:{}}function rwe(e,t,r,o,i,s){return o.reduce((a,u)=>[...a,twe(e,t,r,u,i,s)],[])}function nwe(e){return e.reduce((t,r)=>[...t,me(r)],[])}function T5(e,t,r,o,i,s){let a=E5(o),u=rwe(e,t,r,a,i,s),l=nwe(u);return br(l)}function vL(e,t,r,o,i,s,a){return Le([o])?O.Update(T5(e,t,r,o,i,s),{},a):gE(r,o,i,s,a)}function S5(e,t,r,o,i,s,a){let u=G(e,t,o);return vL(e,t,r,u,i,s,a)}function owe(e,t,r){let o=O.Assign(e,t);return c.Keys(t).filter(s=>r.includes(s)).reduce((s,a)=>({...s,[a]:e6(o,a,t[a])}),{})}function iwe(e,t,r){let o=O.Assign(e,t);return c.Keys(t).filter(s=>!r.includes(s)).reduce((s,a)=>({...s,[a]:G(o,zt([],[]),t[a])}),{})}function swe(e,t,r){let o=QQ(t),i=owe(e,t,o),s=iwe(e,t,o),a={...i,...s};return O.Update(a,{},r)}function $O(e,t,r,o){return swe(e,r,o)}function fO(e,t={}){return ee("NonNullable",[e],t)}function _5(e,t={}){return NL(e,t)}function awe(e){let t=Pe([ef(),cf()]);return wE(e,t,{})}function NL(e,t){return Le([e])?O.Update(awe(e),{},t):fO(e,t)}function I5(e,t,r,o){let i=G(e,t,r);return NL(i,o)}function gO(e,t,r={}){return ee("Omit",[e,t],r)}function b5(e,t,r={}){let o=c.IsArray(t)?gf(t):t;return kL(e,o,r)}function GO(e){let t=hf(e);return Te(t)?t.properties:_r()}function cwe(e,t){return c.Keys(e).reduce((o,i)=>t.includes(i)?o:{...o,[i]:e[i]},{})}function x5(e,t){let r=GO(e),o=Ef(t),i=cwe(r,o);return me(i)}function kL(e,t,r){return Le([e,t])?O.Update(x5(e,t),{},r):gO(e,t,r)}function O5(e,t,r,o,i){let s=G(e,t,r),a=G(e,t,o);return kL(s,a,i)}function hO(e,t={}){return ee("Parameters",[e],t)}function A5(e,t={}){return LL(e,t)}function uwe(e){let t=vr(e)?e.parameters:[],r=ju({},zt([],[]),t);return Ir(r)}function LL(e,t){return Le([e])?O.Update(uwe(e),{},t):hO(e,t)}function C5(e,t,r,o){let i=G(e,t,r);return LL(i,o)}function yO(e,t={}){return ee("Partial",[e],t)}function R5(e,t={}){return ML(e,t)}function P5(e,t){let r=na(e,t),o=oa(r);return Xs(O.Assign(e,{[t]:o}),t)}function U5(e,t,r){let o=fs(e,t,r);return oa(o)}function w5(e){let t=br(e);return oa(t)}function v5(e){let t=e.map(r=>oa(r));return Pe(t)}function N5(e){let t=c.Keys(e).reduce((o,i)=>({...o,[i]:Ux(e[i])}),{});return me(t)}function oa(e){return Mt(e)?P5(e.$defs,e.$ref):Sr(e)?U5(e.if,e.then,e.else):ge(e)?w5(e.allOf):z(e)?v5(e.anyOf):Te(e)?N5(e.properties):me({})}function ML(e,t){return Le([e])?O.Update(oa(e),{},t):yO(e,t)}function k5(e,t,r,o){let i=G(e,t,r);return ML(i,o)}function EO(e,t,r={}){return ee("Pick",[e,t],r)}function L5(e,t,r={}){let o=c.IsArray(t)?gf(t):t;return DL(e,o,r)}function pwe(e,t){return c.Keys(e).reduce((o,i)=>t.includes(i)?O.Assign(o,{[i]:e[i]}):o,{})}function M5(e,t){let r=GO(e),o=Ef(t),i=pwe(r,o);return me(i)}function DL(e,t,r){return Le([e,t])?O.Update(M5(e,t),{},r):EO(e,t,r)}function D5(e,t,r,o,i){let s=G(e,t,r),a=G(e,t,o);return DL(s,a,i)}function TO(e,t={}){return ee("ReadonlyObject",[e],t)}function FL(e,t={}){return $L(e,t)}var F5=FL;function $5(e){return Jm(Io(e))}function G5(e,t){let r=na(e,t),o=ia(r);return Xs(O.Assign(e,{[t]:o}),t)}function B5(e,t,r){let o=fs(e,t,r);return ia(o)}function j5(e){let t=br(e);return ia(t)}function q5(e){let t=c.Keys(e).reduce((o,i)=>({...o,[i]:$x(e[i])}),{});return me(t)}function H5(e){return Jm(Ir(e))}function K5(e){let t=e.map(r=>ia(r));return Pe(t)}function ia(e){return Ze(e)?$5(e.items):Mt(e)?G5(e.$defs,e.$ref):Sr(e)?B5(e.if,e.then,e.else):ge(e)?j5(e.allOf):Te(e)?q5(e.properties):Ge(e)?H5(e.items):z(e)?K5(e.anyOf):e}function $L(e,t){return Le([e])?O.Update(ia(e),{},t):TO(e)}function z5(e,t,r,o){let i=G(e,t,r);return $L(i,o)}function Y5(e,t,r,o){return t.visited.includes(o)?r:o in e?G(e,zt(t.callstack,[...t.visited,o]),e[o]):r}function V5(e,t){let r=na(e,t),o=sa(r);return Xs(O.Assign(e,{[t]:o}),t)}function W5(e,t,r){let o=fs(e,t,r);return sa(o)}function Q5(e){let t=br(e);return sa(t)}function Z5(e){let t=e.map(r=>sa(r));return Pe(t)}function oW(e,t={}){return ee("RemoveOptional",[e],t)}function X5(e,t={}){return Nl(e,t)}function J5(e){let t=c.Keys(e).reduce((o,i)=>({...o,[i]:X5(e[i])}),{});return me(t)}function sa(e){return Mt(e)?V5(e.$defs,e.$ref):Sr(e)?W5(e.if,e.then,e.else):ge(e)?Q5(e.allOf):z(e)?Z5(e.anyOf):Te(e)?J5(e.properties):me({})}function SO(e,t={}){return ee("Required",[e],t)}function e8(e,t={}){return GL(e,t)}function GL(e,t){return Le([e])?O.Update(sa(e),{},t):SO(e,t)}function t8(e,t,r,o){let i=G(e,t,r);return GL(i,o)}function _O(e,t={}){return ee("ReturnType",[e],t)}function r8(e,t={}){return BL(e,t)}function lwe(e){return vr(e)?e.returnType:St()}function BL(e,t){return Le([e])?O.Update(lwe(e),{},t):_O(e,t)}function n8(e,t,r,o={}){let i=G(e,t,r);return BL(i,o)}function IO(e,t){return ee("With",[e,t],{})}function BO(e,t){return jL(e,t)}function jL(e,t){return Le([e])?O.Update(e,{},t):IO(e,t)}function o8(e,t,r,o){let i=G(e,t,r);return jL(i,o)}function dwe(e){return Fu(e)?Ge(e.items)?qL(e.items.items):Lr(e.items)?[e]:yt(e.items)?[e]:[St()]:[e]}function qL(e){return e.reduce((r,o)=>[...r,...dwe(o)],[])}function zt(e,t){return{callstack:e,visited:t}}function Le(e){return c.ShiftLeft(e,(t,r)=>yt(t)?!1:Le(r),()=>!0)}function OE(e,t,r){return c.Keys(r).reduce((o,i)=>({...o,[i]:G(e,t,r[i])}),{})}function ju(e,t,r){let o=si(e,t,r);return qL(o)}function si(e,t,r){return r.map(o=>G(e,t,o))}function mwe(e,t){let r=Nr(e)?Vs(t,{}):t,o=Ec(e)?Ys(r,{}):r;return Ul(e)?kE(o,{}):o}function fwe(e,t,r,o,i){return c.IsEqual(r,"AddImmutable")?i8(e,t,o[0],i):c.IsEqual(r,"RemoveImmutable")?f6(e,t,o[0],i):c.IsEqual(r,"AddReadonly")?YV(e,t,o[0],i):c.IsEqual(r,"RemoveReadonly")?B4(e,t,o[0],i):c.IsEqual(r,"AddOptional")?VV(e,t,o[0],i):c.IsEqual(r,"RemoveOptional")?G4(e,t,o[0],i):c.IsEqual(r,"Capitalize")?b6(e,t,o[0],i):c.IsEqual(r,"Conditional")?R6(e,t,o[0],o[1],o[2],o[3],i):c.IsEqual(r,"ConstructorParameters")?U6(e,t,o[0],i):c.IsEqual(r,"Evaluate")?n6(e,t,o[0],i):c.IsEqual(r,"Exclude")?v6(e,t,o[0],o[1],i):c.IsEqual(r,"Extract")?M6(e,t,o[0],o[1],i):c.IsEqual(r,"Index")?s5(e,t,o[0],o[1],i):c.IsEqual(r,"InstanceType")?c5(e,t,o[0],i):c.IsEqual(r,"Interface")?zQ(e,t,o[0],o[1],i):c.IsEqual(r,"KeyOf")?h5(e,t,o[0],i):c.IsEqual(r,"Lowercase")?x6(e,t,o[0],i):c.IsEqual(r,"Mapped")?S5(e,t,o[0],o[1],o[2],o[3],i):c.IsEqual(r,"Module")?$O(e,t,o[0],i):c.IsEqual(r,"NonNullable")?I5(e,t,o[0],i):c.IsEqual(r,"Pick")?D5(e,t,o[0],o[1],i):c.IsEqual(r,"Parameters")?C5(e,t,o[0],i):c.IsEqual(r,"Partial")?k5(e,t,o[0],i):c.IsEqual(r,"Omit")?O5(e,t,o[0],o[1],i):c.IsEqual(r,"ReadonlyObject")?z5(e,t,o[0],i):c.IsEqual(r,"Record")?o3(e,t,o[0],o[1],i):c.IsEqual(r,"Required")?t8(e,t,o[0],i):c.IsEqual(r,"ReturnType")?n8(e,t,o[0],i):c.IsEqual(r,"TemplateLiteral")?pQ(e,t,o[0],i):c.IsEqual(r,"Uncapitalize")?O6(e,t,o[0],i):c.IsEqual(r,"Uppercase")?A6(e,t,o[0],i):c.IsEqual(r,"With")?o8(e,t,o[0],o[1]):ee(r,o,i)}function gwe(e,t,r){let o=yt(r)?Y5(e,t,r,r.$ref):Ze(r)?Io(G(e,t,r.items),Qm(r)):ff(r)?DO(e,t,r.target,r.arguments):wr(r)?Ws(si(e,t,r.parameters),G(e,t,r.instanceType),WV(r)):vr(r)?Qs(si(e,t,r.parameters),G(e,t,r.returnType),QV(r)):Sr(r)?Rl(G(e,t,r.if),G(e,t,r.then),G(e,t,r.else),r4(r)):ge(r)?Kn(si(e,t,r.allOf),a4(r)):Te(r)?me(OE(e,t,r.properties),e4(r)):_t(r)?Jx(Hr(r),G(e,t,Zt(r))):Fu(r)?Ll(G(e,t,r.items)):Ge(r)?Ir(ju(e,t,r.items),F4(r)):z(r)?Pe(si(e,t,r.anyOf),R4(r)):r;return mwe(r,o)}function G(e,t,r){return wu(r)?fwe(e,t,r.action,r.parameters,r.options):gwe(e,t,r)}function Li(e,t){return G(e,zt([],[]),t)}function kE(e,t){return O.Update(e,{"~immutable":!0},t)}function i8(e,t,r,o){let i=G(e,t,r);return kE(i,o)}function iW(e,t={}){return ee("AddImmutable",[e],t)}function Jm(e,t={}){return kE(e,t)}function sW(e,t={}){return ee("RemoveReadonly",[e],t)}function aW(e,t={}){return ee("Evaluate",[e],t)}function Nn(e,t={}){return yL(e,t)}function cW(e,t={}){return ee("Module",[e],t)}function s8(e,t={}){return $O({},zt([],[]),e,t)}function hwe(e,t){let r=nf(e,t);return c.IsEqual(r,mE)||c.IsEqual(r,PE)?1:0}function a8(e,t,r=[]){return c.ShiftLeft(t,(o,i)=>c.IsEqual(hwe(e,o),1)?a8(e,i,[...r,o]):[...r,e,...t],()=>[...r,e])}function c8(e,t=[]){return c.ShiftLeft(e,(r,o)=>c8(o,a8(r,t)),()=>t)}function u8(e){return c8(e)}function p8(...e){let[t,r,o]=ot.Match(e,{2:(a,u)=>c.IsString(a)?[{},a,u]:[a,u,{}],3:(a,u,l)=>[a,u,l],1:a=>[{},a,{}]}),i=iQ(r),s=c.IsArray(i)&&c.IsEqual(i.length,2)?G(t,zt([],[]),i[0]):St();return O.Update(s,{},o)}var n={};yi(n,{Any:()=>Xm,Array:()=>Io,BigInt:()=>aE,Boolean:()=>Bx,Call:()=>d6,Capitalize:()=>T6,Codec:()=>Fx,Conditional:()=>C6,Constructor:()=>Ws,ConstructorParameters:()=>P6,Cyclic:()=>Xs,Decode:()=>E4,DecodeBuilder:()=>sE,Dependent:()=>Rl,Encode:()=>T4,EncodeBuilder:()=>iE,Enum:()=>s4,Evaluate:()=>Nn,Exclude:()=>w6,Extends:()=>vn,ExtendsResult:()=>be,Extract:()=>N6,Function:()=>Qs,Generic:()=>vu,Identifier:()=>cE,Immutable:()=>S4,Index:()=>D6,Infer:()=>nE,InstanceType:()=>a5,Instantiate:()=>Li,Integer:()=>wl,Interface:()=>YQ,Intersect:()=>Kn,IsAny:()=>dr,IsArray:()=>Ze,IsBigInt:()=>$o,IsBoolean:()=>so,IsCall:()=>ff,IsCodec:()=>Pl,IsConstructor:()=>wr,IsCyclic:()=>Mt,IsDependent:()=>Sr,IsEnum:()=>Mr,IsEnumValue:()=>i4,IsFunction:()=>vr,IsGeneric:()=>Zm,IsIdentifier:()=>x4,IsImmutable:()=>Ul,IsInfer:()=>Lr,IsInteger:()=>dn,IsIntersect:()=>ge,IsKind:()=>W,IsLiteral:()=>ze,IsNever:()=>Do,IsNull:()=>ea,IsNumber:()=>ar,IsObject:()=>Te,IsOptional:()=>Nr,IsParameter:()=>C4,IsReadonly:()=>Ec,IsRecord:()=>_t,IsRef:()=>yt,IsRefine:()=>Gx,IsRest:()=>Fu,IsSchema:()=>sr,IsString:()=>qr,IsSymbol:()=>ta,IsTemplateLiteral:()=>Dt,IsThis:()=>rO,IsTuple:()=>Ge,IsUndefined:()=>gs,IsUnion:()=>z,IsUnknown:()=>kr,IsUnsafe:()=>Nx,IsVoid:()=>Bo,KeyOf:()=>u5,Literal:()=>$e,Lowercase:()=>S6,Mapped:()=>y5,Module:()=>s8,Never:()=>St,NonNullable:()=>_5,Null:()=>ef,Number:()=>Go,Object:()=>me,Omit:()=>b5,Optional:()=>XV,Parameter:()=>vl,Parameters:()=>A5,Partial:()=>R5,Pick:()=>L5,Readonly:()=>_4,ReadonlyObject:()=>FL,ReadonlyType:()=>F5,Record:()=>sf,RecordKey:()=>af,RecordPattern:()=>Hr,RecordValue:()=>Zt,Ref:()=>pn,Refine:()=>I4,Required:()=>e8,Rest:()=>Ll,ReturnType:()=>r8,Script:()=>p8,String:()=>wn,Symbol:()=>tf,TemplateLiteral:()=>dQ,This:()=>tO,Tuple:()=>Ir,Uncapitalize:()=>_6,Undefined:()=>cf,Union:()=>Pe,Unknown:()=>jr,Unsafe:()=>t4,Uppercase:()=>I6,Void:()=>nO,With:()=>BO});function wt(e){throw new Error(`assertUnreachable: ${JSON.stringify(e,null,2)}`)}var l8="Must be a valid tags query: only tag:value searches (no wildcards), boolean operators, and parentheses are supported.";var ywe=Cs(m8());var f8="lowercase-email",$l="iana-timezone",HL="simple-time",KL="simple-date-time";var g8="lowercase-domain";var Mi="kebab-case";var h8="camel-case";var y8="upper-snake-case";var E8="http-url";var T8="^https://[^/?#@]*([/?#]|$)";var Ewe="x-tsuga-internal",Twe=new Set;function D(e,t,r={}){let o=t.map(s=>{let a=s;return a.$id?(Twe.add(s),n.Ref(a.$id)):s}),i=t.flatMap(s=>{if(s[Ewe]===!0)return[];let a=s.properties?.[e];return typeof a?.const=="string"?[a.const]:a?.enum?.filter(u=>typeof u=="string")??[]});return n.Unsafe({...r,type:"object",discriminator:{propertyName:e},required:[e],oneOf:o,...i.length>0&&{errorMessage:{discriminator:`value of tag "${e}" must be one of: ${i.join(", ")}`}}})}function he(e,t){return n.Object({values:n.Array(e,{...t.minItems!==void 0&&{minItems:t.minItems},...t.maxItems!==void 0&&{maxItems:t.maxItems},...t.uniqueItems&&{uniqueItems:!0},description:"Values compared by this filter. When `exclude` is omitted or false, rows matching any value are kept; when `exclude` is true, matching rows are removed."}),exclude:n.Optional(n.Boolean({description:"If true, exclude rows matching these values instead of including them"}))},{description:t.description})}function ui(e,t={}){return D("type",[n.Object({type:n.Literal("ids"),ids:n.Array(p({allowEmpty:!1}),{minItems:1,uniqueItems:!0,...t.maxIds!==void 0&&{maxItems:t.maxIds}})}),n.Object({type:n.Literal("all"),filters:n.Optional(e)})])}function Oo(e){return n.Object({value:p({allowEmpty:!1,description:e.valueDescription}),exclude:n.Optional(n.Boolean({description:"If true, exclude rows matching this value instead of including them"}))},{description:e.description})}var qu=1e3,qO=100,fe={limit:n.Optional(n.Integer({minimum:1,maximum:qu,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."}))},Swe=["asc","desc"],le=n.Enum(Swe,{description:"Sort direction: ascending or descending."}),qe={...fe,limit:n.Optional(n.Integer({minimum:1,maximum:qu,default:qO,description:`Maximum number of items to return in this page. Omit to use the public API default of ${qO}.`}))},_we=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."}),Mvt=n.Object({pagination:_we},{$id:"ResponseMetadata",description:"Metadata accompanying `data` on paginated operations, describing the full result set the page was taken from."});function Ye(e,t={}){return n.Optional(n.Union([n.Null(),e],t))}function S8(e){return{...e,method:"PUT"}}function w(e={}){return n.Unsafe({...e,type:"string"})}var ci=250,Iwe=1e4;function p({allowEmpty:e=!0,type:t="short",description:r,default:o}={}){let i=e?0:1,s={...r===void 0?{}:{description:r},...o===void 0?{}:{default:o}};switch(t){case"camel-case":return n.String({format:h8,minLength:i,maxLength:ci,...s});case"kebab-case":return n.String({format:Mi,minLength:i,maxLength:ci,...s});case"upper-snake-case":return n.String({format:y8,minLength:i,maxLength:ci,...s});case"email":return n.String({format:f8,minLength:i,maxLength:254,errorMessage:{format:"Must be a valid lowercase email address."},...s});case"lowercase-domain":return n.String({format:g8,minLength:i,maxLength:ci,...s});case"tsuga-query":return n.String({format:"tsuga-query",minLength:i,maxLength:Iwe,...s});case"tags-query":return n.String({format:"tags-query",minLength:i,maxLength:1e4,errorMessage:{format:`${l8} The query you provided is invalid: \${0}`},...s});case"date-time":return n.String({format:"date-time",...s});case"uri":return n.String({format:"uri",pattern:T8,errorMessage:{pattern:"Must be an HTTPS URL without credentials (user:password@)."},...s});case"user-password":return n.String({format:"user-password",minLength:12,maxLength:ci,...s});case"long":return n.String({minLength:i,maxLength:5e4,...s});case"short":return n.String({minLength:i,maxLength:ci,...s});case"tsuga-formula":return n.String({format:"tsuga-formula",minLength:i,maxLength:ci,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:wt(t)}}var LE=["ingestion-api-key","operation-api-key","rum-public-token","dashboard","log-route","metric-route","monitor","notification-rule","notification-silence","slo","span-route"],HO=n.Array(n.Enum(LE,{description:"Tsuga-managed asset type."}),{description:"Tsuga-managed asset types covered by the policy. An empty array means all supported asset types."});var zL=["CLUSTER_DB_QUERY_INVALID_CONNECTION_PARAMS","CLUSTER_DB_QUERY_INVALID_CREDENTIALS","CLUSTER_DB_QUERY_PERMISSION_DENIED","CLUSTER_DB_QUERY_QUERY_SYNTAX_ERROR","CLUSTER_DB_QUERY_DATABASE_UNREACHABLE","CLUSTER_DB_QUERY_CONNECTION_FAILED","CLUSTER_DB_QUERY_QUERY_EXECUTION_FAILED","CLUSTER_DB_QUERY_QUERY_TIMEOUT","CLUSTER_DB_QUERY_CONNECTION_TIMEOUT","CLUSTER_DB_QUERY_CONNECTION_POOL_TIMEOUT"],Wvt=n.Enum(zL),bwe=["CLUSTER_AGGREGATION_BUCKET_LIMIT_EXCEEDED","CLUSTER_AGGREGATION_FORMULA","CLUSTER_AGGREGATION_INTERVAL_PARSE_ERROR","CLUSTER_AGGREGATION_PROMQL","CLUSTER_AGGREGATION_STRUCTURE","CLUSTER_AGGREGATION_SYNTAX"];var Qvt=n.Object({code:n.Enum(zL),message:n.String()}),b8=[...zL,...bwe,"ABORT_ERROR","BAD_REQUEST","CUSTOM_ROLE_IN_USE","CUSTOM_ROLE_NAME_CONFLICT","DATA_DELETION_LIMIT_EXCEEDED","DATA_DELETION_REQUEST_NOT_ACTIVE","DUPLICATE_KEY_VIOLATION","FOREIGN_KEY_VIOLATION","FST_ERR_VALIDATION","GROK_RULE_VALIDATION_ERROR","INVALID_INPUT","FORBIDDEN","MISSING_PERMISSION","PRIVILEGE_ESCALATION","RATE_LIMITED","RESERVED_TAG_POLICY_ERROR","RESOURCE_NOT_FOUND","INVALID_INVITATION","TAG_POLICY_ALREADY_EXISTS_ERROR","TAG_POLICY_VALIDATION_ERROR","UNAUTHORIZED","URL_NOT_FOUND"],x8=["INTERNAL_ERROR","INVALID_QUERY_TO_CLUSTER","CLUSTER_DB_QUERY_CONNECTION_POOL_TIMEOUT"];var xwe=["NETWORK_ERROR","RESPONSE_PARSE_ERROR"],Owe=[...b8,...x8,...xwe],Awe=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(LE,{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."}),Cwe=D("type",[n.Object({type:n.Literal("invalid-syntax",{description:"Discriminator identifying a rule the grok parser could not parse at all."}),error:n.Object({offset:n.Integer({description:"Byte offset in the rule where parsing failed."}),detail:n.String({description:"Parser detail message."})},{description:"Position and parser message for the syntax failure."})},{$id:"GrokInvalidSyntax"}),n.Object({type:n.Literal("unknown-pattern",{description:"Discriminator identifying a rule that references a pattern name the grok engine does not provide."}),error:n.Object({offset:n.Integer({description:"Byte offset of the unknown pattern."}),unknownPattern:n.String({description:"The pattern name that is not supported."})},{description:"Position and name of the unsupported pattern."})},{$id:"GrokUnknownPattern"}),n.Object({type:n.Literal("invalid-filter",{description:"Discriminator identifying a rule whose filter is a known filter used incorrectly."}),error:n.Object({offset:n.Integer({description:"Byte offset of the invalid filter."}),invalidFilter:n.String({description:"The filter that is invalid."}),message:n.String({description:"Why the filter is invalid."})},{description:"Position, text, and reason for the invalid filter."})},{$id:"GrokInvalidFilter"}),n.Object({type:n.Literal("unknown-filter",{description:"Discriminator identifying a rule that references a filter name the grok engine does not implement."}),error:n.Object({offset:n.Integer({description:"Byte offset of the unknown filter."}),unknownFilter:n.String({description:"The filter name that is not implemented."}),message:n.String({description:"Details about the unsupported filter."})},{description:"Position and name of the unimplemented filter."})},{$id:"GrokUnknownFilter"})],{description:"Full structured detail of a grok rule that failed to compile, discriminated by `type`."}),Rwe=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:Cwe},{description:"A single grok rule that failed to compile, with its position in the submitted rules and the structured compile error."}),O8=D("type",[n.Object({type:n.Literal("tag_policy_violation",{description:"Discriminator identifying tag-policy validation details. Set by Tsuga to `tag_policy_violation`. Returned when the error code is `TAG_POLICY_VALIDATION_ERROR`."}),violations:n.Array(Awe,{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(Rwe,{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."}),YL={hint:n.Optional(n.String({description:"One next step that fixes the error, such as the field to change or how long to wait. Omitted when the code covers too many cases for one step, and the message then says what to change."})),docUrl:n.Optional(n.String({description:"Absolute URL of the public documentation section that explains this error and how to fix it."}))},Zvt=n.Object({code:n.Optional(n.Enum(Owe,{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(O8),...YL},{$id:"ErrorResponse",description:"Standard envelope for API errors"}),Xvt=n.Object({code:n.Optional(n.Enum(b8,{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(O8),...YL},{$id:"ClientErrorResponse",description:"Standard envelope for client (4XX) API errors"}),Jvt=n.Object({code:n.Optional(n.Enum(x8,{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"}),...YL},{$id:"ServerErrorResponse",description:"Standard envelope for server (5XX) API errors"}),eNt=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"}),tNt=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 f({body:e,description:t,method:r,operationId:o,params:i,tags:s,query:a,paginated:u,response:l,url:d}){return i?{buildUrl:y=>d.replace(/:[a-zA-Z_]+/g,E=>encodeURIComponent(y[E.slice(1)])),method:r,params:i,response:l,templateUrl:d,...e===void 0?{}:{body:e},...t===void 0?{}:{description:t},...o===void 0?{}:{operationId:o},...a===void 0?{}:{query:a},...u===void 0?{}:{paginated:u},...s===void 0?{}:{tags:s}}:{method:r,response:l,url:d,templateUrl:d,...e===void 0?{}:{body:e},...t===void 0?{}:{description:t},...o===void 0?{}:{operationId:o},...a===void 0?{}:{query:a},...u===void 0?{}:{paginated:u},...s===void 0?{}:{tags:s}}}function A8(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 ie="context";var Hu="trace_id",KO=`${ie}.team`,lNt=`${ie}.env`,dNt=`${ie}.api_key_id`,zO=`${ie}.service.name`,mNt=`${ie}.service.namespace`,fNt=`${ie}.service.version`,YO=`${ie}.span.kind`,VO=`${ie}.span.name`,Ku=`${ie}.status.code`,gNt=`${ie}.stack_trace`,Pwe="STATUS_CODE_ERROR",hNt=`${Ku}:${Pwe}`,VL="resource.attributes.team",C8=["SPAN_KIND_UNSPECIFIED","SPAN_KIND_INTERNAL","SPAN_KIND_SERVER","SPAN_KIND_CLIENT","SPAN_KIND_PRODUCER","SPAN_KIND_CONSUMER"];var zu="span_id",Gl="parent_span_id",ME="service.version",aa="process.exit.code",DE="process.runtime.version",FE="os.type",Bl="error.type",WO="http.response.status_code",$E="cli.command",GE="cli.duration_ms",QO="cli.error.code",Tf="cli.flags",BE="cli.output_format",jE="cli.caller",R8="cli.auth.method",P8="cli.has_config_file",ZO="cli.signal",U8="cli.query.data_source",w8="cli.query.type",v8="cli.query.time_range_seconds",WL="cli.query.has_filter",N8="cli.query.group_by_count",k8="cli.query.result_count",L8="cli.query.series_count",M8="cli.query.datapoint_count",D8="cli.docs.search_result_count",F8="cli.docs.path",$8="cli.docs.search_query",XO="cli.agent.session.id",JO=`${ie}.host.name`,yNt=`${ie}.telemetry.sdk.language`,ENt=`${ie}.scope.name`,TNt=`${ie}.page.id`,SNt=`${ie}.app.name`,_Nt=`${ie}.page.attributes.view_id`,INt=`${ie}.session.id`,bNt=`${ie}.cloud.provider`,xNt=`${ie}.cloud.platform`,ONt=`${ie}.aws.ecs.task.arn`,ANt=`${ie}.aws.ecs.task.id`,CNt=`${ie}.aws.ecs.task.family`,RNt=`${ie}.aws.ecs.cluster.arn`,PNt=`${ie}.faas.name`,UNt=`${ie}.faas.invoked_provider`,wNt=`${ie}.gcp.label.service_name`,vNt=`${ie}.k8s.cluster.name`,NNt=`${ie}.k8s.cluster.uid`,kNt=`${ie}.k8s.namespace.name`,Uwe=`${ie}.k8s.pod.name`,LNt=`${ie}.k8s.pod.uid`,MNt=`${ie}.k8s.container.name`,DNt=`${ie}.k8s.node.name`,FNt=`${ie}.k8s.node.uid`,wwe=`${ie}.k8s.deployment.name`,$Nt=`${ie}.k8s.deployment.uid`,vwe=`${ie}.k8s.replicaset.name`,GNt=`${ie}.k8s.replicaset.uid`,Nwe=`${ie}.k8s.statefulset.name`,BNt=`${ie}.k8s.statefulset.uid`,kwe=`${ie}.k8s.daemonset.name`,jNt=`${ie}.k8s.daemonset.uid`,qNt=`${ie}.k8s.job.name`,HNt=`${ie}.k8s.job.uid`,KNt=`${ie}.k8s.cronjob.name`,zNt=`${ie}.k8s.cronjob.uid`,Sf="status_code",eA="span.name";var tA="span.kind";var Lwe="db.system.name",Mwe="db.system",Dwe="db.namespace",Fwe="db.name";var YNt=`span_attributes.${Dwe}`,VNt=`span_attributes.${Fwe}`,WNt=`span_attributes.${Lwe}`,QNt=`span_attributes.${Mwe}`;var $we="messaging.system",Gwe="messaging.destination.name";var ZNt=`span_attributes.${$we}`;var Bwe="messaging.consumer.group.name",XNt=`span_attributes.${Gwe}`,JNt=`span_attributes.${Bwe}`;var ekt={name:"tsuga.internal.processing_tag_policy_violations_total",attributes:{tagPolicyId:`${ie}.tag_policy_id`,dataSource:`${ie}.data_source`,sourceTeam:`${ie}.source_team`}};var tkt={name:"tsuga.internal.event_size_bytes",attributes:{batchKind:`${ie}.batch_kind`,batchKindMetricsFilter:`${ie}.batch_kind:metrics`,sourceApiKeyId:`${ie}.source_api_key_id`,sourceEnv:`${ie}.source_env`,sourceTeam:`${ie}.source_team`}};var QL="traces.span.metrics.calls",ZL="traces.span.metrics.duration",XL="__tsuga_metadata__",rkt=`${XL}.signature`,nkt=`${XL}.routes`,okt=`${XL}.trace_id_bucket`;var jwe=Math.pow(10,8)*24*60*60*1e3,skt=-jwe;var G8=864e5,B8=6e4,j8=36e5;var qwe=3600;var q8=qwe*24,akt=q8*7,Hwe=q8*365.2425,Kwe=Hwe/12,ckt=Kwe*3,JL=Symbol.for("constructDateFrom");function hs(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&JL in e?e[JL](t):e instanceof Date?new e.constructor(t):new Date(t)}function Kr(e,t){return hs(t||e,e)}function H8(e,t,r){let o=Kr(e,r?.in);return isNaN(t)?hs(r?.in||e,NaN):(t&&o.setDate(o.getDate()+t),o)}function K8(e,t,r){let o=Kr(e,r?.in);if(isNaN(t))return hs(r?.in||e,NaN);if(!t)return o;let i=o.getDate(),s=hs(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 _f(e,t,r){let{years:o=0,months:i=0,weeks:s=0,days:a=0,hours:u=0,minutes:l=0,seconds:d=0}=t,g=Kr(e,r?.in),y=i||o?K8(g,i+o*12):g,E=a||s?H8(y,a+s*7):y,h=l+u*60,T=(d+h*60)*1e3;return hs(r?.in||e,+E+T)}var zwe={};function z8(){return zwe}function e0(e){let t=Kr(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 co(e,...t){let r=hs.bind(null,e||t.find(o=>typeof o=="object"));return t.map(r)}function t0(e,t){let r=Kr(e,t?.in);return r.setHours(0,0,0,0),r}function Y8(e,t,r){let[o,i]=co(r?.in,e,t),s=t0(o),a=t0(i),u=+s-e0(s),l=+a-e0(a);return Math.round((u-l)/G8)}function jl(e,t){let r=+Kr(e)-+Kr(t);return r<0?-1:r>0?1:r}function V8(e,t,r){let[o,i]=co(r?.in,e,t),s=o.getFullYear()-i.getFullYear(),a=o.getMonth()-i.getMonth();return s*12+a}function W8(e,t,r){let[o,i]=co(r?.in,e,t);return o.getFullYear()-i.getFullYear()}function Z8(e,t,r){let[o,i]=co(r?.in,e,t),s=Q8(o,i),a=Math.abs(Y8(o,i));o.setDate(o.getDate()-s*a);let u=+(Q8(o,i)===-s),l=s*(a-u);return l===0?0:l}function Q8(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 If(e){return t=>{let o=(e?Math[e]:Math.trunc)(t);return o===0?0:o}}function X8(e,t,r){let[o,i]=co(r?.in,e,t),s=(+o-+i)/j8;return If(r?.roundingMethod)(s)}function rA(e,t){return+Kr(e)-+Kr(t)}function J8(e,t,r){let o=rA(e,t)/B8;return If(r?.roundingMethod)(o)}function e7(e,t){let r=Kr(e,t?.in);return r.setHours(23,59,59,999),r}function t7(e,t){let r=Kr(e,t?.in),o=r.getMonth();return r.setFullYear(r.getFullYear(),o+1,0),r.setHours(23,59,59,999),r}function r7(e,t){let r=Kr(e,t?.in);return+e7(r,t)==+t7(r,t)}function n7(e,t,r){let[o,i,s]=co(r?.in,e,e,t),a=jl(i,s),u=Math.abs(V8(i,s));if(u<1)return 0;i.getMonth()===1&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-a*u);let l=jl(i,s)===-a;r7(o)&&u===1&&jl(o,s)===1&&(l=!1);let d=a*(u-+l);return d===0?0:d}function o7(e,t,r){let o=rA(e,t)/1e3;return If(r?.roundingMethod)(o)}function i7(e,t,r){let[o,i]=co(r?.in,e,t),s=jl(o,i),a=Math.abs(W8(o,i));o.setFullYear(1584),i.setFullYear(1584);let u=jl(o,i)===-s,l=s*(a-+u);return l===0?0:l}function s7(e,t){let[r,o]=co(e,t.start,t.end);return{start:r,end:o}}var Ywe={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"}},a7=(e,t,r)=>{let o,i=Ywe[e];return typeof i=="string"?o=i:t===1?o=i.one:o=i.other.replace("{{count}}",t.toString()),r?.addSuffix?r.comparison&&r.comparison>0?"in "+o:o+" ago":o};function nA(e){return(t={})=>{let r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}var Vwe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Wwe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Qwe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},c7={date:nA({formats:Vwe,defaultWidth:"full"}),time:nA({formats:Wwe,defaultWidth:"full"}),dateTime:nA({formats:Qwe,defaultWidth:"full"})};var Zwe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},u7=(e,t,r,o)=>Zwe[e];function bf(e){return(t,r)=>{let o=r?.context?String(r.context):"standalone",i;if(o==="formatting"&&e.formattingValues){let a=e.defaultFormattingWidth||e.defaultWidth,u=r?.width?String(r.width):a;i=e.formattingValues[u]||e.formattingValues[a]}else{let a=e.defaultWidth,u=r?.width?String(r.width):e.defaultWidth;i=e.values[u]||e.values[a]}let s=e.argumentCallback?e.argumentCallback(t):t;return i[s]}}var Xwe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Jwe={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},eve={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"]},tve={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"]},rve={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"}},nve={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"}},ove=(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"},p7={ordinalNumber:ove,era:bf({values:Xwe,defaultWidth:"wide"}),quarter:bf({values:Jwe,defaultWidth:"wide",argumentCallback:e=>e-1}),month:bf({values:eve,defaultWidth:"wide"}),day:bf({values:tve,defaultWidth:"wide"}),dayPeriod:bf({values:rve,defaultWidth:"wide",formattingValues:nve,defaultFormattingWidth:"wide"})};function xf(e){return(t,r={})=>{let o=r.width,i=o&&e.matchPatterns[o]||e.matchPatterns[e.defaultMatchWidth],s=t.match(i);if(!s)return null;let a=s[0],u=o&&e.parsePatterns[o]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(u)?sve(u,y=>y.test(a)):ive(u,y=>y.test(a)),d;d=e.valueCallback?e.valueCallback(l):l,d=r.valueCallback?r.valueCallback(d):d;let g=t.slice(a.length);return{value:d,rest:g}}}function ive(e,t){for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function sve(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}function l7(e){return(t,r={})=>{let o=t.match(e.matchPattern);if(!o)return null;let i=o[0],s=t.match(e.parsePattern);if(!s)return null;let a=e.valueCallback?e.valueCallback(s[0]):s[0];a=r.valueCallback?r.valueCallback(a):a;let u=t.slice(i.length);return{value:a,rest:u}}}var ave=/^(\d+)(th|st|nd|rd)?/i,cve=/\d+/i,uve={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},pve={any:[/^b/i,/^(a|c)/i]},lve={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},dve={any:[/1/i,/2/i,/3/i,/4/i]},mve={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},fve={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]},gve={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},hve={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]},yve={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},Eve={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}},d7={ordinalNumber:l7({matchPattern:ave,parsePattern:cve,valueCallback:e=>parseInt(e,10)}),era:xf({matchPatterns:uve,defaultMatchWidth:"wide",parsePatterns:pve,defaultParseWidth:"any"}),quarter:xf({matchPatterns:lve,defaultMatchWidth:"wide",parsePatterns:dve,defaultParseWidth:"any",valueCallback:e=>e+1}),month:xf({matchPatterns:mve,defaultMatchWidth:"wide",parsePatterns:fve,defaultParseWidth:"any"}),day:xf({matchPatterns:gve,defaultMatchWidth:"wide",parsePatterns:hve,defaultParseWidth:"any"}),dayPeriod:xf({matchPatterns:yve,defaultMatchWidth:"any",parsePatterns:Eve,defaultParseWidth:"any"})};var r0={code:"en-US",formatDistance:a7,formatLong:c7,formatRelative:u7,localize:p7,match:d7,options:{weekStartsOn:0,firstWeekContainsDate:1}};var Tve=["years","months","weeks","days","hours","minutes","seconds"];function m7(e,t){let r=z8(),o=t?.locale??r.locale??r0,i=t?.format??Tve,s=t?.zero??!1,a=t?.delimiter??" ";return o.formatDistance?i.reduce((l,d)=>{let g=`x${d.replace(/(^.)/,E=>E.toUpperCase())}`,y=e[d];return y!==void 0&&(s||e[d])?l.concat(o.formatDistance(g,y)):l},[]).join(a):""}function f7(e,t){let{start:r,end:o}=s7(t?.in,e),i={},s=i7(o,r);s&&(i.years=s);let a=_f(r,{years:i.years}),u=n7(o,a);u&&(i.months=u);let l=_f(a,{months:i.months}),d=Z8(o,l);d&&(i.days=d);let g=_f(l,{days:i.days}),y=X8(o,g);y&&(i.hours=y);let E=_f(g,{hours:i.hours}),h=J8(o,E);h&&(i.minutes=h);let S=_f(E,{minutes:i.minutes}),T=o7(o,S);return T&&(i.seconds=T),i}var i0t=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 g0t=60*1e3;var Z0t=1/1e6,ql=1e3,Hl=60*ql,o0=60*Hl,ca=24*o0,X0t=7*ca,J0t=30*ca;var iA=86400;var i0=["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 Ove={s:1,m:60,h:3600,d:86400,w:604800};function Ave(e){let t=Ove[e.at(-1)??""],r=e.slice(0,-1);return t&&r.length>0&&h7(r)?parseInt(r,10)*t:void 0}function h7(e){for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r<48||r>57)return!1}return!0}function Cve(){return Math.floor(Date.now()/1e3)}function sA(e,t=Cve()){if(typeof e=="number")return e;if(e==="now")return t;if(e.startsWith("-")){let o=Ave(e.slice(1));if(o!==void 0)return t-o}if(h7(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 Rve=`/${"v1"}/cli-runs`,Pve=["json","tsv","csv","pretty","text"],Uve=["claude-code","codex","opencode","gemini-cli","cline","agent","ci","terminal","script"],aA=["SIGINT","SIGTERM"],a0=32,c0=100,u0=64,Of=4096,s0="^(?!0+$)[0-9a-f]{16}$",wve=n.Object({name:n.String({minLength:1,maxLength:200}),kind:n.Enum(["internal","server","client","producer","consumer"]),[zu]:n.String({pattern:s0}),[Gl]:n.String({pattern:s0,description:"The run span for a span the CLI started at its top level."}),start_offset_ms:n.Number({minimum:0,maximum:ca,description:"Start of the span, from the start of the run."}),duration_ms:n.Number({minimum:0,maximum:ca}),status_code:n.Enum(["unset","error"]),attributes:n.Record(n.String({maxLength:200}),n.Union([n.String({maxLength:Of}),n.Number(),n.Boolean()]),{maxProperties:u0})}),y7=n.Object({[ME]:n.String({pattern:"^[0-9A-Za-z.+-]{1,40}$",description:"Version of the CLI that ran."}),[$E]:n.String({pattern:"^[a-z0-9 -]{0,120}$",description:"Command path without its arguments, e.g. `monitors list`."}),[GE]:n.Integer({minimum:0,maximum:ca,description:"Run duration."}),[aa]:n.Integer({minimum:0,maximum:255,description:"Process exit code."}),[Bl]:n.Optional(n.String({pattern:"^[A-Za-z]{1,64}$",description:"Kind of failure, e.g. `TransportError`."})),[WO]:n.Optional(n.Integer({minimum:100,maximum:599,description:"HTTP status of the API response that failed the run, when the API answered."})),[QO]:n.Optional(n.String({pattern:"^[A-Z0-9_]{1,64}$",description:"Machine-readable code of the API error that failed the run, e.g. `RESOURCE_NOT_FOUND`."})),[Tf]:n.Optional(n.Array(n.String({maxLength:Of}),{maxItems:a0,description:"Command-line arguments from the first flag on, with their values, e.g. `--query`, `level:ERROR`."})),[BE]:n.Optional(n.Enum(Pve,{description:"`pretty` when `--pretty` was passed. Older CLI versions report the `-o` value."})),[jE]:n.Optional(n.Enum(Uve,{description:"What ran the command: a known coding agent (from the environment variable it sets), `agent` (another agent that sets `AGENT` or `AI_AGENT`), `ci` (`CI` was set), `terminal` (a person at an interactive terminal), or `script` (anything else)."})),[XO]:n.Optional(n.String({pattern:"^[0-9a-f]{64}$",description:"Stable hash of a coding agent session ID, when one is available."})),[ZO]:n.Optional(n.Enum(aA,{description:"Signal that interrupted the run."})),[FE]:n.String({pattern:"^[a-z0-9]{1,20}$",description:"e.g. `darwin`."}),[DE]:n.String({pattern:"^[0-9.]{1,20}$",description:"e.g. `24.1.0`."}),[Hu]:n.String({pattern:"^(?!0+$)[0-9a-f]{32}$",description:"W3C trace ID the CLI sent with its API calls during the run."}),[zu]:n.String({pattern:s0,description:"W3C span ID of the run span, the parent of the spans the CLI started at its top level."}),spans:n.Optional(n.Array(wve,{maxItems:c0,description:"Spans the CLI recorded during the run, API calls included."}))}),vve={[ME]:"1.40.0",[$E]:"monitors list",[GE]:412,[aa]:0,[Tf]:["--fields","name","-o","tsv"],[BE]:"tsv",[jE]:"terminal",[FE]:"darwin",[DE]:"24.1.0",[Hu]:"4bf92f3577b34da6a3ce929d0e0e4736",[zu]:"00f067aa0ba902b7"};Object.assign(y7,{examples:[vve]});var E7=n.Object({id:n.String({description:"API request ID the run was recorded under."})},{description:"Acknowledgement of a recorded CLI run"});Object.assign(E7,{examples:[{id:"request-123-abc"}]});var T7=f({description:"Record one Tsuga CLI run, sent only by CLIs that opted in with `TSUGA_TELEMETRY=1`. Unauthenticated, so that runs which failed before or during authentication are recorded too.",tags:["private"],url:Rve,method:"POST",body:y7,response:E7});function p0(e,t){if(e!==null&&typeof e=="object"&&Object.hasOwn(e,t))return e[t];let r=e;for(let o of t.split(".")){if(r===null||typeof r!="object"||!Object.hasOwn(r,o))return;r=r[o]}return r}function l0(e,t){let r=Object.create(null);for(let o of t){let i=p0(e,o);if(i===void 0)continue;if(Object.hasOwn(e,o)){r[o]=i;continue}let s=o.split("."),a=s.pop();if(a===void 0)continue;let u=r;for(let l of s)(typeof u[l]!="object"||u[l]===null)&&(u[l]=Object.create(null)),u=u[l];u[a]=i}return r}var Af=class extends He("OAuthTokenError"){},ua=class extends He("TransportError"){},Cf=class extends He("ResponseDecodeError"){},_c=class extends He("LoginFailed"){},Rf=class extends He("ConfigCorrupted"){},Pf=class extends He("ConfigUnreadable"){},Yu=class extends He("NoCredentials"){},Kl=class extends He("SessionExpired"){},Uf=class extends He("KeychainUnwritable"){},zl=class extends He("ExternalCommandError"){},Ic=class extends He("UntrustedApiUrl"){},wf=class extends He("FieldsNotFound"){},Vu=class extends He("NonJsonResponse"){},ys=class e extends He("ApiError"){static fromErrorResponse(t,r){return new e({message:t.message,...t.statusCode===void 0?{}:{statusCode:t.statusCode},...t.code===void 0?{}:{code:t.code},...r===void 0?{}:{requestId:r},...t.details===void 0?{}:{details:t.details},...t.suggestions===void 0?{}:{suggestions:t.suggestions}})}};function Yl(e){return Nve()?`\x1B[2m${e}\x1B[0m`:e}function Nve(){return process.stdout.isTTY&&!process.env.NO_COLOR}var kve=120;function S7(){return process.stdout.columns||kve}var _7=" ",Lve=8,Mve=3,I7=/\u001b\[[0-9;]*m/g;function b7(e){return e.map(t=>({header:t,value:t}))}function x7(e,t,r){let o=t.map(a=>{let u=e.map(l=>Bve(l,a));return{column:a,cells:u,width:Math.max(a.header.length,...u.map(d0))}});r.truncate&&Dve(o,r.width);let i=a=>o.map((u,l)=>Fve(Gve(a[l]??"",u.width),u.width,u.column.align??"left")).join(_7).trimEnd();return[i(o.map(a=>Yl(a.column.header.toUpperCase()))),...e.map((a,u)=>i(o.map(l=>l.cells[u]??"")))].join(`
|
|
270
270
|
`)}function Dve(e,t){let r=()=>e.reduce((o,i)=>o+i.width,0)+_7.length*(e.length-1);for(;r()>t;){let i=e.filter(s=>(s.column.priority??1)>0&&s.width>Lve).sort((s,a)=>(a.column.priority??1)-(s.column.priority??1)||a.width-s.width)[0];if(!i)return;i.width-=1}}function Fve(e,t,r){let o=" ".repeat(Math.max(0,t-d0(e)));return r==="right"?`${o}${e}`:`${e}${o}`}var $ve=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/;function Gve(e,t){return d0(e)<=t?e:`${e.replace(I7,"").slice(0,Math.max(0,t-1))}\u2026`}function d0(e){return e.replace(I7,"").length}function Bve(e,t){let r=typeof t.value=="function"?t.value(e):p0(e,t.value);return t.format?t.format(r):O7(r)}function O7(e){if(e==null||e==="")return Yl("-");if(typeof e=="boolean")return e?"yes":"no";if(typeof e=="string")return $ve.test(e)?jve(e):e;if(typeof e=="number"||typeof e=="bigint")return String(e);if(Array.isArray(e)){if(e.length===0)return Yl("-");let t=e.slice(0,Mve).map(o=>O7(o)),r=e.length-t.length;return r>0?`${t.join(", ")} ${Yl(`+${r} more`)}`:t.join(", ")}return typeof e=="object"?Yl(`{${Object.keys(e).length} keys}`):Yl("-")}function jve(e){let t=Date.parse(e);if(Number.isNaN(t))return e;let r=Sm(ns(t));return`${`${r.getFullYear()}-${cA(r.getMonth()+1)}-${cA(r.getDate())}`} ${cA(r.getHours())}:${cA(r.getMinutes())}`}function cA(e){return String(e).padStart(2,"0")}var uA=Ie("common-cli/OutputFields",{defaultValue:()=>{}}),HE=Ie("common-cli/StdoutIsTTY",{defaultValue:()=>process.stdout.isTTY}),m0=Ie("common-cli/IsInteractive",{defaultValue:()=>!process.env.CI&&process.stdin.isTTY&&process.stdout.isTTY&&process.stderr.isTTY}),De=e=>en(e),Es=k(function*(e,t){yield*en(JSON.stringify(yield*A7(e,t),null,2))}),xe=k(function*(e,t){yield*en(JSON.stringify({...e,data:yield*A7(e.data,t)},null,2))}),A7=k(function*(e,t){let r=t??(yield*uA);if(r===void 0||!qE(e))return e;let o=Array.isArray(e)?e.map(i=>qE(i)?l0(i,r):i):l0(e,r);return qve(e,o)?yield*new wf({message:`--fields ${r.join(",")} selected nothing from the response. Top-level fields: ${Hve(e).join(", ")}`,suggestions:["Pick paths from the fields listed above, with dots for nested fields","For any other shape, omit --fields and pipe the JSON to jq"]}):o});function qve(e,t){if(!Array.isArray(e))return Object.keys(t).length===0;let r=t;return e.some(qE)&&r.every(o=>!qE(o)||Object.keys(o).length===0)}function Hve(e){let t=Array.isArray(e)?e.find(qE):e;return t===void 0?[]:Object.keys(t).sort()}function qE(e){return e!==null&&typeof e=="object"}var C7=k(function*(e,t){if(e.length===0){yield*Yn("No results.");return}let r=t.fields??(yield*uA),o={truncate:yield*HE,width:S7()};yield*De(r===void 0&&t.prettyFormat!==void 0?t.prettyFormat(e,o):x7(e,b7(r??t.defaultFields),o))}),Yn=e=>Ay(e);function f0(e,t=r=>{process.exit(r)}){e.on("error",r=>{if(r.code==="EPIPE"){t(process.exitCode);return}throw r})}var B=n.Object({success:n.Literal(!0,{description:"Always `true` when the delete request completed and the resource was removed."})},{$id:"DeleteResponse",description:"Confirmation that the targeted resource was deleted.",example:{success:!0}});var g0="tsuga-cli";var Vl="/v0/oauth",R7=f({description:"OAuth 2.1 authorization endpoint: validates the client and redirect URI, then redirects to the consent page",url:`${Vl}/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)"})}),P7=f({description:"OAuth 2.1 token endpoint: exchanges an authorization code (PKCE) or refresh token for a token pair",url:`${Vl}/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()})}),OMt=f({description:"Resolve a signed authorization request handle for the consent page",url:`${Vl}/authorization-request`,method:"GET",query:n.Object({handle:n.String()}),response:n.Object({clientId:n.String(),clientName:n.String(),redirectUri:n.String()})}),AMt=f({description:"Approve or deny an OAuth authorization request from the consent page",url:`${Vl}/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"})})}),CMt=f({description:"Validate an OAuth access token (internal, for the MCP resource server)",url:`${Vl}/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())})}),Kve=["pending","active","revoked"],zve=n.Object({id:n.String(),createdAt:w(),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(Kve),lastUsedAt:n.Optional(w())}),RMt=f({tags:["oauth"],description:"List OAuth grants: your own, or all users for admins",url:`${Vl}/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(zve)}),PMt=f({tags:["oauth"],description:"Delete an OAuth grant (own grant, or any grant for admins)",url:`${Vl}/grants/:id`,method:"DELETE",params:n.Object({id:n.String()}),response:B});function U7(e,t,r){let o=new URL(R7.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 Yve=un({access_token:Tt(ye),refresh_token:Tt(ye),expires_in:Tt(lc),error:Tt(ye),error_description:Tt(ye)}),Vve=Lo(Yve),w7=k(function*(e){let t=yield*Cl,r=v("oauth.token")(function*(o,i){let s=yield*t.post(new URL(P7.url,o).href,{headers:{Accept:"application/json"},body:Uk(i,"application/x-www-form-urlencoded")}).pipe(ht(l=>new ua({message:`OAuth token request failed (${l.message})`,cause:l}))),a=yield*s.json.pipe(H(Vve),ri(()=>({})));if(s.status!==200){let l=a.error??`HTTP ${s.status}`;return yield*new Af({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 Cf({message:"OAuth token response was missing required fields"});let u=yield*Fn;return{accessToken:a.access_token,refreshToken:a.refresh_token,expiresAt:Sm(ns(u+a.expires_in*ql))}});return{exchangeCode:v("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:v("oauth.refreshTokens")(function*(o,i){return yield*r(o,{grant_type:"refresh_token",client_id:e,refresh_token:i})})}});function v7(e,t){return U7(g0,e,t)}var Wu=class extends Qe()("cli/OAuth",{make:w7(g0)}){static layer=Uo(this,this.make)};var N7=require("node:fs");var pA=k(function*(e,t={}){let r=yield*js;return k(function*(o,i){let s=yield*Ui(e,o,{...t.env===void 0?{}:{env:t.env},...i===void 0?{}:{stdin:{stream:s2(new TextEncoder().encode(i))}}}),{stdout:a,stderr:u,status:l}=yield*qa({stdout:s.stdout.pipe(el,tl),stderr:s.stderr.pipe(el,tl),status:s.exitCode},{concurrency:"unbounded"});return{status:Number(l),stdout:a,stderr:u}},to,xi(js,r),ri(()=>({status:1,stdout:"",stderr:`${e} did not run`})))});var k7="/usr/bin/security",Wve=44;function Qve(e){return e===0||e===Wve}function h0(){return process.platform==="darwin"&&y0(k7)}function y0(e){try{return(0,N7.lstatSync)(e).isFile()}catch{return!1}}function Zve(e,t){return["find-generic-password","-s",e,"-a",t,"-w"]}function Xve(e,t){return["delete-generic-password","-s",e,"-a",t]}function Jve(e,t,r){let o=Buffer.from(r,"utf-8").toString("hex");return`add-generic-password -U -s ${e} -a ${t} -X ${o}
|
|
271
271
|
`}var L7=k(function*(e){let t=yield*pA(k7,{env:{}}),r=k(function*(o){if(!h0())return;let{status:i,stdout:s}=yield*t(Zve(e,o));return i===0&&s.trim()||void 0});return{location:"the macOS Keychain",read:r,save:v("keychain.save")(function*(o,i){return h0()?(yield*t(["-i"],Jve(e,o,i))).status===0:!1}),remove:v("keychain.remove")(function*(o){if(!h0())return!0;let{status:i}=yield*t(Xve(e,o));return Qve(i)?(yield*r(o))===void 0:!1})}});var Di=e=>Cy(e).pipe(hl(t=>t.trim()||void 0),TN(void 0));var M7="/usr/bin/secret-tool",eNe=km({DBUS_SESSION_BUS_ADDRESS:Di("DBUS_SESSION_BUS_ADDRESS"),XDG_RUNTIME_DIR:Di("XDG_RUNTIME_DIR")}).pipe(hl(e=>Object.fromEntries(Object.entries(e).flatMap(([t,r])=>r===void 0?[]:[[t,r]]))));function tNe(e){return["lookup","service",e.service,"account",e.account]}function rNe(e,t){return["store","--label",t,"service",e.service,"account",e.account]}function nNe(e){return["clear","service",e.service,"account",e.account]}function oNe(e){return["search","--all","service",e.service,"account",e.account]}function iNe(e){return e.status===0&&e.stdout.trim()===""}function E0(){return process.platform==="linux"&&y0(M7)}var D7=k(function*({service:e,label:t}){let r=yield*eNe.pipe(ri(()=>({}))),o=yield*pA(M7,{env:r});return{location:"the login keyring",read:k(function*(s){if(!E0())return;let{status:a,stdout:u}=yield*o(tNe({service:e,account:s}));return a===0&&u.trim()||void 0}),save:v("secretTool.save")(function*(s,a){return E0()?(yield*o(rNe({service:e,account:s},t),a)).status===0:!1}),remove:v("secretTool.remove")(function*(s){return E0()?(yield*o(nNe({service:e,account:s})),iNe(yield*o(oNe({service:e,account:s})))):!0})}});var F7=require("node:os");var It=class extends He("RequestBodyError"){},kn=class extends He("LocalFileError"){},Wl=class extends He("InvalidLink"){},KE=class extends He("SessionCorrupted"){},sNe=[ys,Rf,Pf,zl,wf,Wl,Uf,kn,_c,Yu,Vu,Af,It,Cf,KE,Kl,ua,Ic],Ar={success:0,failure:1,usage:2,auth:3,api:4,network:5,localState:6},aNe={ApiError:Ar.api,ConfigCorrupted:Ar.localState,ConfigUnreadable:Ar.localState,ExternalCommandError:Ar.failure,FieldsNotFound:Ar.usage,InvalidLink:Ar.usage,KeychainUnwritable:Ar.localState,LocalFileError:Ar.localState,LoginFailed:Ar.auth,NoCredentials:Ar.auth,NonJsonResponse:Ar.network,OAuthTokenError:Ar.auth,RequestBodyError:Ar.usage,ResponseDecodeError:Ar.network,SessionCorrupted:Ar.auth,SessionExpired:Ar.auth,TransportError:Ar.network,UntrustedApiUrl:Ar.usage};function lA(e){return aNe[e._tag]}function dA(e){return 128+F7.constants.signals[e??"SIGINT"]}function mA(e){return sNe.some(t=>e instanceof t)}function fA(e){return wy(e)&&e._tag==="ShowHelp"}var gA=["Sign in with your browser: tsuga auth login","Save an operation API key: tsuga auth operation-key <OPERATION_API_KEY>"];function $7(e){let t=[`Error: ${e.message}`];return e._tag==="ApiError"&&(e.statusCode&&t.push(`Status: ${e.statusCode}`),e.requestId&&t.push(`Request ID: ${e.requestId}`),e.details&&t.push(`Details: ${JSON.stringify(e.details,null,2)}`)),e.suggestions&&e.suggestions.length>0&&t.push("","Suggestions:",...e.suggestions.map(r=>` - ${r}`)),t.join(`
|
|
272
|
-
`)}var hA=un({accessToken:Lb,accessExpiresAt:Lb,refreshToken:Tt(ye)}),cNe=Lo(wi(hA)),G7=e=>cNe(e.trim()).pipe(ht(()=>new KE({message:"The saved session is unreadable.",suggestions:["Sign in again to replace it: tsuga auth login"]}))),uNe=5*Hl;function T0(e,t){let r=Date.parse(e.accessExpiresAt);return Number.isNaN(r)?!0:r<=t+uNe}function B7(e){if(e.flagKey)return{kind:"operation-api-key",token:e.flagKey,source:"flag"};if(e.environmentKey)return{kind:"operation-api-key",token:e.environmentKey,source:"environment"};if(e.operationApiKey)return{kind:"operation-api-key",token:e.operationApiKey,source:"config"};if(e.userAuth)return{kind:"user-session",userAuth:e.userAuth}}var j7="tsuga-cli",pNe="Tsuga CLI session",vf=class extends Qe()("SecretStore",{make:pt(function*(){let t=process.platform==="linux"?yield*D7({service:j7,label:pNe}):yield*L7(j7);return{location:t.location,read:k(function*(r){let o=yield*t.read(r);return o===void 0?void 0:yield*G7(o)}),save:(r,o)=>t.save(r,JSON.stringify(o)),remove:t.remove}})}){static layer=Uo(this,this.make)};var mn=class e extends Qe()("common-cli/OutputFormatter"){static layer=Qi(e)(q7("rows"));static pageLayer=Qi(e)(q7("page"))};function q7(e){return{rows:(t,r)=>pt(function*(){if(r.pretty??(yield*HE))return yield*C7(t,r);yield*e==="page"?xe({data:t,metadata:r.metadata},r.fields):Es(t,r.fields)})}}var pa=class extends Qe()("GlobalFlags"){},H7=Ie("cli/Argv",{defaultValue:()=>process.argv.slice(2)});var K7="__tsuga_cluster_id__",lNe=n.Object({}),dNe=n.Object({status:n.Literal("error"),message:n.String({description:"Why this cluster failed to answer the query."})});function Nf(e=lNe){let t=D("status",[n.Object({...e.properties,status:n.Literal("ok")}),dNe]);return Object.assign(Jx(ii,t),{description:'Outcome per cluster, keyed by cluster ID. A cluster that failed reports `status: "error"`.'})}var mNe=5,bc=n.Array(p({allowEmpty:!1}),{minItems:1,maxItems:mNe,uniqueItems:!0,description:"IDs of the clusters to query, without duplicates. Mutually exclusive with `clusterId`. Omit both to use the default cluster."});var z7=n.Object({type:n.Literal("number"),number:n.String()}),fNe=n.Object({type:n.Literal("string"),string:n.String()}),gNe=n.Object({type:n.Literal("timestamp"),timestamp:n.String()}),zE=D("type",[z7,fNe,gNe]),hNe=n.Object({by:n.Record(n.String(),zE),computed:n.Record(n.String(),z7)}),yNe=n.Object({type:n.Literal("buckets"),buckets:n.Array(hNe),clusterResponses:n.Optional(Nf())}),ENe=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()))}),kf=D("type",[yNe,ENe]);var S0=["all","owning-team-and-public","owning-team-only"],Ts=n.Enum(S0,{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 V7=1456444800,W7=4927737600,TNe=V7*1e3,SNe=W7*1e3,yA=1704067200,EA=yA+3600,Q7=yA*1e3,Z7=EA*1e3,X7={title:"TimeRange",description:"Inclusive time range for telemetry queries. Use Unix timestamps in seconds unless the field description says milliseconds.",examples:[{from:yA,to:EA}]},_Ne={title:"V2TimeRange",description:"Inclusive time range for telemetry queries using Unix timestamps in milliseconds.",examples:[{from:Q7,to:Z7}]},Ql=(e,t=yA)=>n.Integer({description:e,examples:[t],minimum:V7,maximum:W7,format:"int64"}),Y7=(e,t=Q7)=>n.Integer({description:e,examples:[t],minimum:TNe,maximum:SNe,format:"int64"}),Cr=n.Object({from:n.Optional(Ql("Start of the query window as a Unix timestamp in seconds")),to:n.Optional(Ql("End of the query window as a Unix timestamp in seconds",EA))},X7),tn=n.Object({from:Ql("Start of the query window as a Unix timestamp in seconds"),to:Ql("End of the query window as a Unix timestamp in seconds",EA)},X7),Ao=n.Object({from:Y7("Start of the query window as a Unix timestamp in milliseconds"),to:Y7("End of the query window as a Unix timestamp in milliseconds",Z7)},_Ne);var xc="/v0/logs";var TA=["CRITICAL","ERROR","WARN","NOTICE","INFO","DEBUG","TRACE"];var YE=0,_0=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(TA,{description:"Log severity, normalized from the source severity into one of the fixed Tsuga levels (ordered `CRITICAL` to `TRACE`)."}),[K7]:n.Optional(n.String({description:"ID of the cluster this log was read from. Only set when the request spanned several clusters."}))},{additionalProperties:!0}),eZ=100,INe="timestamp",Qu=n.Partial(n.Object({...Cr.properties,query:p({type:"tsuga-query",description:"Tsuga query used to filter logs in the selected time range."}),maxResults:n.Integer({minimum:1,maximum:1e3,description:"Maximum number of logs to return. Valid values are 1 through 1000."}),shouldRecommendAttributes:n.Boolean({description:"Whether Tsuga should return suggested attributes to highlight in results."}),triggeredBy:n.Literal("refresh",{description:"Indicates the query was triggered by a refresh action."}),startOffset:n.Number({minimum:YE,description:"Result offset used when fetching additional log rows."}),startOffsets:n.Array(n.Number({minimum:YE}),{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 ${YE} for every cluster.`}),clusterId:p({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}),clusterIds:bc,sortBy:p({allowEmpty:!1,default:INe,description:"Attribute to sort by. Attributes other than `timestamp` sort numerically; logs where the attribute is missing or not a number come last."}),sortDirection:le,useCanopy:n.Boolean()})),_Dt=f({tags:["logs"],url:`${xc}/count`,method:"GET",query:n.Pick(Qu,["from","to","query","clusterId","clusterIds","useCanopy"]),response:n.Object({count:n.Number(),clusterResponses:n.Optional(Nf())})}),VE=n.Object({value:n.String(),priority:n.Number()}),IDt=f({tags:["logs"],url:`${xc}/search`,method:"GET",query:Qu,response:n.Object({logs:n.Optional(n.Array(_0)),attributesToHighlight:n.Optional(n.Array(VE)),incomplete:n.Optional(n.Boolean({description:"True when attribute highlighting stopped early because too many distinct attributes were found."})),clusterResponses:n.Optional(Nf(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})}),bNe=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"}),tZ=n.Object({id:n.String(),pattern:n.Array(bNe),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"}))}),I0=n.Object({...Cr.properties,query:p({type:"tsuga-query"}),clusteringThreshold:n.Optional(n.Number()),clusterId:n.Optional(p({allowEmpty:!1})),useCanopy:n.Optional(n.Boolean())}),bDt=f({tags:["logs"],url:`${xc}/patterns`,method:"GET",query:I0,response:n.Object({patterns:n.Array(tZ),sampleSize:n.Number()})}),rZ=n.Object({id:n.String(),volume:n.Integer({description:"Number of logs in the cluster"}),levels:n.Array(n.Enum(TA)),signatures:n.Array(n.Object({signature:n.String(),volume:n.Integer()}))}),xDt=f({tags:["logs"],url:`${xc}/patterns/clusters`,method:"GET",query:I0,response:n.Object({clusters:n.Array(rZ),totalVolume:n.Integer()})}),xNe=50,ODt=f({tags:["logs"],url:`${xc}/patterns/details`,method:"POST",body:n.Object({...I0.properties,clusters:n.Array(rZ,{maxItems:xNe})}),response:n.Object({patterns:n.Array(tZ),sampleSize:n.Number()})}),ADt=f({tags:["logs"],url:`${xc}/attributes`,method:"GET",query:n.Object({...Cr.properties,clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"})),clusterIds:n.Optional(bc),useCanopy:n.Optional(n.Boolean()),search:n.Optional(p({allowEmpty:!1,description:"Return only attribute dot-paths containing this text, case-insensitively"}))}),response:n.Object({attributes:n.Array(n.String()),clusterResponses:n.Optional(Nf())})});var nZ="timestamp";var J7=`${nZ}_iso`;var ONe=["pending","running","completed","incomplete","failed"],oZ=n.Object({id:n.String({description:"ID of the export."}),status:n.Enum(ONe,{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."}))}),CDt=f({tags:["logs"],url:`${xc}/exports`,method:"POST",body:n.Object({...n.Pick(Qu,["from","to","query","clusterId","clusterIds","sortBy","sortDirection"]).properties,columns:n.Array(p({allowEmpty:!1}),{minItems:1,description:`Log attributes to write as CSV columns, in order. Each becomes one column, resolved against the log with dotted-path lookup. Including \`${nZ}\` also writes a \`${J7}\` column next to it, holding the same instant in ISO 8601.`}),timezone:n.Optional(n.String({format:$l,description:`IANA timezone the \`${J7}\` column is offset to (e.g. \`Europe/Paris\`). Defaults to UTC.`}))}),response:n.Object({...oZ.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."})})}),RDt=f({tags:["logs"],url:`${xc}/exports/:exportId`,method:"GET",params:n.Object({exportId:n.String()}),response:oZ}),PDt=f({tags:["logs"],url:`${xc}/exports/:exportId/download`,method:"GET",params:n.Object({exportId:n.String()}),query:n.Object({token:p({allowEmpty:!1,type:"long",description:"Single-use token minted when the export was created."})}),response:n.String({description:"CSV file, streamed as it is produced."})});var Oc="/v0/metrics",ANe=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(TA)},{additionalProperties:!0}),MDt=f({tags:["metrics"],url:`${Oc}/count`,method:"GET",query:n.Pick(Qu,["from","to","query","clusterId"]),response:n.Object({count:n.Number()})}),DDt=f({tags:["metrics"],url:`${Oc}/search`,method:"GET",query:Qu,response:n.Object({logs:n.Optional(n.Array(ANe)),totalHits:n.Optional(n.Number()),attributesToHighlight:n.Optional(n.Array(VE))},{additionalProperties:!0})}),SA=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."}),_A=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."}),b0=["gauge","cumulative-counter","delta-counter","cumulative-histogram","delta-histogram","summary"],iZ=n.Enum(b0,{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."}),sZ=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."}),aZ=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."}),IA=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."}),CNe=n.Record(n.String(),n.Number(),{description:"Estimated number of distinct values per attribute over the same window as `seriesCardinality`, keyed like `tags`."}),RNe=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(_A),type:n.Optional(SA),unit:n.Optional(n.String({description:"Metric unit reported by instrumentation or inferred metadata."})),lastSeen:n.Optional(sZ),teams:n.Optional(aZ),seriesCardinality:n.Optional(IA),attributeCardinalities:n.Optional(CNe)}),FDt=f({url:`${Oc}/metadata`,method:"GET",query:n.Object({...Cr.properties,metricName:p({allowEmpty:!1}),kind:n.Optional(iZ),clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:RNe}),$Dt=f({tags:["metrics"],url:Oc,method:"GET",query:n.Object({...Cr.properties,clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:n.Array(n.String())}),cZ=n.Array(n.Object({name:n.String({description:"Metric name observed by Tsuga."}),kind:iZ,type:SA,temporality:n.Optional(_A),lastSeen:n.Optional(sZ),teams:n.Optional(aZ),seriesCardinality:n.Optional(IA)}),{description:"Metric variants observed in the requested time range. A name appears once per kind it was reported as."}),PNe=[{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(cZ,{examples:[PNe]});var GDt=f({tags:["metrics"],url:`${Oc}/names-and-types`,method:"GET",query:n.Object({...Cr.properties,clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:cZ}),WE=n.Array(n.String(),{description:"Attribute names available as dimensions for filtering or grouping the requested metric(s)."}),UNe=["service","env","host","method","status_code"];Object.assign(WE,{examples:[UNe]});var BDt=f({tags:["metrics"],url:`${Oc}/attributes`,method:"GET",query:n.Object({...Cr.properties,metricName:p({allowEmpty:!1}),clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:WE}),jDt=f({tags:["metrics"],url:`${Oc}/attributes/batch`,method:"GET",query:n.Object({...Cr.properties,metricNames:n.Array(p({allowEmpty:!1}),{minItems:1,description:"Metric names to fetch attributes for"}),clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:WE}),x0=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."})}),qDt=f({tags:["metrics"],url:`${Oc}/assets-usage`,method:"GET",query:n.Object({metricName:p({allowEmpty:!1})}),response:x0}),HDt=f({url:`${Oc}/per-attribute`,method:"GET",query:n.Object({from:n.Optional(n.Number()),to:n.Optional(n.Number()),attribute:p(),clusterId:n.Optional(p({allowEmpty:!1}))}),response:n.Array(n.String())});var NNe="/v0/aggregation",kNe=n.Union([n.Literal("a"),n.Literal("d"),n.Literal("q"),n.Literal("w"),n.Literal("t")]),ZE=n.Object({parallelism:n.Number(),engine:kNe,recordBatchCache:n.Optional(n.Boolean()),includeNullGroups:n.Optional(n.Boolean()),restartAwareGaugeSum:n.Optional(n.Boolean())}),O0=["logs","metrics","traces"];var lZ={logs:"Logs",metrics:"Metrics",traces:"Spans"},LNe=[...O0,"connections","log-patterns","spans","rum"];var rFt={...lZ,connections:"Connections","log-patterns":"Log Patterns",spans:"Spans",rum:"RUM events"},la=[...O0,"rum"];var nFt={...lZ,rum:"RUM events"};var oFt=n.Enum(LNe,{description:"Data source being queried"}),iFt=n.Enum(O0,{description:"Telemetry source queried by this aggregation: `logs`, `metrics`, or `traces`."}),pi=n.Enum(la,{description:"Telemetry source queried by this aggregation: `logs`, `metrics`, `traces`, or `rum`."}),Zl=n.String({description:"Attribute containing the values to aggregate"}),Lf=p({description:"Attribute containing the values to aggregate"}),MNe=D("type",[n.Object({type:n.Literal("count",{description:"Counts the total number of records"}),field:n.Optional(Zl)},{$id:"AggregateCount",title:"Count"}),n.Object({type:n.Literal("unique-count",{description:"Counts the distinct values of the field"}),field:Zl},{$id:"AggregateUniqueCount",title:"UniqueCount"}),n.Object({type:n.Literal("average",{description:"Calculates the average value of the selected field"}),field:Zl},{$id:"AggregateAverage",title:"Average"}),n.Object({type:n.Literal("max",{description:"Finds the largest value of the field"}),field:Zl},{$id:"AggregateMax",title:"Max"}),n.Object({type:n.Literal("min",{description:"Finds the smallest value of the field"}),field:Zl},{$id:"AggregateMin",title:"Min"}),n.Object({type:n.Literal("sum",{description:"Sums the values of the selected field"}),field:Zl},{$id:"AggregateSum",title:"Sum"}),n.Object({type:n.Literal("percentile",{description:"Calculates a percentile of the selected field"}),field:Zl,percentile:n.Number({description:"Percentile to compute for the selected field."})},{$id:"AggregatePercentile",title:"Percentile"})],{title:"Aggregate",description:"Aggregation operation for this query. Required for every query; `field` is required by all aggregate types except `count`, which needs it only when `dataSource` is `metrics`."}),DNe=D("type",[n.Object({type:n.Literal("count",{description:"Counts the total number of records"}),field:n.Optional(p({description:"Metric to count when `dataSource` is `metrics`, where it is required: without it the query fails with `count aggregate requires a non-empty field`. On `logs`, `traces` and `rum`, `count` counts records and ignores this field."}))},{$id:"InputAggregateCount",title:"Count"}),n.Object({type:n.Literal("unique-count",{description:"Counts the distinct values of the field"}),field:Lf},{$id:"InputAggregateUniqueCount",title:"UniqueCount"}),n.Object({type:n.Literal("average",{description:"Calculates the average value of the selected field"}),field:Lf},{$id:"InputAggregateAverage",title:"Average"}),n.Object({type:n.Literal("max",{description:"Finds the largest value of the field"}),field:Lf},{$id:"InputAggregateMax",title:"Max"}),n.Object({type:n.Literal("min",{description:"Finds the smallest value of the field"}),field:Lf},{$id:"InputAggregateMin",title:"Min"}),n.Object({type:n.Literal("sum",{description:"Sums the values of the selected field"}),field:Lf},{$id:"InputAggregateSum",title:"Sum"}),n.Object({type:n.Literal("percentile",{description:"Calculates a percentile of the selected field"}),field:Lf,percentile:n.Number({description:"Percentile to compute for the selected field."})},{$id:"InputAggregatePercentile",title:"Percentile"})],{title:"InputAggregate",description:"Aggregation operation for this query. Required for every query; `field` is required by all aggregate types except `count`, which needs it only when `dataSource` is `metrics`."}),dZ=n.Object({type:n.Literal("per-second",{description:"Normalizes the metric to events per second"})},{$id:"FunctionPerSecond",title:"PerSecond"}),mZ=n.Object({type:n.Literal("per-minute",{description:"Normalizes the metric to events per minute"})},{$id:"FunctionPerMinute",title:"PerMinute"}),fZ=n.Object({type:n.Literal("per-hour",{description:"Normalizes the metric to events per hour"})},{$id:"FunctionPerHour",title:"PerHour"}),gZ=n.Object({type:n.Literal("rate",{description:"Calculates the rate of change"})},{$id:"FunctionRate",title:"Rate"}),hZ=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"}),yZ=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"}),EZ=n.Object({type:n.Literal("sqrt",{description:"Applies a square root transformation to the values"})},{$id:"FunctionSqrt",title:"Sqrt"}),TZ=n.Object({type:n.Literal("last",{description:"Takes the last value of the metric for the selected time frame"})},{$id:"FunctionLast",title:"Last"}),SZ=n.Object({type:n.Literal("cumsum",{description:"Cumulative sum of the values over the time frame. Computed by the Tsuga web app only: the aggregation API ignores it and returns the raw values."})},{$id:"FunctionCumsum",title:"Cumsum"}),FNe=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"}),$Ne=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"}),GNe=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"}),BNe=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"}),jNe=D("type",[dZ,mZ,fZ,gZ,hZ,FNe,yZ,EZ,TZ,GNe,SZ],{title:"Function",description:"Post-processing function applied to an aggregation query result after the aggregate is computed, selected by `type`."}),qNe=D("type",[dZ,mZ,fZ,gZ,hZ,$Ne,yZ,EZ,TZ,BNe,SZ],{title:"InputFunction",description:"Post-processing function applied to an aggregation query result after the aggregate is computed, selected by `type`."});var uZ=n.Object({min:n.Number({description:"Lower bound of the distribution range."}),max:n.Number({description:"Upper bound of the distribution range."})}),HNe=["linear","log"],QE=n.Enum(HNe,{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."}),KNe=1e3,pZ=n.Integer({minimum:1,maximum:KNe}),bA={pattern:"^0*[1-9]\\d*[smhdw]$",errorMessage:{pattern:'must be a positive whole number followed by s, m, h, d or w, such as "10s", "1m" or "1h".'}},zNe=D("type",[n.Object({type:n.Literal("scalar")},{title:"Scalar",description:"Returns a single value"}),n.Object({type:n.Literal("timeseries"),aggregationWindow:n.String({...bA,description:'Time bucket size for aggregation (e.g. "10s", "60s", "1m")'})},{title:"Timeseries",description:"Returns a time series"}),n.Object({type:n.Literal("histogram"),by:n.Optional(p()),bucketCount:n.Optional(pZ),bounds:n.Optional(uZ),boundsScale:n.Optional(QE),percentiles:n.Optional(n.Array(n.Integer({minimum:0,maximum:100}),{minItems:1,maxItems:100}))},{title:"Histogram",description:"Returns a single distribution over the entire time range"}),n.Object({type:n.Literal("heatmap"),aggregationWindow:n.String({...bA,description:'Time bucket size for the heatmap (e.g. "10s", "60s", "1m")'}),by:n.Optional(p()),bucketCount:n.Optional(pZ),bounds:n.Optional(uZ),boundsScale:n.Optional(QE)},{title:"Heatmap",description:"Returns a distribution per time window"})]),xA=15,sFt=128*1024,YNe=["zero","null"],VNe=n.Enum(YNe,{description:"`zero` fills missing points with zero. `null` keeps missing points null."}),_Z=n.Object({mode:n.Object({type:VNe},{description:"How missing aggregation points should be filled."})},{description:"Missing-point fill behavior for aggregation results. Optional; omit to keep missing points null."}),WNe=["avg","sum","min","max","last"],IZ=n.Enum(WNe,{description:"Per-series rollup applied within each time bucket before the cross-series aggregate. Use it on metric queries when `aggregate.type` is `sum` and no `rate`, `increase`, or `last` function is present. When omitted, Tsuga derives the rollup from the metric type."});var bZ=n.Enum(b0,{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."}),xZ={aggregate:MNe,functions:n.Optional(n.Array(jNe,{description:"Post-processing functions applied to aggregation results"})),fill:n.Optional(_Z),timeAggregate:n.Optional(IZ),metricKind:n.Optional(bZ)},OZ={aggregate:DNe,functions:n.Optional(n.Array(qNe,{maxItems:10,description:"Post-processing functions applied to aggregation results. Defaults to an empty array when omitted."})),fill:n.Optional(_Z),timeAggregate:n.Optional(IZ),metricKind:n.Optional(bZ)},QNe={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."},AZ={minItems:1,maxItems:xA,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").'},CZ=n.Array(n.Object({...xZ,filter:n.Optional(n.String({description:"Filter to apply to the aggregation"}))},{title:"AggregationQuery"}),QNe),XE=n.Array(n.Object({...OZ,filter:n.Optional(p({type:"tsuga-query",description:"Tsuga query filter to apply to the aggregation. Defaults to an empty string when omitted."}))},{title:"AggregationQuery"}),AZ),Ac=n.Array(n.Object({...xZ,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."}),Zu=n.Array(n.Object({...OZ,filter:p({type:"tsuga-query",description:"Tsuga query filter applied to this alerting or SLO aggregation query. Required by the API; use the query language for the selected data source."})},{title:"MonitorAggregationQuery",description:"Single aggregation query evaluated by a monitor."}),{...AZ,description:"Aggregation queries used by alerting. Each query is referenced from formulas as q1, q2, and so on."}),RZ=n.Array(n.Omit(Zu.items,["fill"],{title:"SloAggregationQuery",description:"Single aggregation query evaluated by an SLO."}),{minItems:1,maxItems:xA,description:"Aggregation queries used by SLO evaluation. Each query is referenced from formulas as q1, q2, and so on."});var OA=n.String({description:"Formula referencing submitted query outputs, such as `q1 + q2`. References must be within `q1` through `qN` for the submitted queries."}),Xl=p({type:"tsuga-formula",description:"Formula referencing query outputs, such as `q1 + q2`, to compute derived results. Defaults to `q1`. Formulas may reference only submitted queries (`q1` through `qN`); undefined query references return 400. Only `+`, `-`, `*`, `/` and parentheses over query references and numbers are supported, with no functions such as `max()`."}),ZNe=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"}),XNe=n.Object({fields:n.Array(p(),{maxItems:1,description:"Telemetry attribute name to group aggregation results by at this grouping level. To group by several attributes, send one `groupBy` entry per attribute: entries nest, outermost first.",errorMessage:{maxItems:'must hold one field. To group by several fields, send one groupBy entry per field: they nest, outermost first, such as [{"fields": ["context.service.name"], "limit": 10}, {"fields": ["level"], "limit": 5}].'}}),limit:n.Number({description:'Maximum number of distinct values of `fields` to return for this grouping level, ranked by aggregate value. Groups beyond the limit are truncated from the response, not merged into an "other" group.'}),sortOrder:n.Optional(le),replaceNullWith:n.Optional(p({allowEmpty:!1,description:"Value used to group documents that have no value for a grouped field."}))},{title:"AggregationGroupBy"}),PZ=7;var Mf=n.Array(ZNe,{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."}),Cc=n.Array(XNe,{maxItems:PZ,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 aFt=f({tags:["aggregation"],url:`${NNe}/multi-query`,method:"POST",body:n.Object({timeRange:Ao,queries:XE,groupBy:n.Optional(Cc),returnType:zNe,dataSource:pi,formula:Xl,executionOptions:ZE,triggeredBy:n.Optional(n.Literal("refresh")),shouldStreamResults:n.Optional(n.Boolean()),clusterId:n.Optional(p({allowEmpty:!1})),clusterIds:n.Optional(bc),viewAs:n.Optional(n.Object({owner:p({allowEmpty:!1,description:"Team ID to fetch data as"}),permissions:Ts}))}),response:kf});var UZ=`/${"v1"}/aggregation`,wZ=`/${"v2"}/aggregation`,vZ=n.Object({id:n.String({description:"Result identifier. Query results use `q1`, `q2`, and so on; formula results use `value`."}),group:n.Record(n.String(),n.Union([n.String(),n.Number()]),{description:"Group-by field values for this result. Empty when no group-by is requested."})}),NZ=n.Object({results:n.Array(n.Object({...vZ.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."}),JNe={results:[{id:"q1",group:{host:"server-1"},value:123.45}]};Object.assign(NZ,{examples:[JNe]});var AA=n.Object({series:n.Array(n.Object({...vZ.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."}),eke={series:[{id:"q1",group:{host:"server-1"},points:[{timestamp:16094592e5,value:123.45},{timestamp:160945926e4,value:456.78}]}]};Object.assign(AA,{examples:[eke]});var kZ=n.Record(n.String(),n.Union([n.String(),n.Number()]),{description:"Group-by field values for this row, keyed by field name. Empty when no group-by is requested."}),LZ="Keyed by result id: `q1`, `q2`, and so on for each query in submission order, plus `f1`, `f2`, and so on for each entry of `formulas` in submission order, or `value` for a PromQL query. Every row has the same keys.",MZ=n.Object({results:n.Array(n.Object({group:kZ,values:n.Record(n.String(),n.Union([n.Number(),n.Null()]),{description:`Aggregated values over the full time range, \`null\` where the group has none. ${LZ}`})},{title:"ScalarResultV2"}),{description:"One row per group, in group-by sort order (largest first unless `sortOrder` says otherwise)."})},{$id:"ScalarAggregationResponseV2",title:"ScalarAggregationResponseV2",description:"Scalar aggregation response with one row per group."}),tke={results:[{group:{"context.host.name":"web-1"},values:{q1:12,q2:1e3,f1:1.2}},{group:{"context.host.name":"web-2"},values:{q1:3,q2:500,f1:.6}}]};Object.assign(MZ,{examples:[tke]});var CA=n.Object({timestamps:n.Array(n.Integer(),{description:"Start of each time bucket as a Unix timestamp in milliseconds, ascending, spaced by `aggregationWindow` (`step` for PromQL) from the first bucket with data to the last. Every `values` array in `series` aligns with it index by index."}),series:n.Array(n.Object({group:kZ,values:n.Record(n.String(),n.Array(n.Union([n.Number(),n.Null()])),{description:`One value per entry of \`timestamps\`, \`null\` where the bucket has none. ${LZ}`})},{title:"SeriesV2"}),{description:"One series per group, in group-by sort order for aggregation queries and in no particular order for PromQL."})},{$id:"TimeseriesAggregationResponseV2",title:"TimeseriesAggregationResponseV2",description:"Timeseries aggregation response: a shared time axis and one series per group aligned to it."}),rke={timestamps:[16094592e5,160945926e4,160945932e4],series:[{group:{"context.host.name":"web-1"},values:{q1:[12,null,7],q2:[1e3,900,1400],f1:[1.2,null,.5]}}]};Object.assign(CA,{examples:[rke]});var nke=n.Omit(XE.items,["fill"],{title:"AggregationQuery",description:"Aggregation query. Omit `filter` for an unfiltered query and omit `functions` when no post-processing is needed."}),oke=n.Optional(Cc),DZ={timeRange:tn,queries:n.Array(nke,{maxItems:xA,description:'Aggregations that may be combined together in the same query. Each item is referenced from formulas as q1, q2, and so on, in submission order. For dataSource "metrics", each aggregate\'s `field` is the metric name, not an attribute; to count distinct values of an attribute use unique-count with field "<metricName>.context.<attribute>" (e.g. "system.cpu.utilization.context.host.name").'}),groupBy:oke,dataSource:pi},FZ={...DZ,formula:n.Optional(Xl)},$Z={...DZ,timeRange:Ao,formulas:n.Optional(n.Array(p({type:"tsuga-formula",allowEmpty:!1,description:"Formula over the query results, such as `q1 / q2 * 100`. Only `+`, `-`, `*`, `/` and parentheses over query references (`q1` through `qN`) and numbers are supported; an undefined query reference returns 400."}),{maxItems:1,description:"Formulas computed from the query results, returned beside them as `f1`, `f2`, and so on in submission order. At most one for now."}))},Fi=n.Object({clusterId:n.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))}),GZ=n.Object(FZ,{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."}),ike={timeRange:{from:1782201500,to:1782203400},dataSource:"logs",queries:[{aggregate:{type:"count"},filter:"context.service.name:checkout"}],groupBy:[{fields:["level"],limit:5}]};Object.assign(GZ,{examples:[ike]});var BZ=n.Object($Z,{description:"Scalar aggregation request. Provide a time range in milliseconds, one or more queries, a telemetry data source, and optional grouping or formulas. Omit `groupBy` for ungrouped results. Send `clusterId` as a query parameter, not in the JSON body."}),jZ={timeRange:{from:17822015e5,to:17822034e5},dataSource:"logs",queries:[{aggregate:{type:"count"},filter:"context.service.name:checkout AND level:error"},{aggregate:{type:"count"},filter:"context.service.name:checkout"}],groupBy:[{fields:["context.host.name"],limit:5}],formulas:["q1 / q2 * 100"]};Object.assign(BZ,{examples:[jZ]});var RA=f({description:"Computes counts, unique counts, sums, averages, min/max or percentiles (p50, p95, p99), one value per group. Runs over logs, traces (spans), metrics or RUM (real user monitoring) events filtered with Tsuga query syntax, and supports group-by on any attribute, top-N breakdowns, per-second or per-minute rates and formulas. For values over time, use the timeseries aggregation. See [Analytics queries](/documentation/visualize/analytics/queries).",operationId:"aggregateScalar",tags:["public","aggregation"],url:`${UZ}/multi-query/scalar`,method:"POST",body:GZ,query:Fi,response:NZ}),gFt=f({description:"Runs one or more aggregation queries over logs, metrics, traces, or RUM events and returns one row per group with every query result in it. Same request as `POST /v1/aggregation/multi-query/scalar`, with `timeRange` in milliseconds and formulas given as the `formulas` list and returned as `f1`. See [Analytics queries](/documentation/visualize/analytics/queries).",operationId:"aggregateScalarV2",tags:["public","aggregation"],url:`${wZ}/multi-query/scalar`,method:"POST",body:BZ,query:Fi,response:MZ}),qZ=n.String({...bA,maxLength:ci,description:"Time bucket size for timeseries aggregation, such as `10s`, `1m`, or `1h`."}),HZ=n.Object({...FZ,aggregationWindow:qZ},{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."}),ske={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(HZ,{examples:[ske]});var KZ=n.Object({...$Z,aggregationWindow:qZ},{description:"Timeseries aggregation request. Provide a time range in milliseconds, bucket size, one or more queries, a telemetry data source, and optional grouping or formulas. Omit `groupBy` for ungrouped series. Send `clusterId` as a query parameter, not in the JSON body."}),ake={...jZ,aggregationWindow:"1m"};Object.assign(KZ,{examples:[ake]});var PA=f({description:"Charts counts, unique counts, sums, averages, min/max or percentiles (p50, p95, p99) over time, one series per group. Runs over logs, traces (spans), metrics or RUM (real user monitoring) events filtered with Tsuga query syntax, bucketed by `aggregationWindow`, with group-by on any attribute, per-second or per-minute rates and formulas. For one value per group, use the scalar aggregation. See [Analytics queries](/documentation/visualize/analytics/queries).",operationId:"aggregateTimeseries",tags:["public","aggregation"],url:`${UZ}/multi-query/timeseries`,method:"POST",body:HZ,query:Fi,response:AA}),hFt=f({description:"Runs one or more aggregation queries over logs, metrics, traces, or RUM events and returns one shared time axis in milliseconds with one series per group aligned to it. Use `aggregationWindow` to choose the time bucket size. Same request as `POST /v1/aggregation/multi-query/timeseries`, with `timeRange` in milliseconds and formulas given as the `formulas` list and returned as `f1`. See [Analytics queries](/documentation/visualize/analytics/queries).",operationId:"aggregateTimeseriesV2",tags:["public","aggregation"],url:`${wZ}/multi-query/timeseries`,method:"POST",body:KZ,query:Fi,response:CA});var cke="x-tsuga-session-id",C0="x-tsuga-source",R0="x-tsuga-source-version",P0="x-tsuga-source-commit",U0="x-tsuga-source-date",w0="x-tsuga-rationale",uke="x-tsuga-dashboard-id",pke="x-tsuga-widget-id",lke="x-tsuga-widget-slot",dke="x-request-id",EFt={[cke]:"Session identifier for request correlation",[C0]:"SDK or client source identifier (e.g., web-frontend, terraform-provider)",[R0]:"SDK version",[P0]:"SDK commit hash",[U0]:"SDK commit date",[w0]:"Optional caller-supplied rationale for this request, recorded for telemetry",[uke]:"ID of the dashboard a query is issued from, when the request originates from a dashboard widget",[pke]:"ID of the dashboard widget (graph) a query is issued from, when the request originates from a dashboard widget",[lke]:"Identifies which of a multi-query widget's queries this request is for, such as `col-0` for the first column of a table",[dke]:"Unique identifier for this API request, useful for debugging and support"};var mke=["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS","TRACE"],zZ=k(function*(e,t,r,o,i){let{body:s,params:a,query:u}=o,l=r.url??(r.buildUrl&&a?r.buildUrl(a):void 0),d=mke.find(g=>g===r.method);return l===void 0||d===void 0?yield*new ys({message:`Internal error: endpoint ${r.operationId??r.method} is not callable`}):Tx(d)(A8(`${e}${l}`,u),{headers:{Accept:"application/json","User-Agent":fke(t),[C0]:t,[R0]:"1.163.0",[P0]:"1101c20563",[U0]:"2026-11-05T17:03:54.681Z",...i},...s?{body:Pk(s)}:{}})});function fke(e){return`${e==="cli"?"tsuga-cli":"tadmin"}/1.163.0 (${process.platform}; node ${process.versions.node})`}var gke=["allowed-domains","audit-log-stream-destination","billing","cluster-integration-config","custom-role","custom-usage-tag","database","databricks-connection","explorer-saved-view","github-connection","inventory","llm-provider","monitor-alert","monitor-debugging","oauth-grant","org","queue","retention-policy","saml-config","sensitive-data-scanner-rule","service","service-target","team-remap-config","user-self","widget-share"],hke=["adaptive-notification-rule","audit-log","cloud-account","dashboard-folder","monitor-folder","dashboard-report","dashboard-share","dashboard","data-deletion-request","ingestion-api-key","investigation","log-route","metric-route","monitor","notebook","notification-integration","notification-rule","notification-silence","operation-api-key","quality-report","rum-public-token","sandbox-configuration","slo","span-route","synthetic-test","synthetic-variable","tag-policy","team","user-data","user-invitation","user-permissions"],v0=["log","metric","trace","rum"],N0=[...hke,...v0],yke=[...gke,...N0];var Xu=["admin","public_editor","public_viewer","teams_only"],wA=[...Xu,"custom"],$i=["admin","editor","viewer"];var Jl="/v0/team-membership",k0="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.",JE=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($i,{description:k0})}),vA=n.Object({userId:p({allowEmpty:!1,description:"User ID to add to or update in the team."}),teamId:p({allowEmpty:!1,description:"Team ID receiving the membership change."}),roleKey:n.Enum($i,{description:k0})}),L0=n.Object({userId:p({allowEmpty:!1,description:"User ID to remove from the team."}),teamId:p({allowEmpty:!1,description:"Team ID to remove the user from."})}),Eke=n.Optional(n.Object({userId:n.Optional(p({allowEmpty:!1,description:"Restrict results to memberships for this user ID."})),teamId:n.Optional(p({allowEmpty:!1,description:"Restrict results to memberships for this team ID."}))})),PFt=f({tags:["access-control"],url:Jl,method:"GET",query:Eke,response:n.Array(JE)}),UFt=f({tags:["access-control"],url:Jl,method:"POST",body:vA,response:JE}),wFt=f({tags:["access-control"],url:Jl,method:"PUT",body:vA,response:JE}),vFt=f({tags:["access-control"],url:Jl,method:"DELETE",body:L0,response:B}),UA=500,NA=n.Object({teamId:p({allowEmpty:!1,description:"Team ID receiving all requested memberships."}),members:n.Array(n.Object({userId:n.Optional(p({allowEmpty:!1,description:"Existing user ID to add to the team."})),userEmail:n.Optional(p({allowEmpty:!1,type:"email",description:"Existing user email to resolve and add to the team."})),roleKey:n.Enum($i,{description:k0})},{oneOf:[{required:["userId"]},{required:["userEmail"]}]}),{minItems:1,maxItems:UA,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."}),Tke={teamId:"team-123-abc",members:[{userId:"user-123-abc",roleKey:"viewer"},{userEmail:"sam@example.com",roleKey:"editor"}]};Object.assign(NA,{examples:[Tke]});var kA=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."}),Ske={results:[{userId:"user-123-abc",status:"added"},{userId:"sam@example.com",status:"user_not_found"}]};Object.assign(kA,{examples:[Ske]});var NFt=f({tags:["access-control"],url:`${Jl}/bulk-add`,method:"POST",body:NA,response:kA}),kFt=f({tags:["access-control"],url:`${Jl}/bulk-update-user-roles`,method:"PUT",body:n.Object({userIds:n.Array(p({allowEmpty:!1}),{minItems:1,maxItems:UA}),teamId:p({allowEmpty:!1}),role:n.Enum($i)}),response:n.Object({})}),LA=n.Object({teamId:p({allowEmpty:!1,description:"Team ID to remove the requested users from."}),userIds:n.Optional(n.Array(p({allowEmpty:!1}),{minItems:1,maxItems:UA,description:"User IDs to remove from the team. Items are processed independently: a user who is not a member or cannot be resolved does not stop the other items from being removed."})),userEmails:n.Optional(n.Array(p({allowEmpty:!1,type:"email"}),{minItems:1,maxItems:UA,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."}),_ke={teamId:"team-123-abc",userIds:["user-123-abc"]};Object.assign(LA,{examples:[_ke]});var MA=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."}),Ike={results:[{userId:"user-123-abc",status:"removed"},{userId:"missing@example.com",status:"user_not_found"}]};Object.assign(MA,{examples:[Ike]});var LFt=f({tags:["access-control"],url:`${Jl}/bulk-remove`,method:"DELETE",body:LA,response:MA});var bke={"sandbox-configuration":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"github-connection":{read:["admin"],write:["admin"]},"llm-provider":{read:["admin"],write:["admin"]},investigation:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"ingestion-api-key":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"rum-public-token":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"widget-share":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"dashboard-share":{read:["public_viewer","public_editor","admin"],write:["admin"]},"audit-log":{read:["public_viewer","public_editor","admin"],write:[]},"custom-role":{read:["public_viewer","public_editor","admin"],write:["admin"]},"custom-usage-tag":{read:["public_viewer","public_editor","admin"],write:["admin"]},"cluster-integration-config":{read:["admin"],write:["admin"]},"explorer-saved-view":{read:["public_viewer","public_editor","admin"],write:["public_viewer","public_editor","admin"]},"operation-api-key":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"cloud-account":{read:["public_viewer","public_editor","admin"],write:["admin"]},dashboard:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"dashboard-folder":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"monitor-folder":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"dashboard-report":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},notebook:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},inventory:{read:["public_viewer","public_editor","admin"],write:[]},log:{read:["public_viewer","public_editor","admin"],write:[]},"log-route":{read:["public_viewer","public_editor","admin"],write:["admin","public_editor"]},"metric-route":{read:["public_viewer","public_editor","admin"],write:["admin","public_editor"]},"span-route":{read:["public_viewer","public_editor","admin"],write:["admin","public_editor"]},metric:{read:["public_viewer","public_editor","admin"],write:[]},trace:{read:["public_viewer","public_editor","admin"],write:[]},rum:{read:["public_viewer","public_editor","admin"],write:[]},monitor:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"monitor-alert":{read:["public_viewer","public_editor","admin"],write:[]},"monitor-debugging":{read:["admin"],write:[]},"notification-integration":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"notification-rule":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"adaptive-notification-rule":{read:["public_viewer","public_editor","admin"],write:["admin"]},"notification-silence":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"saml-config":{read:["admin"],write:["admin"]},"audit-log-stream-destination":{read:["admin"],write:["admin"]},org:{read:["public_viewer","public_editor","admin"],write:["admin"]},"allowed-domains":{read:["public_viewer","public_editor","admin"],write:["admin"]},"quality-report":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},billing:{read:["admin"],write:[]},"data-deletion-request":{read:["admin"],write:["admin"]},"sensitive-data-scanner-rule":{read:["public_viewer","public_editor","admin"],write:["admin"]},slo:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"synthetic-test":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"synthetic-variable":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"retention-policy":{read:["public_viewer","public_editor","admin"],write:["admin"]},"databricks-connection":{read:["public_viewer","public_editor","admin"],write:["admin"]},service:{read:["public_viewer","public_editor","admin"],write:[]},"service-target":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},database:{read:["public_viewer","public_editor","admin"],write:[]},queue:{read:["public_viewer","public_editor","admin"],write:[]},"tag-policy":{read:["public_viewer","public_editor","admin"],write:["admin"]},team:{read:["public_viewer","public_editor","admin"],write:["admin"]},"team-remap-config":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-data":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-invitation":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-permissions":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-self":{read:["public_viewer","public_editor","admin"],write:["public_viewer","public_editor","admin"]},"oauth-grant":{read:[],write:[]}},xke={"sandbox-configuration":{read:["viewer","editor","admin"],write:["editor","admin"]},"github-connection":{read:["admin"],write:[]},"llm-provider":{read:[],write:[]},investigation:{read:["viewer","editor","admin"],write:["editor","admin"]},"ingestion-api-key":{read:["viewer","editor","admin"],write:["editor","admin"]},"rum-public-token":{read:["viewer","editor","admin"],write:["editor","admin"]},"widget-share":{read:["viewer","editor","admin"],write:["viewer","editor","admin"]},"dashboard-share":{read:["viewer","editor","admin"],write:["admin"]},"audit-log":{read:["viewer","editor","admin"],write:[]},"custom-role":{read:["viewer","editor","admin"],write:[]},"custom-usage-tag":{read:[],write:[]},"cluster-integration-config":{read:[],write:[]},"explorer-saved-view":{read:["viewer","editor","admin"],write:["viewer","editor","admin"]},"operation-api-key":{read:["viewer","editor","admin"],write:["admin"]},"cloud-account":{read:["viewer","editor","admin"],write:[]},dashboard:{read:["viewer","editor","admin"],write:["editor","admin"]},"dashboard-folder":{read:["viewer","editor","admin"],write:["editor","admin"]},"monitor-folder":{read:["viewer","editor","admin"],write:["editor","admin"]},"dashboard-report":{read:["viewer","editor","admin"],write:["editor","admin"]},notebook:{read:["viewer","editor","admin"],write:["editor","admin"]},inventory:{read:["viewer","editor","admin"],write:[]},log:{read:["viewer","editor","admin"],write:[]},"log-route":{read:["viewer","editor","admin"],write:["editor","admin"]},"metric-route":{read:["viewer","editor","admin"],write:["editor","admin"]},"span-route":{read:["viewer","editor","admin"],write:["editor","admin"]},metric:{read:["viewer","editor","admin"],write:[]},trace:{read:["viewer","editor","admin"],write:[]},rum:{read:["viewer","editor","admin"],write:[]},monitor:{read:["viewer","editor","admin"],write:["editor","admin"]},"monitor-alert":{read:["viewer","editor","admin"],write:[]},"monitor-debugging":{read:["admin"],write:[]},"notification-integration":{read:["viewer","editor","admin"],write:["editor","admin"]},"notification-rule":{read:["viewer","editor","admin"],write:["editor","admin"]},"adaptive-notification-rule":{read:["viewer","editor","admin"],write:[]},"notification-silence":{read:["viewer","editor","admin"],write:["editor","admin"]},"saml-config":{read:[],write:[]},"audit-log-stream-destination":{read:[],write:[]},org:{read:["viewer","editor","admin"],write:[]},"allowed-domains":{read:["viewer","editor","admin"],write:[]},"quality-report":{read:["viewer","editor","admin"],write:["editor","admin"]},billing:{read:[],write:[]},"data-deletion-request":{read:[],write:[]},"sensitive-data-scanner-rule":{read:["viewer","editor","admin"],write:[]},slo:{read:["viewer","editor","admin"],write:["editor","admin"]},"synthetic-test":{read:["viewer","editor","admin"],write:["editor","admin"]},"synthetic-variable":{read:["viewer","editor","admin"],write:["editor","admin"]},"retention-policy":{read:[],write:[]},"databricks-connection":{read:[],write:[]},service:{read:["viewer","editor","admin"],write:[]},"service-target":{read:["viewer","editor","admin"],write:["editor","admin"]},database:{read:["viewer","editor","admin"],write:[]},queue:{read:["viewer","editor","admin"],write:[]},"tag-policy":{read:[],write:[]},team:{read:["viewer","editor","admin"],write:["admin"]},"team-remap-config":{read:[],write:[]},"user-data":{read:["viewer","editor","admin"],write:["admin"]},"user-invitation":{read:["viewer","editor","admin"],write:["admin"]},"user-permissions":{read:["viewer","editor","admin"],write:[]},"user-self":{read:["viewer","editor","admin"],write:["viewer","editor","admin"]},"oauth-grant":{read:[],write:[]}},Oke={user:bke,team:xke};function M0(e){return YZ(e,"team")}function D0(e){return YZ(e,"user")}function YZ(e,t){let r=[],o=Oke[t];for(let[i,s]of Object.entries(o))for(let[a,u]of Object.entries(s))u.includes(e)&&r.push({actionType:a,resourceType:i});return r}var Ake={admin:{name:"Global admin",description:"Full control across the organization. Can view and modify everything, including private teams.",permissions:D0("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:D0("public_editor"),roleKey:"public_editor"},public_viewer:{name:"Public viewer",description:"Read-only access to public team data. Cannot make changes.",permissions:D0("public_viewer"),roleKey:"public_viewer"},teams_only:{name:"Teams only",description:"Only access data and assets in their own teams.",permissions:[],roleKey:"teams_only"}},BFt=Object.values(Ake).map(e=>({value:e.roleKey,label:e.name,description:e.description})),jFt={admin:{name:"Team admin",description:"Full team control, manage assets, members, and settings.",permissions:M0("admin"),roleKey:"admin"},editor:{name:"Team editor",description:"Can view and update most assets (like dashboards, monitors).",permissions:M0("editor"),roleKey:"editor"},viewer:{name:"Team viewer",description:"Can view all team data but cannot make changes.",permissions:M0("viewer"),roleKey:"viewer"}};var qFt=new Set(N0);var Cke={documentation:void 0,investigations:"investigation",logs:"log",metrics:"metric",traces:"trace",user:"user-data","allowed-domains":"allowed-domains",billing:"billing","cloud-account":"cloud-account","custom-role":"custom-role","custom-usage-tag":"custom-usage-tag","data-deletion-request":"data-deletion-request",dashboard:"dashboard","dashboard-folder":"dashboard-folder","monitor-folder":"monitor-folder","ingestion-api-key":"ingestion-api-key",inventory:"inventory","log-route":"log-route","metric-route":"metric-route","span-route":"span-route",monitor:"monitor","notification-integration":"notification-integration","notification-rule":"notification-rule","adaptive-notification-rule":"adaptive-notification-rule","notification-silence":"notification-silence","operation-api-key":"operation-api-key","quality-report":"quality-report",queue:"queue","retention-policy":"retention-policy",rum:"rum","rum-public-token":"rum-public-token","sandbox-configuration":"sandbox-configuration",service:"service","service-target":"service-target",slo:"slo","tag-policy":"tag-policy",team:"team","user-invitation":"user-invitation"},Rke=Object.entries(Cke),HFt=new Map(Rke.flatMap(([e,t])=>t?[[t,e]]:[]));var WFt=[Sf,Ku,Ku.replace(`${ie}.`,"")];var F0=["red","orange","amber","yellow","green","emerald","teal","cyan","sky","blue","indigo","purple","pink"],$0=["light","dark"];var Pke={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)"}},VZ=["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 t$t=Pke.light.red.background;var WZ=12,QZ=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:"188073512757127",isUsingLuhnAlgorithm:!1,regexp:"\\b[12](?:[0-9]{2}(?:0[1-9]|1[0-2])(?:2[AB]|[0-9]{2})[0-9]{6}[0-9]{2}| [0-9]{2} (?:0[1-9]|1[0-2]) (?:2[AB]|[0-9]{2}) [0-9]{3} [0-9]{3} [0-9]{2})\\b"},{key:"ip_address",name:"IP address",category:"device-identifier",example:"81.55.13.53",isUsingLuhnAlgorithm:!1,regexp:""},{key:"social_security_number",name:"Social security number (XXX-XX-XXXX)",category:"personal-information",example:"437-02-2223",isUsingLuhnAlgorithm:!1,regexp:"(?x)(?-u:\\b)(?:00[1-9]|0[1-9][0-9]|[1-578][0-9]{2}|6[0-57-9][0-9]|66[0-57-9])-(?:0[1-9]|[1-9]0|[1-9][1-9])-(?:000[1-9]|00[1-9]0|0[1-9]00|[1-9]000|[1-9]{4})(?-u:\\b)"},{key:"social_security_number_space",name:"Social security number (XXX XX XXXX)",category:"personal-information",example:"437 02 2223",isUsingLuhnAlgorithm:!1,regexp:"(?x)(?-u:\\b)(?:00[1-9]|0[1-9][0-9]|[1-578][0-9]{2}|6[0-57-9][0-9]|66[0-57-9])\\s+(?:0[1-9]|[1-9]0|[1-9][1-9])\\s+(?:000[1-9]|00[1-9]0|0[1-9]00|[1-9]000|[1-9]{4})(?-u:\\b)"},{key:"social_security_number_digits",name:"Social security number (9 digits)",category:"personal-information",example:"437022223",isUsingLuhnAlgorithm:!1,regexp:"(?x)(?-u:\\b)(?:00[1-9]|0[1-9][0-9]|[1-578][0-9]{2}|6[0-57-9][0-9]|66[0-57-9])(?:0[1-9]|[1-9]0|[1-9][1-9])(?:000[1-9]|00[1-9]0|0[1-9]00|[1-9]000|[1-9]{4})(?-u:\\b)"},{key:"email",name:"Email",category:"credential",example:"admin@tsuga.com",isUsingLuhnAlgorithm:!1,regexp:"[a-zA-Z0-9-_.]*[a-zA-Z0-9_](@[a-zA-Z0-9_]+)(\\.[a-zA-Z0-9_]+(\\.[a-zA-Z0-9_]+)?[a-zA-Z])(?-u:\\b)"},{key:"one_password_secret_key",name:"1Password secret key",category:"credential",example:"A3-O28NKC-F58GULWCN72-4NIKS-KGY7V-U7FAT",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)A3-[A-Z0-9]{6}-(?:(?:[A-Z0-9]{11})|(?:[A-Z0-9]{6}-[A-Z0-9]{5}))-[A-Z0-9]{5}-[A-Z0-9]{5}-[A-Z0-9]{5}(?-u:\\b)"},{key:"one_password_service_account_token",name:"1Password service account token",category:"credential",example:"ops_eyJdAZ/FoIyz0jAXpEQOrRdIE8ydVaYfAXeZXGFqHWfBOjnE/Vgf5kHIbwrNAp2WeFNPeFiVJPlLv1hmaTVums0ldq1Kv8JEglMqP3f0ATBuX/WRbKqXYS3Z1wSzxg6S0krW4df7ZplvK04+JhJimejyTEH5dYaxqsYDBSLxjeEq7JWsmHEuXj6WP5qQi7FB+5s+CwhWPWY/jDhUMB3fdowXbfv5VnWri3iYrfBh+bFeRe9KURhXGHRDE9hgs",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ops_eyJ[a-zA-Z0-9+/]{50}"},{key:"adafruit_api_key",name:"Adafruit API key",category:"credential",example:"jb9pb4unb2bhe7xqepmgwtl2jg7ti101",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{32})"},{key:"adobe_client_id",name:"Adobe client ID",category:"credential",example:"c4166853dfd2897ebe706d49ef13fe63",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"adobe_client_secret",name:"Adobe client secret",category:"credential",example:"p8e-bb6e1614324ae48e507d33af176db3b7",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:p8e-[a-z0-9]{32})"},{key:"age_secret_key",name:"Age secret key",category:"credential",example:"AGE-SECRET-KEY-1QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)AGE-SECRET-KEY-1[QPZRY9X8GF2TVDW0S3JN54KHCE6MUA7L]{58}"},{key:"airtable_api_key",name:"Airtable API key",category:"credential",example:"19b73hbi0tc5cdy4w",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{17})"},{key:"algolia_api_key",name:"Algolia API key",category:"credential",example:"346155deb68d31c4018d73de73452947",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"alibaba_access_key_id",name:"Alibaba Cloud AccessKey ID",category:"credential",example:"LTAI7cc6804e4c2155cd52bd",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:LTAI[a-z0-9]{20})"},{key:"alibaba_secret_key",name:"Alibaba Cloud secret key",category:"credential",example:"suwixirhh10xhnko9bv0vfg2971u9p",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{30})"},{key:"anthropic_admin_api_key",name:"Anthropic admin API key",category:"credential",example:"sk-ant-admin01-abc12fake-456def789ghij-klmnopqrstuvwx-3456yza789bcde-12fakehijklmnopby56aaaogaopaaaabc123xyzAA",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sk-ant-admin01-[a-zA-Z0-9_-]{93}AA)"},{key:"anthropic_api_key",name:"Anthropic API key",category:"credential",example:"sk-ant-api03-abc123xyz-456def789ghij-klmnopqrstuvwx-3456yza789bcde-1234fghijklmnopby56aaaogaopaaaabc123xyzAA",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sk-ant-api03-[a-zA-Z0-9_-]{93}AA)"},{key:"artifactory_api_key",name:"Artifactory API key",category:"credential",example:"AKCpt771klpkqllt647fdf36fq43radbz2w2nyetvx4l90qyeef8kbgkmke63ul5vf6mqsy82",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)AKCp[A-Za-z0-9]{69}(?-u:\\b)"},{key:"artifactory_reference_token",name:"Artifactory reference token",category:"credential",example:"cmVmdc6i6888t9viuobfd88e46pdonjjsvmme6np82qti7wzbj7l9m1ygtyl9wik",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)cmVmd[A-Za-z0-9]{59}(?-u:\\b)"},{key:"asana_client_id",name:"Asana client ID",category:"credential",example:"9760134337886314",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9]{16})"},{key:"asana_client_secret",name:"Asana client secret",category:"credential",example:"tcnc8mjrf5bad359nnz3j1z90gow67ji",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"atlassian_api_token",name:"Atlassian API token",category:"credential",example:"fdo4scsa4kh53jnenkfp5fbe",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:[a-z0-9]{20}[a-f0-9]{4})|(?-u:\\b)(?:ATATT3[A-Za-z0-9_-=]{50})"},{key:"authress_service_client_access_key",name:"Authress service client access key",category:"credential",example:"sc_scmz00n9xj.0ykp.acc_2k5vtnrec4.55vc9459s-gc5qlia7a67jvzm0bobn3g0ezimd3b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:sc|ext|scauth|authress)_[a-z0-9]{5,30}\\.[a-z0-9]{4,6}\\.(?-i:acc)[_-][a-z0-9-]{10,32}\\.[a-z0-9+/_=-]{30})"},{key:"aws_access_token",name:"AWS access token",category:"credential",example:"AKIALALEMEL33243OLIB",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:A3T[A-Z0-9]|AKIA|ASIA|ABIA|ACCA)[A-Z2-7]{16})(?-u:\\b)"},{key:"azure_ad_client_secret",name:"Azure AD client secret",category:"credential",example:"bP88Q~rcBcYjzzOhg1Hnn76Wm3jGgakZiZ.8vMgR",isUsingLuhnAlgorithm:!1,regexp:"(?:^|[\\\\'\"` \\r\\n\\t\\f\\v>=:(?:,)])(?:[a-zA-Z0-9_~.]{3}[0-9]Q~[a-zA-Z0-9_~.-]{31,34})(?:$|[\\\\'\"` \\r\\n\\t\\f\\v<),])"},{key:"bitbucket_client_id",name:"Bitbucket client ID",category:"credential",example:"yyxmjnl3kahirvct7sat2082pzqdyf09",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"bitbucket_client_secret",name:"Bitbucket client secret",category:"credential",example:"fylw1pominwz91e5guqjiugw6srutpl64vzch5rnt8xnt31ka7so9va73fscz836",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{64})"},{key:"beamer_api_token",name:"Beamer API token",category:"credential",example:"b_zhy-phuoqk13asco6az4u_0yhtklgswm4umkv95nv4gu",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:b_[a-z0-9=_\\-]{44})"},{key:"codecov_access_token",name:"Codecov access token",category:"credential",example:"r93iopllonuphk41qglet20y8cb83thm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"clickhouse_cloud_api_secret_key",name:"ClickHouse Cloud API secret key",category:"credential",example:"4b1dbRdW3rOcB7xLthrM4BTBGK1qPLkHigpN1bXD6z",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:4b1d[A-Za-z0-9]{38})(?-u:\\b)"},{key:"clojars_api_token",name:"Clojars API token",category:"credential",example:"CLOJARS_d1vd7t0blxaarzx25dxoda4hm5ox86st6o5ww7tnzsfz07wvu223bf0fmgim",isUsingLuhnAlgorithm:!1,regexp:"CLOJARS_[a-z0-9]{60}"},{key:"cloudflare_api_key",name:"Cloudflare API key",category:"credential",example:"ckg0h_dzkxnl627gy3nskpq9wzm4d5hc_vxk272h",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{40})"},{key:"cloudflare_global_api_key",name:"Cloudflare global API key",category:"credential",example:"1d003bb65ec73ad2691fb76631b6496e3c9d9",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{37})"},{key:"cloudflare_origin_ca_key",name:"Cloudflare Origin CA key",category:"credential",example:"v1.0-aaa334dc886f30631ba0a610-0d98ef66290d7e50aac7c27b5986c99e6f3f1084c881d8ac0eae5de1d1aa0644076ff57022069b3237d19afe60ad045f207ef2b16387ee37b749441b2ae2e9ebe5b4606e846475d4a5",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:v1\\.0-[a-f0-9]{24}-[a-f0-9]{50})"},{key:"cohere_api_token",name:"Cohere API token",category:"credential",example:"lpn59BQ4FNUabVJh1vCpIqZpQbaViELQrTa14p9D",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:[a-zA-Z0-9]{40})"},{key:"confluent_access_token",name:"Confluent access token",category:"credential",example:"kkat92sclkukwvr2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{16})"},{key:"confluent_secret_key",name:"Confluent secret key",category:"credential",example:"64d4ppp37l9fjhadm8vv0awie6wjo4d6ourfcqvi2bcs2tm95x4f0e8gyb8z8usj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"contentful_delivery_api_token",name:"Contentful delivery API token",category:"credential",example:"eumospigka64wiwpavfmmblrq7x1hm6gz84wiiw2ff3",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{43})"},{key:"curl_auth_header",name:"Curl authorization header",category:"credential",example:"curl --header 'Authorization: 5eb4223e-5008-46e5-be67-c7b8f2732305'",isUsingLuhnAlgorithm:!1,regexp:`(?-u:\\b)curl(?-u:\\b)(?:.*?|.*?(?:[\\r\\n]{1,2}.*?){1,5})[ \\t\\n\\r](?:-H|--header)(?:=|[ \\t]{0,5})(?:"(?:Authorization:[ \\t]{0,5}(?:Basic[ \\t](?:[a-z0-9+/]{8,}={0,3})|(?:Bearer|(?:Api-)?Token)[ \\t](?:[a-zA-Z0-9_=~@.+/-]{8,})|(?:[a-zA-Z0-9_=~@.+/-]{8,}))|(?:(?:X-(?:[a-z]+-)?)?(?:Api-?)?(?:Key|Token)):[ \\t]{0,5}(?:[a-zA-Z0-9_=~@.+/-]{8,}))"|'(?:Authorization:[ \\t]{0,5}(?:Basic[ \\t](?:[a-z0-9+/]{8,}={0,3})|(?:Bearer|(?:Api-)?Token)[ \\t](?:[a-zA-Z0-9_=~@.+/-]{8,})|(?:[a-zA-Z0-9_=~@.+/-]{8,}))|(?:(?:X-(?:[a-z]+-)?)?(?:Api-?)?(?:Key|Token)):[ \\t]{0,5}(?:[a-zA-Z0-9_=~@.+/-]{8,}))')(?:(?-u:\\B)|[ \\r\\n\\t\\f\\v]|\\z)`},{key:"curl_auth_user",name:"Curl basic authentication",category:"credential",example:"curl -u elastic:P@ssw0rd$1",isUsingLuhnAlgorithm:!1,regexp:`(?-u:\\b)curl(?-u:\\b)(?:.*|.*(?:[\\r\\n]{1,2}.*){1,5})[ \\t\\n\\r](?:-u|--user)(?:=|[ \\t]{0,5})(?:"(:[^"]{3,}|[^:"]{3,}:|[^:"]{3,}:[^"]{3,})"|'(?:[^:']{3,}:[^']{3,})'|(?:(?:"[^"]{3,}"|'[^']{3,}'|[a-zA-Z0-9_$@.-]+):(?:"[^"]{3,}"|'[^']{3,}'|[a-zA-Z0-9_\${}@.-]+)))(?:[ \\r\\n\\t\\f\\v]|\\z)`},{key:"databricks_api_token",name:"Databricks API token",category:"credential",example:"dapia2553f815d29a193fd09c2bb55201895",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:dapi[a-f0-9]{32}(?:-[0-9])?)"},{key:"datadog_access_token",name:"Datadog access token",category:"credential",example:"ljgbhjnca2hy5yc2nv7cag1ag7ehx2hc6geparov",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{40})"},{key:"defined_networking_api_token",name:"Defined Networking API token",category:"credential",example:"dnkey-nowf_nwyqhvqt1gi66xnuuf2rb-bfxnr9_qydyxnxn1y8uijvhhp9owllbg-2czoe-7qs5_w5650xei",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:-[a-z0-9=_\\-]{26}-[a-z0-9=_\\-]{52})"},{key:"digitalocean_pat",name:"DigitalOcean personal access token",category:"credential",example:"dop_v1_ec8f4a856c1459bd442a275461e2f709506347de30b180851cde71f696e9fcc8",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:dop_v1_[a-f0-9]{64})"},{key:"digitalocean_access_token",name:"DigitalOcean OAuth access token",category:"credential",example:"doo_v1_42b8ea6c4b0c373f88aff9d3fa87e123ab23b0d3c22ac6d4361a4e9c1e89eaa6",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:doo_v1_[a-f0-9]{64})"},{key:"digitalocean_refresh_token",name:"DigitalOcean OAuth refresh token",category:"credential",example:"dor_v1_4d9b3e6fbe65ab472e464dfa6377d702e80164442acdfbeb3ef032d917cb9984",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:dor_v1_[a-f0-9]{64})"},{key:"discord_api_token",name:"Discord API token",category:"credential",example:"7eb855d9a40747182d0b0ea74df27aee31d05756a9933a815a3ccb5a46b2d61d",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{64})"},{key:"discord_client_id",name:"Discord client ID",category:"credential",example:"763721114261247538",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9]{18})"},{key:"discord_client_secret",name:"Discord client secret",category:"credential",example:"13641266018325206246161633988007",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{32})"},{key:"doppler_api_token",name:"Doppler API token",category:"credential",example:"dp.pt.vgin8wwjy7sx66fyq99tavkm3y5g2jdxmsufh257dhj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)dp\\.pt\\.[a-z0-9]{43}"},{key:"dropbox_api_token",name:"Dropbox API token",category:"credential",example:"rdlztoij88rzrsk",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{15})"},{key:"droneci_access_token",name:"DroneCI access token",category:"credential",example:"v26gffr903rbti5v7m392ba0u7oarz36",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"duffel_api_token",name:"Duffel API token",category:"credential",example:"duffel_test_-yd6b3pc4jy593pt5kr2l3ynzkb5b_f619dshefiz=v",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)duffel_(?:test|live)_[a-z0-9_\\-=]{43}"},{key:"dynatrace_api_token",name:"Dynatrace API token",category:"credential",example:"dt0c01.ben820rdpb1so4kasfx3yn4a.zkje7lawif35udsin5t1mi1m1sne7wdzphlzrmdnu3j69gr4kgf5dwg4x5lb30zg",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)dt0c01\\.[a-z0-9]{24}\\.[a-z0-9]{64}"},{key:"easypost_api_token",name:"EasyPost API token",category:"credential",example:"EZAKBVScDZwZFv0nJXHBcxPGil7eztnPJOSmDFf2NGKQk6Dn7VqULciSRm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)EZAK[a-z0-9]{54}(?-u:\\b)"},{key:"easypost_test_api_token",name:"EasyPost test API token",category:"credential",example:"EZTKuxUXVU5HBS1K2iyh165t3VtivpdxMgIf5Y2P1oJxeFeaJGcwzVexds",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)EZTK[a-z0-9]{54}(?-u:\\b)"},{key:"etsy_access_token",name:"Etsy access token",category:"credential",example:"8ssp35lhprxpb3sjyergcz5z",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{24})"},{key:"facebook_secret",name:"Facebook secret",category:"credential",example:"c41c21ba4fb5ee05398db86ca83f06db",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"facebook_access_token",name:"Facebook access token",category:"credential",example:"911602140448729|AY-lRJZq9BoDLobvAiP25L7RcMg",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:[0-9]{15,16}(\\||%)[0-9a-z\\-_]{27,40})"},{key:"facebook_page_access_token",name:"Facebook page access token",category:"credential",example:"EAAM9GOnCB9kBO2frzOAWGN2zMnZClQshlWydZCrBNdodesbwimx1mfVJgqZBP5RSpMfUzWhtjTTXHG5I1UlvlwRZCgjm3ZBVGeTYiqAAoxyED6HaUdhpGVNoPUwAuAWWFsi9OvyYBQt22DGLqMIgD7VktuCTTZCWKasz81Q822FPhMTB9VFFyClNzQ0NLZClt9zxpsMMrUZCo1VU1rL3CKavir5QTfBjfCEzHNlWAUDUV2YZD",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:EAA[MC][a-z0-9]{50})"},{key:"fastly_api_token",name:"Fastly API token",category:"credential",example:"im7_ux24tyyxz_4y4mvzj22akpid830c",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{32})"},{key:"finicity_client_secret",name:"Finicity client secret",category:"credential",example:"roepymyr0ce7wxhjvgb2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{20})"},{key:"finicity_api_token",name:"Finicity API token",category:"credential",example:'= "cce089057c8b7fe7f2a8474b9a050816',isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"flickr_access_token",name:"Flickr access token",category:"credential",example:"damvt93tudulk6wrfp36sawndc9pa7bb",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"finnhub_access_token",name:"Finnhub access token",category:"credential",example:"x01lnfp13spcbsa0at32",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{20})"},{key:"flutterwave_public_key",name:"Flutterwave public key",category:"credential",example:"FLWPUBK_TEST-99484d505b4ee5c1181a2884f5fe3852-X",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)FLWPUBK_TEST-[a-h0-9]{32}-X"},{key:"flutterwave_secret_key",name:"Flutterwave secret key",category:"credential",example:"FLWSECK_TEST-66187ac83488c2245f0d7e95fa37e833-X",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)FLWSECK_TEST-[a-h0-9]{32}-X"},{key:"flutterwave_encryption_key",name:"Flutterwave encryption key",category:"credential",example:"FLWSECK_TEST-6262214a02e7",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)FLWSECK_TEST-[a-h0-9]{12}"},{key:"flyio_access_token",name:"Fly.io access token",category:"credential",example:"fo1_m-HT0NHLBSPwMJ2hIer4v3lxtWEC7grXNidQxJMrVVE",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:fo1_[a-zA-Z0-9_-]{43}|fm1[ar]_[a-zA-Z0-9+\\/]{50}))"},{key:"frameio_api_token",name:"Frame.io API token",category:"credential",example:"fio-u-4ov9vjtr2wwj8j1gob-8xrx2-1=z818psmitskgoq4=p-_k77d54034z55xk-lqh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)fio-u-[a-z0-9\\-_=]{64}"},{key:"freshbooks_access_token",name:"FreshBooks access token",category:"credential",example:"gqw118uwne1nddlt4yruvvs4jr9s0vrj5mxaswgb2amacod8lgnmrknsvbovsx1g",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"gocardless_api_token",name:"GoCardless API token",category:"credential",example:"live_-z4lwtrrk6p6=-v1ig_y_4ceplziwek0lw=oz-eu",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:live_[a-z0-9\\-_=]{40})"},{key:"gcp_api_key",name:"GCP API key",category:"credential",example:"AIzaYpvGqEzpgB7R353HD9CxN8LuhZ6d6UfuXLL",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:AIza[a-zA-Z0-9_-]{35})"},{key:"github_pat",name:"GitHub personal access token",category:"credential",example:"ghp_t7i9llxuukeb7apn4zlnyeyz5b0007rsfs54",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ghp_[0-9a-zA-Z]{36}"},{key:"github_fine_grained_pat",name:"GitHub fine-grained personal access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)github_pat_[a-zA-Z0-9_]{82}"},{key:"github_oauth",name:"GitHub OAuth token",category:"credential",example:"gho_anlrm6zqscqityoqozv503by66dobnem4yxh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)gho_[0-9a-zA-Z]{36}"},{key:"github_app_token",name:"GitHub app token",category:"credential",example:"ghs_0zleityj4n1ulz178o9in1w97q1ifw8u3y8h",isUsingLuhnAlgorithm:!1,regexp:"(?:ghu|ghs)_[0-9a-zA-Z]{36}"},{key:"github_refresh_token",name:"GitHub refresh token",category:"credential",example:"ghr_inu1aa7qbgi46cf8nprbgh4kn03d0zk35raj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ghr_[0-9a-zA-Z]{36}"},{key:"gitlab_cicd_job_token",name:"GitLab CI/CD job token",category:"credential",example:"glcbt-7h2nr_6jmho0uoqkb1ww431kfl",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glcbt-[0-9a-zA-Z]{1,5}_[0-9a-zA-Z_-]{20}"},{key:"gitlab_deploy_token",name:"GitLab deploy token",category:"credential",example:"gldt-7a3o70gqa8zkal0zdp4x",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)gldt-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_feature_flag_client_token",name:"GitLab feature flag client token",category:"credential",example:"glffct-dsct62ndnvcj7alw5nas",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glffct-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_feed_token",name:"GitLab feed token",category:"credential",example:"glft-13956nvy00289v6xu0di",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glft-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_incoming_mail_token",name:"GitLab incoming mail token",category:"credential",example:"glimt-fcdt1a5jvj01si61jgkse2r20",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glimt-[0-9a-zA-Z_\\-]{25}"},{key:"gitlab_kubernetes_agent_token",name:"GitLab Kubernetes agent token",category:"credential",example:"glagent-8wxkulkbbuk7u6r3nvrefswdfw5o0v7vy81y4oky8rnfogm826",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glagent-[0-9a-zA-Z_\\-]{50}"},{key:"gitlab_oauth_app_secret",name:"GitLab OAuth app secret",category:"credential",example:"gloas-vawws2nw5kf6rizn49g41jc3jiy4xqioaihrwm1msltbdt4cbmo4x52tygcic7af",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)gloas-[0-9a-zA-Z_\\-]{64}"},{key:"gitlab_pat",name:"GitLab personal access token",category:"credential",example:"glpat-2gl3ku1497ms4gzyv16i",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glpat-[a-zA-Z0-9_-]{20}"},{key:"gitlab_pat_routable",name:"GitLab personal access token (routable)",category:"credential",example:"glpat-2hf7vebpux9j56tdcqqsvap7vxc.chvjof35u",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glpat-[0-9a-zA-Z_-]{27}\\.[0-9a-z]{2}[0-9a-z]{7}(?-u:\\b)"},{key:"gitlab_ptt",name:"GitLab personal access token (temporary)",category:"credential",example:"glptt-b54e8b7b90cf006b79af110baa9b8d9183fd7048",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glptt-[0-9a-f]{40}"},{key:"gitlab_rrt",name:"GitLab registration token",category:"credential",example:"GR1348941vnauzmn2hj0zncvt0nfe",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)GR1348941[a-zA-Z0-9_-]{20}"},{key:"gitlab_runner_authentication_token",name:"GitLab runner authentication token",category:"credential",example:"glrt-xbd1w7c9clbxm52zdxkm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glrt-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_runner_authentication_token_routable",name:"GitLab runner authentication token (routable)",category:"credential",example:"glrt-t5_8d8ugbkfzddae0dw06tvm0x7qxc.mwcd1a7cn",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glrt-t[0-9]_[0-9a-zA-Z_\\-]{27}\\.[0-9a-z]{2}[0-9a-z]{7}(?-u:\\b)"},{key:"gitlab_scim_token",name:"GitLab SCIM token",category:"credential",example:"glsoat-9jb5zk1nvy800c1uqhh0",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glsoat-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_session_cookie",name:"GitLab session cookie",category:"credential",example:"_gitlab_session=yjhub6vtrp60djn6rszuemeacsoqox97",isUsingLuhnAlgorithm:!1,regexp:"_gitlab_session=[0-9a-z]{32}"},{key:"gitter_access_token",name:"Gitter access token",category:"credential",example:"uazubes6trcd_1gym09opuf_8gj1rmvj6jwber4a",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{40})"},{key:"grafana_api_key",name:"Grafana API key",category:"credential",example:"eyJrIjoiyl5shjvqja0xkfbu38m24vn5httsipr1h9fgjhodxzlkpravuiy8h7hom5kt8gtwuguh2v",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:eyJrIjoi[A-Za-z0-9]{70}={0,3})"},{key:"grafana_cloud_api_token",name:"Grafana cloud API token",category:"credential",example:"glc_cb7p4j2g1qu0sy84me72ufmn1z8mqk8y",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:glc_[A-Za-z0-9+/]{32}={0,3})"},{key:"grafana_service_account_token",name:"Grafana service account token",category:"credential",example:"glsa_rm3sadbwl8o2c13v4ipgkz04h66kiy6t_edaea401",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:glsa_[A-Za-z0-9]{32}_[A-Fa-f0-9]{8})"},{key:"harness_api_key",name:"Harness API key",category:"credential",example:"pat.vzcxr183pymw194fdq1q0v.qjqjarqkd9ydxqagjmq3f5iq.8nn5nyaow3h5mmgjh053",isUsingLuhnAlgorithm:!1,regexp:"(?:pat|sat)\\.[a-zA-Z0-9_-]{22}\\.[a-zA-Z0-9]{24}\\.[a-zA-Z0-9]{20}"},{key:"hashicorp_tf_api_token",name:"HashiCorp Terraform API token",category:"credential",example:"984d8033429986.atlasv1.799k5cihj_807yc1e8afvla8ackd1khsb50nfeswbxbr1re54y0wpzs2tjy=",isUsingLuhnAlgorithm:!1,regexp:"[a-z0-9]{14}\\.(?-i:atlasv1)\\.[a-z0-9\\-_=]{60,70}"},{key:"heroku_api_key",name:"Heroku API key",category:"credential",example:"9127f65b-8b3f-c0b7-a336-a4347e71bc51",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"heroku_api_key_v2",name:"Heroku API key v2",category:"credential",example:"HRKU-AAxPYvV6l2R3DvF0w9VJ4m8cz9oaygOHxpQvcw--iD51MszQZeakD9DZsclX",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(HRKU-AA[0-9a-zA-Z_-]{58}))"},{key:"hubspot_api_key",name:"HubSpot API key",category:"credential",example:"86cb6664-b191-db72-95a7-49adebe84b74",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12})"},{key:"huggingface_access_token",name:"HuggingFace access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:hf_(?i:[a-z]{34}))"},{key:"huggingface_organization_api_token",name:"HuggingFace organization API token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:api_org_(?i:[a-z]{34}))"},{key:"intercom_api_key",name:"Intercom API key",category:"credential",example:"zuc5c=ykf5gcwesqvmh2pji6k3extx0rbalsznte3sdo7iu7f-lumol2npfk",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{60})"},{key:"intra42_client_secret",name:"Intra42 client secret",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:s-s4t2(?:ud|af)-[abcdef0123456789]{64})"},{key:"jfrog_api_key",name:"JFrog API key",category:"credential",example:"lj7nrgoo0kr04kw312zvly7l0olsn37vhto5wdn3yqi5srxnc2axstp7a1kewkxi717w295kh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{73})"},{key:"jfrog_identity_token",name:"JFrog identity token",category:"credential",example:"xh0x2upbtkkg1pseg7ezmcyw2c3kt0bt05l5v8ynvkro6wagolhch0f7kppplt8b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"jwt",name:"JSON web token",category:"credential",example:"ey7gzQUpN8Kz7XY6Yin.ey1o36_XrBphAG8WMHQ.",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:ey[a-zA-Z0-9]{17,}\\.ey[a-zA-Z0-9\\/\\\\_-]{17,}\\.(?:[a-zA-Z0-9\\/\\\\_-]{10,}={0,2})?)"},{key:"jwt_base64",name:"JSON web token base64",category:"credential",example:"ZXlKNE5YUWpVekkxTmlJNklsUjFUM0pDZVRKT1kxUnNSbE5YZFZvNFMyZzRWemhCYWxGaFoySTBabTVtVURGVGJFdE5Uemd0VTI4aWZRLmV5SnBjM01pT2lKcWIyVWlMQTBLSUNKbGVIQWlPakV6TURBNE1Ua3pPREFzRFFvZ0ltaDBkSEE2THk5bGVHRnRjR3hsTG1OdmJTOXBjMTl5YjI5MElqcDBjblZsZlEuZEJqZnRKZVo0Q1ZQLW1COTJLMjd1aGJVSlUxcDFyX3dXMWdGV0ZPRWpYaw==",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ZXlK(?:(?P<alg>aGJHY2lPaU)|(?P<apu>aGNIVWlPaU)|(?P<apv>aGNIWWlPaU)|(?P<aud>aGRXUWlPaU)|(?P<b64>aU5qUWlP)|(?P<crit>amNtbDBJanBi)|(?P<cty>amRIa2lPaU)|(?P<epk>bGNHc2lPbn)|(?P<enc>bGJtTWlPaU)|(?P<jku>cWEzVWlPaU)|(?P<jwk>cWQyc2lPb)|(?P<iss>cGMzTWlPaU)|(?P<iv>cGRpSTZJ)|(?P<kid>cmFXUWlP)|(?P<key_ops>clpYbGZiM0J6SWpwY)|(?P<kty>cmRIa2lPaUp)|(?P<nonce>dWIyNWpaU0k2)|(?P<p2c>d01tTWlP)|(?P<p2s>d01uTWlPaU)|(?P<ppt>d2NIUWlPaU)|(?P<sub>emRXSWlPaU)|(?P<svt>emRuUWlP)|(?P<tag>MFlXY2lPaU)|(?P<typ>MGVYQWlPaUp)|(?P<url>MWNtd2l)|(?P<use>MWMyVWlPaUp)|(?P<ver>MlpYSWlPaU)|(?P<version>MlpYSnphVzl1SWpv)|(?P<x>NElqb2)|(?P<x5c>NE5XTWlP)|(?P<x5t>NE5YUWlPaU)|(?P<x5ts256>NE5YUWpVekkxTmlJNkl)|(?P<x5u>NE5YVWlPaU)|(?P<zip>NmFYQWlPaU))[a-zA-Z0-9\\/\\\\_+\\-\\r\\n]{40,}={0,2}"},{key:"launchdarkly_access_token",name:"LaunchDarkly access token",category:"credential",example:"ezmej9s6yv4qwk2=yeb4kfi162p33b_2hzm7tr-0",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{40})"},{key:"linear_api_key",name:"Linear API key",category:"credential",example:"lin_api_0n5n0k26vb4ka9je9dqdcwl1dae5mbpfhb48xio6",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)lin_api_[a-z0-9]{40}"},{key:"linear_client_secret",name:"Linear client secret",category:"credential",example:"7b956760f09b81684ed833c524f081de",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"linkedin_client_id",name:"LinkedIn client ID",category:"credential",example:"18u930hak0em0r",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{14})"},{key:"linkedin_client_secret",name:"LinkedIn client secret",category:"credential",example:"uvkxd9rw41ylk1zj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{16})"},{key:"lob_api_key",name:"Lob API key",category:"credential",example:"test_02efbb923a38370aac769e3bedc4d3398be",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:(live|test)_[a-f0-9]{35})"},{key:"lob_pub_api_key",name:"Lob publishable API key",category:"credential",example:"test_pub_df170d9f5be9244959713dfee686c42",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:(test|live)_pub_[a-f0-9]{31})"},{key:"mailchimp_api_key",name:"MailChimp API key",category:"credential",example:"81277fbbe2dd9c5e18d5f28cebcc558c-us20",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32}-us[0-9][0-9])"},{key:"mailgun_pub_key",name:"Mailgun public validation key",category:"credential",example:"pubkey-5011bae1a4b57dfa83762c24b0e1299d",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:pubkey-[a-f0-9]{32})"},{key:"mailgun_private_api_token",name:"Mailgun private API token",category:"credential",example:"key-176f7ef066471ac351adab734d2c9fb2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:key-[a-f0-9]{32})"},{key:"mailgun_signing_key",name:"Mailgun webhook signing key",category:"credential",example:"24564bd3d54a469601d5ac5daecb9ad2-00001111-22223333",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-h0-9]{32}-[a-h0-9]{8}-[a-h0-9]{8})"},{key:"mapbox_api_token",name:"MapBox API token",category:"credential",example:"pk.5ko18udoy3cilkpgyedje9limykwj8n7wmhug4967o9wze284mmpuuhjzgig.edjzuv7jwhc6lnv5b3p9nc",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:pk\\.[a-z0-9]{60}\\.[a-z0-9]{22})"},{key:"mattermost_access_token",name:"Mattermost access token",category:"credential",example:"rtw2hncbfhpbyyri90d3q2mo1m",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{26})"},{key:"maxmind_license_key",name:"MaxMind license key",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:[A-Za-z0-9]{6}_[A-Za-z0-9]{29}_mmk)"},{key:"cisco_meraki_api_key",name:"Cisco Meraki API key",category:"credential",example:"acea14a1470f7cf443a031dde64065ce81c77b2b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:[0-9a-f]{40})"},{key:"messagebird_api_token",name:"MessageBird API token",category:"credential",example:"448q6im7yxutswabdko1n69ry",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{25})"},{key:"messagebird_client_id",name:"MessageBird client ID",category:"credential",example:"12345678-ABCD-ABCD-ABCD-1234567890AB",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"netlify_access_token",name:"Netlify access token",category:"credential",example:"3j1sa0o20v0k-cjbjn3vh_4uqnkvb3w_px5no2in",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{40,46})"},{key:"new_relic_user_api_key",name:"New Relic user API key",category:"credential",example:"NRAK-zozcnrh45ornsbl1duyfhell59u",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:NRAK-[a-z0-9]{27})"},{key:"new_relic_user_api_id",name:"New Relic user API ID",category:"credential",example:"k0jze7delork84k8ke1z1dm275yw2aqf5uu2cy7x1uiloll3xab5203hiz9tx9xx",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"new_relic_browser_api_token",name:"New Relic browser API token",category:"credential",example:"NRJS-c7fa1261a97506e4a45",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:NRJS-[a-f0-9]{19})"},{key:"new_relic_insert_key",name:"New Relic insight insert key",category:"credential",example:"NRII-4168ab7eb2e051f37144ad884d32ab34",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:NRII-[a-z0-9-]{32})"},{key:"notion_api_token",name:"Notion API token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:ntn_[0-9]{11}[A-Za-z0-9]{32}[A-Za-z0-9]{3})"},{key:"npm_access_token",name:"npm access token",category:"credential",example:"npm_vz9e7fvsn7o2n2tddg6b01gs7g9wldlys4vm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:npm_[a-z0-9]{36})"},{key:"nytimes_access_token",name:"NYTimes access token",category:"credential",example:"ako7xzi0mx7w15ogdkew7ilq7h13x8rl",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{32})"},{key:"octopus_deploy_api_key",name:"Octopus Deploy API key",category:"credential",example:"API-NFWN6F7X32BYDBU94IGY3V5ZQY",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:API-[A-Z0-9]{26})"},{key:"okta_access_token",name:"Okta access token",category:"credential",example:"003cKkRNNMy4ul7V8UDHEjEBGbnsQ6tejSHzfeBtcp",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:00[a-zA-Z0-9_=\\-]{40})"},{key:"openai_api_key",name:"OpenAI API key",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sk-(?:proj|svcacct|admin)-(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})T3BlbkFJ(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})(?-u:\\b)|sk-[a-zA-Z0-9]{20}T3BlbkFJ[a-zA-Z0-9]{20})"},{key:"openshift_user_token",name:"OpenShift user token",category:"credential",example:"sha256~OFL-TnR3jyLteu_rAuff3PUYNELVvByMRFYCcAkaJSR",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sha256~[a-zA-Z0-9_-]{43})(?:[^a-zA-Z0-9_-]|\\z)"},{key:"perplexity_api_key",name:"Perplexity API key",category:"credential",example:"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'",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pplx-[a-zA-Z0-9]{48})(?:[`'\" \\r\\n\\t\\f\\v;]|\\\\[nr]|$|(?-u:\\b))"},{key:"pgpassword_shell_assignment",name:"PGPASSWORD shell assignment",category:"credential",example:"PGPASSWORD='supersecret'",isUsingLuhnAlgorithm:!1,regexp:`(?-u:\\b)PGPASSWORD=(?:"[^"\\r\\n]+"|'[^'\\r\\n]+'|[^\\s'"]+)`},{key:"plaid_api_token",name:"Plaid API token",category:"credential",example:"access-development-4b0f8c31-83fe-e4c5-3d02-91e487b69d2d",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:access-(?:sandbox|development|production)-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"plaid_client_id",name:"Plaid client ID",category:"credential",example:"TTPjxpFNiwOct5XLdxjXD0Ta",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{24})"},{key:"plaid_secret_key",name:"Plaid secret key",category:"credential",example:"ikhqm7a9k76l8f544dl0v8kxvm2w55",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{30})"},{key:"planetscale_password",name:"PlanetScale password",category:"credential",example:"pscale_pw_9gvu8z79m4b814z0vv8266w70h3i7jlq",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pscale_pw_[a-zA-Z0-9_=\\.-]{32,64})"},{key:"planetscale_api_token",name:"PlanetScale API token",category:"credential",example:"pscale_tkn_nwy9jkjgnry96ftecsx_=jrxc6pkmmew",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pscale_tkn_[a-zA-Z0-9_=\\.-]{32,64})"},{key:"planetscale_oauth_token",name:"PlanetScale OAuth token",category:"credential",example:"pscale_oauth_zx8v3gzfnfxbymj__l629i68jnz5gnff",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pscale_oauth_[a-zA-Z0-9_=\\.-]{32,64})"},{key:"postman_api_token",name:"Postman API token",category:"credential",example:"PMAK-525b84aa46e2c588620d8123-06f9ca36c4aad4305baafbe00716b7bc8f",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:PMAK-[a-f0-9]{24}\\-[a-f0-9]{34})"},{key:"prefect_api_token",name:"Prefect API token",category:"credential",example:"pnu_kttbffyfgffu2sfbxzxw8mbpgvvtxjljwe1p",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pnu_[a-zA-Z0-9]{36})"},{key:"privateai_api_token",name:"PrivateAI API token",category:"credential",example:"iwuxqzqilzbfnccncvjz6px23dnej11h",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"private_key",name:"Private key",category:"credential",example:`-----BEGIN PRIVATE KEY-----
|
|
272
|
+
`)}var hA=un({accessToken:Lb,accessExpiresAt:Lb,refreshToken:Tt(ye)}),cNe=Lo(wi(hA)),G7=e=>cNe(e.trim()).pipe(ht(()=>new KE({message:"The saved session is unreadable.",suggestions:["Sign in again to replace it: tsuga auth login"]}))),uNe=5*Hl;function T0(e,t){let r=Date.parse(e.accessExpiresAt);return Number.isNaN(r)?!0:r<=t+uNe}function B7(e){if(e.flagKey)return{kind:"operation-api-key",token:e.flagKey,source:"flag"};if(e.environmentKey)return{kind:"operation-api-key",token:e.environmentKey,source:"environment"};if(e.operationApiKey)return{kind:"operation-api-key",token:e.operationApiKey,source:"config"};if(e.userAuth)return{kind:"user-session",userAuth:e.userAuth}}var j7="tsuga-cli",pNe="Tsuga CLI session",vf=class extends Qe()("SecretStore",{make:pt(function*(){let t=process.platform==="linux"?yield*D7({service:j7,label:pNe}):yield*L7(j7);return{location:t.location,read:k(function*(r){let o=yield*t.read(r);return o===void 0?void 0:yield*G7(o)}),save:(r,o)=>t.save(r,JSON.stringify(o)),remove:t.remove}})}){static layer=Uo(this,this.make)};var mn=class e extends Qe()("common-cli/OutputFormatter"){static layer=Qi(e)(q7("rows"));static pageLayer=Qi(e)(q7("page"))};function q7(e){return{rows:(t,r)=>pt(function*(){if(r.pretty??(yield*HE))return yield*C7(t,r);yield*e==="page"?xe({data:t,metadata:r.metadata},r.fields):Es(t,r.fields)})}}var pa=class extends Qe()("GlobalFlags"){},H7=Ie("cli/Argv",{defaultValue:()=>process.argv.slice(2)});var K7="__tsuga_cluster_id__",lNe=n.Object({}),dNe=n.Object({status:n.Literal("error"),message:n.String({description:"Why this cluster failed to answer the query."})});function Nf(e=lNe){let t=D("status",[n.Object({...e.properties,status:n.Literal("ok")}),dNe]);return Object.assign(Jx(ii,t),{description:'Outcome per cluster, keyed by cluster ID. A cluster that failed reports `status: "error"`.'})}var mNe=5,bc=n.Array(p({allowEmpty:!1}),{minItems:1,maxItems:mNe,uniqueItems:!0,description:"IDs of the clusters to query, without duplicates. Mutually exclusive with `clusterId`. Omit both to use the default cluster."});var z7=n.Object({type:n.Literal("number"),number:n.String()}),fNe=n.Object({type:n.Literal("string"),string:n.String()}),gNe=n.Object({type:n.Literal("timestamp"),timestamp:n.String()}),zE=D("type",[z7,fNe,gNe]),hNe=n.Object({by:n.Record(n.String(),zE),computed:n.Record(n.String(),z7)}),yNe=n.Object({type:n.Literal("buckets"),buckets:n.Array(hNe),clusterResponses:n.Optional(Nf())}),ENe=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()))}),kf=D("type",[yNe,ENe]);var S0=["all","owning-team-and-public","owning-team-only"],Ts=n.Enum(S0,{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 V7=1456444800,W7=4927737600,TNe=V7*1e3,SNe=W7*1e3,yA=1704067200,EA=yA+3600,Q7=yA*1e3,Z7=EA*1e3,X7={title:"TimeRange",description:"Inclusive time range for telemetry queries. Use Unix timestamps in seconds unless the field description says milliseconds.",examples:[{from:yA,to:EA}]},_Ne={title:"V2TimeRange",description:"Inclusive time range for telemetry queries using Unix timestamps in milliseconds.",examples:[{from:Q7,to:Z7}]},Ql=(e,t=yA)=>n.Integer({description:e,examples:[t],minimum:V7,maximum:W7,format:"int64"}),Y7=(e,t=Q7)=>n.Integer({description:e,examples:[t],minimum:TNe,maximum:SNe,format:"int64"}),Cr=n.Object({from:n.Optional(Ql("Start of the query window as a Unix timestamp in seconds")),to:n.Optional(Ql("End of the query window as a Unix timestamp in seconds",EA))},X7),tn=n.Object({from:Ql("Start of the query window as a Unix timestamp in seconds"),to:Ql("End of the query window as a Unix timestamp in seconds",EA)},X7),Ao=n.Object({from:Y7("Start of the query window as a Unix timestamp in milliseconds"),to:Y7("End of the query window as a Unix timestamp in milliseconds",Z7)},_Ne);var xc="/v0/logs";var TA=["CRITICAL","ERROR","WARN","NOTICE","INFO","DEBUG","TRACE"];var YE=0,_0=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(TA,{description:"Log severity, normalized from the source severity into one of the fixed Tsuga levels (ordered `CRITICAL` to `TRACE`)."}),[K7]:n.Optional(n.String({description:"ID of the cluster this log was read from. Only set when the request spanned several clusters."}))},{additionalProperties:!0}),eZ=100,INe="timestamp",Qu=n.Partial(n.Object({...Cr.properties,query:p({type:"tsuga-query",description:"Tsuga query used to filter logs in the selected time range."}),maxResults:n.Integer({minimum:1,maximum:1e3,description:"Maximum number of logs to return. Valid values are 1 through 1000."}),shouldRecommendAttributes:n.Boolean({description:"Whether Tsuga should return suggested attributes to highlight in results."}),triggeredBy:n.Literal("refresh",{description:"Indicates the query was triggered by a refresh action."}),startOffset:n.Number({minimum:YE,description:"Result offset used when fetching additional log rows."}),startOffsets:n.Array(n.Number({minimum:YE}),{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 ${YE} for every cluster.`}),clusterId:p({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}),clusterIds:bc,sortBy:p({allowEmpty:!1,default:INe,description:"Attribute to sort by. Attributes other than `timestamp` sort numerically; logs where the attribute is missing or not a number come last."}),sortDirection:le,useCanopy:n.Boolean()})),_Dt=f({tags:["logs"],url:`${xc}/count`,method:"GET",query:n.Pick(Qu,["from","to","query","clusterId","clusterIds","useCanopy"]),response:n.Object({count:n.Number(),clusterResponses:n.Optional(Nf())})}),VE=n.Object({value:n.String(),priority:n.Number()}),IDt=f({tags:["logs"],url:`${xc}/search`,method:"GET",query:Qu,response:n.Object({logs:n.Optional(n.Array(_0)),attributesToHighlight:n.Optional(n.Array(VE)),incomplete:n.Optional(n.Boolean({description:"True when attribute highlighting stopped early because too many distinct attributes were found."})),clusterResponses:n.Optional(Nf(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})}),bNe=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"}),tZ=n.Object({id:n.String(),pattern:n.Array(bNe),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"}))}),I0=n.Object({...Cr.properties,query:p({type:"tsuga-query"}),clusteringThreshold:n.Optional(n.Number()),clusterId:n.Optional(p({allowEmpty:!1})),useCanopy:n.Optional(n.Boolean())}),bDt=f({tags:["logs"],url:`${xc}/patterns`,method:"GET",query:I0,response:n.Object({patterns:n.Array(tZ),sampleSize:n.Number()})}),rZ=n.Object({id:n.String(),volume:n.Integer({description:"Number of logs in the cluster"}),levels:n.Array(n.Enum(TA)),signatures:n.Array(n.Object({signature:n.String(),volume:n.Integer()}))}),xDt=f({tags:["logs"],url:`${xc}/patterns/clusters`,method:"GET",query:I0,response:n.Object({clusters:n.Array(rZ),totalVolume:n.Integer()})}),xNe=50,ODt=f({tags:["logs"],url:`${xc}/patterns/details`,method:"POST",body:n.Object({...I0.properties,clusters:n.Array(rZ,{maxItems:xNe})}),response:n.Object({patterns:n.Array(tZ),sampleSize:n.Number()})}),ADt=f({tags:["logs"],url:`${xc}/attributes`,method:"GET",query:n.Object({...Cr.properties,clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"})),clusterIds:n.Optional(bc),useCanopy:n.Optional(n.Boolean()),search:n.Optional(p({allowEmpty:!1,description:"Return only attribute dot-paths containing this text, case-insensitively"}))}),response:n.Object({attributes:n.Array(n.String()),clusterResponses:n.Optional(Nf())})});var nZ="timestamp";var J7=`${nZ}_iso`;var ONe=["pending","running","completed","incomplete","failed"],oZ=n.Object({id:n.String({description:"ID of the export."}),status:n.Enum(ONe,{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."}))}),CDt=f({tags:["logs"],url:`${xc}/exports`,method:"POST",body:n.Object({...n.Pick(Qu,["from","to","query","clusterId","clusterIds","sortBy","sortDirection"]).properties,columns:n.Array(p({allowEmpty:!1}),{minItems:1,description:`Log attributes to write as CSV columns, in order. Each becomes one column, resolved against the log with dotted-path lookup. Including \`${nZ}\` also writes a \`${J7}\` column next to it, holding the same instant in ISO 8601.`}),timezone:n.Optional(n.String({format:$l,description:`IANA timezone the \`${J7}\` column is offset to (e.g. \`Europe/Paris\`). Defaults to UTC.`}))}),response:n.Object({...oZ.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."})})}),RDt=f({tags:["logs"],url:`${xc}/exports/:exportId`,method:"GET",params:n.Object({exportId:n.String()}),response:oZ}),PDt=f({tags:["logs"],url:`${xc}/exports/:exportId/download`,method:"GET",params:n.Object({exportId:n.String()}),query:n.Object({token:p({allowEmpty:!1,type:"long",description:"Single-use token minted when the export was created."})}),response:n.String({description:"CSV file, streamed as it is produced."})});var Oc="/v0/metrics",ANe=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(TA)},{additionalProperties:!0}),MDt=f({tags:["metrics"],url:`${Oc}/count`,method:"GET",query:n.Pick(Qu,["from","to","query","clusterId"]),response:n.Object({count:n.Number()})}),DDt=f({tags:["metrics"],url:`${Oc}/search`,method:"GET",query:Qu,response:n.Object({logs:n.Optional(n.Array(ANe)),totalHits:n.Optional(n.Number()),attributesToHighlight:n.Optional(n.Array(VE))},{additionalProperties:!0})}),SA=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."}),_A=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."}),b0=["gauge","cumulative-counter","delta-counter","cumulative-histogram","delta-histogram","summary"],iZ=n.Enum(b0,{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."}),sZ=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."}),aZ=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."}),IA=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."}),CNe=n.Record(n.String(),n.Number(),{description:"Estimated number of distinct values per attribute over the same window as `seriesCardinality`, keyed like `tags`."}),RNe=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(_A),type:n.Optional(SA),unit:n.Optional(n.String({description:"Metric unit reported by instrumentation or inferred metadata."})),lastSeen:n.Optional(sZ),teams:n.Optional(aZ),seriesCardinality:n.Optional(IA),attributeCardinalities:n.Optional(CNe)}),FDt=f({url:`${Oc}/metadata`,method:"GET",query:n.Object({...Cr.properties,metricName:p({allowEmpty:!1}),kind:n.Optional(iZ),clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:RNe}),$Dt=f({tags:["metrics"],url:Oc,method:"GET",query:n.Object({...Cr.properties,clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:n.Array(n.String())}),cZ=n.Array(n.Object({name:n.String({description:"Metric name observed by Tsuga."}),kind:iZ,type:SA,temporality:n.Optional(_A),lastSeen:n.Optional(sZ),teams:n.Optional(aZ),seriesCardinality:n.Optional(IA)}),{description:"Metric variants observed in the requested time range. A name appears once per kind it was reported as."}),PNe=[{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(cZ,{examples:[PNe]});var GDt=f({tags:["metrics"],url:`${Oc}/names-and-types`,method:"GET",query:n.Object({...Cr.properties,clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:cZ}),WE=n.Array(n.String(),{description:"Attribute names available as dimensions for filtering or grouping the requested metric(s)."}),UNe=["service","env","host","method","status_code"];Object.assign(WE,{examples:[UNe]});var BDt=f({tags:["metrics"],url:`${Oc}/attributes`,method:"GET",query:n.Object({...Cr.properties,metricName:p({allowEmpty:!1}),clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:WE}),jDt=f({tags:["metrics"],url:`${Oc}/attributes/batch`,method:"GET",query:n.Object({...Cr.properties,metricNames:n.Array(p({allowEmpty:!1}),{minItems:1,description:"Metric names to fetch attributes for"}),clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:WE}),x0=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."})}),qDt=f({tags:["metrics"],url:`${Oc}/assets-usage`,method:"GET",query:n.Object({metricName:p({allowEmpty:!1})}),response:x0}),HDt=f({url:`${Oc}/per-attribute`,method:"GET",query:n.Object({from:n.Optional(n.Number()),to:n.Optional(n.Number()),attribute:p(),clusterId:n.Optional(p({allowEmpty:!1}))}),response:n.Array(n.String())});var NNe="/v0/aggregation",kNe=n.Union([n.Literal("a"),n.Literal("d"),n.Literal("q"),n.Literal("w"),n.Literal("t")]),ZE=n.Object({parallelism:n.Number(),engine:kNe,recordBatchCache:n.Optional(n.Boolean()),includeNullGroups:n.Optional(n.Boolean()),restartAwareGaugeSum:n.Optional(n.Boolean())}),O0=["logs","metrics","traces"];var lZ={logs:"Logs",metrics:"Metrics",traces:"Spans"},LNe=[...O0,"connections","log-patterns","spans","rum"];var rFt={...lZ,connections:"Connections","log-patterns":"Log Patterns",spans:"Spans",rum:"RUM events"},la=[...O0,"rum"];var nFt={...lZ,rum:"RUM events"};var oFt=n.Enum(LNe,{description:"Data source being queried"}),iFt=n.Enum(O0,{description:"Telemetry source queried by this aggregation: `logs`, `metrics`, or `traces`."}),pi=n.Enum(la,{description:"Telemetry source queried by this aggregation: `logs`, `metrics`, `traces`, or `rum`."}),Zl=n.String({description:"Attribute containing the values to aggregate"}),Lf=p({description:"Attribute containing the values to aggregate"}),MNe=D("type",[n.Object({type:n.Literal("count",{description:"Counts the total number of records"}),field:n.Optional(Zl)},{$id:"AggregateCount",title:"Count"}),n.Object({type:n.Literal("unique-count",{description:"Counts the distinct values of the field"}),field:Zl},{$id:"AggregateUniqueCount",title:"UniqueCount"}),n.Object({type:n.Literal("average",{description:"Calculates the average value of the selected field"}),field:Zl},{$id:"AggregateAverage",title:"Average"}),n.Object({type:n.Literal("max",{description:"Finds the largest value of the field"}),field:Zl},{$id:"AggregateMax",title:"Max"}),n.Object({type:n.Literal("min",{description:"Finds the smallest value of the field"}),field:Zl},{$id:"AggregateMin",title:"Min"}),n.Object({type:n.Literal("sum",{description:"Sums the values of the selected field"}),field:Zl},{$id:"AggregateSum",title:"Sum"}),n.Object({type:n.Literal("percentile",{description:"Calculates a percentile of the selected field"}),field:Zl,percentile:n.Number({description:"Percentile to compute for the selected field."})},{$id:"AggregatePercentile",title:"Percentile"})],{title:"Aggregate",description:"Aggregation operation for this query. Required for every query; `field` is required by all aggregate types except `count`, which needs it only when `dataSource` is `metrics`."}),DNe=D("type",[n.Object({type:n.Literal("count",{description:"Counts the total number of records"}),field:n.Optional(p({description:"Metric to count when `dataSource` is `metrics`, where it is required: without it the query fails with `count aggregate requires a non-empty field`. On `logs`, `traces` and `rum`, `count` counts records and ignores this field."}))},{$id:"InputAggregateCount",title:"Count"}),n.Object({type:n.Literal("unique-count",{description:"Counts the distinct values of the field"}),field:Lf},{$id:"InputAggregateUniqueCount",title:"UniqueCount"}),n.Object({type:n.Literal("average",{description:"Calculates the average value of the selected field"}),field:Lf},{$id:"InputAggregateAverage",title:"Average"}),n.Object({type:n.Literal("max",{description:"Finds the largest value of the field"}),field:Lf},{$id:"InputAggregateMax",title:"Max"}),n.Object({type:n.Literal("min",{description:"Finds the smallest value of the field"}),field:Lf},{$id:"InputAggregateMin",title:"Min"}),n.Object({type:n.Literal("sum",{description:"Sums the values of the selected field"}),field:Lf},{$id:"InputAggregateSum",title:"Sum"}),n.Object({type:n.Literal("percentile",{description:"Calculates a percentile of the selected field"}),field:Lf,percentile:n.Number({description:"Percentile to compute for the selected field."})},{$id:"InputAggregatePercentile",title:"Percentile"})],{title:"InputAggregate",description:"Aggregation operation for this query. Required for every query; `field` is required by all aggregate types except `count`, which needs it only when `dataSource` is `metrics`."}),dZ=n.Object({type:n.Literal("per-second",{description:"Normalizes the metric to events per second"})},{$id:"FunctionPerSecond",title:"PerSecond"}),mZ=n.Object({type:n.Literal("per-minute",{description:"Normalizes the metric to events per minute"})},{$id:"FunctionPerMinute",title:"PerMinute"}),fZ=n.Object({type:n.Literal("per-hour",{description:"Normalizes the metric to events per hour"})},{$id:"FunctionPerHour",title:"PerHour"}),gZ=n.Object({type:n.Literal("rate",{description:"Calculates the rate of change"})},{$id:"FunctionRate",title:"Rate"}),hZ=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"}),yZ=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"}),EZ=n.Object({type:n.Literal("sqrt",{description:"Applies a square root transformation to the values"})},{$id:"FunctionSqrt",title:"Sqrt"}),TZ=n.Object({type:n.Literal("last",{description:"Takes the last value of the metric for the selected time frame"})},{$id:"FunctionLast",title:"Last"}),SZ=n.Object({type:n.Literal("cumsum",{description:"Cumulative sum of the values over the time frame. Computed by the Tsuga web app only: the aggregation API ignores it and returns the raw values."})},{$id:"FunctionCumsum",title:"Cumsum"}),FNe=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"}),$Ne=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"}),GNe=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"}),BNe=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"}),jNe=D("type",[dZ,mZ,fZ,gZ,hZ,FNe,yZ,EZ,TZ,GNe,SZ],{title:"Function",description:"Post-processing function applied to an aggregation query result after the aggregate is computed, selected by `type`."}),qNe=D("type",[dZ,mZ,fZ,gZ,hZ,$Ne,yZ,EZ,TZ,BNe,SZ],{title:"InputFunction",description:"Post-processing function applied to an aggregation query result after the aggregate is computed, selected by `type`."});var uZ=n.Object({min:n.Number({description:"Lower bound of the distribution range."}),max:n.Number({description:"Upper bound of the distribution range."})}),HNe=["linear","log"],QE=n.Enum(HNe,{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."}),KNe=1e3,pZ=n.Integer({minimum:1,maximum:KNe}),bA={pattern:"^0*[1-9]\\d*[smhdw]$",errorMessage:{pattern:'must be a positive whole number followed by s, m, h, d or w, such as "10s", "1m" or "1h".'}},zNe=D("type",[n.Object({type:n.Literal("scalar")},{title:"Scalar",description:"Returns a single value"}),n.Object({type:n.Literal("timeseries"),aggregationWindow:n.String({...bA,description:'Time bucket size for aggregation (e.g. "10s", "60s", "1m")'})},{title:"Timeseries",description:"Returns a time series"}),n.Object({type:n.Literal("histogram"),by:n.Optional(p()),bucketCount:n.Optional(pZ),bounds:n.Optional(uZ),boundsScale:n.Optional(QE),percentiles:n.Optional(n.Array(n.Integer({minimum:0,maximum:100}),{minItems:1,maxItems:100}))},{title:"Histogram",description:"Returns a single distribution over the entire time range"}),n.Object({type:n.Literal("heatmap"),aggregationWindow:n.String({...bA,description:'Time bucket size for the heatmap (e.g. "10s", "60s", "1m")'}),by:n.Optional(p()),bucketCount:n.Optional(pZ),bounds:n.Optional(uZ),boundsScale:n.Optional(QE)},{title:"Heatmap",description:"Returns a distribution per time window"})]),xA=15,sFt=128*1024,YNe=["zero","null"],VNe=n.Enum(YNe,{description:"`zero` fills missing points with zero. `null` keeps missing points null."}),_Z=n.Object({mode:n.Object({type:VNe},{description:"How missing aggregation points should be filled."})},{description:"Missing-point fill behavior for aggregation results. Optional; omit to keep missing points null."}),WNe=["avg","sum","min","max","last"],IZ=n.Enum(WNe,{description:"Per-series rollup applied within each time bucket before the cross-series aggregate. Use it on metric queries when `aggregate.type` is `sum` and no `rate`, `increase`, or `last` function is present. When omitted, Tsuga derives the rollup from the metric type."});var bZ=n.Enum(b0,{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."}),xZ={aggregate:MNe,functions:n.Optional(n.Array(jNe,{description:"Post-processing functions applied to aggregation results"})),fill:n.Optional(_Z),timeAggregate:n.Optional(IZ),metricKind:n.Optional(bZ)},OZ={aggregate:DNe,functions:n.Optional(n.Array(qNe,{maxItems:10,description:"Post-processing functions applied to aggregation results. Defaults to an empty array when omitted."})),fill:n.Optional(_Z),timeAggregate:n.Optional(IZ),metricKind:n.Optional(bZ)},QNe={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."},AZ={minItems:1,maxItems:xA,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").'},CZ=n.Array(n.Object({...xZ,filter:n.Optional(n.String({description:"Filter to apply to the aggregation"}))},{title:"AggregationQuery"}),QNe),XE=n.Array(n.Object({...OZ,filter:n.Optional(p({type:"tsuga-query",description:"Tsuga query filter to apply to the aggregation. Defaults to an empty string when omitted."}))},{title:"AggregationQuery"}),AZ),Ac=n.Array(n.Object({...xZ,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."}),Zu=n.Array(n.Object({...OZ,filter:p({type:"tsuga-query",description:"Tsuga query filter applied to this alerting or SLO aggregation query. Required by the API; use the query language for the selected data source."})},{title:"MonitorAggregationQuery",description:"Single aggregation query evaluated by a monitor."}),{...AZ,description:"Aggregation queries used by alerting. Each query is referenced from formulas as q1, q2, and so on."}),RZ=n.Array(n.Omit(Zu.items,["fill"],{title:"SloAggregationQuery",description:"Single aggregation query evaluated by an SLO."}),{minItems:1,maxItems:xA,description:"Aggregation queries used by SLO evaluation. Each query is referenced from formulas as q1, q2, and so on."});var OA=n.String({description:"Formula referencing submitted query outputs, such as `q1 + q2`. References must be within `q1` through `qN` for the submitted queries."}),Xl=p({type:"tsuga-formula",description:"Formula referencing query outputs, such as `q1 + q2`, to compute derived results. Defaults to `q1`. Formulas may reference only submitted queries (`q1` through `qN`); undefined query references return 400. Only `+`, `-`, `*`, `/` and parentheses over query references and numbers are supported, with no functions such as `max()`."}),ZNe=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"}),XNe=n.Object({fields:n.Array(p(),{maxItems:1,description:"Telemetry attribute name to group aggregation results by at this grouping level. To group by several attributes, send one `groupBy` entry per attribute: entries nest, outermost first.",errorMessage:{maxItems:'must hold one field. To group by several fields, send one groupBy entry per field: they nest, outermost first, such as [{"fields": ["context.service.name"], "limit": 10}, {"fields": ["level"], "limit": 5}].'}}),limit:n.Number({description:'Maximum number of distinct values of `fields` to return for this grouping level, ranked by aggregate value. Groups beyond the limit are truncated from the response, not merged into an "other" group.'}),sortOrder:n.Optional(le),replaceNullWith:n.Optional(p({allowEmpty:!1,description:"Value used to group documents that have no value for a grouped field."}))},{title:"AggregationGroupBy"}),PZ=7;var Mf=n.Array(ZNe,{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."}),Cc=n.Array(XNe,{maxItems:PZ,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 aFt=f({tags:["aggregation"],url:`${NNe}/multi-query`,method:"POST",body:n.Object({timeRange:Ao,queries:XE,groupBy:n.Optional(Cc),returnType:zNe,dataSource:pi,formula:Xl,executionOptions:ZE,triggeredBy:n.Optional(n.Literal("refresh")),shouldStreamResults:n.Optional(n.Boolean()),clusterId:n.Optional(p({allowEmpty:!1})),clusterIds:n.Optional(bc),viewAs:n.Optional(n.Object({owner:p({allowEmpty:!1,description:"Team ID to fetch data as"}),permissions:Ts}))}),response:kf});var UZ=`/${"v1"}/aggregation`,wZ=`/${"v2"}/aggregation`,vZ=n.Object({id:n.String({description:"Result identifier. Query results use `q1`, `q2`, and so on; formula results use `value`."}),group:n.Record(n.String(),n.Union([n.String(),n.Number()]),{description:"Group-by field values for this result. Empty when no group-by is requested."})}),NZ=n.Object({results:n.Array(n.Object({...vZ.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."}),JNe={results:[{id:"q1",group:{host:"server-1"},value:123.45}]};Object.assign(NZ,{examples:[JNe]});var AA=n.Object({series:n.Array(n.Object({...vZ.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."}),eke={series:[{id:"q1",group:{host:"server-1"},points:[{timestamp:16094592e5,value:123.45},{timestamp:160945926e4,value:456.78}]}]};Object.assign(AA,{examples:[eke]});var kZ=n.Record(n.String(),n.Union([n.String(),n.Number()]),{description:"Group-by field values for this row, keyed by field name. Empty when no group-by is requested."}),LZ="Keyed by result id: `q1`, `q2`, and so on for each query in submission order, plus `f1`, `f2`, and so on for each entry of `formulas` in submission order, or `value` for a PromQL query. Every row has the same keys.",MZ=n.Object({results:n.Array(n.Object({group:kZ,values:n.Record(n.String(),n.Union([n.Number(),n.Null()]),{description:`Aggregated values over the full time range, \`null\` where the group has none. ${LZ}`})},{title:"ScalarResultV2"}),{description:"One row per group, in group-by sort order (largest first unless `sortOrder` says otherwise)."})},{$id:"ScalarAggregationResponseV2",title:"ScalarAggregationResponseV2",description:"Scalar aggregation response with one row per group."}),tke={results:[{group:{"context.host.name":"web-1"},values:{q1:12,q2:1e3,f1:1.2}},{group:{"context.host.name":"web-2"},values:{q1:3,q2:500,f1:.6}}]};Object.assign(MZ,{examples:[tke]});var CA=n.Object({timestamps:n.Array(n.Integer(),{description:"Start of each time bucket as a Unix timestamp in milliseconds, ascending, spaced by `aggregationWindow` (`step` for PromQL) from the first bucket with data to the last. Every `values` array in `series` aligns with it index by index."}),series:n.Array(n.Object({group:kZ,values:n.Record(n.String(),n.Array(n.Union([n.Number(),n.Null()])),{description:`One value per entry of \`timestamps\`, \`null\` where the bucket has none. ${LZ}`})},{title:"SeriesV2"}),{description:"One series per group, in group-by sort order for aggregation queries and in no particular order for PromQL."})},{$id:"TimeseriesAggregationResponseV2",title:"TimeseriesAggregationResponseV2",description:"Timeseries aggregation response: a shared time axis and one series per group aligned to it."}),rke={timestamps:[16094592e5,160945926e4,160945932e4],series:[{group:{"context.host.name":"web-1"},values:{q1:[12,null,7],q2:[1e3,900,1400],f1:[1.2,null,.5]}}]};Object.assign(CA,{examples:[rke]});var nke=n.Omit(XE.items,["fill"],{title:"AggregationQuery",description:"Aggregation query. Omit `filter` for an unfiltered query and omit `functions` when no post-processing is needed."}),oke=n.Optional(Cc),DZ={timeRange:tn,queries:n.Array(nke,{maxItems:xA,description:'Aggregations that may be combined together in the same query. Each item is referenced from formulas as q1, q2, and so on, in submission order. For dataSource "metrics", each aggregate\'s `field` is the metric name, not an attribute; to count distinct values of an attribute use unique-count with field "<metricName>.context.<attribute>" (e.g. "system.cpu.utilization.context.host.name").'}),groupBy:oke,dataSource:pi},FZ={...DZ,formula:n.Optional(Xl)},$Z={...DZ,timeRange:Ao,formulas:n.Optional(n.Array(p({type:"tsuga-formula",allowEmpty:!1,description:"Formula over the query results, such as `q1 / q2 * 100`. Only `+`, `-`, `*`, `/` and parentheses over query references (`q1` through `qN`) and numbers are supported; an undefined query reference returns 400."}),{maxItems:1,description:"Formulas computed from the query results, returned beside them as `f1`, `f2`, and so on in submission order. At most one for now."}))},Fi=n.Object({clusterId:n.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))}),GZ=n.Object(FZ,{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."}),ike={timeRange:{from:1782201500,to:1782203400},dataSource:"logs",queries:[{aggregate:{type:"count"},filter:"context.service.name:checkout"}],groupBy:[{fields:["level"],limit:5}]};Object.assign(GZ,{examples:[ike]});var BZ=n.Object($Z,{description:"Scalar aggregation request. Provide a time range in milliseconds, one or more queries, a telemetry data source, and optional grouping or formulas. Omit `groupBy` for ungrouped results. Send `clusterId` as a query parameter, not in the JSON body."}),jZ={timeRange:{from:17822015e5,to:17822034e5},dataSource:"logs",queries:[{aggregate:{type:"count"},filter:"context.service.name:checkout AND level:error"},{aggregate:{type:"count"},filter:"context.service.name:checkout"}],groupBy:[{fields:["context.host.name"],limit:5}],formulas:["q1 / q2 * 100"]};Object.assign(BZ,{examples:[jZ]});var RA=f({description:"Computes counts, unique counts, sums, averages, min/max or percentiles (p50, p95, p99), one value per group. Runs over logs, traces (spans), metrics or RUM (real user monitoring) events filtered with Tsuga query syntax, and supports group-by on any attribute, top-N breakdowns, per-second or per-minute rates and formulas. For values over time, use the timeseries aggregation. See [Analytics queries](/documentation/visualize/analytics/queries).",operationId:"aggregateScalar",tags:["public","aggregation"],url:`${UZ}/multi-query/scalar`,method:"POST",body:GZ,query:Fi,response:NZ}),gFt=f({description:"Runs one or more aggregation queries over logs, metrics, traces, or RUM events and returns one row per group with every query result in it. Same request as `POST /v1/aggregation/multi-query/scalar`, with `timeRange` in milliseconds and formulas given as the `formulas` list and returned as `f1`. See [Analytics queries](/documentation/visualize/analytics/queries).",operationId:"aggregateScalarV2",tags:["public","aggregation"],url:`${wZ}/multi-query/scalar`,method:"POST",body:BZ,query:Fi,response:MZ}),qZ=n.String({...bA,maxLength:ci,description:"Time bucket size for timeseries aggregation, such as `10s`, `1m`, or `1h`."}),HZ=n.Object({...FZ,aggregationWindow:qZ},{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."}),ske={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(HZ,{examples:[ske]});var KZ=n.Object({...$Z,aggregationWindow:qZ},{description:"Timeseries aggregation request. Provide a time range in milliseconds, bucket size, one or more queries, a telemetry data source, and optional grouping or formulas. Omit `groupBy` for ungrouped series. Send `clusterId` as a query parameter, not in the JSON body."}),ake={...jZ,aggregationWindow:"1m"};Object.assign(KZ,{examples:[ake]});var PA=f({description:"Charts counts, unique counts, sums, averages, min/max or percentiles (p50, p95, p99) over time, one series per group. Runs over logs, traces (spans), metrics or RUM (real user monitoring) events filtered with Tsuga query syntax, bucketed by `aggregationWindow`, with group-by on any attribute, per-second or per-minute rates and formulas. For one value per group, use the scalar aggregation. See [Analytics queries](/documentation/visualize/analytics/queries).",operationId:"aggregateTimeseries",tags:["public","aggregation"],url:`${UZ}/multi-query/timeseries`,method:"POST",body:HZ,query:Fi,response:AA}),hFt=f({description:"Runs one or more aggregation queries over logs, metrics, traces, or RUM events and returns one shared time axis in milliseconds with one series per group aligned to it. Use `aggregationWindow` to choose the time bucket size. Same request as `POST /v1/aggregation/multi-query/timeseries`, with `timeRange` in milliseconds and formulas given as the `formulas` list and returned as `f1`. See [Analytics queries](/documentation/visualize/analytics/queries).",operationId:"aggregateTimeseriesV2",tags:["public","aggregation"],url:`${wZ}/multi-query/timeseries`,method:"POST",body:KZ,query:Fi,response:CA});var cke="x-tsuga-session-id",C0="x-tsuga-source",R0="x-tsuga-source-version",P0="x-tsuga-source-commit",U0="x-tsuga-source-date",w0="x-tsuga-rationale",uke="x-tsuga-dashboard-id",pke="x-tsuga-widget-id",lke="x-tsuga-widget-slot",dke="x-request-id",EFt={[cke]:"Session identifier for request correlation",[C0]:"SDK or client source identifier (e.g., web-frontend, terraform-provider)",[R0]:"SDK version",[P0]:"SDK commit hash",[U0]:"SDK commit date",[w0]:"Optional caller-supplied rationale for this request, recorded for telemetry",[uke]:"ID of the dashboard a query is issued from, when the request originates from a dashboard widget",[pke]:"ID of the dashboard widget (graph) a query is issued from, when the request originates from a dashboard widget",[lke]:"Identifies which of a multi-query widget's queries this request is for, such as `col-0` for the first column of a table",[dke]:"Unique identifier for this API request, useful for debugging and support"};var mke=["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS","TRACE"],zZ=k(function*(e,t,r,o,i){let{body:s,params:a,query:u}=o,l=r.url??(r.buildUrl&&a?r.buildUrl(a):void 0),d=mke.find(g=>g===r.method);return l===void 0||d===void 0?yield*new ys({message:`Internal error: endpoint ${r.operationId??r.method} is not callable`}):Tx(d)(A8(`${e}${l}`,u),{headers:{Accept:"application/json","User-Agent":fke(t),[C0]:t,[R0]:"1.164.0",[P0]:"402828d507",[U0]:"2026-11-06T06:03:10.731Z",...i},...s?{body:Pk(s)}:{}})});function fke(e){return`${e==="cli"?"tsuga-cli":"tadmin"}/1.164.0 (${process.platform}; node ${process.versions.node})`}var gke=["allowed-domains","audit-log-stream-destination","billing","cluster-integration-config","custom-role","custom-usage-tag","database","databricks-connection","explorer-saved-view","github-connection","inventory","llm-provider","monitor-alert","monitor-debugging","oauth-grant","org","queue","retention-policy","saml-config","sensitive-data-scanner-rule","service","service-target","team-remap-config","user-self","widget-share"],hke=["adaptive-notification-rule","audit-log","cloud-account","dashboard-folder","monitor-folder","dashboard-report","dashboard-share","dashboard","data-deletion-request","ingestion-api-key","investigation","log-route","metric-route","monitor","notebook","notification-integration","notification-rule","notification-silence","operation-api-key","quality-report","rum-public-token","sandbox-configuration","slo","span-route","synthetic-test","synthetic-variable","tag-policy","team","user-data","user-invitation","user-permissions"],v0=["log","metric","trace","rum"],N0=[...hke,...v0],yke=[...gke,...N0];var Xu=["admin","public_editor","public_viewer","teams_only"],wA=[...Xu,"custom"],$i=["admin","editor","viewer"];var Jl="/v0/team-membership",k0="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.",JE=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($i,{description:k0})}),vA=n.Object({userId:p({allowEmpty:!1,description:"User ID to add to or update in the team."}),teamId:p({allowEmpty:!1,description:"Team ID receiving the membership change."}),roleKey:n.Enum($i,{description:k0})}),L0=n.Object({userId:p({allowEmpty:!1,description:"User ID to remove from the team."}),teamId:p({allowEmpty:!1,description:"Team ID to remove the user from."})}),Eke=n.Optional(n.Object({userId:n.Optional(p({allowEmpty:!1,description:"Restrict results to memberships for this user ID."})),teamId:n.Optional(p({allowEmpty:!1,description:"Restrict results to memberships for this team ID."}))})),PFt=f({tags:["access-control"],url:Jl,method:"GET",query:Eke,response:n.Array(JE)}),UFt=f({tags:["access-control"],url:Jl,method:"POST",body:vA,response:JE}),wFt=f({tags:["access-control"],url:Jl,method:"PUT",body:vA,response:JE}),vFt=f({tags:["access-control"],url:Jl,method:"DELETE",body:L0,response:B}),UA=500,NA=n.Object({teamId:p({allowEmpty:!1,description:"Team ID receiving all requested memberships."}),members:n.Array(n.Object({userId:n.Optional(p({allowEmpty:!1,description:"Existing user ID to add to the team."})),userEmail:n.Optional(p({allowEmpty:!1,type:"email",description:"Existing user email to resolve and add to the team."})),roleKey:n.Enum($i,{description:k0})},{oneOf:[{required:["userId"]},{required:["userEmail"]}]}),{minItems:1,maxItems:UA,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."}),Tke={teamId:"team-123-abc",members:[{userId:"user-123-abc",roleKey:"viewer"},{userEmail:"sam@example.com",roleKey:"editor"}]};Object.assign(NA,{examples:[Tke]});var kA=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."}),Ske={results:[{userId:"user-123-abc",status:"added"},{userId:"sam@example.com",status:"user_not_found"}]};Object.assign(kA,{examples:[Ske]});var NFt=f({tags:["access-control"],url:`${Jl}/bulk-add`,method:"POST",body:NA,response:kA}),kFt=f({tags:["access-control"],url:`${Jl}/bulk-update-user-roles`,method:"PUT",body:n.Object({userIds:n.Array(p({allowEmpty:!1}),{minItems:1,maxItems:UA}),teamId:p({allowEmpty:!1}),role:n.Enum($i)}),response:n.Object({})}),LA=n.Object({teamId:p({allowEmpty:!1,description:"Team ID to remove the requested users from."}),userIds:n.Optional(n.Array(p({allowEmpty:!1}),{minItems:1,maxItems:UA,description:"User IDs to remove from the team. Items are processed independently: a user who is not a member or cannot be resolved does not stop the other items from being removed."})),userEmails:n.Optional(n.Array(p({allowEmpty:!1,type:"email"}),{minItems:1,maxItems:UA,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."}),_ke={teamId:"team-123-abc",userIds:["user-123-abc"]};Object.assign(LA,{examples:[_ke]});var MA=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."}),Ike={results:[{userId:"user-123-abc",status:"removed"},{userId:"missing@example.com",status:"user_not_found"}]};Object.assign(MA,{examples:[Ike]});var LFt=f({tags:["access-control"],url:`${Jl}/bulk-remove`,method:"DELETE",body:LA,response:MA});var bke={"sandbox-configuration":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"github-connection":{read:["admin"],write:["admin"]},"llm-provider":{read:["admin"],write:["admin"]},investigation:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"ingestion-api-key":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"rum-public-token":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"widget-share":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"dashboard-share":{read:["public_viewer","public_editor","admin"],write:["admin"]},"audit-log":{read:["public_viewer","public_editor","admin"],write:[]},"custom-role":{read:["public_viewer","public_editor","admin"],write:["admin"]},"custom-usage-tag":{read:["public_viewer","public_editor","admin"],write:["admin"]},"cluster-integration-config":{read:["admin"],write:["admin"]},"explorer-saved-view":{read:["public_viewer","public_editor","admin"],write:["public_viewer","public_editor","admin"]},"operation-api-key":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"cloud-account":{read:["public_viewer","public_editor","admin"],write:["admin"]},dashboard:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"dashboard-folder":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"monitor-folder":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"dashboard-report":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},notebook:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},inventory:{read:["public_viewer","public_editor","admin"],write:[]},log:{read:["public_viewer","public_editor","admin"],write:[]},"log-route":{read:["public_viewer","public_editor","admin"],write:["admin","public_editor"]},"metric-route":{read:["public_viewer","public_editor","admin"],write:["admin","public_editor"]},"span-route":{read:["public_viewer","public_editor","admin"],write:["admin","public_editor"]},metric:{read:["public_viewer","public_editor","admin"],write:[]},trace:{read:["public_viewer","public_editor","admin"],write:[]},rum:{read:["public_viewer","public_editor","admin"],write:[]},monitor:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"monitor-alert":{read:["public_viewer","public_editor","admin"],write:[]},"monitor-debugging":{read:["admin"],write:[]},"notification-integration":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"notification-rule":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"adaptive-notification-rule":{read:["public_viewer","public_editor","admin"],write:["admin"]},"notification-silence":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"saml-config":{read:["admin"],write:["admin"]},"audit-log-stream-destination":{read:["admin"],write:["admin"]},org:{read:["public_viewer","public_editor","admin"],write:["admin"]},"allowed-domains":{read:["public_viewer","public_editor","admin"],write:["admin"]},"quality-report":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},billing:{read:["admin"],write:[]},"data-deletion-request":{read:["admin"],write:["admin"]},"sensitive-data-scanner-rule":{read:["public_viewer","public_editor","admin"],write:["admin"]},slo:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"synthetic-test":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"synthetic-variable":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"retention-policy":{read:["public_viewer","public_editor","admin"],write:["admin"]},"databricks-connection":{read:["public_viewer","public_editor","admin"],write:["admin"]},service:{read:["public_viewer","public_editor","admin"],write:[]},"service-target":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},database:{read:["public_viewer","public_editor","admin"],write:[]},queue:{read:["public_viewer","public_editor","admin"],write:[]},"tag-policy":{read:["public_viewer","public_editor","admin"],write:["admin"]},team:{read:["public_viewer","public_editor","admin"],write:["admin"]},"team-remap-config":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-data":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-invitation":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-permissions":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-self":{read:["public_viewer","public_editor","admin"],write:["public_viewer","public_editor","admin"]},"oauth-grant":{read:[],write:[]}},xke={"sandbox-configuration":{read:["viewer","editor","admin"],write:["editor","admin"]},"github-connection":{read:["admin"],write:[]},"llm-provider":{read:[],write:[]},investigation:{read:["viewer","editor","admin"],write:["editor","admin"]},"ingestion-api-key":{read:["viewer","editor","admin"],write:["editor","admin"]},"rum-public-token":{read:["viewer","editor","admin"],write:["editor","admin"]},"widget-share":{read:["viewer","editor","admin"],write:["viewer","editor","admin"]},"dashboard-share":{read:["viewer","editor","admin"],write:["admin"]},"audit-log":{read:["viewer","editor","admin"],write:[]},"custom-role":{read:["viewer","editor","admin"],write:[]},"custom-usage-tag":{read:[],write:[]},"cluster-integration-config":{read:[],write:[]},"explorer-saved-view":{read:["viewer","editor","admin"],write:["viewer","editor","admin"]},"operation-api-key":{read:["viewer","editor","admin"],write:["admin"]},"cloud-account":{read:["viewer","editor","admin"],write:[]},dashboard:{read:["viewer","editor","admin"],write:["editor","admin"]},"dashboard-folder":{read:["viewer","editor","admin"],write:["editor","admin"]},"monitor-folder":{read:["viewer","editor","admin"],write:["editor","admin"]},"dashboard-report":{read:["viewer","editor","admin"],write:["editor","admin"]},notebook:{read:["viewer","editor","admin"],write:["editor","admin"]},inventory:{read:["viewer","editor","admin"],write:[]},log:{read:["viewer","editor","admin"],write:[]},"log-route":{read:["viewer","editor","admin"],write:["editor","admin"]},"metric-route":{read:["viewer","editor","admin"],write:["editor","admin"]},"span-route":{read:["viewer","editor","admin"],write:["editor","admin"]},metric:{read:["viewer","editor","admin"],write:[]},trace:{read:["viewer","editor","admin"],write:[]},rum:{read:["viewer","editor","admin"],write:[]},monitor:{read:["viewer","editor","admin"],write:["editor","admin"]},"monitor-alert":{read:["viewer","editor","admin"],write:[]},"monitor-debugging":{read:["admin"],write:[]},"notification-integration":{read:["viewer","editor","admin"],write:["editor","admin"]},"notification-rule":{read:["viewer","editor","admin"],write:["editor","admin"]},"adaptive-notification-rule":{read:["viewer","editor","admin"],write:[]},"notification-silence":{read:["viewer","editor","admin"],write:["editor","admin"]},"saml-config":{read:[],write:[]},"audit-log-stream-destination":{read:[],write:[]},org:{read:["viewer","editor","admin"],write:[]},"allowed-domains":{read:["viewer","editor","admin"],write:[]},"quality-report":{read:["viewer","editor","admin"],write:["editor","admin"]},billing:{read:[],write:[]},"data-deletion-request":{read:[],write:[]},"sensitive-data-scanner-rule":{read:["viewer","editor","admin"],write:[]},slo:{read:["viewer","editor","admin"],write:["editor","admin"]},"synthetic-test":{read:["viewer","editor","admin"],write:["editor","admin"]},"synthetic-variable":{read:["viewer","editor","admin"],write:["editor","admin"]},"retention-policy":{read:[],write:[]},"databricks-connection":{read:[],write:[]},service:{read:["viewer","editor","admin"],write:[]},"service-target":{read:["viewer","editor","admin"],write:["editor","admin"]},database:{read:["viewer","editor","admin"],write:[]},queue:{read:["viewer","editor","admin"],write:[]},"tag-policy":{read:[],write:[]},team:{read:["viewer","editor","admin"],write:["admin"]},"team-remap-config":{read:[],write:[]},"user-data":{read:["viewer","editor","admin"],write:["admin"]},"user-invitation":{read:["viewer","editor","admin"],write:["admin"]},"user-permissions":{read:["viewer","editor","admin"],write:[]},"user-self":{read:["viewer","editor","admin"],write:["viewer","editor","admin"]},"oauth-grant":{read:[],write:[]}},Oke={user:bke,team:xke};function M0(e){return YZ(e,"team")}function D0(e){return YZ(e,"user")}function YZ(e,t){let r=[],o=Oke[t];for(let[i,s]of Object.entries(o))for(let[a,u]of Object.entries(s))u.includes(e)&&r.push({actionType:a,resourceType:i});return r}var Ake={admin:{name:"Global admin",description:"Full control across the organization. Can view and modify everything, including private teams.",permissions:D0("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:D0("public_editor"),roleKey:"public_editor"},public_viewer:{name:"Public viewer",description:"Read-only access to public team data. Cannot make changes.",permissions:D0("public_viewer"),roleKey:"public_viewer"},teams_only:{name:"Teams only",description:"Only access data and assets in their own teams.",permissions:[],roleKey:"teams_only"}},BFt=Object.values(Ake).map(e=>({value:e.roleKey,label:e.name,description:e.description})),jFt={admin:{name:"Team admin",description:"Full team control, manage assets, members, and settings.",permissions:M0("admin"),roleKey:"admin"},editor:{name:"Team editor",description:"Can view and update most assets (like dashboards, monitors).",permissions:M0("editor"),roleKey:"editor"},viewer:{name:"Team viewer",description:"Can view all team data but cannot make changes.",permissions:M0("viewer"),roleKey:"viewer"}};var qFt=new Set(N0);var Cke={documentation:void 0,investigations:"investigation",logs:"log",metrics:"metric",traces:"trace",user:"user-data","allowed-domains":"allowed-domains",billing:"billing","cloud-account":"cloud-account","custom-role":"custom-role","custom-usage-tag":"custom-usage-tag","data-deletion-request":"data-deletion-request",dashboard:"dashboard","dashboard-folder":"dashboard-folder","monitor-folder":"monitor-folder","ingestion-api-key":"ingestion-api-key",inventory:"inventory","log-route":"log-route","metric-route":"metric-route","span-route":"span-route",monitor:"monitor","notification-integration":"notification-integration","notification-rule":"notification-rule","adaptive-notification-rule":"adaptive-notification-rule","notification-silence":"notification-silence","operation-api-key":"operation-api-key","quality-report":"quality-report",queue:"queue","retention-policy":"retention-policy",rum:"rum","rum-public-token":"rum-public-token","sandbox-configuration":"sandbox-configuration",service:"service","service-target":"service-target",slo:"slo","tag-policy":"tag-policy",team:"team","user-invitation":"user-invitation"},Rke=Object.entries(Cke),HFt=new Map(Rke.flatMap(([e,t])=>t?[[t,e]]:[]));var WFt=[Sf,Ku,Ku.replace(`${ie}.`,"")];var F0=["red","orange","amber","yellow","green","emerald","teal","cyan","sky","blue","indigo","purple","pink"],$0=["light","dark"];var Pke={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)"}},VZ=["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 t$t=Pke.light.red.background;var WZ=12,QZ=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:"188073512757127",isUsingLuhnAlgorithm:!1,regexp:"\\b[12](?:[0-9]{2}(?:0[1-9]|1[0-2])(?:2[AB]|[0-9]{2})[0-9]{6}[0-9]{2}| [0-9]{2} (?:0[1-9]|1[0-2]) (?:2[AB]|[0-9]{2}) [0-9]{3} [0-9]{3} [0-9]{2})\\b"},{key:"ip_address",name:"IP address",category:"device-identifier",example:"81.55.13.53",isUsingLuhnAlgorithm:!1,regexp:""},{key:"social_security_number",name:"Social security number (XXX-XX-XXXX)",category:"personal-information",example:"437-02-2223",isUsingLuhnAlgorithm:!1,regexp:"(?x)(?-u:\\b)(?:00[1-9]|0[1-9][0-9]|[1-578][0-9]{2}|6[0-57-9][0-9]|66[0-57-9])-(?:0[1-9]|[1-9]0|[1-9][1-9])-(?:000[1-9]|00[1-9]0|0[1-9]00|[1-9]000|[1-9]{4})(?-u:\\b)"},{key:"social_security_number_space",name:"Social security number (XXX XX XXXX)",category:"personal-information",example:"437 02 2223",isUsingLuhnAlgorithm:!1,regexp:"(?x)(?-u:\\b)(?:00[1-9]|0[1-9][0-9]|[1-578][0-9]{2}|6[0-57-9][0-9]|66[0-57-9])\\s+(?:0[1-9]|[1-9]0|[1-9][1-9])\\s+(?:000[1-9]|00[1-9]0|0[1-9]00|[1-9]000|[1-9]{4})(?-u:\\b)"},{key:"social_security_number_digits",name:"Social security number (9 digits)",category:"personal-information",example:"437022223",isUsingLuhnAlgorithm:!1,regexp:"(?x)(?-u:\\b)(?:00[1-9]|0[1-9][0-9]|[1-578][0-9]{2}|6[0-57-9][0-9]|66[0-57-9])(?:0[1-9]|[1-9]0|[1-9][1-9])(?:000[1-9]|00[1-9]0|0[1-9]00|[1-9]000|[1-9]{4})(?-u:\\b)"},{key:"email",name:"Email",category:"credential",example:"admin@tsuga.com",isUsingLuhnAlgorithm:!1,regexp:"[a-zA-Z0-9-_.]*[a-zA-Z0-9_](@[a-zA-Z0-9_]+)(\\.[a-zA-Z0-9_]+(\\.[a-zA-Z0-9_]+)?[a-zA-Z])(?-u:\\b)"},{key:"one_password_secret_key",name:"1Password secret key",category:"credential",example:"A3-O28NKC-F58GULWCN72-4NIKS-KGY7V-U7FAT",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)A3-[A-Z0-9]{6}-(?:(?:[A-Z0-9]{11})|(?:[A-Z0-9]{6}-[A-Z0-9]{5}))-[A-Z0-9]{5}-[A-Z0-9]{5}-[A-Z0-9]{5}(?-u:\\b)"},{key:"one_password_service_account_token",name:"1Password service account token",category:"credential",example:"ops_eyJdAZ/FoIyz0jAXpEQOrRdIE8ydVaYfAXeZXGFqHWfBOjnE/Vgf5kHIbwrNAp2WeFNPeFiVJPlLv1hmaTVums0ldq1Kv8JEglMqP3f0ATBuX/WRbKqXYS3Z1wSzxg6S0krW4df7ZplvK04+JhJimejyTEH5dYaxqsYDBSLxjeEq7JWsmHEuXj6WP5qQi7FB+5s+CwhWPWY/jDhUMB3fdowXbfv5VnWri3iYrfBh+bFeRe9KURhXGHRDE9hgs",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ops_eyJ[a-zA-Z0-9+/]{50}"},{key:"adafruit_api_key",name:"Adafruit API key",category:"credential",example:"jb9pb4unb2bhe7xqepmgwtl2jg7ti101",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{32})"},{key:"adobe_client_id",name:"Adobe client ID",category:"credential",example:"c4166853dfd2897ebe706d49ef13fe63",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"adobe_client_secret",name:"Adobe client secret",category:"credential",example:"p8e-bb6e1614324ae48e507d33af176db3b7",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:p8e-[a-z0-9]{32})"},{key:"age_secret_key",name:"Age secret key",category:"credential",example:"AGE-SECRET-KEY-1QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)AGE-SECRET-KEY-1[QPZRY9X8GF2TVDW0S3JN54KHCE6MUA7L]{58}"},{key:"airtable_api_key",name:"Airtable API key",category:"credential",example:"19b73hbi0tc5cdy4w",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{17})"},{key:"algolia_api_key",name:"Algolia API key",category:"credential",example:"346155deb68d31c4018d73de73452947",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"alibaba_access_key_id",name:"Alibaba Cloud AccessKey ID",category:"credential",example:"LTAI7cc6804e4c2155cd52bd",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:LTAI[a-z0-9]{20})"},{key:"alibaba_secret_key",name:"Alibaba Cloud secret key",category:"credential",example:"suwixirhh10xhnko9bv0vfg2971u9p",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{30})"},{key:"anthropic_admin_api_key",name:"Anthropic admin API key",category:"credential",example:"sk-ant-admin01-abc12fake-456def789ghij-klmnopqrstuvwx-3456yza789bcde-12fakehijklmnopby56aaaogaopaaaabc123xyzAA",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sk-ant-admin01-[a-zA-Z0-9_-]{93}AA)"},{key:"anthropic_api_key",name:"Anthropic API key",category:"credential",example:"sk-ant-api03-abc123xyz-456def789ghij-klmnopqrstuvwx-3456yza789bcde-1234fghijklmnopby56aaaogaopaaaabc123xyzAA",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sk-ant-api03-[a-zA-Z0-9_-]{93}AA)"},{key:"artifactory_api_key",name:"Artifactory API key",category:"credential",example:"AKCpt771klpkqllt647fdf36fq43radbz2w2nyetvx4l90qyeef8kbgkmke63ul5vf6mqsy82",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)AKCp[A-Za-z0-9]{69}(?-u:\\b)"},{key:"artifactory_reference_token",name:"Artifactory reference token",category:"credential",example:"cmVmdc6i6888t9viuobfd88e46pdonjjsvmme6np82qti7wzbj7l9m1ygtyl9wik",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)cmVmd[A-Za-z0-9]{59}(?-u:\\b)"},{key:"asana_client_id",name:"Asana client ID",category:"credential",example:"9760134337886314",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9]{16})"},{key:"asana_client_secret",name:"Asana client secret",category:"credential",example:"tcnc8mjrf5bad359nnz3j1z90gow67ji",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"atlassian_api_token",name:"Atlassian API token",category:"credential",example:"fdo4scsa4kh53jnenkfp5fbe",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:[a-z0-9]{20}[a-f0-9]{4})|(?-u:\\b)(?:ATATT3[A-Za-z0-9_-=]{50})"},{key:"authress_service_client_access_key",name:"Authress service client access key",category:"credential",example:"sc_scmz00n9xj.0ykp.acc_2k5vtnrec4.55vc9459s-gc5qlia7a67jvzm0bobn3g0ezimd3b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:sc|ext|scauth|authress)_[a-z0-9]{5,30}\\.[a-z0-9]{4,6}\\.(?-i:acc)[_-][a-z0-9-]{10,32}\\.[a-z0-9+/_=-]{30})"},{key:"aws_access_token",name:"AWS access token",category:"credential",example:"AKIALALEMEL33243OLIB",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:A3T[A-Z0-9]|AKIA|ASIA|ABIA|ACCA)[A-Z2-7]{16})(?-u:\\b)"},{key:"azure_ad_client_secret",name:"Azure AD client secret",category:"credential",example:"bP88Q~rcBcYjzzOhg1Hnn76Wm3jGgakZiZ.8vMgR",isUsingLuhnAlgorithm:!1,regexp:"(?:^|[\\\\'\"` \\r\\n\\t\\f\\v>=:(?:,)])(?:[a-zA-Z0-9_~.]{3}[0-9]Q~[a-zA-Z0-9_~.-]{31,34})(?:$|[\\\\'\"` \\r\\n\\t\\f\\v<),])"},{key:"bitbucket_client_id",name:"Bitbucket client ID",category:"credential",example:"yyxmjnl3kahirvct7sat2082pzqdyf09",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"bitbucket_client_secret",name:"Bitbucket client secret",category:"credential",example:"fylw1pominwz91e5guqjiugw6srutpl64vzch5rnt8xnt31ka7so9va73fscz836",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{64})"},{key:"beamer_api_token",name:"Beamer API token",category:"credential",example:"b_zhy-phuoqk13asco6az4u_0yhtklgswm4umkv95nv4gu",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:b_[a-z0-9=_\\-]{44})"},{key:"codecov_access_token",name:"Codecov access token",category:"credential",example:"r93iopllonuphk41qglet20y8cb83thm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"clickhouse_cloud_api_secret_key",name:"ClickHouse Cloud API secret key",category:"credential",example:"4b1dbRdW3rOcB7xLthrM4BTBGK1qPLkHigpN1bXD6z",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:4b1d[A-Za-z0-9]{38})(?-u:\\b)"},{key:"clojars_api_token",name:"Clojars API token",category:"credential",example:"CLOJARS_d1vd7t0blxaarzx25dxoda4hm5ox86st6o5ww7tnzsfz07wvu223bf0fmgim",isUsingLuhnAlgorithm:!1,regexp:"CLOJARS_[a-z0-9]{60}"},{key:"cloudflare_api_key",name:"Cloudflare API key",category:"credential",example:"ckg0h_dzkxnl627gy3nskpq9wzm4d5hc_vxk272h",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{40})"},{key:"cloudflare_global_api_key",name:"Cloudflare global API key",category:"credential",example:"1d003bb65ec73ad2691fb76631b6496e3c9d9",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{37})"},{key:"cloudflare_origin_ca_key",name:"Cloudflare Origin CA key",category:"credential",example:"v1.0-aaa334dc886f30631ba0a610-0d98ef66290d7e50aac7c27b5986c99e6f3f1084c881d8ac0eae5de1d1aa0644076ff57022069b3237d19afe60ad045f207ef2b16387ee37b749441b2ae2e9ebe5b4606e846475d4a5",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:v1\\.0-[a-f0-9]{24}-[a-f0-9]{50})"},{key:"cohere_api_token",name:"Cohere API token",category:"credential",example:"lpn59BQ4FNUabVJh1vCpIqZpQbaViELQrTa14p9D",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:[a-zA-Z0-9]{40})"},{key:"confluent_access_token",name:"Confluent access token",category:"credential",example:"kkat92sclkukwvr2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{16})"},{key:"confluent_secret_key",name:"Confluent secret key",category:"credential",example:"64d4ppp37l9fjhadm8vv0awie6wjo4d6ourfcqvi2bcs2tm95x4f0e8gyb8z8usj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"contentful_delivery_api_token",name:"Contentful delivery API token",category:"credential",example:"eumospigka64wiwpavfmmblrq7x1hm6gz84wiiw2ff3",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{43})"},{key:"curl_auth_header",name:"Curl authorization header",category:"credential",example:"curl --header 'Authorization: 5eb4223e-5008-46e5-be67-c7b8f2732305'",isUsingLuhnAlgorithm:!1,regexp:`(?-u:\\b)curl(?-u:\\b)(?:.*?|.*?(?:[\\r\\n]{1,2}.*?){1,5})[ \\t\\n\\r](?:-H|--header)(?:=|[ \\t]{0,5})(?:"(?:Authorization:[ \\t]{0,5}(?:Basic[ \\t](?:[a-z0-9+/]{8,}={0,3})|(?:Bearer|(?:Api-)?Token)[ \\t](?:[a-zA-Z0-9_=~@.+/-]{8,})|(?:[a-zA-Z0-9_=~@.+/-]{8,}))|(?:(?:X-(?:[a-z]+-)?)?(?:Api-?)?(?:Key|Token)):[ \\t]{0,5}(?:[a-zA-Z0-9_=~@.+/-]{8,}))"|'(?:Authorization:[ \\t]{0,5}(?:Basic[ \\t](?:[a-z0-9+/]{8,}={0,3})|(?:Bearer|(?:Api-)?Token)[ \\t](?:[a-zA-Z0-9_=~@.+/-]{8,})|(?:[a-zA-Z0-9_=~@.+/-]{8,}))|(?:(?:X-(?:[a-z]+-)?)?(?:Api-?)?(?:Key|Token)):[ \\t]{0,5}(?:[a-zA-Z0-9_=~@.+/-]{8,}))')(?:(?-u:\\B)|[ \\r\\n\\t\\f\\v]|\\z)`},{key:"curl_auth_user",name:"Curl basic authentication",category:"credential",example:"curl -u elastic:P@ssw0rd$1",isUsingLuhnAlgorithm:!1,regexp:`(?-u:\\b)curl(?-u:\\b)(?:.*|.*(?:[\\r\\n]{1,2}.*){1,5})[ \\t\\n\\r](?:-u|--user)(?:=|[ \\t]{0,5})(?:"(:[^"]{3,}|[^:"]{3,}:|[^:"]{3,}:[^"]{3,})"|'(?:[^:']{3,}:[^']{3,})'|(?:(?:"[^"]{3,}"|'[^']{3,}'|[a-zA-Z0-9_$@.-]+):(?:"[^"]{3,}"|'[^']{3,}'|[a-zA-Z0-9_\${}@.-]+)))(?:[ \\r\\n\\t\\f\\v]|\\z)`},{key:"databricks_api_token",name:"Databricks API token",category:"credential",example:"dapia2553f815d29a193fd09c2bb55201895",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:dapi[a-f0-9]{32}(?:-[0-9])?)"},{key:"datadog_access_token",name:"Datadog access token",category:"credential",example:"ljgbhjnca2hy5yc2nv7cag1ag7ehx2hc6geparov",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{40})"},{key:"defined_networking_api_token",name:"Defined Networking API token",category:"credential",example:"dnkey-nowf_nwyqhvqt1gi66xnuuf2rb-bfxnr9_qydyxnxn1y8uijvhhp9owllbg-2czoe-7qs5_w5650xei",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:-[a-z0-9=_\\-]{26}-[a-z0-9=_\\-]{52})"},{key:"digitalocean_pat",name:"DigitalOcean personal access token",category:"credential",example:"dop_v1_ec8f4a856c1459bd442a275461e2f709506347de30b180851cde71f696e9fcc8",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:dop_v1_[a-f0-9]{64})"},{key:"digitalocean_access_token",name:"DigitalOcean OAuth access token",category:"credential",example:"doo_v1_42b8ea6c4b0c373f88aff9d3fa87e123ab23b0d3c22ac6d4361a4e9c1e89eaa6",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:doo_v1_[a-f0-9]{64})"},{key:"digitalocean_refresh_token",name:"DigitalOcean OAuth refresh token",category:"credential",example:"dor_v1_4d9b3e6fbe65ab472e464dfa6377d702e80164442acdfbeb3ef032d917cb9984",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:dor_v1_[a-f0-9]{64})"},{key:"discord_api_token",name:"Discord API token",category:"credential",example:"7eb855d9a40747182d0b0ea74df27aee31d05756a9933a815a3ccb5a46b2d61d",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{64})"},{key:"discord_client_id",name:"Discord client ID",category:"credential",example:"763721114261247538",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9]{18})"},{key:"discord_client_secret",name:"Discord client secret",category:"credential",example:"13641266018325206246161633988007",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{32})"},{key:"doppler_api_token",name:"Doppler API token",category:"credential",example:"dp.pt.vgin8wwjy7sx66fyq99tavkm3y5g2jdxmsufh257dhj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)dp\\.pt\\.[a-z0-9]{43}"},{key:"dropbox_api_token",name:"Dropbox API token",category:"credential",example:"rdlztoij88rzrsk",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{15})"},{key:"droneci_access_token",name:"DroneCI access token",category:"credential",example:"v26gffr903rbti5v7m392ba0u7oarz36",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"duffel_api_token",name:"Duffel API token",category:"credential",example:"duffel_test_-yd6b3pc4jy593pt5kr2l3ynzkb5b_f619dshefiz=v",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)duffel_(?:test|live)_[a-z0-9_\\-=]{43}"},{key:"dynatrace_api_token",name:"Dynatrace API token",category:"credential",example:"dt0c01.ben820rdpb1so4kasfx3yn4a.zkje7lawif35udsin5t1mi1m1sne7wdzphlzrmdnu3j69gr4kgf5dwg4x5lb30zg",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)dt0c01\\.[a-z0-9]{24}\\.[a-z0-9]{64}"},{key:"easypost_api_token",name:"EasyPost API token",category:"credential",example:"EZAKBVScDZwZFv0nJXHBcxPGil7eztnPJOSmDFf2NGKQk6Dn7VqULciSRm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)EZAK[a-z0-9]{54}(?-u:\\b)"},{key:"easypost_test_api_token",name:"EasyPost test API token",category:"credential",example:"EZTKuxUXVU5HBS1K2iyh165t3VtivpdxMgIf5Y2P1oJxeFeaJGcwzVexds",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)EZTK[a-z0-9]{54}(?-u:\\b)"},{key:"etsy_access_token",name:"Etsy access token",category:"credential",example:"8ssp35lhprxpb3sjyergcz5z",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{24})"},{key:"facebook_secret",name:"Facebook secret",category:"credential",example:"c41c21ba4fb5ee05398db86ca83f06db",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"facebook_access_token",name:"Facebook access token",category:"credential",example:"911602140448729|AY-lRJZq9BoDLobvAiP25L7RcMg",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:[0-9]{15,16}(\\||%)[0-9a-z\\-_]{27,40})"},{key:"facebook_page_access_token",name:"Facebook page access token",category:"credential",example:"EAAM9GOnCB9kBO2frzOAWGN2zMnZClQshlWydZCrBNdodesbwimx1mfVJgqZBP5RSpMfUzWhtjTTXHG5I1UlvlwRZCgjm3ZBVGeTYiqAAoxyED6HaUdhpGVNoPUwAuAWWFsi9OvyYBQt22DGLqMIgD7VktuCTTZCWKasz81Q822FPhMTB9VFFyClNzQ0NLZClt9zxpsMMrUZCo1VU1rL3CKavir5QTfBjfCEzHNlWAUDUV2YZD",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:EAA[MC][a-z0-9]{50})"},{key:"fastly_api_token",name:"Fastly API token",category:"credential",example:"im7_ux24tyyxz_4y4mvzj22akpid830c",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{32})"},{key:"finicity_client_secret",name:"Finicity client secret",category:"credential",example:"roepymyr0ce7wxhjvgb2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{20})"},{key:"finicity_api_token",name:"Finicity API token",category:"credential",example:'= "cce089057c8b7fe7f2a8474b9a050816',isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"flickr_access_token",name:"Flickr access token",category:"credential",example:"damvt93tudulk6wrfp36sawndc9pa7bb",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"finnhub_access_token",name:"Finnhub access token",category:"credential",example:"x01lnfp13spcbsa0at32",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{20})"},{key:"flutterwave_public_key",name:"Flutterwave public key",category:"credential",example:"FLWPUBK_TEST-99484d505b4ee5c1181a2884f5fe3852-X",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)FLWPUBK_TEST-[a-h0-9]{32}-X"},{key:"flutterwave_secret_key",name:"Flutterwave secret key",category:"credential",example:"FLWSECK_TEST-66187ac83488c2245f0d7e95fa37e833-X",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)FLWSECK_TEST-[a-h0-9]{32}-X"},{key:"flutterwave_encryption_key",name:"Flutterwave encryption key",category:"credential",example:"FLWSECK_TEST-6262214a02e7",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)FLWSECK_TEST-[a-h0-9]{12}"},{key:"flyio_access_token",name:"Fly.io access token",category:"credential",example:"fo1_m-HT0NHLBSPwMJ2hIer4v3lxtWEC7grXNidQxJMrVVE",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:fo1_[a-zA-Z0-9_-]{43}|fm1[ar]_[a-zA-Z0-9+\\/]{50}))"},{key:"frameio_api_token",name:"Frame.io API token",category:"credential",example:"fio-u-4ov9vjtr2wwj8j1gob-8xrx2-1=z818psmitskgoq4=p-_k77d54034z55xk-lqh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)fio-u-[a-z0-9\\-_=]{64}"},{key:"freshbooks_access_token",name:"FreshBooks access token",category:"credential",example:"gqw118uwne1nddlt4yruvvs4jr9s0vrj5mxaswgb2amacod8lgnmrknsvbovsx1g",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"gocardless_api_token",name:"GoCardless API token",category:"credential",example:"live_-z4lwtrrk6p6=-v1ig_y_4ceplziwek0lw=oz-eu",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:live_[a-z0-9\\-_=]{40})"},{key:"gcp_api_key",name:"GCP API key",category:"credential",example:"AIzaYpvGqEzpgB7R353HD9CxN8LuhZ6d6UfuXLL",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:AIza[a-zA-Z0-9_-]{35})"},{key:"github_pat",name:"GitHub personal access token",category:"credential",example:"ghp_t7i9llxuukeb7apn4zlnyeyz5b0007rsfs54",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ghp_[0-9a-zA-Z]{36}"},{key:"github_fine_grained_pat",name:"GitHub fine-grained personal access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)github_pat_[a-zA-Z0-9_]{82}"},{key:"github_oauth",name:"GitHub OAuth token",category:"credential",example:"gho_anlrm6zqscqityoqozv503by66dobnem4yxh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)gho_[0-9a-zA-Z]{36}"},{key:"github_app_token",name:"GitHub app token",category:"credential",example:"ghs_0zleityj4n1ulz178o9in1w97q1ifw8u3y8h",isUsingLuhnAlgorithm:!1,regexp:"(?:ghu|ghs)_[0-9a-zA-Z]{36}"},{key:"github_refresh_token",name:"GitHub refresh token",category:"credential",example:"ghr_inu1aa7qbgi46cf8nprbgh4kn03d0zk35raj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ghr_[0-9a-zA-Z]{36}"},{key:"gitlab_cicd_job_token",name:"GitLab CI/CD job token",category:"credential",example:"glcbt-7h2nr_6jmho0uoqkb1ww431kfl",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glcbt-[0-9a-zA-Z]{1,5}_[0-9a-zA-Z_-]{20}"},{key:"gitlab_deploy_token",name:"GitLab deploy token",category:"credential",example:"gldt-7a3o70gqa8zkal0zdp4x",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)gldt-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_feature_flag_client_token",name:"GitLab feature flag client token",category:"credential",example:"glffct-dsct62ndnvcj7alw5nas",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glffct-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_feed_token",name:"GitLab feed token",category:"credential",example:"glft-13956nvy00289v6xu0di",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glft-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_incoming_mail_token",name:"GitLab incoming mail token",category:"credential",example:"glimt-fcdt1a5jvj01si61jgkse2r20",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glimt-[0-9a-zA-Z_\\-]{25}"},{key:"gitlab_kubernetes_agent_token",name:"GitLab Kubernetes agent token",category:"credential",example:"glagent-8wxkulkbbuk7u6r3nvrefswdfw5o0v7vy81y4oky8rnfogm826",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glagent-[0-9a-zA-Z_\\-]{50}"},{key:"gitlab_oauth_app_secret",name:"GitLab OAuth app secret",category:"credential",example:"gloas-vawws2nw5kf6rizn49g41jc3jiy4xqioaihrwm1msltbdt4cbmo4x52tygcic7af",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)gloas-[0-9a-zA-Z_\\-]{64}"},{key:"gitlab_pat",name:"GitLab personal access token",category:"credential",example:"glpat-2gl3ku1497ms4gzyv16i",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glpat-[a-zA-Z0-9_-]{20}"},{key:"gitlab_pat_routable",name:"GitLab personal access token (routable)",category:"credential",example:"glpat-2hf7vebpux9j56tdcqqsvap7vxc.chvjof35u",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glpat-[0-9a-zA-Z_-]{27}\\.[0-9a-z]{2}[0-9a-z]{7}(?-u:\\b)"},{key:"gitlab_ptt",name:"GitLab personal access token (temporary)",category:"credential",example:"glptt-b54e8b7b90cf006b79af110baa9b8d9183fd7048",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glptt-[0-9a-f]{40}"},{key:"gitlab_rrt",name:"GitLab registration token",category:"credential",example:"GR1348941vnauzmn2hj0zncvt0nfe",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)GR1348941[a-zA-Z0-9_-]{20}"},{key:"gitlab_runner_authentication_token",name:"GitLab runner authentication token",category:"credential",example:"glrt-xbd1w7c9clbxm52zdxkm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glrt-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_runner_authentication_token_routable",name:"GitLab runner authentication token (routable)",category:"credential",example:"glrt-t5_8d8ugbkfzddae0dw06tvm0x7qxc.mwcd1a7cn",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glrt-t[0-9]_[0-9a-zA-Z_\\-]{27}\\.[0-9a-z]{2}[0-9a-z]{7}(?-u:\\b)"},{key:"gitlab_scim_token",name:"GitLab SCIM token",category:"credential",example:"glsoat-9jb5zk1nvy800c1uqhh0",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glsoat-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_session_cookie",name:"GitLab session cookie",category:"credential",example:"_gitlab_session=yjhub6vtrp60djn6rszuemeacsoqox97",isUsingLuhnAlgorithm:!1,regexp:"_gitlab_session=[0-9a-z]{32}"},{key:"gitter_access_token",name:"Gitter access token",category:"credential",example:"uazubes6trcd_1gym09opuf_8gj1rmvj6jwber4a",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{40})"},{key:"grafana_api_key",name:"Grafana API key",category:"credential",example:"eyJrIjoiyl5shjvqja0xkfbu38m24vn5httsipr1h9fgjhodxzlkpravuiy8h7hom5kt8gtwuguh2v",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:eyJrIjoi[A-Za-z0-9]{70}={0,3})"},{key:"grafana_cloud_api_token",name:"Grafana cloud API token",category:"credential",example:"glc_cb7p4j2g1qu0sy84me72ufmn1z8mqk8y",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:glc_[A-Za-z0-9+/]{32}={0,3})"},{key:"grafana_service_account_token",name:"Grafana service account token",category:"credential",example:"glsa_rm3sadbwl8o2c13v4ipgkz04h66kiy6t_edaea401",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:glsa_[A-Za-z0-9]{32}_[A-Fa-f0-9]{8})"},{key:"harness_api_key",name:"Harness API key",category:"credential",example:"pat.vzcxr183pymw194fdq1q0v.qjqjarqkd9ydxqagjmq3f5iq.8nn5nyaow3h5mmgjh053",isUsingLuhnAlgorithm:!1,regexp:"(?:pat|sat)\\.[a-zA-Z0-9_-]{22}\\.[a-zA-Z0-9]{24}\\.[a-zA-Z0-9]{20}"},{key:"hashicorp_tf_api_token",name:"HashiCorp Terraform API token",category:"credential",example:"984d8033429986.atlasv1.799k5cihj_807yc1e8afvla8ackd1khsb50nfeswbxbr1re54y0wpzs2tjy=",isUsingLuhnAlgorithm:!1,regexp:"[a-z0-9]{14}\\.(?-i:atlasv1)\\.[a-z0-9\\-_=]{60,70}"},{key:"heroku_api_key",name:"Heroku API key",category:"credential",example:"9127f65b-8b3f-c0b7-a336-a4347e71bc51",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"heroku_api_key_v2",name:"Heroku API key v2",category:"credential",example:"HRKU-AAxPYvV6l2R3DvF0w9VJ4m8cz9oaygOHxpQvcw--iD51MszQZeakD9DZsclX",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(HRKU-AA[0-9a-zA-Z_-]{58}))"},{key:"hubspot_api_key",name:"HubSpot API key",category:"credential",example:"86cb6664-b191-db72-95a7-49adebe84b74",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12})"},{key:"huggingface_access_token",name:"HuggingFace access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:hf_(?i:[a-z]{34}))"},{key:"huggingface_organization_api_token",name:"HuggingFace organization API token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:api_org_(?i:[a-z]{34}))"},{key:"intercom_api_key",name:"Intercom API key",category:"credential",example:"zuc5c=ykf5gcwesqvmh2pji6k3extx0rbalsznte3sdo7iu7f-lumol2npfk",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{60})"},{key:"intra42_client_secret",name:"Intra42 client secret",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:s-s4t2(?:ud|af)-[abcdef0123456789]{64})"},{key:"jfrog_api_key",name:"JFrog API key",category:"credential",example:"lj7nrgoo0kr04kw312zvly7l0olsn37vhto5wdn3yqi5srxnc2axstp7a1kewkxi717w295kh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{73})"},{key:"jfrog_identity_token",name:"JFrog identity token",category:"credential",example:"xh0x2upbtkkg1pseg7ezmcyw2c3kt0bt05l5v8ynvkro6wagolhch0f7kppplt8b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"jwt",name:"JSON web token",category:"credential",example:"ey7gzQUpN8Kz7XY6Yin.ey1o36_XrBphAG8WMHQ.",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:ey[a-zA-Z0-9]{17,}\\.ey[a-zA-Z0-9\\/\\\\_-]{17,}\\.(?:[a-zA-Z0-9\\/\\\\_-]{10,}={0,2})?)"},{key:"jwt_base64",name:"JSON web token base64",category:"credential",example:"ZXlKNE5YUWpVekkxTmlJNklsUjFUM0pDZVRKT1kxUnNSbE5YZFZvNFMyZzRWemhCYWxGaFoySTBabTVtVURGVGJFdE5Uemd0VTI4aWZRLmV5SnBjM01pT2lKcWIyVWlMQTBLSUNKbGVIQWlPakV6TURBNE1Ua3pPREFzRFFvZ0ltaDBkSEE2THk5bGVHRnRjR3hsTG1OdmJTOXBjMTl5YjI5MElqcDBjblZsZlEuZEJqZnRKZVo0Q1ZQLW1COTJLMjd1aGJVSlUxcDFyX3dXMWdGV0ZPRWpYaw==",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ZXlK(?:(?P<alg>aGJHY2lPaU)|(?P<apu>aGNIVWlPaU)|(?P<apv>aGNIWWlPaU)|(?P<aud>aGRXUWlPaU)|(?P<b64>aU5qUWlP)|(?P<crit>amNtbDBJanBi)|(?P<cty>amRIa2lPaU)|(?P<epk>bGNHc2lPbn)|(?P<enc>bGJtTWlPaU)|(?P<jku>cWEzVWlPaU)|(?P<jwk>cWQyc2lPb)|(?P<iss>cGMzTWlPaU)|(?P<iv>cGRpSTZJ)|(?P<kid>cmFXUWlP)|(?P<key_ops>clpYbGZiM0J6SWpwY)|(?P<kty>cmRIa2lPaUp)|(?P<nonce>dWIyNWpaU0k2)|(?P<p2c>d01tTWlP)|(?P<p2s>d01uTWlPaU)|(?P<ppt>d2NIUWlPaU)|(?P<sub>emRXSWlPaU)|(?P<svt>emRuUWlP)|(?P<tag>MFlXY2lPaU)|(?P<typ>MGVYQWlPaUp)|(?P<url>MWNtd2l)|(?P<use>MWMyVWlPaUp)|(?P<ver>MlpYSWlPaU)|(?P<version>MlpYSnphVzl1SWpv)|(?P<x>NElqb2)|(?P<x5c>NE5XTWlP)|(?P<x5t>NE5YUWlPaU)|(?P<x5ts256>NE5YUWpVekkxTmlJNkl)|(?P<x5u>NE5YVWlPaU)|(?P<zip>NmFYQWlPaU))[a-zA-Z0-9\\/\\\\_+\\-\\r\\n]{40,}={0,2}"},{key:"launchdarkly_access_token",name:"LaunchDarkly access token",category:"credential",example:"ezmej9s6yv4qwk2=yeb4kfi162p33b_2hzm7tr-0",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{40})"},{key:"linear_api_key",name:"Linear API key",category:"credential",example:"lin_api_0n5n0k26vb4ka9je9dqdcwl1dae5mbpfhb48xio6",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)lin_api_[a-z0-9]{40}"},{key:"linear_client_secret",name:"Linear client secret",category:"credential",example:"7b956760f09b81684ed833c524f081de",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"linkedin_client_id",name:"LinkedIn client ID",category:"credential",example:"18u930hak0em0r",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{14})"},{key:"linkedin_client_secret",name:"LinkedIn client secret",category:"credential",example:"uvkxd9rw41ylk1zj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{16})"},{key:"lob_api_key",name:"Lob API key",category:"credential",example:"test_02efbb923a38370aac769e3bedc4d3398be",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:(live|test)_[a-f0-9]{35})"},{key:"lob_pub_api_key",name:"Lob publishable API key",category:"credential",example:"test_pub_df170d9f5be9244959713dfee686c42",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:(test|live)_pub_[a-f0-9]{31})"},{key:"mailchimp_api_key",name:"MailChimp API key",category:"credential",example:"81277fbbe2dd9c5e18d5f28cebcc558c-us20",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32}-us[0-9][0-9])"},{key:"mailgun_pub_key",name:"Mailgun public validation key",category:"credential",example:"pubkey-5011bae1a4b57dfa83762c24b0e1299d",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:pubkey-[a-f0-9]{32})"},{key:"mailgun_private_api_token",name:"Mailgun private API token",category:"credential",example:"key-176f7ef066471ac351adab734d2c9fb2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:key-[a-f0-9]{32})"},{key:"mailgun_signing_key",name:"Mailgun webhook signing key",category:"credential",example:"24564bd3d54a469601d5ac5daecb9ad2-00001111-22223333",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-h0-9]{32}-[a-h0-9]{8}-[a-h0-9]{8})"},{key:"mapbox_api_token",name:"MapBox API token",category:"credential",example:"pk.5ko18udoy3cilkpgyedje9limykwj8n7wmhug4967o9wze284mmpuuhjzgig.edjzuv7jwhc6lnv5b3p9nc",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:pk\\.[a-z0-9]{60}\\.[a-z0-9]{22})"},{key:"mattermost_access_token",name:"Mattermost access token",category:"credential",example:"rtw2hncbfhpbyyri90d3q2mo1m",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{26})"},{key:"maxmind_license_key",name:"MaxMind license key",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:[A-Za-z0-9]{6}_[A-Za-z0-9]{29}_mmk)"},{key:"cisco_meraki_api_key",name:"Cisco Meraki API key",category:"credential",example:"acea14a1470f7cf443a031dde64065ce81c77b2b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:[0-9a-f]{40})"},{key:"messagebird_api_token",name:"MessageBird API token",category:"credential",example:"448q6im7yxutswabdko1n69ry",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{25})"},{key:"messagebird_client_id",name:"MessageBird client ID",category:"credential",example:"12345678-ABCD-ABCD-ABCD-1234567890AB",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"netlify_access_token",name:"Netlify access token",category:"credential",example:"3j1sa0o20v0k-cjbjn3vh_4uqnkvb3w_px5no2in",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{40,46})"},{key:"new_relic_user_api_key",name:"New Relic user API key",category:"credential",example:"NRAK-zozcnrh45ornsbl1duyfhell59u",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:NRAK-[a-z0-9]{27})"},{key:"new_relic_user_api_id",name:"New Relic user API ID",category:"credential",example:"k0jze7delork84k8ke1z1dm275yw2aqf5uu2cy7x1uiloll3xab5203hiz9tx9xx",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"new_relic_browser_api_token",name:"New Relic browser API token",category:"credential",example:"NRJS-c7fa1261a97506e4a45",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:NRJS-[a-f0-9]{19})"},{key:"new_relic_insert_key",name:"New Relic insight insert key",category:"credential",example:"NRII-4168ab7eb2e051f37144ad884d32ab34",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:NRII-[a-z0-9-]{32})"},{key:"notion_api_token",name:"Notion API token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:ntn_[0-9]{11}[A-Za-z0-9]{32}[A-Za-z0-9]{3})"},{key:"npm_access_token",name:"npm access token",category:"credential",example:"npm_vz9e7fvsn7o2n2tddg6b01gs7g9wldlys4vm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:npm_[a-z0-9]{36})"},{key:"nytimes_access_token",name:"NYTimes access token",category:"credential",example:"ako7xzi0mx7w15ogdkew7ilq7h13x8rl",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{32})"},{key:"octopus_deploy_api_key",name:"Octopus Deploy API key",category:"credential",example:"API-NFWN6F7X32BYDBU94IGY3V5ZQY",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:API-[A-Z0-9]{26})"},{key:"okta_access_token",name:"Okta access token",category:"credential",example:"003cKkRNNMy4ul7V8UDHEjEBGbnsQ6tejSHzfeBtcp",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:00[a-zA-Z0-9_=\\-]{40})"},{key:"openai_api_key",name:"OpenAI API key",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sk-(?:proj|svcacct|admin)-(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})T3BlbkFJ(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})(?-u:\\b)|sk-[a-zA-Z0-9]{20}T3BlbkFJ[a-zA-Z0-9]{20})"},{key:"openshift_user_token",name:"OpenShift user token",category:"credential",example:"sha256~OFL-TnR3jyLteu_rAuff3PUYNELVvByMRFYCcAkaJSR",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sha256~[a-zA-Z0-9_-]{43})(?:[^a-zA-Z0-9_-]|\\z)"},{key:"perplexity_api_key",name:"Perplexity API key",category:"credential",example:"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'",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pplx-[a-zA-Z0-9]{48})(?:[`'\" \\r\\n\\t\\f\\v;]|\\\\[nr]|$|(?-u:\\b))"},{key:"pgpassword_shell_assignment",name:"PGPASSWORD shell assignment",category:"credential",example:"PGPASSWORD='supersecret'",isUsingLuhnAlgorithm:!1,regexp:`(?-u:\\b)PGPASSWORD=(?:"[^"\\r\\n]+"|'[^'\\r\\n]+'|[^\\s'"]+)`},{key:"plaid_api_token",name:"Plaid API token",category:"credential",example:"access-development-4b0f8c31-83fe-e4c5-3d02-91e487b69d2d",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:access-(?:sandbox|development|production)-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"plaid_client_id",name:"Plaid client ID",category:"credential",example:"TTPjxpFNiwOct5XLdxjXD0Ta",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{24})"},{key:"plaid_secret_key",name:"Plaid secret key",category:"credential",example:"ikhqm7a9k76l8f544dl0v8kxvm2w55",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{30})"},{key:"planetscale_password",name:"PlanetScale password",category:"credential",example:"pscale_pw_9gvu8z79m4b814z0vv8266w70h3i7jlq",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pscale_pw_[a-zA-Z0-9_=\\.-]{32,64})"},{key:"planetscale_api_token",name:"PlanetScale API token",category:"credential",example:"pscale_tkn_nwy9jkjgnry96ftecsx_=jrxc6pkmmew",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pscale_tkn_[a-zA-Z0-9_=\\.-]{32,64})"},{key:"planetscale_oauth_token",name:"PlanetScale OAuth token",category:"credential",example:"pscale_oauth_zx8v3gzfnfxbymj__l629i68jnz5gnff",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pscale_oauth_[a-zA-Z0-9_=\\.-]{32,64})"},{key:"postman_api_token",name:"Postman API token",category:"credential",example:"PMAK-525b84aa46e2c588620d8123-06f9ca36c4aad4305baafbe00716b7bc8f",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:PMAK-[a-f0-9]{24}\\-[a-f0-9]{34})"},{key:"prefect_api_token",name:"Prefect API token",category:"credential",example:"pnu_kttbffyfgffu2sfbxzxw8mbpgvvtxjljwe1p",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pnu_[a-zA-Z0-9]{36})"},{key:"privateai_api_token",name:"PrivateAI API token",category:"credential",example:"iwuxqzqilzbfnccncvjz6px23dnej11h",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"private_key",name:"Private key",category:"credential",example:`-----BEGIN PRIVATE KEY-----
|
|
273
273
|
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDAC4AWkdwKYSd8
|
|
274
274
|
Ks14IReLcYgADhoXk56ZzXI=
|
|
275
275
|
-----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}"}],Uke=XZ.map(e=>e.key);var u$t=new Set(Uke),p$t=XZ.map(e=>e.key);var wke={"&":"&","<":"<",">":">",'"':""","'":"'"};function G0(e){return e.replace(/[&<>"']/g,t=>wke[t]??t)}var x$t={[YO]:tA,[YO.replace(`${ie}.`,"")]:tA,[VO]:eA,[VO.replace(`${ie}.`,"")]:eA,[Ku]:Sf,[Ku.replace(`${ie}.`,"")]:Sf},O$t={[tA]:YO,[eA]:VO,[Sf]:Ku};function DA(e,t){let r={};for(let[o,i]of Object.entries(e))t.includes(o)||(r[o]=i);return r}function JZ(e){return e.replace(/ies$/,"y").replace(/s$/,"")}var vke=["alert_cluster","alert_conditions","alert_data_url","alert_id","alert_owner","alert_pattern_signature","alert_previous_status","alert_priority","alert_start_time","alert_status","alert_tags","alert_timeframe","alert_title","alert_transition","alert_triggered_by","dashboard_url","monitor_url"],Nke=["alert_queries","alert_thresholds","alert_values"],kke=["alert_event_name","alert_message"],J$t=new Set([...vke,...kke]),e1t=new Set(Nke);var B0={aws:"aws",gcp:"gcp",azure:"azure"},Ju=[B0.aws,B0.gcp,B0.azure];var eX=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(Ju,{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`."}),tX="clusterId must be provided when the organization has multiple clusters",Lke={id:"abc-123-def",name:"production",friendlyName:"Production (US)",clusterType:"aws",clusterRegion:"us-east-1"};Object.assign(eX,{examples:[Lke]});var FA=f({description:"Lists the Tsuga clusters of the organization, with cloud provider and region: the `clusterId` values other requests accept. These are not Kubernetes clusters.",operationId:"listClusters",tags:["clusters"],url:`/${"v1"}/clusters`,method:"GET",response:n.Array(eX)});function Df(e){return`\u2022\u2022\u2022\u2022${e.slice(-4)}`}function $A(e){return{accessToken:e.accessToken,accessExpiresAt:e.expiresAt.toISOString(),refreshToken:e.refreshToken}}var j0=require("node:os"),ed=require("node:path");var GA=e=>e.reason._tag==="NotFound";var rX=new Set(["api.tsuga.com","api.tsuga-staging.com"]),Mke=new Set(["localhost","127.0.0.1","[::1]"]);function nX(e){let t=e.replace(/\/+$/,"");if(!URL.canParse(t))return F(new Ic({message:`TSUGA_API_URL is not a URL: ${t}`}));if(/[\s"'\\]/.test(t))return F(new Ic({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:"?F(new Ic({message:`TSUGA_API_URL must use HTTP or HTTPS: ${t}`})):!Mke.has(r.hostname)&&(r.protocol!=="https:"||!rX.has(r.hostname))?F(new Ic({message:`Refusing to send credentials to ${t}. Set TSUGA_API_URL to ${[...rX].map(o=>`https://${o}`).join(", ")}, or a localhost URL.`})):A(t)}var eT="https://api.tsuga.com",Dke=un({operationApiKey:Tt(ye),userAuth:Tt(hA)}),oX=un({operationApiKey:Tt(ye),userAuth:Tt(hA),credentials:Tt(vb(ye,Dke)),defaults:Tt(vb(ye,ye)),telemetry:Tt(aN)}),iX=un({lastUpdateCheck:Tt(ye)}),Fke=Lo(wi(oX)),$ke=Lo(wi(iX)),Gke=fl(wi(oX,{space:2})),Bke=fl(wi(iX)),q0=["from","to","query","max-results","cluster"],sX={from:"-30m",to:"now",query:"*","max-results":"100"};function jke(e){let{operationApiKey:t,userAuth:r,...o}=e;return!t&&!r?e:{...o,credentials:{...e.credentials,[eT]:{...t?{operationApiKey:t}:{},...r?{userAuth:r}:{},...e.credentials?.[eT]}}}}function aX(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: ${Df(o.userAuth.accessToken)} (expires ${o.userAuth.accessExpiresAt})`);break;default:wt(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={...sX,...e.defaults};for(let[s,a]of Object.entries(i)){let u=s in e.defaults?" *":"";r.push(` ${s}: ${a}${u}`)}return`${r.join(`
|
|
@@ -279,7 +279,7 @@ Fix its permissions and retry; the CLI will not overwrite a config it cannot rea
|
|
|
279
279
|
`,{mode:384})}),E=k(function*(T,_){let I=T.credentials?.[_]??{};if(I.operationApiKey)return I;let b=yield*r.read(_);return b?{...I,userAuth:b}:I}),h=(T,_,I)=>({...T,credentials:{...T.credentials,[I]:_}}),S=v("config.storeUserAuth")(function*(T,_){let I=yield*g,b=yield*l,{operationApiKey:N}=I.credentials?.[b]??{},M=_&&N?{operationApiKey:N}:{};return(yield*r.save(b,T))?(yield*y(h(I,M,b)),r.location):(yield*y(h(I,{...M,userAuth:T},b)),s)});return{configPath:s,resolveApiUrl:l,resolve:k(function*(T){let _=yield*d,I=yield*l,N=T.operationApiKey??o.operationApiKey?{}:yield*E(_,I),M=B7({flagKey:T.operationApiKey,environmentKey:o.operationApiKey,operationApiKey:N.operationApiKey,userAuth:N.userAuth});yield*Qa({[R8]:M===void 0?"none":M.kind==="user-session"?"user_session":`operation_api_key_${M.source}`,[P8]:yield*t.exists(s).pipe(ri(()=>!1))});let R=_.defaults??{},$=T.clusterId?.trim()||o.clusterId||R.cluster?.trim()||void 0;return{apiUrl:I,credential:M,clusterId:$,defaults:R}}),getUserAuth:pt(function*(){let T=yield*d,_=yield*l;return(yield*E(T,_)).userAuth}),saveUserAuth:T=>S(T,!1),saveRefreshedUserAuth:T=>S(T,!0).pipe(Ka),saveOperationApiKey:v("config.saveOperationApiKey")(function*(T){let _=yield*g,I=yield*l;yield*y(h(_,{operationApiKey:T},I))}),clearUserAuth:pt(function*(){let T=yield*l,_=yield*g,{operationApiKey:I}=_.credentials?.[T]??{},b=yield*r.remove(T);if(yield*y(h(_,I?{operationApiKey:I}:{},T)),!b)return yield*new Uf({message:`The session is still in ${r.location}. Unlock it and run \`tsuga auth logout\` again.`})}),getDefault:k(function*(T){return((yield*g).defaults??{})[T]??sX[T]}),setDefault:v("config.setDefault")(function*(T,_){let I=yield*g,{[T]:b,...N}=I.defaults??{};yield*y({...I,defaults:_===""?N:{...N,[T]:_}})}),resetDefaults:pt(function*(){let{defaults:T,..._}=yield*g;yield*y(_)}),getTelemetryConsent:te(d,T=>T.telemetry),saveTelemetryConsent:v("config.saveTelemetryConsent")(function*(T){let _=yield*g;yield*y({..._,telemetry:T})}),getLastUpdateCheck:t.readFileString(u).pipe(H($ke),te(T=>T.lastUpdateCheck),ri(()=>{})),saveLastUpdateCheck:v("config.saveLastUpdateCheck")(function*(T){yield*t.makeDirectory(a,{recursive:!0,mode:448});let _=yield*Bke({lastUpdateCheck:T}).pipe(Cn);yield*t.writeFileString(u,`${_}
|
|
280
280
|
`,{mode:384})})}})}){static layer=Uo(this,this.make)};var qke="Your session expired.",Hke="Your session could not be renewed: the refresh token was already used, revoked or expired. A refresh token is single-use, so the server revokes the whole session when one is replayed.",BA=k(function*(e,t){let r=yield*Fn;if(!T0(t,r))return t;let o=yield*gt,i=yield*Wu,s=(yield*o.getUserAuth.pipe(ri(()=>{})))??t;if(!T0(s,r))return s;if(!s.refreshToken)return yield*new Kl({message:qke,suggestions:["Sign in again: tsuga auth login"]});let a=yield*i.refreshTokens(e,s.refreshToken).pipe(ti("OAuthTokenError",l=>F(l.code==="invalid_grant"?new Kl({message:Hke,suggestions:["Sign in again: tsuga auth login"]}):new ua({message:`Could not renew your session: ${l.message}. Retry the command.`})))),u=$A(a);return yield*o.saveRefreshedUserAuth(u).pipe(So(l=>Yn(`Warning: could not save the renewed session (${l.message}). Run \`tsuga auth login\` before the next command.`))),u});var iT=require("node:crypto");var H0={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`."})},Kke=n.Object({...H0,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.'})}),_Gt=f({tags:["docs"],url:"/v0/docs/search",method:"GET",query:n.Object({query:p({allowEmpty:!1,description:"Search text to match against documentation and API-reference content."}),limit:n.Optional(n.Integer({minimum:1,maximum:50,description:"Maximum number of results to return."}))}),response:n.Array(Kke)});var cX=`/${"v1"}/docs`,uX=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"}),zke={path:"getting-started/send-your-first-logs",title:"Send your first logs",content:`# Send your first logs
|
|
281
281
|
...`};Object.assign(uX,{examples:[zke]});var pX=n.Object(H0,{$id:"DocSearchResult",description:"A documentation page or API-reference endpoint search result"}),Yke={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(pX,{examples:[Yke]});var lX=f({description:"Retrieves the raw markdown of a documentation or API-reference page by path or link. Documentation pages use slug paths such as `getting-started/send-your-first-logs`; API-reference pages use `api/<operationId>`.",operationId:"getDocPage",tags:["public","docs"],url:cX,method:"GET",query:n.Object({path:p({allowEmpty:!1,description:"Page to fetch: a doc slug path, `api/<operationId>`, or a docs link with or without its host. A `/documentation/<path>` link returns the whole page, ignoring `?tab=` and `#anchor`; an API-reference link `/documentation/api#tag/<tag>/<METHOD><path>` returns that operation's page."})},{description:"Documentation page lookup query."}),response:uX}),jA=f({description:"Searches Tsuga documentation and API reference, covering product behavior, query syntax (Tsuga queries, PromQL), API fields, dashboard and widget schemas, setup, limits, gotchas and more. Results are ranked by relevance; an empty array means nothing matched.",operationId:"searchDocs",tags:["public","docs"],url:`${cX}/search`,method:"GET",query:n.Object({query:p({allowEmpty:!1,description:"Search text to match against documentation and API-reference content."})},{description:"Documentation search query."}),response:n.Array(pX)});var tT=`/${"v1"}/logs`,K0=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(_0,["message","timestamp","level"]).properties},{additionalProperties:!0,$id:"LogEvent",description:"Log event including message, timestamp, severity level, and optional enriched context attributes."}),Vke={context:{team:"platform"},message:"Request completed successfully",timestamp:17040672e5,level:"INFO"};Object.assign(K0,{examples:[Vke]});var dX=n.Object({query:n.Optional(p({type:"tsuga-query",default:"*",description:"Tsuga query selecting logs to return. Omit to search all logs with `*`."})),maxResults:n.Optional(n.Integer({minimum:1,maximum:1e3,default:eZ,description:"Maximum number of logs to return. Defaults to 100. Valid values are 1 through 1000."})),clusterId:n.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."})),...tn.properties},{description:"Log search query. Provide a time range, optional Tsuga query, and optional limit."}),Wke={query:"level:ERROR",maxResults:100,from:1704067200,to:1704070800};Object.assign(dX,{examples:[Wke]});var rT=f({description:"Searches raw log lines in a time range with Tsuga query syntax: error messages, exceptions, stack traces, the logs of one request or pod. For counts or rates, use an aggregation; to group similar messages, use log patterns. See [Logs](/documentation/explore/logs) and [Query syntax](/documentation/explore/query-syntax).",operationId:"searchLogs",tags:["public","logs"],url:`${tT}/search`,method:"GET",query:dX,response:n.Object({logs:n.Array(K0,{description:"Log events matching the query and time range."})})}),Qke=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`."}))}),mX=n.Object({patterns:n.Array(Qke,{description:"Log patterns clustered from logs matching the query."}),sampleSize:n.Number({description:"Sum of the returned patterns' `size` values. It is not the number of logs matching the query: logs outside the returned patterns are not counted."})},{}),Zke={patterns:[{pattern:"Resolved segment SegmentId([0:1]) from cache",size:37004,groups:[{key:"level",value:"DEBUG"},{key:"context.team",value:"infra"}]}],sampleSize:37004};Object.assign(mX,{examples:[Zke]});var fX=f({description:"Groups similar log messages into patterns with counts over a time range: the top messages or errors without reading raw lines. For patterns first seen in the range, use new error patterns; for growing ones, error pattern increases. See [Logs](/documentation/explore/logs).",operationId:"getLogPatterns",tags:["public","logs"],url:`${tT}/patterns`,method:"GET",query:n.Object({...tn.properties,query:p({type:"tsuga-query",description:"Tsuga query selecting logs to cluster into patterns."}),clusterId:n.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))}),response:mX}),Xke=n.Object({exampleLog:n.Optional(K0),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."})}),gX=n.Object({newErrorPatterns:n.Array(Xke,{description:"Error patterns first seen in the requested time range."})},{}),Jke={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(gX,{examples:[Jke]});var hX=f({description:"Finds error log patterns first seen in the time range: new errors or exceptions, for example after a change. Optionally filtered by team, environment or service. See [Logs](/documentation/explore/logs).",operationId:"getNewErrorPatterns",tags:["public","logs"],url:`${tT}/patterns/new`,method:"GET",query:n.Object({...tn.properties,team:n.Optional(p({description:"Team name to restrict pattern detection to."})),env:n.Optional(p({description:"Environment to restrict pattern detection to."})),service:n.Optional(p({description:"Service name to restrict pattern detection to."})),clusterId:n.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))}),response:gX}),eLe=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."}))}),yX=n.Object({errorPatternIncreases:n.Array(eLe,{description:"Error patterns with increased occurrence in the requested time range."})},{}),tLe={errorPatternIncreases:[{team:"platform",env:"production",pattern:"Non-resolved segment SegmentId(*) from cache",increaseTimestamps:[17041536e5,17042392e5]}]};Object.assign(yX,{examples:[tLe]});var EX=f({description:"Finds a team's error log patterns whose count increased in the time range: spikes in existing errors. For errors first seen in the range, use new error patterns. See [Logs](/documentation/explore/logs).",operationId:"getErrorPatternIncrease",tags:["public","logs"],url:`${tT}/patterns/increase`,method:"GET",query:n.Object({...tn.properties,team:p({allowEmpty:!1,description:"Team name to analyze for pattern increases. Required; match it to the `context.team` value on the logs you want Tsuga to inspect."}),env:n.Optional(p({allowEmpty:!1,description:"Environment to restrict the analysis to. Optional; match it to the `context.env` value on the logs, or omit it to analyze all environments for the team."})),clusterId:n.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))}),response:yX}),TX=n.Object({attributes:n.Array(n.String(),{description:"Log attribute dot-paths observed in the time range"})},{}),rLe={attributes:["context.env","context.k8s.pod.name","context.service.name","context.team","level","message","timestamp"]};Object.assign(TX,{examples:[rLe]});var nLe=n.Object({...tn.properties,clusterId:n.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."})),search:n.Optional(p({allowEmpty:!1,description:"Return only attribute dot-paths containing this text, case-insensitively, e.g. `k8s` or `http.status`."}))},{description:"Log attribute discovery query. Provide a time range, an optional cluster ID, and an optional search text."}),SX=f({description:"Lists log attribute (field, key) names seen in a time range, to find the key to filter or group logs by. Requires a credential that can read all teams: attribute discovery is not team-filtered. To rank fields by their use in dashboards and monitors, use interesting fields. See [Logs](/documentation/explore/logs).",operationId:"getLogAttributes",tags:["public","logs"],url:`${tT}/attributes`,method:"GET",query:nLe,response:TX});var oLe=n.Union([n.Literal("scalar"),n.Literal("timeseries")]),iLe="/v0/promql",qA=n.Object({query:p({type:"long",allowEmpty:!1,description:"PromQL expression to evaluate."}),timeRange:Ao,step:p({allowEmpty:!1,description:"Evaluation step interval (e.g. `1m`, `5m`, `1h`). Must be a valid Prometheus duration string."}),returnType:n.Optional(oLe),executionOptions:ZE,shouldStreamResults:n.Optional(n.Boolean()),clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster to target. Mutually exclusive with `clusterIds`. Defaults to the first cluster created in the organization when both are omitted."})),clusterIds:n.Optional(bc)}),sLe={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(qA,{examples:[sLe]});var qGt=f({tags:["promql"],url:iLe,method:"POST",body:qA,response:kf});var aLe=`/${"v1"}/promql`,cLe=`/${"v2"}/promql`,_X=n.Object({...n.Pick(qA,["query","step"]).properties,timeRange:tn},{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"}]}),IX=n.Object({clusterId:n.Optional(p({allowEmpty:!1,description:"Telemetry cluster to query. Set by the client as the clusterId query parameter, not in the JSON body. Required when the organization has multiple clusters; omit only for single-cluster organizations. Unknown cluster IDs return 404."}))}),HA=f({description:'Runs a PromQL (Prometheus query language) range query over metrics and returns timeseries. Use a metric name exactly as the metrics list returns it: names are not translated between OpenTelemetry dots and Prometheus underscores, and a dotted metric or label name must be quoted, as in `{"k8s.pod.memory.working_set"}`. See [How to write PromQL queries](/documentation/visualize/guides/how-to-write-promql-queries).',operationId:"queryPromql",tags:["public","promql"],url:aLe,method:"POST",body:_X,query:IX,response:AA}),uLe=n.Object({..._X.properties,timeRange:Ao},{description:"PromQL range-query request with the time range in milliseconds. Send clusterId as a query parameter, not in this JSON body.",examples:[{query:'sum by ("context.service.name") (sum_over_time({"traces.span.metrics.calls", "span.kind"="SPAN_KIND_SERVER"}[5m]))',timeRange:{from:17822015e5,to:17822034e5},step:"1m"}]}),XGt=f({description:"Runs a PromQL range query over Tsuga metric data and returns one shared time axis in milliseconds with one series per group aligned to it. Same request as `POST /v1/promql`, with `timeRange` in milliseconds. See [How to write PromQL queries](/documentation/visualize/guides/how-to-write-promql-queries) for query syntax and examples.",operationId:"queryPromqlV2",tags:["public","promql"],url:cLe,method:"POST",body:uLe,query:IX,response:CA});var td="/v0/traces",iBt=f({tags:["traces"],url:`${td}/count`,method:"GET",query:n.Pick(Qu,["from","to","query","clusterId","useCanopy"]),response:n.Object({count:n.Number()})}),pLe=["unset","ok","error"],lLe=n.Enum(pLe),dLe=["unspecified","internal","server","client","producer","consumer"],mLe=n.Enum(dLe),OX=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:mLe,name:n.String()}),status_code:n.Optional(lLe),trace_id:n.String()}),AX=100;var fLe={...Cr.properties,query:n.Optional(p({type:"tsuga-query"})),maxResults:n.Optional(n.Integer({minimum:1,maximum:1e4})),shouldRecommendAttributes:n.Optional(n.Boolean()),startOffset:n.Optional(n.Number({minimum:YE})),clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"})),sortBy:n.Optional(p({allowEmpty:!1,description:"Attribute to sort by. Attributes other than `start_time` sort numerically; spans where the attribute is missing or not a number come last."})),sortDirection:n.Optional(le),useCanopy:n.Optional(n.Boolean())},sBt=f({tags:["traces"],url:`${td}/search`,method:"GET",query:n.Object(fLe),response:n.Object({spans:n.Optional(n.Array(OX)),attributesToHighlight:n.Optional(n.Array(VE)),incomplete:n.Optional(n.Boolean({description:"True when attribute highlighting stopped early because too many distinct attributes were found."}))})}),gLe=n.Object({groupByAttributes:n.Array(p({allowEmpty:!1}),{description:'Glob patterns of span_attributes keys to use as additional grouping dimensions (e.g. "db.*"). Matches against flattened dotted keys of span_attributes only.'}),minLeafSpansToAggregate:n.Integer({minimum:2,description:"Minimum leaf-group size before aggregation occurs. Default 5."}),maxParentDepth:n.Integer({minimum:-1,description:"Max depth of recursive parent aggregation. 0 = leaves only, -1 = unlimited (default)."}),aggregationHistogramBucketsSeconds:n.Array(n.Number({minimum:0}),{description:"Upper bounds for the latency histogram in seconds. Empty array disables the histogram attributes."}),sortSpans:n.Boolean({description:"Whether to sort the returned spans by start_time (span_id tie-breaker). Set false when the caller reconstructs the trace tree and does not need ordering. Default true."})}),hLe=n.Object({...Cr.properties,traceId:p({allowEmpty:!1,description:"Trace ID to summarize"}),clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"})),...n.Partial(gLe).properties}),aBt=f({tags:["traces"],url:`${td}/summarize`,method:"GET",query:hLe,response:n.Object({spans:n.Array(OX)})}),cBt=f({tags:["traces"],url:`${td}/attributes`,method:"GET",query:n.Object({...Cr.properties,clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"})),useCanopy:n.Optional(n.Boolean())}),response:n.Object({attributes:n.Array(n.String())})}),yLe=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."}))}),ELe=n.Object({fromNs:n.String({description:"Range start time in nanoseconds since Unix epoch. Tsuga sets it from the trace timeline split where active leaf spans change. Transmitted as a string to avoid losing precision."}),toNs:n.String({description:"Range end time in nanoseconds since Unix epoch. Tsuga sets it from the trace timeline split where active leaf spans change. Transmitted as a string to avoid losing precision."}),durationNs:n.String({description:"Range duration in nanoseconds, computed as `toNs - fromNs`. Transmitted as a string to avoid losing precision."}),contributions:n.Array(n.Object({serviceKey:n.String({description:"Contributing service key for this range. References `services[].key` in the same response."}),weight:n.Number({description:"Share of this range attributed to the service, from `0` through `1`, computed from active leaf spans in the range. Weights in one range sum to `1`, except on a range merged from shorter ones: each pairwise merge truncates to the microsecond grid, so the loss grows with the number of merges, a few parts in 10,000 on a typical trace but well below `1` after a long run of very short adjacent ranges. `serviceTotals` carries the same loss."}),durationNs:n.String({description:"Estimated duration attributed to this service in the range, computed as `weight` times the range's own `durationNs` and rounded to whole nanoseconds. Use `serviceTotals` as authoritative when rounded range values do not add up exactly."})}),{description:"Services contributing active leaf-span time to this range, with weighted shares for the range duration."}),spanIds:n.Array(n.String(),{description:"Leaf span IDs that produced this range. Tsuga returns IDs from the leaf-only attribution set, including merged sub-ranges after short-range collapsing."})}),TLe=n.Object({serviceKey:n.String({description:"Contributing service key for this aggregate total. References `services[].key` in the same response."}),durationNs:n.String({description:"Total wall-clock contribution of this service across the trace, in nanoseconds. Sum of `weight * durationNs` over every range the service contributes to; authoritative when it disagrees with rounded per-range values. Transmitted as a string to avoid losing precision."}),share:n.Number({description:"Share of total trace duration attributed to this service, `durationNs / totalDurationNs`, from `0` through `1`. Shares sum to less than `1` because time where no span was running is credited to no service, and because of the merge truncation described on `ranges[].contributions[].weight`, which is the whole shortfall on a trace with no gap."})}),z0=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."})),Y0=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."})),KA=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(yLe,{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(ELe,{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(TLe,{description:"Aggregated wall-clock contribution per service across the fetched trace. Use this for service-level latency ownership without processing the per-range timeline."})}),SLe={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(KA,{examples:[SLe]});var uBt=f({tags:["traces"],url:`${td}/latency-summary`,method:"GET",query:n.Object({...Cr.properties,traceId:p({allowEmpty:!1,description:"Trace ID to summarize"}),clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"})),minRangeDurationMs:z0,includeRanges:Y0}),response:KA}),_Le=n.Object({traceId:n.String(),spanId:n.String()}),pBt=f({tags:["traces"],url:`${td}/span-backlinks`,method:"GET",query:n.Object({...Cr.properties,traceId:p({allowEmpty:!1,description:"Trace ID referenced by span links"}),clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),response:n.Object({backlinks:n.Array(n.Object({spanId:n.String(),references:n.Array(_Le)})),truncated:n.Boolean()})}),bX=n.Object({filter:p({type:"tsuga-query",description:"TQL filter defining the group"}),timeRange:Ao}),ILe=n.Object({value:n.String(),targetSupport:n.Number(),baselineSupport:n.Number()}),bLe=n.Object({value:n.String(),targetSupport:n.Number(),baselineSupport:n.Number(),lift:n.Union([n.Number(),n.Null()]),pValue:n.Number()}),xLe=n.Object({attr:n.String(),values:n.Array(bLe),otherValues:n.Array(ILe)}),xX=n.Object({contrastSets:n.Array(xLe),targetGroupCount:n.Number(),baselineGroupCount:n.Number(),failedAttributeCount:n.Number()}),OLe=D("type",[n.Object({type:n.Literal("snapshot"),response:xX}),n.Object({type:n.Literal("done"),response:xX}),n.Object({type:n.Literal("error"),message:n.String()})]),ALe=n.Object({targetGroup:bX,baselineGroup:bX,candidateAttrs:n.Optional(n.Array(p({allowEmpty:!1}))),topK:n.Optional(n.Integer({minimum:1,maximum:100})),minLift:n.Optional(n.Number({minimum:1})),minSupport:n.Optional(n.Number({minimum:0,maximum:100})),clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster ID"}))}),lBt=f({tags:["traces"],url:`${td}/contrast-sets/stream`,method:"POST",body:ALe,response:OLe});var zA=`/${"v1"}/traces`,V0=n.Object({context:n.Optional(n.Object({service:n.Optional(n.Object({name:n.Optional(n.String({description:"Service name associated with the span."})),version:n.Optional(n.String({description:"Service version associated with the span."}))},{additionalProperties:!0,description:"Service identity associated with the span, from OpenTelemetry service resource attributes."}))},{additionalProperties:!0,description:"OpenTelemetry resource context resolved for the span, holding the identity of the emitting service."})),parent_span_id:n.Optional(n.String({description:"`span_id` of this span's parent within the same trace. Empty or absent for a root span."})),resource_attributes:n.Object({},{additionalProperties:!0,description:"OpenTelemetry resource attributes describing the process/host that emitted the span (e.g. `host.name`, `k8s.pod.name`), as a flat key-value map set by the instrumented service or its SDK."}),span_attributes:n.Object({},{additionalProperties:!0,description:"OpenTelemetry span attributes describing this operation (e.g. HTTP method, DB statement), as a flat key-value map set by the instrumented code or auto-instrumentation."}),duration:n.Number({description:"Span duration in milliseconds, derived from the nanosecond `start_time` and `end_time` values."}),duration_ns:n.String({description:"Span duration in nanoseconds, encoded as a string to preserve precision."}),start_time:n.String({description:"Span start time as a Unix epoch timestamp in nanoseconds, encoded as a string to preserve precision."}),end_time:n.String({description:"Span end time as a Unix epoch timestamp in nanoseconds, encoded as a string to preserve precision."}),error:n.Optional(n.Object({message:n.String({description:"OpenTelemetry span status description set by the instrumentation, such as the exception message."})},{description:"OpenTelemetry span status description. `message` is set only when `status_code` is `error` and the instrumentation recorded a description."})),events:n.Optional(n.Array(n.Object({event_attributes:n.Object({},{additionalProperties:!0,description:"Key-value attributes recorded with this event, set by the instrumented code when the event was added to the span (e.g. exception details)."}),event_name:n.String({description:"Name of the span event."}),event_timestamp_nanos:n.String({description:"Event timestamp in nanoseconds, transmitted as a string for precision."})},{description:"A single timestamped event recorded on the span, with its name and attributes."}),{description:"Events recorded on the span."})),links:n.Optional(n.Array(n.Object({},{additionalProperties:!0}),{description:"OpenTelemetry span links to related spans, possibly in other traces."})),span_id:n.String({description:"Unique span ID within the trace."}),span:n.Object({kind:n.String({description:"OpenTelemetry span kind describing the relationship to remote calls: `unspecified`, `internal`, `server`, `client`, `producer`, or `consumer`."}),name:n.String({description:"Operation name recorded on the span."})},{description:"Operation identity for the span, combining the recorded operation name and the OpenTelemetry span kind."}),status_code:n.Optional(n.String({description:"OpenTelemetry span status set by the instrumented code: `unset` (default, no explicit status), `ok`, or `error`. Absent if the source span never set a status."})),trace_id:n.String({description:"Trace ID shared by all spans in the trace."})},{additionalProperties:!0,$id:"SpanEvent",description:"Distributed tracing span including timing, identifiers, OpenTelemetry attributes, events, and status metadata."}),CLe={context:{service:{name:"my-service",version:"1.0.0"}},parent_span_id:"187a47da1b2560f8",resource_attributes:{},span_attributes:{busyNs:374640,code:{file:{path:"src/queue/sqs.rs"},line:{number:162},module:{name:"queue::sqs"}},idleNs:23621445,maxMessages:"1",target:"queue::sqs",thread:{id:2,name:"tokio-runtime-worker"}},duration:23,duration_ns:"23995900",start_time:"1770923469995353600",end_time:"1770923470019349500",span_id:"3df8cc3449378f66",span:{kind:"internal",name:"receive_messages"},status_code:"ok",trace_id:"78c99c5bb1e4a30297fa134b9dbec64f"};Object.assign(V0,{examples:[CLe]});var RLe={from:1704067200,to:1704070800,query:"context.service.name:my-service",maxResults:100},PX=n.Object({...tn.properties,query:n.Optional(p({type:"tsuga-query",default:"*",description:"Tsuga query selecting spans to return. Omit to search all spans in the range with `*`."})),maxResults:n.Optional(n.Integer({minimum:1,maximum:1e4,default:AX,description:"Maximum number of spans to return. Defaults to 100. Valid values are 1 through 10000."})),clusterId:n.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))},{description:"Span search query. Provide a time range, optional Tsuga query, and optional limit."});Object.assign(PX,{examples:[RLe]});var nT=f({description:"Searches trace spans (APM requests and operations) in a time range with Tsuga query syntax, for example the slow or failing requests of a service. For one whole trace, use the trace summary; for counts or latency percentiles, an aggregation. See [Traces](/documentation/explore/traces) and [Query syntax](/documentation/explore/query-syntax).",operationId:"searchSpans",tags:["public","traces"],url:`${zA}/search`,method:"GET",query:PX,response:n.Object({spans:n.Array(V0,{description:"Spans matching the query and time range."})})}),PLe={from:1704067200,to:1704070800,traceId:"78c99c5bb1e4a30297fa134b9dbec64f"},UX=n.Object({...tn.properties,traceId:p({allowEmpty:!1,description:"Trace ID to summarize. Use the `trace_id` returned by span search, the trace details page, or your tracing instrumentation. Required; the requested time range must include the trace."}),clusterId:n.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."})),groupByAttributes:n.Optional(n.Array(p({allowEmpty:!1}),{description:"Glob patterns of span attribute keys to use as additional grouping dimensions. Use this when spans should be summarized separately for matching attributes, such as `db.*`. Matches flattened dotted span attribute keys; omitted by default."})),minLeafSpansToAggregate:n.Optional(n.Integer({minimum:2,default:5,description:"Minimum number of similar leaf spans in a group before Tsuga replaces them with one synthetic summary span. Use higher values for less aggressive summarization. Optional; defaults to 5 and must be at least 2."})),maxParentDepth:n.Optional(n.Integer({minimum:-1,default:-1,description:"Maximum depth of recursive parent aggregation after leaf spans are summarized. Use this to limit parent-level aggregation. Use `0` to aggregate leaf spans only or `-1` for unlimited depth; defaults to `-1`."})),aggregationHistogramBucketsSeconds:n.Optional(n.Array(n.Number({minimum:0}),{description:"Upper-bound bucket values, in seconds, for the latency histogram recorded on synthetic summary spans. Provide custom buckets when the default latency buckets are not suitable. Pass an empty array to omit histogram attributes; omitted values use Tsuga defaults from 5 ms through 10 s."})),sortSpans:n.Optional(n.Boolean({default:!0,description:"Whether Tsuga sorts returned spans by start time, using span ID as the tie-breaker for identical start times. Defaults to `true`; set to `false` only when reconstructing the trace tree yourself, in which case summary spans are appended after surviving spans."}))},{description:"Trace summarization query. Provide a trace ID, a time range covering the trace, and optional aggregation tuning."});Object.assign(UX,{examples:[PLe]});var wX=f({description:"Returns one trace by trace ID as a compact set of spans: similar spans are merged into summary spans with counts and duration statistics, so large traces fit. Summary spans carry `span_attributes.aggregation.is_summary`. For where the time went, use the trace latency summary. See [Traces](/documentation/explore/traces).",operationId:"summarizeTrace",tags:["public","traces"],url:`${zA}/summarize`,method:"GET",query:UX,response:n.Object({spans:n.Array(V0,{description:"Summarized trace spans, sorted by start time unless `sortSpans` is false. Aggregated groups are replaced by synthetic summary spans marked with `span_attributes.aggregation.is_summary`."})})}),ULe={from:1704067200,to:1704070800,traceId:"78c99c5bb1e4a30297fa134b9dbec64f"},vX=n.Object({...tn.properties,traceId:p({allowEmpty:!1,description:"Trace ID to summarize. Use the `trace_id` returned by span search, the trace details page, or your tracing instrumentation. Required; the requested time range must include the trace."}),clusterId:n.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."})),minRangeDurationMs:z0,includeRanges:Y0},{description:"Trace latency summary query. Provide a trace ID, a time range covering the trace, and optional timeline tuning."});Object.assign(vX,{examples:[ULe]});var NX=f({description:"Finds where the time went in one trace (bottleneck, critical path): wall-clock time attributed to the services with active leaf spans, as per-service totals and an optional sequential timeline. For the spans themselves, use the trace summary. See [Traces](/documentation/explore/traces).",operationId:"getTraceLatencySummary",tags:["public","traces"],url:`${zA}/latency-summary`,method:"GET",query:vX,response:KA}),CX=e=>n.Object({filter:p({type:"tsuga-query",description:`Tsuga query selecting the ${e} spans. Terms are ANDed by whitespace, as in \`context.service.name:checkout status_code:error\`.`}),timeRange:tn},{description:`The ${e} group: a Tsuga query and the time range it is evaluated over.`}),kX=n.Object({targetGroup:CX("target"),baselineGroup:CX("baseline"),candidateAttrs:n.Optional(n.Array(p({allowEmpty:!1}),{maxItems:20,description:"Span attribute dot-paths to test, such as `context.service.name` or `span_attributes.http.route`. Attributes referenced by either group filter, and their known sibling attributes for the same field, are always excluded, so the contrasted condition does not come back as a finding. Omit or pass an empty array to let Tsuga test the attributes among `span_attributes.*`, `context.*`, `span.name`, `span.kind`, `status_code` and `is_root` that take more than one value across samples of both groups, most frequent in the target first; when none varies, `contrastSets` is empty. Span duration (`duration_ns`, even when named here) and discovered numeric attributes with near-unique values never appear in `contrastSets`."})),topK:n.Optional(n.Integer({minimum:1,maximum:100,description:"Maximum number of findings to return, strongest first. A finding is one attribute/value pair, and findings are grouped into one `contrastSets` entry per attribute, so a result carries at most this many `values` rows across possibly fewer entries. Valid values are 1 through 100. Defaults to 10."})),minLift:n.Optional(n.Number({minimum:1,description:"Minimum lift a value must reach to be reported as a finding. Lift is the value's coverage of the target group divided by its coverage of the baseline, so `2` keeps only values at least twice as frequent in the target. Raise it to cut weak findings. Defaults to 1.5."})),minSupport:n.Optional(n.Number({minimum:0,maximum:100,description:"Support floor as a percentage: a value is reported as a finding only when it covers at least this much of the target group or of the baseline group. Valid values are 0 through 100. Raise it to drop findings that explain only a handful of spans. Defaults to 0.5."}))},{description:"Contrast-set request. Provide the target group to explain and the baseline to compare it against, plus optional significance tuning. Send `clusterId` as a query parameter, not in the JSON body."}),wLe={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(kX,{examples:[wLe]});var RX={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."})},vLe=n.Object({attr:n.String({description:"Span attribute dot-path this contrast set is about, such as `context.env`."}),values:n.Array(n.Object({...RX,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(RX,{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"}),LX=n.Object({contrastSets:n.Array(vLe,{description:"One entry per attribute that separates the two groups, strongest first. An attribute with the same value strings as a stronger entry is left out, so two boolean attributes appear as one entry. Empty when nothing cleared the gates, which means the target and the baseline look alike on the attributes tested."}),targetGroupCount:n.Number({description:"Number of spans matched by the target group filter over its time range. Not a sample: it is a plain count over the whole group."}),baselineGroupCount:n.Number({description:"Number of spans matched by the baseline group filter over its time range. Not a sample: it is a plain count over the whole group."}),failedAttributeCount:n.Number({description:"Number of candidate attributes Tsuga dropped because a query for them failed. Those attributes were not tested at all, so a high count next to an empty `contrastSets` means the comparison was incomplete, not that the two groups are alike."})}),NLe={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(LX,{examples:[NLe]});var MX=f({description:"Finds what failing or slow requests have in common that healthy ones do not, for example errors against successes, or before and after a change: compares a target span group with a baseline and returns the attribute values over-represented in the target. Each group has its own time range, so a before/after comparison is one call. See [Traces](/documentation/explore/traces).",operationId:"findContrastSets",tags:["public","traces"],url:`${zA}/contrast-sets`,method:"POST",body:kX,query:Fi,response:LX});function FX(e,t){let r=[],o=DX(t);for(let i=0;i<e.length;i+=1){let s=e[i];if(s===void 0||s==="--")break;if(s.startsWith("-")){s.includes("=")||(i+=1);continue}let a=o.get(s);if(a===void 0)break;r.push(s),o=DX(a)}return r.join(" ")}function DX(e){let t=new Map;for(let r of e.subcommands)for(let o of r.commands)t.set(o.name,o);return t}var Rc=(e,t)=>r=>ht(r,o=>new kn({message:`Could not ${e} ${t}: ${o.message}`})),Ff=v("fs.writeAtomic")(function*(e,t){let r=yield*Jr,o=`${e}.tmp.${process.pid}`;yield*r.writeFileString(o,t).pipe(Rc("write",o)),yield*r.rename(o,e).pipe(Rc("write",e))}),$f=v("fs.readOrUndefined")(function*(e){return yield*(yield*Jr).readFileString(e).pipe(Bj(GA,()=>Me),dI({onSuccess:r=>r??void 0,onFailure:r=>new kn({message:`Could not read ${e}: ${r.message}`})}))}),Gf=v("fs.backupIfExists")(function*(e,t,r){if(t===void 0)return;let o=yield*Jr,i=`${e}.bak.${r.replaceAll(":","-")}`;return yield*o.writeFileString(i,t).pipe(Rc("back up",e)),i});function li(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var YA=v("fs.parseJsonObject")(function*(e,t){let r=yield*kLe(t).pipe(ht(()=>new kn({message:`${e} is not valid JSON. Fix or remove it before re-running.`})));return li(r)?r:yield*new kn({message:`${e} must contain a JSON object at the top level.`})}),kLe=VK(wi(uc)),VA=v("fs.formatJsonFile")(function*(e){return`${yield*LLe(e).pipe(Cn)}
|
|
282
|
-
`}),LLe=fl(wi(uc,{space:2}));var MLe=fl(wi(uc)),sT={traceId:(0,iT.randomBytes)(16).toString("hex"),spanId:(0,iT.randomBytes)(8).toString("hex")};function Q0(e,t,r){if(e===jA)return Array.isArray(r)?{[D8]:r.length}:{};let o=e===rT||e===nT,i=e===RA,s=e===HA;if(!(o||i||s||e===PA))return{};let a=t.query??{},u=li(t.body)?t.body:{},l=li(r)?r:{},d=o?a:li(u.timeRange)?u.timeRange:{},g=Array.isArray(u.queries)?u.queries:[],y=Array.isArray(u.groupBy)?u.groupBy:[],E=o?l.logs??l.spans:i?l.results:l.series,h=Array.isArray(l.series)?l.series:void 0,S=e===rT?"logs":e===nT?"traces":s?"metrics":typeof u.dataSource=="string"?u.dataSource:void 0;return{...S===void 0?{}:{[U8]:S},[w8]:o?"search":i?"scalar":s?"promql":"timeseries",...typeof d.from=="number"&&typeof d.to=="number"?{[v8]:d.to-d.from}:{},...o?{[WL]:a.query!==void 0&&a.query!=="*"}:{},...o||s?{}:{[WL]:g.some(T=>li(T)&&typeof T.filter=="string"&&T.filter.length>0),[N8]:y.reduce((T,_)=>T+(li(_)&&Array.isArray(_.fields)?_.fields.length:0),0)},...Array.isArray(E)?{[k8]:E.length}:{},...h===void 0?{}:{[L8]:h.length,[M8]:h.reduce((T,_)=>T+(li(_)&&Array.isArray(_.points)?_.points.length:0),0)}}}var oT=[],W0=class extends ph{get traceId(){return sT.traceId}end(t,r){super.end(t,r),oT.push({name:this.name.slice(0,200),kind:this.kind,[zu]:this.spanId,[Gl]:En(this.parent,{onNone:()=>sT.spanId,onSome:o=>o.spanId}),startTimeMs:Number(this.startTime/1000000n),duration_ms:Number(t-this.startTime)/1e6,status_code:iu(r)&&!ja(r.cause)?"error":"unset",attributes:Object.fromEntries([...this.attributes].flatMap(([o,i])=>{let s=zLe(i);return s===void 0?[]:[[o.slice(0,200),s]]}).slice(0,u0))}),oT.length>c0&&oT.shift()}},GX=JP({span:e=>new W0(e)});function DLe(e,t,r){if(yo(e))return{...t,[aa]:Ar.success};if(ja(e.cause))return{...t,[aa]:dA(r),[Bl]:"Interrupted",...r===void 0?{}:{[ZO]:r}};let o=nu(e.cause);if(fA(o))return{...t,[aa]:Ar.usage,[Bl]:"Usage"};if(mA(o)){let i="statusCode"in o?o.statusCode:void 0,s=o._tag==="ApiError"?o.code:void 0;return{...t,[aa]:lA(o),[Bl]:o._tag,...i===void 0?{}:{[WO]:i},...s===void 0?{}:{[QO]:s}}}return{...t,[aa]:Ar.failure,[Bl]:"Unhandled"}}var BX=[["CLAUDECODE","claude-code"],["CLAUDE_CODE_SESSION_ID","claude-code"],["CODEX_THREAD_ID","codex"],["CODEX_SESSION_ID","codex"],["OPENCODE","opencode"],["GEMINI_CLI","gemini-cli"],["CLINE_ACTIVE","cline"],["AGENT","agent"],["AI_AGENT","agent"]],FLe=[...BX.map(([e])=>e),"CI"],$Le=km(Object.fromEntries(FLe.map(e=>[e,Di(e)]))).pipe(Cn);function GLe(e,t,r){let o=e.findIndex(d=>d.startsWith("-")),i=o===-1?[]:e.slice(o,o+a0).map(d=>d.slice(0,Of)),s=e.indexOf("--"),a=(s===-1?e:e.slice(0,s)).includes("--pretty"),u=BX.find(([d])=>t[d])?.[1]??(t.CI?"ci":r?"terminal":"script"),l=BLe(u,t);return{...i.length>0?{[Tf]:i}:{},...a?{[BE]:"pretty"}:{},[jE]:u,...l===void 0?{}:{[XO]:l}}}function BLe(e,t){let r=e==="claude-code"?t.CLAUDE_CODE_SESSION_ID:e==="codex"?t.CODEX_SESSION_ID||t.CODEX_THREAD_ID:void 0;if(!(r===void 0||!/^[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}$/i.test(r)))return(0,iT.createHash)("sha256").update(e).update("\0").update(r.toLowerCase()).digest("hex")}var jX=k(function*(e,t,r,o){let i=yield*Fn;return yield*e.pipe(Wa(s=>jLe(s,{argv:t,root:r,startedAt:i,receivedSignal:o})))}),jLe=v("cli.telemetry.reportRun")(function*(e,t){let[r,o,i]=yield*qa([m0,$Le,Fn]),s=DLe(e,{[$E]:FX(t.argv,t.root),[GE]:i-t.startedAt,...GLe(t.argv,o,r)},t.receivedSignal?.());if(!(yield*qLe(s)))return;let a=yield*(yield*gt).resolveApiUrl,u={...s,[ME]:"1.
|
|
282
|
+
`}),LLe=fl(wi(uc,{space:2}));var MLe=fl(wi(uc)),sT={traceId:(0,iT.randomBytes)(16).toString("hex"),spanId:(0,iT.randomBytes)(8).toString("hex")};function Q0(e,t,r){if(e===jA)return Array.isArray(r)?{[D8]:r.length}:{};let o=e===rT||e===nT,i=e===RA,s=e===HA;if(!(o||i||s||e===PA))return{};let a=t.query??{},u=li(t.body)?t.body:{},l=li(r)?r:{},d=o?a:li(u.timeRange)?u.timeRange:{},g=Array.isArray(u.queries)?u.queries:[],y=Array.isArray(u.groupBy)?u.groupBy:[],E=o?l.logs??l.spans:i?l.results:l.series,h=Array.isArray(l.series)?l.series:void 0,S=e===rT?"logs":e===nT?"traces":s?"metrics":typeof u.dataSource=="string"?u.dataSource:void 0;return{...S===void 0?{}:{[U8]:S},[w8]:o?"search":i?"scalar":s?"promql":"timeseries",...typeof d.from=="number"&&typeof d.to=="number"?{[v8]:d.to-d.from}:{},...o?{[WL]:a.query!==void 0&&a.query!=="*"}:{},...o||s?{}:{[WL]:g.some(T=>li(T)&&typeof T.filter=="string"&&T.filter.length>0),[N8]:y.reduce((T,_)=>T+(li(_)&&Array.isArray(_.fields)?_.fields.length:0),0)},...Array.isArray(E)?{[k8]:E.length}:{},...h===void 0?{}:{[L8]:h.length,[M8]:h.reduce((T,_)=>T+(li(_)&&Array.isArray(_.points)?_.points.length:0),0)}}}var oT=[],W0=class extends ph{get traceId(){return sT.traceId}end(t,r){super.end(t,r),oT.push({name:this.name.slice(0,200),kind:this.kind,[zu]:this.spanId,[Gl]:En(this.parent,{onNone:()=>sT.spanId,onSome:o=>o.spanId}),startTimeMs:Number(this.startTime/1000000n),duration_ms:Number(t-this.startTime)/1e6,status_code:iu(r)&&!ja(r.cause)?"error":"unset",attributes:Object.fromEntries([...this.attributes].flatMap(([o,i])=>{let s=zLe(i);return s===void 0?[]:[[o.slice(0,200),s]]}).slice(0,u0))}),oT.length>c0&&oT.shift()}},GX=JP({span:e=>new W0(e)});function DLe(e,t,r){if(yo(e))return{...t,[aa]:Ar.success};if(ja(e.cause))return{...t,[aa]:dA(r),[Bl]:"Interrupted",...r===void 0?{}:{[ZO]:r}};let o=nu(e.cause);if(fA(o))return{...t,[aa]:Ar.usage,[Bl]:"Usage"};if(mA(o)){let i="statusCode"in o?o.statusCode:void 0,s=o._tag==="ApiError"?o.code:void 0;return{...t,[aa]:lA(o),[Bl]:o._tag,...i===void 0?{}:{[WO]:i},...s===void 0?{}:{[QO]:s}}}return{...t,[aa]:Ar.failure,[Bl]:"Unhandled"}}var BX=[["CLAUDECODE","claude-code"],["CLAUDE_CODE_SESSION_ID","claude-code"],["CODEX_THREAD_ID","codex"],["CODEX_SESSION_ID","codex"],["OPENCODE","opencode"],["GEMINI_CLI","gemini-cli"],["CLINE_ACTIVE","cline"],["AGENT","agent"],["AI_AGENT","agent"]],FLe=[...BX.map(([e])=>e),"CI"],$Le=km(Object.fromEntries(FLe.map(e=>[e,Di(e)]))).pipe(Cn);function GLe(e,t,r){let o=e.findIndex(d=>d.startsWith("-")),i=o===-1?[]:e.slice(o,o+a0).map(d=>d.slice(0,Of)),s=e.indexOf("--"),a=(s===-1?e:e.slice(0,s)).includes("--pretty"),u=BX.find(([d])=>t[d])?.[1]??(t.CI?"ci":r?"terminal":"script"),l=BLe(u,t);return{...i.length>0?{[Tf]:i}:{},...a?{[BE]:"pretty"}:{},[jE]:u,...l===void 0?{}:{[XO]:l}}}function BLe(e,t){let r=e==="claude-code"?t.CLAUDE_CODE_SESSION_ID:e==="codex"?t.CODEX_SESSION_ID||t.CODEX_THREAD_ID:void 0;if(!(r===void 0||!/^[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}$/i.test(r)))return(0,iT.createHash)("sha256").update(e).update("\0").update(r.toLowerCase()).digest("hex")}var jX=k(function*(e,t,r,o){let i=yield*Fn;return yield*e.pipe(Wa(s=>jLe(s,{argv:t,root:r,startedAt:i,receivedSignal:o})))}),jLe=v("cli.telemetry.reportRun")(function*(e,t){let[r,o,i]=yield*qa([m0,$Le,Fn]),s=DLe(e,{[$E]:FX(t.argv,t.root),[GE]:i-t.startedAt,...GLe(t.argv,o,r)},t.receivedSignal?.());if(!(yield*qLe(s)))return;let a=yield*(yield*gt).resolveApiUrl,u={...s,[ME]:"1.164.0",[FE]:process.platform==="win32"?"windows":process.platform,[DE]:process.versions.node,[Hu]:sT.traceId,[zu]:sT.spanId},l=KLe(t.startedAt),d=yield*MLe(l.length>0?{...u,spans:l}:u).pipe(Cn),g=yield*Ui(process.execPath,["-e",WLe,`${a}${T7.url}`,YLe(d,u)],{detached:!0,windowsHide:!0,stdin:"ignore",stdout:"ignore",stderr:"ignore"});yield*Ka(g.unref)},e=>e.pipe(to,za)),qLe=k(function*(e){let t=yield*Z0;if(t!==void 0)return t;let r=yield*gt,o=yield*r.getTelemetryConsent;if(o!==void 0)return o;if(!(yield*m0)||e[aa]!==0)return!1;yield*Yn(HLe);let i=yield*oo(Fy({message:"Send usage data?"}));return yield*r.saveTelemetryConsent(i),i}),Z0=Di("TSUGA_TELEMETRY").pipe(hl(e=>e===void 0?void 0:["1","true"].includes(e.toLowerCase())),Cn),HLe="\nHelp improve the Tsuga CLI by sending usage data.\nChange it later with `tsuga config set telemetry on|off`.";function KLe(e){let t=new Set(oT.map(r=>r[zu]));return oT.map(({startTimeMs:r,...o})=>({...o,[Gl]:t.has(o[Gl])?o[Gl]:sT.spanId,start_offset_ms:Math.max(0,r-e)}))}function zLe(e){if(typeof e=="boolean"||typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="bigint")return Number(e);if(typeof e=="string")return e.slice(0,Of);try{return JSON.stringify(e)?.slice(0,Of)}catch{return}}var $X=process.platform==="win32"?15e3:1e5;function YLe(e,t){if(Buffer.byteLength(e)<=$X)return e;let r=JSON.stringify(t);return Buffer.byteLength(r)<=$X?r:JSON.stringify({...t,[Tf]:void 0})}var VLe=()=>{let[e="",t=""]=process.argv.slice(1);fetch(e,{method:"POST",headers:{"content-type":"application/json"},body:t,signal:AbortSignal.timeout(1e4)}).catch(()=>{})},WLe=`(${VLe.toString()})()`;function qX(e){return e.message.includes(tX)}var HX=["Choose a default cluster: tsuga config set default cluster --value <CLUSTER_ID>","Override it for one command: tsuga --cluster <CLUSTER_ID> <COMMAND>","Set an environment override: export TSUGA_CLUSTER_ID=<CLUSTER_ID>"];function KX(e){let t=e.map(r=>` ${r.id} ${r.friendlyName??r.name}`);return t.length>0?["","Available clusters:",...t].join(`
|
|
283
283
|
`):""}var zX={CLUSTER_AGGREGATION_STRUCTURE:["Compare the body with a generated one: tsuga aggregation <scalar|timeseries> --generate-skeleton"],TAG_POLICY_ALREADY_EXISTS_ERROR:["Find the existing policy ID with tsuga tag-policies list, then run tsuga tag-policies update <ID> -f policy.json"],URL_NOT_FOUND:["Update the CLI: tsuga self-update"]};function YX(e){return e!==void 0&&Object.hasOwn(zX,e)?zX[e]??[]:[]}function QLe(e){return e.replace(/\s+/g," ").replace(/[^\x20-\x7e\x80-\xff]/g,"").trim()}function ZLe({body:e,query:t}){let r=t?.offset??e?.offset,o=typeof r=="string"?Number(r):r;return typeof o=="number"&&Number.isSafeInteger(o)&&o>=0?o:0}var XLe=un({data:Tt(uc),requestId:Tt(ye),error:Tt(un({message:ye,statusCode:Tt(lc),code:Tt(ye),details:Tt(uc),hint:Tt(ye),docUrl:Tt(ye)})),metadata:Tt(un({pagination:Tt(un({totalCount:lc,pageCount:Tt(lc)}))}))}),JLe=Lo(XLe);function e0e(e,t,r){let o=e.metadata?.pagination,i=o===void 0?void 0:WX(e.data);if(o===void 0||i===void 0)return;let s=t+i.length;if(!(s>=o.totalCount))return`Showing ${i.length} of ${o.totalCount} (offset ${t}). Next page: ${t0e(r,i.length,s)}`}function WX(e){if(Array.isArray(e))return e;let t=e!==null&&typeof e=="object"?Object.values(e):[],[r]=t;return t.length===1&&Array.isArray(r)?r:void 0}function t0e(e,t,r){let o=[];for(let i=0;i<e.length;i++){let s=e[i]??"";if(s==="--operation-api-key"){o.push(s,"<OPERATION_API_KEY>"),i++;continue}if(s.startsWith("--operation-api-key=")){o.push("--operation-api-key=<OPERATION_API_KEY>");continue}if(s==="--limit"||s==="--offset"){i++;continue}s.startsWith("--limit=")||s.startsWith("--offset=")||o.push(s)}return["tsuga",...o,"--limit",String(t),"--offset",String(r)].map(r0e).join(" ")}function r0e(e){return/^[\w./:=@%+,-]+$/.test(e)?e:`'${e.replace(/'/g,"'\\''")}'`}function n0e(e,t){let r=Math.round(t/ql);switch(e){case 504:return new Vu({message:`The API gave up on the request after ${r}s (HTTP 504): it ran longer than the gateway allows.`,statusCode:e,suggestions:["Narrow the time range or add filters to the query","Ask for fewer results"]});case 502:case 503:return new Vu({message:`The API gateway could not reach the server (HTTP ${e}).`,statusCode:e,suggestions:["Retry in a few seconds"]});default:return new Vu({message:`Server returned a non-JSON response (HTTP ${e}).`,statusCode:e})}}var VX=v("api.endpoint")(function*(e,t={}){yield*Qa(Q0(e,t,void 0));let{data:r,metadata:o}=t.allPages?yield*o0e(e,t):yield*QX(e,t).pipe(Ms(i=>pt(function*(){let s=e0e(i,ZLe(t),yield*H7);s!==void 0&&(yield*Yn(s))})));return yield*Qa(Q0(e,t,r)),{data:r,metadata:o}}),o0e=k(function*(e,t){if(i0e(t))return yield*new It({message:"--all cannot be combined with --limit or --offset"});let r=[];for(;;){let o=yield*QX(e,s0e(e,t,r.length)),i=WX(o.data),s=o.metadata?.pagination?.totalCount;if(i===void 0||s===void 0)return o;if(r.push(...i),i.length===0||r.length>=s)return{data:a0e(o.data,r),metadata:{pagination:{totalCount:r.length,pageCount:1}}}}});function i0e({body:e,query:t}){let r=e??{};return[t?.limit,t?.offset,r.limit,r.offset].some(o=>o!==void 0)}function s0e(e,t,r){let o={limit:qu,offset:r};return e.body!==void 0&&n.IsObject(e.body)&&"offset"in e.body.properties?{...t,body:{...t.body,...o}}:{...t,query:{...t.query,...o}}}function a0e(e,t){if(Array.isArray(e))return t;let[r]=Object.keys(e);return{[r??"data"]:t}}var QX=k(function*(e,t){let r=yield*pa,o=yield*gt,i=yield*Cl,s=yield*o.resolve({operationApiKey:r.operationApiKey,clusterId:r.cluster}),{credential:a}=s;if(a===void 0)return yield*new Yu({message:"No credentials.",suggestions:gA});let u=a.kind==="operation-api-key"?a.token:(yield*BA(s.apiUrl,a.userAuth)).accessToken,l=r.rationale?QLe(r.rationale):"",d=yield*zZ(s.apiUrl,"cli",e,s.clusterId===void 0?t:u0e(e,t,s.clusterId),{Authorization:`Bearer ${u}`,...l?{[w0]:l}:{}}),g=yield*Fn,y=yield*i.execute(d).pipe(ht(S=>new ua({message:`Could not reach ${s.apiUrl}`,cause:S}))),E=(yield*Fn)-g,h=yield*y.json.pipe(H(JLe),ht(()=>n0e(y.status,E)));if(yield*Zj("API response").pipe(Xj({method:d.method,url:d.url,status:y.status,requestId:h.requestId})),h.error){let S=h.error.statusCode??y.status,T;S===401?T=[`Replace the rejected credential: ${a.kind==="operation-api-key"?c0e[a.source]:"tsuga auth login"}`]:S===403?T=[`Inspect your identity and permissions: ${r.operationApiKey?"tsuga --operation-api-key <OPERATION_API_KEY> auth whoami":"tsuga auth whoami"}`]:T=YX(h.error.code);let{hint:_,docUrl:I}=h.error,b=[...T,..._?[_]:[],...I?[`See ${I}`]:[]];return yield*ys.fromErrorResponse({...h.error,...b.length>0?{suggestions:b}:{}},h.requestId)}return h}),c0e={flag:"tsuga --operation-api-key <OPERATION_API_KEY> <COMMAND>",environment:"export TSUGA_OPERATION_API_KEY=<OPERATION_API_KEY>",config:"tsuga auth operation-key <OPERATION_API_KEY>"},Xt=k(function*(e,t={}){return(yield*tt(e,t)).data}),tt=k(function*(e,t={}){return yield*VX(e,t).pipe(ti("ApiError",r=>pt(function*(){if(!qX(r))return yield*r;let o=yield*VX(FA).pipe(te(i=>i.data),ri(()=>[]));return yield*ys.fromErrorResponse({message:`${r.message}${KX(o)}`,statusCode:r.statusCode,code:r.code,details:r.details,suggestions:HX},r.requestId)})))});function u0e(e,t,r){return e.body!==void 0&&n.IsObject(e.body)&&"clusterId"in e.body.properties?{...t,body:{clusterId:r,...t.body}}:{...t,query:{clusterId:r,...t.query}}}var p0e="Provide a request body with -f <FILE_PATH> or -d <JSON>. Use --generate-skeleton to get a template.",X0=(e,t)=>lt({try:()=>JSON.parse(t),catch:r=>new It({message:`${e} is not valid JSON: ${r instanceof Error?r.message:String(r)}`})}),rd=k(function*(e){if(Rt(e.file)&&Rt(e.data))return yield*new It({message:"-f and -d cannot be combined. Provide the request body with one of them."});let t=oe(e.file);if(t!==void 0){if(t==="-"){let s=yield*Rm,a=yield*el(s.stdin).pipe(tl,ht(u=>new It({message:`Could not read stdin: ${u.message}`})));return yield*X0("stdin",a)}let i=yield*(yield*Jr).readFileString(t).pipe(ht(s=>new It({message:`Could not read ${t}: ${s.message}`})));return yield*X0(t,i)}let r=oe(e.data);return r!==void 0?yield*X0("--data",r):yield*new It({message:p0e})});function WA(e){return c.HasPropertyKey(e,"~refine")&&c.IsArray(e["~refine"])&&c.Every(e["~refine"],0,t=>c.IsObject(t)&&c.HasPropertyKey(t,"check")&&c.HasPropertyKey(t,"error")&&c.IsFunction(t.check)&&c.IsFunction(t.error))}function Co(e){return c.IsObject(e)&&!c.IsArray(e)}function nd(e){return c.IsBoolean(e)}function Ae(e){return Co(e)||nd(e)}function QA(e){return c.HasPropertyKey(e,"additionalItems")&&Ae(e.additionalItems)}function da(e){return c.HasPropertyKey(e,"additionalProperties")&&Ae(e.additionalProperties)}function ZA(e){return c.HasPropertyKey(e,"allOf")&&c.IsArray(e.allOf)&&e.allOf.every(t=>Ae(t))}function ZX(e){return c.HasPropertyKey(e,"$anchor")&&c.IsString(e.$anchor)}function XA(e){return c.HasPropertyKey(e,"anyOf")&&c.IsArray(e.anyOf)&&e.anyOf.every(t=>Ae(t))}function J0(e){return c.HasPropertyKey(e,"const")}function ep(e){return c.HasPropertyKey(e,"contains")&&Ae(e.contains)}function di(e){return c.HasPropertyKey(e,"default")}function eM(e){return c.HasPropertyKey(e,"dependencies")&&c.IsObject(e.dependencies)&&Object.values(e.dependencies).every(t=>Ae(t)||c.IsArray(t)&&t.every(r=>c.IsString(r)))}function tM(e){return c.HasPropertyKey(e,"dependentRequired")&&c.IsObject(e.dependentRequired)&&Object.values(e.dependentRequired).every(t=>c.IsArray(t)&&t.every(r=>c.IsString(r)))}function JA(e){return c.HasPropertyKey(e,"dependentSchemas")&&c.IsObject(e.dependentSchemas)&&Object.values(e.dependentSchemas).every(t=>Ae(t))}function tp(e){return c.HasPropertyKey(e,"$dynamicAnchor")&&c.IsString(e.$dynamicAnchor)}function eC(e){return c.HasPropertyKey(e,"$dynamicRef")&&c.IsString(e.$dynamicRef)}function tC(e){return c.HasPropertyKey(e,"else")&&Ae(e.else)}function rM(e){return c.HasPropertyKey(e,"enum")&&c.IsArray(e.enum)}function nM(e){return c.HasPropertyKey(e,"exclusiveMaximum")&&(c.IsNumber(e.exclusiveMaximum)||c.IsBigInt(e.exclusiveMaximum))}function Pc(e){return c.HasPropertyKey(e,"exclusiveMinimum")&&(c.IsNumber(e.exclusiveMinimum)||c.IsBigInt(e.exclusiveMinimum))}function aT(e){return c.HasPropertyKey(e,"format")&&c.IsString(e.format)}function uo(e){return c.HasPropertyKey(e,"$id")&&c.IsString(e.$id)}function rC(e){return c.HasPropertyKey(e,"if")&&Ae(e.if)}function od(e){return c.HasPropertyKey(e,"items")&&(Ae(e.items)||c.IsArray(e.items)&&e.items.every(t=>Ae(t)))}function nC(e){return od(e)&&c.IsArray(e.items)}function oM(e){return c.HasPropertyKey(e,"maximum")&&(c.IsNumber(e.maximum)||c.IsBigInt(e.maximum))}function iM(e){return c.HasPropertyKey(e,"maxContains")&&c.IsNumber(e.maxContains)}function oC(e){return c.HasPropertyKey(e,"maxItems")&&c.IsNumber(e.maxItems)}function sM(e){return c.HasPropertyKey(e,"maxLength")&&c.IsNumber(e.maxLength)}function aM(e){return c.HasPropertyKey(e,"maxProperties")&&c.IsNumber(e.maxProperties)}function Uc(e){return c.HasPropertyKey(e,"minimum")&&(c.IsNumber(e.minimum)||c.IsBigInt(e.minimum))}function id(e){return c.HasPropertyKey(e,"minContains")&&c.IsNumber(e.minContains)}function Bf(e){return c.HasPropertyKey(e,"minItems")&&c.IsNumber(e.minItems)}function cT(e){return c.HasPropertyKey(e,"minLength")&&c.IsNumber(e.minLength)}function uT(e){return c.HasPropertyKey(e,"minProperties")&&c.IsNumber(e.minProperties)}function cM(e){return c.HasPropertyKey(e,"multipleOf")&&(c.IsNumber(e.multipleOf)||c.IsBigInt(e.multipleOf))}function iC(e){return c.HasPropertyKey(e,"not")&&Ae(e.not)}function sC(e){return c.HasPropertyKey(e,"oneOf")&&c.IsArray(e.oneOf)&&e.oneOf.every(t=>Ae(t))}function pT(e){return c.HasPropertyKey(e,"pattern")&&(c.IsString(e.pattern)||e.pattern instanceof RegExp)}function jf(e){return c.HasPropertyKey(e,"patternProperties")&&c.IsObject(e.patternProperties)&&Object.values(e.patternProperties).every(t=>Ae(t))}function sd(e){return c.HasPropertyKey(e,"prefixItems")&&c.IsArray(e.prefixItems)&&e.prefixItems.every(t=>Ae(t))}function qf(e){return c.HasPropertyKey(e,"properties")&&c.IsObject(e.properties)&&Object.values(e.properties).every(t=>Ae(t))}function aC(e){return c.HasPropertyKey(e,"propertyNames")&&(c.IsObject(e.propertyNames)||Ae(e.propertyNames))}function l0e(e){return c.HasPropertyKey(e,"$recursiveAnchor")&&c.IsBoolean(e.$recursiveAnchor)}function lT(e){return l0e(e)&&c.IsEqual(e.$recursiveAnchor,!0)}function cC(e){return c.HasPropertyKey(e,"$recursiveRef")&&c.IsString(e.$recursiveRef)}function uC(e){return c.HasPropertyKey(e,"$ref")&&c.IsString(e.$ref)}function ad(e){return c.HasPropertyKey(e,"required")&&c.IsArray(e.required)&&e.required.every(t=>c.IsString(t))}function pC(e){return c.HasPropertyKey(e,"then")&&Ae(e.then)}function uM(e){return c.HasPropertyKey(e,"type")&&(c.IsString(e.type)||c.IsArray(e.type)&&e.type.every(t=>c.IsString(t)))}function Hf(e){return c.HasPropertyKey(e,"uniqueItems")&&c.IsBoolean(e.uniqueItems)}function dT(e){return c.HasPropertyKey(e,"unevaluatedItems")&&Ae(e.unevaluatedItems)}function mT(e){return c.HasPropertyKey(e,"unevaluatedProperties")&&Ae(e.unevaluatedProperties)}var po=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}},Ln=class extends po{constructor(){super(),this.errors=[]}AtCapacity(){return this.errors.length>=Br.Get().maxErrors}AddError(t,r,o,i){return this.AddErrorObject({keyword:t,schemaPath:r,instancePath:o,params:i})}AddErrors(t){return t.forEach(r=>this.AddErrorObject(r)),!1}GetErrors(){return this.errors}AddErrorObject(t){return this.AtCapacity()||this.errors.push(t),!1}};function XX(e,t,r,o){return c.Every(r["~refine"],0,(i,s)=>i.check(o))}function JX(e,t,r,o,i,s){return c.EveryAll(i["~refine"],0,(a,u)=>a.check(s)||t.AddError("~refine",r,o,{index:u,message:a.error(s)}))}var fT="urn:typebox:root";function wc(e,t){return URL.canParse(e,t)?new URL(e,t):c.IsEqual(t,fT)?new URL(`${t}:${e}`):new URL(`${t.slice(0,t.lastIndexOf(":"))}:${e}`)}function zf(e,t){let r=Co(t)&&uo(t)?wc(t.$id,fT).href:fT;return{context:e,schema:t,lexicalSchema:t,lexicalBase:r,resourceBase:r,referenceBase:r,ids:[],useResourceBaseForReference:!0,recursiveAnchor:void 0,dynamicAnchors:[],resourceEntries:new Map,pendingResource:!0,enteredResource:!1}}function pM(e,t,r=!0){if(nd(t))return e;if(Array.isArray(t))return t.reduce((i,s)=>pM(i,s,!1),e);if(!Co(t)||!r&&uo(t))return e;let o=!r&&tp(t)?[...e,t]:e;return Object.keys(t).reduce((i,s)=>pM(i,t[s],!1),o)}function gT(e,t){return e.resourceEntries.get(t)}function eJ(e,t){return e.enteredResource||gT(e,t)!==void 0}function d0e(e){return!/^[A-Za-z][A-Za-z0-9+.-]*:/.test(e.$id)}function m0e(e,t){return uo(t)?[...e.ids,t]:e.ids}function f0e(e,t){return e.recursiveAnchor??(lT(t)?t:void 0)}function g0e(e,t){let r=uo(t)?pM(e.dynamicAnchors,t):e.dynamicAnchors;return tp(t)?[...r,t]:r}function h0e(e,t){return uo(t)?!1:e.pendingResource}function tJ(e,t){let r=gT(e,t);return r?r.base:uo(t)?wc(t.$id,e.lexicalBase).href:e.lexicalBase}function rJ(e,t){let r=gT(e,t);return r?r.base:uo(t)&&e.pendingResource?wc(t.$id,e.resourceBase).href:e.resourceBase}function nJ(e,t){return uo(t)?!d0e(t):e.useResourceBaseForReference}function y0e(e,t){let r=eJ(e,t),o=nJ(e,t);return r||o?rJ(e,t):tJ(e,t)}function E0e(e,t){let r=gT(e,t);return r?r.root:uo(t)?t:e.lexicalSchema}function T0e(e,t){return Co(t)&&(uo(t)||tp(t)||c.IsUndefined(e.recursiveAnchor)&&lT(t)||!c.IsUndefined(gT(e,t)))}function Yf(e,t){return T0e(e,t)?{...e,ids:m0e(e,t),dynamicAnchors:g0e(e,t),recursiveAnchor:f0e(e,t),pendingResource:h0e(e,t),lexicalBase:tJ(e,t),resourceBase:rJ(e,t),useResourceBaseForReference:nJ(e,t),referenceBase:y0e(e,t),lexicalSchema:E0e(e,t),enteredResource:eJ(e,t)}:e}function oJ(e){return od(e)&&c.IsArray(e.items)}function iJ(e,t,r,o){return oJ(r)?c.Every(o,0,(s,a)=>c.IsLessThan(a,r.items.length)||mi(e,t,r.additionalItems,s)&&t.AddIndex(a)):!0}function sJ(e,t,r,o,i,s){return oJ(i)?c.Every(s,0,(u,l)=>{let d=`${r}/additionalItems`,g=`${o}/${l}`;return c.IsLessThan(l,i.items.length)||fi(e,t,d,g,i.additionalItems,u)&&t.AddIndex(l)}):!0}function qo(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function rp(e){return new RegExp(e,"u")}function S0e(e){return`^${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}$`}function aJ(e){let t=[];return jf(e)&&t.push(...c.Keys(e.patternProperties)),qf(e)&&t.push(...c.Keys(e.properties).map(S0e)),c.IsEqual(t.length,0)?"(?!)":`(${t.join("|")})`}function cJ(e,t,r,o){let i=rp(aJ(r));return c.Every(c.Keys(o),0,(a,u)=>i.test(a)||mi(e,t,r.additionalProperties,o[a])&&t.AddKey(a))}function uJ(e,t,r,o,i,s){let a=rp(aJ(i)),u=[];return c.EveryAll(c.Keys(s),0,(d,g)=>{let y=`${r}/additionalProperties`,E=`${o}/${qo(d)}`,h=a.test(d)||fi(e,t,y,E,i.additionalProperties,s[d])&&t.AddKey(d);return h||u.push(d),h})||t.AddError("additionalProperties",r,o,{additionalProperties:u})}function pJ(e,t,r,o){let i=r.allOf.reduce((s,a)=>{let u=new po;return st(e,u,a,o)?[...s,u]:s},[]);return c.IsEqual(i.length,r.allOf.length)&&t.Merge(i)}function lJ(e,t,r,o,i,s){let a=[],u=i.allOf.reduce((d,g,y)=>{let E=`${r}/allOf/${y}`,h=new Ln,S=Ft(e,h,E,o,g,s);return S||a.push(h),S?[...d,h]:d},[]),l=c.IsEqual(u.length,i.allOf.length)&&t.Merge(u);return l||a.forEach(d=>t.AddErrors(d.GetErrors())),l}function dJ(e,t,r,o){let i=r.anyOf.reduce((s,a)=>{let u=new po;return st(e,u,a,o)?[...s,u]:s},[]);return c.IsGreaterThan(i.length,0)&&t.Merge(i)}function mJ(e,t,r,o,i,s){let a=[],u=i.anyOf.reduce((d,g,y)=>{let E=new Ln,h=`${r}/anyOf/${y}`,S=Ft(e,E,h,o,g,s);return S||a.push(E),S?[...d,E]:d},[]),l=c.IsGreaterThan(u.length,0)&&t.Merge(u);return l||a.forEach(d=>t.AddErrors(d.GetErrors())),l||t.AddError("anyOf",r,o,{})}function mM(e,t,r,o){return r}function fJ(e,t,r,o,i,s){return mM(e,t,i,s)||t.AddError("boolean",r,o,{})}function fM(e,t,r,o){return c.IsValueLike(r.const)?c.IsEqual(o,r.const):c.IsDeepEqual(o,r.const)}function gJ(e,t,r,o,i,s){return fM(e,t,i,s)||t.AddError("const",r,o,{allowedValue:i.const})}function _0e(e){return!(id(e)&&c.IsEqual(e.minContains,0))}function gM(e,t,r,o){return _0e(r)?!c.IsEqual(o.length,0)&&c.SomeAll(o,(i,s)=>st(e,t,r.contains,i)&&t.AddIndex(s)):!0}function hJ(e,t,r,o,i,s){return gM(e,t,i,s)||t.AddError("contains",r,o,{minContains:1})}function yJ(e,t,r,o){let i=c.IsEqual(c.Keys(o).length,0),s=c.Every(c.Entries(r.dependencies),0,([a,u])=>!c.HasPropertyKey(o,a)||(c.IsArray(u)?u.every(l=>c.HasPropertyKey(o,l)):st(e,t,u,o)));return i||s}function EJ(e,t,r,o,i,s){let a=c.IsEqual(c.Keys(s).length,0),u=c.EveryAll(c.Entries(i.dependencies),0,([l,d])=>{let g=`${r}/dependencies/${qo(l)}`;return!c.HasPropertyKey(s,l)||(c.IsArray(d)?d.every(y=>c.HasPropertyKey(s,y)||t.AddError("dependencies",r,o,{property:l,dependencies:d})):Ft(e,t,g,o,d,s))});return a||u}function TJ(e,t,r,o){let i=c.IsEqual(c.Keys(o).length,0),s=c.Every(c.Entries(r.dependentRequired),0,([a,u])=>!c.HasPropertyKey(o,a)||u.every(l=>c.HasPropertyKey(o,l)));return i||s}function SJ(e,t,r,o,i,s){let a=c.IsEqual(c.Keys(s).length,0),u=c.EveryAll(c.Entries(i.dependentRequired),0,([l,d])=>!c.HasPropertyKey(s,l)||c.EveryAll(d,0,g=>c.HasPropertyKey(s,g)||t.AddError("dependentRequired",r,o,{property:l,dependencies:d})));return a||u}function _J(e,t,r,o){let i=c.IsEqual(c.Keys(o).length,0),s=c.Every(c.Entries(r.dependentSchemas),0,([a,u])=>!c.HasPropertyKey(o,a)||st(e,t,u,o));return i||s}function IJ(e,t,r,o,i,s){let a=c.IsEqual(c.Keys(s).length,0),u=c.EveryAll(c.Entries(i.dependentSchemas),0,([l,d])=>{let g=`${r}/dependentSchemas/${qo(l)}`;return!c.HasPropertyKey(s,l)||Ft(e,t,g,o,d,s)});return a||u}var Gi={};yi(Gi,{DynamicRef:()=>X0e,RecursiveRef:()=>W0e,Ref:()=>Y0e});var Wf={};yi(Wf,{Delete:()=>O0e,Get:()=>b0e,Has:()=>I0e,Indices:()=>yT,Set:()=>x0e});function xJ(e){throw Error(e)}function bJ(){xJ("Pointer contains unsafe property key")}function hM(){xJ("Cannot set value")}function yT(e){let t=e.split("/").map(r=>r.replace(/~1/g,"/").replace(/~0/g,"~"));return t[0]===""?t.slice(1):t}function I0e(e,t){let r=e;for(let o of yT(t)){if(!c.IsObject(r)||!c.HasPropertyKey(r,o))return!1;r=r[o]}return!0}function b0e(e,t){let r=e;for(let o of yT(t)){if(!c.IsObject(r)||c.IsUnsafePropertyKey(o))return;r=r[o]}return r}function OJ(e,t,r){let o=e;for(let i of t)c.IsUnsafePropertyKey(i)&&bJ(),o=c.IsObject(o)?o[i]:void 0;return c.IsUnsafePropertyKey(r)&&bJ(),c.IsObject(o)||hM(),o}function x0e(e,t,r){let o=yT(t),i=o.pop();return c.IsUndefined(i)&&hM(),OJ(e,o,i)[i]=r,e}function O0e(e,t){let r=yT(t),o=r.pop();c.IsUndefined(o)&&hM();let i=OJ(e,r,o);return c.IsArray(i)&&/^(0|[1-9]\d*)$/.test(o)?i.splice(Number(o),1):delete i[o],e}function TM(e,t){return Co(e)&&uo(e)?wc(e.$id,t.href):t}function SM(e){return wc(e,fT)}function yM(e){return e.href.split("#")[0]}function A0e(e,t,r){return EM(e,SM(t),r)}function C0e(e,t){return t.$ref.startsWith("#")||e.enteredResource?e.lexicalSchema:e.schema}function R0e(e){return e.startsWith("#/")}function AJ(e,t){if(c.IsObject(e)&&tp(e)&&c.IsEqual(e.$dynamicAnchor,t))return e;if(c.IsObject(e))for(let r of c.Keys(e)){let o=AJ(e[r],t);if(o)return o}}function EM(e,t,r){if(c.IsEqual(e,r))return t.href;let o=TM(e,t);if(c.IsArray(e))for(let i of e){let s=EM(i,o,r);if(!c.IsUndefined(s))return s}else if(c.IsObject(e))for(let i of c.Keys(e)){let s=EM(e[i],o,r);if(!c.IsUndefined(s))return s}}function CJ(e,t){if(t.href.endsWith("#"))return e;if(!t.hash.startsWith("#"))return;let r=decodeURIComponent(t.hash.slice(1));if(r.startsWith("/"))return Wf.Get(e,r)}function P0e(e,t,r){if(!uo(e))return;if(c.IsEqual(e.$id,r.hash))return e;let o=new URL(r.href,t.href);if(c.IsEqual(t.pathname,o.pathname))return r.hash.startsWith("#")?CJ(e,r):e}function U0e(e,t,r){if(!ZX(e))return;let o=new URL(`#${e.$anchor}`,t.href),i=new URL(r.href,t.href);return c.IsEqual(o.href,i.href)?e:void 0}function w0e(e,t,r){if(!tp(e))return;let o=new URL(`#${e.$dynamicAnchor}`,t.href),i=new URL(r.href,t.href);return c.IsEqual(o.href,i.href)?e:void 0}function v0e(e,t,r){if(Co(e))return P0e(e,t,r)??U0e(e,t,r)??w0e(e,t,r)??CJ(e,r)}function N0e(e,t,r){if(c.IsArray(e))return e.reduce((o,i)=>{let s=lC(i,t,r);return c.IsUndefined(s)?o:s},void 0)}function k0e(e,t,r){if(c.IsObject(e))return c.Keys(e).reduce((o,i)=>{if(c.IsEqual(i,"const")||c.IsEqual(i,"enum"))return o;let s=lC(e[i],t,r);return c.IsUndefined(s)?o:s},void 0)}function lC(e,t,r){let o=TM(e,t);return v0e(e,o,r)??N0e(e,o,r)??k0e(e,o,r)}function L0e(e,t,r,o){let i=dC(e,t,r,o);return Co(i)&&uo(i)?i:void 0}function M0e(e,t,r){if(!t.$ref.startsWith("#")||!Co(e.schema)||c.HasPropertyKey(e.schema,"$schema"))return;let o=A0e(e.lexicalSchema,e.referenceBase,r);if(!(c.IsUndefined(o)||c.IsEqual(o,e.referenceBase)))return{target:r,base:o,root:e.lexicalSchema}}function D0e(e,t,r){let o=e.context[t];if(Co(o))return{target:r,base:t,root:o}}function F0e(e,t,r,o,i){let s=i?D0e(e,o,r):void 0;return c.IsUndefined(s)?M0e(e,t,r):s}function $0e(e,t,r){if(uo(r))return;let o=L0e(e.context,e.schema,e.referenceBase,t);if(!(!o||e.ids.includes(o)))return{resource:o}}function G0e(e,t){return c.HasPropertyKey(e,t)?e[t]:void 0}function B0e(e,t,r){return lC(e,t,r)}function j0e(e,t,r){let o=yM(r);if(!c.HasPropertyKey(e,o)||c.IsEqual(o,yM(t)))return;let i=e[o],s=TM(i,new URL(o));return c.IsEqual(r.hash,"")?i:lC(i,s,r)}function dC(e,t,r,o){let i=SM(r),s=wc(o,i.href);return G0e(e,o)??B0e(t,i,s)??j0e(e,i,s)}function q0e(e,t){if(!t)return e;let r=new Map(e.resourceEntries);return r.set(t.target,{base:t.base,root:t.root}),{...e,resourceEntries:r}}function H0e(e,t){return t?Yf(e,t.resource):e}function RJ(e,t,r,o){let i=q0e({...e,pendingResource:t},r);return H0e(i,o)}function K0e(e,t,r){let o=yM(wc(t.$ref,e.referenceBase)),i=!c.IsEqual(o,e.resourceBase),s=F0e(e,t,r,o,i),a=i?$0e(e,o,r):void 0;return{schema:r,stack:RJ(e,!0,s,a)}}function z0e(e,t){return{schema:t,stack:RJ(e,!c.IsUndefined(t))}}function Y0e(e,t){let r=dC(e.context,C0e(e,t),e.referenceBase,t.$ref);return Co(r)?K0e(e,t,r):z0e(e,r)}function V0e(e){return Co(e.lexicalSchema)&&lT(e.lexicalSchema)}function W0e(e,t){let r=V0e(e)?e.recursiveAnchor:e.lexicalSchema;return dC(e.context,r,e.lexicalBase,t.$recursiveRef)}function PJ(e,t){return wc(t.$dynamicRef,SM(e.lexicalBase).href).hash}function UJ(e,t){return e.dynamicAnchors.find(r=>c.IsEqual(r.$dynamicAnchor,t))??AJ(e.schema,t)}function Q0e(e,t,r){if(!Co(r)||!tp(r))return r;let o=PJ(e,t);return R0e(o)?r:UJ(e,r.$dynamicAnchor)}function Z0e(e,t){let r=PJ(e,t);return UJ(e,decodeURIComponent(r.slice(1)))}function X0e(e,t){let r=t.$dynamicRef.startsWith("#")?e.lexicalSchema:e.schema,o=dC(e.context,r,e.lexicalBase,t.$dynamicRef);return c.IsUndefined(o)?Z0e(e,t):Q0e(e,t,o)}function wJ(e,t,r,o){let i=Gi.DynamicRef(e,r)??!1,s=i?{...e,pendingResource:!0}:e;return Ae(i)&&st(s,t,i,o)}function vJ(e,t,r,o,i,s){let a=Gi.DynamicRef(e,i)??!1,u=a?{...e,pendingResource:!0}:e;return Ae(a)&&Ft(u,t,r,o,a,s)}function bM(e,t,r,o){return c.Some(r.enum,i=>c.IsValueLike(i)?c.IsEqual(o,i):c.IsDeepEqual(o,i))}function NJ(e,t,r,o,i,s){return bM(e,t,i,s)||t.AddError("enum",r,o,{allowedValues:i.enum})}function xM(e,t,r,o){return c.IsLessThan(o,r.exclusiveMaximum)}function kJ(e,t,r,o,i,s){return xM(e,t,i,s)||t.AddError("exclusiveMaximum",r,o,{comparison:"<",limit:i.exclusiveMaximum})}function OM(e,t,r,o){return c.IsGreaterThan(o,r.exclusiveMinimum)}function LJ(e,t,r,o,i,s){return OM(e,t,i,s)||t.AddError("exclusiveMinimum",r,o,{comparison:">",limit:i.exclusiveMinimum})}var _T={};yi(_T,{Clear:()=>cee,Entries:()=>BMe,Get:()=>HMe,Has:()=>qMe,IsDate:()=>Qf,IsDateTime:()=>mC,IsDuration:()=>fC,IsEmail:()=>gC,IsHostname:()=>bC,IsIPv4:()=>AC,IsIPv6:()=>CC,IsIdnEmail:()=>xC,IsIdnHostname:()=>OC,IsIri:()=>PC,IsIriReference:()=>RC,IsJsonPointer:()=>wC,IsJsonPointerUriFragment:()=>UC,IsRegex:()=>vC,IsRelativeJsonPointer:()=>NC,IsTime:()=>Zf,IsUri:()=>MC,IsUriReference:()=>kC,IsUriTemplate:()=>LC,IsUrl:()=>DC,IsUuid:()=>FC,Reset:()=>uee,Set:()=>jMe,Test:()=>KMe});var J0e=[0,31,28,31,30,31,30,31,31,30,31,30,31],eMe=/^(\d\d\d\d)-(\d\d)-(\d\d)$/;function tMe(e){return e%4===0&&(e%100!==0||e%400===0)}function Qf(e){let t=eMe.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&&tMe(r)?29:J0e[o])}var rMe=/^(\d\d):(\d\d):(\d\d)(?:\.\d+)?(?:([Zz])|([+-])(\d\d):(\d\d))?$/;function Zf(e,t=!0){let r=rMe.exec(e);if(!r||t&&!r[4]&&!r[5])return!1;let o=+r[1],i=+r[2],s=+r[3];if(o>23||i>59||s>60)return!1;if(r[5]){let g=+r[6],y=+r[7];if(g>23||y>59)return!1}if(s<60)return!0;let a=r[5]==="-"?-1:1,u=+(r[6]||0),l=+(r[7]||0);return((o*60+i-a*(u*60+l))%1440+1440)%1440===1439}var nMe=/^(?:\[!?(?:(?!\.{1,2}[/\]])[A-Za-z._][A-Za-z._0-9+-]{0,13}(?:\/(?!\.{1,2}[/\]])[A-Za-z._][A-Za-z._0-9+-]{0,13})*|[+-](?:[01][0-9]|2[0-3]):[0-5][0-9])\](?:\[!?[a-z_][a-z_0-9-]*=[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*\])*|(?:\[!?[a-z_][a-z_0-9-]*=[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*\])*)$/;function mC(e){let t=e.indexOf("["),r=t===-1?e:e.slice(0,t);if(t!==-1&&!nMe.test(e.slice(t)))return!1;let o=r.split(/T/i);return o.length===2&&Qf(o[0])&&Zf(o[1])}var oMe=/^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 fC(e){return oMe.test(e)}var iMe=/^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[^"\\]|\\[\x20-\x7e])*")@(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*|\[(?:IPv6:[a-f0-9:]+|(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(?:\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3})\])$/i;function gC(e){return iMe.test(e)}var MJ=/^(?!-).*(?<!-)$/,DJ=/^(?!..--)/,FJ=/^[a-zA-Z0-9-]*$/,CKt=new RegExp("^\\p{ASCII}*$","u"),Xf=/[^\p{ASCII}]/u;var sMe=/[0-9]/,$J=/[\u{0660}-\u{0669}]/u,aMe=/[\u{06f0}-\u{06f9}]/u,cMe=/[\u{002e}\u{002c}\u{003a}\u{002f}]/u,uMe=/[\u{002d}\u{002b}]/u,AM=new RegExp("\\p{Mn}","u"),pMe=new RegExp("\\p{Mc}","u"),RKt=new RegExp("\\p{Me}","u"),GJ=/[\p{Mn}\p{Mc}\p{Me}]/u,CM=new RegExp("\\p{L}","u"),lMe=new RegExp("\\p{Nd}","u"),BJ=new RegExp("\\p{Script=Greek}","u"),hC=new RegExp("\\p{Script=Hebrew}","u"),jJ=/[\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Han}]/u,qJ=/[\p{Script=Arabic}\p{Script=Syriac}\p{Script=Thaana}\p{Script=Mandaic}]/u,RM=/[\u{094d}\u{09cd}\u{0a4d}\u{0acd}\u{0b4d}\u{0bcd}\u{0c4d}\u{0ccd}\u{0d3b}\u{0d3c}\u{0d4d}\u{0dca}\u{1b44}\u{1baa}\u{1bab}\u{a9c0}\u{11046}\u{1107f}\u{110b9}\u{11133}\u{11134}\u{111c0}\u{11235}\u{1134d}\u{11442}\u{114c2}\u{115bf}\u{1163f}\u{116b6}\u{11c3f}\u{11d44}\u{11d45}]/u,HJ=/[\u{0640}\u{07fa}\u{302e}\u{302f}\u{3031}\u{3032}\u{3033}\u{3034}\u{3035}\u{303b}]/u,dMe=/[\u{00b7}\u{0375}\u{05f3}\u{05f4}\u{200c}\u{200d}\u{30fb}]/u,mMe=/[\u{00df}\u{03c2}\u{06fd}\u{06fe}\u{0f0b}\u{3007}]/u,KJ=new RegExp([sMe,aMe].map(e=>e.source).join("|"),"u"),zJ=new RegExp([CM,uMe,cMe,lMe,AM,pMe,dMe,mMe].map(e=>e.source).join("|"),"u");function YJ(e){return MJ.test(e)&&DJ.test(e)&&FJ.test(e)}var _s=36,TT=1,ST=26,gMe=38,hMe=700,WJ=72,QJ=128;function PM(){throw null}function yC(e){return e.toLowerCase().startsWith("xn--")}function ZJ(e,t,r){e=r?Math.floor(e/hMe):e>>1,e+=Math.floor(e/t);let o=0;for(;e>(_s-TT)*ST>>1;)e=Math.floor(e/(_s-TT)),o+=_s;return o+Math.floor((_s-TT+1)*e/(e+gMe))}function EC(e){let t=[],r=QJ,o=0,i=WJ,s=e.lastIndexOf("-");if(s>0)for(let u=0;u<s;u++){let l=e.charCodeAt(u);l>=128&&PM(),t.push(l)}let a=s<0?0:s+1;for(;a<e.length;){let u=o,l=1,d=_s;for(;;){a>=e.length&&PM();let y=e.charCodeAt(a++),E;y>=97&&y<=122?E=y-97:y>=48&&y<=57?E=y-48+26:PM(),o+=E*l;let h=d<=i?TT:d>=i+ST?ST:d-i;if(E<h)break;l*=_s-h,d+=_s}let g=t.length+1;i=ZJ(o-u,g,u===0),r+=Math.floor(o/g),o%=g,t.splice(o,0,r),o++}return String.fromCodePoint(...t)}function VJ(e){return e<26?String.fromCharCode(e+97):String.fromCharCode(e-26+48)}var yMe=new RegExp(Xf.source,"gu");function XJ(e){let t=e.replace(yMe,""),r=t.length,o=r>0?[t,"-"]:[],i=Array.from(e,d=>d.codePointAt(0)),s=QJ,a=0,u=WJ,l=r;for(;l<i.length;){let d=1/0;for(let g of i)g>=s&&g<d&&(d=g);a+=(d-s)*(l+1),s=d;for(let g of i)if(g<s&&a++,g===s){let y=a;for(let E=_s;;E+=_s){let h=E<=u?TT:E>=u+ST?ST:E-u;if(y<h)break;let S=h+(y-h)%(_s-h);o.push(VJ(S)),y=Math.floor((y-h)/(_s-h))}o.push(VJ(y)),u=ZJ(a,l+1,l===r),a=0,l++}a++,s++}return o.join("")}var EMe=/^(?:R|AL|AN|EN|ES|CS|ET|ON|BN|NSM)$/,JJ=/^(?:L|EN|ES|CS|ET|ON|BN|NSM)$/,TMe=/^(?:R|AL|AN)$/;function eee(e){if(yC(e))try{return TC(EC(e.slice(4).toLowerCase()))}catch{return!1}return TC(e)}function tee(e){let t=String.fromCodePoint(e);return KJ.test(t)?"EN":$J.test(t)?"AN":AM.test(t)?"NSM":hC.test(t)?"R":qJ.test(t)?"AL":CM.test(t)?"L":"ON"}function TC(e){for(let t of e)if(TMe.test(tee(t.codePointAt(0))))return!0;return!1}function SC(e){let t=!1,r=JJ,o=!1,i=!1,s=!0;for(let a of e){let u=tee(a.codePointAt(0));if(s){if(u!=="L"&&u!=="R"&&u!=="AL")return!1;t=u==="R"||u==="AL",r=t?EMe:JJ,s=!1}if(!r.test(u))return!1;u==="EN"?o=!0:u==="AN"&&(i=!0)}return!(t&&o&&i)}function SMe(e){return Xf.test(e)&&XJ(e).length+4>63}function _Me(e){return e[0]==="-"||e[e.length-1]==="-"?!0:e.slice(2).join("").startsWith("--")}function _C(e){if(SMe(e)||TC(e)&&!SC(e))return!1;let t=[...e],r=t.map(s=>s.codePointAt(0)),o=r.length;if(_Me(t)||GJ.test(t[0]))return!1;let i=!1;for(let s=0;s<o;s++){let a=r[s],u=t[s];if(HJ.test(u)||!zJ.test(u))return!1;jJ.test(u)&&(i=!0);let l=r[s-1],d=r[s+1];switch(a){case 183:if(l!==108||d!==108)return!1;break;case 885:if(!d||!BJ.test(t[s+1]))return!1;break;case 1523:case 1524:if(!l||!hC.test(t[s-1]))return!1;break;case 8204:if(!l||l<128&&!RM.test(t[s-1]))return!1;break;case 8205:if(!l||!RM.test(t[s-1]))return!1;break;case 12539:break}}return!(e.includes("\u30FB")&&!i)}function IC(e){if(!yC(e))return!1;try{let t=e.slice(4).toLowerCase();if(t.lastIndexOf("-")===0)return!1;let r=EC(t);return Xf.test(r)?_C(r):!1}catch{return!1}}function IMe(e){return e.length>0&&e.length<=63}function bMe(e){return IMe(e)&&(IC(e)||YJ(e))}function iee(e){return e.length===0||e.length>253||e.charCodeAt(e.length-1)===46?!1:e.split(".").every(t=>bMe(t))}function xMe(e){return e.length>0&&e.length<=63}function OMe(e){return xMe(e)&&(IC(e)||_C(e))}function AMe(e){return e.replace(/[\uff01-\uff5e]/g,t=>String.fromCharCode(t.charCodeAt(0)-65248)).normalize("NFC").replace(/[\u00ad\u034f\u180b-\u180d\u200b\ufe00-\ufe0f\u{e0100}-\u{e01ef}]/gu,"").replace(/[\u002E\u3002\uFF0E\uFF61]/g,".")}function see(e){if(e.length===0||e.includes(" "))return!1;let t=AMe(e);if(t.length>253)return!1;let r=t.split("."),o=r.some(i=>eee(i));return r.every(i=>OMe(i)&&(!o||SC(i)))}function bC(e){return iee(e)}var CMe=/^(?:[A-Za-z0-9!#$%&'*+\/=?^_`{|}~\u{0080}-\u{10FFFF}-]+(?:\.[A-Za-z0-9!#$%&'*+\/=?^_`{|}~\u{0080}-\u{10FFFF}-]+)*|"(?:[^"\\]|\\.)*")@[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,62})(?<!-)(?:\.[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,62})(?<!-))*$/iu;function xC(e){return CMe.test(e.normalize("NFC"))}function OC(e){return see(e)}var RMe=/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/;function AC(e){return RMe.test(e)}var PMe=/^(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:)?[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)$/i;function CC(e){return PMe.test(e)}var UMe=/[\x00-\x20\x7F\\]|%(?![0-9a-fA-F]{2})/,wMe=/^[a-zA-Z][a-zA-Z0-9+\-.]*\/\//;function RC(e){return!UMe.test(e)&&!wMe.test(e)&&URL.canParse(e,"http://example.com")}var vMe=/[\x00-\x20<>\^`{|}\\]/,NMe=/%(?![0-9a-fA-F]{2})/;function PC(e){return vMe.test(e)||NMe.test(e)?!1:URL.canParse(e)}var kMe=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;function UC(e){return kMe.test(e)}var LMe=/^(?:\/(?:[^~/]|~0|~1)*)*$/;function wC(e){return LMe.test(e)}function vC(e){try{return new RegExp(e,"u"),!0}catch{return!1}}var MMe=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function NC(e){return MMe.test(e)}var DMe=/^(?:[a-z][a-z0-9+\-.]*:(?:\/\/(?:(?:[-a-z0-9._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:[\da-f]{1,4}:){6}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|::(?:[\da-f]{1,4}:){5}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:[\da-f]{1,4})?::(?:[\da-f]{1,4}:){4}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,1}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){3}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){2}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4})?::[\da-f]{1,4}:(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4})?::(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4})?::[\da-f]{1,4}|(?:(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4})?::)|v[0-9a-f]+\.[-a-z0-9._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)|(?:[-a-z0-9._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:\/\/(?:(?:[-a-z0-9._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:[\da-f]{1,4}:){6}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|::(?:[\da-f]{1,4}:){5}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:[\da-f]{1,4})?::(?:[\da-f]{1,4}:){4}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,1}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){3}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){2}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4})?::[\da-f]{1,4}:(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4})?::(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4})?::[\da-f]{1,4}|(?:(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4})?::)|v[0-9a-f]+\.[-a-z0-9._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)|(?:[-a-z0-9._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[-a-z0-9._~!$&'()*+,;=@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?)(?:\?(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function kC(e){return DMe.test(e)}var FMe=/^(?:(?:[^\x00-\x20"<>%\\^`{|}\x7f]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?:\.(?:[a-z0-9_]|%[0-9a-f]{2})+)*(?::[1-9]\d{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?:\.(?:[a-z0-9_]|%[0-9a-f]{2})+)*(?::[1-9]\d{0,3}|\*)?)*\})*$/i;function LC(e){return FMe.test(e)}var $Me=/^[a-z][a-z0-9+\-.]*:(?:\/\/(?:(?:[-a-z0-9._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:[\da-f]{1,4}:){6}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|::(?:[\da-f]{1,4}:){5}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:[\da-f]{1,4})?::(?:[\da-f]{1,4}:){4}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,1}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){3}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){2}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4})?::[\da-f]{1,4}:(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4})?::(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4})?::[\da-f]{1,4}|(?:(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4})?::)|v[0-9a-f]+\.[-a-z0-9._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)|(?:[-a-z0-9._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function MC(e){return $Me.test(e)}function DC(e){return URL.canParse(e)}var GMe=/^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;function FC(e){return GMe.test(e)}var Jt=new Map;function cee(){Jt.clear()}function BMe(){return[...Jt.entries()]}function jMe(e,t){Jt.set(e,t)}function qMe(e){return Jt.has(e)}function HMe(e){return Jt.get(e)}function KMe(e,t){return Jt.get(e)?.(t)??!0}function uee(){cee(),Jt.set("date-time",mC),Jt.set("date",Qf),Jt.set("duration",fC),Jt.set("email",gC),Jt.set("hostname",bC),Jt.set("idn-email",xC),Jt.set("idn-hostname",OC),Jt.set("ipv4",AC),Jt.set("ipv6",CC),Jt.set("iri-reference",RC),Jt.set("iri",PC),Jt.set("json-pointer-uri-fragment",UC),Jt.set("json-pointer",wC),Jt.set("regex",vC),Jt.set("relative-json-pointer",NC),Jt.set("time",Zf),Jt.set("uri-reference",kC),Jt.set("uri-template",LC),Jt.set("uri",MC),Jt.set("url",DC),Jt.set("uuid",FC)}uee();function wM(e,t,r,o){return _T.Test(r.format,o)}function pee(e,t,r,o,i,s){return wM(e,t,i,s)||t.AddError("format",r,o,{format:i.format})}function lee(e,t,r,o){let i=pC(r)?r.then:!0,s=tC(r)?r.else:!0;return st(e,t,r.if,o)?st(e,t,i,o):st(e,t,s,o)}function dee(e,t,r,o,i,s){let a=pC(i)?i.then:!0,u=tC(i)?i.else:!0,l=new Ln,d=Ft(e,l,`${r}/if`,o,i.if,s)?Ft(e,l,`${r}/then`,o,a,s)||t.AddError("if",r,o,{failingKeyword:"then"}):Ft(e,t,`${r}/else`,o,u,s)||t.AddError("if",r,o,{failingKeyword:"else"});return d&&t.Merge([l]),d}function zMe(e,t,r,o){return c.Every(r.items,0,(i,s)=>c.IsLessEqualThan(o.length,s)||mi(e,t,i,o[s])&&t.AddIndex(s))}function YMe(e,t,r,o,i,s){return c.EveryAll(i.items,0,(a,u)=>{let l=`${r}/items/${u}`,d=`${o}/${u}`;return c.IsLessEqualThan(s.length,u)||fi(e,t,l,d,a,s[u])&&t.AddIndex(u)})}function VMe(e,t,r,o){let i=sd(r)?r.prefixItems.length:0;return c.Every(o,i,(s,a)=>mi(e,t,r.items,s)&&t.AddIndex(a))}function WMe(e,t,r,o,i,s){let a=sd(i)?i.prefixItems.length:0;return c.EveryAll(s,a,(u,l)=>{let d=`${r}/items`,g=`${o}/${l}`;return fi(e,t,d,g,i.items,u)&&t.AddIndex(l)})}function mee(e,t,r,o){return nC(r)?zMe(e,t,r,o):VMe(e,t,r,o)}function fee(e,t,r,o,i,s){return nC(i)?YMe(e,t,r,o,i,s):WMe(e,t,r,o,i,s)}function QMe(e){return ep(e)}function vM(e,t,r,o){if(!QMe(r))return!0;let i=c.Counted(o,s=>st(e,t,r.contains,s));return c.IsLessEqualThan(i,r.maxContains)}function gee(e,t,r,o,i,s){let a=id(i)?i.minContains:1;return vM(e,t,i,s)||t.AddError("contains",r,o,{minContains:a,maxContains:i.maxContains})}function NM(e,t,r,o){return c.IsLessEqualThan(o,r.maximum)}function hee(e,t,r,o,i,s){return NM(e,t,i,s)||t.AddError("maximum",r,o,{comparison:"<=",limit:i.maximum})}function kM(e,t,r,o){return c.IsLessEqualThan(o.length,r.maxItems)}function yee(e,t,r,o,i,s){return kM(e,t,i,s)||t.AddError("maxItems",r,o,{limit:i.maxItems})}function LM(e,t,r,o){return c.IsMaxLength(o,r.maxLength)}function Eee(e,t,r,o,i,s){return LM(e,t,i,s)||t.AddError("maxLength",r,o,{limit:i.maxLength})}function MM(e,t,r,o){return c.IsLessEqualThan(c.Keys(o).length,r.maxProperties)}function Tee(e,t,r,o,i,s){return MM(e,t,i,s)||t.AddError("maxProperties",r,o,{limit:i.maxProperties})}function ZMe(e){return ep(e)}function DM(e,t,r,o){if(!ZMe(r))return!0;let i=c.Counted(o,(s,a)=>st(e,t,r.contains,s)&&t.AddIndex(a));return c.IsGreaterEqualThan(i,r.minContains)}function See(e,t,r,o,i,s){return DM(e,t,i,s)||t.AddError("contains",r,o,{minContains:i.minContains})}function FM(e,t,r,o){return c.IsGreaterEqualThan(o,r.minimum)}function _ee(e,t,r,o,i,s){return FM(e,t,i,s)||t.AddError("minimum",r,o,{comparison:">=",limit:i.minimum})}function $M(e,t,r,o){return c.IsGreaterEqualThan(o.length,r.minItems)}function Iee(e,t,r,o,i,s){return $M(e,t,i,s)||t.AddError("minItems",r,o,{limit:i.minItems})}function GM(e,t,r,o){return c.IsMinLength(o,r.minLength)}function bee(e,t,r,o,i,s){return GM(e,t,i,s)||t.AddError("minLength",r,o,{limit:i.minLength})}function BM(e,t,r,o){return c.IsGreaterEqualThan(c.Keys(o).length,r.minProperties)}function xee(e,t,r,o,i,s){return BM(e,t,i,s)||t.AddError("minProperties",r,o,{limit:i.minProperties})}function jM(e,t,r,o){return c.IsMultipleOf(o,r.multipleOf)}function Oee(e,t,r,o,i,s){return jM(e,t,i,s)||t.AddError("multipleOf",r,o,{multipleOf:i.multipleOf})}function qM(e,t,r,o){let i=new po;return!st(e,i,r.not,o)&&t.Merge([i])}function Aee(e,t,r,o,i,s){return qM(e,t,i,s)||t.AddError("not",r,o,{})}function Cee(e,t,r,o){let i=r.oneOf.reduce((s,a)=>{let u=new po;return st(e,u,a,o)?[...s,u]:s},[]);return c.IsEqual(i.length,1)&&t.Merge(i)}function Ree(e,t,r,o,i,s){let a=[],u=[],l=i.oneOf.reduce((g,y,E)=>{let h=new Ln,S=`${r}/oneOf/${E}`,T=Ft(e,h,S,o,y,s);return T&&u.push(E),T||a.push(h),T?[...g,h]:g},[]),d=c.IsEqual(l.length,1)&&t.Merge(l);return!d&&c.IsEqual(u.length,0)&&a.forEach(g=>t.AddErrors(g.GetErrors())),d||t.AddError("oneOf",r,o,{passingSchemas:u})}function HM(e,t,r,o){return(c.IsString(r.pattern)?rp(r.pattern):r.pattern).test(o)}function Pee(e,t,r,o,i,s){return HM(e,t,i,s)||t.AddError("pattern",r,o,{pattern:i.pattern})}function Uee(e,t,r,o){return c.Every(c.Entries(r.patternProperties),0,([i,s])=>{let a=rp(i);return c.Every(c.Entries(o),0,([u,l])=>!a.test(u)||mi(e,t,s,l)&&t.AddKey(u))})}function wee(e,t,r,o,i,s){return c.EveryAll(c.Entries(i.patternProperties),0,([a,u])=>{let l=`${r}/patternProperties/${qo(a)}`,d=rp(a);return c.EveryAll(c.Entries(s),0,([g,y])=>{let E=`${o}/${qo(g)}`;return!d.test(g)||fi(e,t,l,E,u,y)&&t.AddKey(g)})})}function vee(e,t,r,o){return c.IsEqual(o.length,0)||c.Every(r.prefixItems,0,(i,s)=>c.IsLessEqualThan(o.length,s)||mi(e,t,i,o[s])&&t.AddIndex(s))}function Nee(e,t,r,o,i,s){return c.IsEqual(s.length,0)||c.EveryAll(i.prefixItems,0,(a,u)=>{let l=`${r}/prefixItems/${u}`,d=`${o}/${u}`;return c.IsLessEqualThan(s.length,u)||fi(e,t,l,d,a,s[u])&&t.AddIndex(u)})}function KM(e,t){return e.includes(t)||Br.Get().exactOptionalPropertyTypes}function zM(e,t){return c.IsUndefined(e[t])}function kee(e,t,r,o){let i=ad(r)?r.required:[];return c.Every(c.Entries(r.properties),0,([a,u])=>{let l=!c.HasPropertyKey(o,a)||mi(e,t,u,o[a])&&t.AddKey(a);return KM(i,a)?l:zM(o,a)||l})}function Lee(e,t,r,o,i,s){let a=ad(i)?i.required:[];return c.EveryAll(c.Entries(i.properties),0,([l,d])=>{let g=`${r}/properties/${qo(l)}`,y=`${o}/${qo(l)}`,E=()=>!c.HasPropertyKey(s,l)||fi(e,t,g,y,d,s[l])&&t.AddKey(l);return KM(a,l)?E():zM(s,l)||E()})}function Mee(e,t,r,o){return c.Every(c.Keys(o),0,(i,s)=>st(e,t,r.propertyNames,i))}function Dee(e,t,r,o,i,s){let a=[];return c.EveryAll(c.Keys(s),0,(l,d)=>{let g=`${o}/${qo(l)}`,y=`${r}/propertyNames`,E=Ft(e,t,y,g,i.propertyNames,l);return E||a.push(l),E})||t.AddError("propertyNames",r,o,{propertyNames:a})}function Fee(e,t,r,o){let i=Gi.RecursiveRef(e,r)??!1,s=i?{...e,pendingResource:!0}:e;return Ae(i)&&st(s,t,i,o)}function $ee(e,t,r,o,i,s){let a=Gi.RecursiveRef(e,i)??!1,u=a?{...e,pendingResource:!0}:e;return Ae(a)&&Ft(u,t,r,o,a,s)}function Gee(e,t,r,o){let i=Gi.Ref(e,r),s=i.schema??!1,a=new po,u=Ae(s)&&st(i.stack,a,s,o);return u&&t.Merge([a]),u}function Bee(e,t,r,o,i,s){let a=Gi.Ref(e,i),u=a.schema??!1,l=new Ln,d=Ae(u)&&Ft(a.stack,l,r,o,u,s);return d&&t.Merge([l]),d||t.AddErrors(l.GetErrors()),d}function jee(e,t,r,o){return c.Every(r.required,0,i=>c.HasPropertyKey(o,i))}function qee(e,t,r,o,i,s){let a=[];return c.EveryAll(i.required,0,l=>{let d=c.HasPropertyKey(s,l);return d||a.push(l),d})||t.AddError("required",r,o,{requiredProperties:a})}function YM(e,t,r,o,i){return c.IsEqual(r,"object")?c.IsObjectNotArray(i):c.IsEqual(r,"array")?c.IsArray(i):c.IsEqual(r,"boolean")?c.IsBoolean(i):c.IsEqual(r,"integer")?c.IsInteger(i):c.IsEqual(r,"number")?c.IsNumber(i):c.IsEqual(r,"null")?c.IsNull(i):c.IsEqual(r,"string")?c.IsString(i):c.IsEqual(r,"bigint")?c.IsBigInt(i):c.IsEqual(r,"constructor")?c.IsConstructor(i):c.IsEqual(r,"function")?c.IsFunction(i):c.IsEqual(r,"symbol")?c.IsSymbol(i):c.IsEqual(r,"undefined")?c.IsUndefined(i):c.IsEqual(r,"void")?c.IsUndefined(i):!0}function Hee(e,t,r,o,i){return c.Some(r,s=>YM(e,t,s,o,i))}function Kee(e,t,r,o){return c.IsArray(r.type)?Hee(e,t,r.type,r,o):YM(e,t,r.type,r,o)}function zee(e,t,r,o,i,s){return(c.IsArray(i.type)?Hee(e,t,i.type,i,s):YM(e,t,i.type,i,s))||t.AddError("type",r,o,{type:i.type})}function Yee(e,t,r,o){let i=t.GetIndices();return c.Every(o,0,(s,a)=>(i.has(a)||st(e,t,r.unevaluatedItems,s))&&t.AddIndex(a))}function Vee(e,t,r,o,i,s){let a=t.GetIndices(),u=[];return c.EveryAll(s,0,(d,g)=>{let y=new Ln,E=(a.has(g)||Ft(e,y,r,o,i.unevaluatedItems,d))&&t.AddIndex(g);return E||u.push(g),E})||t.AddError("unevaluatedItems",r,o,{unevaluatedItems:u})}function Wee(e,t,r,o){let i=t.GetKeys();return c.Every(c.Entries(o),0,([s,a])=>i.has(s)||st(e,t,r.unevaluatedProperties,a)&&t.AddKey(s))}function Qee(e,t,r,o,i,s){let a=t.GetKeys(),u=[];return c.EveryAll(c.Entries(s),0,([d,g])=>{let y=new Ln,E=a.has(d)||Ft(e,y,r,o,i.unevaluatedProperties,g)&&t.AddKey(d);return E||u.push(d),E})||t.AddError("unevaluatedProperties",r,o,{unevaluatedProperties:u})}function Zee(e){return!c.IsEqual(e.uniqueItems,!1)}function Xee(e,t,r,o){if(!Zee(r))return!0;let i=new Set(o.map(ku.Hash)).size,s=o.length;return c.IsEqual(i,s)}function Jee(e,t,r,o,i,s){if(!Zee(i))return!0;let a=new Set,u=s.reduce((d,g,y)=>{let E=ku.Hash(g);return a.has(E)?[...d,y]:(a.add(E),d)},[]);return c.IsEqual(u.length,0)||t.AddError("uniqueItems",r,o,{duplicateItems:u})}function mi(e,t,r,o){return t.Push()&&st(e,t,r,o)&&t.Pop()}function st(e,t,r,o){let i=Yf(e,r);return nd(r)?mM(i,t,r,o):(!uM(r)||Kee(i,t,r,o))&&(!(c.IsObject(o)&&!c.IsArray(o))||(!ad(r)||jee(i,t,r,o))&&(!da(r)||cJ(i,t,r,o))&&(!eM(r)||yJ(i,t,r,o))&&(!tM(r)||TJ(i,t,r,o))&&(!JA(r)||_J(i,t,r,o))&&(!jf(r)||Uee(i,t,r,o))&&(!qf(r)||kee(i,t,r,o))&&(!aC(r)||Mee(i,t,r,o))&&(!uT(r)||BM(i,t,r,o))&&(!aM(r)||MM(i,t,r,o)))&&(!c.IsArray(o)||(!QA(r)||iJ(i,t,r,o))&&(!ep(r)||gM(i,t,r,o))&&(!od(r)||mee(i,t,r,o))&&(!id(r)||DM(i,t,r,o))&&(!iM(r)||vM(i,t,r,o))&&(!Bf(r)||$M(i,t,r,o))&&(!oC(r)||kM(i,t,r,o))&&(!sd(r)||vee(i,t,r,o))&&(!Hf(r)||Xee(i,t,r,o)))&&(!c.IsString(o)||(!cT(r)||GM(i,t,r,o))&&(!sM(r)||LM(i,t,r,o))&&(!aT(r)||wM(i,t,r,o))&&(!pT(r)||HM(i,t,r,o)))&&(!(c.IsNumber(o)||c.IsBigInt(o))||(!Pc(r)||OM(i,t,r,o))&&(!nM(r)||xM(i,t,r,o))&&(!Uc(r)||FM(i,t,r,o))&&(!oM(r)||NM(i,t,r,o))&&(!cM(r)||jM(i,t,r,o)))&&(!uC(r)||Gee(i,t,r,o))&&(!cC(r)||Fee(i,t,r,o))&&(!eC(r)||wJ(i,t,r,o))&&(!J0(r)||fM(i,t,r,o))&&(!rM(r)||bM(i,t,r,o))&&(!rC(r)||lee(i,t,r,o))&&(!iC(r)||qM(i,t,r,o))&&(!ZA(r)||pJ(i,t,r,o))&&(!XA(r)||dJ(i,t,r,o))&&(!sC(r)||Cee(i,t,r,o))&&(!dT(r)||!c.IsArray(o)||Yee(i,t,r,o))&&(!mT(r)||!c.IsObject(o)||Wee(i,t,r,o))&&(!WA(r)||XX(i,t,r,o))}function fi(e,t,r,o,i,s){return t.Push()&&Ft(e,t,r,o,i,s)&&t.Pop()}function Ft(e,t,r,o,i,s){if(t.AtCapacity())return!1;let a=Yf(e,i);return nd(i)?fJ(a,t,r,o,i,s):!!(+(!uM(i)||zee(a,t,r,o,i,s))&+(!(c.IsObject(s)&&!c.IsArray(s))||!!(+(!ad(i)||qee(a,t,r,o,i,s))&+(!da(i)||uJ(a,t,r,o,i,s))&+(!eM(i)||EJ(a,t,r,o,i,s))&+(!tM(i)||SJ(a,t,r,o,i,s))&+(!JA(i)||IJ(a,t,r,o,i,s))&+(!jf(i)||wee(a,t,r,o,i,s))&+(!qf(i)||Lee(a,t,r,o,i,s))&+(!aC(i)||Dee(a,t,r,o,i,s))&+(!uT(i)||xee(a,t,r,o,i,s))&+(!aM(i)||Tee(a,t,r,o,i,s))))&+(!c.IsArray(s)||!!(+(!QA(i)||sJ(a,t,r,o,i,s))&+(!ep(i)||hJ(a,t,r,o,i,s))&+(!od(i)||fee(a,t,r,o,i,s))&+(!id(i)||See(a,t,r,o,i,s))&+(!iM(i)||gee(a,t,r,o,i,s))&+(!Bf(i)||Iee(a,t,r,o,i,s))&+(!oC(i)||yee(a,t,r,o,i,s))&+(!sd(i)||Nee(a,t,r,o,i,s))&+(!Hf(i)||Jee(a,t,r,o,i,s))))&+(!c.IsString(s)||!!(+(!cT(i)||bee(a,t,r,o,i,s))&+(!sM(i)||Eee(a,t,r,o,i,s))&+(!aT(i)||pee(a,t,r,o,i,s))&+(!pT(i)||Pee(a,t,r,o,i,s))))&+(!(c.IsNumber(s)||c.IsBigInt(s))||!!(+(!Pc(i)||LJ(a,t,r,o,i,s))&+(!nM(i)||kJ(a,t,r,o,i,s))&+(!Uc(i)||_ee(a,t,r,o,i,s))&+(!oM(i)||hee(a,t,r,o,i,s))&+(!cM(i)||Oee(a,t,r,o,i,s))))&+(!uC(i)||Bee(a,t,r,o,i,s))&+(!cC(i)||$ee(a,t,r,o,i,s))&+(!eC(i)||vJ(a,t,r,o,i,s))&+(!J0(i)||gJ(a,t,r,o,i,s))&+(!rM(i)||NJ(a,t,r,o,i,s))&+(!rC(i)||dee(a,t,r,o,i,s))&+(!iC(i)||Aee(a,t,r,o,i,s))&+(!ZA(i)||lJ(a,t,r,o,i,s))&+(!XA(i)||mJ(a,t,r,o,i,s))&+(!sC(i)||Ree(a,t,r,o,i,s))&+(!dT(i)||!c.IsArray(s)||Vee(a,t,r,o,i,s))&+(!mT(i)||!c.IsObject(s)||Qee(a,t,r,o,i,s)))&&(!WA(i)||JX(a,t,r,o,i,s))}function $C(...e){let[t,r,o]=ot.Match(e,{3:(g,y,E)=>[g,y,E],2:(g,y)=>[{},g,y]}),i=zf(t,r),s=new Ln,a=Ft(i,s,"#","",r,o),u=s.GetErrors(),l=h4(),d=u.map(g=>({...g,message:l(g)}));return[a,d]}var ete=0;function WM(){let e=Px();ete=e.maxErrors,e.maxErrors=e.maxParseErrors}function QM(){let e=Px();e.maxErrors=ete}function ZM(...e){let[t,r,o]=ot.Match(e,{3:(a,u,l)=>[a,u,l],2:(a,u)=>[{},a,u]}),i=zf(t,r),s=new po;return st(i,s,r,o)}function bt(...e){let[t,r,o]=ot.Match(e,{3:(i,s,a)=>[i,s,a],2:(i,s)=>[{},i,s]});return ZM(t,r,o)}function fa(...e){let[t,r,o]=ot.Match(e,{3:(a,u,l)=>[a,u,l],2:(a,u)=>[{},a,u]}),[i,s]=$C(t,r,o);return s}var np=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 tte(e,t,r){return c.IsArray(r)?r.map(o=>fn(e,t.items,o)):r}function rte(e,t,r){return fn({...e,...t.$defs},pn(t.$ref),r)}function eDe(e,t){let r=c.HasPropertyKey(t,"unevaluatedProperties")?{additionalProperties:t.unevaluatedProperties}:{},o=Li(e,t),i=Nn(o);return Te(i)?BO(i,r):i}function nte(e,t,r){let o=eDe(e,t);return fn(e,o,r)}function GC(e){return c.HasPropertyKey(e,"additionalProperties")?e.additionalProperties:void 0}function ote(e,t,r){if(!c.IsObject(r)||c.IsArray(r))return r;let o=GC(t);for(let i of c.Keys(r)){if(c.HasPropertyKey(t.properties,i)&&sr(t.properties[i])){r[i]=fn(e,t.properties[i],r[i]);continue}if(c.IsBoolean(o)&&c.IsEqual(o,!0)||sr(o)&&bt(e,o,r[i])){r[i]=fn(e,o,r[i]);continue}delete r[i]}return r}function ite(e,t,r){if(!c.IsObject(r))return r;let o=GC(t),[i,s]=[new RegExp(Hr(t)),Zt(t)];for(let a of c.Keys(r)){if(i.test(a)){r[a]=fn(e,s,r[a]);continue}if(c.IsBoolean(o)&&c.IsEqual(o,!0)||sr(o)&&bt(e,o,r[a])){r[a]=fn(e,o,r[a]);continue}delete r[a]}return r}function ste(e,t,r){return c.HasPropertyKey(e,t.$ref)?fn(e,e[t.$ref],r):r}function ate(e,t,r){if(!c.IsArray(r))return r;let o=Math.min(r.length,t.items.length);for(let i=0;i<o;i++)r[i]=fn(e,t.items[i],r[i]);return c.IsGreaterThan(r.length,o)?r.slice(0,o):r}function tDe(e){return c.HasPropertyKey(e,"~kind")||c.HasPropertyKey(e,"~unsafe")}function rDe(e){let t={};for(let r of c.Keys(e)){if(c.IsUnsafePropertyKey(r))continue;let o=Object.getOwnPropertyDescriptor(e,r);o.value=pd(o.value),c.IsEqual(o.enumerable,!0)?t[r]=o.value:Object.defineProperty(t,r,o)}return t}function nDe(e){let t={};for(let r of c.Keys(e))c.IsUnsafePropertyKey(r)||(t[r]=pd(e[r]));for(let r of c.Symbols(e))t[r]=pd(e[r]);return t}function oDe(e){return c.IsClassInstance(e)?e:tDe(e)?rDe(e):nDe(e)}function iDe(e){return e.map(t=>pd(t))}function sDe(e){return e.slice()}function aDe(e){return new RegExp(e.source,e.flags)}function cDe(e){return new Map(pd([...e.entries()]))}function uDe(e){return new Set(pd([...e.values()]))}function pd(e){return io.IsTypeArray(e)?sDe(e):io.IsRegExp(e)?aDe(e):io.IsMap(e)?cDe(e):io.IsSet(e)?uDe(e):c.IsArray(e)?iDe(e):c.IsObject(e)?oDe(e):e}function cte(e){return pd(e)}function Rr(e){return cte(e)}function ute(e,t,r){for(let o of t.anyOf){let i=fn(e,o,Rr(r));if(bt(e,o,i))return i}return r}function fn(e,t,r){return Ze(t)?tte(e,t,r):Mt(t)?rte(e,t,r):ge(t)?nte(e,t,r):Te(t)?ote(e,t,r):_t(t)?ite(e,t,r):yt(t)?ste(e,t,r):Ge(t)?ate(e,t,r):z(t)?ute(e,t,r):r}function pDe(e,t){return O.Assign(e,t)}function lDe(e){let t={};for(let r of HV.Keys(e))t[r]=IT(e[r]);return t}function dDe(e){return wn({pattern:Hr(e)})}function mDe(e){return XM(u8(e))}function XM(e){return e.map(t=>IT(t))}function IT(e){let t=Ze(e)?Io(IT(e.items),Qm(e)):ge(e)?Kn(XM(e.allOf)):z(e)?Pe(mDe(e.anyOf)):Te(e)?me(lDe(e.properties)):_t(e)?sf(dDe(e),IT(Zt(e))):Ge(e)?Ir(XM(e.items)):e;return pDe(e,t)}function Jf(e){return IT(e)}function ga(...e){let[t,r,o]=ot.Match(e,{3:(s,a,u)=>[s,a,u],2:(s,a)=>[{},s,a]}),i=Br.Get().unionPrioritySort?Jf(r):r;return fn(t,i,o)}var at={};yi(at,{Fail:()=>ld,IsOk:()=>JM,Ok:()=>ce,TryArray:()=>fDe,TryBigInt:()=>eD,TryBoolean:()=>ADe,TryNull:()=>wDe,TryNumber:()=>LDe,TryString:()=>MDe,TryUndefined:()=>BDe});function JM(e){return c.IsObject(e)&&c.HasPropertyKey(e,"value")}function ce(e){return{value:e}}function ld(){}function fDe(e){return c.IsArray(e)?ce(e):ce([e])}function gDe(e){return c.IsEqual(e,!0)?ce(BigInt(1)):ce(BigInt(0))}var hDe=/^-?(0|[1-9]\d*)n$/,yDe=/^-?(0|[1-9]\d*)\.\d+$/,EDe=/^-?(0|[1-9]\d*)$/;function TDe(e){return hDe.test(e)}function SDe(e){return yDe.test(e)}function _De(e){return EDe.test(e)}function IDe(e){let t=e.toLowerCase();return TDe(e)?ce(BigInt(e.slice(0,e.length-1))):SDe(e)?ce(BigInt(e.split(".")[0])):_De(e)?ce(BigInt(e)):c.IsEqual(t,"false")?ce(BigInt(0)):c.IsEqual(t,"true")?ce(BigInt(1)):void 0}function eD(e){return c.IsBigInt(e)?ce(e):c.IsBoolean(e)?gDe(e):c.IsNumber(e)?ce(BigInt(Math.trunc(e))):c.IsNull(e)?ce(BigInt(0)):c.IsString(e)?IDe(e):c.IsUndefined(e)?ce(BigInt(0)):void 0}function bDe(e){return c.IsEqual(e,BigInt(0))?ce(!1):c.IsEqual(e,BigInt(1))?ce(!0):void 0}function xDe(e){return c.IsEqual(e,0)?ce(!1):c.IsEqual(e,1)?ce(!0):void 0}function ODe(e){return c.IsEqual(e.toLowerCase(),"false")?ce(!1):c.IsEqual(e.toLowerCase(),"true")?ce(!0):c.IsEqual(e,"0")?ce(!1):c.IsEqual(e,"1")?ce(!0):void 0}function ADe(e){return c.IsBigInt(e)?bDe(e):c.IsBoolean(e)?ce(e):c.IsNumber(e)?xDe(e):c.IsNull(e)?ce(!1):c.IsString(e)?ODe(e):c.IsUndefined(e)?ce(!1):void 0}function CDe(e){return c.IsEqual(e,BigInt(0))?ce(null):void 0}function RDe(e){return c.IsEqual(e,!1)?ce(null):void 0}function PDe(e){return c.IsEqual(e,0)?ce(null):void 0}function UDe(e){let t=e.toLowerCase();return c.IsEqual(t,"undefined")||c.IsEqual(t,"null")||c.IsEqual(e,"")||c.IsEqual(e,"0")?ce(null):void 0}function wDe(e){return c.IsBigInt(e)?CDe(e):c.IsBoolean(e)?RDe(e):c.IsNumber(e)?PDe(e):c.IsNull(e)?ce(null):c.IsString(e)?UDe(e):c.IsUndefined(e)?ce(null):void 0}var pte=BigInt(Number.MAX_SAFE_INTEGER),lte=BigInt(Number.MIN_SAFE_INTEGER);function vDe(e){return e<=pte&&e>=lte?ce(Number(e)):void 0}function NDe(e){return ce(e?1:0)}function kDe(e){let t=+e;if(c.IsNumber(t))return ce(t);let r=e.toLowerCase();if(c.IsEqual(r,"false"))return ce(0);if(c.IsEqual(r,"true"))return ce(1);let o=eD(e);return JM(o)?o.value<=pte&&o.value>=lte?ce(Number(o.value)):void 0:void 0}function LDe(e){return c.IsBigInt(e)?vDe(e):c.IsBoolean(e)?NDe(e):c.IsNumber(e)?ce(e):c.IsNull(e)?ce(0):c.IsString(e)?kDe(e):c.IsUndefined(e)?ce(0):void 0}function MDe(e){return c.IsBigInt(e)?ce(e.toString()):c.IsBoolean(e)?ce(e.toString()):c.IsNumber(e)?ce(e.toString()):c.IsNull(e)?ce("null"):c.IsString(e)?ce(e):c.IsUndefined(e)?ce(""):void 0}function DDe(e){return c.IsEqual(e,BigInt(0))?ce(void 0):void 0}function FDe(e){return c.IsEqual(e,!1)?ce(void 0):void 0}function $De(e){return c.IsEqual(e,0)?ce(void 0):void 0}function GDe(e){let t=e.toLowerCase();return c.IsEqual(t,"undefined")||c.IsEqual(t,"null")||c.IsEqual(e,"")||c.IsEqual(e,"0")?ce(void 0):void 0}function BDe(e){return c.IsBigInt(e)?DDe(e):c.IsBoolean(e)?FDe(e):c.IsNumber(e)?$De(e):c.IsNull(e)?ce(void 0):c.IsString(e)?GDe(e):c.IsUndefined(e)?ce(e):void 0}function dte(e,t,r){return at.TryArray(r).value.map(i=>Pr(e,t.items,i))}function mte(e,t,r){let o=at.TryBigInt(r);return at.IsOk(o)?o.value:r}function fte(e,t,r){let o=at.TryBoolean(r);return at.IsOk(o)?o.value:r}function gte(e,t,r){return Pr({...e,...t.$defs},pn(t.$ref),r)}function hte(e,t,r){return Pr(e,Nn(t),r)}function yte(e,t,r){let o=at.TryNumber(r);return at.IsOk(o)?Math.trunc(o.value):r}function Ete(e,t,r){let o=Li(e,t),i=Nn(o);return Pr(e,i,r)}function jDe(e,t,r){let o=at.TryBigInt(r);return at.IsOk(o)&&c.IsEqual(t.const,o.value)?o.value:r}function qDe(e,t,r){let o=at.TryBoolean(r);return at.IsOk(o)&&c.IsEqual(t.const,o.value)?o.value:r}function HDe(e,t,r){let o=at.TryNumber(r);return at.IsOk(o)&&c.IsEqual(t.const,o.value)?o.value:r}function KDe(e,t,r){let o=at.TryString(r);return at.IsOk(o)&&c.IsEqual(t.const,o.value)?o.value:r}function Tte(e,t,r){return c.IsEqual(t.const,r)?r:O4(t)?jDe(e,t,r):A4(t)?qDe(e,t,r):Hx(t)?HDe(e,t,r):Kx(t)?KDe(e,t,r):_r()}function Ste(e,t,r){let o=at.TryNull(r);return at.IsOk(o)?o.value:r}function _te(e,t,r){let o=at.TryNumber(r);return at.IsOk(o)?o.value:r}function BC(e,t,r,o){let i=c.Keys(o);for(let[s,a]of t)for(let u of i)s.test(u)||(o[u]=Pr(e,r,o[u]));return o}function bT(e,t,r){return Nr(e)&&c.IsUndefined(r[t])}function zDe(e,t,r){let o=c.EntriesRegExp(t.properties),i=c.Keys(r);for(let[s,a]of o)for(let u of i)!s.test(u)||bT(a,u,r)||(r[u]=Pr(e,a,r[u]));return c.HasPropertyKey(t,"additionalProperties")&&c.IsObject(t.additionalProperties)?BC(e,o,t.additionalProperties,r):r}function Ite(e,t,r){return c.IsObjectNotArray(r)?zDe(e,t,r):r}function YDe(e,t,r){let o=c.EntriesRegExp(t.patternProperties),i=c.Keys(r);for(let[s,a]of o)for(let u of i)s.test(u)&&(r[u]=Pr(e,a,r[u]));return c.HasPropertyKey(t,"additionalProperties")&&c.IsObject(t.additionalProperties)?BC(e,o,t.additionalProperties,r):r}function bte(e,t,r){return c.IsObjectNotArray(r)?YDe(e,t,r):r}function xte(e,t,r){return c.HasPropertyKey(e,t.$ref)?Pr(e,e[t.$ref],r):r}function Ote(e,t,r){let o=at.TryString(r);return at.IsOk(o)?o.value:r}function Ate(e,t,r){return Pr(e,Nn(t),r)}function Cte(e,t,r){if(!c.IsArray(r))return r;for(let o=0;o<Math.min(t.items.length,r.length);o++)r[o]=Pr(e,t.items[o],r[o]);return r}function Rte(e,t,r){let o=at.TryUndefined(r);return at.IsOk(o)?o.value:r}function Pte(e,t,r){if(t.anyOf.some(a=>bt(e,a,r)))return r;let s=t.anyOf.map(a=>Pr(e,a,Rr(r))).find(a=>bt(e,t,a));return c.IsUndefined(s)?r:s}function Ute(e,t,r){let o=at.TryUndefined(r);return at.IsOk(o)?void 0:r}function Pr(e,t,r){return Ze(t)?dte(e,t,r):$o(t)?mte(e,t,r):so(t)?fte(e,t,r):Mt(t)?gte(e,t,r):Mr(t)?hte(e,t,r):dn(t)?yte(e,t,r):ge(t)?Ete(e,t,r):ze(t)?Tte(e,t,r):ea(t)?Ste(e,t,r):ar(t)?_te(e,t,r):Te(t)?Ite(e,t,r):_t(t)?bte(e,t,r):yt(t)?xte(e,t,r):qr(t)?Ote(e,t,r):Dt(t)?Ate(e,t,r):Ge(t)?Cte(e,t,r):gs(t)?Rte(e,t,r):z(t)?Pte(e,t,r):Bo(t)?Ute(e,t,r):r}function op(...e){let[t,r,o]=ot.Match(e,{3:(i,s,a)=>[i,s,a],2:(i,s)=>[{},i,s]});return Pr(t,r,o)}function wte(e,t,r){if(!c.IsArray(r))return r;for(let o=0;o<r.length;o++)r[o]=gn(e,t.items,r[o]);return r}function vte(e,t,r){return gn({...e,...t.$defs},pn(t.$ref),r)}function Nte(e,t){return c.IsUndefined(t)?c.IsFunction(e.default)?e.default():Rr(e.default):t}function kte(e,t,r){let o=Li(e,t),i=Nn(o);return gn(e,i,r)}function Lte(e,t,r){if(!c.IsObject(r))return r;let o=c.Keys(t.properties);for(let i of o){let s=gn(e,t.properties[i],r[i]);c.IsUndefined(s)&&(Nr(t.properties[i])||!c.HasPropertyKey(t.properties[i],"default"))||(r[i]=s)}if(!da(t)||c.IsBoolean(t.additionalProperties))return r;for(let i of c.Keys(r))o.includes(i)||(r[i]=gn(e,t.additionalProperties,r[i]));return r}function Mte(e,t,r){if(!c.IsObject(r))return r;let[o,i]=[new RegExp(Hr(t)),Zt(t)];for(let s of c.Keys(r))o.test(s)&&di(i)&&(r[s]=gn(e,i,r[s]));if(!da(t))return r;for(let s of c.Keys(r))o.test(s)||(r[s]=gn(e,t.additionalProperties,r[s]));return r}function Dte(e,t,r){return c.HasPropertyKey(e,t.$ref)?gn(e,e[t.$ref],r):r}function Fte(e,t,r){if(!c.IsArray(r))return r;let[o,i]=[t.items,Math.max(t.items.length,r.length)];for(let s=0;s<i;s++)s<o.length&&(r[s]=gn(e,o[s],r[s]));return r}function $te(e,t,r){for(let o of t.anyOf){let i=gn(e,o,Rr(r));if(bt(e,o,i))return i}return r}function gn(e,t,r){let o=di(t)?Nte(t,r):r;return Ze(t)?wte(e,t,o):Mt(t)?vte(e,t,o):ge(t)?kte(e,t,o):Te(t)?Lte(e,t,o):_t(t)?Mte(e,t,o):yt(t)?Dte(e,t,o):Ge(t)?Fte(e,t,o):z(t)?$te(e,t,o):o}function dd(...e){let[t,r,o]=ot.Match(e,{3:(i,s,a)=>[i,s,a],2:(i,s)=>[{},i,s]});return gn(t,r,o)}function eg(e){return(...t)=>{let[r,o,i]=ot.Match(t,{3:(s,a,u)=>[s,a,u],2:(s,a)=>[{},s,a]});return e.reduce((s,a)=>a(r,o,s),i)}}function VDe(e,t,r){return t["~codec"].decode(r)}function WDe(e,t,r){return t["~codec"].encode(r)}function er(e,t,r,o){return Pl(r)?c.IsEqual(e,"Decode")?VDe(t,r,o):WDe(t,r,o):o}function QDe(e,t,r,o){if(!c.IsArray(o))return o;for(let i=0;i<o.length;i++)o[i]=cr(e,t,r.items,o[i]);return er(e,t,r,o)}function ZDe(e,t,r,o){let i=er(e,t,r,o);if(!c.IsArray(i))return i;for(let s=0;s<i.length;s++)i[s]=cr(e,t,r.items,i[s]);return i}function Gte(e,t,r,o){return c.IsEqual(e,"Decode")?QDe(e,t,r,o):ZDe(e,t,r,o)}function Bte(e,t,r,o){return o=cr(e,{...t,...r.$defs},pn(r.$ref),o),er(e,t,r,o)}function jte(e){return e.reduce((t,r)=>({...t,...r}),{})}function qte(e,t){for(let r of t)if(!c.IsDeepEqual(e,r))return r;return e}function XDe(e,t,r,o){if(c.IsEqual(r.allOf.length,0))return er(e,t,r,o);let i=r.allOf.map(u=>cr(e,t,u,ga(u,Rr(o)))),a=i.every(u=>c.IsObject(u))?jte(i):qte(o,i);return er(e,t,r,a)}function JDe(e,t,r,o){if(c.IsEqual(r.allOf.length,0))return er(e,t,r,o);let i=er(e,t,r,o),s=r.allOf.map(u=>cr(e,t,u,ga(u,Rr(i))));return s.every(u=>c.IsObject(u))?jte(s):qte(i,s)}function Hte(e,t,r,o){return c.IsEqual(e,"Decode")?XDe(e,t,r,o):JDe(e,t,r,o)}function eFe(e,t,r,o){if(!c.IsObjectNotArray(o))return o;for(let i of c.Keys(r.properties))!c.HasPropertyKey(o,i)||bT(r.properties[i],i,o)||(o[i]=cr(e,t,r.properties[i],o[i]));return er(e,t,r,o)}function tFe(e,t,r,o){let i=er(e,t,r,o);if(!c.IsObjectNotArray(i))return i;for(let s of c.Keys(r.properties))!c.HasPropertyKey(i,s)||bT(r.properties[s],s,i)||(i[s]=cr(e,t,r.properties[s],i[s]));return i}function Kte(e,t,r,o){return c.IsEqual(e,"Decode")?eFe(e,t,r,o):tFe(e,t,r,o)}function rFe(e,t,r,o){if(!c.IsObjectNotArray(o))return o;let i=new RegExp(Hr(r));for(let s of c.Keys(o))i.test(s)&&(o[s]=cr(e,t,Zt(r),o[s]));return er(e,t,r,o)}function nFe(e,t,r,o){let i=er(e,t,r,o);if(!c.IsObjectNotArray(i))return i;let s=new RegExp(Hr(r));for(let a of c.Keys(i))s.test(a)&&(i[a]=cr(e,t,Zt(r),i[a]));return i}function zte(e,t,r,o){return c.IsEqual(e,"Decode")?rFe(e,t,r,o):nFe(e,t,r,o)}function Yte(e,t,r,o){return c.HasPropertyKey(t,r.$ref)?cr(e,t,t[r.$ref],o):o}function Vte(e,t,r,o){return c.IsEqual(e,"Decode")?er(e,t,r,Yte(e,t,r,o)):Yte(e,t,r,er(e,t,r,o))}function oFe(e,t,r,o){if(!c.IsArray(o))return o;for(let i=0;i<Math.min(r.items.length,o.length);i++)o[i]=cr(e,t,r.items[i],o[i]);return er(e,t,r,o)}function iFe(e,t,r,o){let i=er(e,t,r,o);if(!c.IsArray(i))return o;for(let s=0;s<Math.min(r.items.length,i.length);s++)i[s]=cr(e,t,r.items[s],i[s]);return i}function Wte(e,t,r,o){return c.IsEqual(e,"Decode")?oFe(e,t,r,o):iFe(e,t,r,o)}function sFe(e,t,r,o){for(let i of r.anyOf){if(!bt(t,i,o))continue;let s=cr(e,t,i,o);return er(e,t,r,s)}return o}function aFe(e,t,r,o){let i=er(e,t,r,o);for(let s of r.anyOf){let a=cr(e,t,s,Rr(i));if(bt(t,s,a))return a}return i}function Qte(e,t,r,o){return c.IsEqual(e,"Decode")?sFe(e,t,r,o):aFe(e,t,r,o)}function cr(e,t,r,o){return Ze(r)?Gte(e,t,r,o):Mt(r)?Bte(e,t,r,o):ge(r)?Hte(e,t,r,o):Te(r)?Kte(e,t,r,o):_t(r)?zte(e,t,r,o):yt(r)?Vte(e,t,r,o):Ge(r)?Wte(e,t,r,o):z(r)?Qte(e,t,r,o):er(e,t,r,o)}var tD=class extends np{constructor(t,r){super("Decode",t,r)}};function cFe(e,t,r){if(!bt(e,t,r))throw new tD(r,fa(e,t,r));return r}function uFe(e,t,r){let o=Br.Get().unionPrioritySort?Jf(t):t;return cr("Decode",e,o,r)}var fZt=eg([(e,t,r)=>Rr(r),(e,t,r)=>dd(e,t,r),(e,t,r)=>op(e,t,r),(e,t,r)=>ga(e,t,r),(e,t,r)=>cFe(e,t,r),(e,t,r)=>uFe(e,t,r)]);var rD=class extends np{constructor(t,r){super("Encode",t,r)}};function pFe(e,t,r){if(!bt(e,t,r))throw new rD(r,fa(e,t,r));return r}function lFe(e,t,r){let o=Br.Get().unionPrioritySort?Jf(t):t;return cr("Encode",e,o,r)}var CZt=eg([(e,t,r)=>Rr(r),(e,t,r)=>lFe(e,t,r),(e,t,r)=>dd(e,t,r),(e,t,r)=>op(e,t,r),(e,t,r)=>ga(e,t,r),(e,t,r)=>pFe(e,t,r)]);var Bi=class extends Error{constructor(t,r){super(r),this.type=t}};function Zte(e,t){return c.IsFunction(t.default)?t.default(t):c.IsObject(t.default)?Rr(t.default):t.default}function Xte(e,t){if(Hf(t)&&!di(t))throw new Bi(t,"Arrays with uniqueItems constraints must specify a default annotation");let r=Bf(t)?t.minItems:0;return Array.from({length:r},()=>Ur(e,t.items))}function Jte(e,t){return Pc(t)?BigInt(t.exclusiveMinimum)+BigInt(1):Uc(t)?BigInt(t.minimum):BigInt(0)}function ere(e,t){return!1}function tre(e,t){let r=Ur(e,t.instanceType);return class{constructor(){Object.assign(this,r)}}}function rre(e,t){return Ur({...e,...t.$defs},pn(t.$ref))}function nre(e,t){return Ur(e,Nn(t))}function ore(e,t){let r=Ur(e,t.returnType);return()=>r}function ire(e,t){return Pc(t)&&c.IsNumber(t.exclusiveMinimum)?t.exclusiveMinimum+1:Uc(t)?t.minimum:0}function sre(e,t){let r=Li(e,t),o=Nn(r);return Ur(e,o)}function are(e,t){return t.const}function cre(e,t){throw new Bi(t,"Cannot create TNever types")}function ure(e,t){return null}function pre(e,t){return Pc(t)&&c.IsNumber(t.exclusiveMinimum)?t.exclusiveMinimum+1:Uc(t)?t.minimum:0}function lre(e,t){return(c.IsUndefined(t.required)?[]:t.required).reduce((o,i)=>({...o,[i]:Ur(e,t.properties[i])}),{})}function dre(e,t){if(uT(t)&&!di(t))throw new Bi(t,"Record with the minProperties constraint must have a default annotation");return{}}function mre(e,t){return c.HasPropertyKey(e,t.$ref)?Ur(e,e[t.$ref]):(()=>{throw new Bi(t,"Unable to deref Ref")})()}function fre(e,t){if((pT(t)||aT(t))&&!di(t))throw Error("Strings with format or pattern constraints must specify default");let o=cT(t)?t.minLength:0;return"".padEnd(o)}function gre(e,t){return Symbol()}function hre(e,t){let r=pE(t.pattern);if(qr(r))throw new Bi(t,"Unable to create TemplateLiteral due to infinite type expansion");return Ur(e,r)}function yre(e,t){return Array.from({length:t.minItems},(r,o)=>Ur(e,t.items[o]))}function Ere(e,t){if(c.IsEqual(t.anyOf.length,0))throw Error("Unable to create Union with no variants");return Ur(e,t.anyOf[0])}function Ur(e,t){return di(t)?Zte(e,t):Ze(t)?Xte(e,t):$o(t)?Jte(e,t):so(t)?ere(e,t):wr(t)?tre(e,t):Mt(t)?rre(e,t):Mr(t)?nre(e,t):vr(t)?ore(e,t):dn(t)?ire(e,t):ge(t)?sre(e,t):ze(t)?are(e,t):Do(t)?cre(e,t):ea(t)?ure(e,t):ar(t)?pre(e,t):Te(t)?lre(e,t):_t(t)?dre(e,t):yt(t)?mre(e,t):qr(t)?fre(e,t):ta(t)?gre(e,t):Dt(t)?hre(e,t):Ge(t)?yre(e,t):gs(t)?void 0:z(t)?Ere(e,t):Bo(t)?void 0:void 0}function ha(...e){let[t,r]=ot.Match(e,{2:(o,i)=>[o,i],1:o=>[{},o]});return Ur(t,r)}var nD=class extends np{constructor(t,r){super("Parse",t,r)}};function dFe(e,t,r){WM();let o=fa(e,t,r);if(QM(),!bt(e,t,r))throw new nD(r,o);return r}var VJt=eg([(e,t,r)=>Rr(r),(e,t,r)=>dd(e,t,r),(e,t,r)=>op(e,t,r),(e,t,r)=>ga(e,t,r),(e,t,r)=>dFe(e,t,r)]);var fFe=me({type:$e("insert"),path:wn(),value:jr()}),gFe=Object({type:$e("update"),path:wn(),value:jr()}),hFe=me({type:$e("delete"),path:wn()}),ter=Pe([fFe,gFe,hFe]);var md=k(function*(e){if(!e.body)return yield*new It({message:"This command does not accept a request body"});let t=e.body;return t.examples?.length?t.examples[0]:ha(t)});var _re=" (unix seconds, ISO 8601, or relative like -1h/-30m/now)",tg=Fe("file").pipe(Ks("f"),X("Read body from file (use - for stdin)"),Ee("FILE_PATH"),Je),fd=Fe("data").pipe(Ks("d"),X("Inline JSON body"),Ee("JSON"),Je),gd=qn("generate-skeleton").pipe(X("Print a JSON skeleton for the request body and exit"),_n(!1)),Yt={from:Fe("from").pipe(X(`Start of time range${_re}. Start narrow and widen step by step only when the result is empty`),Ee("TIMESTAMP"),Je),to:Fe("to").pipe(X(`End of time range${_re}`),Ee("TIMESTAMP"),Je)},ip=Fe("query").pipe(X("Tsuga query to filter results"),Ee("TSUGA_QUERY"),Je),rg=qm("max-results").pipe(Ru(e=>Number.isSafeInteger(e)&&e>0,()=>"--max-results must be a positive safe integer"),X("Maximum number of results"),Ee("COUNT"),Je),sp={limit:qm("limit").pipe(Ru(e=>Number.isSafeInteger(e)&&e>=1&&e<=qu,()=>`--limit must be an integer from 1 to ${qu}`),X(`Maximum number of items to return, up to ${qu} (default: ${qO})`),Ee("N"),Je),offset:qm("offset").pipe(Ru(e=>Number.isSafeInteger(e)&&e>=0,()=>"--offset must be a non-negative safe integer"),X("Number of items to skip, to request a later page"),Ee("N"),Je),all:qn("all").pipe(X("Follow every page and print all items as one page; cannot be combined with --limit or --offset"),_n(!1))},zr=k(function*(e){return{from:yield*jC("from",e.from),to:yield*jC("to",e.to)}}),jC=k(function*(e,t){let r=yield*gt,o=oe(t)??(yield*r.getDefault(e));if(!o)return yield*new It({message:`--${e} is required`});let i=Math.floor((yield*Fn)/ql),s=yield*lt({try:()=>sA(o,i),catch:a=>new It({message:a instanceof Error?a.message:String(a)})});return Number.isSafeInteger(s)?s:yield*new It({message:`Invalid time value: ${o}. Unix seconds must be a safe integer.`})}),hd=k(function*(e,t){let r=yield*gt;return oe(t)??(yield*r.getDefault(e))});function Ire(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 bre(e,t){let r=e[t];return typeof r=="string"?r:nh(r)&&Rt(r)&&typeof r.value=="string"?r.value:void 0}function hn(e){let t={};for(let[r,o]of Object.entries(e))o!==void 0&&(t[r]=o);return t}var Mn=(e,t,r)=>P(e,{file:tg,data:fd,generateSkeleton:gd},v(`cli.${e}`)(function*(o){if(o.generateSkeleton){yield*Es(yield*md(r));return}yield*xe(yield*tt(r,{body:yield*rd(o)}))})).pipe(U(t));var xre=Mn("scalar","Run aggregation queries and return scalar results",RA);var Ore=Mn("timeseries","Run aggregation queries and return timeseries results",PA);var Are=P("aggregation").pipe(U("Run aggregation queries"),_e([xre,Ore]));var Nre=require("node:crypto");var xT=require("node:crypto");function TFe(e){return(0,xT.createHash)("sha256").update(e).digest("base64url")}function Cre(){let e=(0,xT.randomBytes)(32).toString("base64url");return{verifier:e,challenge:TFe(e)}}var Ure=require("node:http"),sD=require("node:os");var SFe=[":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(""),_Fe=['<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 oD(e,t){let r=G0(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>${SFe}</style></head><body><main>`,`<span class="tile">${_Fe}</span>`,`<div class="copy"><h1>${r}</h1><p>${G0(t)}</p></div>`,"</main></body></html>"].join("")}var wre="/oauth/callback",bFe=5*Hl,xFe=oD("Login complete","You can close this tab and return to the terminal."),Rre=oD("Login failed","Return to the terminal for details."),{$match:OFe,Code:AFe,Failed:iD,NotACallback:Pre}=g_();function CFe(e){return(0,sD.platform)()==="darwin"?["open",[e]]:(0,sD.platform)()==="win32"?["rundll32",["url.dll,FileProtocolHandler",e]]:["xdg-open",[e]]}var RFe=(e,t,r)=>je(()=>{let o,i=Z(()=>{o!==void 0&&(e.off("request",o),o=void 0)});return Tn(s=>{let a=(u,l,d)=>{u.writeHead(l,{"Content-Type":"text/html"}),u.end(d)};o=(u,l)=>{OFe({NotACallback:()=>a(l,404,Rre),Failed:({message:d})=>{a(l,400,Rre),s(F(new _c({message:d})))},Code:({code:d})=>{a(l,200,xFe),s(A(d))}})(UFe(u.url??"/",r,t))},e.on("request",o)}).pipe(ko(i),Hj({duration:bFe,orElse:()=>new _c({message:"Timed out waiting for the browser to complete login (5 minutes)."})}))}),PFe=v("auth.openBrowser")(function*(e){let[t,r]=CFe(e);return yield*to(H(Ui(t,r,{stdin:"ignore",stdout:{stream:"ignore"},stderr:{stream:"ignore"}}),o=>eo(o.unref,o.exitCode))).pipe(zp({onSuccess:o=>Number(o)===0,onFailure:()=>!1}))});function UFe(e,t,r){let o;try{o=new URL(e,t)}catch{return Pre()}if(o.pathname!==wre)return Pre();let i=o.searchParams.get("error");if(i){let a=o.searchParams.get("error_description")??"";return iD({message:`Authorization failed: ${i}${a?` (${a})`:""}`})}if(o.searchParams.get("state")!==r)return iD({message:"State mismatch on OAuth callback; aborting for safety."});let s=o.searchParams.get("code");return s?AFe({code:s}):iD({message:"OAuth callback did not include an authorization code."})}var vre=v("auth.captureAuthorizationCode")(function*(e){let t=yield*No(Z(()=>{let l=(0,Ure.createServer)();return l.on("connection",d=>d.unref()),l}),l=>Z(()=>l.close())),o=`http://127.0.0.1:${yield*Tn(l=>{let d=g=>{l(new _c({message:`Could not open a loopback port: ${g.message}`}))};t.once("error",d),t.listen(0,"127.0.0.1",()=>{t.off("error",d);let g=t.address();l(g===null||typeof g=="string"?new _c({message:"Loopback server did not report a usable address."}):A(g.port))})})}`,i=`${o}${wre}`,s=yield*pu(RFe(t,e.state,o),{startImmediately:!0}),a=e.buildAuthorizeUrl(i);return yield*pu(pt(function*(){(yield*PFe(a))?(yield*Yn("Opening your browser to complete login..."),yield*Yn("If it does not open, visit this URL:")):yield*Yn("Visit this URL in your browser to complete login:"),yield*Yn(` ${a}`)}),{startImmediately:!0}),{code:yield*$h(s),redirectUri:i}},to);var kre=P("login",{},v("cli.auth.login")(function*(){let e=yield*gt,t=yield*Wu,r=yield*e.resolveApiUrl,{verifier:o,challenge:i}=Cre(),s=(0,Nre.randomBytes)(16).toString("base64url"),{code:a,redirectUri:u}=yield*vre({state:s,buildAuthorizeUrl:g=>v7(r,{redirectUri:g,challenge:i,state:s})}),l=yield*t.exchangeCode(r,{code:a,verifier:o,redirectUri:u}),d=yield*e.saveUserAuth($A(l));yield*De(`Logged in. Session token ${Df(l.accessToken)} saved to ${d}`)})).pipe(U("Log in as a user with a browser authorization flow and save the session (replaces any saved operation API key)"));var Lre=P("logout",{},v("cli.auth.logout")(function*(){yield*(yield*gt).clearUserAuth,yield*De("Local user session cleared.")})).pipe(U("Clear the saved user session"));var Yr=e=>Yb(Il,e);var Mre=(e,t)=>Vb(Il,e,t);var ur=x(2,(e,t)=>Wb(e,t));var Dre=x(e=>zb(e[0]),(e,t)=>XN(e,t)),Fre=x(2,(e,t)=>jm(e,t));var $re=(e,t)=>Gy(Il,e,t);var Gre=x(3,(e,t,r)=>Xb(e,t,r));var Bre=P("operation-key",{key:Yr("OPERATION_API_KEY").pipe(ur("The operation API key to save"),Fre(e=>e.trim()),Gre(e=>e.length>0,()=>"OPERATION_API_KEY must not be empty or whitespace-only"))},v("cli.auth.operationKey")(function*({key:e}){let t=yield*gt;yield*t.saveOperationApiKey(e),yield*De(`Operation API key saved to ${t.configPath}`)})).pipe(U("Save an operation API key to the config file (replaces any saved user session)"));function jre(e,t){let r=Df(e.accessToken),o=Date.parse(e.accessExpiresAt),i=!!e.refreshToken;if(Number.isNaN(o))return`Logged in as a user (token ${r}, expires ${e.accessExpiresAt}).`;let s=Sm(ns(o));return s<=t?i?`Logged in as a user (token ${r}). Access token expired ${qC(s,t)} ago, on ${e.accessExpiresAt}; the next command renews it automatically.`:`Logged in as a user (token ${r}). Session expired ${qC(s,t)} ago, on ${e.accessExpiresAt}. Run \`tsuga auth login\` to sign in again.`:i?`Logged in as a user (token ${r}). Access token expires in ${qC(t,s)}, on ${e.accessExpiresAt}; the session renews automatically.`:`Logged in as a user (token ${r}). Session expires in ${qC(t,s)}, on ${e.accessExpiresAt}.`}function qC(e,t){let r=m7(f7({start:e,end:t}),{format:["years","months","days","hours","minutes"]});return r===""?"less than a minute":r}var qre=P("status",{},v("cli.auth.status")(function*(){let e=yield*pa,t=yield*gt,{credential:r}=yield*t.resolve({operationApiKey:e.operationApiKey,clusterId:e.cluster});if(!r){yield*De("Not authenticated. Run `tsuga auth login` or `tsuga auth operation-key <OPERATION_API_KEY>`.");return}let o=r.kind;switch(o){case"user-session":{let i=yield*A2;yield*De(jre(r.userAuth,i));return}case"operation-api-key":yield*De("Authenticated with an operation API key.");return;default:wt(o)}})).pipe(U("Show the current authentication method"));var Hre=P("token",{},v("cli.auth.token")(function*(){let e=yield*gt,t=yield*e.resolveApiUrl,r=yield*e.getUserAuth;if(!r){let i=t===eT?"":` for ${t}`;return yield*new Yu({message:`No user session${i}.`,suggestions:["Sign in with your browser: tsuga auth login"]})}let o=yield*BA(t,r);yield*De(o.accessToken)})).pipe(U("Print the saved user access token to stdout"));var yd="/v0/admin-center";var wFe="^\\S(.*\\S)?$",vFe=50,NFe=128,kFe=256,LFe=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"}),MFe=n.Object({key:n.String({maxLength:NFe,description:"Tag key to attach to the resource."}),value:n.String({maxLength:kFe,pattern:wFe,description:"Tag value to attach to the resource. Leading or trailing whitespace is rejected."})},{title:"Tag"}),Vr=n.Array(LFe,{title:"Tags",description:"Key/value tags applied to the resource. Use them to organize resources and to satisfy tag policies."}),rn=n.Array(MFe,{title:"Tags",maxItems:vFe,description:"Key/value tags to apply to the resource. Tag policies may require specific keys or values."}),vt=n.Optional(Vr),$t=n.Optional(rn);var ap="/v0/teams",zC=["public","private"],HC={NAME:"name",CREATED_AT:"createdAt",MEMBER_COUNT:"memberCount",VISIBILITY:"visibility"},DFe=n.Enum([HC.NAME,HC.CREATED_AT,HC.MEMBER_COUNT,HC.VISIBILITY],{description:"Team field used for sorting list responses. Use `name`, `createdAt`, `memberCount`, or `visibility`."}),YC=n.Object({color:n.Enum(F0,{description:"Color token used by Tsuga when rendering the team avatar."}),mode:n.Enum($0,{description:"Avatar rendering mode selected for the team."}),iconName:n.Enum(VZ,{description:"Icon name rendered inside the team avatar when icon mode is used."})}),ng=n.Object({color:n.Enum(F0),mode:n.Enum($0)}),FFe=100,$Fe=250,Kre=n.Object({id:n.String(),name:n.String(),email:n.String(),role:n.Enum($i),joinedTeamAt:w(),orgRole:n.Enum(wA),avatar:n.Optional(ng)}),aD=3,cD=n.Pick(Kre,["id","name","avatar"]),cp=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(zC,{description:"`public` makes team-owned resources discoverable according to access controls. `private` restricts discovery to team members and authorized users."}),tags:vt,createdAt:w({description:"Timestamp when Tsuga created the team."}),updatedAt:w({description:"Timestamp when Tsuga last updated the team metadata."}),memberCount:n.Optional(n.Number({description:"Number of members currently in the team"})),memberPreview:n.Optional(n.Array(cD,{description:`First ${aD} members of the team, sorted by name.`})),avatar:n.Optional(YC)}),VC=n.Object({name:n.String({minLength:1,maxLength:FFe,format:Mi,description:"Name to assign to the team. Must be kebab-case (lowercase letters, numbers, and dashes only) and unique in the organization."}),description:Ye(n.String({maxLength:$Fe}),{description:"Team description."}),visibility:n.Enum(zC,{description:"`public` makes team-owned resources discoverable according to access controls. `private` restricts discovery to team members and authorized users."}),tags:$t,avatar:Ye(YC)}),zre=n.Object({searchQuery:n.Optional(p({description:"Substring matched against team names, descriptions, and IDs."})),visibility:n.Optional(n.Enum(zC,{description:"Restrict results to teams with this visibility."})),myTeamsOnly:n.Optional(n.Boolean({description:"If true, return only teams that include the authenticated user."}))}),uD=n.Optional(p({allowEmpty:!1,description:"Exact team name to look up. Returns at most one team, since team names are unique."})),tor=f({tags:["teams"],url:ap,method:"GET",paginated:!0,response:n.Array(cp),query:n.Object({...fe,includeMemberPreview:n.Optional(n.Boolean({description:"Adds `memberCount` and `memberPreview` to every returned team."})),...zre.properties,name:uD,sortBy:n.Optional(DFe),sortDirection:n.Optional(le)})}),ror=f({tags:["teams"],url:`${ap}/:id`,method:"GET",params:n.Object({id:p()}),response:cp}),KC={NAME:"name",ROLE:"role",ORG_ROLE:"orgRole",JOINED_TEAM_AT:"joinedTeamAt"},GFe=n.Enum([KC.NAME,KC.ROLE,KC.ORG_ROLE,KC.JOINED_TEAM_AT]),nor=f({tags:["teams"],url:`${ap}/:id/members`,method:"GET",paginated:!0,params:n.Object({id:p()}),query:n.Object({...fe,searchQuery:n.Optional(p({description:"Substring matched against member names, emails, and IDs."})),teamRole:n.Optional(n.Array(n.Enum($i),{maxItems:$i.length,uniqueItems:!0,description:"Restrict results to members with one of these team roles."})),sortBy:n.Optional(GFe),sortDirection:n.Optional(le)}),response:n.Array(Kre)}),oor=f({tags:["teams"],url:`${ap}/:id/assets`,method:"GET",params:n.Object({id:p()}),response:n.Object({apiKeyCount:n.Number(),logRouteCount:n.Number(),monitorCount:n.Number(),notificationRuleCount:n.Number(),dashboardCount:n.Number(),sloCount:n.Number()})}),ior=f({tags:["teams"],url:ap,method:"POST",body:VC,response:cp}),sor=f({tags:["teams"],url:`${ap}/:id`,method:"PUT",params:n.Object({id:p()}),body:VC,response:cp}),BFe=D("type",[n.Object({type:n.Literal("ids"),teamIds:n.Array(p({allowEmpty:!1}),{minItems:1,maxItems:100})}),n.Object({type:n.Literal("all"),filters:n.Optional(zre)})]),aor=f({tags:["teams"],url:`${ap}/bulk-update`,method:"POST",body:n.Object({selection:BFe,config:n.Object({visibility:n.Enum(zC)})}),response:n.Object({})}),cor=f({tags:["teams"],url:`${ap}/:id`,method:"DELETE",params:n.Object({id:p()}),response:B});var jFe=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."}),Se=D("type",[n.Object({type:n.Literal("user",{description:"The resource was created or updated by a user."}),id:n.String({description:"Unique identifier of the user actor."}),name:n.String({description:"Display name of the user actor at the time of response."}),avatar:n.Optional(ng)}),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(jFe)})],{description:"User or operation API key responsible for creating or updating a resource. Returned by Tsuga for audit context."});var AT=`${yd}/custom-roles`,qFe=50,HFe=3,KFe=20,zFe=["read","write"],OT=n.Enum(["read"],{description:"Access granted on this resource type."}),rt=n.Enum(zFe,{description:"Access granted on this resource type. `write` implies `read`."});var Wre="Teams the role grants its asset permissions on. `all` covers every team, `public` covers public teams only, `specific` covers the listed teams, and `all-except` covers every team but the listed ones.",Qre="Team IDs the scope applies to.",Yre=n.Array(n.String(),{description:Qre}),YFe=D("type",[n.Object({type:n.Literal("all")},{title:"CustomRoleAllTeams"}),n.Object({type:n.Literal("public")},{title:"CustomRolePublicTeams"}),n.Object({type:n.Literal("specific"),teamIds:Yre},{title:"CustomRoleSpecificTeams"}),n.Object({type:n.Literal("all-except"),teamIds:Yre},{title:"CustomRoleAllTeamsExcept"})],{description:Wre}),Vre=n.Array(p({allowEmpty:!1}),{minItems:1,maxItems:qFe,uniqueItems:!0,description:Qre}),VFe=D("type",[n.Object({type:n.Literal("all")}),n.Object({type:n.Literal("public")}),n.Object({type:n.Literal("specific"),teamIds:Vre}),n.Object({type:n.Literal("all-except"),teamIds:Vre})],{description:Wre}),WFe=n.Object({database:OT,inventory:OT,queue:OT,service:OT,"audit-log":OT}),QFe=n.Object({"allowed-domains":rt,"audit-log-stream-destination":rt,"cluster-integration-config":rt,"custom-usage-tag":rt,"databricks-connection":rt,"github-connection":rt,"llm-provider":rt,"retention-policy":rt,"saml-config":rt,"sensitive-data-scanner-rule":rt,"service-target":rt,"team-remap-config":rt,"adaptive-notification-rule":rt,"cloud-account":rt,"dashboard-folder":rt,"monitor-folder":rt,"dashboard-report":rt,"dashboard-share":rt,dashboard:rt,"ingestion-api-key":rt,investigation:rt,"log-route":rt,"metric-route":rt,"span-route":rt,monitor:rt,notebook:rt,"notification-integration":rt,"notification-rule":rt,"notification-silence":rt,"operation-api-key":rt,"quality-report":rt,"rum-public-token":rt,"sandbox-configuration":rt,slo:rt,"synthetic-test":rt,"synthetic-variable":rt,"tag-policy":rt,"user-invitation":rt}),Zre=n.Object({...n.Partial(n.Object({...WFe.properties,...QFe.properties})).properties,team:rt},{description:"Access level granted per resource type, within the role team scope. An omitted resource type grants no access."});var Xre=n.Array(n.Enum(v0),{description:"Telemetry signals the role can read. An empty array grants no telemetry access."}),pD="Additional restriction applied cluster-side to every telemetry query the role holder runs. Each entry keeps only the data points whose `key` matches one of `values`, and entries are combined with AND.",Jre="Attribute key matched against telemetry data points, such as `env` or `service.name`.",ene="Values the attribute must equal for a data point to be kept. A data point matching any of them is kept.",ZFe=n.Array(n.Object({key:n.String({description:Jre}),values:n.Array(n.String(),{description:ene})}),{description:pD}),XFe=n.Array(n.Object({key:p({allowEmpty:!1,description:Jre}),values:n.Array(n.String({minLength:1,maxLength:ci,pattern:"^(?!\\*$)",errorMessage:{pattern:"Must not be '*'."}}),{minItems:1,maxItems:KFe,description:ene})}),{maxItems:HFe,description:pD}),Ed=n.Object({id:n.String({description:"Tsuga-generated custom role ID assigned at creation."}),name:n.String({description:"Human-readable custom role name, unique across the account."}),description:n.Optional(n.String({description:"Free-form description of the custom role. Absent when not set."})),teamScope:YFe,assets:Zre,telemetry:Xre,telemetryQuery:n.Optional(ZFe),creator:n.Optional(Se),updater:n.Optional(Se),createdAt:w({description:"Timestamp when Tsuga created the custom role."}),updatedAt:w({description:"Timestamp when Tsuga last updated the custom role."})}),tne=n.Pick(Ed,["teamScope","assets","telemetry","telemetryQuery"],{description:"What the custom role grants its holder."}),JFe=100,WC=n.Object({name:n.String({minLength:1,maxLength:JFe,format:Mi,description:"Human-readable custom role name, unique across the account."}),description:Ye(p({type:"short"}),{description:"Free-form description of the custom role. Omit on update to keep the current description, or pass null to remove it."}),teamScope:VFe,assets:Zre,telemetry:Xre,telemetryQuery:Ye(XFe,{description:`${pD} Omit on update to keep the current restriction, or pass null to remove it.`})}),xor=f({tags:["custom-roles"],url:AT,method:"GET",response:n.Array(Ed)}),Oor=f({tags:["custom-roles"],url:`${AT}/:id`,method:"GET",params:n.Object({id:p({allowEmpty:!1})}),response:Ed}),Aor=f({tags:["custom-roles"],url:AT,method:"POST",body:WC,response:Ed}),Cor=f({tags:["custom-roles"],url:`${AT}/:id`,method:"PUT",params:n.Object({id:p({allowEmpty:!1})}),body:WC,response:Ed}),Ror=f({tags:["custom-roles"],url:`${AT}/:id`,method:"DELETE",params:n.Object({id:p({allowEmpty:!1})}),response:B});var e$e={"ai-sandboxes":"AI tasks",analytics:"Analytics","browser-views":"RUM Browser views","dashboard-reports":"Dashboard reports",dashboards:"Dashboards",databases:"Databases",ecs:"ECS","inventory-all-resources":"All cloud resources","inventory-overview":"Cloud resources overview","inventory-settings":"Cloud resources settings",inventory:"Cloud resources",investigations:"Investigations",issues:"Issues",kubernetes:"Kubernetes","log-routes":"Log routes",logs:"Logs","metric-routes":"Metric routes",metrics:"Metrics",mobile:"RUM Mobile",monitor:"Monitors",notebooks:"Notebooks","notification-integrations":"Notification integrations","notification-rules-list":"Notification rules","notification-rules":"Notifications","notification-silences":"Notification silences","ongoing-alerts":"Ongoing alerts",queues:"Queues",routes:"Routes",rum:"RUM views","sensitive-data-scanner":"Sensitive data scanner",serverless:"Serverless",services:"Services",sessions:"Sessions",slo:"SLOs","span-routes":"Span routes",synthetics:"Synthetics","team-map":"Service map",traces:"Traces"},t$e=Object.keys(e$e),lD=n.Enum(t$e,{description:"Stable nav item key within a main sidebar category."}),rne="Nav item keys shown in the primary sidebar for this category, in display order.",nne="Nav item keys for this category that are folded away (e.g. View more). Omitted or empty means none.",one=e=>D("type",[n.Object({type:n.Literal("dashboard"),id:e("Tsuga-generated ID of the dashboard the item opens.")}),n.Object({type:n.Literal("service"),serviceName:e("OpenTelemetry service name of the service whose page the item opens."),serviceNamespace:n.Optional(e("OpenTelemetry service namespace of that service. Omitted for a service without one."))}),n.Object({type:n.Literal("browser-view"),pageId:e("View name identifying the page the item opens."),app:e("Application the view belongs to."),env:e("Environment the view was observed in.")})],{description:"Page the user added to their personal sidebar."}),r$e=one(e=>n.String({description:e})),n$e=one(e=>p({allowEmpty:!1,description:e}));var o$e=50,ine=`Items shown in the primary sidebar for this category, in display order: nav item keys, and pages the user added to their personal sidebar (at most ${o$e} across all categories).`,i$e=n.Array(n.String(),{description:rne}),s$e=n.Optional(n.Array(n.String(),{description:nne})),a$e=n.Array(lD,{description:rne}),c$e=n.Optional(n.Array(lD,{description:nne})),sne="Stable category id. Unknown or renamed ids are ignored by the client catalog.",ane="Sidebar categories in display order. Unknown or renamed ids are ignored by the client catalog.",cne=e=>n.Object({categories:n.Array(n.Object({id:n.String({description:sne}),visible:e,folded:s$e}),{description:ane})}),une=e=>n.Object({categories:n.Array(n.Object({id:p({allowEmpty:!1,description:sne}),visible:e,folded:c$e}),{description:ane})}),Nor=cne(i$e),kor=une(a$e),pne=cne(n.Array(n.Union([n.String(),r$e]),{description:ine})),lne=une(n.Array(n.Union([lD,n$e]),{description:ine}));var fne=["YYYY-MM-DD","DD-MM-YYYY","MM-DD-YYYY"],gne=["12h","24h"],p$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()]),l$e=n.Union([D("type",[n.Object({type:n.Literal("home")}),n.Object({type:n.Literal("explorer")}),n.Object({type:n.Literal("metrics")}),n.Object({type:n.Literal("traces")}),n.Object({type:n.Literal("analytics")}),n.Object({type:n.Literal("dashboards"),id:p()}),n.Object({type:n.Literal("ongoing-alerts")}),n.Object({type:n.Literal("services")}),n.Object({type:n.Literal("rum-views")})]),n.Null()]),mD=p({allowEmpty:!1,description:"Identifier of the custom role to assign. Use the `id` returned by the custom role endpoints."}),hne=D("type",[n.Object({type:n.Enum(Xu,{description:"Built-in organization role: `admin`, `public_editor`, `public_viewer`, or `teams_only`."})}),n.Object({type:n.Literal("custom",{description:"Assigns the custom role `customRoleId`."}),customRoleId:mD})],{description:"Organization role to assign: a built-in role `type`, or `custom` with the `customRoleId` of a custom role."}),d$e=D("type",[n.Object({type:n.Enum(Xu,{description:"Built-in organization role: `admin`, `public_editor`, `public_viewer`, or `teams_only`."})}),n.Object({type:n.Literal("custom",{description:"The user holds a custom role."}),customRoleId:n.String({description:"Identifier of the custom role. Use it with the custom role endpoints to read what the role grants."})})]),Nc=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.Union([n.Enum(wA,{description:"Organization role for the user: `admin`, `public_editor`, `public_viewer`, `teams_only`, or `custom` when the user holds a custom role."}),d$e],{description:"Organization role for the user, either as a role key or as an object with the role `type` and, for a custom role, its `customRoleId`. Handle both forms: the object form replaces the role key."}),customRoleId:n.Optional(n.String({description:"Identifier of the custom role held by the user, when `role` is the `custom` key. The object form of `role` carries it instead. Use it with the custom role endpoints to read what the role grants."})),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(ng),defaultView:n.Optional(p$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(fne),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(gne),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(pne),fromSso:n.Boolean({description:"Whether the user account was provisioned or authenticated through SSO."}),createdAt:w({description:"Timestamp when Tsuga created the user."}),updatedAt:w({description:"Timestamp when Tsuga last updated the user."}),teamIds:n.Optional(n.Array(n.String(),{description:"Team IDs the user currently belongs to."}))}),{role:zor,customRoleId:Yor,...dne}=Nc.properties,fD=D("role",[n.Object({...dne,role:n.Enum(Xu,{description:"Organization role for the user: `admin`, `public_editor`, `public_viewer` or `teams_only`."})}),n.Object({...dne,role:n.Literal("custom",{description:"The user holds a custom role."}),customRole:tne})]),yne=n.Intersect([cp,n.Object({userRole:n.Enum($i)})]),Ene=n.Object({status:n.Literal("authenticated"),token:n.String(),user:fD}),Tne=D("status",[Ene,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."})})]),Vor=f({tags:["users"],url:"/v0/login",method:"POST",body:n.Object({email:p({type:"email"}),password:p({type:"long"})}),response:Tne}),Sne="/v0/login/totp",Wor=f({tags:["users"],url:`${Sne}/setup`,method:"POST",body:n.Object({mfaToken:p({type:"long"})}),response:n.Object({mfaToken:n.String({description:"Replaces the login MFA token; pass it when verifying the first code."}),secret:n.String({description:"Base32 secret for manual entry in the authenticator app."})})}),Qor=f({tags:["users"],url:Sne,method:"POST",body:n.Object({mfaToken:p({type:"long"}),code:n.String({pattern:`^[0-9]{${6}}$`,description:"The 6-digit code shown by the authenticator app."})}),response:Ene}),Zor=f({tags:["users"],url:"/v0/forgot-password",method:"POST",body:n.Object({email:p({type:"email"})}),response:n.Object({})}),Xor=f({tags:["users"],url:"/v0/reset-password",method:"POST",body:n.Object({resetToken:p(),password:p({type:"user-password"})}),response:n.Object({})}),m$e=["active","expired"],Jor=f({tags:["users"],url:"/v0/reset-password-status/:resetToken",method:"GET",params:n.Object({resetToken:p()}),response:n.Object({status:n.Enum(m$e)})}),eir=f({tags:["users"],url:"/v0/change-password",method:"POST",body:n.Object({currentPassword:p({type:"long"}),newPassword:p({type:"user-password"})}),response:n.Object({})}),up="/v0/users",gD="/v0/current-user",tir=f({tags:["users"],url:gD,method:"GET",response:fD}),rir=f({tags:["users"],url:`${gD}/teams`,method:"GET",response:n.Array(yne)}),nir=f({tags:["users"],url:"/v0/logout",method:"POST",response:n.Object({})}),oir=f({tags:["users"],method:"PATCH",url:gD,body:n.Partial(n.Object({avatar:n.Union([ng,n.Null()]),defaultView:l$e,timezone:n.Union([n.String({format:$l}),n.Null()]),dateFormat:n.Union([n.Enum(fne),n.Null()]),hourFormat:n.Union([n.Enum(gne),n.Null()]),favoriteDashboards:n.Array(p({allowEmpty:!1})),favoriteFolders:n.Array(p({allowEmpty:!1})),filterDataByTeams:n.Boolean(),sidebarNavLayout:n.Union([lne,n.Null()]),name:p()}),{minProperties:1}),response:fD}),iir=f({tags:["users"],url:up,method:"GET",response:n.Array(Nc),query:n.Optional(n.Object({includeTeamIds:n.Optional(n.Boolean())}))}),mne={count:n.Integer({description:"Number of members holding the role."}),preview:n.Array(cD,{description:`First ${aD} members holding the role, sorted by name.`})},f$e=D("role",[n.Object({role:n.Enum(Xu),...mne}),n.Object({role:n.Literal("custom"),customRoleId:n.String(),...mne})]),sir=f({tags:["users"],url:`${up}/role-members`,method:"GET",response:n.Array(f$e,{description:"Member count and preview of every role held by at least one member."})}),CT={NAME:"name",ROLE:"role",LOGIN_METHOD:"fromSso",TEAMS:"teams",CREATED_AT:"createdAt"},_ne=n.Partial(n.Object({searchQuery:n.Object({value:p({allowEmpty:!1,description:"Substring to match against the member name, email, or ID."})},{description:"Substring matched against the member name, email, or ID"})},{description:"Optional filters applied to narrow the returned members"})),g$e=n.Partial(n.Object({...fe,includeTeamIds:n.Boolean({description:"When true, include the IDs of the teams each member belongs to."}),filters:_ne,sort:n.Object({by:n.Enum([CT.NAME,CT.ROLE,CT.LOGIN_METHOD,CT.TEAMS,CT.CREATED_AT],{description:"Field to sort the returned members by"}),direction:le},{description:"Optional sorting applied to the returned members"})})),air=f({tags:["users"],url:`${up}/query`,method:"POST",paginated:!0,response:n.Array(Nc),body:g$e}),{teamIds:cir,...h$e}=Nc.properties,y$e=n.Object({...h$e,teams:n.Optional(n.Array(yne))}),uir=f({tags:["users"],url:`${up}/:id`,method:"GET",params:n.Object({id:p({allowEmpty:!1})}),query:n.Optional(n.Object({includeTeamRoles:n.Optional(n.Boolean())})),response:y$e}),dD=ui(_ne),pir=f({tags:["users"],method:"PUT",url:`${up}/bulk-update-role`,body:n.Union([D("role",[n.Object({role:n.Enum(Xu),selection:dD}),n.Object({role:n.Literal("custom"),selection:dD,customRoleId:mD})]),n.Object({selection:dD,role:hne})]),response:n.Object({})}),lir=f({tags:["users"],url:`${up}/:id`,method:"DELETE",params:n.Object({id:p()}),response:B}),dir=f({tags:["users"],url:`${up}/:id/totp`,method:"DELETE",params:n.Object({id:p()}),response:B}),mir=f({tags:["users"],url:`${up}/all-emails`,method:"GET",response:n.Array(n.String())}),Ine=["pending","accepted","expired","revoked"],E$e=n.Enum(Ine),Td="/v0/invitations",T$e=10,hD={email:p({type:"email",description:"Lowercase email address to invite into the organization."}),teamId:p({description:"Team ID to add the invited user to after acceptance."}),teamRole:n.Enum($i,{description:"Role the invited user receives in the target team once accepted: `admin`, `editor`, or `viewer`."})},S$e=n.Object({...hD,userRole:n.Enum(Xu,{description:"Organization role the invited user receives after acceptance: `admin`, `public_editor`, `public_viewer`, or `teams_only`."})}),_$e=n.Object({...hD,userRole:n.Literal("custom",{description:"Assigns the custom role identified by `customRoleId` after acceptance."}),customRoleId:mD}),I$e=n.Object({...hD,userRole:hne}),b$e=n.Union([D("userRole",[S$e,_$e]),I$e]),fir=f({tags:["invitations"],url:`${Td}/create`,method:"POST",body:n.Array(b$e,{maxItems:T$e}),response:n.Object({success:n.Boolean(),message:n.String()})}),gir=f({tags:["invitations"],url:`${Td}/resend/:id`,params:n.Object({id:p()}),method:"POST",response:n.Object({success:n.Boolean(),message:n.String()})}),bne=n.Partial(n.Object({searchQuery:n.Object({value:p({allowEmpty:!1,description:"Substring to match against the invitation email, team name, or status."})},{description:"Substring matched against the invitation email, team name, or status"})},{description:"Optional filters applied to narrow the returned invitations"})),x$e=ui(bne),hir=f({tags:["invitations"],url:`${Td}/bulk-resend`,method:"POST",body:n.Object({selection:x$e}),response:n.Object({success:n.Boolean(),message:n.String()})}),yir=f({tags:["invitations"],url:Td,method:"POST",body:n.Object({secret:p()}),response:n.Object({status:E$e,email:n.String(),teamName:n.Optional(n.String()),avatar:n.Optional(YC)})}),Eir=f({tags:["invitations"],url:`${Td}/accept`,method:"POST",body:n.Object({name:p({type:"short"}),password:p({type:"user-password"}),secret:p()}),response:Tne}),Tir=f({tags:["invitations"],url:`${Td}/revoke/:id`,params:n.Object({id:p()}),method:"POST",response:n.Object({success:n.Boolean(),message:n.String()})}),O$e=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($i,{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(Ine,{description:"Invitation lifecycle status: `pending`, `accepted`, `expired`, or `revoked`. `expired` can be computed from `expiresAt` when invitations are listed."}),expiresAt:w({description:"Timestamp when the invitation expires if not accepted."}),createdAt:w({description:"Timestamp when Tsuga created the invitation."}),updatedAt:w({description:"Timestamp when Tsuga last updated the invitation."})}),QC={EMAIL:"email",TEAM:"team",STATUS:"status",CREATED_AT:"createdAt"},A$e=n.Partial(n.Object({...fe,filters:bne,sort:n.Object({by:n.Enum([QC.EMAIL,QC.TEAM,QC.STATUS,QC.CREATED_AT],{description:"Field to sort the returned invitations by"}),direction:le},{description:"Optional sorting applied to the returned invitations"})})),Sir=f({tags:["invitations"],url:`${Td}/query`,method:"POST",paginated:!0,response:n.Array(O$e),body:A$e});var og="/v0/operation-api-keys",xne="tsuga_op",One="v1";var C$e=100,Ane=n.Enum(S0,{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."}),Is=e=>n.Literal("read",{description:e}),tr=e=>n.Enum(["read","write"],{description:e}),RT=n.Partial(n.Object({investigations:tr("Investigations, the records collecting the timeline and findings of an incident analysis."),dashboard:tr("Dashboards and the graphs they contain."),"dashboard-folder":tr("Folders organizing dashboards."),"monitor-folder":tr("Folders organizing monitors."),documentation:Is("Tsuga documentation and API reference pages, which are public content rather than account data."),"ingestion-api-key":tr("Ingestion API keys, used to send telemetry data to Tsuga."),"rum-public-token":tr("RUM public tokens, embedded in web and mobile applications to send real user monitoring telemetry."),"operation-api-key":tr("Operation API keys, used to authenticate API, Terraform, MCP, and Tsuga CLI clients."),inventory:Is("Cloud resources discovered by inventory scans."),"cloud-account":tr("Cloud accounts Tsuga scans to discover resources."),"custom-role":tr("Custom global roles, which define what their holders can access across the organization."),"data-deletion-request":tr("Data deletion requests, which delete the telemetry events matching a query on a cluster."),logs:Is("Ingested log events, through search and aggregation endpoints."),"log-route":tr("Log routes, which select newly ingested logs and apply processors to them."),metrics:Is("Ingested metrics, through query and aggregation endpoints."),"metric-route":tr("Metric routes, which select newly ingested metrics by name and apply processors to them."),"span-route":tr("Span routes, which select newly ingested spans and apply processors to them."),monitor:tr("Monitors, the alert definitions evaluated against telemetry."),"allowed-domains":tr("Email domains whose users are allowed to join the organization."),queue:Is("Message queues of the catalog, inferred from telemetry."),"quality-report":Is("Telemetry quality reports."),billing:Is("Ingested data volume billed to the organization."),service:Is("Services of the catalog, inferred from telemetry."),"service-target":tr("Notification targets attached to a service."),slo:tr("Service level objectives and the alerts attached to them."),"notification-rule":tr("Notification rules, which route alert transitions to notification targets."),"adaptive-notification-rule":tr("Adaptive notification rules, which page the owners of the failing service when one of their monitors or SLOs fires."),"notification-integration":tr("Notification integrations, containing the credentials Tsuga uses when sending notifications."),"notification-silence":tr("Notification silences, which suppress matching notification delivery."),"custom-usage-tag":tr("Custom usage tags, the telemetry tag keys tracked as usage dimensions."),"retention-policy":tr("Retention policies applied to logs, metrics, and traces."),"sandbox-configuration":Is("Sandbox agent configurations of the key's teams, and the sandbox agent runs launched with them."),"tag-policy":tr("Tag policies, which enforce tag requirements on Tsuga-managed assets and telemetry data."),team:tr("Teams, their settings and their memberships."),traces:Is("Ingested spans, through search and aggregation endpoints."),rum:Is("Ingested RUM events, through search and aggregation endpoints."),user:tr("User accounts of the organization."),"user-invitation":tr("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."}),ig=n.Object({id:n.String({description:"Unique identifier of the operation API key. Generated by Tsuga when the key is created. Use this as the stable key identifier when correlating API calls with audit logs or key-management records."}),name:n.String({description:"Display name of the operation API key. Set by the user who created or last updated the key. Returned for every operation-key-authenticated request so clients can show which saved key is active."}),owner:n.String({description:"Identifier of the team that owns the operation API key. Set when the key is created or updated. Combined with `scope`, it determines which team-owned resources the key can reach."}),tags:vt,scope:Ane,permissions:RT,keyLastCharacters:n.String({description:"Last characters of the operation API key secret. Set by Tsuga from the generated secret and returned because the full secret is only shown once at creation. Use this to distinguish saved keys without exposing the secret."}),updatedAt:w(),createdAt:w(),creator:n.Optional(Se),updater:n.Optional(Se),expiresAt:n.Optional(w({description:"Timestamp after which the operation API key stops authenticating. Set when the key is created or updated. Returned only for keys that have an expiration date."})),lastUsedAt:n.Optional(w())}),ZC=n.Object({name:n.String({format:Mi,minLength:1,maxLength:C$e,description:"Kebab-case name for the operation API key."}),owner:p({allowEmpty:!1,description:"ID of the team that owns the operation API key. When the caller is an operation API key, the team must be within the caller's scope."}),tags:$t,scope:Ane,permissions:RT,expiresAt:Ye(p({allowEmpty:!1,type:"date-time",description:"Date and time after which the key stops working. Send null for a key that never expires. On update, leave it out to keep the current expiration. When the caller is an operation API key, set a future expiration, no later than the caller's own when the caller expires."}))}),Uir=f({tags:["operation-api-keys"],url:og,method:"POST",body:ZC,response:n.Object({...ig.properties,key:n.String()})}),wir=f({tags:["operation-api-keys"],url:og,method:"GET",paginated:!0,query:n.Object(fe),response:n.Array(ig)}),vir=f({tags:["operation-api-keys"],url:`${og}/:id`,method:"GET",params:n.Object({id:p({allowEmpty:!1})}),response:ig}),Nir=f({tags:["operation-api-keys"],url:`${og}/:id`,method:"PUT",params:n.Object({id:p()}),body:ZC,response:ig}),kir=f({tags:["operation-api-keys"],url:`${og}/:id`,method:"DELETE",params:n.Object({id:p()}),response:B}),Lir=f({tags:["operation-api-keys"],url:`${og}/bulk-delete`,method:"DELETE",body:n.Object({ids:n.Array(p({allowEmpty:!1}),{uniqueItems:!0})}),response:n.Object({})});var PT=`/${"v1"}/operation-api-keys`,Sd=n.Pick(ig,["id","name","owner","tags","scope","permissions","keyLastCharacters","expiresAt"],{$id:"OperationApiKey",description:"Operation API key used to authenticate API, Terraform, MCP, and Tsuga CLI clients. The full key secret is returned only when the key is created. See [API keys](/documentation/account-and-settings/api-keys)."}),Cne={id:"123-456-abc",name:"terraform-production",owner:"team-123-abc",tags:[{key:"env",value:"production"}],scope:"owning-team-only",permissions:{dashboard:"write",monitor:"write",logs:"read"},keyLastCharacters:"x7Qm"};Object.assign(Sd,{examples:[Cne]});var Rne={...n.Pick(ZC,["name","owner","tags","scope","permissions"]).properties,expiresAt:p({allowEmpty:!1,type:"date-time",description:"Date and time after which the key stops working. When the caller is an operation API key, set a future expiration, no later than the caller's own when the caller expires."})},Pne=n.Object(Rne,{$id:"CreateOperationApiKeyRequest",description:"Operation API key creation request. Provide a kebab-case name, owner team, scope, permissions, expiration date, and optionally tags."}),Une=n.Object(Rne,{$id:"UpdateOperationApiKeyRequest",description:"Operation API key update request. Provide the full definition, including name, owner team, scope, permissions, and expiration date."}),wne={name:"terraform-production",owner:"team-123-abc",tags:[{key:"env",value:"production"}],scope:"owning-team-only",permissions:{dashboard:"write",monitor:"write",logs:"read"},expiresAt:"2027-01-01T00:00:00.000Z"};Object.assign(Pne,{examples:[wne]});Object.assign(Une,{examples:[wne]});var R$e={...Cne,key:`${xne}:${One}:abc123xyx7Qm`},vne="When the caller is an operation API key, the resulting key cannot have a wider scope than the caller, cannot have a higher permission level than the caller on any resource, must have an expiration in the future, and cannot expire later than the caller's own expiration.",qir=f({description:"Lists operation API keys, the machine credentials of the public API, with their owner team, scope, permissions, tags and expiry. Only the last characters of each secret are returned. Keys that send telemetry are ingestion API keys.",operationId:"listOperationApiKeys",tags:["operation-api-keys"],url:PT,method:"GET",paginated:!0,query:n.Object(qe),response:n.Array(Sd)}),Hir=f({description:"Retrieves one operation API key by ID. The response never includes the full secret key value; only the last visible characters are returned.",operationId:"getOperationApiKey",tags:["operation-api-keys"],url:`${PT}/:id`,method:"GET",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the operation API key to retrieve. Use the `id` returned by operation API key list or create responses."})}),response:Sd}),P$e=n.Object({...Sd.properties,key:n.String({description:"Full operation API key secret. Returned only in the create response; list, get, and update responses expose only `keyLastCharacters`."})},{title:"OperationApiKeyCreated",example:R$e}),Kir=f({description:`Creates an operation API key. Store the returned \`key\` immediately because Tsuga returns the full secret only in this response. ${vne}`,operationId:"createOperationApiKey",tags:["operation-api-keys"],url:PT,method:"POST",body:Pne,response:P$e}),zir=f({description:`Updates an operation API key by ID, including name, owner, tags, scope, permissions, and expiration. The secret key value is not rotated by this operation. ${vne} The key to update must also belong to a team within the scope of the caller.`,operationId:"updateOperationApiKey",tags:["operation-api-keys"],url:`${PT}/:id`,method:"PUT",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the operation API key to update. Use the `id` returned by operation API key list, get, or create responses."})}),body:Une,response:Sd}),Yir=f({description:"Deletes an operation API key by ID. Clients using the deleted key can no longer authenticate with it. When the caller is an operation API key, the key must belong to a team within the scope of the caller.",operationId:"deleteOperationApiKey",tags:["operation-api-keys"],url:`${PT}/:id`,method:"DELETE",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the operation API key to delete. Use the `id` returned by operation API key list, get, or create responses."})}),response:B});var U$e=`/${"v1"}/me`,Nne=n.Object({type:n.Literal("operation-api-key",{description:"Credential type for this response variant. Set by Tsuga from the bearer token used on the request. Returned as `operation-api-key` when the request authenticated with an operation API key."}),...n.Pick(Sd,["id","name","owner","scope","permissions","keyLastCharacters","expiresAt"]).properties},{$id:"OperationApiKeyIdentity",description:"Identity and effective access for the operation API key used on the request. Returned when the bearer token is an operation API key. See [API keys](/documentation/account-and-settings/api-keys)."}),w$e={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(Nne,{examples:[w$e]});var kne=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(Nc,["id","email","name","role","orgId","orgName"]).properties,...n.Required(n.Pick(Nc,["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)."}),v$e={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(kne,{examples:[v$e]});var N$e=D("type",[Nne,kne],{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."}),Lne=f({description:"Returns who the request is authenticated as: for an operation API key, its name, owner team, scope, permissions and expiry; for an OAuth access token, the user, organization and role. Any valid public API credential can call it, without resource permissions.",operationId:"getMe",tags:["public","authentication"],url:U$e,method:"GET",response:N$e});var k$e={all:"all permitted telemetry","owning-team-and-public":"owning team plus public data","owning-team-only":"owning team only"};function L$e(e){switch(e.type){case"operation-api-key":return["Authenticated as an operation API key.",...yD([["Name",e.name],["Key",`\u2022\u2022\u2022\u2022${e.keyLastCharacters}`],["ID",e.id],["Owning team",e.owner],["Data scope",`${e.scope} (${k$e[e.scope]})`],["Expires",e.expiresAt??"never"]]),"",...M$e(e.permissions)].join(`
|
|
284
284
|
`);case"user":return["Authenticated as a user.",...yD([["Name",e.name],["Email",e.email],["ID",e.id],["Role",typeof e.role=="string"?e.role:e.role.type]]),"","Access follows the organization role, not a per-resource permission map."].join(`
|
|
285
285
|
`);default:wt(e)}}function M$e(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:",...yD(r)]}function yD(e){let t=Math.max(...e.map(([r])=>r.length));return e.map(([r,o])=>` ${r.padEnd(t)} ${o}`)}var Mne=P("whoami",{output:nx("output",["text","json"]).pipe(Ks("o"),X("Output format: text | json"),_n("text"))},v("cli.auth.whoami")(function*({output:e}){let t=yield*Xt(Lne);if(e==="json"){yield*xe({data:t});return}yield*De(L$e(t))})).pipe(U("Ask Tsuga which credential this CLI authenticates as, and print its scope and permissions"));var Dne=P("auth").pipe(U("Manage authentication: user login (OAuth) or operation API key"),_e([kre,Lre,Hre,Bre,qre,Mne]));var D$e="/v0/billing/focus",ED="1.4",_d=31,XC=e=>n.String({description:`${e} UTC, formatted as ISO 8601.`}),UT=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:XC("Exclusive end of the calendar month holding the charge,"),BillingPeriodStart:XC("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:XC("Exclusive end of the day the data was ingested,"),ChargePeriodStart:XC("Inclusive start of the day the data was ingested,"),ConsumedQuantity:n.Number({description:"Uncompressed ingested volume, in gigabytes."}),ConsumedUnit:n.Literal("GB",{description:"Unit of `ConsumedQuantity`."}),ContractedCost:n.Literal(0,{description:"Always 0 for now."}),EffectiveCost:n.Literal(0,{description:"Always 0 for now."}),HostProviderName:n.Literal("Tsuga",{description:"Entity hosting the infrastructure the service runs on."}),InvoiceIssuerName:n.Literal("Tsuga",{description:"Entity issuing the invoice."}),ListCost:n.Literal(0,{description:"Always 0 for now."}),PricingQuantity:n.Number({description:"Billable volume, in gigabytes."}),PricingUnit:n.Literal("GB",{description:"Unit of `PricingQuantity`."}),ServiceCategory:n.Literal("Management and Governance",{description:"FOCUS service category."}),ServiceName:n.String({description:"Tsuga product the data was ingested into: `Tsuga Logs`, `Tsuga Metrics`, `Tsuga Traces`, `Tsuga RUM`, or `Tsuga Profiling`."}),ServiceProviderName:n.Literal("Tsuga",{description:"Entity providing the service."}),ServiceSubcategory:n.Literal("Observability",{description:"FOCUS service subcategory."})}),TD=n.Object(tn.properties,{description:`Time range to export. It is widened to whole UTC days and must span at most ${_d} days.`}),ysr=f({tags:["billing"],url:D$e,method:"GET",query:TD,response:n.Array(UT)});var Fne=n.Object(UT.properties,{$id:"FocusBillingRow",description:`One FOCUS ${ED} cost and usage row: the volume of one telemetry kind ingested on one UTC day.`}),F$e={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(Fne,{examples:[F$e]});var $ne=f({description:`Exports the ingested data volume of the organization as FOCUS ${ED} 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 ${_d} 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:TD,response:n.Array(Fne)});var lo=qn("pretty").pipe(X("Print an aligned table instead of JSON"),_n(!1)),Gne=Fe("fields").pipe(X("Comma-separated dot-paths to select from JSON objects or each row of a JSON array; also selects the columns of a --pretty table. Text and binary output are unchanged."),Ee("FIELDS"),zs($$e),Ru(e=>e.length>0,()=>"--fields must contain at least one field name"),Je,zs(oe));function $$e(e){return e.split(",").map(t=>t.trim()).filter(t=>t.length>0)}var G$e=Object.keys(UT.properties),Bne=P("export",{...Yt,pretty:lo},v("cli.billing.export")(function*(e){let t=yield*mn,{from:r,to:o}=yield*zr(e),i=Math.ceil(o/iA)-Math.floor(r/iA);if(i>_d)return yield*new It({message:`--from/--to span ${i} days; a FOCUS export covers at most ${_d} days. Export one shorter range at a time.`});let s=yield*Xt($ne,{query:{from:r,to:o}});yield*t.rows(s,{...e,defaultFields:G$e})})).pipe(U(`Export ingested data volume as FOCUS cost and usage rows, at most ${_d} days per call`));var jne=P("billing").pipe(U("Export billing cost and usage data"),_e([Bne]));var qne=P("list",{},v("cli.clusters.list")(function*(){yield*xe(yield*tt(FA))})).pipe(U("List all Tsuga clusters available to the operation API key"));var Hne=P("clusters").pipe(U("Manage Tsuga cluster selection"),_e([qne]));var Kne=P("defaults",{},v("cli.config.resetDefaults")(function*(){yield*(yield*gt).resetDefaults,yield*De("Custom defaults cleared")})).pipe(U("Clear all custom defaults"));var zne=P("reset").pipe(U("Reset configuration values"),_e([Kne]));var Yne=P("default",{key:Mre("FLAG_NAME",q0).pipe(ur(`The flag to set a default for. One of: ${q0.join(" | ")}`)),value:Fe("value").pipe(X("The default value. Use --value=-1h for dash-prefixed values; an empty value clears the default"),Ee("VALUE"),zs(e=>e.trim()))},v("cli.config.setDefault")(function*({key:e,value:t}){let r=yield*gt;if(t===""){yield*r.setDefault(e,t),yield*De(`Default cleared: ${e}`);return}yield*B$e(e,t),yield*r.setDefault(e,t),yield*De(`Default set: ${e} = ${t}`)})).pipe(U("Set a custom default value for a command flag"),px([{description:"Widen the default log search window",command:"config set default from --value=-1h"},{description:"Go back to the built-in default",command:"config set default from --value ''"}]));function B$e(e,t){switch(e){case"from":case"to":return Ka(jC(e,pe(t)));case"max-results":{let r=Number(t);return Number.isSafeInteger(r)&&r>0?Me:new It({message:`The default for max-results must be a positive safe integer (got: ${t})`})}case"query":case"cluster":return Me;default:return wt(e)}}var Vne=P("telemetry",{consent:$re("STATE",[["on",!0],["off",!1]]).pipe(ur("Whether to send usage data"))},v("cli.config.setTelemetry")(function*({consent:e}){yield*(yield*gt).saveTelemetryConsent(e);let t=(yield*Z0)===void 0?"":" (TSUGA_TELEMETRY overrides it)";yield*De(`Usage data: ${e?"on":"off"}${t}`)})).pipe(U("Turn sending anonymous usage data on or off"),px([{description:"Stop sending usage data",command:"config set telemetry off"}]));var Wne=P("set").pipe(U("Set a configuration value"),_e([Yne,Vne]));var Qne=v("cli.config.show")(function*(){let e=yield*pa,t=yield*gt,r=yield*t.resolve({operationApiKey:e.operationApiKey,clusterId:e.cluster});yield*De(aX(r,t.configPath).trimEnd())});var Zne=P("config",{},Qne).pipe(U("Show or manage configuration"),_e([Wne,zne]));var Xne=P("get",{path:Yr("DOC_PATH").pipe(ur("Path or link of the page to fetch"))},v("cli.docs.get")(function*({path:e}){yield*Qa({[F8]:e}),yield*xe(yield*tt(lX,{query:{path:e}}))})).pipe(U("Get a documentation or API-reference page by path or link (e.g. 'getting-started/send-your-first-logs' or 'api/aggregateScalar')"));var Jne=P("search",{query:Yr("SEARCH_TEXT").pipe(ur("Text to search for"))},v("cli.docs.search")(function*({query:e}){yield*Qa({[$8]:e}),yield*xe(yield*tt(jA,{query:{query:e}}))})).pipe(U("Search Tsuga documentation and the full API reference, ranked by relevance"));var eoe=P("docs").pipe(U("Search and fetch Tsuga documentation and API-reference pages"),_e([Xne,Jne]));var wT="/v0/sandbox-runs",j$e=["running","completed","failed","cancelled"],q$e=n.Enum(j$e,{description:"Lifecycle status of the sandbox agent run"}),H$e="^[A-Za-z0-9][A-Za-z0-9._-]*\\.md$",K$e=50,z$e=25e3,Y$e=1e5,toe=`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 ${Y$e} characters in total. Runs rewrite them, so review them like any agent output.`,SD=n.Record(n.String(),n.String(),{description:toe}),_D=n.Record(n.String({pattern:H$e}),n.String({maxLength:z$e}),{additionalProperties:!1,minProperties:1,maxProperties:K$e,description:toe,examples:[{"MEMORY.md":"- [Topic](topic.md) - one-line summary"}]}),roe=30,V$e=D("type",[n.Object({type:n.Literal("quality-report-auto-fix"),ruleKey:n.String({description:"Quality-report rule the run tried to fix."}),teamId:n.Optional(n.String({description:"Team the rule failed for."})),teamName:n.Optional(n.String({description:"Name of that team."})),configurationId:n.Optional(n.String({description:"Sandbox configuration the run used."})),configurationName:n.Optional(n.String({description:"Name of that configuration."}))}),n.Object({type:n.Literal("scheduled"),scheduledRunId:n.String({description:"Scheduled run that launched the run."}),scheduledRunName:n.String({description:"Name of that scheduled run."}),configurationId:n.String({description:"Sandbox configuration the run used."}),configurationName:n.Optional(n.String({description:"Name of that configuration. Missing when the launch failed before the configuration was read."}))})],{description:"What launched the run."}),noe=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."}),ooe=200,vT=n.Object({id:n.String({description:"Tsuga-generated sandbox run ID."}),status:q$e,trigger:V$e,clusterId:n.String({description:"Cluster the agent queried."}),error:n.Optional(n.String({description:"Why the run failed or stopped."})),usage:n.Optional(noe),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(Se),createdAt:w({description:"When the run started."}),completedAt:n.Optional(w({description:"When the run finished."}))}),war=f({tags:["sandbox-runs"],url:wT,method:"GET",response:n.Array(vT)}),Nar=f({tags:["sandbox-runs"],url:`${wT}/:id`,method:"GET",params:n.Object({id:p()}),response:vT}),kar=f({tags:["sandbox-runs"],url:`${wT}/validate`,method:"POST",body:n.Object({runId:p({allowEmpty:!1,description:"Active sandbox run whose ID identifies the container."}),clusterId:p({allowEmpty:!1,description:"Cluster the run targets; must belong to the operation key's organization."})}),response:n.Object({authorized:n.Boolean({description:"True when the key may execute this sandbox run."})})}),Lar=f({tags:["sandbox-runs"],url:`${wT}/:id/cancel`,method:"POST",params:n.Object({id:p()}),response:n.Object({})}),Mar=f({tags:["sandbox-runs"],url:`${wT}/:id/complete`,method:"POST",params:n.Object({id:p({description:"Sandbox run the agent finished."})}),body:n.Object({status:n.Enum(["completed","failed"],{description:"Completed when the agent exited successfully, failed otherwise."}),output:n.Optional(n.String({description:"The agent's final output."})),error:n.Optional(n.String({description:"Why the run failed."})),usage:n.Optional(noe),memory:n.Optional(_D)}),response:n.Object({})});var pp="/v0/sandbox-configurations",W$e=100,Q$e=60,ioe="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.",soe=`Maximum minutes the sandbox agent may run before it is stopped. Defaults to ${roe} when unset.`,aoe="Slack channel told when a run of this configuration finishes, through a Slack notification integration. Omit it to notify no one.",Z$e=n.Object({type:n.Literal("slack"),integrationId:n.String({description:"Slack notification integration to post with."}),channel:n.String({description:"Slack channel or user that receives the message."})},{description:aoe}),X$e=n.Object({type:n.Literal("slack"),integrationId:p({allowEmpty:!1,description:"Slack notification integration to post with."}),channel:p({allowEmpty:!1,description:"Slack channel or user that receives the message."})},{description:aoe}),sg=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:ioe}),scope:Ts,permissions:RT,systemPrompt:n.Optional(n.String({description:"Extra system prompt prepended to the sandbox agent run for this configuration."})),timeoutMinutes:n.Optional(n.Integer({description:soe})),memory:n.Optional(SD),notification:n.Optional(Z$e),creator:n.Optional(Se),updater:n.Optional(Se),createdAt:w(),updatedAt:w()}),coe=n.Object({name:n.String({minLength:1,maxLength:W$e,description:"Human-readable name of the sandbox configuration."}),owner:p({allowEmpty:!1,description:"ID of the team that owns this sandbox configuration."}),repositories:n.Array(p({allowEmpty:!1}),{default:[],description:ioe}),scope:Ts,permissions:RT,systemPrompt:n.Optional(p({type:"long",description:"Extra system prompt prepended to the sandbox agent run for this configuration."})),timeoutMinutes:n.Optional(n.Integer({minimum:1,maximum:Q$e,description:soe})),notification:n.Optional(X$e)}),zar=f({tags:["sandbox-configurations"],url:pp,method:"GET",response:n.Array(sg)}),Yar=f({tags:["sandbox-configurations"],url:`${pp}/:id`,method:"GET",params:n.Object({id:p()}),response:sg}),Var=f({tags:["sandbox-configurations"],url:pp,method:"POST",body:coe,response:sg}),War=f({tags:["sandbox-configurations"],url:`${pp}/:id`,method:"PUT",params:n.Object({id:p()}),body:coe,response:sg}),Qar=f({tags:["sandbox-configurations"],url:`${pp}/:id`,method:"DELETE",params:n.Object({id:p()}),response:B}),NT=n.Object({memory:n.Optional(SD)}),ID=n.Object({memory:_D}),Zar=f({tags:["sandbox-configurations"],url:`${pp}/:id/memory`,method:"GET",params:n.Object({id:p()}),response:NT}),Xar=f({tags:["sandbox-configurations"],url:`${pp}/:id/memory`,method:"PUT",params:n.Object({id:p()}),body:ID,response:sg}),Jar=f({tags:["sandbox-configurations"],url:`${pp}/:id/memory`,method:"DELETE",params:n.Object({id:p()}),response:sg});var uoe=`/${"v1"}/sandbox-runs`,bD=`/${"v1"}/sandbox-configurations/:id/memory`,poe="Admin users see every run; other users and operation API keys see only the runs their user started.",xD=n.Object({id:p({allowEmpty:!1,description:"ID of the sandbox configuration."})}),loe=f({description:`Lists the latest ${ooe} sandbox agent runs, newest first, without their prompt and output. ${poe}`,tags:["private"],url:uoe,method:"GET",response:n.Array(vT)}),doe=f({description:`Gets a sandbox agent run with its prompt and output. ${poe}`,tags:["private"],url:`${uoe}/:id`,method:"GET",params:n.Object({id:p({allowEmpty:!1,description:"ID of the sandbox run."})}),response:vT}),moe=f({description:"Gets the memory sandbox agent runs keep for a sandbox configuration.",tags:["private"],url:bD,method:"GET",params:xD,response:NT}),OD=f({description:"Replaces the memory of a sandbox configuration.",tags:["private"],url:bD,method:"PUT",params:xD,body:ID,response:NT}),foe=f({description:"Clears the memory of a sandbox configuration.",tags:["private"],url:bD,method:"DELETE",params:xD,response:NT});var ag=Yr("CONFIGURATION_ID").pipe(ur("The sandbox configuration ID"));var goe=P("clear",{id:ag},v("cli.sandbox-memory.clear")(function*({id:e}){yield*xe(yield*tt(foe,{params:{id:e}}))})).pipe(U("Clear the memory of a sandbox configuration"));var hoe=P("get",{id:ag},v("cli.sandbox-memory.get")(function*({id:e}){yield*xe(yield*tt(moe,{params:{id:e}}))})).pipe(U("Get the memory of a sandbox configuration"));var yoe=P("set",{id:ag,file:tg,data:fd,generateSkeleton:gd},v("cli.sandbox-memory.set")(function*(e){if(e.generateSkeleton){yield*Es(yield*md(OD));return}yield*xe(yield*tt(OD,{params:{id:e.id},body:yield*rd(e)}))})).pipe(U("Replace the memory of a sandbox configuration"));var Eoe=P("sandbox-memory").pipe(U("Read and edit the memory that sandbox agent runs keep per configuration"),_e([hoe,yoe,goe]));function Toe(e){let t={};function r(o,i,s,a){if(n.IsObject(o)){for(let[u,l]of Object.entries(o.properties)){if(i.length===0&&["limit","offset","clusterId"].includes(u))continue;let d=u.replace(/([A-Z])/g,"-$1").toLowerCase(),g=u==="filters"||u==="value"||u==="values"?s:u==="exclude"?`exclude-${s}`:s?`${s}-${d}`:d,y="description"in l&&typeof l.description=="string"?l.description:"";r(l,[...i,u],g,u==="value"||u==="values"?`${a} ${y}`.trim():y||a)}return}t[s]={path:i,flag:J$e(s,o,a)}}return e&&r(e,[],"",""),{flags:Object.fromEntries(Object.entries(t).map(([o,{flag:i}])=>[o,i])),apply:k(function*(o,i={},s={}){if(i===null||typeof i!="object"||Array.isArray(i))return yield*new It({message:"The list request body must be a JSON object"});let a={...i,...s};for(let[l,{path:d}]of Object.entries(t)){let g=o[l];if(!nh(g)||sn(g))continue;let y=a;for(let[E,h]of d.entries())if(E===d.length-1)y[h]=g.value;else{let S=y[h],T=S!==null&&typeof S=="object"&&!Array.isArray(S)?{...S}:{};y[h]=T,y=T}}let u=e?fa(e,a):[];return u.length>0?yield*new It({message:`Invalid list request: ${JSON.stringify(u)}`}):a})}}function J$e(e,t,r){let o;if(n.IsString(t))o=Fe(e);else if(n.IsBoolean(t))o=qn(e);else if(n.IsEnum(t))o=Hy(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=Fe(e).pipe(Ee("VALUE,..."),zs(s=>s.split(",").map(a=>{let u=a.trim();return i&&u!==""?Number(u):u}))),r+=" Pass comma-separated values."}else n.IsUnion(t)&&t.anyOf.some(n.IsNull)&&t.anyOf.every(i=>n.IsString(i)||n.IsNull(i))?(o=Fe(e).pipe(zs(i=>i==="null"?null:i)),r+=" Use null to select resources without a folder."):(o=Fe(e).pipe(Ee("JSON"),CY(i=>JSON.parse(i),()=>`--${e} must be valid JSON`)),r+=n.IsArray(t)?" Pass a JSON array.":" Pass JSON.");return o.pipe(X(r),Je)}function Ue(e){let t=e.singularOverride??JZ(e.commandName).replace(/-/g," "),r=e.pluralOverride??e.commandName.replace(/-/g," "),o=e1e(t),{get:i,create:s,update:a,delete:u}=e.endpoints,l=[t1e(e,r),...i?[P("get",{id:AD},v("cli.resource.get")(function*({id:d}){yield*xe(yield*tt(i,{params:{[CD(i)]:d}}))})).pipe(U(`Get ${o} ${t} by ID`))]:[],...s?[Mn("create",`Create a new ${t}`,s)]:[],...a?[P("update",{id:AD,file:tg,data:fd,generateSkeleton:gd},v("cli.resource.update")(function*(d){if(d.generateSkeleton){yield*Es(yield*md(a));return}yield*xe(yield*tt(a,{params:{[CD(a)]:d.id},body:yield*rd(d)}))})).pipe(U(`Update ${o} ${t} by ID`))]:[],...u?[P("delete",{id:AD},v("cli.resource.delete")(function*({id:d}){yield*xe(yield*tt(u,{params:{[CD(u)]:d}}))})).pipe(U(`Delete ${o} ${t} by ID`))]:[],...e.extraSubcommands??[]];return P(e.commandName).pipe(U(e.description),_e(l))}function e1e(e){return/^[aeiou]/i.test(e)||e==="SLO"?"an":"a"}var AD=Yr("ID").pipe(ur("The resource ID"));function t1e(e,t){let r=e.listDescription??`List all ${t}`,o=Toe(e.enableListBody?e.endpoints.list.body:e.endpoints.list.query),i=e.endpoints.list.paginated===!0?{limit:sp.limit,offset:sp.offset,all:sp.all}:{};return e.enableListBody?P("list",{...o.flags,...i,data:fd,generateSkeleton:gd},v("cli.resource.list")(function*(s){if(s.generateSkeleton){yield*Es(yield*md(e.endpoints.list));return}let a=Rt(s.data)?yield*rd({file:K(),data:s.data}):{};yield*xe(yield*tt(e.endpoints.list,{body:yield*o.apply(s,a,Soe(s)),allPages:s.all===!0}))})).pipe(U(r)):P("list",{...o.flags,...i},v("cli.resource.list")(function*(s){let a=yield*o.apply(s,{},Soe(s));yield*xe(yield*tt(e.endpoints.list,{query:a,allPages:s.all===!0}))})).pipe(U(r))}function Soe(e){return hn({limit:e.limit&&oe(e.limit),offset:e.offset&&oe(e.offset)})}function CD(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 _oe=Ue({commandName:"sandbox-runs",description:"Read the history of sandbox agent runs",endpoints:{list:loe,get:doe}});var Ioe=P("experimental").pipe(U("Experimental commands that may change or be removed without notice"),_e([_oe,Eoe]));var r1e=`/${"v1"}/feedback`,boe=n.Object({id:n.String({description:"API request ID recorded with the feedback."})},{$id:"Feedback",description:"A recorded piece of feedback"}),n1e={id:"request-123-abc"};Object.assign(boe,{examples:[n1e]});var xoe=n.Object({content:p({allowEmpty:!1,type:"long",description:"Free-text feedback content, e.g. what went wrong, what was confusing, or a suggestion. Required and must be non-empty."})}),o1e={content:"The traces command times out for large services."};Object.assign(xoe,{examples:[o1e]});var Ooe=f({description:"Submit free-text feedback about Tsuga tools or APIs, e.g. a tool that failed, returned unusable output, or was confusing to use. Feedback is recorded for the Tsuga team to review and improve tooling.",operationId:"createFeedback",tags:["public","feedback"],url:r1e,method:"POST",body:xoe,response:boe});var Aoe=P("feedback",{message:Yr("MESSAGE").pipe(ur("The feedback to send"),Dre({min:1}))},v("cli.feedback")(function*({message:e}){yield*xe(yield*tt(Ooe,{body:{content:e.join(" ")}}))})).pipe(U("Send feedback about Tsuga tools or APIs (e.g. a tool that failed or was confusing)"));var i1e=`/${"v1"}/grok`,s1e=25,a1e=100,Coe=n.Object({rules:n.Array(p({allowEmpty:!1,type:"long",description:"Grok parsing rule to preview against each sample. The rule uses the same Grok syntax as the log route **Grok parser** processor, for example `pod:%{DATA:namespace}/%{DATA:name}`."}),{minItems:1,maxItems:s1e,description:"Ordered Grok parsing rules to preview. For each sample, Tsuga tries the rules in order and returns the first successful match, matching route Grok processor semantics."}),samples:n.Array(p({allowEmpty:!1,type:"long",description:"Raw log line to parse with the provided Grok rules. The value is parsed as preview input only; this endpoint does not ingest or store the sample."}),{minItems:1,maxItems:a1e,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."}),c1e={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(Coe,{examples:[c1e]});var Roe=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."}),u1e={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(Roe,{examples:[u1e]});var Poe=f({url:`${i1e}/parse`,method:"POST",operationId:"parseGrok",tags:["public","grok"],body:Coe,response:Roe,description:"Tests Grok parsing rules on sample log lines and returns the extracted fields, with the engine log routes use. Requires read access to log routes. A rule that fails to compile returns a 400 with error code `GROK_RULE_VALIDATION_ERROR` and per-rule details in `error.details.ruleErrors`."});var Uoe=Mn("parse","Parse sample log lines with grok rules and return the extracted fields",Poe);var woe=P("grok").pipe(U("Test and preview grok parsing rules"),_e([Uoe]));var Loe=require("node:os"),LT=require("node:path");var RD,voe=()=>{RD?.release(),RD=void 0},Noe=(e,t)=>{let r=[],o=e.write.bind(e),i=!0;e.write=u=>i?(r.push(u),!0):o(u);let s=()=>i?(i=!1,e.write=o,r.splice(0)):[],a={release:()=>{for(let u of s())o(u)},divert:()=>{for(let u of s())t.write(u)}};return RD=a,a},koe=e=>t=>t.pipe(mI(r=>r._tag==="ShowHelp"?Z(e.divert):Me),ko(Z(e.release)));function p1e(e){return process.platform==="win32"?`${e}.cmd`:e}var lp=v("external.run")(function*(e,t){yield*De(` $ ${e} ${t.join(" ")}`),yield*Z(voe);let r=yield*to(H(Ui(p1e(e),t,{stdin:{stream:"ignore"},stdout:{stream:"inherit"},stderr:{stream:"inherit"}}),o=>o.exitCode)).pipe(ht(o=>new zl({message:`Could not run \`${e}\`: ${o.message}. Is it installed and on your PATH?`})));if(Number(r)!==0)return yield*new zl({message:`${e} ${t.join(" ")} exited ${r}`})});var kT="tsuga-dev/agent-plugins",cg="tsuga";var l1e=v("cli.installPlugin.autoUpdate")(function*(e){let t=yield*Jr,r=(0,LT.join)(e,".claude","settings.json");yield*De(`Claude Code \u2192 ${r} (autoUpdate)`),yield*t.makeDirectory((0,LT.dirname)(r),{recursive:!0}).pipe(Rc("create",(0,LT.dirname)(r)));let o=yield*$f(r),i=yield*YA(r,o??"{}"),s=i.extraKnownMarketplaces??{};if(!li(s))return yield*new kn({message:`${r} "extraKnownMarketplaces" must be a JSON object`});let a=s[cg],u=li(a)?a:{},l={...i,extraKnownMarketplaces:{...s,[cg]:{source:{source:"github",repo:kT},...u,autoUpdate:!0}}},d=nc(yield*HI),g=yield*Gf(r,o,d);yield*Ff(r,yield*VA(l)),yield*De(g===void 0?" created":` patched (backup: ${g})`)}),d1e=v("cli.installPlugin.claude")(function*(e,t){yield*De("Claude Code \u2192 installing Tsuga plugin"),yield*lp("claude",["plugin","marketplace","add",kT]),yield*lp("claude",["plugin","install",`tsuga@${cg}`]),t&&(yield*l1e(e))}),Moe=P("claude-code",{autoUpdate:qn("auto-update").pipe(X("Patch ~/.claude/settings.json with autoUpdate=true; --no-auto-update skips it"),_n(!0))},v("cli.installPlugin.claudeCode")(function*({autoUpdate:e}){yield*d1e((0,Loe.homedir)(),e),yield*De("Restart your claude session to load the new plugins.")})).pipe(U("Install the Tsuga plugin into Claude Code (requires the claude CLI in PATH)"));var m1e=v("cli.installPlugin.codex")(function*(){yield*De("Codex \u2192 installing Tsuga plugin"),yield*lp("codex",["plugin","marketplace","add",kT]),yield*lp("codex",["plugin","add",`tsuga@${cg}`])}),Doe=P("codex",{},v("cli.installPlugin.codexCli")(function*(){yield*m1e(),yield*De("Restart your codex session to load the new plugins.")})).pipe(U("Install the Tsuga plugin into Codex (requires the codex CLI in PATH)"));var Foe=P("plugin").pipe(U("Install the Tsuga plugin into a specific LLM CLI"),_e([Moe,Doe]));var $oe=P("install").pipe(U("Install Tsuga plugins into local LLM CLIs"),_e([Foe]));var f1e=10,g1e=n.Object({key:p({allowEmpty:!1,description:"Telemetry attribute key to scope the ranking by: a service, environment, team, route, or other positive equality term in the population you want fields for. Use dot-path keys such as `context.service.name`."}),value:n.Optional(p({allowEmpty:!1,description:"Attribute value the scoped telemetry should match, when the scope is a specific service, environment, team, route, or other known value. When omitted, artifacts that reference the key match this entry at full weight regardless of value."})),valueMustMatch:n.Optional(n.Boolean({description:"When true, this entry is a hard filter rather than a weight: any widget or monitor that does not match it exactly (key = value) contributes no fields at all, instead of contributing at a reduced weight. Other widgets of the same dashboard still contribute if they match. Requires `value`."}))}),PD=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."})}),UD=n.Object({logs:n.Array(PD,{description:"Top log fields for the requested scope, ranked by score and mined from readable logs-sourced dashboards and monitors."}),traces:n.Array(PD,{description:"Top trace fields for the requested scope, ranked by score and mined from readable traces-sourced dashboards and monitors."}),metrics:n.Array(PD,{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."})}),wD=n.Object({scope:n.Array(g1e,{minItems:1,maxItems:f1e,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."})}),$ur=f({tags:["interesting-fields"],url:"/v0/interesting-fields",method:"POST",body:wD,response:UD});var h1e=`/${"v1"}/interesting-fields`,y1e={scope:[{key:"context.service.name",value:"payments"},{key:"context.env",value:"prod",valueMustMatch:!0}]},E1e=n.Object(wD.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:[y1e]}),Goe=f({url:h1e,method:"POST",operationId:"getInterestingFields",tags:["public","interesting-fields"],body:E1e,response:UD,description:"Ranks the log, trace and metric fields most used for a scope, such as one service, in the organization's dashboards and monitors: which attribute to filter or group by, which metric to chart. Ranking is TF-IDF style, so a field used everywhere scores below one distinctive to the scope. Assets the caller cannot read only feed an anonymous frequency baseline. Requires public API read access to dashboards and monitors."});var Boe=Mn("list","Rank the log, trace and metric fields most relevant to a scope, mined from dashboards and monitors",Goe);var joe=P("interesting-fields").pipe(U("Discover the telemetry fields an org already uses for a scope"),_e([Boe]));var zo="/v0/kubernetes-explorer",T1e="^[a-z0-9.-]+$",S1e="^[A-Za-z0-9._-]+$",qoe=256,Hoe=n.Optional(p({allowEmpty:!1,description:"Tsuga cluster ID to target. Tsuga assigns it when a cluster is connected to the organization. Optional for single-cluster organizations and required for organizations with multiple clusters to scope the request to one cluster."}));var Ko=e=>n.Optional(n.Array(p({allowEmpty:!1}),{description:e})),vD=["clusters","namespaces","teams","envs"],MT="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.",ND={clusterId:Hoe,search:n.Optional(n.String({pattern:T1e,minLength:1,maxLength:qoe,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."}))},Koe={clusterId:Hoe,search:n.Optional(n.String({pattern:S1e,minLength:1,maxLength:qoe,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."}))},zoe=n.Object(ND),Yoe=n.Object(Koe),ug={...ND,includeInternalNamespaces:n.Optional(n.Boolean({description:"When false or omitted, resources in internal namespaces (kube-system, kube-public, kube-node-lease, local-path-storage, gke-managed-*) are excluded, even when `namespaces` names them."})),clusters:Ko("Restrict results to these Kubernetes cluster names."),namespaces:Ko("Restrict results to these namespaces."),teams:Ko("Restrict results to these team names."),envs:Ko("Restrict results to these environments."),exclusiveFilters:n.Optional(n.Array(n.Enum(vD),{description:MT})),...fe},_1e=["Pending","Running","Succeeded","Failed","Unknown","CrashLoopBackOff","Error"],I1e=[...vD,"nodes","deployments","statefulsets","daemonsets","podStatus"],b1e={...ug,nodes:Ko("Restrict results to pods scheduled on these nodes."),deployments:Ko("Restrict results to pods owned by these Deployments."),statefulsets:Ko("Restrict results to pods owned by these StatefulSets."),daemonsets:Ko("Restrict results to pods owned by these DaemonSets."),podStatus:Ko("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(I1e),{description:`${MT} Excluding podStatus is applied after stitching pod phase and container status reason telemetry, because phase is not a filterable metric attribute.`}))},x1e=["deployment","statefulset","daemonset"],Voe=n.Object({kind:n.Enum(x1e,{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."}),Woe=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(_1e,{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(w({description:"Timestamp from pod start time telemetry for the selected pod instance. Present when pod start time telemetry is observed."}))}),kD=n.Object({...Woe.properties,workload:n.Optional(Voe),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."}))}),LD=["podName","namespace","cluster","team","env","node","phase","restarts","cpuUsageMilli","cpuUtilization","cpuRequestUtilization","memoryUsageBytes","memoryUtilization","memoryRequestUtilization","createdAt"],tpr=f({tags:["kubernetes-explorer"],method:"GET",url:`${zo}/pods`,query:n.Object({...b1e,sortBy:n.Optional(n.Enum(LD,{description:"Field to sort pods by."})),sortDirection:n.Optional(le)}),paginated:!0,response:n.Array(kD)}),O1e=["teams","envs"],MD=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."}))}),A1e=["cluster","teams","envs","cpuUsageMilli","memoryUsageBytes","readyNodes"],rpr=f({tags:["kubernetes-explorer"],method:"GET",url:`${zo}/clusters`,query:n.Object({...Koe,teams:Ko("Restrict to clusters that host workloads from these team names."),envs:Ko("Restrict to clusters that host workloads in these environments."),exclusiveFilters:n.Optional(n.Array(n.Enum(O1e),{description:MT})),sortBy:n.Optional(n.Enum(A1e,{description:"Field to sort clusters by."})),sortDirection:n.Optional(le),...fe}),paginated:!0,response:n.Array(MD)}),C1e=["clusters"],R1e=["Ready","NotReady","Unknown"],DD=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(R1e,{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."}))}),FD=["node","cluster","status","instanceType","pods","allocatablePods","cpuUsageMilli","cpuAllocatableMilli","cpuUtilization","memoryUsageBytes","memoryAllocatableBytes","memoryUtilization"],npr=f({tags:["kubernetes-explorer"],method:"GET",url:`${zo}/nodes`,query:n.Object({...ND,clusters:Ko("Restrict results to these Kubernetes cluster names."),exclusiveFilters:n.Optional(n.Array(n.Enum(C1e),{description:MT})),sortBy:n.Optional(n.Enum(FD,{description:"Field to sort nodes by."})),sortDirection:n.Optional(le),...fe}),paginated:!0,response:n.Array(DD)}),$D=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."}))}),GD=["namespace","cluster","teams","envs","pods","cpuUsageMilli","memoryUsageBytes"],opr=f({tags:["kubernetes-explorer"],method:"GET",url:`${zo}/namespaces`,query:n.Object({...ug,sortBy:n.Optional(n.Enum(GD,{description:"Field to sort namespaces by."})),sortDirection:n.Optional(le)}),paginated:!0,response:n.Array($D)}),BD=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."}))}),jD=["deployment","namespace","cluster","team","env","pods","availableReplicas","cpuUsageMilli","memoryUsageBytes"],ipr=f({tags:["kubernetes-explorer"],method:"GET",url:`${zo}/deployments`,query:n.Object({...ug,sortBy:n.Optional(n.Enum(jD,{description:"Field to sort deployments by."})),sortDirection:n.Optional(le)}),paginated:!0,response:n.Array(BD)}),qD=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."}))}),HD=["statefulSet","namespace","cluster","team","env","pods","cpuUsageMilli","memoryUsageBytes"],spr=f({tags:["kubernetes-explorer"],method:"GET",url:`${zo}/statefulsets`,query:n.Object({...ug,sortBy:n.Optional(n.Enum(HD,{description:"Field to sort StatefulSets by."})),sortDirection:n.Optional(le)}),paginated:!0,response:n.Array(qD)}),KD=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."}))}),zD=["daemonSet","namespace","cluster","team","env","pods","readyNodes","cpuUsageMilli","memoryUsageBytes"],apr=f({tags:["kubernetes-explorer"],method:"GET",url:`${zo}/daemonsets`,query:n.Object({...ug,sortBy:n.Optional(n.Enum(zD,{description:"Field to sort DaemonSets by."})),sortDirection:n.Optional(le)}),paginated:!0,response:n.Array(KD)}),YD=n.Object({overview:n.Object({...Woe.properties,workload:n.Optional(Voe)},{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."})}),Qoe=n.Object({clusterId:n.Optional(p({allowEmpty:!1})),k8sCluster:p({allowEmpty:!1}),k8sNamespace:p({allowEmpty:!1}),podName:p({allowEmpty:!1})}),cpr=f({tags:["kubernetes-explorer"],method:"GET",url:`${zo}/pod-details`,query:Qoe,response:YD}),VD=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:w({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(w({description:"Timestamp when Tsuga last observed the pod deletion event. Present when the latest observed pod event is deleted."}))}),upr=f({tags:["kubernetes-explorer"],method:"GET",url:`${zo}/pod-manifest`,query:Qoe,response:VD}),WD=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."}),QD=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(w({description:"Latest ReplicaSet metadata.creationTimestamp observed for the Deployment. Present when ReplicaSet object telemetry is observed."}))}),podReplicas:n.Array(WD,{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(w({description:"ReplicaSet metadata.creationTimestamp from the latest observed ReplicaSet object. Present when creation time is observed."})),faultyReasons:n.Optional(n.Array(n.String(),{description:"Container status reasons the Kubernetes faulty deployment monitor reported for this revision within the revisions lookback. Present only when the revision was flagged as faulty."})),logsSearchFilter:n.String({description:"TQL log search filter scoped to this ReplicaSet revision. Built from cluster, namespace, and ReplicaSet identifiers."})}),{description:"Deployment rollout revisions from recent ReplicaSet object telemetry. Includes the latest observed event per ReplicaSet, excludes ReplicaSets whose latest observed spec.replicas is 0, and returns up to 8 revisions sorted by revision number descending."})}),ppr=f({tags:["kubernetes-explorer"],method:"GET",url:`${zo}/deployment-details`,query:n.Object({clusterId:n.Optional(p({allowEmpty:!1})),k8sCluster:p({allowEmpty:!1}),k8sNamespace:p({allowEmpty:!1}),deploymentName:p({allowEmpty:!1})}),response:QD}),P1e=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(w())}),podReplicas:n.Array(WD,{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(w()),faultyReasons:n.Optional(n.Array(n.String()))}))}),lpr=f({tags:["kubernetes-explorer"],method:"GET",url:`${zo}/statefulset-details`,query:n.Object({clusterId:n.Optional(p({allowEmpty:!1})),k8sCluster:p({allowEmpty:!1}),k8sNamespace:p({allowEmpty:!1}),statefulSetName:p({allowEmpty:!1})}),response:P1e}),U1e=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(w())}),podReplicas:n.Array(WD,{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(w()),faultyReasons:n.Optional(n.Array(n.String()))}))}),dpr=f({tags:["kubernetes-explorer"],method:"GET",url:`${zo}/daemonset-details`,query:n.Object({clusterId:n.Optional(p({allowEmpty:!1})),k8sCluster:p({allowEmpty:!1}),k8sNamespace:p({allowEmpty:!1}),daemonSetName:p({allowEmpty:!1})}),response:U1e}),JC=1e3,Zoe=ca,eR=n.Object({id:n.String({description:"Identifier of the event, unique across clusters and namespaces."}),name:n.Optional(n.String({description:"Name of the Kubernetes Event object, unique within its namespace."})),timestamp:n.Number({description:"Last time the event was observed, in milliseconds since the Unix epoch."}),type:n.Optional(n.String({description:"Event type, `Normal` or `Warning`."})),reason:n.Optional(n.String({description:"Short, machine-readable reason for the event, such as `BackOff` or `FailedScheduling`."})),message:n.Optional(n.String({description:"Human-readable description of the event."})),resourceName:n.Optional(n.String({description:"Name of the Kubernetes resource the event is about."})),resourceKind:n.Optional(n.String({description:"Kind of the Kubernetes resource the event is about, such as `Pod` or `Node`."})),namespace:n.Optional(n.String({description:"Kubernetes namespace the event was recorded in."})),cluster:n.Optional(n.String({description:"Name of the Kubernetes cluster that emitted the event."})),count:n.Optional(n.Integer({description:"Number of times the event occurred."}))}),w1e=["timestamp","type","reason","resourceName","resourceKind","namespace","cluster","count"],v1e=[...vD,"resourceKinds","resourceNames"],ZD=n.Object({...ug,resourceKinds:Ko("Restrict results to events about these resource kinds (Pod, Node, Deployment...)."),resourceNames:Ko("Restrict results to events about these resource names."),types:n.Optional(n.Array(n.Enum(["Normal","Warning"]),{description:"Restrict results to events of these types."})),exclusiveFilters:n.Optional(n.Array(n.Enum(v1e),{description:MT})),sortBy:n.Optional(n.Enum(w1e)),sortDirection:n.Optional(le)}),mpr=f({tags:["kubernetes-explorer"],method:"GET",url:`${zo}/events`,query:ZD,paginated:!0,response:n.Array(eR)}),N1e=n.Object({...eR.properties,firstSeen:n.Optional(n.Number({description:"First time the event was observed, in milliseconds since the Unix epoch."})),resourceFieldPath:n.Optional(n.String({description:"Part of the resource the event is about, such as `spec.containers{app}` for one container."})),reportingComponent:n.Optional(n.String({description:"Component that reported the event, such as `kubelet`."})),reportingInstance:n.Optional(n.String({description:"Instance of the reporting component, such as the node name."})),team:n.Optional(n.String()),logsQuery:n.String({description:"TQL log search filter matching every update of the event."})}),fpr=f({tags:["kubernetes-explorer"],method:"GET",url:`${zo}/event-details`,query:n.Object({clusterId:n.Optional(p({allowEmpty:!1})),k8sCluster:p({allowEmpty:!1}),k8sNamespace:p({allowEmpty:!1}),eventName:p({allowEmpty:!1})}),response:N1e});var bs=`/${"v1"}/kubernetes-explorer`,Joe=n.Pick(kD,["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."}),k1e={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(Joe,{examples:[k1e]});var eie=n.Pick(MD,["cluster","teams","envs","cpuUsageMilli","memoryUsageBytes","readyNodes","podPhaseCounts"],{description:"A Kubernetes cluster with aggregate resource usage, node readiness, and pod phase counts."}),L1e={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(eie,{examples:[L1e]});var tie=n.Pick($D,["namespace","cluster","teams","envs","pods","cpuUsageMilli","memoryUsageBytes"],{description:"A Kubernetes namespace with pod count and aggregate resource usage."}),M1e={namespace:"production",cluster:"prod-us-east",teams:["platform"],envs:["production"],pods:24,cpuUsageMilli:1800,memoryUsageBytes:3221225472};Object.assign(tie,{examples:[M1e]});var rie=n.Pick(DD,["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."}),D1e={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(rie,{examples:[D1e]});var nie=n.Pick(BD,["deployment","namespace","cluster","team","env","pods","availableReplicas","desiredReplicas","cpuUsageMilli","memoryUsageBytes"],{description:"A Kubernetes deployment with replica counts and aggregate resource usage."}),F1e={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(nie,{examples:[F1e]});var oie=n.Pick(qD,["statefulSet","namespace","cluster","team","env","pods","cpuUsageMilli","memoryUsageBytes"],{description:"A Kubernetes StatefulSet with replica counts and aggregate resource usage."}),$1e={statefulSet:"postgres",namespace:"production",cluster:"prod-us-east",team:"platform",env:"production",pods:3,cpuUsageMilli:900,memoryUsageBytes:2147483648};Object.assign(oie,{examples:[$1e]});var iie=n.Pick(KD,["daemonSet","namespace","cluster","team","env","pods","readyNodes","desiredNodes","cpuUsageMilli","memoryUsageBytes"],{description:"A Kubernetes DaemonSet with eligible-node readiness and aggregate resource usage."}),G1e={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(iie,{examples:[G1e]});var sie=n.Pick(YD,["overview","healthMetrics","searchFilters"],{description:"Metrics-derived information for a single Kubernetes pod: status, owning workload, CPU/memory metric identifiers, and log/trace filters."}),B1e={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(sie,{examples:[B1e]});var aie=n.Pick(VD,["configuration","labels","annotations","deletedAt"],{description:"Manifest-derived details for a single Kubernetes pod: the pod manifest spec, labels, and annotations from the pod's most recently observed manifest."}),j1e={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(aie,{examples:[j1e]});var cie=n.Pick(QD,["overview","podReplicas","revisions"],{description:"Detailed information for a single Kubernetes deployment: replica status, backing pods, and rollout revisions."}),q1e={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(cie,{examples:[q1e]});var uie=n.Pick(eR,["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."}),H1e={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(uie,{examples:[H1e]});var pie=n.Object({clusterId:n.Optional(p({allowEmpty:!1,description:"Tsuga cluster ID to target. Tsuga assigns it when a cluster is connected to the organization. Optional for single-cluster organizations and required for organizations with multiple clusters to scope the request to one cluster."}))}),lie=n.Pick(zoe,["clusterId","search"]);function pg(e){return n.Object({...lie.properties,sortBy:n.Optional(n.Enum(e,{description:"Field to sort results by. Without it the order is not stable between requests, so set it when paging with `offset`."})),sortDirection:n.Optional(le),...qe})}var K1e=n.Pick(Yoe,["clusterId","search"]),die=f({description:"Lists Kubernetes (k8s) pods with phase, ready containers, restarts, node, owning workload and CPU and memory usage against limits: find crashing, pending or restarting pods.",operationId:"listKubernetesPods",tags:["public","kubernetes-explorer"],method:"GET",url:`${bs}/pods`,paginated:!0,query:pg(LD),response:n.Array(Joe)}),mie=f({description:"Lists Kubernetes (k8s) clusters with node readiness, pod phase counts and resource usage. These are not Tsuga clusters, which the clusters list returns.",operationId:"listKubernetesClusters",tags:["public","kubernetes-explorer"],method:"GET",url:`${bs}/clusters`,query:K1e,response:n.Array(eie)}),fie=f({description:"Lists Kubernetes (k8s) namespaces with pod counts and resource usage.",operationId:"listKubernetesNamespaces",tags:["public","kubernetes-explorer"],method:"GET",url:`${bs}/namespaces`,paginated:!0,query:pg(GD),response:n.Array(tie)}),gie=f({description:"Lists Kubernetes (k8s) nodes with readiness, instance type and resource usage against allocatable capacity.",operationId:"listKubernetesNodes",tags:["public","kubernetes-explorer"],method:"GET",url:`${bs}/nodes`,paginated:!0,query:pg(FD),response:n.Array(rie)}),hie=f({description:"Lists Kubernetes (k8s) deployments with replica counts and resource usage. For rollout history, get the deployment details.",operationId:"listKubernetesDeployments",tags:["public","kubernetes-explorer"],method:"GET",url:`${bs}/deployments`,paginated:!0,query:pg(jD),response:n.Array(nie)}),yie=f({description:"Lists Kubernetes (k8s) StatefulSets with replica counts and resource usage.",operationId:"listKubernetesStatefulSets",tags:["public","kubernetes-explorer"],method:"GET",url:`${bs}/statefulsets`,paginated:!0,query:pg(HD),response:n.Array(oie)}),Eie=f({description:"Lists Kubernetes (k8s) DaemonSets with eligible-node readiness and resource usage.",operationId:"listKubernetesDaemonSets",tags:["public","kubernetes-explorer"],method:"GET",url:`${bs}/daemonsets`,paginated:!0,query:pg(zD),response:n.Array(iie)}),Xoe=100,z1e=n.Object({...lie.properties,...n.Pick(ZD,["clusters","namespaces","resourceKinds","types","includeInternalNamespaces"]).properties,limit:n.Optional(n.Integer({minimum:1,maximum:JC,default:Xoe,description:`Maximum number of events to return, newest first. Defaults to ${Xoe}. Valid values are 1 through ${JC}.`}))}),Tie=f({description:`Lists Kubernetes (k8s) events of the last ${Zoe/o0} hours, newest first, such as BackOff or FailedScheduling warnings, with type, reason, message and the resource concerned. Reads the latest ${JC} event observations; \`search\` matches the resource name.`,operationId:"listKubernetesEvents",tags:["public","kubernetes-explorer"],method:"GET",url:`${bs}/events`,query:z1e,response:n.Array(uie)}),Sie=n.Object({...pie.properties,k8sCluster:p({allowEmpty:!1,description:"Kubernetes cluster name that contains the pod. From cluster telemetry. Required to identify the pod because pod names are only unique within a namespace and cluster."}),k8sNamespace:p({allowEmpty:!1,description:"Kubernetes namespace that contains the pod. From pod metadata. Required to identify the pod because pod names are only unique within a namespace and cluster."}),podName:p({allowEmpty:!1,description:"Kubernetes pod name to retrieve. Set when the pod is created. Required to fetch pod details for the selected cluster and namespace."})}),_ie=f({description:"Returns one Kubernetes pod's status, owning workload, CPU and memory metric names, and ready-to-use log and trace filters. The pod manifest endpoint serves its manifest, labels and annotations.",operationId:"getKubernetesPodDetails",tags:["public","kubernetes-explorer"],method:"GET",url:`${bs}/pod-details`,query:Sie,response:sie}),Iie=f({description:"Returns one Kubernetes pod's manifest from its latest observation: the pod spec (containers, resource requests and limits), labels and annotations.",operationId:"getKubernetesPodManifest",tags:["public","kubernetes-explorer"],method:"GET",url:`${bs}/pod-manifest`,query:Sie,response:aie}),bie=f({description:"Returns one Kubernetes deployment's replica status, backing pods and rollout revisions, with ready-to-use log filters.",operationId:"getKubernetesDeploymentDetails",tags:["public","kubernetes-explorer"],method:"GET",url:`${bs}/deployment-details`,query:n.Object({...pie.properties,k8sCluster:p({allowEmpty:!1,description:"Kubernetes cluster name that contains the Deployment. From cluster telemetry. Required to identify the Deployment because names are only unique within a namespace and cluster."}),k8sNamespace:p({allowEmpty:!1,description:"Kubernetes namespace that contains the Deployment. From workload metadata. Required to identify the Deployment because names are only unique within a namespace and cluster."}),deploymentName:p({allowEmpty:!1,description:"Kubernetes Deployment name to retrieve. From workload telemetry. Required to fetch deployment details for the selected cluster and namespace."})}),response:cie});var Y1e="clusterId";function fr(e,t,r){let o=V1e(t,r);return P(e,o,v(`cli.${t.operationId??e}`)(function*(i){let s=i,a={};for(let u of Object.keys(o)){let l=bre(s,u);l!==void 0&&(a[u]=l)}yield*xe(yield*tt(t,Object.keys(a).length>0?{query:a}:void 0))})).pipe(U(t.description??e))}function V1e(e,t){let r=Ire(e.query),o={};for(let i of Object.keys(r)){if(i===Y1e)continue;let s=i.replace(/([A-Z])/g,"-$1").toLowerCase(),a=s.replace(/-/g,"_").toUpperCase(),u=Fe(s).pipe(X(r[i]?.description??""),Ee(a));o[i]=t?u:u.pipe(Je)}return o}var xie=fr("clusters",mie,!1);var Oie=fr("daemonsets",Eie,!1);var Aie=fr("deployment-details",bie,!0);var Cie=fr("deployments",hie,!1);var Rie=fr("events",Tie,!1);var Pie=fr("namespaces",fie,!1);var Uie=fr("nodes",gie,!1);var wie=fr("pod-details",_ie,!0);var vie=fr("pod-manifest",Iie,!0);var Nie=fr("pods",die,!1);var kie=fr("statefulsets",yie,!1);var Lie=P("kubernetes").pipe(U("Explore Kubernetes resources observed across the organization"),_e([Nie,xie,Pie,Uie,Cie,kie,Oie,Rie,wie,vie,Aie]));var Mie=P("attributes",{...Yt,search:Fe("search").pipe(X("Only list dot-paths containing this text, case-insensitively (e.g. k8s or http.status)"),Ee("TEXT"),Je)},v("cli.logs.attributes")(function*(e){let{attributes:t}=yield*Xt(SX,{query:hn({...yield*zr(e),search:oe(e.search)})});yield*xe({data:t})})).pipe(U("List log attribute dot-paths observed in the time range"));var tR=Fe("env").pipe(X("Filter by environment"),Ee("ENV_NAME"),Je);var W1e=["team","env","pattern"],Die=P("error-pattern-increases",{...Yt,team:Fe("team").pipe(X("Team to query"),Ee("TEAM_NAME")),env:tR,pretty:lo},v("cli.logs.errorPatternIncreases")(function*(e){let t=yield*mn,{errorPatternIncreases:r}=yield*Xt(EX,{query:hn({...yield*zr(e),team:e.team,env:oe(e.env)})});yield*t.rows(r,{...e,defaultFields:W1e})})).pipe(U("List error pattern increases for a given team"));var Q1e=["team","env","service","firstSeen","lastSeen"],Z1e=Fe("team").pipe(X("Filter by team"),Ee("TEAM_NAME"),Je),Fie=P("new-error-patterns",{...Yt,team:Z1e,env:tR,service:Fe("service").pipe(X("Filter by service"),Ee("SERVICE_NAME"),Je),pretty:lo},v("cli.logs.newErrorPatterns")(function*(e){let t=yield*mn,{newErrorPatterns:r}=yield*Xt(hX,{query:hn({...yield*zr(e),team:oe(e.team),env:oe(e.env),service:oe(e.service)})});yield*t.rows(r,{...e,defaultFields:Q1e})})).pipe(U("List error patterns first seen in this time range"));var X1e=["count","ratio","team","level","pattern"];function J1e(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 $ie=P("patterns",{...Yt,query:ip.pipe(X("Tsuga query to filter logs before clustering into patterns")),pretty:lo},v("cli.logs.patterns")(function*(e){let t=yield*mn,r=yield*Xt(fX,{query:hn({...yield*zr(e),query:yield*hd("query",e.query)})}),{patterns:o,sampleSize:i}=r,s=o.map(a=>J1e(a,i));yield*t.rows(s,{...e,defaultFields:X1e})})).pipe(U("List log patterns"));var eGe=k(function*(e){if(e===void 0)return;let t=oe(e);if(t!==void 0)return t;let r=yield*hd("max-results",K());if(r===void 0)return;let o=Number(r);return!Number.isSafeInteger(o)||o<=0?yield*new It({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}),lg=k(function*(e){let t=e.query===void 0?void 0:yield*hd("query",e.query),r=yield*eGe(e.maxResults);return hn({...yield*zr(e),query:t,maxResults:r})});var tGe=["timestamp","level","message"],Gie=P("search",{...Yt,query:ip,maxResults:rg,pretty:lo},v("cli.logs.search")(function*(e){let t=yield*mn,r=yield*Xt(rT,{query:yield*lg(e)}),{logs:o}=r;yield*t.rows(o,{...e,defaultFields:tGe})})).pipe(U("Search logs"));var Bie=P("logs").pipe(U("Search and analyze logs"),_e([Gie,Mie,$ie,Fie,Die]));var XD=`/${"v1"}/metrics`,JD=n.Object({name:n.String({description:"Metric name observed by Tsuga. Use this value in metric queries and aggregations."}),type:SA,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(_A),capabilities:n.Optional(n.Array(n.String(),{description:"Aggregate function types (such as `max`, `min`, `sum`) supported when querying or graphing this metric. An empty or omitted array means all aggregate types are supported."})),attributes:n.Optional(n.Array(n.String(),{description:"Metric attribute names available as dimensions for filtering or grouping."})),seriesCardinality:n.Optional(IA),attributeCardinalities:n.Optional(n.Record(n.String(),n.Number(),{description:"Estimated number of distinct values per attribute over the same window as `seriesCardinality`, keyed like `attributes`. Omitted when the catalog has no statistics for the metric yet."}))}),jie={name:"http.server.request.duration",type:"histogram",description:"Duration of HTTP server requests",unit:"ms",temporality:"delta",capabilities:["max","min","sum"],attributes:["context.team","context.environment","context.region"],seriesCardinality:1250,attributeCardinalities:{"context.team":4,"context.environment":3,"context.region":12}};Object.assign(JD,{examples:[jie]});var qie=n.Omit(JD,["attributes","attributeCardinalities"]);Object.assign(qie,{examples:[DA(jie,["attributes","attributeCardinalities"])]});var Hie=n.Object({from:Ql("Unix timestamp in seconds. Required, but does not scope the result."),to:Ql("Unix timestamp in seconds. Required, but does not scope the result."),clusterId:n.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Required when the organization has multiple clusters; omit only for single-cluster organizations."}))},{description:"Metric metadata query. The time range is required but does not scope the result, which comes from a cluster-wide catalog of metric names. Optionally takes a cluster ID."}),Kie=f({description:"Lists or searches metric names with type, unit, temporality and estimated series cardinality, to find the metric to query. Metrics come from OpenTelemetry, Prometheus or cloud provider integrations (AWS CloudWatch, GCP Cloud Monitoring, Azure Monitor). `search` keeps the names containing a substring. `from` and `to` are required but do not scope the result, and a name stays listed after the metric stops reporting; to check for data in a window, run a `count` aggregation. Get one metric for its attributes. See [Metrics](/documentation/explore/metrics/index).",operationId:"listMetrics",tags:["public","metrics"],url:XD,method:"GET",paginated:!0,query:n.Object({...Hie.properties,...qe,search:n.Optional(p({allowEmpty:!1,description:"Keep only metric names containing this value, matched case-insensitively."}))}),response:n.Array(qie)}),zie=f({description:"Returns one metric's metadata: its attributes (labels, dimensions, tags) with estimated cardinality, type, unit and supported query behavior. `from` and `to` are required but do not scope the result: it reads a cluster-wide catalog whose cardinalities are periodically refreshed estimates. See [Metric details](/documentation/explore/metrics/metric-details).",operationId:"getMetric",tags:["public","metrics"],url:`${XD}/:name`,method:"GET",params:n.Object({name:p({allowEmpty:!1,description:"Metric name to retrieve, for example `http.server.request.duration`."})}),query:Hie,response:JD}),rGe=["service","env","host","method","status_code"];Object.assign(WE,{examples:[rGe]});var Yie=n.Pick(x0,["assets"]),nGe={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(Yie,{examples:[nGe]});var Vie=f({description:"Lists the dashboards and monitors whose queries use a metric, before renaming or dropping it. An empty result does not prove the metric unused: PromQL widgets, SLOs and assets the caller cannot read are not covered. See [How to find which assets use a metric](/documentation/explore/guides/how-to-find-which-assets-use-a-metric).",operationId:"getMetricAssetsUsage",tags:["public","metrics"],url:`${XD}/assets-usage`,method:"GET",query:n.Object({metricName:p({allowEmpty:!1,description:"Metric name to look up, for example `http.server.request.duration`."})}),response:Yie});var Wie=P("assets-usage",{name:Yr("METRIC_NAME").pipe(ur("The metric to look up"))},v("cli.metrics.assetsUsage")(function*({name:e}){yield*xe(yield*tt(Vie,{query:{metricName:e}}))})).pipe(U("List dashboards and monitors that use a specific metric"));var Qie=P("get",{name:Yr("METRIC_NAME").pipe(ur("The metric to retrieve")),...Yt},v("cli.metrics.get")(function*(e){yield*xe(yield*tt(zie,{params:{name:e.name},query:yield*zr(e)}))})).pipe(U("Retrieve a metric by name with its metadata"));var Zie=P("list",{...Yt,...sp,search:Fe("search").pipe(X("Keep only metric names containing this text (case-insensitive)"),Ee("TEXT"),Je)},v("cli.metrics.list")(function*(e){let t=hn({limit:oe(e.limit),offset:oe(e.offset),search:oe(e.search),...yield*zr(e)});yield*xe(yield*tt(Kie,{query:t,allPages:e.all}))})).pipe(U("List metrics with their metadata, sorted by name and paged"));var Xie=P("metrics").pipe(U("List and inspect metrics"),_e([Zie,Qie,Wie]));var oGe="/v0/profiles",iGe=["cpu","samples","sample","wall","offcpu","space","inuse_space","objects","inuse_objects","alloc_space","alloc_objects","goroutine"],sGe=20,DT={service:p({allowEmpty:!1,description:"Service the profiles belong to, as it appears in `profile.{type}.{service}`."}),type:n.Enum(iGe,{description:"pprof sample type."}),filter:n.Optional(p({type:"tsuga-query",description:"TQL over the profile labels. Only label equality, negation and wildcards are accepted."})),groupBy:n.Optional(n.Array(p({allowEmpty:!1}),{description:"Labels to split the flamegraph by. The stack itself cannot be a group-by."})),limit:n.Optional(n.Integer({minimum:1,default: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."}))},Ddr=f({tags:["profiles"],url:`${oGe}/query`,method:"POST",body:n.Object({...DT,timeRange:Ao,clusterId:n.Optional(p({allowEmpty:!1,description:"Cluster to target. Defaults to the first cluster created in the organization when omitted."}))}),response:kf});var Jie=`/${"v1"}/profiles`,ese=n.Object({...DT,timeRange:tn},{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"}]}),aGe=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}]}]}),rR=f({description:"Aggregates continuous profiling samples for a service into folded stacks, optionally split by profile labels.",tags:["private"],url:`${Jie}/query`,method:"POST",body:ese,query:Fi,response:aGe}),cGe=n.Object({pprof:n.String({description:"Merged pprof profile, base64-encoded (standard alphabet, padded)."})}),tse=f({description:"Merges continuous profiling samples for a service into a single pprof profile.",tags:["private"],url:`${Jie}/pprof`,method:"POST",body:ese,query:Fi,response:cGe});var rse=v("output.printBytes")(function*(e){let t=yield*Rm;yield*Kh(i2(e),t.stdout()).pipe(ht(r=>new kn({message:`Could not write stdout: ${r.message}`})))});var nR={service:Fe("service").pipe(X("Service the profiles belong to"),Ee("SERVICE_NAME")),type:nx("type",DT.type.enum).pipe(X("Profile type"),Ee("PROFILE_TYPE")),...Yt,filter:Fe("filter").pipe(X("Tsuga query over profile labels (equality, negation, wildcards)"),Ee("TSUGA_QUERY"),Je)},oR=k(function*(e){let t=oe(e.filter);return{service:e.service,type:e.type,timeRange:yield*zr(e),...t===void 0?{}:{filter:t}}});var nse=P("pprof",{...nR,outputFile:Fe("output-file").pipe(Ks("O"),X("Write the profile to this file instead of stdout"),Ee("FILE_PATH"),Je)},v("cli.profiles.pprof")(function*(e){let t=oe(e.outputFile);if(t===void 0&&(yield*HE))return yield*new It({message:"Refusing to write a binary profile to the terminal. Use --output-file <FILE_PATH> or pipe stdout."});let r=yield*Xt(tse,{body:yield*oR(e)}),o=Buffer.from(r.pprof,"base64");if(t===void 0){yield*rse(o);return}yield*(yield*Jr).writeFile(t,o).pipe(ht(s=>new kn({message:`Could not write ${t}: ${s.message}`})))})).pipe(U("Download a merged pprof profile (raw protobuf, not gzipped)"));var ose=Mn("query","Run a raw profile query and print the folded stacks",rR);var uGe=30,pGe=["flat","flatPercent","cum","cumPercent","function"],ise=P("top",{...nR,limit:qm("limit").pipe(X("Maximum number of functions to print"),Ee("COUNT"),_n(uGe)),pretty:lo},v("cli.profiles.top")(function*(e){let t=yield*mn;if(e.limit<1)return yield*new It({message:`--limit must be a positive integer (got: ${e.limit})`});let r=yield*Xt(rR,{body:yield*oR(e)}),{total:o,functions:i}=lGe(r.stacks),s=i.slice(0,e.limit).map(a=>({...a,total:o}));yield*t.rows(s,{...e,defaultFields:pGe})})).pipe(U("Rank functions by self (flat) and inclusive (cum) sample value, like pprof -top"));function lGe(e){let t=new Map,r=new Map,o=0;for(let{stack:a,value:u}of e){let l=a.split(";"),d=l[l.length-1];if(d!==void 0){o+=u,t.set(d,(t.get(d)??0)+u);for(let g of new Set(l))r.set(g,(r.get(g)??0)+u)}}let i=a=>o===0?0:Math.round(a/o*1e4)/100,s=[...r.entries()].map(([a,u])=>{let l=t.get(a)??0;return{function:a,flat:l,flatPercent:i(l),cum:u,cumPercent:i(u)}}).sort((a,u)=>u.flat-a.flat||u.cum-a.cum||a.function.localeCompare(u.function));return{total:o,functions:s}}var sse=P("profiles").pipe(U("Query continuous profiling data"),_e([ise,nse,ose]));var ase=Mn("query","Run a PromQL range query over metric data",HA);var cse=P("promql").pipe(U("Run PromQL queries over metric data"),_e([ase]));var mo="/v0/monitors",dg=["alert","resolve","keep_last_status","consider_zero"],mg=["alert","resolve","keep_last_status"];var pse=["no_aggregation","all","any","each","proportion"],lse=["greater_than","less_than","equal","not_equal","greater_than_or_equal","less_than_or_equal"];var dGe=n.Object({formula:n.String({description:"Formula result to compare against the threshold, usually `q1` or a formula alias."}),operator:n.Enum(lse,{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."})}),mGe=n.Object({formula:p({type:"tsuga-formula",description:"Formula result to compare against the threshold, usually `q1` or a formula alias."}),operator:n.Enum(lse,{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."})}),fGe=5,eF=n.Array(dGe,{description:"Threshold conditions evaluated against query and formula results. All listed conditions must match for a non-grouped threshold monitor to alert."}),tF=n.Array(mGe,{minItems:1,maxItems:fGe,description:"Threshold conditions evaluated against query and formula results. All listed conditions must match for a non-grouped threshold monitor to alert."}),rF=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`."}),nF=n.Object({formula:p({type:"tsuga-formula",description:"Formula result analyzed for anomalous behavior, usually `q1` or a formula alias."}),conditionType:n.Enum(["rate","error","cpu","general","to_be_set"],{description:"Anomaly model type used to classify expected behavior: `rate` flags downward anomalies (e.g. count rates), `error` and `cpu` flag upward anomalies (e.g. error counts/rates, CPU usage), and `general` flags both directions. Use `to_be_set` to let Tsuga infer the model type from the monitor query during create or update."})},{description:"Anomaly detection condition evaluated by this monitor. The `formula` result is compared against behavior learned from historical query results, and the monitor alerts on deviations in the direction implied by `conditionType`."}),yn=[1,2,3,4,5];var gGe=4;var iR={timeframe:n.Number({description:"Lookback window, in minutes, that each query-backed threshold monitor evaluation aggregates over. Always a whole number, at least 1."}),groupByFields:n.Array(n.Object({fields:n.Array(n.String(),{description:"Attribute names the monitor splits results by, evaluating each resulting group independently. Empty means the monitor evaluates a single ungrouped series."}),limit:n.Number({description:"Maximum number of groups evaluated per field. Anomaly monitors apply it, capped at 100. Threshold monitors ignore it and evaluate up to 100 groups per field."}),sortOrder:n.Optional(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."}),aggregationAlertLogic:n.Optional(n.Enum(pse,{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`."}))},sR={timeframe:n.Integer({minimum:1,description:"Lookback window, in minutes, that each query-backed threshold monitor evaluation aggregates over."}),groupByFields:n.Array(n.Object({fields:n.Array(p(),{maxItems:gGe,description:"Attribute names the monitor splits results by, evaluating each resulting group independently. Empty or omitted means the monitor evaluates a single ungrouped series."}),limit:n.Number({description:"Maximum number of groups evaluated per field. Anomaly monitors apply it, capped at 100. Threshold monitors ignore it and evaluate up to 100 groups per field."}),sortOrder:n.Optional(le),replaceNullWith:n.Optional(p({allowEmpty:!1,description:"Value used to group documents that have no value for a grouped field."}))}),{maxItems:1,description:"Monitor group by configuration."}),aggregationAlertLogic:n.Optional(n.Enum(pse,{description:"How grouped results are combined into alert state. Use `no_aggregation` only when `groupByFields` is empty; use `all`, `any`, `each`, or `proportion` with non-empty `groupByFields`. `proportion` also requires `proportionAlertThreshold`. With `groupByFields`, send `each` so every group opens and resolves its own alert, as the app does by default; `all`, `any`, and `proportion` raise one alert for the whole monitor. On create, omitted query-monitor values default to `no_aggregation`; on update, omitted values keep the existing aggregation logic."})),proportionAlertThreshold:n.Optional(n.Integer({minimum:1,maximum:99,description:"Percentage threshold used when `aggregationAlertLogic` is `proportion`."}))},oF={...iR,timeframe:n.Number({description:"Lookback window, in minutes, that each anomaly monitor evaluation aggregates over. Always a whole number from 5 through 1440."})},iF={...sR,timeframe:n.Integer({minimum:5,maximum:1440,description:"Lookback window, in minutes, that each anomaly monitor evaluation aggregates over."})},hGe=10,yGe=4320,dse=`Number of consecutive \`timeframe\`-minute windows, ending at evaluation time, that must all meet the conditions before the monitor alerts, per group for grouped monitors. 1 or omitted checks a single window. A window that does not meet the conditions breaks the run. An empty window, such as a query with \`fill.mode.type\` \`null\` returning nothing, breaks the run under \`noDataBehavior\` \`alert\` or \`resolve\`, takes the previous window's result under \`keep_last_status\`, and counts as 0 under \`consider_zero\`. A query without \`fill\` counts an empty window as 0. When every window is empty (with \`keep_last_status\`, when the oldest is empty and none breaks the run), \`noDataBehavior\` applies as for a single window. Above 1, \`consecutiveWindows\` \xD7 \`timeframe\` must not exceed ${yGe} minutes (3 days).`,sF=n.Optional(n.Integer({description:dse})),aF=n.Optional(n.Integer({minimum:1,maximum:hGe,description:dse})),mse=n.Object({type:n.Literal("metric",{description:"Threshold monitor over metric aggregations."}),conditions:eF,noDataBehavior:n.Enum(dg,{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."}),...iR,consecutiveWindows:sF,queries:Ac},{$id:"MonitorConfigurationMetric"}),EGe=n.Object({type:n.Literal("metric",{description:"Threshold monitor over metric aggregations."}),conditions:tF,noDataBehavior:n.Enum(dg,{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."}),...sR,consecutiveWindows:aF,queries:Zu},{$id:"InputMonitorConfigurationMetric"}),fse=n.Object({type:n.Literal("log",{description:"Threshold monitor over log aggregations."}),conditions:eF,noDataBehavior:n.Enum(dg,{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."}),...iR,consecutiveWindows:sF,queries:Ac},{$id:"MonitorConfigurationLog"}),TGe=n.Object({type:n.Literal("log",{description:"Threshold monitor over log aggregations."}),conditions:tF,noDataBehavior:n.Enum(dg,{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."}),...sR,consecutiveWindows:aF,queries:Zu},{$id:"InputMonitorConfigurationLog"}),gse=n.Object({type:n.Literal("trace",{description:"Threshold monitor over trace aggregations."}),conditions:eF,noDataBehavior:n.Enum(dg,{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."}),...iR,consecutiveWindows:sF,queries:Ac},{$id:"MonitorConfigurationTrace"}),SGe=n.Object({type:n.Literal("trace",{description:"Threshold monitor over trace aggregations."}),conditions:tF,noDataBehavior:n.Enum(dg,{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."}),...sR,consecutiveWindows:aF,queries:Zu},{$id:"InputMonitorConfigurationTrace"}),hse=n.Object({type:n.Literal("anomaly-log",{description:"Anomaly monitor over log aggregations."}),condition:rF,noDataBehavior:n.Enum(mg,{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."}),...oF,queries:Ac},{$id:"MonitorConfigurationAnomalyLog"}),_Ge=n.Object({type:n.Literal("anomaly-log",{description:"Anomaly monitor over log aggregations."}),condition:nF,noDataBehavior:n.Enum(mg,{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."}),...iF,queries:Zu},{$id:"InputMonitorConfigurationAnomalyLog"}),yse=n.Object({type:n.Literal("anomaly-metric",{description:"Anomaly monitor over metric aggregations."}),condition:rF,noDataBehavior:n.Enum(mg,{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."}),...oF,queries:Ac},{$id:"MonitorConfigurationAnomalyMetric"}),IGe=n.Object({type:n.Literal("anomaly-metric",{description:"Anomaly monitor over metric aggregations."}),condition:nF,noDataBehavior:n.Enum(mg,{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."}),...iF,queries:Zu},{$id:"InputMonitorConfigurationAnomalyMetric"}),Ese=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:rF,noDataBehavior:n.Enum(mg,{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."}),...oF,queries:Ac},{$id:"MonitorConfigurationAnomalyTrace"}),bGe=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:nF,noDataBehavior:n.Enum(mg,{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."}),...iF,queries:Zu},{$id:"InputMonitorConfigurationAnomalyTrace"}),Tse=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"}),xGe=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"}),Sse="When `true`, every new error pattern alerts on the next evaluation, even if it appeared in a single log. When `false` or omitted, a new pattern alerts only once it has lasted at least 5 minutes and matched at least 20 logs, which filters out one-off errors.",OGe=n.Object({type:n.Literal("log-error-pattern",{description:"Monitor that alerts on newly detected log error patterns for the configured environment, scoped by teams, services, or both. Recovery notifications are not sent for this monitor type."}),aggregationAlertLogic:n.Literal("each",{description:"Fixed aggregation logic for log error pattern monitors. Each new pattern is evaluated as its own alert group."}),noDataBehavior:n.Literal("keep_last_status",{description:"Fixed no-data behavior for log error pattern monitors. Pattern state is kept until inactive pattern groups expire."}),filter:n.Object({teamIds:n.Optional(n.Array(n.String(),{description:"Team IDs whose logs are searched for new error patterns. Tsuga resolves these team IDs to team names when exporting monitor assets."})),env:n.String({description:"Environment whose logs are searched for new error patterns."}),services:n.Optional(n.Array(n.String(),{description:"Service names whose logs are searched for new error patterns."}))},{description:"Log selection used for new error pattern detection. All configured fields must match for logs to be included, so sending both teams and services searches only the listed services owned by the listed teams. Send a non-empty `teamIds`, a non-empty `services`, or both."}),alertOnFirstOccurrence:n.Optional(n.Boolean({description:Sse}))},{$id:"MonitorConfigurationLogErrorPattern"}),AGe=n.Object({type:n.Literal("log-error-pattern",{description:"Monitor that alerts on newly detected log error patterns for the configured environment, scoped by teams, services, or both. Recovery notifications are not sent for this monitor type."}),aggregationAlertLogic:n.Literal("each",{description:"Fixed aggregation logic for log error pattern monitors. Each new pattern is evaluated as its own alert group."}),noDataBehavior:n.Literal("keep_last_status",{description:"Fixed no-data behavior for log error pattern monitors. Pattern state is kept until inactive pattern groups expire."}),filter:n.Object({teamIds:n.Optional(n.Array(p({allowEmpty:!1}),{description:"Team IDs whose logs are searched for new error patterns. Tsuga resolves these team IDs to team names when exporting monitor assets.",minItems:1})),env:p({allowEmpty:!1,description:"Environment whose logs are searched for new error patterns."}),services:n.Optional(n.Array(p({allowEmpty:!1}),{description:"Service names whose logs are searched for new error patterns.",minItems:1}))},{description:"Log selection used for new error pattern detection. All configured fields must match for logs to be included, so sending both teams and services searches only the listed services owned by the listed teams. Send a non-empty `teamIds`, a non-empty `services`, or both."}),alertOnFirstOccurrence:n.Optional(n.Boolean({description:Sse}))},{$id:"InputMonitorConfigurationLogErrorPattern"}),_se=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"}),CGe=n.Object({type:n.Literal("log-error-pattern-increase",{description:"Monitor that alerts when the volume of an existing log error pattern increases sharply for the configured teams and environment."}),aggregationAlertLogic:n.Literal("each",{description:"Fixed aggregation logic for log error pattern increase monitors. Each pattern whose volume increased is evaluated as its own alert group."}),noDataBehavior:n.Literal("resolve",{description:"Fixed no-data behavior for log error pattern increase monitors. A pattern group resolves once its volume stops increasing."}),filter:n.Object({teamIds:n.Optional(n.Array(p({allowEmpty:!1}),{minItems:1,description:"Team IDs whose error logs are watched for volume increases. Tsuga resolves these team IDs to team names when exporting monitor assets. Omit to watch every team, in which case `services` is required."})),env:p({allowEmpty:!1,description:"Environment whose error logs are watched for volume increases."}),services:n.Optional(n.Array(p({allowEmpty:!1}),{minItems:1,description:"Service names whose error logs are watched for volume increases. Omit to watch every service matching the team and environment scope."}))},{description:"Log selection used for error pattern increase detection. All configured fields must match for logs to be included."})},{$id:"InputMonitorConfigurationLogErrorPatternIncrease"}),Ise={type:n.Literal("k8s-faulty-deployment",{description:"Monitor that alerts when a Kubernetes workload (Deployment, StatefulSet, or DaemonSet) keeps failing right after a rollout."}),aggregationAlertLogic:n.Literal("each",{description:"Fixed aggregation logic for Kubernetes faulty deployment monitors. Each faulty workload revision is evaluated as its own alert group."})},RGe=["replicaSet","statefulSet","daemonSet"],bse=n.Enum(RGe,{description:"Kubernetes workload type: `replicaSet` (Deployment rollouts), `statefulSet`, or `daemonSet`."}),xse=n.Object({...Ise,filter:n.Object({clusterNames:n.Optional(n.Array(n.String(),{description:"Kubernetes cluster names to watch. Omit to watch every cluster."})),namespaces:n.Optional(n.Array(n.String(),{description:"Kubernetes namespaces to watch. Omit to watch every namespace."})),envs:n.Optional(n.Array(n.String(),{description:"Environments to watch. Omit to watch every environment."})),workloadTypes:n.Optional(n.Array(bse,{description:"Kubernetes workload types to watch. Omit to watch every workload type."}))},{description:"Workload selection used for faulty deployment detection. All configured fields must match for a workload to be watched."})},{$id:"MonitorConfigurationK8sFaultyDeployment"}),PGe=n.Object({...Ise,filter:n.Object({clusterNames:n.Optional(n.Array(p({allowEmpty:!1}),{minItems:1,description:"Kubernetes cluster names to watch. Omit to watch every cluster."})),namespaces:n.Optional(n.Array(p({allowEmpty:!1}),{minItems:1,description:"Kubernetes namespaces to watch. Omit to watch every namespace."})),envs:n.Optional(n.Array(p({allowEmpty:!1}),{minItems:1,description:"Environments to watch. Omit to watch every environment."})),workloadTypes:n.Optional(n.Array(bse,{minItems:1,uniqueItems:!0,description:"Kubernetes workload types to watch. Omit to watch every workload type."}))},{description:"Workload selection used for faulty deployment detection. All configured fields must match for a workload to be watched. Send an empty object to watch every workload."})},{$id:"InputMonitorConfigurationK8sFaultyDeployment"}),Ose={type:n.Literal("faulty-deployment",{description:"Monitor that alerts when Tsuga faulty deployment detection flags a newly deployed service version as faulty."}),aggregationAlertLogic:n.Literal("each",{description:"Fixed aggregation logic for faulty deployment monitors. Each faulty service version in an environment is evaluated as its own alert group."})},Ase=n.Object({...Ose,filter:n.Object({services:n.Optional(n.Array(n.String(),{description:"Service names to watch. Omit to watch every service."})),envs:n.Optional(n.Array(n.String(),{description:"Environments to watch. Omit to watch every environment."}))},{description:"Deployment selection used for faulty deployment detection. All configured fields must match for a deployment to be watched."})},{$id:"MonitorConfigurationFaultyDeployment"}),UGe=n.Object({...Ose,filter:n.Object({services:n.Optional(n.Array(p({allowEmpty:!1}),{minItems:1,description:"Service names to watch. Omit to watch every service."})),envs:n.Optional(n.Array(p({allowEmpty:!1}),{minItems:1,description:"Environments to watch. Omit to watch every environment."}))},{description:"Deployment selection used for faulty deployment detection. All configured fields must match for a deployment to be watched. Send an empty object to watch every deployment."})},{$id:"InputMonitorConfigurationFaultyDeployment"}),wGe=D("type",[mse,fse,gse,hse,yse,OGe,_se,Ese,Tse,xse,Ase],{description:"Monitor evaluation configuration. The `type` discriminator determines which telemetry source, condition shape, and evaluation rules Tsuga uses."}),vGe=D("type",[EGe,TGe,SGe,_Ge,IGe,bGe,AGe,CGe,xGe,PGe,UGe],{description:"Monitor evaluation configuration. The `type` discriminator determines which telemetry source, condition shape, and evaluation rules Tsuga uses."});var mp=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:vt,configuration:wGe,priority:n.Enum(yn,{description:"Monitor priority from 1 through 5, where 1 is highest priority."}),permissions:Ts,dashboardId:n.Optional(n.String({description:"ID of the dashboard linked to this monitor for context when investigating alerts. Caller-supplied. Omitted when no dashboard is linked."})),folderId:n.Optional(n.String({description:"ID of the monitor folder containing this monitor. Omitted for unfiled monitors."})),pauseUntil:n.Optional(w({description:"Timestamp until which the monitor is snoozed. Omitted when the monitor is not snoozed."})),creator:n.Optional(Se),updater:n.Optional(Se),createdAt:w({description:"Timestamp when Tsuga created the monitor."}),updatedAt:w({description:"Timestamp when Tsuga last updated the monitor."}),assetUpdatedAt:w({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"}),cF=D("type",[mse,fse,gse,hse,yse,Ese,Tse,_se,xse,Ase]),kmr=n.Object({...mp.properties,configuration:cF},{title:"Monitor"}),FT=n.Object({name:p({description:"Display name of the monitor and alert source."}),message:Ye(p({type:"long"}),{description:"Message included in notifications triggered by this monitor. Optional on create."}),tags:$t,configuration:vGe,priority:n.Enum(yn,{description:"Monitor priority from 1 through 5, where 1 is highest priority."}),owner:p({allowEmpty:!1,description:"Team ID that owns and manages the monitor."}),dashboardId:Ye(p({allowEmpty:!1}),{description:"ID of the dashboard to link to this monitor for context when investigating alerts. On create: omit or send `null` to leave the monitor unlinked. On update: omit to skip updating this field, send `null` to clear an existing link."}),folderId:Ye(p({allowEmpty:!1}),{description:"Folder to organize this monitor in. Omit on create or send null to leave it unfiled; omit on update to keep its folder, or send null to remove it. A non-null ID must name a readable monitor folder. Assignment does not change ownership, data access, or evaluation state."}),pauseUntil:Ye(p({allowEmpty:!1,type:"date-time"}),{description:"ISO timestamp until which the monitor is snoozed. Must be in the future and at most one month from now. On create: omit or send `null` to leave the monitor active. On update: omit to keep the current snooze, send `null` to clear it."}),permissions:Ts,clusterIds:n.Optional(n.Array(p({allowEmpty:!1}),{description:"Cluster IDs where the monitor should be deployed. Empty or omitted means all eligible clusters for cluster-deployed monitor types."}))}),use=["threshold","certificate-expiry","anomaly-detection","log-error-pattern","log-error-pattern-increase","k8s-faulty-deployment","faulty-deployment"],dp={PRIORITY:"priority",TYPE:"type",NAME:"name",OWNER:"owner",TAGS:"tags",CLUSTER_IDS:"clusterIds",PAUSE_UNTIL:"pauseUntil",ASSET_UPDATED_AT:"assetUpdatedAt"};var uF=n.Object({folderId:n.Union([n.Null(),p({allowEmpty:!1})],{description:"Return monitors directly assigned to this folder ID, or unfiled monitors when null. Omit to return all monitors."}),owners:he(p({allowEmpty:!1}),{description:"Restrict results to monitors owned by any of these team IDs",maxItems:50}),searchQuery:Oo({description:"Search query filter for monitors.",valueDescription:"Case-insensitive substring matched against monitor ID, monitor name, query filters, and aggregate fields. Wildcard characters are treated literally."}),tags:he(rn.items,{description:"Restrict results to monitors that have at least one of the listed key/value tags",maxItems:50}),priorities:he(n.Enum(yn),{description:"Restrict results to monitors with one of these priorities",maxItems:yn.length}),types:he(n.Enum(use),{description:"Restrict results to monitors with these types",maxItems:use.length}),activity:n.Enum(["active","snoozed"],{description:"Restrict results by activity status: active monitors or currently snoozed monitors"}),clusterIds:he(p({allowEmpty:!1}),{description:"Restrict results to monitors deployed to any of these cluster IDs (monitors with no cluster restriction are always included)",maxItems:50})},{description:"Optional filters applied to narrow the returned monitors"}),aR=n.Partial(uF),pF=n.Partial(n.Object({...fe,filters:aR,sort:n.Object({by:n.Enum([dp.PRIORITY,dp.TYPE,dp.NAME,dp.OWNER,dp.TAGS,dp.CLUSTER_IDS,dp.PAUSE_UNTIL,dp.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."})})),Lmr=f({tags:["monitors"],url:`${mo}/query`,method:"POST",paginated:!0,response:n.Array(mp),body:pF}),Mmr=f({tags:["monitors"],url:`${mo}/tags/query`,method:"POST",body:n.Object({filters:n.Optional(n.Partial(n.Omit(uF,["tags"])))}),response:Vr}),Dmr=f({tags:["monitors"],url:`${mo}/counts/query`,method:"POST",body:n.Object({filters:n.Optional(n.Partial(n.Omit(uF,["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."})})}),Fmr=f({tags:["monitors"],url:`${mo}/:id`,method:"GET",params:n.Object({id:p()}),response:mp}),$mr=f({tags:["monitors"],url:mo,method:"POST",body:FT,response:mp}),Gmr=f({tags:["monitors"],url:`${mo}/:id`,method:"PUT",params:n.Object({id:p()}),body:FT,response:mp}),NGe=100,kGe=ui(aR,{maxIds:NGe}),Bmr=f({tags:["monitors"],url:`${mo}/bulk-update`,method:"PUT",body:n.Object({selection:kGe,owner:n.Optional(p({allowEmpty:!1,description:"Owning team to apply to every selected monitor. Omit to keep current ownership."})),folderId:Ye(p({allowEmpty:!1}),{description:"Folder to assign every selected monitor to. Omit to keep their folders, or send null to make them unfiled. Assignment preserves ownership, data access, and evaluation state."})}),response:n.Object({})}),jmr=f({tags:["monitors"],url:`${mo}/:id`,method:"DELETE",params:n.Object({id:p()}),response:B}),LGe=ui(aR),qmr=f({tags:["monitors"],url:`${mo}/bulk-delete`,method:"DELETE",body:n.Object({selection:LGe}),response:n.Object({})}),Hmr=f({tags:["monitors"],url:`${mo}/:id/snooze`,method:"POST",params:n.Object({id:p()}),body:n.Object({pauseUntil:n.Union([n.Null(),p({allowEmpty:!1,type:"date-time"})])}),response:mp}),MGe=ui(aR,{maxIds:100}),Kmr=f({tags:["monitors"],url:`${mo}/bulk-snooze`,method:"POST",body:n.Object({selection:MGe,pauseUntil:p({allowEmpty:!1,type:"date-time"})}),response:n.Object({})}),DGe=["alert","alert_consider_zero","alert_no_data","keep_last_status_alert"],FGe=["ok","ok_consider_zero","ok_no_data","keep_last_status_ok"],$Ge=[...DGe,...FGe],Id=n.Enum($Ge),GGe=D("type",[n.Object({type:n.Literal("each"),subStates:n.Record(n.String(),n.Object({stateValue:n.Union([Id,n.Null()]),lastChangedAt:w()}))}),n.Object({type:n.Literal("no_aggregation"),stateValue:n.Optional(Id)}),n.Object({type:n.Literal("any"),stateValue:n.Optional(Id)}),n.Object({type:n.Literal("all"),stateValue:n.Optional(Id)}),n.Object({type:n.Literal("proportion"),stateValue:n.Optional(Id)})]),BGe=n.Object({monitorId:n.String(),currentState:GGe,lastChangedAt:n.Optional(w())}),zmr=f({tags:["monitors"],url:`${mo}/states/:id`,method:"GET",params:n.Object({id:p()}),response:BGe}),Ymr=f({tags:["monitors"],url:`${mo}/:id/transitions`,method:"GET",params:n.Object({id:p()}),query:n.Object({from:n.Number(),to:n.Number()}),response:n.Array(n.Object({id:n.String(),createdAt:w(),fromState:n.Optional(Id),toState:n.Optional(Id),dimension:n.Optional(n.String())}))}),jGe=["unprocessed","processed","failed-to-process"],Vmr=f({tags:["monitors"],url:`${mo}/:id/results`,method:"GET",params:n.Object({id:p()}),query:n.Object({from:n.Number(),to:n.Number()}),response:n.Object({isTruncated:n.Boolean(),results:n.Array(n.Object({id:n.String(),evaluationAt:w(),formulaResult:n.Object({groups:n.Array(n.Object({groupKey:n.Record(n.String(),zE),results:n.Array(n.Union([n.Number(),n.Null()])),conditionMet:n.Enum(["true","false","nan-no-data"])}))}),createdAt:w(),status:n.Enum(jGe)}))})});var Cse=D("type",[n.Object({type:n.Literal("bearer"),tokenLastChars:n.String()}),n.Object({type:n.Literal("basic"),username:n.String(),passwordLastChars:n.String()}),n.Object({type:n.Literal("custom-header"),key:n.String(),valueLastChars:n.String()}),n.Object({type:n.Literal("none")})]),Rse=D("type",[n.Object({type:n.Literal("bearer"),token:p({allowEmpty:!1})}),n.Object({type:n.Literal("basic"),username:p({allowEmpty:!1}),password:p({allowEmpty:!1})}),n.Object({type:n.Literal("custom-header"),key:p({allowEmpty:!1}),value:p({allowEmpty:!1})}),n.Object({type:n.Literal("none")})]),Pse=D("type",[n.Object({type:n.Literal("bearer"),token:n.Optional(p({allowEmpty:!1}))}),n.Object({type:n.Literal("basic"),username:n.Optional(p({allowEmpty:!1})),password:n.Optional(p({allowEmpty:!1}))}),n.Object({type:n.Literal("custom-header"),key:n.Optional(p({allowEmpty:!1})),value:n.Optional(p({allowEmpty:!1}))}),n.Object({type:n.Literal("none")})]);var xd="/v0/notifications",Ta=`${xd}/rules`,Use=`${xd}/slack/setup`,fg=`${xd}/integrations`,bd=["triggered","resolved","no-data"],qGe=["sent","stale","pending","rate-limited","failed","silenced"],HGe=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."})),lF=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."}),KGe=n.Optional(lF),ya=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."})),Ea=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."})),$T=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:HGe,config:D("type",[n.Object({type:n.Literal("slack",{description:"Slack target backed by a configured Slack integration."}),channel:n.String({description:"Slack channel ID that receives the notification"}),integrationId:n.String({description:"Slack workspace ID that receives the notification"}),integrationName:n.String({description:"Human readable name of the Slack integration"}),renotifyConfig:ya},{$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:ya},{$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:ya},{$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:ya},{$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:ya},{$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:ya},{$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:ya},{$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:ya},{$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:ya},{$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:ya},{$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`."})}),gg=n.Object({id:p({description:"Identifier of the notification target within this rule. Choose a stable ID that is unique among this rule's targets; Tsuga uses it with the rule ID for per-target delivery state such as rate limiting."}),rateLimit:KGe,config:D("type",[n.Object({type:n.Literal("slack",{description:"Slack target backed by a configured Slack integration."}),channel:p({allowEmpty:!1,description:"Slack channel ID that receives the notification"}),integrationId:p({allowEmpty:!1,description:"Slack workspace ID that receives the notification"}),renotifyConfig:Ea},{$id:"RuleTargetInputSlack"}),n.Object({type:n.Literal("incident-io",{description:"incident.io target backed by a configured incident.io integration."}),integrationId:p({allowEmpty:!1,description:"Identifier of the incident.io integration to use"}),renotifyConfig:Ea},{$id:"RuleTargetInputIncidentIo"}),n.Object({type:n.Literal("pagerduty",{description:"PagerDuty target backed by a configured PagerDuty integration."}),integrationId:p({allowEmpty:!1,description:"Identifier of the PagerDuty integration to use"}),renotifyConfig:Ea},{$id:"RuleTargetInputPagerDuty"}),n.Object({type:n.Literal("email",{description:"Email target that sends directly to the listed addresses and does not require an integration."}),addresses:n.Array(p({type:"email"}),{minItems:1,maxItems:20,description:"Email addresses that will receive the alert"}),renotifyConfig:Ea},{$id:"RuleTargetInputEmail"}),n.Object({type:n.Literal("grafana-irm",{description:"Grafana IRM target backed by a configured Grafana IRM integration."}),integrationId:p({allowEmpty:!1,description:"Identifier of the Grafana IRM integration to use"}),renotifyConfig:Ea},{$id:"RuleTargetInputGrafanaIrm"}),n.Object({type:n.Literal("microsoft-teams",{description:"Microsoft Teams target backed by a configured Microsoft Teams integration."}),integrationId:p({allowEmpty:!1,description:"Identifier of the Microsoft Teams integration to use"}),renotifyConfig:Ea},{$id:"RuleTargetInputMicrosoftTeams"}),n.Object({type:n.Literal("webhook",{description:"Webhook target backed by a configured webhook integration."}),integrationId:p({allowEmpty:!1,description:"Identifier of the webhook integration to use"}),renotifyConfig:Ea},{$id:"RuleTargetInputWebhook"}),n.Object({type:n.Literal("servicenow",{description:"ServiceNow target backed by a configured ServiceNow integration."}),integrationId:p({allowEmpty:!1,description:"Identifier of the ServiceNow integration to use"}),renotifyConfig:Ea},{$id:"RuleTargetInputServiceNow"}),n.Object({type:n.Literal("google-chat",{description:"Google Chat target backed by a configured Google Chat integration."}),integrationId:p({allowEmpty:!1,description:"Identifier of the Google Chat integration to use"}),renotifyConfig:Ea},{$id:"RuleTargetInputGoogleChat"}),n.Object({type:n.Literal("squadcast",{description:"Squadcast target backed by a configured Squadcast integration."}),integrationId:p({allowEmpty:!1,description:"Identifier of the Squadcast integration to use"}),renotifyConfig:Ea},{$id:"RuleTargetInputSquadcast"}),n.Object({type:n.Literal("jira",{description:"Jira target backed by a configured Jira integration. Jira targets file one issue per notification and do not support renotification."}),integrationId:p({allowEmpty:!1,description:"Identifier of the Jira integration to use"}),projectKey:p({allowEmpty:!1,description:'Key of the Jira project that alert issues are filed into, like "OPS".'}),issueType:p({allowEmpty:!1,description:'Name of the Jira issue type created for alerts, like "Bug" or "Task".'}),openStatus:n.Optional(p({allowEmpty:!1,description:"Jira status the alert ticket is moved to right after it is filed for a firing alert. A later transition between two firing states leaves the ticket status alone."})),closedStatus:n.Optional(p({allowEmpty:!1,description:"Jira status the alert ticket is moved to when the alert resolves. Only takes effect when the rule delivers recovery transitions."}))},{$id:"RuleTargetInputJira"})],{description:"Destination that should receive the notification. The `type` field discriminates the variant: `email` sends directly to the listed addresses and needs no integration; every other type routes through the integration identified by `integrationId`, which must already exist (create it first with the notification integration endpoints)."})}),dF=D("type",[n.Object({type:n.Literal("specific-teams",{description:"Match alert transitions associated with the listed teams. The caller must be allowed to access every listed team."}),teams:n.Array(n.String(),{description:"Team IDs selected by this filter."})},{title:"SpecificTeams"}),n.Object({type:n.Literal("all-teams",{description:"Match alert transitions for every team in the organization. Public API callers need an API key with `all` scope to create or update this filter."})},{title:"AllTeams"}),n.Object({type:n.Literal("all-public-teams",{description:"Match alert transitions for all public teams. Public API callers need an API key with `all` or `owning-team-and-public` scope to create or update this filter."})},{title:"AllPublicTeams"})],{description:"Team visibility filter used when matching alert transitions. Tsuga validates create and update requests against the caller permissions."}),mF=D("type",[n.Object({type:n.Literal("specific-teams",{description:"Match alert transitions associated with the listed teams. The caller must be allowed to access every listed team."}),teams:n.Array(p(),{minItems:1,maxItems:100,description:"Team IDs selected by this filter."})},{title:"SpecificTeams"}),n.Object({type:n.Literal("all-teams",{description:"Match alert transitions for every team in the organization. Public API callers need an API key with `all` scope to create or update this filter."})},{title:"AllTeams"}),n.Object({type:n.Literal("all-public-teams",{description:"Match alert transitions for all public teams. Public API callers need an API key with `all` or `owning-team-and-public` scope to create or update this filter."})},{title:"AllPublicTeams"})],{description:"Team visibility filter used when matching alert transitions. Tsuga validates create and update requests against the caller permissions."}),Od=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(yn),{description:"Monitor priorities that must match for this rule to fire. An empty array matches every priority."}),transitionTypesFilter:n.Array(n.Enum(bd),{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:w({description:"Timestamp when Tsuga created the rule."}),updatedAt:w({description:"Timestamp when Tsuga last updated the rule."}),isActive:n.Boolean({description:"Whether the rule currently sends notifications when its filters match."}),tags:vt,targets:n.Array($T,{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(Se),updater:n.Optional(Se)}),GT=n.Object({name:p({description:"Display name of the notification rule."}),queryString:Ye(p({type:"tags-query"}),{description:"Optional query that narrows which alert transitions trigger the rule. Matches on the monitor transition group key and the monitor tags, e.g. `env:prod service:api`. Omit or leave empty to match regardless of tags."}),teamsFilter:mF,prioritiesFilter:n.Array(n.Enum(yn),{maxItems:yn.length,description:"Monitor priorities that must match for this rule to fire. An empty array matches every priority."}),transitionTypesFilter:n.Array(n.Enum(bd),{maxItems:bd.length,description:"Alert state transitions that must match for this rule to fire. An empty array matches every transition type."}),clusterIdsFilter:n.Optional(n.Array(p({allowEmpty:!1}),{description:"Cluster IDs that must match for this rule to fire. Omit it, or leave it empty, to match every cluster."})),owner:p({allowEmpty:!1,description:"Team ID that owns and manages the rule"}),tags:$t,isActive:n.Boolean({description:"Set to true for the rule to send notifications when its filters match."}),targets:n.Array(gg,{minItems:1,description:"Destinations that receive a notification whenever this rule matches an alert transition. This list replaces the existing targets on update."})}),Ad=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:w({description:"Timestamp when Tsuga created the rule."}),updatedAt:w({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:vt,monitorIds:n.Array(n.String(),{description:"Monitors this rule reacts to."}),sloIds:n.Array(n.String(),{description:"SLOs this rule reacts to."}),fallbackTarget:$T,creator:n.Optional(Se),updater:n.Optional(Se)}),cR=n.Object({name:p({description:"Display name of the adaptive notification rule."}),owner:p({allowEmpty:!1,description:"Team ID that owns and manages the rule"}),tags:$t,isActive:n.Boolean({description:"Set to true for the rule to send notifications when one of its monitors fires."}),shouldCreateInvestigation:n.Optional(n.Boolean({description:"Set to true to record an investigation for each page, holding the sampled traces and the call graph the destination was resolved from, and to link it from the notification body. Defaults to false."})),monitorIds:n.Optional(n.Array(p({allowEmpty:!1}),{maxItems:100,description:"Monitors this rule reacts to. Only trace monitors and metric monitors over OTel span metrics are eligible. On update, omitting this field keeps the current monitors; send an empty array to remove them. Send at least one monitor or SLO."})),sloIds:n.Optional(n.Array(p({allowEmpty:!1}),{maxItems:100,description:"SLOs this rule reacts to. Only SLOs over traces or OTel span metrics are eligible. On update, omitting this field keeps the current SLOs; send an empty array to remove them. Send at least one monitor or SLO."})),fallbackTarget:gg}),zGe=["active","inactive"],YGe=["name","isActive","owner","tags","clusterIdsFilter","targets","type","updatedAt"],wse=n.Object({owners:he(p({allowEmpty:!1}),{description:"Restrict results to rules owned by any of these team IDs.",maxItems:50}),searchQuery:Oo({description:"Search query filter for notification rules.",valueDescription:"Case-insensitive substring matched against rule name and ID."}),tags:he(rn.items,{description:"Restrict results to rules that have at least one of the listed key/value tags.",maxItems:50}),destinations:he(p({allowEmpty:!1}),{description:"Restrict results to rules that route to any of these email addresses or integration IDs.",maxItems:50}),clusterIds:he(p({allowEmpty:!1}),{description:"Restrict results to rules that run on any of these cluster IDs. Rules with no cluster restriction are treated as running on every cluster, including the requested ones.",maxItems:50}),status:n.Enum(zGe,{description:"Restrict results to active or inactive rules."})}),VGe=n.Partial(n.Object({...fe,filters:n.Partial(wse),sort:n.Object({by:n.Enum(YGe,{description:"Field to sort the returned notification rules by."}),direction:le})})),WGe=n.Object({type:n.Literal("standard",{description:"Standard notification rule matched by query, tags, and destinations."}),...Od.properties}),QGe=n.Object({type:n.Literal("adaptive",{description:"Adaptive notification rule matched by selected monitors or SLOs."}),...Ad.properties}),ZGe=D("type",[WGe,QGe]),XGe=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."})}),JGe=n.Object({tags:Vr,destinations:n.Array(XGe,{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."})})}),eBe=n.Object({filters:n.Optional(n.Partial(wse,{description:"Filters applied before collecting tag, destination, and active-count options."}))}),afr=f({tags:["notification-rules"],url:`${Ta}/query`,method:"POST",paginated:!0,body:VGe,response:n.Array(ZGe,{description:"Matching standard and adaptive notification rules after they are merged, sorted, and paginated."})}),cfr=f({tags:["notification-rules"],url:`${Ta}/options/query`,method:"POST",body:eBe,response:JGe}),ufr=f({tags:["notification-rules"],url:Ta,method:"GET",paginated:!0,query:n.Object(fe),response:n.Array(Od)}),pfr=f({tags:["notification-rules"],url:`${Ta}/:id`,params:n.Object({id:p()}),method:"GET",response:Od}),lfr=f({tags:["notification-rules"],url:Ta,method:"POST",body:GT,response:Od}),dfr=f({tags:["notification-rules"],url:`${Ta}/:id`,method:"PUT",params:n.Object({id:p()}),body:GT,response:Od}),mfr=f({tags:["notification-rules"],url:`${Ta}/:id`,method:"DELETE",params:n.Object({id:p()}),response:B}),ffr=f({tags:["notification-rules"],url:`${Ta}/bulk-delete`,method:"DELETE",body:n.Object({ids:n.Array(p(),{uniqueItems:!0})}),response:n.Object({})}),hg=`${xd}/adaptive-rules`,gfr=f({tags:["notification-rules"],url:hg,method:"GET",paginated:!0,query:n.Object(fe),response:n.Array(Ad)}),hfr=f({tags:["notification-rules"],url:`${hg}/:id`,params:n.Object({id:p()}),method:"GET",response:Ad}),yfr=f({tags:["notification-rules"],url:hg,method:"POST",body:cR,response:Ad}),Efr=f({tags:["notification-rules"],url:`${hg}/:id`,method:"PUT",params:n.Object({id:p()}),body:cR,response:Ad}),Tfr=f({tags:["notification-rules"],url:`${hg}/:id`,method:"DELETE",params:n.Object({id:p()}),response:B}),Sfr=f({tags:["notification-rules"],url:`${hg}/bulk-delete`,method:"DELETE",body:n.Object({ids:n.Array(p(),{uniqueItems:!0})}),response:n.Object({})}),_fr=f({tags:["notification-integrations"],url:`${Use}/start`,method:"POST",response:n.Object({redirectUrl:n.String()})}),tBe=["google-chat","grafana-irm","incident-io","jira","microsoft-teams","pagerduty","servicenow","slack","squadcast","webhook"],vse=n.Object({id:n.String(),name:n.String(),type:n.Enum(tBe),createdAt:w(),ruleCount:n.Number(),creator:n.Optional(Se),owner:n.Optional(n.String({description:"ID of the team that owns the integration. Absent on integrations created before ownership was introduced."}))}),rBe=["name","type","ruleCount","createdAt"],nBe=n.Object({searchQuery:Oo({description:"Search query filter for notification integrations.",valueDescription:"Case-insensitive substring matched against integration name and ID."})}),oBe=n.Partial(n.Object({...fe,filters:n.Partial(nBe),sort:n.Object({by:n.Enum(rBe,{description:"Field to sort the returned notification integrations by."}),direction:le})})),Ifr=f({tags:["notification-integrations"],url:`${fg}/query`,method:"POST",paginated:!0,body:oBe,response:n.Array(vse,{description:"Matching notification integrations after they are filtered, sorted, and paginated."})}),bfr=f({tags:["notification-integrations"],url:`${Ta}/integrations`,method:"GET",paginated:!0,query:n.Object(fe),response:n.Array(vse)}),xfr=f({tags:["notification-integrations"],url:`${Use}/callback`,method:"GET",query:n.Object({code:p()}),response:n.Object({success:n.Boolean()})}),iBe={data:"notification_view_data",source:"notification_view_source",dashboard:"notification_view_dashboard",service:"notification_view_service"},Ofr=n.Object({type:n.Literal("block_actions"),actions:n.Array(n.Object({type:n.Literal("button"),action_id:n.Enum(Object.values(iBe))}),{minItems:1})}),Afr=f({tags:["notification-integrations"],url:`${xd}/slack/interactivity`,method:"POST",body:n.String(),response:n.Literal("")}),fF=["POST","PUT"],sBe=n.Record(n.String(),n.String()),aBe=n.Record(n.String(),n.Unknown()),cBe=n.Record(n.String(),n.Union([n.String(),n.Number(),n.Boolean(),n.Null(),n.Array(n.Union([n.String(),n.Number(),n.Boolean()]))])),uBe=D("type",[n.Object({type:n.Literal("json"),value:aBe}),n.Object({type:n.Literal("form"),value:cBe})]),pBe=n.Object({ok:n.String(),alert:n.String()}),BT=n.Object({id:n.String(),name:n.String(),owner:n.Optional(n.String({description:"ID of the team that owns the integration. Absent on integrations created before ownership was introduced."})),setting:D("type",[n.Object({type:n.Literal("incident-io"),alertSourceConfigId:n.String(),tokenLastChars:n.String()}),n.Object({type:n.Literal("grafana-irm"),urlLastChars:n.String()}),n.Object({type:n.Literal("pagerduty"),integrationKeyLastChars:n.String()}),n.Object({type:n.Literal("microsoft-teams"),webhookUrlLastChars:n.String()}),n.Object({type:n.Literal("webhook"),urlLastChars:n.String(),method:n.Enum(fF),authentication:Cse,customHeaders:n.Optional(sBe),payloadTemplate:uBe,eventNameMapping:n.Optional(pBe)}),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:vt}),lBe=n.Object({type:n.Literal("webhook"),url:p({type:"uri"}),method:n.Enum(fF),authentication:Rse,customHeaders:n.Record(p({allowEmpty:!1}),p()),payloadTemplate:D("type",[n.Object({type:n.Literal("json"),value:n.Record(p({allowEmpty:!1}),n.Unknown())}),n.Object({type:n.Literal("form"),value:n.Record(p({allowEmpty:!1}),n.Union([n.String(),n.Number(),n.Boolean(),n.Null(),n.Array(n.Union([n.String(),n.Number(),n.Boolean()]))]))})]),eventNameMapping:n.Optional(n.Object({ok:p({allowEmpty:!1}),alert:p({allowEmpty:!1})}))}),Nse=n.Object({type:n.Literal("incident-io"),alertSourceConfigId:p(),token:p()}),kse=n.Object({type:n.Literal("grafana-irm"),url:p({type:"uri"})}),Lse=n.Object({type:n.Literal("pagerduty"),integrationKey:p()}),Mse=n.Object({type:n.Literal("microsoft-teams"),webhookUrl:p({type:"uri"})}),dBe=n.Object({type:n.Literal("servicenow"),instanceName:p({allowEmpty:!1,description:'Instance name of the ServiceNow instance. This corresponds to the subdomain part of the instance URL, like "my-instance" in "my-instance.service-now.com"'}),username:p({allowEmpty:!1}),password:p({allowEmpty:!1})}),mBe=n.Object({type:n.Literal("google-chat"),webhookUrl:p({type:"uri"})}),fBe=n.Object({type:n.Literal("squadcast"),webhookUrl:p({type:"uri"})}),gBe=n.Object({type:n.Literal("jira"),siteUrl:p({type:"uri",allowEmpty:!1,description:'Base URL of the Jira Cloud site, like "https://your-company.atlassian.net". Tsuga files issues against this site.'}),email:p({type:"email",allowEmpty:!1,description:"Atlassian account email used together with the API token for Basic authentication."}),apiToken:p({allowEmpty:!1,description:"Atlassian API token minted for the account, used as the Basic auth password."})}),Dse=p({allowEmpty:!1,description:"ID of the team that will own the integration, determining which team members can view and manage it. Only an org admin or an admin of this team may set it."}),gF=n.Object({name:p(),owner:Dse,setting:D("type",[Nse,kse,Lse,Mse,lBe,dBe,mBe,fBe,gBe]),tags:$t}),hBe=n.Object({type:n.Literal("webhook"),url:n.Optional(p({type:"uri"})),method:n.Optional(n.Enum(fF)),authentication:n.Optional(Pse),customHeaders:n.Optional(n.Record(p({allowEmpty:!1}),p())),payloadTemplate:n.Optional(D("type",[n.Object({type:n.Literal("json"),value:n.Record(p({allowEmpty:!1}),n.Unknown())}),n.Object({type:n.Literal("form"),value:n.Record(p({allowEmpty:!1}),n.Union([n.String(),n.Number(),n.Boolean(),n.Null(),n.Array(n.Union([n.String(),n.Number(),n.Boolean()]))]))})])),eventNameMapping:Ye(n.Object({ok:n.Optional(p({allowEmpty:!1})),alert:n.Optional(p({allowEmpty:!1}))}))}),yBe=n.Object({type:n.Literal("servicenow"),instanceName:n.Optional(p({allowEmpty:!1})),username:n.Optional(p({allowEmpty:!1})),password:n.Optional(p({allowEmpty:!1}))}),EBe=n.Object({type:n.Literal("jira"),siteUrl:n.Optional(p({type:"uri",allowEmpty:!1})),email:n.Optional(p({allowEmpty:!1})),apiToken:n.Optional(p({allowEmpty:!1}))}),TBe=n.Object({type:n.Literal("google-chat"),webhookUrl:p({type:"uri"})}),SBe=n.Object({type:n.Literal("squadcast"),webhookUrl:p({type:"uri"})}),hF=n.Object({name:n.Optional(p()),owner:Dse,tags:$t,setting:n.Optional(D("type",[Nse,kse,Lse,Mse,hBe,yBe,TBe,SBe,EBe]))}),Cfr=f({tags:["notification-integrations"],url:fg,method:"POST",body:gF,response:BT}),Rfr=f({tags:["notification-integrations"],url:`${fg}/:id`,method:"GET",params:n.Object({id:p()}),response:BT}),Pfr=f({tags:["notification-integrations"],url:`${fg}/:id`,method:"PATCH",params:n.Object({id:p()}),body:hF,response:BT}),Ufr=f({tags:["notification-integrations"],url:`${fg}/:id`,method:"DELETE",params:n.Object({id:p()}),response:B}),_Be=D("status",[n.Object({status:n.Literal("ok",{description:"Tsuga reached Jira and listed the projects the credentials can file into."}),projects:n.Array(n.Object({key:n.String({description:'Jira project key, like "OPS".'}),name:n.String({description:"Human readable Jira project name."}),issueTypes:n.Array(n.String(),{description:"Issue type names available when creating an issue in this project."}),statuses:n.Optional(n.Array(n.String(),{description:"Status names an issue in this project can be transitioned to. Omitted when Jira refused the status lookup for this project."}))}),{description:"Projects the connected Jira account can file issues into."})},{title:"JiraMetadataOk"}),n.Object({status:n.Literal("error",{description:"Tsuga could not load Jira metadata with the stored credentials."}),message:n.String({description:"Human readable reason the Jira metadata could not be loaded."})},{title:"JiraMetadataError"})],{description:"Result of probing Jira for the projects, issue types and statuses reachable with a stored integration. Returns a typed error instead of failing so the rule editor can fall back to free-text entry."}),wfr=f({tags:["notification-integrations"],url:`${fg}/:id/jira-metadata`,method:"GET",params:n.Object({id:p()}),response:_Be}),vfr=f({tags:["notification-rules"],url:`${mo}/:id/notifications`,method:"GET",params:n.Object({id:p()}),query:n.Optional(n.Object({from:n.Optional(n.Number()),to:n.Optional(n.Number())})),response:n.Object({notifications:n.Array(n.Object({id:n.String(),monitorId:n.String(),monitorResultId:n.String(),ruleId:n.Optional(n.String()),targetId:n.Optional(n.String()),status:n.Enum(qGe),tryCount:n.Number(),nextTryAt:w(),createdAt:w(),updatedAt:w(),sentAt:n.Optional(w())})),isTruncated:n.Boolean()})}),IBe=["slack","incident-io","pagerduty","email","grafana-irm","microsoft-teams","webhook","servicenow","google-chat","squadcast","jira"],Nfr=f({tags:["notification-rules"],url:`${Ta}/test`,method:"POST",body:n.Object({notificationRule:GT,targetIds:n.Optional(n.Array(p({allowEmpty:!1}),{description:"Target IDs to test specific targets",minItems:1,maxItems:10})),monitorId:n.Optional(p({allowEmpty:!1,description:"Monitor to simulate: the test notification is built like a real alert of this monitor (message, tags, group by values). When omitted, a generic test notification is sent."}))}),response:n.Union([n.Object({success:n.Literal(!1),overallMessage:n.String({description:"Message when there is an overall error"})}),n.Object({success:n.Boolean(),results:n.Array(n.Object({targetId:n.String({description:"The ID of the target that was tested"}),targetType:n.Enum(IBe,{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 bBe=["healthy","breached","no_data"],fp=n.Enum(bBe,{description:"SLO status: healthy (meeting the target), breached (breaching it), or no_data (not evaluated yet)"}),yg=n.Object({owners:he(p({allowEmpty:!1}),{description:"Restrict results to SLOs owned by any of these team IDs",maxItems:50}),searchQuery:Oo({description:"Text filter for SLO names or IDs. Optional; `exclude: true` removes matching SLOs.",valueDescription:"Substring matched case-insensitively against the SLO name or SLO ID."}),tags:he(rn.items,{description:"Restrict results to SLOs that have at least one of the listed key/value tags",maxItems:50}),clusterIds:he(p({allowEmpty:!1}),{description:"Restrict results to SLOs that run against any of these cluster IDs (SLOs with no cluster restriction are always included)",maxItems:50}),statuses:he(fp,{description:"Restrict results to SLOs whose status is one of these values",maxItems:3})},{description:"Optional filters applied to narrow the returned SLOs"});var xs="/v0/service-catalog",xBe=n.Object({team:n.String({description:"Team name observed on telemetry for this service. The emitting service sets it through telemetry attributes. Returned when Tsuga has observed a team value for the service; metadata refreshes weekly or when a new service version appears. For a service the service catalog has not recorded yet, it comes from the trace span metrics of the queried window."})},{description:"A team name observed on telemetry for this service."}),OBe=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:w({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."}),ABe=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:w({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:w({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."}),CBe=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:w({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."}),RBe=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:w({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."}),PBe=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:w({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."}),UBe=n.Object({platform:n.String({description:"Observed cloud or orchestration platform. Tsuga reads the `cloud.platform` resource attribute, such as `aws_eks` or `aws_lambda`, and adds `kubernetes` when spans carry `k8s.cluster.name` and `aws_ecs` when they carry `aws.ecs.task.arn`. The emitting service or collector sets these resource attributes."}),lastSeenAt:w({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."}),wBe=n.Object({provider:n.String({description:"Observed cloud provider, read from the `cloud.provider` resource attribute, such as `aws`, `gcp`, or `azure`. The emitting service or collector sets it."}),lastSeenAt:w({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."}),Eg=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:$T.properties.config,rateLimit:$T.properties.rateLimit,createdAt:w({description:"Timestamp when the service notification target was created. Tsuga sets this value and returns it on private service-catalog responses."}),updatedAt:w({description:"Timestamp when the service notification target was last updated. Tsuga sets this value and returns it on private service-catalog responses."})}),yF=n.Object({config:gg.properties.config,rateLimit:gg.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."}),EF=n.Object({config:gg.properties.config,rateLimit:n.Union([lF,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."}),uR=n.Object({id:n.Optional(n.String({description:"Unique identifier of this service. Use it with service detail and graph endpoints. Absent until the hourly service catalog task records the service."})),serviceName:n.String({description:"OpenTelemetry service name observed in telemetry."}),serviceNamespace:n.Optional(n.String({description:"OpenTelemetry service namespace observed in telemetry."})),env:n.String({description:"Environment value observed for this service."}),teams:n.Array(xBe,{description:"Team names observed on telemetry for this service."}),ingestionApiKeys:n.Array(OBe,{description:"Ingestion API keys observed on telemetry for this service and when each was last seen."}),versions:n.Array(ABe,{description:"Service version values observed in telemetry, including first and last seen timestamps."}),languages:n.Array(CBe,{description:"Programming languages observed for this service."}),serverProtocols:n.Array(RBe,{description:"API protocols this service exposes (from server-kind spans)"}),frameworks:n.Array(PBe,{description:"Application frameworks detected from OTel instrumentation scope"}),cloudPlatforms:n.Optional(n.Array(UBe,{description:"Cloud platforms this service is running on. Absent or empty when Tsuga has not observed platform metadata for the service; treat both the same."})),cloudProviders:n.Optional(n.Array(wBe,{description:"Cloud providers this service is running on. Absent or empty when Tsuga has not observed provider metadata for the service; treat both the same."})),lastSeenAt:n.Optional(w({description:"Most recent time Tsuga observed telemetry for this service. Absent until the hourly service catalog task records the service."})),firstSeenAt:n.Optional(w({description:"First time Tsuga observed telemetry for this service. Absent until the hourly service catalog task records the service."})),traceRequestRate:n.Optional(n.Number({description:"Requests per second observed for this service over the queried window, counting calls of its primary span kind. The primary span kind is the busiest of `SPAN_KIND_SERVER`, `SPAN_KIND_PRODUCER`, and `SPAN_KIND_CONSUMER` in the service\u2019s busiest env, or `SPAN_KIND_INTERNAL` when the service has none of those; `SPAN_KIND_CLIENT` never counts. Every env of the service uses that same span kind. Omitted when the trace query failed, which is distinct from `0` (the service is quiet)."})),traceErrorRate:n.Optional(n.Number({description:"Percentage of this service\u2019s primary-span-kind calls (see `traceRequestRate`) over the queried window that ended with error status. Omitted when the trace query failed."})),notificationTargets:n.Array(Eg,{description:"Notification targets attached to this service, used by adaptive notification rules to page its owners."}),createdAt:n.Optional(w({description:"Timestamp when Tsuga created this service catalog entry."})),updatedAt:n.Optional(w({description:"Timestamp when Tsuga last updated this service catalog entry."}))}),vBe=n.Object({spanKind:n.Enum(C8),count:n.Number()});var Fse=n.Object({...uR.properties,spanKindCounts:n.Array(vBe),envs:n.Array(n.String())}),NBe=["serviceName","env","lastDeploy","traceErrorRate","traceRequestRate","teams","api","frameworks","languages","pagingDestination"],kBe=n.Object({searchQuery:n.Object({value:p({allowEmpty:!1,description:"Substring matched case-insensitively against service names."})},{description:"Text filter for service names."}),teams:he(p({allowEmpty:!1}),{description:"Restrict results to services observed under any of these team names",maxItems:50}),envs:he(p({allowEmpty:!1}),{description:"Restrict results to services observed in any of these environments",maxItems:50}),versions:he(p({allowEmpty:!1}),{description:"Restrict results to services whose latest observed version is one of these",maxItems:50}),languages:he(p({allowEmpty:!1}),{description:"Restrict results to services written in any of these languages",maxItems:50}),hasRecentData:n.Boolean({description:"When true, only return services whose request rate over the queried window is non-zero"})}),jT=["1h","4h","24h"];var TF=n.Partial(n.Object({...fe,clusterId:p(),filters:n.Partial(kBe,{description:"Optional filters applied to narrow the returned services"}),sort:n.Object({by:n.Enum(NBe,{description:"Field to sort the returned services by"}),direction:le},{description:"Optional sorting applied to the returned services"}),statsWindow:n.Enum(jT,{description:"Lookback used to select the services returned, which are those with trace span metrics in it, and to compute the trace request rate and trace error rate fields and the span-call totals that pick each service's primary environment. Defaults to `1h`."})})),Vfr=f({tags:["service-catalog"],url:`${xs}/v2/services/query`,method:"POST",paginated:!0,body:TF,response:n.Array(Fse)}),Wfr=f({tags:["service-catalog"],query:n.Object({serviceName:p({allowEmpty:!1}),serviceNamespace:n.Optional(p({allowEmpty:!1})),env:p({allowEmpty:!1}),clusterId:n.Optional(p())}),method:"GET",url:`${xs}/v2/service`,response:Fse}),Qfr=f({tags:["service-catalog"],query:n.Object({serviceName:p({allowEmpty:!1}),serviceNamespace:n.Optional(p({allowEmpty:!1})),clusterId:n.Optional(p())}),method:"GET",url:`${xs}/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."})}),Zfr=f({tags:["service-catalog"],method:"GET",url:`${xs}/services/:serviceId`,params:n.Object({serviceId:p()}),response:uR}),Xfr=f({tags:["service-catalog"],method:"GET",url:`${xs}/services/:serviceId/targets`,params:n.Object({serviceId:p()}),response:n.Array(Eg)}),Jfr=f({tags:["service-catalog"],method:"POST",url:`${xs}/services/:serviceId/targets`,params:n.Object({serviceId:p()}),body:yF,response:Eg}),egr=f({tags:["service-catalog"],method:"PUT",url:`${xs}/services/:serviceId/targets/:targetId`,params:n.Object({serviceId:p(),targetId:p()}),body:EF,response:Eg}),tgr=f({tags:["service-catalog"],method:"DELETE",url:`${xs}/services/:serviceId/targets/:targetId`,params:n.Object({serviceId:p(),targetId:p()}),response:B}),LBe=["http","rpc","messaging","genai","object_store"],$se={name:n.String({description:"Service or inferred dependency name shown in the graph."}),env:n.Optional(n.String({description:"Environment observed from spans."}))},SF=n.Object({...$se,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."})}),Gse={...$se,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"}))},_F=n.Object({...Gse,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`."})}),IF=n.Object({...Gse,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(LBe,{description:"Inferred dependency type from span metadata: http, rpc, messaging, genai, or object_store."})}),MBe=D("nodeType",[SF,_F,IF]),bF=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."}),rgr=f({tags:["service-catalog"],url:`${xs}/services/:serviceId/graph`,method:"GET",params:n.Object({serviceId:p()}),query:n.Object({...Cr.properties,query:n.Optional(p({type:"tsuga-query"}))}),response:n.Object({clusterId:n.String(),nodes:n.Array(MBe),edges:n.Array(bF)})}),DBe=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(yn,{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(fp,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"})}))}),ngr=f({tags:["service-catalog"],method:"GET",url:`${xs}/services/:serviceId/related-resources`,params:n.Object({serviceId:p()}),response:DBe}),ogr=f({tags:["service-catalog"],method:"GET",url:`${xs}/services/by-api-keys`,response:n.Record(n.String(),n.Array(n.Object({serviceName:n.String(),serviceNamespace:n.Optional(n.String())})))});var Bse="/v0/service-catalog/queues",pR=n.Object({clusterId:n.String(),name:n.String(),env:n.String(),messagingSystem:n.String(),publishPerSecond:n.Number({description:"Messages published per second."}),consumePerSecond:n.Number({description:"Messages consumed per second."}),consumerErrorsPerSecond:n.Number({description:"Messages per second whose consumer span has an error status."}),p90ProcessingMs:n.Number({description:"p90 duration of consumer spans."})}),pgr=f({tags:["service-catalog"],query:n.Object({...fe,clusterId:n.Optional(p({description:"Cluster ID used to restrict the returned queue catalog entries."})),env:n.Optional(p({allowEmpty:!1,description:"Environment used to restrict the queues."})),statsWindow:n.Optional(n.Enum(jT,{description:"Lookback over producer and consumer messaging spans used to list the queues and compute their rates."}))}),method:"GET",paginated:!0,url:Bse,response:n.Array(pR)}),lgr=f({tags:["service-catalog"],method:"GET",url:`${Bse}/by-name`,query:n.Object({name:p({allowEmpty:!1}),messagingSystem:p({allowEmpty:!1}),env:p({allowEmpty:!1}),clusterId:n.Optional(p({allowEmpty:!1}))}),response:pR});var jse=`/${"v1"}/queues`,xF=n.Pick(pR,["name","env","messagingSystem","publishPerSecond","consumePerSecond","consumerErrorsPerSecond","p90ProcessingMs"],{$id:"Queue",description:"Message queue inferred from producer and consumer messaging spans (OpenTelemetry `messaging.*` attributes), with its publish, consume, and consumer error rates."}),FBe={name:"orders",env:"production",messagingSystem:"kafka",publishPerSecond:42.5,consumePerSecond:41.9,consumerErrorsPerSecond:.2,p90ProcessingMs:18.4};Object.assign(xF,{examples:[FBe]});var qse=n.Optional(p({allowEmpty:!1,description:"Telemetry cluster to target. Omit to use the first cluster in the organization; this does not query all clusters."})),Hse=f({description:"Lists message queues and topics (Kafka, SQS, RabbitMQ and other messaging systems) inferred from producer and consumer messaging spans, with per-second publish, consume and consumer error rates and p90 processing duration over the stats window.",operationId:"listQueues",tags:["queues"],method:"GET",url:jse,paginated:!0,query:n.Object({...qe,clusterId:qse,env:n.Optional(p({allowEmpty:!1,description:"Environment used to restrict the queues."})),statsWindow:n.Optional(n.Enum(jT,{description:"Lookback over messaging spans used to list the queues and compute their rates. Defaults to `1h`."}))}),response:n.Array(xF)}),Kse=f({description:"Retrieves one message queue or topic by name, messaging system and environment, with its rates. Searches the last hour first, then the last 24 hours.",operationId:"getQueue",tags:["queues"],method:"GET",url:`${jse}/by-name`,query:n.Object({name:p({allowEmpty:!1,description:"Queue name (`messaging.destination.name`)."}),messagingSystem:p({allowEmpty:!1,description:"Messaging system (`messaging.system`), for example `kafka` or `aws_sqs`."}),env:p({allowEmpty:!1,description:"Environment the queue was observed in."}),clusterId:qse}),response:xF});var zse=P("queues").pipe(U("List and inspect message queues inferred from messaging spans"),_e([fr("list",Hse,!1),fr("get",Kse,!0)]));var qT=`/${"v1"}/adaptive-notification-rules`,HT=n.Pick(Ad,["id","name","owner","isActive","shouldCreateInvestigation","tags","monitorIds","sloIds","fallbackTarget"],{$id:"AdaptiveRule",description:"Adaptive notification rule that reacts to selected monitors and SLOs. When one of them fires, Tsuga pages the owners of the failing service it identifies from the sampled traces, and pages the fallback target when no owner can be resolved. See [Rules](/documentation/alert/notifications/rules)."}),Yse={name:"Checkout latency",owner:"team-123-abc",isActive:!0,shouldCreateInvestigation:!0,tags:[{key:"channel",value:"alerts"}],monitorIds:["monitor-123-abc"],sloIds:["slo-456-def"],fallbackTarget:{id:"789-abc-def",rateLimit:{maxMessages:10,minutes:5},config:{type:"email",addresses:["oncall@example.com"],renotifyConfig:{mode:"each",renotificationStates:["alert"],renotifyIntervalMinutes:30}}}},$Be={id:"123-456-abc",...Yse};Object.assign(HT,{examples:[$Be]});var Vse=f({description:"Lists adaptive notification rules: when a selected monitor or SLO fires, they page the owners of the failing service found in sampled traces, or a fallback target. Standard notification rules have their own endpoint.",operationId:"listAdaptiveNotificationRules",tags:["adaptive-notification-rules"],url:qT,method:"GET",paginated:!0,query:n.Object(qe),response:n.Array(HT)}),Wse=f({description:"Retrieves one adaptive notification rule by ID.",operationId:"getAdaptiveNotificationRule",tags:["adaptive-notification-rules"],url:`${qT}/:id`,method:"GET",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the adaptive notification rule to retrieve. Use the `id` returned by adaptive notification rule list or create responses."})}),response:HT}),OF=n.Pick(cR,["name","owner","tags","isActive","shouldCreateInvestigation","monitorIds","sloIds","fallbackTarget"],{description:"Adaptive notification rule create or update request. Provide the monitors or SLOs the rule reacts to, the owner, the active state, and the fallback target."}),GBe=Yse;Object.assign(OF,{examples:[GBe]});var Qse=f({description:"Creates an adaptive notification rule that pages the owners of the failing service when a selected monitor or SLO fires. Only trace monitors, metric monitors over OTel span metrics, and SLOs over traces or OTel span metrics are eligible.",operationId:"createAdaptiveNotificationRule",tags:["adaptive-notification-rules"],url:qT,method:"POST",body:OF,response:HT}),Zse=f({description:"Updates an existing adaptive notification rule by ID. Required fields and the fallback target are overwritten; omitted optional fields, including `monitorIds` and `sloIds`, keep their existing values. Send an empty array to clear a list.",operationId:"updateAdaptiveNotificationRule",tags:["adaptive-notification-rules"],url:`${qT}/:id`,method:"PUT",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the adaptive notification rule to update. Use the `id` returned by adaptive notification rule list, get, or create responses."})}),body:OF,response:HT}),Xse=f({description:"Deletes an adaptive notification rule by ID. Its monitors and SLOs keep evaluating, but this rule no longer pages anyone.",operationId:"deleteAdaptiveNotificationRule",tags:["adaptive-notification-rules"],url:`${qT}/:id`,method:"DELETE",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the adaptive notification rule to delete. Use the `id` returned by adaptive notification rule list, get, create, or update responses."})}),response:B});var Jse=Ue({commandName:"adaptive-notification-rules",description:"Manage adaptive notification rules",endpoints:{list:Vse,get:Wse,create:Qse,update:Zse,delete:Xse}});var BBe={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"]}},[Lgr,lR,KT]=jBe(BBe),Mgr=Object.fromEntries(lR.map(e=>[e,e]));function jBe(e){let t=[],r=[],o=[],i=Object.keys(e);for(let s of i){t.push(s);let a=e[s];for(let u in a){r.push(u);let l=a[u];Array.isArray(l)&&o.push(...l)}}return[AF(t),AF(r),AF(o)]}function AF(e){if(e.length===0)throw new Error("Array must have at least one element.");return e}var CF=n.Enum(["HTTP","HTTPS","TCP","UDP","GENEVE","TLS","TLS_QUIC","TCP_UDP","TCP_QUIC","QUIC"]),qBe=n.Object({versioningStatus:n.Optional(n.Enum(["Enabled","Disabled","Suspended","Not configured"]))}),HBe=n.Object({domainName:n.Optional(n.String()),origins:n.Optional(n.Array(n.String()))}),KBe=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())}),zBe=n.Object({version:n.Optional(n.String()),virtualNetworkId:n.Optional(n.String()),subnets:n.Optional(n.Array(n.String()))}),YBe=n.Object({artifactRegistryFormat:n.Optional(n.Enum(["FORMAT_UNSPECIFIED","DOCKER","MAVEN","NPM","APT","YUM","PYTHON","KFP","GO","GENERIC","RUBY"])),uri:n.Optional(n.String()),tagMutability:n.Optional(n.Enum(["MUTABLE","IMMUTABLE"])),scanOnPush:n.Optional(n.Boolean()),encryptionType:n.Optional(n.String())}),VBe=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()))}),WBe=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(w()),protectionEnabled:n.Optional(n.Boolean()),protectionExpiresAt:n.Optional(w())}),QBe=n.Object({isEncrypted:n.Optional(n.Boolean()),ownerId:n.Optional(n.String()),state:n.Optional(n.Enum(["creating","available","deleting","deleted","error","updating"]))}),ZBe=n.Object({type:n.Optional(n.String()),osType:n.Optional(n.String()),subnetIds:n.Optional(n.Array(n.String())),nbContainers:n.Optional(n.Number())}),XBe=n.Object({digest:n.String(),imageTags:n.Array(n.String()),imageSizeBytes:n.Optional(n.Number()),imagePushedAt:n.Optional(w()),mediaType:n.Optional(n.String()),repositoryName:n.String(),repositoryId:n.Optional(n.String()),scanStatus:n.Optional(n.String())}),JBe=n.Object({url:n.Optional(n.String()),maxMessageSizeBytes:n.Optional(n.Number()),messageRetentionHours:n.Optional(n.Number())}),eje=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())}),tje=n.Object({kind:n.Optional(n.String())}),rje=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())}),nje=n.Object({id:n.Optional(n.String()),ipCidrBlocks:n.Array(n.String())}),oje=n.Object({protocol:n.Optional(CF),port:n.Optional(n.Number()),instanceProtocol:n.Optional(CF),instancePort:n.Optional(n.Number())}),ije=n.Object({protocol:n.Optional(n.String()),ports:n.Optional(n.Array(n.String())),portRange:n.Optional(n.String()),allPorts:n.Optional(n.Boolean())}),sje=n.Object({name:n.String(),ip:n.Optional(n.String()),type:n.Enum(["public","private"])}),aje=n.Object({type:n.String(),name:n.String()}),cje=n.Object({frontendIp:n.Optional(sje),backendIpPools:n.Array(aje)}),uje=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())}),pje=n.Object({protocol:n.Optional(CF),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(uje)),targetCount:n.Optional(n.Number()),healthyTargetCount:n.Optional(n.Number()),loadBalancerArns:n.Optional(n.Array(n.String()))}),lje=n.Object({first:n.Optional(n.String()),last:n.Optional(n.String()),scope:n.Optional(n.Number())}),dje=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(),lje]))),target:n.Optional(n.String()),weight:n.Optional(n.Number()),priority:n.Optional(n.Number()),status:n.Optional(n.String())}),mje=n.Object({instanceId:n.Optional(n.String()),state:n.Optional(n.String()),reasonCode:n.Optional(n.String()),description:n.Optional(n.String())}),fje=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(oje),n.Array(ije)])),targets:n.Optional(n.Union([n.Array(n.String()),n.Array(mje),n.Array(dje)])),azureLoadBalancingRules:n.Optional(n.Array(cje))}),gje=n.Object({domainName:n.Optional(n.String()),expiresAt:n.Optional(w()),inUseBy:n.Optional(n.Array(n.String())),renewalEligibility:n.Optional(n.String()),revokedAt:n.Optional(w()),status:n.Optional(n.String()),type:n.Optional(n.String())}),hje=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"]))}),yje=n.Object({osType:n.Optional(n.Enum(["Windows","Linux"]))}),Eje=n.Object({state:n.Optional(n.String()),volumeType:n.Optional(n.String())}),Tje=n.Intersect([n.Object({isEncrypted:n.Optional(n.Boolean()),sizeGib:n.Optional(n.Number())}),n.Union([hje,Eje,yje])]),Sje=n.Object({instanceCount:n.Optional(n.Number()),hostnames:n.Optional(n.Array(n.String())),runtime:n.Optional(n.String())}),dR=n.Union([n.Object({category:n.Literal("application"),resourceType:n.Literal("webService"),attributes:n.Optional(Sje)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("bucket"),attributes:n.Optional(qBe)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("messagingService"),attributes:n.Optional(JBe)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("fileSystem"),attributes:n.Optional(QBe)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("contentDeliveryNetwork"),attributes:n.Optional(HBe)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("database"),attributes:n.Optional(KBe)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("storageAccount"),attributes:n.Optional(tje)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("volume"),attributes:n.Optional(Tje)}),n.Object({category:n.Literal("compute"),resourceType:n.Literal("virtualMachine"),attributes:n.Optional(rje)}),n.Object({category:n.Literal("compute"),resourceType:n.Literal("serverless"),attributes:n.Optional(eje)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("kubernetesCluster"),attributes:n.Optional(zBe)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerRepository"),attributes:n.Optional(YBe)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerCluster"),attributes:n.Optional(VBe)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerServiceTask"),attributes:n.Optional(WBe)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerService"),attributes:n.Optional(ZBe)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerImage"),attributes:n.Optional(XBe)}),n.Object({category:n.Literal("network"),resourceType:n.Literal("virtualNetwork"),attributes:n.Optional(nje)}),n.Object({category:n.Literal("network"),resourceType:n.Literal("loadBalancer"),attributes:fje}),n.Object({category:n.Literal("network"),resourceType:n.Literal("targetGroup"),attributes:n.Optional(pje)}),n.Object({category:n.Literal("network"),resourceType:n.Literal("certificate"),attributes:n.Optional(gje)})],{description:"Normalized public inventory category, resource type, and category-specific attributes. Attribute shape depends on the category and resourceType combination."});var Cd="/v0/inventory",eae=["scan_in_progress","success","failure","partial"],PF=n.Object({id:n.String({description:"Identifier of the inventory resource. Generated by Tsuga."}),cloudPlatform:n.Enum(Ju,{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(w({description:"Timestamp when the resource was created in the cloud, when known."})),resourceUpdatedAt:n.Optional(w({description:"Timestamp when the resource was last updated in the cloud, when known."})),resourceLastSeenAt:w({description:"Timestamp when Tsuga last observed this resource during an inventory scan."}),tags:vt,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"},tae=n.Object({cloudPlatforms:he(n.Enum(Ju),{description:"Restrict results to resources discovered on any of these cloud platforms",maxItems:Ju.length}),cloudAccounts:he(p({allowEmpty:!1}),{description:"Restrict results to resources in any of these cloud accounts",maxItems:500}),cloudRegions:he(p({allowEmpty:!1}),{description:"Restrict results to resources in any of these cloud regions",maxItems:500}),nativeResourceTypes:he(n.Enum(KT),{description:"Restrict results to resources of any of these cloud-native resource types",maxItems:KT.length}),resourceTypes:he(n.Enum(lR),{description:"Restrict results to resources of any of these normalized resource types",maxItems:lR.length}),tags:he(rn.items,{description:"Restrict results to resources that have at least one of the listed key/value tags",maxItems:50}),isIacManaged:n.Boolean({description:"Restrict results by infrastructure-as-code coverage. When true, only resources covered by the configured IaC identifiers are returned; when false, only uncovered resources are returned."}),searchQuery:n.Object({value:p({allowEmpty:!1,description:"Case-insensitive substring matched against resource ID, display name, fully-qualified resource ID, cloud account, region, and resource type. Use the `tags` filter to narrow by tag. Wildcard characters are treated literally."}),exclude:n.Optional(n.Boolean({description:"If true, exclude resources matching this value instead of including them"}))},{description:"Search query filter for resources."})},{description:"Optional filters applied to narrow the returned resources"}),UF=n.Partial(n.Object({...fe,filters:n.Partial(tae,{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."})})),Kgr=f({tags:["inventory"],method:"POST",url:`${Cd}/resources/query`,paginated:!0,body:UF,response:n.Array(n.Intersect([PF,dR]))}),_je=["resourceType","cloudAccount","isIacManaged"],zgr=f({tags:["inventory"],method:"POST",url:`${Cd}/resources/counts`,body:n.Object({filters:n.Optional(n.Partial(tae)),groupBy:n.Enum(_je,{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."})}))}),Ygr=f({tags:["inventory"],method:"GET",url:`${Cd}/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:Vr})}),Vgr=D("type",[n.Object({type:n.Literal("aws",{description:"Discriminator identifying AWS connection settings."}),accountId:n.String({description:"AWS account ID that Tsuga scans."}),externalId:n.String({description:"External ID Tsuga passes when assuming the cross-account IAM role."}),roleArn:n.String({description:"ARN of the IAM role Tsuga assumes to read inventory in the account."})}),n.Object({type:n.Literal("gcp",{description:"Discriminator identifying GCP connection settings."}),projectId:n.String({description:"GCP project ID that Tsuga scans."}),serviceAccountId:n.String({description:"Service account Tsuga impersonates to read inventory."}),workloadIdentityProvider:n.String({description:"Workload identity provider resource name used for federated authentication."})}),n.Object({type:n.Literal("azure",{description:"Discriminator identifying Azure connection settings."}),clientId:n.String({description:"Client ID of the Azure application Tsuga authenticates as."}),subscriptionId:n.String({description:"Azure subscription ID that Tsuga scans."}),tenantId:n.String({description:"Azure tenant ID that owns the subscription."})})]),Ije="^[0-9]{12}$",bje="^arn:aws[a-z-]*:iam::[0-9]{12}:role/.+$",xje="^[a-z][a-z0-9-]{4,28}[a-z0-9]$",Oje="^[^@\\s]+@[^@\\s]+\\.iam\\.gserviceaccount\\.com$",Aje="^//iam\\.googleapis\\.com/projects/[0-9]+/locations/global/workloadIdentityPools/[^/]+/providers/[^/]+$",RF="^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$",Cje=n.Object({type:n.Literal("aws",{description:"Discriminator identifying AWS connection settings."}),accountId:n.String({pattern:Ije,description:"AWS account ID that Tsuga scans.",errorMessage:{pattern:"Must be a 12-digit AWS account ID."}}),externalId:p({allowEmpty:!1,description:"External ID Tsuga passes when assuming the cross-account IAM role."}),roleArn:n.String({pattern:bje,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"}),Rje=n.Object({type:n.Literal("gcp",{description:"Discriminator identifying GCP connection settings."}),projectId:n.String({pattern:xje,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:Oje,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:Aje,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"}),Pje=n.Object({type:n.Literal("azure",{description:"Discriminator identifying Azure connection settings."}),clientId:n.String({pattern:RF,minLength:1,description:"Client ID of the Azure application Tsuga authenticates as (GUID).",errorMessage:{pattern:"Must be a GUID."}}),subscriptionId:n.String({pattern:RF,minLength:1,description:"Azure subscription ID that Tsuga scans (GUID).",errorMessage:{pattern:"Must be a GUID."}}),tenantId:n.String({pattern:RF,minLength:1,description:"Azure tenant ID that owns the subscription (GUID).",errorMessage:{pattern:"Must be a GUID."}})},{$id:"AzureConnectionSettings"}),rae=D("type",[Cje,Rje,Pje],{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`."}),Sg=n.Object({id:n.String({description:"Identifier of the cloud account. Generated by Tsuga."}),cloudType:n.Enum(Ju,{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:w({description:"Timestamp when the account was registered in Tsuga."}),lastScanStartedAt:n.Optional(w({description:"Timestamp when the most recent inventory scan started."})),lastScanFinishedAt:n.Optional(w({description:"Timestamp when the most recent inventory scan finished."})),lastScanStatus:n.Optional(n.Enum(eae,{description:"Status of the most recent inventory scan."}))}),wF=n.Object({cloudType:n.Enum(Ju,{description:"Cloud provider of the account."}),cloudAccountId:p({allowEmpty:!1,description:"Cloud-native account identifier: an AWS account ID, GCP project ID, or Azure subscription ID."}),accountFriendlyName:n.Optional(p({description:"Human-readable name for the account shown in Tsuga."})),organizationId:n.Optional(p({description:"Cloud organization identifier, when known."})),connectionSettings:rae,lastScanStatus:n.Optional(n.Enum(eae,{description:"Status of the most recent inventory scan."}))}),Rd=`${Cd}/cloud-accounts`,Wgr=f({tags:["inventory"],url:Rd,method:"GET",response:n.Array(Sg)}),Qgr=f({tags:["inventory"],url:`${Rd}/:id`,method:"GET",params:n.Object({id:p()}),response:Sg}),Zgr=f({tags:["inventory"],url:Rd,method:"POST",body:wF,response:Sg}),vF=n.Object({accountFriendlyName:p({description:"Human-readable name for the account shown in Tsuga."})}),Xgr=f({tags:["inventory"],url:`${Rd}/:id`,method:"PUT",params:n.Object({id:p()}),body:vF,response:Sg}),Jgr=f({tags:["inventory"],url:`${Rd}/:id`,method:"DELETE",params:n.Object({id:p()}),response:B}),ehr=f({tags:["inventory"],url:`${Cd}/trigger-scan`,method:"POST",body:n.Object({}),response:n.Object({success:n.Literal(!0)})}),thr=f({tags:["inventory"],url:`${Rd}/azure/onboarding`,method:"POST",body:n.Object({tenantId:p()}),response:n.Object({subjectId:n.String(),audience:n.String()})}),rhr=f({tags:["inventory"],method:"POST",url:`${Rd}/validate/:type`,params:n.Object({type:p()}),body:n.Object({data:rae,id:n.Optional(p())}),response:n.Object({areAccountSettingsValid:n.Boolean(),message:n.Optional(n.String())})}),nae=`${Cd}/settings`,nhr=f({tags:["inventory"],url:nae,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())}))}))})}),Uje=50,ohr=f({tags:["inventory"],url:nae,method:"POST",body:n.Object({infrastructureIdentifiers:n.Array(n.Object({name:p({allowEmpty:!1}),value:n.Optional(p({allowEmpty:!1}))}),{maxItems:Uje})}),response:n.Object({})}),ihr=f({tags:["inventory"],url:`${Cd}/iac-tags-proposal`,method:"GET",response:n.Array(n.Object({name:n.String(),value:n.Optional(n.String())}))});var oae=`/${"v1"}/inventory`,wje=n.Omit(PF,["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)."}),iae=n.Intersect([wje,dR],{$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)."}),vje={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(iae,{examples:[vje]});var sae=n.Object({...UF.properties,...qe},{description:"Inventory resource query request. Use filters, sorting, limit, and offset to page through discovered resources."}),Nje={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(sae,{examples:[Nje]});var aae=f({description:"Lists or searches cloud resources (AWS, GCP or Azure, for example EC2 instances or S3 buckets) found by inventory scans of connected cloud accounts, by platform, account, region, resource type, tag or infrastructure-as-code coverage.",operationId:"queryInventoryResources",tags:["inventory"],url:`${oae}/resources/query`,method:"POST",paginated:!0,body:sae,response:n.Array(iae)}),zT=`${oae}/cloud-accounts`,YT=n.Pick(Sg,["id","cloudType","cloudAccountId","accountFriendlyName"],{$id:"CloudAccount"}),kje={id:"123-456-abc",cloudType:"aws",cloudAccountId:"123456789012",accountFriendlyName:"Production AWS"};Object.assign(YT,{examples:[kje]});var cae=n.Pick(wF,["cloudType","cloudAccountId","accountFriendlyName","connectionSettings"]),Lje={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(cae,{examples:[Lje]});var uae=n.Pick(vF,["accountFriendlyName"]),Mje={accountFriendlyName:"Production AWS"};Object.assign(uae,{examples:[Mje]});var fhr=f({description:"Lists the cloud accounts connected to Tsuga (AWS accounts, GCP projects, Azure subscriptions), with provider and display name.",operationId:"listCloudAccounts",tags:["inventory"],url:zT,method:"GET",response:n.Array(YT)}),ghr=f({description:"Retrieves one cloud account by ID.",operationId:"getCloudAccount",tags:["inventory"],url:`${zT}/:id`,method:"GET",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the cloud account to retrieve. Use the `id` returned by the cloud account list or create operations."})}),response:YT}),hhr=f({description:"Registers a cloud account for inventory scanning. Connection settings are stored as provided and are not validated at creation time; scan failures surface through `lastScanStatus`.",operationId:"createCloudAccount",tags:["inventory"],url:zT,method:"POST",body:cae,response:YT}),yhr=f({description:"Updates the friendly name of a cloud account by ID.",operationId:"updateCloudAccount",tags:["inventory"],url:`${zT}/:id`,method:"PUT",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the cloud account to update. Use the `id` returned by the cloud account list or create operations."})}),body:uae,response:YT}),Ehr=f({description:"Deletes a cloud account by ID. Future inventory scans stop for the account, and the trust relationship on the cloud side can be safely removed afterward.",operationId:"deleteCloudAccount",tags:["inventory"],url:`${zT}/:id`,method:"DELETE",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the cloud account to delete. Use the `id` returned by the cloud account list or create operations."})}),response:B});var pae=Ue({commandName:"cloud-resources",description:"List cloud resources discovered by inventory scans",endpoints:{list:aae},enableListBody:!0});var VT=`/${"v1"}/custom-roles`,WT=n.Pick(Ed,["id","name","description","teamScope","assets","telemetry","telemetryQuery"],{$id:"CustomRole",description:"Global role defined by the organization. It sets which teams its holders reach, which telemetry signals they can query, and which resource types they can read or write. See [Custom global roles](/documentation/account-and-settings/roles-and-permissions#custom-global-roles)."}),Dje={id:"123-456-abc",name:"Platform on-call",description:"Edits monitors and dashboards of the platform teams.",teamScope:{type:"specific",teamIds:["team-123-abc"]},assets:{dashboard:"write",monitor:"write",team:"read"},telemetry:["log","metric","trace"],telemetryQuery:[{key:"context.env",values:["production"]}]};Object.assign(WT,{examples:[Dje]});var NF=n.Pick(WC,["name","description","teamScope","assets","telemetry","telemetryQuery"],{description:"Custom role create or update request. Provide the role name, optional description, team scope, resource type grants, readable telemetry signals, and optional telemetry restriction."}),Fje={name:"Platform on-call",description:"Edits monitors and dashboards of the platform teams.",teamScope:{type:"specific",teamIds:["team-123-abc"]},assets:{dashboard:"write",monitor:"write",team:"read"},telemetry:["log","metric","trace"],telemetryQuery:[{key:"context.env",values:["production"]}]};Object.assign(NF,{examples:[Fje]});var lae=f({description:"Lists every custom global role (RBAC permissions, access control) of the organization, ordered by name, with what each role grants.",operationId:"listCustomRoles",tags:["custom-roles"],url:VT,method:"GET",response:n.Array(WT)}),dae=f({description:"Retrieves one custom global role by ID.",operationId:"getCustomRole",tags:["custom-roles"],url:`${VT}/:id`,method:"GET",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the custom role to retrieve. Use the `id` returned by custom role list, create, or update responses."})}),response:WT}),mae=f({description:"Creates a custom global role. The name must be unique across the organization. Grants on resource types a custom role cannot configure are dropped. Requires write access on custom roles, which only an operation key scoped to all teams can hold. Only a Global admin can first grant it to a key; a key holding it and write access on operation API keys can then pass it on to the keys it creates or updates.",operationId:"createCustomRole",tags:["custom-roles"],url:VT,method:"POST",body:NF,response:WT}),fae=f({description:"Replaces the name, team scope, resource type grants, and telemetry signals of a custom global role by ID. The new grants apply to every user holding the role. Requires write access on custom roles, which only an operation key scoped to all teams can hold.",operationId:"updateCustomRole",tags:["custom-roles"],url:`${VT}/:id`,method:"PUT",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the custom role to update. Use the `id` returned by custom role list, get, or create responses."})}),body:NF,response:WT}),gae=f({description:"Deletes a custom global role by ID. Fails while a user still holds the role; change their global role first. Pending invitations that carry the role are deleted with it. Requires write access on custom roles, which only an operation key scoped to all teams can hold.",operationId:"deleteCustomRole",tags:["custom-roles"],url:`${VT}/:id`,method:"DELETE",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the custom role to delete. Use the `id` returned by custom role list, get, create, or update responses."})}),response:B});var hae=Ue({commandName:"custom-roles",description:"Manage custom global roles",endpoints:{list:lae,get:dae,create:mae,update:fae,delete:gae}});var Ig="/v0/dashboard-folders",bg=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:vt,creator:n.Optional(Se),updater:n.Optional(Se),createdAt:w(),updatedAt:w()},{title:"DashboardFolder"}),kF=n.Object({...bg.properties,dashboardCount:n.Number({description:"Number of dashboards in this folder and its readable subfolders that the caller can read. Returned only by folder list responses; callers without dashboard read access see 0."}),folderCount:n.Number({description:"Number of folders nested directly under this folder that the caller can read."})}),mR=n.Object({name:p({allowEmpty:!1,description:"Display name of the dashboard folder. Required and non-empty."}),owner:p({allowEmpty:!1,description:"ID of the team that owns the dashboard folder. Required and used for folder access control."}),parentFolderId:n.Optional(n.Union([n.Null(),p({allowEmpty:!1})],{description:"ID of the top-level folder to nest this folder under. Omit on create or pass null to create a top-level folder; omit on update to keep the current parent; pass null on update to move the folder to top level. Non-null values must name a readable top-level folder. Folders can be nested at most two levels deep."})),tags:$t}),fR=n.Partial(n.Object({owners:he(p({allowEmpty:!1}),{description:"Restrict results to dashboard folders owned by any of these team IDs",maxItems:50}),searchQuery:n.Object({value:p({allowEmpty:!1,description:"Substring matched case-insensitively against dashboard folder names or folder IDs. Omit the whole `searchQuery` filter to skip text filtering."}),exclude:n.Optional(n.Boolean({description:"If true, exclude dashboard folders matching this value instead of including them"}))},{description:"Text filter for dashboard folder names or IDs. Optional; `exclude: true` returns folders whose name and ID do not match the substring."}),tags:he(rn.items,{description:"Restrict results to dashboard folders that have at least one of the listed key/value tags",maxItems:50}),parentFolderId:n.Union([n.Null(),p({allowEmpty:!1})],{description:"Parent folder filter for dashboard folder query results. Optional; pass a folder ID to return the child folders nested directly under it, or null to return only top-level folders. Omit to return all folders."})},{description:"Optional filters applied to narrow the returned dashboard folders"})),_g={IS_FAVORITE:"isFavorite",OWNER:"owner",TAGS:"tags",DASHBOARD_COUNT:"dashboardCount",UPDATED_AT:"updatedAt",NAME:"name"},LF=[_g.OWNER,_g.TAGS,_g.DASHBOARD_COUNT,_g.UPDATED_AT,_g.NAME],$je=n.Partial(n.Object({...fe,filters:fR,sort:n.Object({by:n.Enum([...LF,_g.IS_FAVORITE],{description:"Field to sort the returned dashboard folders by"}),direction:le},{description:"Optional sorting applied to the returned dashboard folders"})})),$hr=f({tags:["dashboard-folders"],url:`${Ig}/query`,method:"POST",paginated:!0,body:$je,response:n.Array(kF)}),Ghr=f({tags:["dashboard-folders"],url:`${Ig}/:id`,method:"GET",params:n.Object({id:p()}),response:bg}),Bhr=f({tags:["dashboard-folders"],url:Ig,method:"POST",body:mR,response:bg}),jhr=f({tags:["dashboard-folders"],url:`${Ig}/:id`,method:"PUT",params:n.Object({id:p()}),body:mR,response:bg}),qhr=f({tags:["dashboard-folders"],url:`${Ig}/:id`,method:"DELETE",params:n.Object({id:p()}),response:B}),Hhr=f({tags:["dashboard-folders"],url:`${Ig}/tags/query`,method:"POST",body:n.Object({filters:n.Optional(n.Omit(fR,["tags"]))}),response:Vr});var QT=`/${"v1"}/dashboard-folders`,gR=n.Pick(bg,["id","name","owner","parentFolderId","tags"],{$id:"DashboardFolder",description:"Folder used to organize dashboards into a two-level hierarchy"}),yae={id:"123-456-abc",name:"Platform",owner:"team-123-abc",tags:[{key:"team",value:"platform"}]};Object.assign(gR,{examples:[yae]});var Eae=n.Pick(kF,["id","name","owner","parentFolderId","tags","dashboardCount"],{$id:"DashboardFolderWithDashboardCount",description:"Folder used to organize dashboards into a two-level hierarchy, including the number of readable dashboards in it and its readable subfolders."}),Gje={...yae,dashboardCount:10};Object.assign(Eae,{examples:[Gje]});var MF=n.Pick(mR,["name","owner","parentFolderId","tags"],{description:"Dashboard folder create or update request. Provide a name, owner team, optional parent folder, and optional tags."}),Bje={name:"Platform",owner:"team-123-abc",parentFolderId:null,tags:[{key:"team",value:"platform"}]};Object.assign(MF,{examples:[Bje]});var jje=n.Object({by:n.Enum(LF,{description:"Field to sort the returned dashboard folders by: `owner` sorts by owning team name, `tags` sorts by tag key/value pairs, `dashboardCount` sorts by the number of readable dashboards in the folder and its readable subfolders, `updatedAt` sorts by last-updated timestamp, and `name` sorts alphabetically by folder name."}),direction:le},{description:"Optional sorting applied to the returned dashboard folders"}),Tae=n.Object({...qe,filters:n.Optional(n.Pick(fR,["owners","searchQuery","tags","parentFolderId"])),sort:n.Optional(jje)},{description:"Dashboard folder query request. Use filters, sorting, limit, and offset to page through visible dashboard folders."}),qje={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(Tae,{examples:[qje]});var Sae=f({description:"Lists or searches dashboard folders by owning team, name or ID substring, tags or parent folder, with the number of readable dashboards in each folder and its readable subfolders. Returns every folder unless `parentFolderId` is set: a folder ID selects its children, null only top-level folders. Most recently updated first unless `sort` is set.",operationId:"queryDashboardFolders",tags:["dashboard-folders"],url:`${QT}/query`,method:"POST",paginated:!0,body:Tae,response:n.Array(Eae)}),_ae=f({description:"Retrieves one dashboard folder by ID.",operationId:"getDashboardFolder",tags:["dashboard-folders"],url:`${QT}/:id`,method:"GET",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the dashboard folder to retrieve. Use the `id` returned by folder list, get, create, or update responses."})}),response:gR}),Iae=f({description:"Creates a dashboard folder owned by the specified team. To create a child folder, set `parentFolderId` to a readable top-level folder.",operationId:"createDashboardFolder",tags:["dashboard-folders"],url:QT,method:"POST",body:MF,response:gR}),bae=f({description:"Updates an existing dashboard folder by ID. Send the folder name, owner, tags, and parent relationship; omit `parentFolderId` to keep the current parent or send null to move the folder to top level.",operationId:"updateDashboardFolder",tags:["dashboard-folders"],url:`${QT}/:id`,method:"PUT",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the dashboard folder to update. Use the `id` returned by folder list, get, create, or update responses."})}),body:MF,response:gR}),xae=f({description:"Deletes an empty dashboard folder by ID. The request fails if the folder still contains dashboards or child folders; dashboards and child folders are not moved or deleted automatically.",operationId:"deleteDashboardFolder",tags:["dashboard-folders"],url:`${QT}/:id`,method:"DELETE",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the dashboard folder to delete. Use the `id` returned by folder list, get, create, or update responses."})}),response:B});var Oae=Ue({commandName:"dashboard-folders",description:"Manage dashboard folders",endpoints:{list:Sae,get:_ae,create:Iae,update:bae,delete:xae},enableListBody:!0});var _a="/v0/dashboards",Aae=["white","gray.100","amber.200","lime.200","emerald.200","cyan.200","blue.200","violet.200","fuchsia.200","pink.200","red.200"],Hje=["bar","distribution","gauge","heatmap","list","pie","query-value","slo","table","timeseries","top-list"],hyr=[...Hje,"note","group"];var Kje=["ns","us","ms","s","m","h","days"];var zje=["B","KB","MB","GB","TB","PB"],Yje=["bit","Kibit","Mibit","Gibit","Tibit","Pibit"],Vje=[...zje,...Yje];var Wje=20;var Cae=n.Object({type:n.Literal("cpu",{description:"Normalizes values as CPU usage"})},{$id:"DataNormalizerCpu",title:"CPU"}),Rae=n.Object({type:n.Literal("duration",{description:"Normalizes values as durations using standard time units"}),unit:n.Enum(Kje,{description:"Time unit used to present the normalized values"})},{$id:"DataNormalizerDuration",title:"Duration"}),Pae=n.Object({type:n.Literal("data",{description:"Normalizes values as data sizes using byte or bit units"}),unit:n.Enum(Vje,{description:"Data size unit of the raw values. Byte units (B, KB, MB, ...) scale in steps of 1000. Bit units (bit, Kibit, Mibit, ...) are binary: values are converted to bytes and scale in steps of 1024 (KiB, MiB, GiB, ...)."})},{$id:"DataNormalizerData",title:"Data"}),Uae=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"}),wae=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"}),vae=n.Object({type:n.Literal("date",{description:"Formats values as calendar dates"})},{$id:"DataNormalizerDate",title:"Date"}),Nae=n.Object({type:n.Literal("level",{description:"Displays values using their log level name"})},{$id:"DataNormalizerLevel",title:"Level"}),kae=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"}),Qje=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"}),Zje=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:Wje})},{$id:"InputDataNormalizerCustom",title:"Custom"}),gr=D("type",[Rae,Pae,Uae,wae,vae,Nae,Cae,kae,Qje],{title:"Normalizer",description:"Display-value formatter for widget values or list/table columns."}),hr=D("type",[Rae,Pae,Uae,wae,vae,Nae,Cae,kae,Zje],{title:"Normalizer",description:"Display-value formatter for widget values or list/table columns."}),yR=n.Object({attribute:n.String({description:"Attribute (log field or database row column) displayed as a column in the list"}),normalizer:n.Optional(gr)},{title:"WidgetListColumn",description:"List column pairing a displayed attribute with the formatting applied to its values."}),ER=n.Object({attribute:n.String({description:"Attribute (log field or database row column) displayed as a column in the list"}),normalizer:n.Optional(hr)},{title:"WidgetListColumn",description:"List column pairing a displayed attribute with the formatting applied to its values."}),xg=["background","no-background"],Xje=["table","legend-only","no-legend"];var Jje=["greater_than","less_than","equal","not_equal","greater_than_or_equal","less_than_or_equal"],Lae=["alert","warning","success"],Ia=n.Object({operator:n.Enum(Jje,{description:"Comparator used to evaluate the metric value"}),value:n.Number({description:"Threshold value used when evaluating the operator"}),color:n.Enum(Lae,{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."}),eqe=n.Object({value:n.Number({description:"Y-axis value where the threshold marker is placed"}),level:n.Enum(Lae,{description:"Level applied to the threshold marker"})},{title:"ThresholdMarker",description:"Marker line drawn across the chart at a fixed value, colored by its level."}),tqe=["sec","min","hour","day"],gp=n.Object({time:n.Number({description:"Numeric count of `metric` units in each bucket. Required when `timeBucket` is present."}),metric:n.Enum(tqe,{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 Sa=n.Enum(["flex-start","center","flex-end"],{description:"Flex alignment keyword used for widget layout"}),Pd=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."}),Ud=n.Object({formula:n.Optional(p({type:"short",description:"Optional alias for formula (only used for display in the UI)"})),queries:n.Optional(n.Record(n.String(),p({type:"short",description:'Display name for this query series in the legend, keyed by the zero-based query index as a string ("0" = first query, "1" = second, and so on). This differs from `formula`, which references queries as "q1", "q2". Omit to fall back to an auto-generated label like "Count on <filter>".'}),{description:"Display names for individual query series, keyed by the zero-based query index as a string."}))},{description:"Display names used for the formula series and the individual query series instead of auto-generated labels."}),TR={source:pi,queries:CZ,formula:n.Optional(OA),aliases:n.Optional(Pd),visibleSeries:n.Optional(n.Array(n.Boolean(),{description:"Flags indicating whether each query or formula series is visible"}))},SR={source:pi,queries:XE,formula:n.Optional(Xl),aliases:n.Optional(Ud),visibleSeries:n.Optional(n.Array(n.Boolean(),{description:"Flags indicating whether each query or formula series is visible"}))},ba=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)"})),Og={...TR,groupBy:n.Optional(Mf)},Ag={...SR,groupBy:n.Optional(Cc)},pr=n.Enum(Xje,{description:"Controls whether and how the widget displays legend or series details (e.g. table, legend-only, or no legend)"}),ct=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."})),ji=n.Optional(n.Array(eqe,{description:"Threshold markers displayed on the chart"})),rqe="^https?:\\/\\/(?:[^\\s{}]|\\{\\{group\\.[^}\\s]+\\}\\})+$",Mae='Text of the entry added to the widget context menu. Defaults to "Open custom link" when omitted.',Dae="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.",ZT=n.Object({label:n.Optional(n.String({description:Mae})),url:n.String({description:Dae})},{$id:"WidgetCustomLink",title:"CustomLink"}),XT=n.Object({label:n.Optional(p({allowEmpty:!1,description:Mae})),url:n.String({pattern:rqe,maxLength:ci,description:Dae})},{$id:"InputWidgetCustomLink",title:"CustomLink"});var DF=["monitor","slo"],Fae="Events displayed on top of the chart, over its time axis, so they can be correlated with the plotted data. A widget carries at most one overlay, and each kind of overlay carries its own settings.",$ae=n.Literal("service-deployments",{description:"Draws the deployments contained in the time range over the chart"}),Gae="IDs of the teams whose services are drawn. The set is resolved when the widget renders, so a service joining one of these teams later is picked up automatically. Every service is drawn when omitted.",Bae="OpenTelemetry service names to draw, narrowing `teams` down to an explicit list. Every service matching `teams` is drawn when omitted.",jae="Environment whose deployments are drawn. Deployments from every environment are drawn when omitted.",nqe=n.Object({type:$ae,teams:n.Optional(n.Array(n.String(),{description:Gae})),services:n.Optional(n.Array(n.String(),{description:Bae})),env:n.Optional(n.String({description:jae}))},{$id:"WidgetServiceDeploymentsOverlay",title:"ServiceDeploymentsOverlay"}),oqe=n.Object({type:$ae,teams:n.Optional(n.Array(p({allowEmpty:!1}),{maxItems:50,description:Gae})),services:n.Optional(n.Array(p({allowEmpty:!1}),{maxItems:200,description:Bae})),env:n.Optional(p({allowEmpty:!1,description:jae}))},{$id:"InputWidgetServiceDeploymentsOverlay",title:"ServiceDeploymentsOverlay"}),qae="Tsuga query selecting the log events drawn over the chart. All log events in the time range are drawn when omitted.",iqe=n.Object({type:n.Literal("logs",{description:"Draws log events over the chart"}),query:n.Optional(n.String({description:qae}))},{$id:"WidgetLogsOverlay",title:"LogsOverlay"}),sqe=n.Object({type:n.Literal("logs",{description:"Draws log events over the chart"}),query:n.Optional(p({type:"tsuga-query",description:qae}))},{$id:"InputWidgetLogsOverlay",title:"LogsOverlay"}),Hae="Kinds of alert drawn over the chart. Both monitor and SLO alerts are drawn when omitted.",Kae="Case-insensitive substring matched against the alert, the same way the Ongoing alerts page matches its search box. Every alert is drawn when omitted.",zae="Narrows the drawn alerts. An alert must match every listed filter, and a filter matches when the alert has any of its values.",Yae="Names of the teams owning the monitor, or the SLO for an SLO alert. Names rather than IDs, matching how the Ongoing alerts page filters by owner.",Vae="Group-by dimensions that raised the alert, each formatted as `key:value`. An alert matches when any of its triggering dimensions is listed.",Wae="Priorities the alert was raised at. A monitor alert takes its priority from the monitor, an SLO alert from the SLO alert that fired.",Qae="IDs of the clusters the alert was raised on. Alerts raised on no cluster are always drawn.",aqe=n.Object({type:n.Literal("ongoing-alerts",{description:"Draws monitor and SLO alerts over the chart"}),alertTypes:n.Optional(n.Array(n.Enum(DF),{description:Hae})),query:n.Optional(n.String({description:Kae})),filters:n.Optional(n.Object({team:n.Optional(n.Array(n.String(),{description:Yae})),triggeredBy:n.Optional(n.Array(n.String(),{description:Vae})),priority:n.Optional(n.Array(n.Enum(yn),{description:Wae})),cluster:n.Optional(n.Array(n.String(),{description:Qae}))},{description:zae}))},{$id:"WidgetOngoingAlertsOverlay",title:"OngoingAlertsOverlay"}),cqe=n.Object({type:n.Literal("ongoing-alerts",{description:"Draws monitor and SLO alerts over the chart"}),alertTypes:n.Optional(n.Array(n.Enum(DF),{maxItems:DF.length,description:Hae})),query:n.Optional(p({description:Kae})),filters:n.Optional(n.Object({team:n.Optional(n.Array(p({allowEmpty:!1}),{maxItems:50,description:Yae})),triggeredBy:n.Optional(n.Array(p({allowEmpty:!1}),{maxItems:50,description:Vae})),priority:n.Optional(n.Array(n.Enum(yn),{maxItems:yn.length,description:Wae})),cluster:n.Optional(n.Array(p({allowEmpty:!1}),{maxItems:50,description:Qae}))},{description:zae}))},{$id:"InputWidgetOngoingAlertsOverlay",title:"OngoingAlertsOverlay"}),wd=D("type",[nqe,iqe,aqe],{title:"EventsOverlay",description:Fae}),vd=D("type",[oqe,sqe,cqe],{title:"EventsOverlay",description:Fae}),uqe=n.Object({name:n.String({description:"Display name of the table column"}),...TR,source:pi,normalizer:n.Optional(gr),precision:ct},{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`."}),pqe=n.Object({name:p({description:"Display name of the table column"}),...SR,source:pi,normalizer:n.Optional(hr),precision:ct},{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`."}),lqe=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."}),dqe=n.Array(n.Object({id:p({description:"ID of the column to sort by: `label` for the grouping column, or `col-<index>` with the zero-based position of the entry in `columns`."}),desc:n.Boolean({description:"Whether the sort is descending"})},{title:"TableDefaultSorting"}),{description:"Default sorting applied to a table widget. Column IDs are `label` for the grouping column and `col-<index>` for each entry in `columns`. Users can still change sorting by selecting columns in the rendered table."}),_R=n.Array(n.Object({id:n.String({description:"Column attribute used for the default list sort. It matches an attribute in `listColumns` or a built-in list column for the selected list source."}),desc:n.Boolean({description:"Sort direction for the default list sort. `true` sorts descending; `false` sorts ascending."})},{title:"ListDefaultSorting"}),{description:"Default sorting applied to a list widget. Applies to log, span, RUM event, or connection list widgets. Users can still change sorting by selecting columns in the rendered list."}),IR=n.Array(n.Object({id:p({description:"Column attribute used for the default list sort. Set this to an attribute in `listColumns` or a built-in list column for the selected list source."}),desc:n.Boolean({description:"Sort direction for the default list sort. Set `true` for descending order or `false` for ascending order."})},{title:"ListDefaultSorting"}),{description:"Default sorting applied to a list widget. Optional on create or update for log, span, RUM event, or connection list widgets. Users can still change sorting by selecting columns in the rendered list."}),Zae=["horizontal","vertical"],mqe=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(yR,{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(_R)},{$id:"GraphVisualizationList",title:"List"}),fqe=n.Object({type:n.Literal("list",{description:"Displays matching logs in a tabular list"}),query:p({type:"tsuga-query",description:"Query that selects logs for the list"}),listColumns:n.Optional(n.Array(ER,{description:"Custom columns to display for each log. Omit it and the list renders no columns: there is no default set."})),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(IR)},{$id:"InputGraphVisualizationList",title:"List"}),hR=D("type",[n.Object({type:n.Literal("auto",{description:"Automatically choose this axis bound"})}),n.Object({type:n.Literal("number",{description:"Use a fixed numeric axis bound"}),value:n.Number({description:"Fixed numeric axis bound value"})})],{description:"Axis bound mode: automatic or fixed numeric value"}),hp=n.Object({min:hR,max:hR,scale:D("type",[n.Object({type:n.Literal("pow",{description:"Power scale"}),exponent:n.Number({description:"Exponent used by the power scale"})}),n.Object({type:n.Enum(["linear","log","sqrt"],{description:"Built-in axis scale"})})],{description:"Y-axis scale mode"}),alwaysIncludeZero:n.Boolean({description:"Whether the rendered Y axis should always include zero"})},{description:"Y-axis bounds and scale configuration for chart widgets."}),yp=n.Object({min:hR,max:hR,scale:D("type",[n.Object({type:n.Literal("pow",{description:"Power scale"}),exponent:n.Number({minimum:0,description:"Exponent used by the power scale"})}),n.Object({type:n.Enum(["linear","log","sqrt"],{description:"Built-in axis scale"})})],{description:"Y-axis scale mode"}),alwaysIncludeZero:n.Boolean({description:"Whether the rendered Y axis should always include zero"})},{description:"Y-axis bounds and scale configuration for chart widgets. Optional on create or update."}),Xae=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"}),Jae=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 gqe=["regular","dashed"],Cg=n.Record(n.String(),n.Object({groupId:n.String(),lineStyle:n.Enum(gqe)}),{description:"Line style of each series, keyed by 1-based query index. The last index is the formula when there is one. Each entry is `{groupId, lineStyle}`, where `groupId` is `_q<n>` for query n or `_value` for the formula. For widgets with a single query, only the `1` entry is read and it applies to every series. Defaults to regular."}),hqe=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(pr),thresholds:ji,yAxisSettings:n.Optional(hp),lineStyleOptions:n.Optional(Cg),normalizer:n.Optional(gr),eventsOverlay:n.Optional(wd)},{$id:"GraphVisualizationTimeseriesConnection",title:"TimeseriesConnection"}),yqe=n.Object({type:n.Literal("timeseries-connection",{description:"Displays the database rows-based aggregation as a time series chart"}),connectionId:p({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(p({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:n.Optional(pr),thresholds:ji,yAxisSettings:n.Optional(yp),lineStyleOptions:n.Optional(Cg),normalizer:n.Optional(hr),eventsOverlay:n.Optional(vd)},{$id:"InputGraphVisualizationTimeseriesConnection",title:"TimeseriesConnection"}),Eqe=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(yR,{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(_R)},{$id:"GraphVisualizationListConnection",title:"ListConnection"}),Tqe=n.Object({type:n.Literal("list-connection",{description:"Displays database rows as a tabular list"}),connectionId:p({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),query:p({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),listColumns:n.Optional(n.Array(ER,{description:"Custom columns to display for each database row. Omit it and the list renders no columns: there is no default set."})),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(IR)},{$id:"InputGraphVisualizationListConnection",title:"ListConnection"}),Sqe=n.Object({type:n.Literal("top-list-connection",{description:"Displays the database rows-based aggregation as a ranked top list"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),queries:n.Array(n.String({description:"The read-only SQL query to execute against the connection."})),normalizer:n.Optional(gr)},{$id:"GraphVisualizationTopListConnection",title:"TopListConnection"}),_qe=n.Object({type:n.Literal("top-list-connection",{description:"Displays the database rows-based aggregation as a ranked top list"}),connectionId:p({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(p({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),normalizer:n.Optional(hr)},{$id:"InputGraphVisualizationTopListConnection",title:"TopListConnection"}),Iqe=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(pr),normalizer:n.Optional(gr)},{$id:"GraphVisualizationPieConnection",title:"PieConnection"}),bqe=n.Object({type:n.Literal("pie-connection",{description:"Displays the database rows-based aggregation as a pie chart"}),connectionId:p({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(p({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:n.Optional(pr),normalizer:n.Optional(hr)},{$id:"InputGraphVisualizationPieConnection",title:"PieConnection"}),xqe=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(pr),thresholds:ji,yAxisSettings:n.Optional(hp),normalizer:n.Optional(gr),eventsOverlay:n.Optional(wd)},{$id:"GraphVisualizationBarConnection",title:"BarConnection"}),Oqe=n.Object({type:n.Literal("bar-connection",{description:"Displays the database rows-based aggregation as a bar chart"}),connectionId:p({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(p({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:n.Optional(pr),thresholds:ji,yAxisSettings:n.Optional(yp),normalizer:n.Optional(hr),eventsOverlay:n.Optional(vd)},{$id:"InputGraphVisualizationBarConnection",title:"BarConnection"}),Aqe=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(xg,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(Ia,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"})),precision:ct,normalizer:n.Optional(gr),legendMode:n.Optional(pr)},{$id:"GraphVisualizationQueryValueConnection",title:"QueryValueConnection"}),Cqe=n.Object({type:n.Literal("query-value-connection",{description:"Displays a single value computed by a SQL query against a database connection"}),connectionId:p({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(p({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),backgroundMode:n.Optional(n.Enum(xg,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(Ia,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"})),precision:ct,normalizer:n.Optional(hr),legendMode:n.Optional(pr)},{$id:"InputGraphVisualizationQueryValueConnection",title:"QueryValueConnection"}),Rqe=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(Zae,{description:"Layout used to render log patterns"}))},{$id:"GraphVisualizationListLogPatterns",title:"ListLogPatterns"}),Pqe=n.Object({type:n.Literal("list-log-patterns",{description:"Displays log patterns clustered from logs matching the query"}),query:p({type:"tsuga-query",description:"Tsuga query that selects logs to cluster into patterns"}),layout:n.Optional(n.Enum(Zae,{description:"Layout used to render log patterns"}))},{$id:"InputGraphVisualizationListLogPatterns",title:"ListLogPatterns"}),Uqe=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(yR,{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(_R)},{$id:"GraphVisualizationListSpans",title:"ListSpans"}),wqe=n.Object({type:n.Literal("list-spans",{description:"Displays matching trace spans in a tabular list"}),query:p({type:"tsuga-query",description:"Query that selects trace spans for the list"}),listColumns:n.Optional(n.Array(ER,{description:"Custom columns to display for each span. Omit it and the list renders no columns: there is no default set."})),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(IR)},{$id:"InputGraphVisualizationListSpans",title:"ListSpans"}),vqe=n.Object({type:n.Literal("list-rum",{description:"Displays matching RUM events in a tabular list"}),query:n.String({description:"Query that selects RUM events for the list"}),listColumns:n.Optional(n.Array(yR,{description:"Custom columns to display for each RUM event. Attributes are read without their stream prefix, e.g. `view.name` rather than `events.view.name`."})),listColumnsSize:n.Optional(n.Record(n.String(),n.Number({description:"List column width by column id"}),{description:"List column widths in pixels, keyed by the `attribute` of the matching `listColumns` entry. Columns without an entry keep their default width."})),isCellWrapped:n.Optional(n.Boolean({description:"Whether list widget cell text wraps instead of truncating. Applies to RUM event list widgets."})),defaultSorting:n.Optional(_R)},{$id:"GraphVisualizationListRum",title:"ListRum"}),Nqe=n.Object({type:n.Literal("list-rum",{description:"Displays matching RUM events in a tabular list"}),query:p({type:"tsuga-query",description:"Query that selects RUM events for the list. Prefix every field with the stream it belongs to (`measurements.`, `events.`, or `exceptions.`) and filter on a single stream per query. A query without stream-prefixed fields searches the `events` stream."}),listColumns:n.Optional(n.Array(ER,{description:"Custom columns to display for each RUM event. Set attributes without their stream prefix, e.g. `view.name` rather than `events.view.name`. Omit it and the list renders no columns: there is no default set."})),listColumnsSize:n.Optional(n.Record(n.String(),n.Number({description:"List column width by column id"}),{description:"List column widths in pixels, keyed by the `attribute` of the matching `listColumns` entry. Columns without an entry keep their default width."})),isCellWrapped:n.Optional(n.Boolean({description:"Whether list widget cell text wraps instead of truncating. Applies to RUM event list widgets. Optional; omit or set false to use truncated cells."})),defaultSorting:n.Optional(IR)},{$id:"InputGraphVisualizationListRum",title:"ListRum"}),Ep=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."}),Tp=n.Array(p({allowEmpty:!1,type:"long",description:"Raw PromQL expression for this widget."}),{minItems:1,description:"PromQL expressions configured for this widget. Only the first expression is rendered; later entries are stored and ignored."}),kqe=n.Object({type:n.Literal("timeseries-promql",{description:"Displays PromQL metrics query-based aggregation as a time series chart"}),queries:Ep,aliases:n.Optional(Pd),timeBucket:n.Optional(gp),normalizer:n.Optional(gr),precision:ct,legendMode:n.Optional(pr),thresholds:ji,yAxisSettings:n.Optional(hp),smoothing:n.Optional(n.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"})),lineStyleOptions:n.Optional(Cg),eventsOverlay:n.Optional(wd)},{$id:"GraphVisualizationTimeseriesPromql",title:"TimeseriesPromql"}),Lqe=n.Object({type:n.Literal("timeseries-promql",{description:"Displays PromQL metrics query-based aggregation as a time series chart"}),queries:Tp,aliases:n.Optional(Ud),timeBucket:n.Optional(gp),normalizer:n.Optional(hr),precision:ct,legendMode:n.Optional(pr),thresholds:ji,yAxisSettings:n.Optional(yp),smoothing:n.Optional(n.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"})),lineStyleOptions:n.Optional(Cg),eventsOverlay:n.Optional(vd)},{$id:"InputGraphVisualizationTimeseriesPromql",title:"TimeseriesPromql"}),Mqe=n.Object({type:n.Literal("query-value-promql",{description:"Configures a PromQL metrics query-based aggregation as a single value"}),queries:Ep,aliases:n.Optional(Pd),backgroundMode:n.Optional(n.Enum(xg,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(Ia,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"})),precision:ct,normalizer:n.Optional(gr),legendMode:n.Optional(pr)},{$id:"GraphVisualizationQueryValuePromql",title:"QueryValuePromql"}),Dqe=n.Object({type:n.Literal("query-value-promql",{description:"Configures a PromQL metrics query-based aggregation as a single value"}),queries:Tp,aliases:n.Optional(Ud),backgroundMode:n.Optional(n.Enum(xg,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(Ia,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"})),precision:ct,normalizer:n.Optional(hr),legendMode:n.Optional(pr)},{$id:"InputGraphVisualizationQueryValuePromql",title:"QueryValuePromql"}),ece=["red","pink","violet","blue","cyan","green","yellow","orange"],bR=n.Enum(ece,{description:"Color palette used to render the heatmap intensity gradient"}),xR=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(ece,{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."}),Fqe=n.Object({type:n.Literal("gauge-promql",{description:"Configures a PromQL metrics query-based aggregation as a gauge"}),queries:Ep,aliases:n.Optional(Pd),max:n.Optional(n.Number({description:"Gauge maximum value, on the raw query value before the unit is applied"})),colorThresholds:n.Optional(n.Array(xR,{description:"Color thresholds inside the gauge range, on the raw query value before the unit is applied"})),precision:ct,normalizer:n.Optional(gr)},{$id:"GraphVisualizationGaugePromql",title:"GaugePromql"}),$qe=n.Object({type:n.Literal("gauge-promql",{description:"Configures a PromQL metrics query-based aggregation as a gauge"}),queries:Tp,aliases:n.Optional(Ud),max:n.Optional(n.Number({description:"Gauge maximum value, on the raw query value before the unit is applied"})),colorThresholds:n.Optional(n.Array(xR,{description:"Color thresholds inside the gauge range, on the raw query value before the unit is applied"})),precision:ct,normalizer:n.Optional(hr)},{$id:"InputGraphVisualizationGaugePromql",title:"GaugePromql"}),Gqe=n.Object({type:n.Literal("top-list-promql",{description:"Displays PromQL metrics query-based aggregation as a ranked top list"}),queries:Ep,aliases:n.Optional(Pd),normalizer:n.Optional(gr),precision:ct,conditions:n.Optional(n.Array(Ia,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"}))},{$id:"GraphVisualizationTopListPromql",title:"TopListPromql"}),Bqe=n.Object({type:n.Literal("top-list-promql",{description:"Displays PromQL metrics query-based aggregation as a ranked top list"}),queries:Tp,aliases:n.Optional(Ud),normalizer:n.Optional(hr),precision:ct,conditions:n.Optional(n.Array(Ia,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"}))},{$id:"InputGraphVisualizationTopListPromql",title:"TopListPromql"}),jqe=n.Object({type:n.Literal("pie-promql",{description:"Displays PromQL metrics query-based aggregation as a pie chart"}),queries:Ep,aliases:n.Optional(Pd),normalizer:n.Optional(gr),precision:ct,legendMode:n.Optional(pr)},{$id:"GraphVisualizationPiePromql",title:"PiePromql"}),qqe=n.Object({type:n.Literal("pie-promql",{description:"Displays PromQL metrics query-based aggregation as a pie chart"}),queries:Tp,aliases:n.Optional(Ud),normalizer:n.Optional(hr),precision:ct,legendMode:n.Optional(pr)},{$id:"InputGraphVisualizationPiePromql",title:"PiePromql"}),Hqe=n.Object({type:n.Literal("bar-promql",{description:"Displays PromQL metrics query-based aggregation as a bar chart"}),queries:Ep,aliases:n.Optional(Pd),timeBucket:n.Optional(gp),precision:ct,normalizer:n.Optional(gr),thresholds:ji,legendMode:n.Optional(pr),yAxisSettings:n.Optional(hp),eventsOverlay:n.Optional(wd)},{$id:"GraphVisualizationBarPromql",title:"BarPromql"}),Kqe=n.Object({type:n.Literal("bar-promql",{description:"Displays PromQL metrics query-based aggregation as a bar chart"}),queries:Tp,aliases:n.Optional(Ud),timeBucket:n.Optional(gp),precision:ct,normalizer:n.Optional(hr),thresholds:ji,legendMode:n.Optional(pr),yAxisSettings:n.Optional(yp),eventsOverlay:n.Optional(vd)},{$id:"InputGraphVisualizationBarPromql",title:"BarPromql"}),zqe=n.Object({type:n.Literal("distribution-promql",{description:"Displays a PromQL histogram query grouped by `le` as a distribution chart, e.g. `sum by (le) (rate(http_duration_bucket[5m]))`"}),queries:Ep,precision:ct,normalizer:n.Optional(gr),percentileMarkers:n.Optional(Xae)},{$id:"GraphVisualizationDistributionPromql",title:"DistributionPromql"}),Yqe=n.Object({type:n.Literal("distribution-promql",{description:"Displays a PromQL histogram query grouped by `le` as a distribution chart, e.g. `sum by (le) (rate(http_duration_bucket[5m]))`"}),queries:Tp,precision:ct,normalizer:n.Optional(hr),percentileMarkers:n.Optional(Jae)},{$id:"InputGraphVisualizationDistributionPromql",title:"DistributionPromql"}),Vqe=n.Object({type:n.Literal("heatmap-promql",{description:"Displays a PromQL histogram query grouped by `le` as a heatmap chart, e.g. `sum by (le) (rate(http_duration_bucket[5m]))`"}),queries:Ep,precision:ct,normalizer:n.Optional(gr),palette:n.Optional(bR),yAxisSettings:n.Optional(hp)},{$id:"GraphVisualizationHeatmapPromql",title:"HeatmapPromql"}),Wqe=n.Object({type:n.Literal("heatmap-promql",{description:"Displays a PromQL histogram query grouped by `le` as a heatmap chart, e.g. `sum by (le) (rate(http_duration_bucket[5m]))`"}),queries:Tp,precision:ct,normalizer:n.Optional(hr),palette:n.Optional(bR),yAxisSettings:n.Optional(yp)},{$id:"InputGraphVisualizationHeatmapPromql",title:"HeatmapPromql"}),Qqe=n.Object({type:n.Literal("timeseries",{description:"Displays the aggregation as a time series chart"}),...Og,groupByMode:ba,timeBucket:n.Optional(gp),normalizer:n.Optional(gr),precision:ct,legendMode:n.Optional(pr),thresholds:ji,yAxisSettings:n.Optional(hp),smoothing:n.Optional(n.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"})),lineStyleOptions:n.Optional(Cg),customLink:n.Optional(ZT),eventsOverlay:n.Optional(wd)},{$id:"GraphVisualizationTimeseries",title:"Timeseries"}),Zqe=n.Object({type:n.Literal("timeseries",{description:"Displays the aggregation as a time series chart"}),...Ag,groupByMode:ba,timeBucket:n.Optional(gp),normalizer:n.Optional(hr),precision:ct,legendMode:n.Optional(pr),thresholds:ji,yAxisSettings:n.Optional(yp),smoothing:n.Optional(n.Boolean({description:"Whether to apply automatic smoothing to the rendered timeseries"})),lineStyleOptions:n.Optional(Cg),customLink:n.Optional(XT),eventsOverlay:n.Optional(vd)},{$id:"InputGraphVisualizationTimeseries",title:"Timeseries"}),tce="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.",Xqe=n.Object({type:n.Literal("top-list",{description:"Displays the aggregation as a ranked list of top results"}),...Og,groupByMode:ba,normalizer:n.Optional(gr),precision:ct,conditions:n.Optional(n.Array(Ia,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"})),isStacked:n.Optional(n.Boolean({description:tce})),legendMode:n.Optional(pr),customLink:n.Optional(ZT)},{$id:"GraphVisualizationTopList",title:"TopList"}),Jqe=n.Object({type:n.Literal("top-list",{description:"Displays the aggregation as a ranked list of top results"}),...Ag,groupByMode:ba,normalizer:n.Optional(hr),precision:ct,conditions:n.Optional(n.Array(Ia,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"})),isStacked:n.Optional(n.Boolean({description:tce})),legendMode:n.Optional(pr),customLink:n.Optional(XT)},{$id:"InputGraphVisualizationTopList",title:"TopList"}),e2e=n.Object({type:n.Literal("pie",{description:"Displays the aggregation as a pie chart"}),...Og,groupByMode:ba,normalizer:n.Optional(gr),precision:ct,legendMode:n.Optional(pr),customLink:n.Optional(ZT)},{$id:"GraphVisualizationPie",title:"Pie"}),t2e=n.Object({type:n.Literal("pie",{description:"Displays the aggregation as a pie chart"}),...Ag,groupByMode:ba,normalizer:n.Optional(hr),precision:ct,legendMode:n.Optional(pr),customLink:n.Optional(XT)},{$id:"InputGraphVisualizationPie",title:"Pie"}),r2e=n.Object({type:n.Literal("query-value",{description:"Displays the aggregation as a single value"}),...TR,backgroundMode:n.Optional(n.Enum(xg,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(Ia,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"})),precision:ct,normalizer:n.Optional(gr),legendMode:n.Optional(pr)},{$id:"GraphVisualizationQueryValue",title:"QueryValue"}),n2e=n.Object({type:n.Literal("query-value",{description:"Displays the aggregation as a single value"}),...SR,backgroundMode:n.Optional(n.Enum(xg,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(Ia,{description:"Conditional formatting rules applied to the raw query value, before the unit is applied"})),precision:ct,normalizer:n.Optional(hr),legendMode:n.Optional(pr)},{$id:"InputGraphVisualizationQueryValue",title:"QueryValue"}),o2e=n.Object({type:n.Literal("bar",{description:"Displays the aggregation as a bar chart"}),...Og,groupByMode:ba,timeBucket:n.Optional(gp),precision:ct,normalizer:n.Optional(gr),thresholds:ji,legendMode:n.Optional(pr),yAxisSettings:n.Optional(hp),customLink:n.Optional(ZT),eventsOverlay:n.Optional(wd)},{$id:"GraphVisualizationBar",title:"Bar"}),i2e=n.Object({type:n.Literal("bar",{description:"Displays the aggregation as a bar chart"}),...Ag,groupByMode:ba,timeBucket:n.Optional(gp),precision:ct,normalizer:n.Optional(hr),thresholds:ji,legendMode:n.Optional(pr),yAxisSettings:n.Optional(yp),customLink:n.Optional(XT),eventsOverlay:n.Optional(vd)},{$id:"InputGraphVisualizationBar",title:"Bar"}),rce='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.',nce=n.String({description:rce}),oce=p({description:rce}),s2e=n.Object({type:n.Literal("distribution",{description:"Displays the aggregation as a distribution chart"}),...Og,group:n.Optional(nce),precision:ct,normalizer:n.Optional(gr),percentileMarkers:n.Optional(Xae),boundsScale:n.Optional(QE)},{$id:"GraphVisualizationDistribution",title:"Distribution"}),a2e=n.Object({type:n.Literal("distribution",{description:"Displays the aggregation as a distribution chart"}),...Ag,group:n.Optional(oce),precision:ct,normalizer:n.Optional(hr),percentileMarkers:n.Optional(Jae),boundsScale:n.Optional(QE)},{$id:"InputGraphVisualizationDistribution",title:"Distribution"}),c2e=n.Object({type:n.Literal("heatmap",{description:"Displays the aggregation as a heatmap chart"}),...Og,group:n.Optional(nce),precision:ct,normalizer:n.Optional(gr),palette:n.Optional(bR),yAxisSettings:n.Optional(hp),eventsOverlay:n.Optional(wd)},{$id:"GraphVisualizationHeatmap",title:"Heatmap"}),u2e=n.Object({type:n.Literal("heatmap",{description:"Displays the aggregation as a heatmap chart"}),...Ag,group:n.Optional(oce),precision:ct,normalizer:n.Optional(hr),palette:n.Optional(bR),yAxisSettings:n.Optional(yp),eventsOverlay:n.Optional(vd)},{$id:"InputGraphVisualizationHeatmap",title:"Heatmap"}),p2e=n.Object({type:n.Literal("gauge",{description:"Displays the aggregation as a gauge"}),...TR,max:n.Optional(n.Number({description:"Gauge maximum value, on the raw query value before the unit is applied"})),colorThresholds:n.Optional(n.Array(xR,{description:"Color thresholds inside the gauge range, on the raw query value before the unit is applied"})),precision:ct,normalizer:n.Optional(gr)},{$id:"GraphVisualizationGauge",title:"Gauge"}),l2e=n.Object({type:n.Literal("gauge",{description:"Displays the aggregation as a gauge"}),...SR,max:n.Optional(n.Number({description:"Gauge maximum value, on the raw query value before the unit is applied. Defaults to 100 when omitted."})),colorThresholds:n.Optional(n.Array(xR,{description:"Color thresholds inside the gauge range, on the raw query value before the unit is applied"})),precision:ct,normalizer:n.Optional(hr)},{$id:"InputGraphVisualizationGauge",title:"Gauge"}),d2e=n.Object({type:n.Literal("table",{description:"Displays the aggregation as a table with multi-level grouping"}),columns:n.Array(uqe,{description:"Each column defines an independent aggregation displayed as a table column"}),groupBy:n.Optional(Mf),groupByMode:ba,defaultSorting:n.Optional(lqe),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(ZT)},{$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(pqe,{minItems:1,description:"Each column defines an independent aggregation displayed as a table column"}),groupBy:n.Optional(Cc),groupByMode:ba,defaultSorting:n.Optional(dqe),columnSizes:n.Optional(n.Record(n.String(),n.Number({description:"Column width by column id"}),{description:"Table column widths in pixels, keyed by column id: `label` for the grouping column and `col-<index>` for each entry in `columns`, counting from 0. Columns without an entry keep their default width."})),customLink:n.Optional(XT)},{$id:"InputGraphVisualizationTable",title:"Table"}),f2e=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(Aae,{description:"Background color used to render the note"})),noteAlign:n.Optional(Sa),noteJustifyContent:n.Optional(Sa)},{$id:"GraphVisualizationNote",title:"Note"}),g2e=n.Object({type:n.Literal("note",{description:"Displays static text on the dashboard"}),note:n.Optional(p({type:"long",description:"Markdown-compatible text shown in the note"})),noteColor:n.Optional(n.Enum(Aae,{description:"Background color used to render the note"})),noteAlign:n.Optional(Sa),noteJustifyContent:n.Optional(Sa)},{$id:"InputGraphVisualizationNote",title:"Note"}),ice=n.Object({type:n.Literal("group",{description:"Full-width header that groups the widgets referencing it through `groupId`. Its name is the widget `name`."})},{$id:"GraphVisualizationGroup",title:"Group"}),sce=["summary","table"],ace="Displays the latest status of SLOs as summary cards with the result count per status, a table of results, or both. Status is not recomputed over the dashboard time range.",cce="Id of the SLO to display. Omit it to cover every SLO that matches `filters`.",uce="Narrows the SLOs the widget covers. Omit it, or any of its fields, to apply no filter.",h2e="Restrict results to SLOs owned by any of these team IDs",y2e="Restrict results to SLOs that have at least one of the listed key/value tags",pce="Keep only the results whose status is one of these values. A result is one cluster of an ungrouped SLO, or one group of a grouped SLO.",lce="Keep only the results matching every key filter. A result's values for a key are its group-by value when its SLO groups by that field, and its SLO's tag values for that key. A result matches when one of its values is in `values`, or, with `exclude: true`, when none is; a result with no value for the key only matches an exclusion.",dce="Group-by field or tag key to filter on, such as `context.team`",mce="Values compared with the result's group-by value and its SLO's tag values for `key`",fce="If true, keep the results with none of these values instead of those with at least one",gce="Groups the results by owning team, or by the value of a tag key or group-by field. Omit it to list results ungrouped. Only the `table` section is grouped, so include `table` in `display`.",hce="Tag key or group-by field to group by, such as `env` or `context.team`. A result falls under each value it has for this key: its group-by value when its SLO groups by this field, and its SLO's tag values for this key. Results with no value for the key are not shown.",yce="Sections to show: `summary` for the result count per status, `table` for the list of results.",Ece=n.Object({type:n.Literal("team",{description:"Groups the results by the team owning their SLO"})},{$id:"SloWidgetOrganizeByTeam",title:"Team"}),E2e=n.Object({type:n.Literal("key",{description:"Groups the results by the value of a tag key or group-by field"}),key:n.String({description:hce})},{$id:"SloWidgetOrganizeByKey",title:"Key"}),T2e=n.Object({type:n.Literal("key",{description:"Groups the results by the value of a tag key or group-by field"}),key:p({allowEmpty:!1,description:hce})},{$id:"InputSloWidgetOrganizeByKey",title:"Key"}),S2e=D("type",[Ece,E2e],{title:"SloWidgetOrganizeBy",description:gce}),_2e=D("type",[Ece,T2e],{title:"SloWidgetOrganizeBy",description:gce}),I2e=n.Object({type:n.Literal("slo",{description:ace}),sloId:n.Optional(n.String({description:cce})),filters:n.Optional(n.Object({owners:n.Optional(n.Object({values:n.Array(n.String()),exclude:n.Optional(n.Boolean())},{description:h2e})),tags:n.Optional(n.Object({values:Vr,exclude:n.Optional(n.Boolean())},{description:y2e})),statuses:n.Optional(n.Object({values:n.Array(fp),exclude:n.Optional(n.Boolean())},{description:pce})),keys:n.Optional(n.Array(n.Object({key:n.String({description:dce}),values:n.Array(n.String(),{description:mce}),exclude:n.Optional(n.Boolean({description:fce}))}),{description:lce}))},{description:uce})),organizeBy:n.Optional(S2e),display:n.Array(n.Enum(sce),{description:yce})},{$id:"GraphVisualizationSlo",title:"Slo"}),b2e=n.Object({type:n.Literal("slo",{description:ace}),sloId:n.Optional(p({allowEmpty:!1,description:cce})),filters:n.Optional(n.Object({owners:n.Optional(yg.properties.owners),tags:n.Optional(yg.properties.tags),statuses:n.Optional(he(fp,{description:pce,maxItems:3})),keys:n.Optional(n.Array(n.Object({key:p({allowEmpty:!1,description:dce}),values:n.Array(p({allowEmpty:!1}),{maxItems:50,description:mce}),exclude:n.Optional(n.Boolean({description:fce}))}),{maxItems:50,description:lce}))},{description:uce})),organizeBy:n.Optional(_2e),display:n.Array(n.Enum(sce),{minItems:1,uniqueItems:!0,description:yce})},{$id:"InputGraphVisualizationSlo",title:"Slo"}),x2e=D("type",[hqe,Eqe,Sqe,Iqe,xqe,Aqe,kqe,Mqe,Fqe,Gqe,jqe,Hqe,zqe,Vqe,Qqe,Xqe,e2e,r2e,p2e,o2e,s2e,c2e,d2e,mqe,f2e,ice,Rqe,Uqe,vqe,I2e],{description:"Widget visualization configuration. The `type` discriminator selects the widget kind and its required fields."}),Tce=D("type",[yqe,Tqe,_qe,bqe,Oqe,Cqe,Lqe,Dqe,$qe,Bqe,qqe,Kqe,Yqe,Wqe,Zqe,Jqe,t2e,n2e,l2e,i2e,a2e,u2e,m2e,fqe,g2e,ice,Pqe,wqe,Nqe,b2e],{description:"Widget visualization configuration. The `type` discriminator selects the widget kind and its required fields."}),FF=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 ${QZ}\xD7${ZZ} (width\xD7height) grid units, except note widgets which can go down to 1\xD71, and group widgets which span the full ${WZ} columns.`}),Sce="ID of the dashboard tab that shows the widget. Widgets without a tab, or whose tab no longer exists, are shown in the first tab.",_ce="ID of the group widget the widget belongs to. The group must be in the same tab, and cannot itself belong to a group.",OR=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(Sa),descriptionJustifyContent:n.Optional(Sa),visualization:x2e,layout:n.Optional(FF),tabId:n.Optional(n.String({description:Sce})),groupId:n.Optional(n.String({description:_ce}))},{title:"Graph",description:"Single dashboard widget, combining its identity, its visualization configuration, and its position on the dashboard grid."}),O2e=n.Object({id:p({description:"Unique identifier of the graph widget inside the dashboard. Assign it when the graph is created; use it to target the graph in later update requests."}),name:n.Optional(p({description:"Display name of the graph widget."})),description:n.Optional(n.String({minLength:1,maxLength:800,description:"Text shown with the graph widget."})),descriptionAlign:n.Optional(Sa),descriptionJustifyContent:n.Optional(Sa),visualization:Tce,layout:n.Optional(FF),tabId:n.Optional(p({description:Sce})),groupId:n.Optional(p({description:_ce}))},{title:"Graph",description:"Single dashboard widget, combining its identity, its visualization configuration, and its position on the dashboard grid."}),$F=n.Object({name:Ye(p(),{description:"Display name of the graph widget. Pass null to remove it."}),description:Ye(n.String({minLength:1,maxLength:800}),{description:"Text shown with the graph widget. Pass null to remove it."}),descriptionAlign:Ye(Sa,{description:"Vertical alignment of the description. Pass null to remove it."}),descriptionJustifyContent:Ye(Sa,{description:"Horizontal alignment of the description. Pass null to remove it."}),visualization:n.Optional(Tce),layout:Ye(FF,{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."}),A2e=10,C2e=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."}),R2e=n.Array(n.Object({key:p({description:"Dashboard-wide filter key, usually a telemetry attribute name."}),values:n.Array(p({description:"Filter value."}),{description:"Allowed values for this dashboard-wide filter."}),exclude:n.Optional(n.Boolean({description:"If true, widgets exclude telemetry whose value matches this filter instead of including it (is-not)."}))}),{maxItems:A2e,description:"Dashboard-wide filters applied to every widget on the dashboard."}),Ice="Ordered tabs splitting the dashboard widgets into separate pages. When omitted or empty, the dashboard shows all its widgets on a single page.",P2e=n.Object({id:n.String({description:"Unique identifier of the tab inside the dashboard."}),name:n.String({description:"Display name of the tab."})}),U2e=n.Object({id:p({allowEmpty:!1,description:"Unique identifier of the tab inside the dashboard."}),name:p({allowEmpty:!1,description:"Display name of the tab."})}),w2e=20,Rg=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(OR,{description:"Ordered widgets that compose the dashboard"}),filters:n.Optional(C2e),tabs:n.Optional(n.Array(P2e,{description:Ice})),createdAt:w({description:"Timestamp when Tsuga created the dashboard."}),updatedAt:w({description:"Timestamp when Tsuga last updated the dashboard."}),creator:n.Optional(Se),updater:n.Optional(Se),tags:vt,timePreset:n.Optional(n.Enum(i0,{description:"Relative time preset used when opening the dashboard."})),clusterIds:n.Optional(n.Array(n.String(),{description:"Clusters selected when opening the dashboard."})),folderId:n.Optional(n.String({description:"Folder that contains the dashboard. Set from the dashboard's saved folder relationship. Returned when the dashboard is in a folder; omitted when it is not."}))}),AR=n.Object({name:p({description:"Display name of the dashboard."}),owner:p({allowEmpty:!1,description:"ID of the team that owns the dashboard. Required and used for dashboard access control."}),graphs:n.Array(O2e,{description:"Ordered widgets that compose the dashboard"}),filters:n.Optional(R2e),tabs:n.Optional(n.Array(U2e,{maxItems:w2e,description:Ice})),tags:$t,timePreset:n.Optional(n.Enum(i0,{description:"Relative time preset used when opening the dashboard. Optional; create defaults to `past-30-minutes` when omitted, and update omission preserves the current value."})),clusterIds:Ye(bc,{description:"Clusters to select when opening the dashboard."}),folderId:n.Optional(n.Union([n.Null(),p({allowEmpty:!1})],{description:"Folder that should contain the dashboard. Optional; omit on update to keep the current folder, pass null to clear the folder, or pass a readable dashboard-folder ID to move it."}))}),Os={IS_FAVORITE:"isFavorite",OWNER:"owner",TAGS:"tags",WIDGET_COUNT:"widgetCount",UPDATED_AT:"updatedAt",NAME:"name"},bce=[Os.OWNER,Os.TAGS,Os.WIDGET_COUNT,Os.UPDATED_AT,Os.NAME],Nd=n.Partial(n.Object({ids:he(p({allowEmpty:!1}),{description:"Restrict results to dashboards with any of these IDs",maxItems:50}),owners:he(p({allowEmpty:!1}),{description:"Restrict results to dashboards owned by any of these team IDs",maxItems:50}),searchQuery:n.Object({value:p({allowEmpty:!1,description:"Substring matched case-insensitively against dashboard names or dashboard IDs. Omit the whole `searchQuery` filter to skip text filtering."}),exclude:n.Optional(n.Boolean({description:"If true, exclude dashboards matching this value instead of including them"}))},{description:"Text filter for dashboard names or IDs. Optional; `exclude: true` returns dashboards whose name and ID do not match the substring."}),tags:he(rn.items,{description:"Restrict results to dashboards that have at least one of the listed key/value tags",maxItems:50}),folderId:n.Union([n.Null(),p({allowEmpty:!1})],{description:"Folder filter for dashboard query results. Optional; pass a folder ID to return dashboards in that folder, or null to return only dashboards that are not in any folder."})},{description:"Optional filters applied to narrow the returned dashboards"})),v2e=n.Partial(n.Object({...fe,filters:Nd,sort:n.Object({by:n.Enum([Os.IS_FAVORITE,Os.OWNER,Os.TAGS,Os.WIDGET_COUNT,Os.UPDATED_AT,Os.NAME],{description:"Field to sort the returned dashboards by"}),direction:le},{description:"Optional sorting applied to the returned dashboards"})})),GF=n.Object({...n.Omit(Rg,["graphs"]).properties,widgetCount:n.Number({description:"Number of widgets on the dashboard."})}),yyr=f({tags:["dashboards"],url:`${_a}/query`,method:"POST",paginated:!0,response:n.Array(GF),body:v2e}),Eyr=f({tags:["dashboards"],url:`${_a}/tags/query`,method:"POST",body:n.Object({filters:n.Optional(n.Omit(Nd,["tags"]))}),response:Vr}),Tyr=f({tags:["dashboards"],url:`${_a}/counts/query`,method:"POST",body:n.Object({filters:n.Optional(n.Partial(Nd))}),response:n.Object({all:n.Integer({description:"Total number of dashboards matching the filters that the user can read."})})}),Syr=f({tags:["dashboards"],url:`${_a}/:id`,method:"GET",params:n.Object({id:p()}),response:Rg}),_yr=f({tags:["dashboards"],url:_a,method:"POST",body:AR,response:Rg}),Iyr=f({tags:["dashboards"],url:`${_a}/:id`,method:"PATCH",params:n.Object({id:p()}),body:n.Partial(AR),response:Rg}),N2e=ui(Nd,{maxIds:100}),byr=f({tags:["dashboards"],url:`${_a}/bulk-update`,method:"PUT",body:n.Object({selection:N2e,owner:n.Optional(p({allowEmpty:!1,description:"Owning team ID to apply to every dashboard. Optional when folderId is provided; omit to keep the current owner."})),folderId:Ye(p({allowEmpty:!1}),{description:"Folder that should contain every dashboard. Optional when owner is provided; omit to keep the current folder, pass null to clear the folder, or pass a dashboard-folder ID to move dashboards."})}),response:n.Object({})}),xyr=f({tags:["dashboards"],url:`${_a}/:id`,method:"DELETE",params:n.Object({id:p()}),response:B}),k2e=f({tags:["dashboards"],url:`${_a}/:id/graphs/:graphId`,method:"PATCH",params:n.Object({id:p({allowEmpty:!1}),graphId:p({allowEmpty:!1})}),body:$F,response:OR}),Oyr=S8(k2e),L2e=ui(Nd),Ayr=f({tags:["dashboards"],url:`${_a}/bulk-delete`,method:"DELETE",body:n.Object({selection:L2e}),response:n.Object({})});var Pg=`/${"v1"}/dashboards`,CR=n.Pick(Rg,["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)."}),xce={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(CR,{examples:[xce]});var Oce=n.Pick(GF,["id","name","owner","widgetCount","filters","tags","timePreset","folderId"],{$id:"DashboardSummary",description:"Dashboard as listed by the dashboard query: its fields without `graphs`, plus the number of widgets. Retrieve the dashboard by ID to read its widgets."});Object.assign(Oce,{examples:[{...DA(xce,["graphs"]),widgetCount:1}]});var M2e=n.Object({by:n.Enum([...bce],{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"}),Ace=n.Object({...qe,filters:n.Optional(n.Pick(Nd,["owners","searchQuery","tags","folderId"])),sort:n.Optional(M2e)},{description:"Dashboard query request. Use filters, sorting, limit, and offset to page through visible dashboards."}),D2e={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(Ace,{examples:[D2e]});var Cce=f({description:"Lists or searches dashboards by name or ID substring, owning team, tags or folder. Results omit widgets (`graphs`) and give `widgetCount`; get a dashboard by ID to read its widgets. See [Dashboards](/documentation/visualize/dashboards/index).",operationId:"queryDashboards",tags:["dashboards"],url:`${Pg}/query`,method:"POST",paginated:!0,body:Ace,response:n.Array(Oce)}),Rce=f({description:"Retrieves one dashboard by ID, with its widgets (graphs, charts) and their queries.",operationId:"getDashboard",tags:["dashboards"],url:`${Pg}/:id`,method:"GET",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the saved dashboard to retrieve. Use the `id` returned by dashboard query, create, or update responses."})}),response:CR}),BF=n.Pick(AR,["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."}),Pce={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(BF,{examples:[Pce]});var Uce=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."}),F2e={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(Uce,{examples:[F2e]});var wce=f({description:"Creates a dashboard owned by the specified team, with its widgets (graphs). The response returns the saved dashboard definition.",operationId:"createDashboard",tags:["dashboards"],url:Pg,method:"POST",body:BF,response:CR}),vce=f({description:"Updates a dashboard by ID, such as its widgets (graphs, charts), filters or folder. Top-level fields are patched and omitted ones keep their values, but a sent array replaces the stored one whole: a `graphs` array missing a widget deletes that widget. Read the dashboard first and send back every widget you keep, or change one widget with the dashboard graph update.",operationId:"updateDashboard",tags:["dashboards"],url:`${Pg}/:id`,method:"PUT",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the saved dashboard to update. Use the `id` returned by dashboard query, get, or create responses."})}),body:n.Partial(BF,{examples:[Pce]}),response:CR}),$2e=n.Object({id:p({allowEmpty:!1,description:"Identifier of the saved dashboard to delete. Use the `id` returned by dashboard query, get, create, or update responses."})}),Nce=f({description:"Deletes a dashboard by ID. Use only after confirming no users or automation still rely on the dashboard.",operationId:"deleteDashboard",tags:["dashboards"],url:`${Pg}/:id`,method:"DELETE",params:$2e,response:B}),Lyr=f({description:"Updates one widget (graph, chart) of a dashboard by dashboard ID and graph ID, without resending the dashboard. Sent fields are patched and null clears them; a sent `visualization` or `layout` replaces the stored one whole.",operationId:"updateDashboardGraph",tags:["dashboards"],url:`${Pg}/:id/graphs/:graphId`,method:"PUT",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the dashboard that contains the graph to update. Use the `id` returned by dashboard responses."}),graphId:p({allowEmpty:!1,description:"Identifier of the graph to update within the dashboard. Use graph IDs from the dashboard response."})}),body:Uce,response:OR});var kce=Ue({commandName:"dashboards",description:"Manage dashboards",endpoints:{list:Cce,get:Rce,create:wce,update:vce,delete:Nce},enableListBody:!0});var Lce="tsuga_in:v1:";var G2e=100,jF=3,Ug=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:Vr,teamOverrideFields:n.Optional(n.Array(n.String(),{description:"Telemetry attribute names used to override ownership for data sent with this key."})),updatedAt:w({description:"Timestamp when Tsuga last updated the key metadata."}),createdAt:w({description:"Timestamp when Tsuga created the key."}),creator:n.Optional(Se),updater:n.Optional(Se),assetUpdatedAt:w({description:"Timestamp used for asset-change tracking across Tsuga-managed resources."})}),JT=n.Object({name:n.String({format:Mi,minLength:1,maxLength:G2e,description:"Kebab-case name for the ingestion API key."}),owner:p({allowEmpty:!1,description:"Team ID that will own and manage the ingestion API key."}),tags:rn,teamOverrideFields:n.Union([n.Array(p({allowEmpty:!1}),{minItems:1,maxItems:jF,description:"Array form."}),n.Null({description:"Clear any existing team override fields."})],{description:"Telemetry attribute names used to override ownership for data sent with this key. Send null to clear existing override fields."})}),wg="/v0/ingestion-api-keys",Yyr=f({tags:["ingestion-api-keys"],url:wg,method:"POST",body:JT,response:n.Object({...Ug.properties,key:n.String({description:"Full secret value of the ingestion API key. Generated by Tsuga and returned only in this create response; subsequent get and list responses expose only `keyLastCharacters`. Store it immediately, since it cannot be retrieved again after this response."})})}),Vyr=f({tags:["ingestion-api-keys"],url:wg,method:"GET",paginated:!0,query:n.Object(fe),response:n.Array(Ug)}),Wyr=f({tags:["ingestion-api-keys"],url:`${wg}/:id`,method:"GET",params:n.Object({id:p({allowEmpty:!1})}),response:Ug}),Qyr=f({tags:["ingestion-api-keys"],url:`${wg}/:id`,method:"PUT",params:n.Object({id:p({allowEmpty:!1})}),body:JT,response:Ug}),Zyr=f({tags:["ingestion-api-keys"],url:`${wg}/:id`,method:"DELETE",params:n.Object({id:p({allowEmpty:!1})}),response:B}),Xyr=f({tags:["ingestion-api-keys"],url:`${wg}/bulk-delete`,method:"DELETE",body:n.Object({ids:n.Array(p({allowEmpty:!1}),{uniqueItems:!0})}),response:n.Object({})});var eS=`/${"v1"}/ingestion-api-keys`,tS=n.Pick(Ug,["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)."}),Mce={id:"123-456-abc",name:"production-logs-ingestion",keyLastCharacters:"x7Qm",owner:"team-123-abc",tags:[{key:"env",value:"production"}],teamOverrideFields:["service"]};Object.assign(tS,{examples:[Mce]});var Dce=n.Pick(JT,["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."}),Fce=n.Pick(JT,["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."}),$ce={name:"production-logs-ingestion",owner:"team-123-abc",tags:[{key:"env",value:"production"}],teamOverrideFields:["service"]};Object.assign(Dce,{examples:[$ce]});Object.assign(Fce,{examples:[$ce]});var B2e={...Mce,key:`${Lce}abc123xyx7Qm`},Gce=f({description:"Lists ingestion API keys, the credentials collectors, agents, SDKs and HTTP clients use to send telemetry to Tsuga, with their owners, tags and team override fields.",operationId:"listIngestionApiKeys",tags:["ingestion-api-keys"],url:eS,method:"GET",paginated:!0,query:n.Object(qe),response:n.Array(tS)}),sEr=f({description:"Retrieves one ingestion API key by ID. The response never includes the full secret key value; only the last visible characters are returned.",operationId:"getIngestionApiKey",tags:["ingestion-api-keys"],url:`${eS}/:id`,method:"GET",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the ingestion API key to retrieve. Use the `id` returned by ingestion API key list or create responses."})}),response:tS}),j2e=n.Object({...tS.properties,key:n.String({description:"Full Tsuga-generated ingestion API key secret. Returned only in the create response; list, get, and update responses expose only `keyLastCharacters`."})},{title:"IngestionApiKeyCreated",example:B2e}),Bce=f({description:"Creates an ingestion API key for telemetry intake. Store the returned `key` immediately because Tsuga returns the full secret only in this response.",operationId:"createIngestionApiKey",tags:["ingestion-api-keys"],url:eS,method:"POST",body:Dce,response:j2e}),jce=f({description:"Updates ingestion API key metadata by ID, including name, owner, tags, and team override fields. The secret key value is not rotated by this operation.",operationId:"updateIngestionApiKey",tags:["ingestion-api-keys"],url:`${eS}/:id`,method:"PUT",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the ingestion API key to update. Use the `id` returned by ingestion API key list, get, or create responses."})}),body:Fce,response:tS}),qce=f({description:"Deletes an ingestion API key by ID. Telemetry clients using the deleted key can no longer send data with it.",operationId:"deleteIngestionApiKey",tags:["ingestion-api-keys"],url:`${eS}/:id`,method:"DELETE",params:n.Object({id:p({allowEmpty:!1,description:"Identifier of the ingestion API key to delete. Use the `id` returned by ingestion API key list, create, or update responses."})}),response:B});var Hce=Ue({commandName:"ingestion-api-keys",description:"Manage ingestion API keys",singularOverride:"ingestion API key",pluralOverride:"ingestion API keys",endpoints:{list:Gce,create:Bce,update:jce,delete:qce}});var rS="/v0/investigations",q2e=["dashboard","monitor","service","slo","log-route","adaptive-notification-rule"],H2e=n.Object({type:n.String({description:'Kind of linked asset, e.g. "dashboard"'}),id:n.String({description:"Identifier of the linked asset"})}),K2e=n.Object({type:n.Enum(q2e,{description:"Kind of linked asset"}),id:p({allowEmpty:!1,description:"Identifier of the linked asset"})}),kc=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:vt,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(H2e,{description:"Assets (dashboards, monitors, \u2026) referenced by this investigation"}),creator:n.Optional(Se),updater:n.Optional(Se),createdAt:w({description:"Timestamp the investigation was created at."}),updatedAt:w({description:"Timestamp the investigation was last updated at."})},{title:"Investigation"}),nS=n.Object({name:p({allowEmpty:!1,description:"Human readable name shown for the investigation"}),slug:p({type:"kebab-case",allowEmpty:!1,description:'Immutable, unique identifier supplied by the creating agent, used to link the investigation back to the agent run, e.g. "incident-2024-06-payments-5xx". The agent should also emit this value in its telemetry.'}),contentMd:Ye(p({type:"long"}),{description:"Markdown content capturing the investigation notes and findings"}),tags:$t,owner:p({allowEmpty:!1,description:"Team ID owning the investigation"}),env:Ye(p({allowEmpty:!0}),{description:"Environment the investigation relates to"}),linkedAssets:n.Optional(n.Array(K2e,{maxItems:100,description:"Assets (dashboards, monitors, \u2026) referenced by this investigation"}))}),z2e={name:"Payments 5xx spike",slug:"incident-2024-06-payments-5xx",contentMd:`## Summary
|
|
@@ -318,7 +318,7 @@ ${a}`:`[${e}]`),a&&u?`${a}
|
|
|
318
318
|
${u}`:a||u}function N$(e,{maxDepth:t=1e3,numbersAsFloat:r=!1,strictTemporal:o=!1}={}){if(FS(e)!=="object")throw new TypeError("stringify can only be called with an object");let i=v$(0,e,"",t,r,o);return i[i.length-1]!==`
|
|
319
319
|
`?i+`
|
|
320
320
|
`:i}function aYe(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 cYe=v("cli.setup.codex")(function*(e,t,r,o){let i=yield*Jr,s=(0,k$.join)(e,".codex"),a=(0,k$.join)(s,"config.toml");yield*De(`Codex \u2192 ${a}`),yield*i.makeDirectory(s,{recursive:!0}).pipe(Rc("create",s));let u=yield*$f(a),l=yield*u===void 0?A({}):lt({try:()=>U$(u),catch:()=>new kn({message:`${a} is not valid TOML. Fix or remove it before re-running.`})}),d="otel"in l,{otel:g,...y}=l,E={...y,otel:aYe(t,r,o)},h=yield*Gf(a,u,yield*VR);yield*Ff(a,N$(E)),yield*De(h===void 0?" created":d?` replaced existing [otel] tables (backup: ${h})`:` appended (backup: ${h})`)}),Zde=P("codex",{endpoint:WR,ingestionApiKey:QR,includePrompts:ZR("user prompts")},v("cli.setup.codexCli")(function*(e){yield*cYe((0,Qde.homedir)(),e.endpoint.replace(/\/+$/,""),e.ingestionApiKey,e.includePrompts),yield*De(YR)})).pipe(U("Patch ~/.codex/config.toml with Tsuga OTEL settings (replaces any existing [otel] table)"));var Xde=P("setup").pipe(U("Configure local LLM CLIs to ship OTEL telemetry to Tsuga"),_e([Bde,Zde]));var Jde=Mn("contrast-sets","Compare two groups of spans and return the attribute values that separate them",MX);var tP=Fe("trace-id").pipe(X("Trace ID to summarize"),Ee("TRACE_ID"));var eme=P("latency-summary",{traceId:tP,...Yt,minRangeDurationMs:AY("min-range-duration-ms").pipe(X("Collapse timeline ranges shorter than this (default: max(1ms, 1% of trace duration); 0 disables collapsing)"),Ee("MILLISECONDS"),Je),ranges:qn("ranges").pipe(X("Include the per-range timeline; --no-ranges returns only services and serviceTotals"),_n(!0))},v("cli.traces.latencySummary")(function*(e){yield*xe(yield*tt(NX,{query:hn({traceId:e.traceId,...yield*zr(e),minRangeDurationMs:oe(e.minRangeDurationMs),includeRanges:e.ranges?void 0:!1})}))})).pipe(U("Summarize where wall-clock time is spent in a trace, attributed per service"));var uYe=["start_time","duration","context.service.name","span.name","status_code","trace_id"],tme=P("search",{...Yt,query:ip,maxResults:rg,pretty:lo},v("cli.traces.search")(function*(e){let t=yield*mn,{spans:r}=yield*Xt(nT,{query:yield*lg(e)});yield*t.rows(r,{...e,defaultFields:uYe})})).pipe(U("Search spans"));var rme=P("summarize",{traceId:tP,...Yt},v("cli.traces.summarize")(function*(e){yield*xe(yield*tt(wX,{query:{traceId:e.traceId,...yield*zr(e)}}))})).pipe(U("Summarize a trace by aggregating groups of similar spans into summary spans"));var nme=P("traces").pipe(U("Search and summarize traces"),_e([Jde,tme,rme,eme]));var ome="/logs",ime="/explorer",L$="/analytics";var sme=n.Object({id:n.String({description:"Code of the short link, the last path segment of `https://app.tsuga.com/l/<id>`."}),url:n.String({description:"Relative app URL (path and search) the short link opens. Search parameters use the app URL encoding: object and array values are JSON-stringified, then URL-encoded."}),expiresAt:w({description:"Timestamp after which the short link stops resolving."})},{$id:"ShortUrl",description:"A short link copied with **Copy page URL** on the Logs or Traces page, resolved to the app URL it opens. See [Share the current search](/documentation/explore/logs#share-the-current-search)."}),pYe={id:"aB3-dE5fG-h7J",url:"/logs?query=level%3Aerror&timeRange=%7B%22type%22%3A%22absolute%22%2C%22from%22%3A1767225600000%2C%22to%22%3A1767229200000%7D",expiresAt:"2026-02-01T00:00:00.000Z"};Object.assign(sme,{examples:[pYe]});var ame=f({description:"Resolves a short link copied from the Logs or Traces page to the app URL it opens, which carries the query, filters and time range. An expired or unknown code returns 404.",operationId:"getShortUrl",tags:["short-urls"],url:`/${"v1"}/short-urls/:id`,method:"GET",params:n.Object({id:p({allowEmpty:!1,description:"Code of the short link, the last path segment of `https://app.tsuga.com/l/<id>`."})}),response:sme});var cme=n.Object({id:n.String({description:"Code of the share link, the last path segment of `https://api.tsuga.com/v0/widget-shares/<orgId>/<id>`."}),title:n.Optional(n.String({description:"Name of the widget the link was shared from. Omitted when the widget had no name."})),search:n.String({description:"Analytics search parameters captured when the link was created, without the leading `?`. Values use the app URL encoding: object and array values are JSON-stringified, then URL-encoded. `timeZone` is the time zone of the user who created the link, which the shared image uses."}),dashboardId:n.Optional(n.String({description:"ID of the dashboard holding the shared widget. Omitted for Analytics shares."})),graphId:n.Optional(n.String({description:"ID of the shared widget on its dashboard. Omitted for Analytics shares."})),url:n.String({description:"Absolute app URL a signed-in browser opening the share link is redirected to: the widget on its dashboard, or Analytics. It carries no `timeZone`, so the app shows the result in the time zone of the viewer."}),expiresAt:w({description:"Timestamp after which the share link stops resolving."})},{$id:"WidgetShare",description:"A widget share link created from Analytics or a dashboard widget, with the query it renders. See [Share links](/documentation/visualize/analytics/index#share-links)."}),lYe={id:"kL9-mN2pQ-r4S",title:"Checkout errors",search:"source=logs&queries=%5B%7B%22aggregate%22%3A%7B%22type%22%3A%22count%22%7D%2C%22filter%22%3A%22service%3Acheckout%22%7D%5D&timeRange=%7B%22type%22%3A%22absolute%22%2C%22from%22%3A1767225600000%2C%22to%22%3A1767229200000%7D",dashboardId:"dashboard-123-abc",graphId:"graph-123-abc",url:"https://app.tsuga.com/dashboards/dashboard-123-abc?openedGraph=graph-123-abc&openedGraphReadonly=true&timeRange=%7B%22type%22%3A%22absolute%22%2C%22from%22%3A1767225600000%2C%22to%22%3A1767229200000%7D",expiresAt:"2026-02-01T00:00:00.000Z"};Object.assign(cme,{examples:[lYe]});var ume=f({description:"Resolves a widget share link, whose unfurl only shows an image, to the query behind it: widget title, Analytics search and dashboard. An expired or unknown code returns 404.",operationId:"getWidgetShare",tags:["public","widget-shares"],url:`/${"v1"}/widget-shares/:id`,method:"GET",params:n.Object({id:p({allowEmpty:!1,description:"Code of the share link, the last path segment of `https://api.tsuga.com/v0/widget-shares/<orgId>/<id>`."})}),response:cme});var dYe=/^\/l\/([^/]+)\/?$/,mYe=/^\/v0\/widget-shares\/[^/]+\/([^/]+?)(?:\/image\.png)?\/?$/,fYe={[ome]:"logs-explorer",[ime]:"logs-explorer","/traces":"traces-explorer",[L$]:"analytics"};function gYe(e){if(!URL.canParse(e))return;let t=new URL(e);if(t.protocol!=="https:"&&t.protocol!=="http:"||!hYe(t.hostname))return;let r=mYe.exec(t.pathname);if(r?.[1])return{type:"widget-share",code:decodeURIComponent(r[1])};if(t.hostname.startsWith("api."))return;let o=dYe.exec(t.pathname);return o?.[1]?{type:"explorer-short-link",origin:t.origin,code:decodeURIComponent(o[1])}:{type:"app-url",url:t}}function hYe(e){return e==="localhost"||e==="127.0.0.1"||["tsuga.com","tsuga-staging.com"].some(t=>e===t||e.endsWith(`.${t}`))}function M$(e,t,{search:r=t.search,...o}={}){return lt({try:()=>{let i=yYe(r);return"timeRange"in i&&(i.timeRange=EYe(i.timeRange)),{type:e,url:t.href,view:TYe(t.pathname),path:t.pathname,...o,searchParams:i}},catch:()=>new Wl({message:"The link contains an invalid time range."})})}function yYe(e){let t={};for(let[r,o]of new URLSearchParams(e))try{t[r]=JSON.parse(o)}catch{t[r]=o}return t}function EYe(e){if(e===null||typeof e!="object")return e;let{type:t,from:r,to:o}=e;return t!=="absolute"||typeof r!="number"||typeof o!="number"?e:{type:t,from:nc(ns(r)),to:nc(ns(o))}}function TYe(e){return e.startsWith("/dashboards/")?"dashboard":fYe[e]}var pme=P("unshorten",{url:Yr("URL").pipe(ur("A short link from Logs or Traces, a widget share link, or a full app.tsuga.com URL"))},v("cli.unshorten")(function*({url:e}){let t=yield*lt({try:()=>gYe(e.trim()),catch:()=>new Wl({message:"The link contains invalid URL encoding."})});if(t===void 0)return yield*new Wl({message:`Not a Tsuga short link, widget share link, or app URL: ${e}`,suggestions:["Pass a short link (https://app.tsuga.com/l/<code>), a widget share link (https://api.tsuga.com/v0/widget-shares/<orgId>/<code>), or an app.tsuga.com URL"]});switch(t.type){case"app-url":yield*xe({data:yield*M$("app-url",t.url)});return;case"explorer-short-link":{let r=yield*Xt(ame,{params:{id:t.code}});yield*xe({data:yield*M$("explorer-short-link",new URL(r.url,t.origin),{expiresAt:r.expiresAt})});return}case"widget-share":{let r=yield*Xt(ume,{params:{id:t.code}}),o=new URL(r.url);yield*xe({data:yield*M$("widget-share",o,{search:r.search,expiresAt:r.expiresAt,widget:{title:r.title,dashboardId:r.dashboardId,graphId:r.graphId,analyticsUrl:new URL(`${L$}?${r.search}`,o.origin).href}})});return}default:wt(t)}})).pipe(U("Expand a Tsuga short link or widget share link and decode its query, time range, and view"));var lme=Ede.pipe(_e([{group:"Resources",commands:hde},{group:"Query & explore",commands:[Bie,Xie,nme,sse,wde,Are,$de,woe,joe,Lie,zse,cse,jne,Ioe,pme]},{group:"Documentation, help & feedback",commands:[eoe,Aoe,kde]},{group:"Setup & config",commands:[Dne,Zne,Hne,Xde,$oe,Mde]}]),lx(uA,e=>e.fields),lx(pa,e=>({operationApiKey:oe(e.operationApiKey),cluster:oe(e.cluster),rationale:oe(e.rationale)})),iV(mn.pageLayer)),D$=lme.pipe(lx(NS,()=>({root:lme})));function dme(e,t){let r=e.split(".").map(Number),o=t.split(".").map(Number);for(let i=0;i<Math.max(r.length,o.length);i++){let s=(r[i]??0)-(o[i]??0);if(s!==0)return s}return 0}var SYe=3e3,_Ye="https://registry.npmjs.org/@tsuga/cli/latest",IYe=un({version:ye}),bYe=Lo(IYe),xYe=v("cli.checkForUpdate")(function*(e){let t=yield*gt,r=yield*Cl,o=yield*Fn,i=yield*t.getLastUpdateCheck;if(i&&o-Date.parse(i)<ca)return;let s=yield*r.get(_Ye).pipe(H(Dk),H(a=>a.json),H(bYe),qj(SYe),Gj);sn(s)||(dme(s.value.version,e)>0&&(yield*Yn(`
|
|
321
|
-
Update available: ${e} \u2192 ${s.value.version}`),yield*Yn("Run `tsuga self-update` to update")),yield*t.saveLastUpdateCheck(nc(ns(o))))}),mme=e=>za(xYe(e));f0(process.stdout);f0(process.stderr);var OYe=im(gt.layer,Wu.layer).pipe(sm(vf.layer),sm(wV),sm(cz)),F$=process.argv.slice(2),gme=F$.some(e=>["--help","-h","--version","-v","--completions","--wizard"].includes(e)),$$,hme=e=>{$$=e;for(let t of aA)process.removeListener(t,hme)};for(let e of aA)process.once(e,hme);var yme=Noe(process.stdout,process.stderr);process.on("exit",yme.release);var fme=Ok(D$,{version:"1.
|
|
321
|
+
Update available: ${e} \u2192 ${s.value.version}`),yield*Yn("Run `tsuga self-update` to update")),yield*t.saveLastUpdateCheck(nc(ns(o))))}),mme=e=>za(xYe(e));f0(process.stdout);f0(process.stderr);var OYe=im(gt.layer,Wu.layer).pipe(sm(vf.layer),sm(wV),sm(cz)),F$=process.argv.slice(2),gme=F$.some(e=>["--help","-h","--version","-v","--completions","--wizard"].includes(e)),$$,hme=e=>{$$=e;for(let t of aA)process.removeListener(t,hme)};for(let e of aA)process.once(e,hme);var yme=Noe(process.stdout,process.stderr);process.on("exit",yme.release);var fme=Ok(D$,{version:"1.164.0"})(F$).pipe(koe(yme)),AYe=gme?fme:jX(fme,F$,D$,()=>$$).pipe(eo(mme("1.164.0")));AYe.pipe(So(e=>mA(e)?eo(e.pipe($7,Yn),Z(()=>process.exitCode=lA(e))):fA(e)&&!gme?Z(()=>process.exitCode=Ar.usage):F(e)),hI(OYe),Yj(GX),xi(vV,!0),e=>rq(e,{teardown:(t,r)=>iu(t)&&ja(t.cause)?r(dA($$)):Rw(t,r)}));
|
|
322
322
|
/**
|
|
323
323
|
* The following is a list of HTTP status codes and their meanings.
|
|
324
324
|
*
|